parent-pom/pom.xml100664 21363 12500110374 14514 0ustarmbouschenstaff 0 0 org.apache apache 16 4.0.0 org.apache.jdo parent-pom 3.1 pom JDO PARENT The Java Data Objects (JDO) API is a standard interface-based Java model abstraction of persistence, developed as Java Specification Requests (JSR 12 and 243) under the auspices of the Java Community Process. http://db.apache.org/jdo 2005 scm:svn:http://svn.apache.org/repos/asf/db/jdo/tags/jdo-3.1/3.1 scm:svn:https://svn.apache.org/repos/asf/db/jdo/tags/jdo-3.1/3.1 http://svn.apache.org/viewvc/db/jdo/tags/jdo-3.1/3.1 Apache Software Foundation http://www.apache.org javax.jdo jdo-api 3.1 org.apache.jdo jdo-exectck 3.1 org.apache.jdo jdo-tck 3.1 org.apache.maven maven-plugin-api 2.0 javax.transaction transaction-api 1.1 org.apache.ant ant 1.7.0 test junit junit 3.8.1 org.eclipse.persistence javax.persistence 2.1.0 org.apache.derby derby 10.6.1.0 org.apache.derby derbytools 10.6.1.0 commons-io commons-io 1.4 org.springframework spring-core 2.0 org.springframework spring-beans 2.0 commons-collections commons-collections 3.2 commons-logging commons-logging 1.1 JDO User List jdo-user-subscribe@db.apache.org jdo-user-unsubscribe@db.apache.org http://mail-archives.apache.org/mod_mbox/db-jdo-user/ JDO Developer List jdo-dev-subscribe@db.apache.org jdo-dev-unsubscribe@db.apache.org http://mail-archives.apache.org/mod_mbox/db-jdo-dev/ JDO Commits List jdo-commits-subscribe@db.apache.org jdo-commits-unsubscribe@db.apache.org http://mail-archives.apache.org/mod_mbox/db-jdo-commits/ clr Craig Russell Craig.Russell@Sun.COM Sun Microsystems, Inc. -8 mbo Michael Bouschen mbo.tech@spree.de Tech@Spree Engineering GmbH 1 brazil Michael Watzek mwa.tech@spree.de Tech@Spree Engineering GmbH 1 mcaisse Michelle Caisse Michelle.Caisse@Sun.COM Apache.org -8 madams Matthew Adams matthew@matthewadams.me Apache.org -8 mzaun Martin Zaun martin.zaun@Sun.COM Sun Microsystems, Inc. -8 ebengtson Erik Bengtson erik@jpox.org JPOX 1 geirm Geir Magnusson, Jr. geirm@apache.org Apache.org -8 brianm Brian McCallister brianm@apache.org Apache.org -8 maven-compiler-plugin 2.3.2 1.5 1.5 maven-javadoc-plugin ${project.name} ${pom.currentVersion} ${project.name} ${pom.currentVersion} org.apache.maven.plugins maven-changes-plugin 2.6 ${basedir}/xdocs/changes.xml org.apache.maven.plugins maven-checkstyle-plugin 2.6 ${basedir}/../jdo_checks.xml ${basedir}/../LICENSE.txt org.apache.maven.plugins maven-deploy-plugin 2.6 false api/src/ 40775 0 12500110371 12330 5ustarmbouschenstaff 0 0 api/src/java/ 40775 0 12500110371 13251 5ustarmbouschenstaff 0 0 api/src/java/javax/ 40775 0 12500110371 14362 5ustarmbouschenstaff 0 0 api/src/java/javax/jdo/ 40775 0 12500110371 15136 5ustarmbouschenstaff 0 0 api/src/java/javax/jdo/annotations/ 40775 0 12500110371 17473 5ustarmbouschenstaff 0 0 api/src/java/javax/jdo/datastore/ 40775 0 12500110371 17124 5ustarmbouschenstaff 0 0 api/src/java/javax/jdo/identity/ 40775 0 12500110371 16767 5ustarmbouschenstaff 0 0 api/src/java/javax/jdo/listener/ 40775 0 12500110371 16763 5ustarmbouschenstaff 0 0 api/src/java/javax/jdo/metadata/ 40775 0 12500110371 16716 5ustarmbouschenstaff 0 0 api/src/java/javax/jdo/spi/ 40775 0 12500110371 15731 5ustarmbouschenstaff 0 0 api/src/main/ 40775 0 12500110371 13254 5ustarmbouschenstaff 0 0 api/src/main/resources/ 40775 0 12500110371 15266 5ustarmbouschenstaff 0 0 api/src/schema/ 40775 0 12500110371 13570 5ustarmbouschenstaff 0 0 api/src/schema/javax/ 40775 0 12500110371 14701 5ustarmbouschenstaff 0 0 api/src/schema/javax/jdo/ 40775 0 12500110371 15455 5ustarmbouschenstaff 0 0 api/test/ 40775 0 12500110371 12520 5ustarmbouschenstaff 0 0 api/test/java/ 40775 0 12500110371 13441 5ustarmbouschenstaff 0 0 api/test/java/javax/ 40775 0 12500110371 14552 5ustarmbouschenstaff 0 0 api/test/java/javax/jdo/ 40775 0 12500110371 15326 5ustarmbouschenstaff 0 0 api/test/java/javax/jdo/annotations/ 40775 0 12500110371 17663 5ustarmbouschenstaff 0 0 api/test/java/javax/jdo/identity/ 40775 0 12500110371 17157 5ustarmbouschenstaff 0 0 api/test/java/javax/jdo/listener/ 40775 0 12500110371 17153 5ustarmbouschenstaff 0 0 api/test/java/javax/jdo/pc/ 40775 0 12500110371 15730 5ustarmbouschenstaff 0 0 api/test/java/javax/jdo/schema/ 40775 0 12500110371 16566 5ustarmbouschenstaff 0 0 api/test/java/javax/jdo/spi/ 40775 0 12500110371 16121 5ustarmbouschenstaff 0 0 api/test/java/javax/jdo/stub/ 40775 0 12500110371 16303 5ustarmbouschenstaff 0 0 api/test/java/javax/jdo/util/ 40775 0 12500110371 16303 5ustarmbouschenstaff 0 0 api/test/resources/ 40775 0 12500110370 14531 5ustarmbouschenstaff 0 0 api/test/resources/enhancer-test-dir/ 40775 0 12500110370 20045 5ustarmbouschenstaff 0 0 api/test/resources/enhancer-test-dir/enhancer-test-subdir/ 40775 0 12500110370 24073 5ustarmbouschenstaff 0 0 api/test/resources/META-INF/ 40775 0 12500110370 15671 5ustarmbouschenstaff 0 0 api/test/resources/META-INF/services/ 40775 0 12500110370 17514 5ustarmbouschenstaff 0 0 api/test/schema/ 40775 0 12500110371 13760 5ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/ 40775 0 12500110370 15721 5ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Negative00/ 40775 0 12500110370 17623 5ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Negative00/META-INF/ 40775 0 12500110370 20763 5ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Negative01/ 40775 0 12500110370 17624 5ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Negative01/META-INF/ 40775 0 12500110370 20764 5ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Negative02/ 40775 0 12500110370 17625 5ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Negative02/META-INF/ 40775 0 12500110370 20765 5ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Negative03/ 40775 0 12500110370 17626 5ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Negative03/META-INF/ 40775 0 12500110370 20766 5ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Negative04/ 40775 0 12500110370 17627 5ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Negative04/META-INF/ 40775 0 12500110370 20767 5ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Negative05/ 40775 0 12500110370 17630 5ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Negative05/META-INF/ 40775 0 12500110370 20770 5ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Negative06/ 40775 0 12500110370 17631 5ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Negative06/6a/ 40775 0 12500110370 20137 5ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Negative06/6a/META-INF/ 40775 0 12500110370 21277 5ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Negative06/6b/ 40775 0 12500110370 20140 5ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Negative06/6b/META-INF/ 40775 0 12500110370 21300 5ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Negative07/ 40775 0 12500110370 17632 5ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Negative07/META-INF/ 40775 0 12500110370 20772 5ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Negative07/META-INF/services/ 40775 0 12500110370 22615 5ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Negative08/ 40775 0 12500110370 17633 5ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Negative08/META-INF/ 40775 0 12500110370 20773 5ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Negative08/META-INF/services/ 40775 0 12500110370 22616 5ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Negative09/ 40775 0 12500110370 17634 5ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Negative09/9a/ 40775 0 12500110370 20145 5ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Negative09/9a/META-INF/ 40775 0 12500110370 21305 5ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Negative09/9a/META-INF/services/ 40775 0 12500110370 23130 5ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Negative09/9b/ 40775 0 12500110370 20146 5ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Negative09/9b/META-INF/ 40775 0 12500110370 21306 5ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Negative09/9b/META-INF/services/ 40775 0 12500110370 23131 5ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Pmfmapmap01/ 40775 0 12500110370 20000 5ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Pmfmapmap01/META-INF/ 40775 0 12500110370 21140 5ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Pmfmapmap02/ 40775 0 12500110370 20001 5ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Positive00/ 40775 0 12500110370 17663 5ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Positive00/META-INF/ 40775 0 12500110370 21023 5ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Positive01/ 40775 0 12500110370 17664 5ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Positive01/1a/ 40775 0 12500110370 20165 5ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Positive01/1a/META-INF/ 40775 0 12500110370 21325 5ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Positive01/1b/ 40775 0 12500110370 20166 5ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Positive01/1b/META-INF/ 40775 0 12500110370 21326 5ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Positive02/ 40775 0 12500110370 17665 5ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Positive02/META-INF/ 40775 0 12500110370 21025 5ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Positive03/ 40775 0 12500110370 17666 5ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Positive03/META-INF/ 40775 0 12500110370 21026 5ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Positive03/META-INF/services/ 40775 0 12500110370 22651 5ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Positive04/ 40775 0 12500110370 17667 5ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Positive04/META-INF/ 40775 0 12500110370 21027 5ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Positive04/META-INF/services/ 40775 0 12500110370 22652 5ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Positive05/ 40775 0 12500110370 17670 5ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Positive05/META-INF/ 40775 0 12500110370 21030 5ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Positive05/META-INF/services/ 40775 0 12500110370 22653 5ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Positive06/ 40775 0 12500110370 17671 5ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Positive06/META-INF/ 40775 0 12500110370 21031 5ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Positive07/ 40775 0 12500110370 17672 5ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Positive07/META-INF/ 40775 0 12500110370 21032 5ustarmbouschenstaff 0 0 api/pom.xml100664 15350 12500110370 13176 0ustarmbouschenstaff 0 0 org.apache.jdo parent-pom 3.1 ../parent-pom 4.0.0 javax.jdo jdo-api JDO API 3.1 The Java Data Objects (JDO) API is a standard interface-based Java model abstraction of persistence, developed as Java Specification Request 243 under the auspices of the Java Community Process. scm:svn:http://svn.apache.org/repos/asf/db/jdo/tags/jdo-3.1/3.1 scm:svn:https://svn.apache.org/repos/asf/db/jdo/tags/jdo-3.1/3.1 http://svn.apache.org/viewvc/db/jdo/tags/jdo-3.1/3.1 src/java test/java META-INF src/main/resources ${basedir}/src/java javax/jdo/*.properties ${basedir}/src/schema javax/jdo/*.dtd javax/jdo/*.xsd ${basedir}/test/resources **/* ${basedir}/test/schema **/*.jdo **/*.jdoquery **/*.orm **/jdoconfig.xml org.apache.maven.plugins maven-source-plugin org.apache.maven.plugins maven-compiler-plugin 2.0.2 true true -Xlint:unchecked 1.5 1.5 org.apache.felix maven-bundle-plugin 2.3.7 bundle-manifest prepare-package manifest JDO 3.1 javax.jdo plugin ${project.parent.project.url} javax.transaction;resolution:=optional, * maven-jar-plugin ${project.build.outputDirectory}/META-INF/MANIFEST.MF maven-javadoc-plugin ${project.name} ${pom.currentVersion} ${project.name} ${pom.currentVersion} maven-surefire-plugin javax/jdo/util/AbstractTest.java javax/jdo/pc/*.java **/*Test.java javax.transaction transaction-api org.apache.ant ant test junit junit test maven-changes-plugin ${basedir}/xdocs/changes.xml maven-checkstyle-plugin ${basedir}/../jdo_checks.xml ${basedir}/../LICENSE.txt api/src/java/javax/jdo/annotations/Cacheable.java100664 2566 12500110371 22273 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Annotation to specify that this class/field/property is cacheable * in a Level 2 cache. * This corresponds to the xml attribute "cacheable" of the "class", "field" * and "property" elements. * @version 2.2 * @since 2.2 */ @Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) public @interface Cacheable { String value() default "true"; }api/src/java/javax/jdo/annotations/Column.java100664 6350 12500110371 21674 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Annotation for a column in the database. * Corresponds to the xml element "column". * * @version 2.1 * @since 2.1 */ @Target({ElementType.FIELD, ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) public @interface Column { /** * Name of the column. * @return the name of the column */ String name() default ""; /** * Target column for this column in the other table when part of a * foreign key relation. * @return the target column in the other table for this column * when part of a foreign key relation. */ String target() default ""; /** * Target member in the other class or interface for this column * when part of a bidirectional relation. * @return the target member for this column when part of * a bidirectional relation. */ String targetMember() default ""; /** * JDBC Type for this column. * @return JDBC type for this column */ String jdbcType() default ""; /** * SQL Type for this column. * @return SQL type for this column */ String sqlType() default ""; /** * Maximum length of data stored in this column. * @return the maximum length of data stored in this column */ int length() default -1; /** * Scale for the column when handling floating point values. * @return the scale for the column when handling floating point values */ int scale() default -1; /** * Whether the column allows null values to be inserted. * @return whether the column allows null values to be inserted */ String allowsNull() default ""; /** * Default value for this column. * @return the default value for this column */ String defaultValue() default ""; /** * Value to be inserted when this is an "unmapped" column * @return the value to be inserted when this is an "unmapped" column */ String insertValue() default ""; /** Vendor extensions. * @return the vendor extensions */ Extension[] extensions() default {}; /** * Position of this column in the table for this class (0=first, -1=unset). * @return (relative) position of this column * @since 3.1 */ int position() default -1; } api/src/java/javax/jdo/annotations/Columns.java100664 2437 12500110371 22061 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Annotation for a group of columns. * * @version 2.1 * @since 2.1 */ @Target({ElementType.FIELD, ElementType.METHOD, ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) public @interface Columns { /** The columns annotation information. * @return the columns */ Column[] value(); } api/src/java/javax/jdo/annotations/DatastoreIdentity.java100664 4500 12500110371 24072 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Annotation for the datastore identity of the class. * Corresponds to the xml element "datastore-identity" of the "class" element. * * @version 2.1 * @since 2.1 */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) public @interface DatastoreIdentity { /** * Strategy to use when generating datastore identities * @return Strategy to use when generating datastore identities */ IdGeneratorStrategy strategy() default IdGeneratorStrategy.UNSPECIFIED; /** Custom strategy to use to generate the value for the identity. * If customStrategy is non-empty, then strategy must be UNSPECIFIED. * @return the custom strategy */ String customStrategy() default ""; /** * Name of sequence to use when the strategy involves sequences * @return Name of sequence to use when the strategy involves sequences */ String sequence() default ""; /** * Name of the column for the datastore identity * @return Name of the column for the datastore identity */ String column() default ""; /** * The column(s) making up the datastore identity. * @return The column(s) making up the datastore identity. */ Column[] columns() default {}; /** Vendor extensions. * @return the vendor extensions */ Extension[] extensions() default {}; } api/src/java/javax/jdo/annotations/Discriminator.java100664 4710 12500110371 23244 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Annotation for the discriminator of the class. * Corresponds to the xml element "discriminator" of the "inheritance" element. * * @version 2.1 * @since 2.1 */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) public @interface Discriminator { /** * Strategy to use for the discriminator. The discriminator determines * the class associated with a row in the datastore. * @return the strategy to use for the discriminator */ DiscriminatorStrategy strategy() default DiscriminatorStrategy.UNSPECIFIED; /** Custom strategy to use for the discriminator. * If customStrategy is non-empty, then strategy must be UNSPECIFIED. * @return the custom strategy */ String customStrategy() default ""; /** * Whether the discriminator is indexed. * @return whether the discriminator is indexed */ String indexed() default ""; /** * Name of the column for the discriminator * @return the name of the column for the discriminator */ String column() default ""; /** * The value for the discriminator for objects of this class * when using "value-map" strategy. * @return The value for the discriminator for objects of this class * when using "value-map" strategy */ String value() default ""; /** * The column(s) making up the discriminator. * @return the column(s) making up the discriminator */ Column[] columns() default {}; } api/src/java/javax/jdo/annotations/DiscriminatorStrategy.java100664 2000 12500110371 24755 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.annotations; /** * Enumeration of the discriminator strategy values. * * @version 2.1 * @since 2.1 */ public enum DiscriminatorStrategy { UNSPECIFIED, NONE, VALUE_MAP, CLASS_NAME } api/src/java/javax/jdo/annotations/Element.java100664 11122 12500110371 22041 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Annotation for the element of a collection/array relation. * Corresponds to the xml element "element". * * @version 2.1 * @since 2.1 */ @Target({ElementType.FIELD, ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) public @interface Element { /** * Types of the elements. This can be determined if using JDK1.5 generics * but is required otherwise. Multiple types can be specified if the * implementation supports multiple types. * @return the types of elements */ Class[] types() default {}; /** * Whether the element is to be stored serialized (into a join table) * @return whether the element is to be stored serialized * (into a join table) */ String serialized() default ""; /** Whether this element is embedded. * @return whether this element is embedded */ String embedded() default ""; /** * The embedded mapping for the element. * @return the embedded mapping for the element */ Embedded[] embeddedMapping() default {}; /** * Whether the element is dependent on the owner, and will be deleted * when the owner is deleted. * @return whether the element is dependent on the owner, and will be * deleted when the owner is deleted */ String dependent() default ""; /** * Name of the table for the element. * @return name of the table for the element */ String table() default ""; /** * Name of the column to store the element in. * @return name of the column to store the element in */ String column() default ""; /** * Delete action to apply to any foreign key for the element. * @return delete action to apply to any foreign key for the element */ ForeignKeyAction deleteAction() default ForeignKeyAction.UNSPECIFIED; /** * Update action to apply to any foreign key for the element * @return update action to apply to any foreign key for the element */ ForeignKeyAction updateAction() default ForeignKeyAction.UNSPECIFIED; /** * Whether the value column(s) should be indexed. * @return whether the value column(s) should be indexed. */ String indexed() default ""; /** The name of the index to generate. * @return the name of the index */ String index() default ""; /** * Whether a unique constraint should be generated or assumed. * @return whether a unique constraint should be generated or assumed */ String unique() default ""; /** * The name of the unique key constraint to generate. * @return the name of the unique key constraint */ String uniqueKey() default ""; /** * Name of the member in the target class that forms a bidirectional * relationship with this member. * @return name of the member in the target class that forms a bidirectional * relationship with this member */ String mappedBy() default ""; /** * The column(s) for the element. * @return the column(s) for the element */ Column[] columns() default {}; /** Generate or assume a foreign key constraint exists on the column * or columns associated with this join. Specify "true" or "false". * @return whether to generate or assume a primary key constraint */ String generateForeignKey() default ""; /** Name for a generated foreign key constraint. * @return the name of the generated foreign key constraint */ String foreignKey() default ""; /** Vendor extensions. * @return the vendor extensions */ Extension[] extensions() default {}; } api/src/java/javax/jdo/annotations/Embedded.java100664 4330 12500110371 22124 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Annotation to define that the object is embedded into the table of the * owning object. * Corresponds to the xml element "embedded". * * @version 2.1 * @since 2.1 */ @Target({ElementType.FIELD, ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) public @interface Embedded { /** The member in the embedded object that links back to the owning object * where it has a bidirectional relationship. * @return the member that refers to the owner */ String ownerMember() default ""; /** The column in the embedded object used to judge if the embedded object * is null. * @return the null indicator column */ String nullIndicatorColumn() default ""; /** The value in the null column to interpret the object as being null. * @return the null indicator value */ String nullIndicatorValue() default ""; /** Members for this embedding. * @return the members embedded in the field or property being annotated */ Persistent[] members() default {}; /** * Discriminator for cases where the embedded object has inheritance. * @return the discriminator for inheritance determination */ Discriminator discriminatorColumnName() default @Discriminator; } api/src/java/javax/jdo/annotations/EmbeddedOnly.java100664 2415 12500110371 22770 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Annotation for whether the class is only for persisting embedded into * another object. * Same as specifying @PersistenceCapable(embeddedOnly="true"). * * @version 2.1 * @since 2.1 */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) public @interface EmbeddedOnly { } api/src/java/javax/jdo/annotations/Extension.java100664 3053 12500110371 22410 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Annotation for a JDO vendor extension. * Corresponds to the xml element "extension". * * @version 2.1 * @since 2.1 */ @Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) public @interface Extension { /** Vendor that the extension applies to (required). * @return the vendor */ String vendorName(); /** The key for the extension (required). * @return the key */ String key(); /** The value for the extension (required). * @return the value */ String value(); } api/src/java/javax/jdo/annotations/Extensions.java100664 2435 12500110371 22576 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Annotation for a group of extensions * * @version 2.1 * @since 2.1 */ @Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) public @interface Extensions { /** * The extensions. * @return the extensions */ Extension[] value(); } api/src/java/javax/jdo/annotations/FetchGroup.java100664 3554 12500110371 22510 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Annotation for the fetch group of a class. * Corresponds to the xml element "fetch-group". * * @version 2.1 * @since 2.1 */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) public @interface FetchGroup { /** * Name of the fetch group. * @return the name of the fetch group */ String name() default ""; /** * Whether we should load this group as part of the post load process. * @return whether we should load this group as part of the post load * process. */ String postLoad() default ""; /** * Members (fields and properties) of the fetch group. The members * should contain only name and recursionDepth. * @return members for the fetch group */ Persistent[] members(); /** * Fetch groups to be nested (included) in this fetch group. */ String[] fetchGroups() default {}; } api/src/java/javax/jdo/annotations/FetchGroups.java100664 2402 12500110371 22662 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Annotation for a group of fetch-group objects * * @version 2.1 * @since 2.1 */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) public @interface FetchGroups { /** * The Fetch Groups * @return The Fetch Groups */ FetchGroup[] value(); } api/src/java/javax/jdo/annotations/FetchPlan.java100664 3451 12500110371 22302 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Annotation for the fetch plan of a persistence manager, query, or extent. * Corresponds to the xml element "fetch-plan". * * @version 2.1 * @since 2.1 */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) public @interface FetchPlan { /** * Name of the fetch plan. * @return the name of the fetch plan */ String name() default ""; /** * The fetch groups in this fetch plan. * @return the fetch groups */ String[] fetchGroups() default {}; /** * The depth of references to instantiate, starting with the root object. * @return the maxium fetch depth */ int maxFetchDepth() default 1; /** * The number of instances of multi-valued fields retrieved by queries. * @return the fetch size */ int fetchSize() default 0; } api/src/java/javax/jdo/annotations/FetchPlans.java100664 2374 12500110371 22470 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Annotation for a group of FetchPlan objects * * @version 2.1 * @since 2.1 */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) public @interface FetchPlans { /** * The Fetch Plans * @return The Fetch Plans */ FetchPlan[] value(); } api/src/java/javax/jdo/annotations/ForeignKey.java100664 5303 12500110371 22476 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Annotation for a database foreign-key. * Corresponds to the xml element "foreign-key". * * @version 2.1 * @since 2.1 */ @Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) public @interface ForeignKey { /** Name of the foreign key. * @return the name of the foreign key */ String name() default ""; /** Table for the foreign key. This is needed iff annotating a type where * the foreign key is not defined on the primary table for the type. * @return the table on which the foreign key is defined */ String table() default ""; /** Whether this foreign key is deferred * (constraint is checked only at commit). * @return whether this foreign key is deferred */ String deferred() default ""; /** Whether this foreign key is unique. * @return whether this foreign key is unique */ String unique() default ""; /** The delete action of this foreign key. * @return the delete action of this foreign key */ ForeignKeyAction deleteAction() default ForeignKeyAction.RESTRICT; /** The update action of this foreign key. * @return the update action of this foreign key */ ForeignKeyAction updateAction() default ForeignKeyAction.RESTRICT; /** Member (field and property) names that compose this foreign key. * @return the member names that compose this foreign key */ String[] members() default {}; /** Columns that compose this foreign key. * @return the columns that compose this foreign key */ Column[] columns() default {}; /** Vendor extensions. * @return the vendor extensions */ Extension[] extensions() default {}; } api/src/java/javax/jdo/annotations/ForeignKeyAction.java100664 2030 12500110371 23626 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.annotations; /** * Enumeration of the foreign-key delete/update action values. * * @version 2.1 * @since 2.1 */ public enum ForeignKeyAction { UNSPECIFIED, RESTRICT, CASCADE, NULL, DEFAULT, NONE } api/src/java/javax/jdo/annotations/ForeignKeys.java100664 2410 12500110371 22655 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Annotation for a group of foreign-key constraints. * * @version 2.1 * @since 2.1 */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) public @interface ForeignKeys { /** * The foreign keys. * @return The foreign keys */ ForeignKey[] value(); } api/src/java/javax/jdo/annotations/IdentityType.java100664 1765 12500110371 23077 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.annotations; /** * Enumeration of the identity type values. * * @version 2.1 * @since 2.1 */ public enum IdentityType { UNSPECIFIED, APPLICATION, DATASTORE, NONDURABLE } api/src/java/javax/jdo/annotations/IdGeneratorStrategy.java100664 2050 12500110371 24356 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.annotations; /** * Enumeration of the id generator strategy values. * * @version 2.1 * @since 2.1 */ public enum IdGeneratorStrategy { UNSPECIFIED, NATIVE, SEQUENCE, IDENTITY, INCREMENT, UUIDSTRING, UUIDHEX } api/src/java/javax/jdo/annotations/Index.java100664 4174 12500110371 21510 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Annotation for a database index. Used for database schema * generation to create indexes. * Corresponds to the xml element "index". * * @version 2.1 * @since 2.1 */ @Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) public @interface Index { /** Name of the index * @return the name of the index */ String name() default ""; /** Table for the index. This is needed iff annotating a type where * the index is not defined on the primary table for the type. * @return the table on which the index is defined */ String table() default ""; /** Whether this index is unique * @return whether this index is unique */ String unique() default ""; /** Member (field and property) names that compose this index. * @return member names that compose this index */ String[] members() default {}; /** Columns that compose this index. * @return columns that compose this index */ Column[] columns() default {}; /** Vendor extensions. * @return the vendor extensions */ Extension[] extensions() default {}; } api/src/java/javax/jdo/annotations/Indices.java100664 2356 12500110371 22017 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Annotation for a group of index constraints. * * @version 2.1 * @since 2.1 */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) public @interface Indices { /** * The indices * @return The indices */ Index[] value(); } api/src/java/javax/jdo/annotations/Inheritance.java100664 3271 12500110371 22667 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Annotation for the inheritance of the class. * Corresponds to the xml element "inheritance" of the "class" * and "interface" elements. * * @version 2.1 * @since 2.1 */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) public @interface Inheritance { /** Strategy to use for inheritance. Specifies in which table(s) * the members for the class are stored. * @return the inheritance strategy */ InheritanceStrategy strategy() default InheritanceStrategy.UNSPECIFIED; /** Custom inheritance strategy. If customStrategy is non-empty, then * strategy must be UNSPECIFIED. * @return the custom inheritance strategy */ String customStrategy() default ""; } api/src/java/javax/jdo/annotations/InheritanceStrategy.java100664 2040 12500110371 24403 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.annotations; /** * Enumeration of the inheritance strategy values. * * @version 3.1 * @since 2.1 */ public enum InheritanceStrategy { UNSPECIFIED, NEW_TABLE, SUBCLASS_TABLE, SUPERCLASS_TABLE, COMPLETE_TABLE } api/src/java/javax/jdo/annotations/Join.java100664 6750 12500110371 21342 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Annotation for the join of a relation. * Corresponds to the xml element "join". * * @version 2.1 * @since 2.1 */ @Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) public @interface Join { /** Table to join to (used when joining to secondary tables). * @return the table */ String table() default ""; /** Name of the column in the join table. * @return the name of the column in the join table */ String column() default ""; /** Whether the join column is indexed. * @return whether the join column(s) is(are) indexed */ String indexed() default ""; /** The name of the index to generate. * @return the name of the index */ String index() default ""; /** Whether the join column is unique. * @return whether the join column(s) is(are) is unique */ String unique() default ""; /** * The name of the unique key constraint to generate. * @return the name of the unique key constraint */ String uniqueKey() default ""; /** Whether to use an outer join. * @return whether to use an outer join */ String outer() default ""; /** Delete action to be applied to any ForeignKey on this join. * @return the delete action */ ForeignKeyAction deleteAction() default ForeignKeyAction.UNSPECIFIED; /** Detail definition of the join column(s). This is needed for * more than one join column. * @return the join columns */ Column[] columns() default {}; /** Generate or assume a primary key constraint exists on the column * or columns associated with this join. Specify "true" or "false". * @return whether to generate or assume a primary key constraint */ String generatePrimaryKey() default ""; /** Name for a generated primary key constraint. * @return the name of the generated primary key constraint */ String primaryKey() default ""; /** Generate or assume a foreign key constraint exists on the column * or columns associated with this join. Specify "true" or "false". * @return whether to generate or assume a foreign key constraint */ String generateForeignKey() default ""; /** Name for a generated foreign key constraint. * @return the name of the generated foreign key constraint */ String foreignKey() default ""; /** Vendor extensions. * @return the vendor extensions */ Extension[] extensions() default {}; } api/src/java/javax/jdo/annotations/Joins.java100664 2764 12500110371 21526 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Annotation for a group of joins. * * @version 2.1 * @since 2.1 */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) public @interface Joins { /** * The join definitions used for the mapping of this type. Joins for * secondary tables are usually defined at the type level and not the * field or property level. This allows multiple fields and properties * to share the same join definition and avoid redundancies. * @return the join definitions */ Join[] value(); } api/src/java/javax/jdo/annotations/Key.java100664 10556 12500110371 21212 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Annotation for the key of a map relation. * Corresponds to the xml element "key". * * @version 2.1 * @since 2.1 */ @Target({ElementType.FIELD, ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) public @interface Key { /** * Types of the keys. This can be determined if using JDK1.5 generics * but is required otherwise. Multiple types can be specified if the * implementation supports multiple types. * @return the types of keys */ Class[] types() default {}; /** * Whether the key is to be stored serialized (into a single column of a * join table). * @return whether the key is to be stored serialized */ String serialized() default ""; /** Whether this key is embedded. * @return whether this key is embedded */ String embedded() default ""; /** * The embedded mapping for the key. * @return the embedded mapping for the key */ Embedded[] embeddedMapping() default {}; /** * Whether the key is dependent on the owner (and will be deleted * when the owner is deleted). * @return whether the key is dependent on the owner */ String dependent() default ""; /** * Name of the table for the key. * @return name of the table for the key */ String table() default ""; /** * Name of the column to store the key in. * @return name of the column to store the key in */ String column() default ""; /** * Delete action to apply to the foreign key for the key. * @return delete action to apply to the foreign key for the key */ ForeignKeyAction deleteAction() default ForeignKeyAction.UNSPECIFIED; /** * Update action to apply to the foreign key for the key. * @return update action to apply to the foreign key for the key */ ForeignKeyAction updateAction() default ForeignKeyAction.UNSPECIFIED; /** * Whether the value column(s) should be indexed. * @return whether the value column(s) should be indexed. */ String indexed() default ""; /** The name of the index to generate. * @return the name of the index */ String index() default ""; /** * Whether the element column(s) contents should be considered unique * @return whether the element column(s) contents should be considered unique */ String unique() default ""; /** * The name of the unique key constraint to generate. * @return the name of the unique key constraint */ String uniqueKey() default ""; /** * Name of a member in the value class where this key is stored. * @return the name of a member in the value class where this key is stored */ String mappedBy() default ""; /** * The column(s) for the key * @return the column(s) for the key */ Column[] columns() default {}; /** Generate or assume a foreign key constraint exists on the column * or columns associated with this join. Specify "true" or "false". * @return whether to generate or assume a foreign key constraint */ String generateForeignKey() default ""; /** Name for a generated foreign key constraint. * @return the name of the generated foreign key constraint */ String foreignKey() default ""; /** Vendor extensions. * @return the vendor extensions */ Extension[] extensions() default {}; } api/src/java/javax/jdo/annotations/NotPersistent.java100664 2561 12500110371 23260 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Annotation to specify that the member is not persistent. If used, this is * the only JDO annotation allowed on a member. * This corresponds to the xml attribute persistence-modifier="none" of the * "field" and "property" elements. * @version 2.1 * @since 2.1 */ @Target({ElementType.FIELD, ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) public @interface NotPersistent { } api/src/java/javax/jdo/annotations/NullValue.java100664 2073 12500110371 22344 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.annotations; /** * Enumeration of the "null-value" behavior values. * This corresponds to the "null-value" attribute of the "field" * and "property" elements. * * @version 2.1 * @since 2.1 */ public enum NullValue { NONE, EXCEPTION, DEFAULT } api/src/java/javax/jdo/annotations/Order.java100664 3754 12500110371 21517 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Annotation for the ordering component of an ordered container member, * such as Java Collections Framework Array and List types and Java native * array types. * Corresponds to the xml element "order". * * @version 2.1 * @since 2.1 */ @Target({ElementType.FIELD, ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) public @interface Order { /** The name of the column to use for ordering the elements of the member. * @return the name of the ordering column */ String column() default ""; /** Name of a field or property in the target class that acts as the * ordering field or property for this member. * Return the name of the field or property in the target class */ String mappedBy() default ""; /** The definition of the column(s) to use for ordering. * @return the columns to use for ordering */ Column[] columns() default {}; /** Vendor extensions. * @return the vendor extensions */ Extension[] extensions() default {}; } api/src/java/javax/jdo/annotations/PersistenceAware.java100664 2536 12500110371 23705 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Annotation to specify that the class is persistence-aware. If used, this is * the only JDO annotation allowed on the class. * This corresponds to the xml attribute * persistence-modifier="persistence-aware" of the "class" element. * @version 2.1 * @since 2.1 */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) public @interface PersistenceAware { } api/src/java/javax/jdo/annotations/PersistenceCapable.java100664 5323 12500110371 24172 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Annotation for whether the class or interface is persistence-capable. * * @version 2.1 * @since 2.1 */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) public @interface PersistenceCapable { /** Member declarations. Annotations for persistent members of this * class or interface can be specifed either here or on each member. * Annotations for inherited members can only be specified here. * @return member declarations */ Persistent[] members() default {}; /** Table to use for persisting this class or interface. */ String table() default ""; /** Catalog to use for persisting this class or interface. */ String catalog() default ""; /** Schema to use for persisting this class or interface. */ String schema() default ""; /** Whether this class or interface manages an extent. */ String requiresExtent() default ""; /** Whether objects of this class or interface can only be embedded. */ String embeddedOnly() default ""; /** Whether this class or interface is detachable. */ String detachable() default ""; /** Type of identity for this class or interface. */ IdentityType identityType() default IdentityType.UNSPECIFIED; /** Primary key class when using application identity and using own PK. */ Class objectIdClass() default void.class; /** Whether this class is cacheable in a Level2 cache. * @since 2.2 */ String cacheable() default "true"; /** Whether objects of this type should, by default, be locked when read. * @since 3.0 */ String serializeRead() default "false"; /** Any vendor extensions. */ Extension[] extensions() default {}; } api/src/java/javax/jdo/annotations/PersistenceModifier.java100664 2177 12500110371 24405 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.annotations; /** * Enumeration of the persistence-modifier values for a field or property. * This corresponds to the "persistence-modifier" attribute of the * "field" and "property" elements. * * @version 2.1 * @since 2.1 */ public enum PersistenceModifier { UNSPECIFIED, PERSISTENT, TRANSACTIONAL, NONE } api/src/java/javax/jdo/annotations/Persistent.java100664 17240 12500110371 22617 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Annotation for defining the persistence of a member. * This corresponds to the xml elements "field" and "property". * * @version 2.1 * @since 2.1 */ @Target({ElementType.FIELD, ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) public @interface Persistent { /** Modifier for this field. This is normally not specified, and the * defaults are used, or the @Transactional or @NotPersistent * annotation is specified directly on the member. One possible use * for specifying persistenceModifier is for embedded instances in which * a member is not persistent but in the non-embedded instances the * member is persistent. Note that it is not portable to specify a * member to be not persistent in the non-embedded case and persistent * in the embedded usage. * @return the persistence modifier */ PersistenceModifier persistenceModifier() default PersistenceModifier.UNSPECIFIED; /** Table to use for persisting this member. * @return the table to use for persisting this member */ String table() default ""; /** Whether this member is in the default fetch group. * @return whether this member is in the default fetch group */ String defaultFetchGroup() default ""; /** Behavior when this member contains a null value. * @return the behavior when this member contains a null value */ NullValue nullValue() default NullValue.NONE; /** Whether this member is embedded. * @return whether this member is embedded */ String embedded() default ""; /** Whether the elements of this member are embedded. * @return whether the elements of this member are embedded */ String embeddedElement() default ""; /** Whether the keys of this member are embedded. * @return whether the keys of this member are embedded */ String embeddedKey() default ""; /** Whether the values of this member are embedded. * @return whether the values of this member are embedded */ String embeddedValue() default ""; /** Whether this member is serialized into a single column. * @return whether this member is serialized into a single column */ String serialized() default ""; /** Whether the elements of this member are serialized. * @return whether the elements of this member are serialized */ String serializedElement() default ""; /** Whether the keys of this member are serialized. * @return whether the keys of this member are serialized */ String serializedKey() default ""; /** Whether the values of this member are serialized. * @return whether the values of this member are serialized */ String serializedValue() default ""; /** Whether related object(s) of this member are dependent * and so deleted when this object is deleted. * @return whether the related object(s) of this member * are dependent */ String dependent() default ""; /** Whether the elements of this member are dependent. * @return whether the elements of this member are dependent */ String dependentElement() default ""; /** Whether the keys of this member are dependent. * @return whether the keys of this member are dependent */ String dependentKey() default ""; /** Whether the values of this member are dependent. * @return whether the values of this member are dependent */ String dependentValue() default ""; /** Whether this member is part of the primary key for application * identity. This is equivalent to specifying @PrimaryKey as * a separate annotation on the member. * @return whether this member is part of the primary key */ String primaryKey() default ""; /** Value strategy to use to generate the value for this field * or property (if any). * @return the generated value strategy */ IdGeneratorStrategy valueStrategy() default IdGeneratorStrategy.UNSPECIFIED; /** Custom value strategy to use to generate the value for this field * or property (if any). If customValueStrategy is non-empty, then * valueStrategy must be UNSPECIFIED. * @return the custom value strategy */ String customValueStrategy() default ""; /** Name of the sequence to use with particular value strategies. * @return the name of the sequence */ String sequence() default ""; /** Name of the fetch-group to use when this member is loaded * due to being referenced when not already loaded. * @return the name of the load fetch group */ String loadFetchGroup() default ""; /** Types of the member. Used when the declared * member type is a supertype of the actual type that is stored in the * member. For example, the declared member type might be an interface type * that must contain an object of a concrete type when used * for persistence. * @return the types */ Class[] types() default {}; /** Name of the related member in the other class * where this value is mapped (bidirectional relationship). * @return the related member in the other class */ String mappedBy() default ""; /** Column definition(s) for this member. Used for mapping * multiple columns * to the same member, for example relationships with * multiple column foreign keys. * @return the columns for this member */ Column[] columns() default {}; /** Column name where the values are stored for this member. * @return the name of the column */ String column() default ""; /** Null indicator column for this member. Used for nested * embedded fields or properties to indicate whether the embedded * instance should have a null value. * @return the null indicator column */ String nullIndicatorColumn() default ""; /** Name of the member when this is embedded in another object. * The fully-qualified member name is used. For example, * "line.point1.x" refers to the member x in class Point * that is embedded as member point1 in class Line that is embedded * in a member called line. * @return the name of the member */ String name() default ""; /** Recursion depth for this member. Used only when * the annotation is used within the definition of a FetchGroup. * @return the recursion depth */ int recursionDepth() default 1; /** Whether this field/property is cacheable in a Level2 cache. * @since 2.2 */ String cacheable() default "true"; /** Vendor extensions for this member. * @return the vendor extensions */ Extension[] extensions() default {}; } api/src/java/javax/jdo/annotations/PrimaryKey.java100664 3704 12500110371 22533 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Annotation on a member to define it as a primary key member of a class or * persistent interface using application identity. * Also used to define the primary key columns of a secondary table. * Corresponds to the xml element "primary-key". * * @version 2.1 * @since 2.1 */ @Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) public @interface PrimaryKey { /** * Name of the primary key constraint * @return the name of the primary key constraint */ String name() default ""; /** * Name of the column to use for the primary key * @return the name of the column to use for the primary key */ String column() default ""; /** * The column(s) for the primary key * @return the column(s) for the primary key */ Column[] columns() default {}; /** Vendor extensions. * @return the vendor extensions */ Extension[] extensions() default {}; } api/src/java/javax/jdo/annotations/Queries.java100664 2366 12500110371 22057 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Annotation for a group of named queries. * * @version 2.1 * @since 2.1 */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) public @interface Queries { /** * The named queries * @return The named queries */ Query[] value(); } api/src/java/javax/jdo/annotations/Query.java100664 4232 12500110371 21541 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Annotation for a named query. * Corresponds to the xml element "query". * * @version 2.1 * @since 2.1 */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) public @interface Query { /** Name of the query (mandatory) * @return the name of the query */ String name(); /** The query string (mandatory) * @return the query string */ String value(); /** The query language * @return the query language */ String language() default "JDOQL"; /** Whether the query is unmodifiable. * @return whether the query is unmodifiable */ String unmodifiable() default ""; /** Whether the query returns a single unique result. * @return whether the query returns a single unique result */ String unique() default ""; /** Result class into which to put the results. * @return the class of the result */ Class resultClass() default void.class; /** The name of the fetch plan used by this query * @return the fetch plan */ String fetchPlan() default ""; /** Vendor extensions. * @return the vendor extensions */ Extension[] extensions() default {}; } api/src/java/javax/jdo/annotations/Sequence.java100664 4302 12500110371 22202 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Annotation for a datastore sequence. * Maps across to the JDO2 element "sequence". * * @version 2.1 * @since 2.1 */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) public @interface Sequence { /** The symbolic name of the datastore sequence. * @return the name of the sequence */ String name(); /** Strategy for the sequence. * @return the strategy for the sequence */ SequenceStrategy strategy(); /** Name of the sequence in the datastore. * @return the name of the datastore sequence */ String datastoreSequence() default ""; /** Name of a factory class for generating the sequence values. * @return the name of the factory class for the sequence */ Class factoryClass() default void.class; /** Vendor extensions for this sequence. * @return vendor extensions */ Extension[] extensions() default {}; /** * Initial value for the sequence. * @return Initial value for the sequence * @since 3.1 */ int initialValue() default 1; /** * Allocation size for the sequence. * @return Allocation size for the sequence * @since 3.1 */ int allocationSize() default 50; } api/src/java/javax/jdo/annotations/SequenceStrategy.java100664 1765 12500110371 23737 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.annotations; /** * Enumeration of the sequence strategy values. * * @version 2.1 * @since 2.1 */ public enum SequenceStrategy { NONTRANSACTIONAL, CONTIGUOUS, NONCONTIGUOUS } api/src/java/javax/jdo/annotations/Serialized.java100664 2657 12500110371 22540 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Annotation on a member (field or property) to indicate that * the member is stored serialized. Such a member cannot be queried using * JDOQL. * Corresponds to xml attribute "serialized" in "field" and "property" * elements. * This is the same as specifying @Persistent(serialized="true"). * * @version 2.1 * @since 2.1 */ @Target({ElementType.FIELD, ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) public @interface Serialized { } api/src/java/javax/jdo/annotations/Transactional.java100664 2531 12500110371 23236 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Annotation to indicate that a member (field or property) * is transactional but not persistent. * This corresponds to xml attribute persistence-modifier="transactional" of * "field" and "property" elements. * @version 2.1 * @since 2.1 */ @Target({ElementType.FIELD, ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) public @interface Transactional { } api/src/java/javax/jdo/annotations/Unique.java100664 4700 12500110371 21702 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Annotation for a database unique constraint. Used for database schema * generation to create unique constraints. Also used to reorder database * operations when flushing changes to avoid unique constraint violations. * Corresponds to the xml element "unique". * * @version 2.1 * @since 2.1 */ @Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) public @interface Unique { /** Name of the unique constraint. * @return the name of the unique constraint */ String name() default ""; /** Table for the unique constraint. This is needed iff annotating a type * where this unique constraint is not for the primary table for * the persistent class or interface. * @return the table on which the unique constraint is defined */ String table() default ""; /** Whether this unique constraint is deferred until commit. * @return whether this unique constraint is deferred until commit */ String deferred() default ""; /** Member (field and property) names that compose this unique constraint. * @return member names that compose this unique constraint */ String[] members() default {}; /** Columns that compose this unique constraint. * @return columns that compose this unique constraint */ Column[] columns() default {}; /** Vendor extensions. * @return the vendor extensions */ Extension[] extensions() default {}; } api/src/java/javax/jdo/annotations/Uniques.java100664 2407 12500110371 22067 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Annotation for a group of unique constraints. * * @version 2.1 * @since 2.1 */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) public @interface Uniques { /** * The unique constraints. * @return The unique constraints */ Unique[] value(); } api/src/java/javax/jdo/annotations/Value.java100664 10671 12500110371 21534 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Annotation for the value of a map relation. * Corresponds to the xml element "value". * * @version 2.1 * @since 2.1 */ @Target({ElementType.FIELD, ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) public @interface Value { /** * Types of the values. This can be determined if using JDK1.5 generics * but is required otherwise. Multiple types can be specified if the * implementation supports multiple types. * @return the types of values */ Class[] types() default {}; /** * Whether the value is to be stored serialized (into a single column of a * join table). * @return Whether the value is to be stored serialized (into a join table) */ String serialized() default ""; /** Whether this value is embedded. * @return whether this value is embedded */ String embedded() default ""; /** * The embedded mapping for the value. * @return the embedded mapping for the value */ Embedded[] embeddedMapping() default {}; /** * Whether the value is dependent on the owner (and will be deleted * when the owner is deleted). * @return whether the value is dependent on the owner */ String dependent() default ""; /** * Name of the table for the value. * @return the name of the table for the value */ String table() default ""; /** * Name of the column to store the value in. * @return the name of the column to store the value in */ String column() default ""; /** * Delete action to apply to any foreign key for the value. * @return delete action to apply to any foreign key for the value */ ForeignKeyAction deleteAction() default ForeignKeyAction.UNSPECIFIED; /** * Update action to apply to any foreign key for the value. * @return update action to apply to any foreign key for the value */ ForeignKeyAction updateAction() default ForeignKeyAction.UNSPECIFIED; /** * Whether the value column(s) should be indexed. * @return whether the value column(s) should be indexed. */ String indexed() default ""; /** The name of the index to generate. * @return the name of the index */ String index() default ""; /** * Whether the element column(s) contents should be considered unique * @return whether the element column(s) contents should be considered unique */ String unique() default ""; /** * The name of the unique key constraint to generate. * @return the name of the unique key constraint */ String uniqueKey() default ""; /** * Name of a member in the key class where this value is stored. * @return the name of a member in the key class where this value is stored */ String mappedBy() default ""; /** * The column(s) for the value. * @return the column(s) for the value */ Column[] columns() default {}; /** Generate or assume a foreign key constraint exists on the column * or columns associated with this join. Specify "true" or "false". * @return whether to generate or assume a foreign key constraint */ String generateForeignKey() default ""; /** Name for a generated foreign key constraint. * @return the name of the generated foreign key constraint */ String foreignKey() default ""; /** Vendor extensions. * @return the vendor extensions */ Extension[] extensions() default {}; } api/src/java/javax/jdo/annotations/Version.java100664 4403 12500110371 22061 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Annotation for the versioning of the class. * Corresponds to the xml element "version" of the "class" and "property" * elements. * * @version 2.1 * @since 2.1 */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) public @interface Version { /** * Strategy for versioning of objects of this class. * @return the strategy for versioning objects of this class */ VersionStrategy strategy() default VersionStrategy.UNSPECIFIED; /** * Custom strategy for versioning of objects of this class. * If customStrategy is non-empty, strategy must be UNSPECIFIED. * @return the custom strategy for versioning objects of this class */ String customStrategy() default ""; /** * Name of the column for the version. * @return the name of the column for the version */ String column() default ""; /** * Whether the version column(s) is(are) indexed. * @return whether the version column(s) is(are) indexed */ String indexed() default ""; /** * The column(s) making up the version. * @return the column(s) making up the version */ Column[] columns() default {}; /** Vendor extensions. * @return the vendor extensions */ Extension[] extensions() default {}; } api/src/java/javax/jdo/annotations/VersionStrategy.java100664 2011 12500110371 23575 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.annotations; /** * Enumeration of the version strategy values. * * @version 2.1 * @since 2.1 */ public enum VersionStrategy { UNSPECIFIED, NONE, STATE_IMAGE, DATE_TIME, VERSION_NUMBER } api/src/java/javax/jdo/Bundle.properties100664 23374 12500110371 20613 0ustarmbouschenstaff 0 0 # # 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. # ResourceBundle properties file for JDO ERR_AbstractClassNoIdentity=Abstract class {0} does not implement key field helper methods ERR_CannotInitCause=The initCause method cannot be used. To set the cause of this exception, \ use a constructor with a Throwable[] argument. ERR_StateManagerClassCast=An element of the parameter collection is of class {0}. \ The parameter collection must contain only elements that are instances of java.lang.Class. ERR_NoMetadata=No metadata has been registered for class {0}. EXC_GetPMFNoSuchMethod=Method getPersistenceManagerFactory(Map) on class {0} does not exist or is not public. EXC_GetPMFNoSuchMethod2=Method getPersistenceManagerFactory(Map,Map) on class {0} does not exist or is not public. EXC_GetPMFInvocationTargetException=Method getPersistenceManagerFactory(..) on class {0} threw exception. EXC_GetPMFUnexpectedException=Unexpected exception caught. EXC_GetPMFClassNotFound=Class {0} was not found. EXC_GetPMFIllegalAccess=Illegal Access for class {0}. EXC_GetPMFNoPMFClassNamePropertyOrPUNameProperty=A property named javax.jdo.PersistenceManagerFactoryClass must be specified, \ or a jar file with a META-INF/services/javax.jdo.PersistenceManagerFactory entry must be in the classpath, \ or a property named javax.jdo.option.PersistenceUnitName must be specified. EXC_IOExceptionDuringServiceLookup=IO error while attempting to lookup PMF name \ via META-INF/services/javax.jdo.PersistenceManagerFactory MSG_FailedObject=FailedObject: MSG_NestedThrowables=NestedThrowables: MSG_NestedThrowablesStackTrace=NestedThrowablesStackTrace: MSG_ExceptionGettingFailedToString=Exception getting failed.toString(): ''{0}''. MSG_ExceptionGettingFailedToStringObjectId=Exception getting failed.toString(): ''{0}''. ObjectId of failed instance: ''{1}''. ERR_NullClass=JDO implementation error: the parameter class object must not be null. EXC_GetPMFNullResource: The resource name argument to this method cannot be null. EXC_GetPMFNullLoader: The class loader argument to this method cannot be null. EXC_GetPMFNullPropsLoader: The class loader argument to this method cannot be null. EXC_GetPMFNullPMFLoader: The class loader argument to this method cannot be null. EXC_GetPMFNullStream: The stream argument to this method cannot be null. EXC_GetPMFNullPMF: The PMF {0} returned null to getPersistenceManagerFactory. EXC_GetPMFNoResource: The resource named "{0}" could not be found in the class loader "{1}". EXC_GetPMFIOExceptionRsrc: An IOException was thrown while loading the resource \ named "{0}" into a java.util.Properties object. EXC_GetPMFIOExceptionStream: An IOException was thrown while loading the stream \ into a java.util.Properties object. EXC_GetPMFNullFile: The file argument to this method cannot be null. EXC_GetPMFNoFile: The file named "{0}" could not be found. EXC_GetPMFIOExceptionFile: An IOException was thrown while loading the file \ named "{0}" into a java.util.Properties object. EXC_GetPMFNullJndiLoc: The JNDI location argument to this method cannot be null. EXC_GetPMFNamingException: A NamingException was thrown while obtaining the \ PersistenceManagerFactory at "{0}" from JNDI. EXC_GetPMFNullPointerException: The PersistenceManagerFactory class must define a static \ method \nPersistenceManagerFactory getPersistenceManagerFactory(Map props). \nThe class "{0}"\n\ defines a non-static getPersistenceManagerFactory(Map props) method. EXC_GetPMFClassCastException: The PersistenceManagerFactory class must define a static \ method \nPersistenceManagerFactory getPersistenceManagerFactory(Map props). \nThe class "{0}"\n\ has the wrong return type for the getPersistenceManagerFactory(Map props) method. EXC_StringWrongLength: There must be exactly one character in the id in the input String for CharIdentity. EXC_IllegalEventType:The event type is outside the range of valid event types. EXC_SingleFieldIdentityNullParameter: The identity must not be null. EXC_ObjectIdentityStringConstruction: The identity instance could not be constructed. \ \nThe exception thrown was: "{0}". \ \nParsed the class name as "{1}" and key as "{2}". EXC_ObjectIdentityStringConstructionNoDelimiter: Missing delimiter ":". EXC_ObjectIdentityStringConstructionTooShort: Parameter is too short. EXC_ObjectIdentityStringConstructionUsage: The instance could not be constructed \ from the parameter String "{0}". \ \nThe parameter String is of the form ":". EXC_CreateKeyAsObjectMustNotBeCalled: The method createKeyAsObject must not be called \ because the keyAsObject field must never be null for this class. EXC_CurrencyStringConstructorIllegalArgument: The instance could not be constructed \ with the argument "{0}". Try "USD". EXC_CurrencyStringConstructorException: An exception was thrown during construction \ of the Currency instance. EXC_LocaleStringConstructorException: An exception was thrown during construction \ of the Locale instance. EXC_DateStringConstructor: Error parsing Date string "{0}" at position {1} \ using date format "{2}". MSG_unknown: unknown EXC_DuplicateRequestedNamedPMFFoundInDifferentConfigs: Duplicate \ PMF name "{0}" found in {1} and {2}. EXC_DuplicateRequestedNamedPMFFoundInSameConfig: Duplicate PMF \ name "{0}" found in {1}. EXC_UnableToInvokeCreateEMFMethod: Unable to invoke \ javax.persistence.Persistence.createEntityManagerFactory(String). EXC_UnableToCastEMFToPMF: Unable to cast EntityManagerFactory class {0} \ to javax.jdo.PersistenceManagerFactory. ERR_NoDocumentBuilderFactory: Unable to instantiate \ javax.xml.parsers.DocumentBuilderFactory. EXC_ParserConfigException: Encountered parser configuration exception while \ getting javax.xml.parsers.DocumentBuilder. EXC_SAXParseException: Exception parsing configuration {0}\ at line {1}, column {2}. EXC_SAXException: Exception parsing configuration {0}. EXC_DuplicatePropertyFound: Duplicate property name "{0}" found in PMF \ configuration with name "{1}" found in {2}. EXC_DuplicatePMFNamePropertyFoundWithinConfig: Duplicate \ PMF name found in {2}: attribute is "{0}", element is "{1}". EXC_PropertyElementHasNoNameAttribute: Found element with no \ "name" attribute in {0}. EXC_PropertyElementNameAttributeHasNoValue: Found element name \ attribute "{0}" with no value in {1}. EXC_DuplicatePropertyNameGivenInPropertyElement: Duplicate property name given \ in property element: name {0} in {1}. EXC_MissingListenerAttribute: Required \ attribute "listener" missing in {0}. EXC_MissingListenerAttributeValue: attribute \ "listener" missing value in {0}. EXC_InvalidJDOConfigNoRoot: No root element found in {0}. EXC_NoPMFConfigurableViaPropertiesOrXML: No PersistenceManagerFactory \ configurable via properties resource "{0}" or no named PMF or persistence unit \ named "{0}" found. EXC_JavaxPersistencePersistenceAbsentOrNoPUFound=\ Class javax.persistence.Persistence or one of its dependencies was not found, \ or the given persistence unit name "{0}" was not found. EXC_GetEnhancerNoValidEnhancerAvailable=\ There are {0} services entries for the JDOEnhancer; \ there were no valid JDOEnhancer implementations found in the CLASSPATH. \ The file META-INF/services/javax.jdo.JDOEnhancer should name the implementation class. MSG_EnhancerUsage=\ Usage: java -cp javax.jdo.Enhancer \n\ options:\n\ \t? (print this message and exit)\n\ \t-h (print this message and exit)\n\ \t-help (print this message and exit)\n\ \t-cp (use the class path with its own class loader)\n\ \t-pu (look for the persistence unit in META-INF/persistence.xml)\n\ \t-d (write enhanced classes with package structure into this directory)\n\ \t-checkonly (do not enhance; just check)\n\ \t-verbose (output detail information)\n\ \t-v (output detail information)\n\ \t-r (recursively descend into parameter directories)\n\ files:\n\ \tfiles and directories to be enhanced, including .class and .jdo files ERR_EnhancerRequiredArgumentMissing=Required Argument Missing. ERR_EnhancerUnrecognizedOption=Enhancer unrecognized option {0}. MSG_EnhancerProcessing=Enhancer Processing {0}. MSG_EnhancerValidatedClasses=Enhancer validated {0} classes. MSG_EnhancerEnhancedClasses=Enhancer enhanced {0} classes. MSG_EnhancerClass=Enhancer found JDOEnhancer of class {0}. MSG_EnhancerJarFileName=Enhancer adding jar file {0}. MSG_EnhancerJDOFileName=Enhancer adding jdo file {0}. MSG_EnhancerClassFileName=Enhancer adding class file {0}. MSG_EnhancerPersistenceUnitName=Enhancer adding Persistence Unit {0}. MSG_EnhancerClassPath=Enhancer processing classpath {0}. MSG_EnhancerOutputDirectory=Enhancer processing output directory {0}. ERR_EnhancerBadClassPath=Enhancer cannot construct URL from path {0}. MSG_EnhancerProperty:Enhancer property key:{0} value:{1}. EXC_UnknownStandardProperty=The property {0} begins with javax.jdo but is not a recognized standard JDO property. EXC_UnknownStandardProperties=Multiple properties begin with javax.jdo but are not recognized standard JDO properties: {0} api/src/java/javax/jdo/Constants.java100664 76343 12500110371 20107 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo; /** * Constant values used in JDO. * * @since 2.1 * @version 3.0 */ public interface Constants { /** * The JDO standard package name. * @since 3.1 */ static String JAVAX_JDO = "javax.jdo"; /** * The JDO standard property string and option string prefix. */ static String JAVAX_JDO_PREFIX = JAVAX_JDO + "."; /** * The name of the standard service configuration resource text file containing * the name of an implementation of {@link PersistenceManagerFactory}. * Constant value is META-INF/services/javax.jdo.PersistenceManagerFactory. * * @since 2.1 */ static String SERVICE_LOOKUP_PMF_RESOURCE_NAME = "META-INF/services/javax.jdo.PersistenceManagerFactory"; /** * The name of the standard service configuration resource text file containing * the name of an enhancer of {@link JDOEnhancer}. * Constant value is META-INF/services/javax.jdo.JDOEnhancer. * @since 3.0 */ static String SERVICE_LOOKUP_ENHANCER_RESOURCE_NAME = "META-INF/services/javax.jdo.JDOEnhancer"; /** * The name of the standard JDO configuration resource file(s). * Constant value is META-INF/jdoconfig.xml. * * @since 2.1 */ static String JDOCONFIG_RESOURCE_NAME = "META-INF/jdoconfig.xml"; /** * The standard JDO configuration schema namespace. * Constant value is http://java.sun.com/xml/ns/jdo/jdoconfig. * * @since 2.1 */ static String JDOCONFIG_XSD_NS = "http://java.sun.com/xml/ns/jdo/jdoconfig"; /** * The standard JDO metadata schema namespace. * Constant value is http://java.sun.com/xml/ns/jdo/jdo. * * @since 2.1 */ static String JDO_XSD_NS = "http://java.sun.com/xml/ns/jdo/jdo"; /** * The standard JDO object-repository mapping schema namespace. * Constant value is http://java.sun.com/xml/ns/jdo/orm. * * @since 2.1 */ static String ORM_XSD_NS = "http://java.sun.com/xml/ns/jdo/orm"; /** * The standard JDO query schema namespace. * Constant value is http://java.sun.com/xml/ns/jdo/jdoquery. * * @since 2.1 */ static String JDOQUERY_XSD_NS = "http://java.sun.com/xml/ns/jdo/jdoquery"; /** * The name of the persistence manager factory element in the JDO * configuration file. * Constant value is persistence-manager-factory. * * @since 2.1 */ static String ELEMENT_PERSISTENCE_MANAGER_FACTORY = "persistence-manager-factory"; /** * The name of the persistence manager factory element's "class" attribute. * * @since 2.1 */ static String PMF_ATTRIBUTE_CLASS = "class"; /** * The name of the persistence manager factory element's * "name" attribute. * * @since 2.1 */ static String PMF_ATTRIBUTE_NAME = "name"; /** * The name of the persistence manager factory element's * "persistence-unit-name" attribute. * * @since 2.1 */ static String PMF_ATTRIBUTE_PERSISTENCE_UNIT_NAME = "persistence-unit-name"; /** * The name of the persistence manager factory element's "optimistic" * attribute. * * @since 2.1 */ static String PMF_ATTRIBUTE_OPTIMISTIC = "optimistic"; /** * The name of the persistence manager factory element's "readonly" * attribute. * * @since 2.2 */ static String PMF_ATTRIBUTE_READONLY = "readonly"; /** * The name of the persistence manager factory element's "retain-values" * attribute. * * @since 2.1 */ static String PMF_ATTRIBUTE_RETAIN_VALUES = "retain-values"; /** * The name of the persistence manager factory element's "restore-values" * attribute. * * @since 2.1 */ static String PMF_ATTRIBUTE_RESTORE_VALUES = "restore-values"; /** * The name of the persistence manager factory element's "ignore-cache" * attribute. * * @since 2.1 */ static String PMF_ATTRIBUTE_IGNORE_CACHE = "ignore-cache"; /** * The name of the persistence manager factory element's * "nontransactional-read" attribute. * * @since 2.1 */ static String PMF_ATTRIBUTE_NONTRANSACTIONAL_READ = "nontransactional-read"; /** * The name of the persistence manager factory element's * "nontransactional-write" attribute. * * @since 2.1 */ static String PMF_ATTRIBUTE_NONTRANSACTIONAL_WRITE = "nontransactional-write"; /** * The name of the persistence manager factory element's "multithreaded" * attribute. * * @since 2.1 */ static String PMF_ATTRIBUTE_MULTITHREADED = "multithreaded"; /** * The name of the persistence manager factory element's * "connection-driver-name" attribute. * * @since 2.1 */ static String PMF_ATTRIBUTE_CONNECTION_DRIVER_NAME = "connection-driver-name"; /** * The name of the persistence manager factory element's * "connection-user-name" attribute. * * @since 2.1 */ static String PMF_ATTRIBUTE_CONNECTION_USER_NAME = "connection-user-name"; /** * The name of the persistence manager factory element's * "connection-password" attribute. * * @since 2.1 */ static String PMF_ATTRIBUTE_CONNECTION_PASSWORD = "connection-password"; /** * The name of the persistence manager factory element's "connection-url" * attribute. * * @since 2.1 */ static String PMF_ATTRIBUTE_CONNECTION_URL = "connection-url"; /** * The name of the persistence manager factory element's * "connection-factory-name" attribute. * * @since 2.1 */ static String PMF_ATTRIBUTE_CONNECTION_FACTORY_NAME = "connection-factory-name"; /** * The name of the persistence manager factory element's * "connection-factory2-name" attribute. * * @since 2.1 */ static String PMF_ATTRIBUTE_CONNECTION_FACTORY2_NAME = "connection-factory2-name"; /** * The name of the persistence manager factory element's * "detach-all-on-commit" attribute. * * @since 2.1 */ static String PMF_ATTRIBUTE_DETACH_ALL_ON_COMMIT = "detach-all-on-commit"; /** * The name of the persistence manager factory element's * "copy-on-attach" attribute. * * @since 2.1 */ static String PMF_ATTRIBUTE_COPY_ON_ATTACH = "copy-on-attach"; /** * The name of the persistence manager factory element's "mapping" * attribute. * * @since 2.1 */ static String PMF_ATTRIBUTE_MAPPING = "mapping"; /** * The name of the persistence manager factory element's * "server-time-zone-id" attribute. * * @since 2.1 */ static String PMF_ATTRIBUTE_SERVER_TIME_ZONE_ID = "server-time-zone-id"; /** * The name of the persistence manager factory element's * "datastore-read-timeout-millis" attribute. * * @since 3.0 */ static String PMF_ATTRIBUTE_DATASTORE_READ_TIMEOUT_MILLIS = "datastore-read-timeout-millis"; /** * The name of the persistence manager factory element's * "datastore-write-timeout-millis" attribute. * * @since 3.0 */ static String PMF_ATTRIBUTE_DATASTORE_WRITE_TIMEOUT_MILLIS = "datastore-write-timeout-millis"; /** * The name of the persistence manager factory property elements in the JDO * configuration file. */ static String ELEMENT_PROPERTY = "property"; /** * The name of the persistence manager factory property element's "name" * attribute. */ static String PROPERTY_ATTRIBUTE_NAME = "name"; /** * The name of the persistence manager factory property element's "value" * attribute. */ static String PROPERTY_ATTRIBUTE_VALUE = "value"; /** * The name of the instance lifecycle listener element in the JDO * configuration file. */ static String ELEMENT_INSTANCE_LIFECYCLE_LISTENER = "instance-lifecycle-listener"; /** * The name of the instance lifecycle listener element's "listener" * attribute. */ static String INSTANCE_LIFECYCLE_LISTENER_ATTRIBUTE_LISTENER = "listener"; /** * The name of the instance lifecycle listener element's "classes" * attribute. */ static String INSTANCE_LIFECYCLE_LISTENER_ATTRIBUTE_CLASSES = "classes"; /** * "javax.jdo.option.TransientTransactional" * * @see PersistenceManagerFactory#supportedOptions() * @since 2.1 */ static String OPTION_TRANSACTIONAL_TRANSIENT = "javax.jdo.option.TransientTransactional"; /** * "javax.jdo.option.NontransactionalRead" * * @see PersistenceManagerFactory#supportedOptions() * @since 2.1 */ static String OPTION_NONTRANSACTIONAL_READ = "javax.jdo.option.NontransactionalRead"; /** * "javax.jdo.option.NontransactionalWrite" * * @see PersistenceManagerFactory#supportedOptions() * @since 2.1 */ static String OPTION_NONTRANSACTIONAL_WRITE = "javax.jdo.option.NontransactionalWrite"; /** * "javax.jdo.option.RetainValues" * * @see PersistenceManagerFactory#supportedOptions() * @since 2.1 */ static String OPTION_RETAIN_VALUES = "javax.jdo.option.RetainValues"; /** * "javax.jdo.option.Optimistic" * * @see PersistenceManagerFactory#supportedOptions() * @since 2.1 */ static String OPTION_OPTIMISTIC = "javax.jdo.option.Optimistic"; /** * "javax.jdo.option.ApplicationIdentity" * * @see PersistenceManagerFactory#supportedOptions() * @since 2.1 */ static String OPTION_APPLICATION_IDENTITY = "javax.jdo.option.ApplicationIdentity"; /** * "javax.jdo.option.DatastoreIdentity" * * @see PersistenceManagerFactory#supportedOptions() * @since 2.1 */ static String OPTION_DATASTORE_IDENTITY = "javax.jdo.option.DatastoreIdentity"; /** * "javax.jdo.option.NonDurableIdentity" * * @see PersistenceManagerFactory#supportedOptions() * @since 2.1 */ static String OPTION_NONDURABLE_IDENTITY = "javax.jdo.option.NonDurableIdentity"; /** * "javax.jdo.option.ArrayList" * * @see PersistenceManagerFactory#supportedOptions() * @since 2.1 */ static String OPTION_ARRAYLIST = "javax.jdo.option.ArrayList"; /** * "javax.jdo.option.LinkedList" * * @see PersistenceManagerFactory#supportedOptions() * @since 2.1 */ static String OPTION_LINKEDLIST = "javax.jdo.option.LinkedList"; /** * "javax.jdo.option.TreeMap" * * @see PersistenceManagerFactory#supportedOptions() * @since 2.1 */ static String OPTION_TREEMAP = "javax.jdo.option.TreeMap"; /** * "javax.jdo.option.TreeSet" * * @see PersistenceManagerFactory#supportedOptions() * @since 2.1 */ static String OPTION_TREESET = "javax.jdo.option.TreeSet"; /** * "javax.jdo.option.Vector" * * @see PersistenceManagerFactory#supportedOptions() * @since 2.1 */ static String OPTION_VECTOR = "javax.jdo.option.Vector"; /** * "javax.jdo.option.Array" * * @see PersistenceManagerFactory#supportedOptions() * @since 2.1 */ static String OPTION_ARRAY = "javax.jdo.option.Array"; /** * "javax.jdo.option.NullCollection" * * @see PersistenceManagerFactory#supportedOptions() * @since 2.1 */ static String OPTION_NULL_COLLECTION = "javax.jdo.option.NullCollection"; /** * "javax.jdo.option.ChangeApplicationIdentity" * * @see PersistenceManagerFactory#supportedOptions() * @since 2.1 */ static String OPTION_CHANGE_APPLICATION_IDENTITY = "javax.jdo.option.ChangeApplicationIdentity"; /** * "javax.jdo.option.BinaryCompatibility" * * @see PersistenceManagerFactory#supportedOptions() * @since 2.1 */ static String OPTION_BINARY_COMPATIBILITY = "javax.jdo.option.BinaryCompatibility"; /** * "javax.jdo.option.GetDataStoreConnection" * * @see PersistenceManagerFactory#supportedOptions() * @since 2.1 */ static String OPTION_GET_DATASTORE_CONNECTION = "javax.jdo.option.GetDataStoreConnection"; /** * "javax.jdo.option.GetJDBCConnection" * * @see PersistenceManagerFactory#supportedOptions() * @since 2.1 */ static String OPTION_GET_JDBC_CONNECTION = "javax.jdo.option.GetJDBCConnection"; /** * "javax.jdo.query.SQL" * * @see PersistenceManagerFactory#supportedOptions() * @since 2.1 */ static String OPTION_QUERY_SQL = "javax.jdo.query.SQL"; /** * "javax.jdo.option.QueryCancel" * * @see PersistenceManagerFactory#supportedOptions() * @since 3.0 */ static String OPTION_QUERY_CANCEL = "javax.jdo.option.QueryCancel"; /** * "javax.jdo.option.DatastoreTimeout" * * @see PersistenceManagerFactory#supportedOptions() * @since 3.0 */ static String OPTION_DATASTORE_TIMEOUT = "javax.jdo.option.DatastoreTimeout"; /** * "javax.jdo.option.UnconstrainedQueryVariables" * * @see PersistenceManagerFactory#supportedOptions() * @since 2.1 */ static String OPTION_UNCONSTRAINED_QUERY_VARIABLES = "javax.jdo.option.UnconstrainedQueryVariables"; /** * "javax.jdo.option.version.DateTime" * * @see PersistenceManagerFactory#supportedOptions() * @since 2.1 */ static String OPTION_VERSION_DATETIME = "javax.jdo.option.version.DateTime"; /** * "javax.jdo.option.version.StateImage" * * @see PersistenceManagerFactory#supportedOptions() * @since 2.1 */ static String OPTION_VERSION_STATE_IMAGE = "javax.jdo.option.version.StateImage"; /** * "javax.jdo.option.PreDirtyEvent" * * @see PersistenceManagerFactory#supportedOptions() * @since 2.1 */ static String OPTION_PREDIRTY_EVENT = "javax.jdo.option.PreDirtyEvent"; /** * "javax.jdo.option.mapping.HeterogeneousObjectType" * * @see PersistenceManagerFactory#supportedOptions() * @since 2.1 */ static String OPTION_MAPPING_HETEROGENEOUS_OBJECT_TYPE = "javax.jdo.option.mapping.HeterogeneousObjectType"; /** * "javax.jdo.option.mapping.HeterogeneousInterfaceType" * * @see PersistenceManagerFactory#supportedOptions() * @since 2.1 */ static String OPTION_MAPPING_HETEROGENEOUS_INTERFACE_TYPE = "javax.jdo.option.mapping.HeterogeneousInterfaceType"; /** * "javax.jdo.option.mapping.JoinedTablePerClass" * * @see PersistenceManagerFactory#supportedOptions() * @since 2.1 */ static String OPTION_MAPPING_JOINED_TABLE_PER_CLASS = "javax.jdo.option.mapping.JoinedTablePerClass"; /** * "javax.jdo.option.mapping.JoinedTablePerConcreteClass" * * @see PersistenceManagerFactory#supportedOptions() * @since 2.1 */ static String OPTION_MAPPING_JOINED_TABLE_PER_CONCRETE_CLASS = "javax.jdo.option.mapping.JoinedTablePerConcreteClass"; /** * "javax.jdo.option.mapping.NonJoinedTablePerConcreteClass" * * @see PersistenceManagerFactory#supportedOptions() * @since 2.1 */ static String OPTION_MAPPING_NON_JOINED_TABLE_PER_CONCRETE_CLASS = "javax.jdo.option.mapping.NonJoinedTablePerConcreteClass"; /** * "javax.jdo.option.mapping.RelationSubclassTable" * * @see PersistenceManagerFactory#supportedOptions() * @since 2.1 */ static String OPTION_MAPPING_RELATION_SUBCLASS_TABLE = "javax.jdo.option.mapping.RelationSubclassTable"; /** * "javax.jdo.PersistenceManagerFactoryClass" * * @see JDOHelper#getPersistenceManagerFactory(java.util.Map) * @since 2.1 */ static String PROPERTY_PERSISTENCE_MANAGER_FACTORY_CLASS = "javax.jdo.PersistenceManagerFactoryClass"; /** * "VendorName" * * @see JDOEnhancer#getProperties() * @since 3.0 */ public final static String PROPERTY_ENHANCER_VENDOR_NAME = "VendorName"; /** * "VersionNumber" * * @see JDOEnhancer#getProperties() * @since 3.0 */ public final static String PROPERTY_ENHANCER_VERSION_NUMBER = "VersionNumber"; /** Exit value for no enhancer found * @since 3.0 * */ public final static int ENHANCER_NO_JDO_ENHANCER_FOUND = 2; /** Exit value for usage error * @since 3.0 * */ public final static int ENHANCER_USAGE_ERROR = 3; /** Exit value for an exception from the JDOEnhancer * @since 3.0 * */ public final static int ENHANCER_EXCEPTION = 1; /** * "javax.jdo.option.Optimistic" * * @see PersistenceManagerFactory#getOptimistic() * @since 2.1 */ static String PROPERTY_OPTIMISTIC = "javax.jdo.option.Optimistic"; /** * "javax.jdo.option.ReadOnly" * * @see PersistenceManagerFactory#getReadOnly() * @since 2.2 */ static String PROPERTY_READONLY = "javax.jdo.option.ReadOnly"; /** * "javax.jdo.option.RetainValues" * * @see PersistenceManagerFactory#getRetainValues() * @since 2.1 */ static String PROPERTY_RETAIN_VALUES = "javax.jdo.option.RetainValues"; /** * "javax.jdo.option.RestoreValues" * * @see PersistenceManagerFactory#getRestoreValues() * @since 2.1 */ static String PROPERTY_RESTORE_VALUES = "javax.jdo.option.RestoreValues"; /** * "javax.jdo.option.IgnoreCache" * * @see PersistenceManagerFactory#getIgnoreCache() * @since 2.1 */ static String PROPERTY_IGNORE_CACHE = "javax.jdo.option.IgnoreCache"; /** * "javax.jdo.option.NontransactionalRead" * * @see PersistenceManagerFactory#getNontransactionalRead() * @since 2.1 */ static String PROPERTY_NONTRANSACTIONAL_READ = "javax.jdo.option.NontransactionalRead"; /** * "javax.jdo.option.NontransactionalWrite" * * @see PersistenceManagerFactory#getNontransactionalWrite() * @since 2.1 */ static String PROPERTY_NONTRANSACTIONAL_WRITE = "javax.jdo.option.NontransactionalWrite"; /** * "javax.jdo.option.Multithreaded" * * @see PersistenceManagerFactory#getMultithreaded() * @since 2.1 */ static String PROPERTY_MULTITHREADED = "javax.jdo.option.Multithreaded"; /** * "javax.jdo.option.TransactionIsolationLevel" * * @since 2.2 */ static String PROPERTY_TRANSACTION_ISOLATION_LEVEL = "javax.jdo.option.TransactionIsolationLevel"; /** * "javax.jdo.option.TransactionIsolationLevel.read-uncommitted" * * @see PersistenceManagerFactory#supportedOptions() * @since 2.2 */ static String PROPERTY_TRANSACTION_ISOLATION_LEVEL_READ_UNCOMMITTED = "javax.jdo.option.TransactionIsolationLevel.read-uncommitted"; /** * "javax.jdo.option.TransactionIsolationLevel.read-committed" * * @see PersistenceManagerFactory#supportedOptions() * @since 2.2 */ static String PROPERTY_TRANSACTION_ISOLATION_LEVEL_READ_COMMITTED = "javax.jdo.option.TransactionIsolationLevel.read-committed"; /** * "javax.jdo.option.TransactionIsolationLevel.repeatable-read" * * @see PersistenceManagerFactory#supportedOptions() * @since 2.2 */ static String PROPERTY_TRANSACTION_ISOLATION_LEVEL_REPEATABLE_READ = "javax.jdo.option.TransactionIsolationLevel.repeatable-read"; /** * "javax.jdo.option.TransactionIsolationLevel.snapshot" * * @see PersistenceManagerFactory#supportedOptions() * @since 2.2 */ static String PROPERTY_TRANSACTION_ISOLATION_LEVEL_SNAPSHOT = "javax.jdo.option.TransactionIsolationLevel.snapshot"; /** * "javax.jdo.option.TransactionIsolationLevel.serializable" * * @see PersistenceManagerFactory#supportedOptions() * @since 2.2 */ static String PROPERTY_TRANSACTION_ISOLATION_LEVEL_SERIALIZABLE = "javax.jdo.option.TransactionIsolationLevel.serializable"; /** * "javax.jdo.option.DetachAllOnCommit" * * @see PersistenceManagerFactory#getDetachAllOnCommit() * @since 2.1 */ static String PROPERTY_DETACH_ALL_ON_COMMIT = "javax.jdo.option.DetachAllOnCommit"; /** * "javax.jdo.option.CopyOnAttach" * * @see PersistenceManagerFactory#getCopyOnAttach() * @since 2.1 */ static String PROPERTY_COPY_ON_ATTACH = "javax.jdo.option.CopyOnAttach"; /** * "javax.jdo.option.ConnectionDriverName" * * @see PersistenceManagerFactory#getConnectionDriverName() * @since 2.1 */ static String PROPERTY_CONNECTION_DRIVER_NAME = "javax.jdo.option.ConnectionDriverName"; /** * "javax.jdo.option.ConnectionUserName" * * @see PersistenceManagerFactory#getConnectionUserName() * @since 2.1 */ static String PROPERTY_CONNECTION_USER_NAME = "javax.jdo.option.ConnectionUserName"; /** * "javax.jdo.option.Password" * * @since 2.1 */ static String PROPERTY_CONNECTION_PASSWORD = "javax.jdo.option.ConnectionPassword"; /** * "javax.jdo.option.ConnectionURL" * * @see PersistenceManagerFactory#getConnectionURL() * @since 2.1 */ static String PROPERTY_CONNECTION_URL = "javax.jdo.option.ConnectionURL"; /** * "javax.jdo.option.ConnectionFactoryName" * * @see PersistenceManagerFactory#getConnectionFactoryName() * @since 2.1 */ static String PROPERTY_CONNECTION_FACTORY_NAME = "javax.jdo.option.ConnectionFactoryName"; /** * "javax.jdo.option.ConnectionFactory2Name" * * @see PersistenceManagerFactory#getConnectionFactory2Name() * @since 2.1 */ static String PROPERTY_CONNECTION_FACTORY2_NAME = "javax.jdo.option.ConnectionFactory2Name"; /** * "javax.jdo.option.Mapping" * * @see PersistenceManagerFactory#getMapping() * @since 2.1 */ static String PROPERTY_MAPPING = "javax.jdo.option.Mapping"; /** * "javax.jdo.option.PersistenceUnitName" * * @see PersistenceManagerFactory#getPersistenceUnitName() * @since 2.1 */ static String PROPERTY_PERSISTENCE_UNIT_NAME = "javax.jdo.option.PersistenceUnitName"; /** * "javax.jdo.option.Name" * * @see PersistenceManagerFactory#getName() * @since 2.1 */ static String PROPERTY_NAME = "javax.jdo.option.Name"; /** * "javax.jdo.option.spi.ResourceName" * @since 2.1 */ static String PROPERTY_SPI_RESOURCE_NAME = "javax.jdo.option.spi.ResourceName"; /** * "javax.jdo.listener.InstanceLifecycleListener" * * @see PersistenceManagerFactory#addInstanceLifecycleListener(javax.jdo.listener.InstanceLifecycleListener,Class[]) * @see PersistenceManagerFactory#removeInstanceLifecycleListener(javax.jdo.listener.InstanceLifecycleListener) */ static String PROPERTY_INSTANCE_LIFECYCLE_LISTENER = "javax.jdo.listener.InstanceLifecycleListener"; /** * Prefix used to configure * {@link javax.jdo.listener.InstanceLifecycleListener} instances * externally. * To configure an InstanceLifecycleListener via properties, * create a property name with the prefix of * this constant and append the fully qualified listener class name, then * set its value to the comma- or whitespace-delimited list * of persistence-capable classes whose instances are to be observed. * Use no value to indicate that instances of * all persistence-capable classes are to be observed.
* For example,
* javax.jdo.option.InstanceLifecycleListener.com.example.MyListener=com.example.Foo,com.example.Bar
* is equivalent to calling
* pmf.addInstanceLifecycleListener(new com.example.MyListener(), new Class[] {com.example.Foo.class, com.example.Bar.class});
* where pmf is an instance of type * PersistenceManagerFactory. * * @see javax.jdo.PersistenceManagerFactory#addInstanceLifecycleListener(javax.jdo.listener.InstanceLifecycleListener,Class[]) * @since 2.1 */ static String PROPERTY_PREFIX_INSTANCE_LIFECYCLE_LISTENER = PROPERTY_INSTANCE_LIFECYCLE_LISTENER + "."; /** * Mapping "javax.jdo.mapping.Catalog" * * @since 2.1 */ static String PROPERTY_MAPPING_CATALOG = "javax.jdo.mapping.Catalog"; /** * Mapping "javax.jdo.mapping.Schema" * * @since 2.1 */ static String PROPERTY_MAPPING_SCHEMA = "javax.jdo.mapping.Schema"; /** * Specified value "javax.jdo.option.ServerTimeZoneID" * * @since 2.1 */ static String PROPERTY_SERVER_TIME_ZONE_ID = "javax.jdo.option.ServerTimeZoneID"; /** * Specified value "javax.jdo.option.DatastoreReadTimeoutMillis" * * @since 3.0 */ static String PROPERTY_DATASTORE_READ_TIMEOUT_MILLIS = "javax.jdo.option.DatastoreReadTimeoutMillis"; /** * Specified value "javax.jdo.option.DatastoreWriteTimeoutMillis" * * @since 3.0 */ static String PROPERTY_DATASTORE_WRITE_TIMEOUT_MILLIS = "javax.jdo.option.DatastoreWriteTimeoutMillis"; /** * Nonconfigurable property constant "VendorName" * * @see PersistenceManagerFactory#getProperties() * @since 2.1 */ static String NONCONFIGURABLE_PROPERTY_VENDOR_NAME = "VendorName"; /** * Nonconfigurable property constant "VersionNumber" * * @see PersistenceManagerFactory#getProperties() * @since 2.1 */ static String NONCONFIGURABLE_PROPERTY_VERSION_NUMBER = "VersionNumber"; /** * Specified value "javax.jdo.option.TransactionType" * * @since 2.1 */ static String PROPERTY_TRANSACTION_TYPE = "javax.jdo.option.TransactionType"; /** * The value for TransactionType to specify that transactions * are managed by the Java Transactions API, as documented in * JSR-220. * * @since 2.1 */ static String JTA = "JTA"; /** * The value for TransactionType to specify that transactions * are managed by the javax.jdo.Transaction instance, similar * to the usage as documented in JSR-220. * * @since 2.1 */ static String RESOURCE_LOCAL = "RESOURCE_LOCAL"; /** * The name of the resource for the DTD of the standard JDO configuration * file. * * @since 2.1 */ static String JDOCONFIG_DTD_RESOURCE = "javax/jdo/jdoconfig_3_0.dtd"; /** * The name of the resource for the XML schema of the standard JDO * configuration file. * * @since 2.1 */ static String JDOCONFIG_XSD_RESOURCE = "javax/jdo/jdoconfig_3_0.xsd"; /** * The name of the resource for the DTD of the standard JDO metadata file. * * @since 2.1 */ static String JDO_DTD_RESOURCE = "javax/jdo/jdo_3_0.dtd"; /** * The name of the resource for the XML schema of the standard JDO * metadata file. * * @since 2.1 */ static String JDO_XSD_RESOURCE = "javax/jdo/jdo_3_0.xsd"; /** * The name of the resource for the DTD of the standard JDO * object-relational mapping metadata file. * * @since 2.1 */ static String ORM_DTD_RESOURCE = "javax/jdo/orm_3_0.dtd"; /** * The name of the resource for the XML schema of the standard JDO * object-relational mapping metadata file. * * @since 2.1 */ static String ORM_XSD_RESOURCE = "javax/jdo/orm_3_0.xsd"; /** * The name of the resource for the DTD of the standard JDO query * metadata file. * * @since 2.1 */ static String JDOQUERY_DTD_RESOURCE = "javax/jdo/jdoquery_3_0.dtd"; /** * The name of the resource for the XML schema of the standard JDO query * metadata file. * * @since 2.1 */ static String JDOQUERY_XSD_RESOURCE = "javax/jdo/jdoquery_3_0.xsd"; /** * The name of the anonymous PersistenceManagerFactory, which * is the empty string. * * @since 2.1 */ static String ANONYMOUS_PERSISTENCE_MANAGER_FACTORY_NAME = ""; /** * Transaction isolation level representing the ability to read * uncommitted data. * @see PersistenceManagerFactory#getTransactionIsolationLevel() * @see Transaction#getIsolationLevel() * @since 2.2 */ public static final String TX_READ_UNCOMMITTED = "read-uncommitted"; /** * Transaction isolation level representing the requirement to read * committed data only. * @see PersistenceManagerFactory#getTransactionIsolationLevel() * @see Transaction#getIsolationLevel() * @since 2.2 */ public static final String TX_READ_COMMITTED = "read-committed"; /** * Transaction isolation level representing the requirement to read * the same data in the same transaction. * @see PersistenceManagerFactory#getTransactionIsolationLevel() * @see Transaction#getIsolationLevel() * @since 2.2 */ public static final String TX_REPEATABLE_READ = "repeatable-read"; /** * Transaction isolation level representing the requirement to keep * a snapshot for reading data. * @see PersistenceManagerFactory#getTransactionIsolationLevel() * @see Transaction#getIsolationLevel() * @since 2.2 */ public static final String TX_SNAPSHOT = "snapshot"; /** * Transaction isolation level representing the requirement to serialize * transactions. * @see PersistenceManagerFactory#getTransactionIsolationLevel() * @see Transaction#getIsolationLevel() * @since 2.2 */ public static final String TX_SERIALIZABLE = "serializable"; } api/src/java/javax/jdo/datastore/DataStoreCache.java100664 14033 12500110371 22717 0ustarmbouschenstaff 0 0 /* * 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. */ /* * DataStoreCache.java * */ package javax.jdo.datastore; import java.util.Collection; /** * Many JDO implementations allow instances to be cached in a * second-level cache, and allow direct management of the cache by * knowledgeable applications. This interface standardizes this * behavior. * @since 2.0 * @version 2.0 */ public interface DataStoreCache { /** Evict the parameter instance from the second-level cache. * @param oid the object id of the instance to evict. * @since 2.0 */ void evict (Object oid); /** Evict the parameter instances from the second-level cache. * All instances in the PersistenceManager's cache are evicted * from the second-level cache. * @since 2.0 */ void evictAll (); /** Evict the parameter instances from the second-level cache. * @param oids the object ids of the instance to evict. * @since 2.0 */ void evictAll (Object... oids); /** Evict the parameter instances from the second-level cache. * @param oids the object ids of the instance to evict. * @since 2.0 */ void evictAll (Collection oids); /** Evict the parameter instances from the second-level cache. * @param pcClass the class of instances to evict * @param subclasses if true, evict instances of subclasses also * @since 2.0 * @deprecated use evictAll (boolean subclasses, Class pcClass) */ void evictAll (Class pcClass, boolean subclasses); /** Evict the parameter instances from the second-level cache. * @param pcClass the class of instances to evict * @param subclasses if true, evict instances of subclasses also * @since 2.1 */ void evictAll (boolean subclasses, Class pcClass); /** Pin the parameter instance in the second-level cache. * @param oid the object id of the instance to pin. * @since 2.0 */ void pin (Object oid); /** Pin the parameter instances in the second-level cache. * @param oids the object ids of the instances to pin. * @since 2.0 */ void pinAll (Collection oids); /** Pin the parameter instances in the second-level cache. * @param oids the object ids of the instances to pin. * @since 2.0 */ void pinAll (Object... oids); /** Pin instances in the second-level cache. * @param pcClass the class of instances to pin * @param subclasses if true, pin instances of subclasses also * @since 2.0 * @deprecated use pinAll (boolean subclasses, Class pcClass) */ void pinAll (Class pcClass, boolean subclasses); /** Pin instances in the second-level cache. * @param pcClass the class of instances to pin * @param subclasses if true, pin instances of subclasses also * @since 2.1 */ void pinAll (boolean subclasses, Class pcClass); /** Unpin the parameter instance from the second-level cache. * @param oid the object id of the instance to unpin. * @since 2.0 */ void unpin(Object oid); /** Unpin the parameter instances from the second-level cache. * @param oids the object ids of the instance to evict. * @since 2.0 */ void unpinAll(Collection oids); /** Unpin the parameter instance from the second-level cache. * @param oids the object id of the instance to evict. * @since 2.0 */ void unpinAll(Object... oids); /** Unpin instances from the second-level cache. * @param pcClass the class of instances to unpin * @param subclasses if true, unpin instances of subclasses also * @since 2.0 * @deprecated use unpinAll(boolean subclasses, Class pcClass) */ void unpinAll(Class pcClass, boolean subclasses); /** Unpin instances from the second-level cache. * @param pcClass the class of instances to unpin * @param subclasses if true, unpin instances of subclasses also * @since 2.1 */ void unpinAll(boolean subclasses, Class pcClass); /** * This class is an empty implementation of the DataStoreCache * interface. It can be used by an implementation that does not * support a second-level cache. * @since 2.0 */ public class EmptyDataStoreCache implements DataStoreCache { public EmptyDataStoreCache() { } public void evict(Object oid) { } public void evictAll() { } public void evictAll(Object... oids) { } public void evictAll(Collection oids) { } public void evictAll(Class pcClass, boolean subclasses) { } public void evictAll(boolean subclasses, Class pcClass) { } public void pin(Object oid) { } public void pinAll(Object... oids) { } public void pinAll(Collection oids) { } public void pinAll(Class pcClass, boolean subclasses) { } public void pinAll(boolean subclasses, Class pcClass) { } public void unpin(Object oid) { } public void unpinAll(Object... oids) { } public void unpinAll(Collection oids) { } public void unpinAll(Class pcClass, boolean subclasses) { } public void unpinAll(boolean subclasses, Class pcClass) { } } } api/src/java/javax/jdo/datastore/JDOConnection.java100664 3722 12500110371 22524 0ustarmbouschenstaff 0 0 /* * 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. */ /* * JDOConnection.java * */ package javax.jdo.datastore; /** * The underlying connection that is being used by a * {@link javax.jdo.PersistenceManager}. * @version 2.0 * @since 2.0 */ public interface JDOConnection { /** * Returns the native, datastore-specific connection that this * connection wraps. In general, it is not recommended that this * native connection be used directly, since the JDO * implementation has no way to intercept calls to it, so it is * quite possible to put the PersistenceManager's * connection into an invalid state. * @return the native connection * @since 2.0 */ Object getNativeConnection (); /** * Returns this connection to the JDO implementation. * The object must be returned to the JDO implementation prior to * calling any JDO method or performing any action on any persistent * instance that might require the JDO implementation to use a * connection. If the object has not been returned and the JDO * implementation needs a connection, a JDOUserException * is thrown. * @since 2.0 */ void close(); } api/src/java/javax/jdo/datastore/package.html100664 1773 12500110371 21512 0ustarmbouschenstaff 0 0 Datastore package This package contains the JDO specification datastore interfaces. api/src/java/javax/jdo/datastore/Sequence.java100664 5213 12500110371 21635 0ustarmbouschenstaff 0 0 /* * 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. */ /* * Sequence.java * */ package javax.jdo.datastore; /** * Implementations of this interface can be used to obtain * sequences. The behavior with regard to the transaction and * rollover behavior are defined in the metadata. * * @version 2.0 * @since 2.0 */ public interface Sequence { /** * Returns the fully qualified name of the Sequence. * @return the name of the sequence */ String getName (); /** * Returns the next sequence value as an Object. If the next * sequence value is not available, throw JDODataStoreException. * @return the next value */ Object next (); /** * Provides a hint to the implementation that the application * will need additional sequence value objects in * short order. There is no externally visible behavior of this * method. It is used to potentially improve the efficiency of * the algorithm of obtaining additional sequence value objects. * @param additional the number of additional values to allocate */ void allocate (int additional); /** * Returns the current sequence value object if it is * available. It is intended to return a sequence value object * previously used. If the current sequence value is not available, * throw JDODataStoreException. * @return the current value */ Object current (); /** * Returns the next sequence value as a long. If the next * sequence value is not available or is not numeric, throw * JDODataStoreException. * @return the next value */ long nextValue(); /** * Returns the current sequence value as a long. If the current * sequence value is not available or is not numeric, throw * JDODataStoreException. * @return the current value */ long currentValue(); } api/src/java/javax/jdo/Enhancer.java100664 44102 12500110371 17642 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo; import java.io.File; import java.net.MalformedURLException; import java.net.URI; import java.net.URL; import java.net.URLClassLoader; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Properties; import java.util.Set; import java.util.Map.Entry; import static javax.jdo.Constants.ENHANCER_EXCEPTION; import static javax.jdo.Constants.ENHANCER_NO_JDO_ENHANCER_FOUND; import static javax.jdo.Constants.ENHANCER_USAGE_ERROR; import static javax.jdo.Constants.PROPERTY_ENHANCER_VENDOR_NAME; import static javax.jdo.Constants.PROPERTY_ENHANCER_VERSION_NUMBER; import javax.jdo.spi.I18NHelper; /** * Main class to invoke a JDO Enhancer. * The enhancer is invoked with the following command line: * * java -cp <classpath> javax.jdo.Enhancer <options> <directory, file, or resource names> * * <classpath> must contain the jdo specification jar, the implementation jar and any * implementation dependencies, the statically-compiled classes, and the jdo * metadata files loadable as resources. * *

<options> include: *

  • ? : print usage to stderr and exit *
  • -h : print usage to stderr and exit *
  • -help : print usage to stderr and exit *
  • -pu <persistence-unit-name> : the name of a persistence unit *
  • -d <target directory> : write the enhanced classes to the specified directory *
  • -checkonly : just check the classes for enhancement status *
  • -v : verbose output *
  • -r : recurse through directories to find all classes and metadata files to enhance *
  • -cp <enhancer class loader path> : if not already included in the java class loader, * this parameter must contain the statically-compiled classes, and the jdo metadata * files loadable as resources *
<directory, file, or resource names> *
  • Directory names must not end in ".jdo", ".jar", or ".class" *
  • Directories will be searched for files with suffixes ".jdo", ".jar", and ".class" *
  • Directories will be searched recursively if the -r option is set *
* * @since 3.0 */ public class Enhancer { /** The Internationalization message helper. */ private final static I18NHelper msg = I18NHelper.getInstance ("javax.jdo.Bundle"); //NOI18N /** New Line */ private char NL = '\n'; //NOI18N /** Jar file suffix */ private String JAR_FILE_SUFFIX = ".jar"; //NOI18N /** JDO Metadata file suffix */ private String JDO_FILE_SUFFIX = ".jdo"; //NOI18N /** Class file suffix */ private String CLASS_FILE_SUFFIX = ".class"; //NOI18N /** Error indicator */ private boolean error = false; /** If set, process parameters, print usage, and exit. */ private boolean printAndExit = false; /** Persistence Units */ private List persistenceUnitNames = new ArrayList(); /** Target Directory Parameter */ private String directoryName = null; /** ClassLoader for JDOEnhancer */ private ClassLoader loader = null; /** Classpath (-cp) parameter */ private String classPath = null; /** Check Only flag */ private boolean checkOnly = false; /** Verbose flag */ private boolean verbose = false; /** Recurse flag */ private boolean recurse = false; /** Error messages should be empty unless there is an error */ private StringBuilder errorBuffer = new StringBuilder(); /** Verbose messages are always collected but only output if verbose flag is set */ private StringBuilder verboseBuffer = new StringBuilder(); /** File Names */ private List fileNames = new ArrayList(); /** Class File Names */ private List classFileNames = new ArrayList(); /** JDO File Names */ private List jdoFileNames = new ArrayList(); /** Jar File Names */ private List jarFileNames = new ArrayList(); /** The number of classes validated by the JDOEnhancer */ private int numberOfValidatedClasses = 0; /** The number of classes enhanced by the JDOEnhancer */ private int numberOfEnhancedClasses = 0; /** The properties from the JDOEnhancer */ private Properties properties; /** Run the enhancer from the command line. * * @param args command line arguments */ public static void main (String[] args) { Enhancer enhancerMain = new Enhancer(); enhancerMain.run(args); } /** Execute the enhancer. * * @param args the command line arguments */ private void run(String[] args) { // processArgs will exit if errors or help processArgs(args); JDOEnhancer enhancer = null; try { enhancer = JDOHelper.getEnhancer(); } catch (JDOException jdoex) { jdoex.printStackTrace(); // outputs to stderr exit(ENHANCER_NO_JDO_ENHANCER_FOUND); } try { // provide verbose property settings of the JDOEnhancer we just loaded properties = enhancer.getProperties(); addVerboseMessage("MSG_EnhancerClass", enhancer.getClass().getName()); //NOI18N addVerboseMessage("MSG_EnhancerProperty", PROPERTY_ENHANCER_VENDOR_NAME, //NOI18N properties.getProperty(PROPERTY_ENHANCER_VENDOR_NAME)); addVerboseMessage("MSG_EnhancerProperty", PROPERTY_ENHANCER_VERSION_NUMBER, //NOI18N properties.getProperty(PROPERTY_ENHANCER_VERSION_NUMBER)); Set> props = properties.entrySet(); Iterator> entries = props.iterator(); while (entries.hasNext()) { Entry entry = entries.next(); if (!(PROPERTY_ENHANCER_VENDOR_NAME.equals(entry.getKey()) || PROPERTY_ENHANCER_VERSION_NUMBER.equals(entry.getKey()))) { addVerboseMessage("MSG_EnhancerProperty", (String)entry.getKey(), //NOI18N (String)entry.getValue()); } } enhancer.setVerbose(verbose); if (loader != null) { enhancer.setClassLoader(loader); } int numberOfClasses = classFileNames.size(); if (numberOfClasses != 0) { enhancer.addClasses(classFileNames.toArray(new String[numberOfClasses])); } int numberOfFiles = jdoFileNames.size(); if (numberOfFiles != 0) { enhancer.addFiles(jdoFileNames.toArray(new String[numberOfFiles])); } if (0 < jarFileNames.size()) { for (String jarFileName : jarFileNames) { enhancer.addJar(jarFileName); } } if (persistenceUnitNames != null) { for (String persistenceUnitName: persistenceUnitNames) { enhancer.addPersistenceUnit(persistenceUnitName); } } if (directoryName != null) { enhancer.setOutputDirectory(directoryName); } if (checkOnly) { numberOfValidatedClasses = enhancer.validate(); addVerboseMessage("MSG_EnhancerValidatedClasses", numberOfValidatedClasses); //NOI18N } else { numberOfEnhancedClasses = enhancer.enhance(); addVerboseMessage("MSG_EnhancerEnhancedClasses", numberOfEnhancedClasses); //NOI18N } exit(0); // good exit } catch (Exception ex) { ex.printStackTrace(); // outputs to stderr exit(ENHANCER_EXCEPTION); // error exit } } /** Process the command line arguments and exit if there is a usage request or an error. * * @param args the command line arguments */ private void processArgs(String[] args) { parseArgs(args); parseFiles(fileNames.toArray(new String[fileNames.size()]), true, recurse); loader = prepareClassLoader(classPath); if (error) { addErrorMessage(msg.msg("MSG_EnhancerUsage")); //NOI18N exit(ENHANCER_USAGE_ERROR); // error exit } if (printAndExit) { addVerboseMessage("MSG_EnhancerUsage"); //NOI18N exit(0); // good exit } } /** Parse the command line arguments. Put the results into fields. * * @param args the command line arguments */ private void parseArgs(String[] args) { boolean doneWithOptions = false; fileNames = new ArrayList(); for (int i = 0; i < args.length; ++i) { String arg = args[i]; // if first argument is ? then simply print usage and return. if ("?".equals(arg)) { printAndExit = true; return; } if (!doneWithOptions) { if (arg.startsWith("-")) { //NOI18N String option = arg.substring(1); if ("help".equals(option)) { //NOI18N addVerboseMessage("MSG_EnhancerProcessing", "-help"); //NOI18N setPrintAndExit(); } else if ("h".equals(option)) { //NOI18N addVerboseMessage("MSG_EnhancerProcessing", "-h"); //NOI18N setPrintAndExit(); } else if ("v".equals(option)) { //NOI18N addVerboseMessage("MSG_EnhancerProcessing", "-v"); //NOI18N verbose = true; } else if ("verbose".equals(option)) { //NOI18N addVerboseMessage("MSG_EnhancerProcessing", "-verbose"); //NOI18N verbose = true; } else if ("pu".equals(option)) { //NOI18N if (hasNextArgument("MSG_EnhancerProcessing", "-pu", i, args.length)) { //NOI18N String puName = args[++i]; addVerboseMessage("MSG_EnhancerPersistenceUnitName", puName); //NOI18N persistenceUnitNames.add(puName); } else { setError(); } } else if ("cp".equals(option)) { //NOI18N if (hasNextArgument("MSG_EnhancerProcessing", "-cp", i, args.length)) { //NOI18N classPath = args[++i]; addVerboseMessage("MSG_EnhancerClassPath", classPath); //NOI18N } else { setError(); } } else if ("d".equals(option)) { //NOI18N if (hasNextArgument("MSG_EnhancerProcessing", "-d", i, args.length)) { //NOI18N directoryName = args[++i]; addVerboseMessage("MSG_EnhancerOutputDirectory", directoryName); //NOI18N } else { setError(); } } else if ("checkonly".equals(option)) { //NOI18N addVerboseMessage("MSG_EnhancerProcessing", "-checkonly"); //NOI18N checkOnly = true; } else if ("r".equals(option)) { //NOI18N addVerboseMessage("MSG_EnhancerProcessing", "-r"); //NOI18N recurse = true; } else { setError(); addErrorMessage(msg.msg("ERR_EnhancerUnrecognizedOption", option)); //NOI18N } } else { doneWithOptions = true; fileNames.add(arg); } } else { fileNames.add(arg); } } } /** Check whether there is another parameter (the argument for an option * that requires an argument). * @param msgId the message id for an error message * @param where the parameter for the message * @param i the index into the parameter array * @param length the length of the parameter array * @return */ private boolean hasNextArgument(String msgId, String where, int i, int length) { if (i + 1 >= length) { setError(); addErrorMessage(msg.msg(msgId, where)); addErrorMessage(msg.msg("ERR_EnhancerRequiredArgumentMissing")); //NOI18N return false; } return true; } /** * Files can be one of four types: *
  1. directory: the directory is examined for files of the following types *
  2. .class: this is a java class file *
  3. .jdo: this is a jdo metadata file *
  4. .jar: this is a jar file *
* If the recursion flag is set, directories contained in directories are examined, * recursively. */ private void parseFiles(String[] fileNames, boolean search, boolean recurse) { for (String fileName: fileNames) { if (fileName.endsWith(JAR_FILE_SUFFIX)) { // add to jar file names jarFileNames.add(fileName); addVerboseMessage("MSG_EnhancerJarFileName", fileName); //NOI18N } else if (fileName.endsWith(JDO_FILE_SUFFIX)) { // add to jdo file names jdoFileNames.add(fileName); addVerboseMessage("MSG_EnhancerJDOFileName", fileName); //NOI18N } else if (fileName.endsWith(CLASS_FILE_SUFFIX)) { // add to class file names classFileNames.add(fileName); addVerboseMessage("MSG_EnhancerClassFileName", fileName); //NOI18N } else { // assume a directory if no recognized suffix File directoryFile = new File(fileName); if (directoryFile.isDirectory() && search) { String directoryPath = directoryFile.getAbsolutePath(); String[] files = directoryFile.list(); String[] pathName = new String[1]; if (files != null) { for (String file: files) { pathName[0] = directoryPath + '/' + file; parseFiles(pathName, recurse, recurse); } } } } } } /** Prepare the class loader from the classPath specified * * @param classPath the classPath string from the "-cp classPath" option * @return the class loader */ private ClassLoader prepareClassLoader(String classPath) { if (classPath == null) return null; ClassLoader result = null; // separate classPath using system class path separator String separator = System.getProperty("path.separator"); String[] paths = classPath.split(separator); List urls = new ArrayList(); for (String path: paths) { // for each path construct a URL from the File File file = new File(path); URI uri = file.toURI(); try { URL url = uri.toURL(); addVerboseMessage("MSG_EnhancerClassPath", url.toString()); urls.add(url); } catch (MalformedURLException e) { setError(); addErrorMessage(msg.msg("ERR_EnhancerBadClassPath", file)); } } result = new URLClassLoader(urls.toArray(new URL[urls.size()]), null); return result; } /** Add a message to stderr. * * @param message the internationalized message to add */ private void addErrorMessage(String message) { errorBuffer.append(message); errorBuffer.append(NL); } /** Set the error flag. * */ private void setError() { error = true; } /** Set the print-and-exit flag. * */ private void setPrintAndExit() { printAndExit = true; } /** Exit this process. * * @param exitValue the process exit value */ private void exit(int exitValue) { System.out.print(verboseBuffer.toString()); System.err.print(errorBuffer.toString()); System.exit(exitValue); } /** Add a message to the verbose message buffer. * * @param msgId the message id * @param where the parameter */ private void addVerboseMessage(String msgId, String... where) { verboseBuffer.append(msg.msg(msgId, where)); verboseBuffer.append(NL); } /** Add a message to the verbose message buffer. * * @param msgId the message id * @param where the parameter */ private void addVerboseMessage(String msgId, String where) { verboseBuffer.append(msg.msg(msgId, where)); verboseBuffer.append(NL); } /** Add a message to the verbose message buffer. * * @param msgId the message id */ private void addVerboseMessage(String msgId) { verboseBuffer.append(msg.msg(msgId)); verboseBuffer.append(NL); } /** Add a message to the verbose message buffer. * * @param msgId the message id * @param where the parameter */ private void addVerboseMessage(String msgId, int where) { addVerboseMessage(msgId, String.valueOf(where)); } } api/src/java/javax/jdo/Extent.java100664 7504 12500110371 17353 0ustarmbouschenstaff 0 0 /* * 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. */ /* * Extent.java * */ package javax.jdo; import java.lang.Iterable; import java.util.Iterator; /** Instances of the Extent class represent the entire collection * of instances in the data store of the candidate class or interface * possibly including its subclasses or subinterfaces. *

The Extent instance has two possible uses: *

    *
  1. to iterate all instances of a particular class or interface *
  2. to execute a Query in the data store over all instances * of a particular class or interface *
* @version 2.1 */ public interface Extent extends Iterable { /** Returns an iterator over all the instances in the Extent. * The behavior of the returned iterator might depend on the setting of the * ignoreCache flag in the owning PersistenceManager. * @return an iterator over all instances in the Extent */ Iterator iterator(); /** Returns whether this Extent was defined to contain subclasses. * @return true if this Extent was defined to contain instances * that are of a subclass type. */ boolean hasSubclasses(); /** An Extent contains all instances of a particular class * or interface in the data * store; this method returns the Class of the instances * represented by this Extent. * @return the Class of instances of this Extent. */ Class getCandidateClass(); /** An Extent is managed by a PersistenceManager; * this method gives access to the owning PersistenceManager. * @return the owning PersistenceManager */ PersistenceManager getPersistenceManager(); /** Close all Iterators associated with this Extent instance. * Iterators closed by this method will return false * to hasNext() and will throw * NoSuchElementException on next(). * The Extent instance can still be used * as a parameter of Query.setExtent, and to get an Iterator. */ void closeAll (); /** Close an Iterator associated with this Extent instance. * Iterators closed by this method will return false * to hasNext() and will throw NoSuchElementException * on next(). The Extent instance can still be used * as a parameter of Query.setExtent, and to get an Iterator. * @param it an Iterator obtained by the method * iterator() on this Extent instance. */ void close (Iterator it); /** Get the fetch plan associated with this Extent. * @return the fetch plan * @since 2.0 */ FetchPlan getFetchPlan(); } api/src/java/javax/jdo/FetchGroup.java100664 24555 12500110371 20177 0ustarmbouschenstaff 0 0 /* * 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. */ /* * FetchGroup.java * */ package javax.jdo; import java.util.Set; /** * FetchGroup represents a named fetch group for a specific class or * interface. A fetch group instance identifies the name of the class or * interface, the list of members (fields or properties) to be fetched when * the fetch group is active, and the recursion depth for each member. *

* Fetch groups are updated using methods on this interface. An instance of * a class implementing this interface can be obtained from * {@link PersistenceManager#getFetchGroup} or * {@link PersistenceManagerFactory#getFetchGroup}. *

* A FetchGroup can be unscoped or can be in one of two scopes (the * {@link PersistenceManager} or the {@link PersistenceManagerFactory} scope). * Unscoped FetchGroups do not affect any behavior. * A FetchGroup in PersistenceManager scope hides the corresponding * FetchGroup in the PersistenceManagerFactory scope. *

  • When a FetchGroup is obtained via * {@link PersistenceManager#getFetchGroup}, * it is immediately in scope of its PersistenceManager. * Subsequent modifications of the FetchGroup * immediately affect FetchPlans that contain the * FetchGroup. *
  • When a FetchGroup is obtained via * {@link PersistenceManagerFactory#getFetchGroup}, it is unscoped. *
  • When a FetchGroup is added to the set of active FetchGroups via * {@link PersistenceManagerFactory#addFetchGroups}, it is put in scope of the * PersistenceManagerFactory. *
  • When a FetchGroup is removed from the set of active FetchGroups via * {@link PersistenceManagerFactory#removeFetchGroups}, * {@link PersistenceManagerFactory#removeAllFetchGroups}, or replaced via * {@link PersistenceManagerFactory#addFetchGroups}, it is unscoped. *
* @version 2.2 * @since 2.2 */ public interface FetchGroup { /** * For use with {@link #addCategory} and {@link #removeCategory} calls. * This category includes members defined in the default fetch group * in xml or annotations. Redefining the default fetch group via the API * does not affect the members defined by this category. *

* Using this category also sets the fetch-depth for the members in the * default fetch group.

* @since 2.2 */ public static final String DEFAULT = "default"; /** * For use with {@link #addCategory} and {@link #removeCategory} calls. * This category includes members of all relationship types. * @since 2.2 */ public static final String RELATIONSHIP = "relationship"; /** * For use with {@link #addCategory} and {@link #removeCategory} calls. * This category includes members of all multi-valued types, including * Collection, array, and Map types of basic and relationship types. * @since 2.2 */ public static final String MULTIVALUED = "multivalued"; /** * For use with {@link #addCategory} and {@link #removeCategory} calls. * This category includes members of all primitive and immutable * object class types as defined in section 6.4 of the specification, * including String, Locale, Currency, BigDecimal, and BigInteger; * as well as Date and its jdbc subtypes and Enum types. * @since 2.2 */ public static final String BASIC = "basic"; /** * For use with {@link #addCategory} and {@link #removeCategory} calls. * This category includes all members in the persistent type. *

* Using this category also sets the fetch-depth for the members in the * default fetch group.

* @since 2.2 */ public static final String ALL = "all"; /** * Return the hashCode for this instance. The hash code should combine both * the class and fetch group name. The hash codes for two equal instances * must be identical. * @return the hash code * @since 2.2 */ int hashCode(); /** * Return whether this instance is equal to the other. The equals method * must compare the class for identity and the fetch group name for * equality. * @return whether this instance is equal to the other * @since 2.2 */ boolean equals(Object other); /** * Get the name of this FetchGroup. The name is set only in the * factory method. * @return the name * @since 2.2 */ String getName(); /** * Get the persistent type (class or interface) of this FetchGroup. * The persistent type is set only in the factory method(s). * @return the persistent type * @since 2.2 */ Class getType(); /** * Get the post-load property of this FetchGroup. * @return the post-load property * @since 2.2 */ boolean getPostLoad(); /** * Set the post-load property of this FetchGroup. * @return the FetchGroup * @throws JDOUserException if the FetchGroup is unmodifiable * @since 2.2 */ FetchGroup setPostLoad(boolean postLoad); /** * Add the member (field or property) to the set of members in this * FetchGroup. * @param memberName the name of a member to add to the FetchGroup * @return the FetchGroup * @throws JDOUserException if the parameter is not a member of the * persistent type * @throws JDOUserException if the FetchGroup is unmodifiable * @since 2.2 */ FetchGroup addMember(String memberName); /** * Add the member (field or property) to the set of members in this * FetchGroup. Duplicates are ignored. * @param memberNames the names of members to add to the FetchGroup * @return the FetchGroup * @throws JDOUserException if any parameter is not a member of the * persistent type * @throws JDOUserException if the FetchGroup is unmodifiable * @since 2.2 */ FetchGroup addMembers(String... memberNames); /** * Remove the member (field or property) from the set of members in this * FetchGroup. * @return the FetchGroup * @throws JDOUserException if the parameter is not a member of the * persistent type * @throws JDOUserException if the FetchGroup is unmodifiable * @since 2.2 */ FetchGroup removeMember(String memberName); /** * Remove the member (field or property) from the set of members in this * FetchGroup. Duplicates in the parameter list are eliminated before * removing them from the membership. * @return the FetchGroup * @throws JDOUserException if any parameter is not a member of the * persistent type * @throws JDOUserException if the FetchGroup is unmodifiable * @since 2.2 */ FetchGroup removeMembers(String... memberNames); /** * Add the members (fields or properties) of the named category * to the set of members in this FetchGroup. This method first * resolves the category name to a set of members and then adds * the members as if {@link #addMembers} was called. After this * method executes, the category is not remembered. * @return the FetchGroup * @throws JDOUserException if the FetchGroup is unmodifiable * @since 2.2 */ FetchGroup addCategory(String categoryName); /** * Remove the members (fields or properties) of the named category * from the set of members in this FetchGroup. This method first * resolves the category name to a set of members and then removes * the members as if {@link #removeMembers} was called. After this * method executes, the category is not remembered. * @return the FetchGroup * @throws JDOUserException if the FetchGroup is unmodifiable * @since 2.2 */ FetchGroup removeCategory(String categoryName); /** * Set the recursion-depth for this member. The default is 1. A value of 0 * means don't fetch the member (as if the member were omitted entirely). * A value of -1 means fetch all instances reachable via this member. * @return the FetchGroup * @param memberName the name of the field or property * @param recursionDepth the value for the recursion-depth property * @throws JDOUserException if the member does not exist * @throws JDOUserException if the FetchGroup is unmodifiable * @since 2.2 */ FetchGroup setRecursionDepth(String memberName, int recursionDepth); /** * Get the recursion-depth for this member. * @param memberName the name of the field or property * @return the recursion-depth for this member * @throws JDOUserException if the member is not in the FetchGroup * @since 2.2 */ int getRecursionDepth(String memberName); /** * Return an immutable Set of String containing the names of all members. * The Set is a copy of the currently defined members and will not change * based on subsequent changes to the membership in the FetchGroup. * @return an immutable Set containing the names of all members * in the FetchGroup * @since 2.2 */ Set getMembers(); /** * Make this FetchGroup unmodifiable. If already unmodifiable, this method * has no effect. * @return the FetchGroup * @since 2.2 */ FetchGroup setUnmodifiable(); /** * Return whether this FetchGroup is unmodifiable. If so, methods * {@link #setPostLoad}, {@link #addMember}, {@link #removeMember}, * {@link #addMembers}, {@link #removeMembers}, * {@link #addCategory}, and {@link #removeCategory} * will throw {@link JDOUserException}. * @return whether the FetchGroup is unmodifiable * @since 2.2 */ boolean isUnmodifiable(); } api/src/java/javax/jdo/FetchPlan.java100664 15042 12500110371 17764 0ustarmbouschenstaff 0 0 /* * 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. */ /* * FetchPlan.java * */ package javax.jdo; import java.util.Collection; import java.util.Set; /** * Fetch groups are activated using methods on this interface. An * instance of this interface can be obtained from {@link * PersistenceManager#getFetchPlan}, {@link Extent#getFetchPlan}, and * {@link Query#getFetchPlan}. When a Query or * Extent is retrieved from a * PersistenceManager, its FetchPlan is * initialized to the same settings as that of the * PersistenceManager. Subsequent modifications of the * Query or Extent's FetchPlan * are not reflected in the FetchPlan of the * PersistenceManager. * @version 2.0 * @since 2.0 */ public interface FetchPlan { /** * For use with {@link #addGroup}, {@link #removeGroup}, and the * various {@link #setGroups} calls. Value: default. * @since 2.0 */ public static final String DEFAULT = "default"; /** * For use with {@link #addGroup}, {@link #removeGroup}, and the * various {@link #setGroups} calls. Value: all. * @since 2.0 */ public static final String ALL = "all"; /** * For use with {@link PersistenceManager#detachCopy} and * {@link #setDetachmentOptions}. Specifies that * fields that are loaded but not in the current fetch plan should * be unloaded prior to detachment. * @since 2.0 */ public static final int DETACH_UNLOAD_FIELDS = 2; /** * For use with {@link PersistenceManager#detachCopy} and * {@link #setDetachmentOptions}. Specifies that * fields that are not loaded but are in the current fetch plan should * be loaded prior to detachment. * @since 2.0 */ public static final int DETACH_LOAD_FIELDS = 1; /** * For use with {@link #setFetchSize}. Value: -1. * @since 2.0 */ public static final int FETCH_SIZE_GREEDY = -1; /** * For use with {@link #setFetchSize}. Value: 0. * @since 2.0 */ public static final int FETCH_SIZE_OPTIMAL = 0; /** * Add the fetch group to the set of active fetch groups. * @return the FetchPlan * @since 2.0 */ FetchPlan addGroup(String fetchGroupName); /** * Remove the fetch group from the set active fetch groups. * @return the FetchPlan * @since 2.0 */ FetchPlan removeGroup(String fetchGroupName); /** * Remove all active groups leaving no active fetch group. * @return the FetchPlan * @since 2.0 */ FetchPlan clearGroups(); /** * Return an immutable Set containing the names * of all active fetch groups. The Set is a copy of * the currently active groups and will not change * based on subsequent changes to the groups. * @return an immutable Set containing the names * of all currently active fetch groups * @since 2.0 */ Set getGroups(); /** * Set a collection of groups. * @param fetchGroupNames a collection of names of fetch groups * @return the FetchPlan * @since 2.0 */ FetchPlan setGroups(Collection fetchGroupNames); /** * Set a collection of groups. * @param fetchGroupNames a String array of names of fetch groups * @return the FetchPlan * @since 2.0 */ FetchPlan setGroups(String... fetchGroupNames); /** * Set the active fetch groups to the single named fetch group. * @param fetchGroupName the single fetch group * @return the FetchPlan * @since 2.0 */ FetchPlan setGroup(String fetchGroupName); /** * Set the maximum fetch depth when fetching. * A value of 0 has no meaning and will throw a JDOUserException. * A value of -1 means that no limit is placed on fetching. * A positive integer will result in that number of references from the * initial object to be fetched. * @param fetchDepth the depth * @return the FetchPlan * @since 2.0 */ FetchPlan setMaxFetchDepth(int fetchDepth); /** * Return the maximum fetch depth used when fetching instances. * @return the maximum fetch depth * @since 2.0 */ int getMaxFetchDepth(); /** * Set the roots for DetachAllOnCommit. * @param roots Collection of the detachment roots. * @since 2.0 */ FetchPlan setDetachmentRoots(Collection roots); /** * Get the roots for DetachAllOnCommit. * @return Collection of detachment roots. * @since 2.0 */ Collection getDetachmentRoots(); /** * Set the root classes for DetachAllOnCommit. * @param rootClasses The root classes. * @since 2.0 */ FetchPlan setDetachmentRootClasses(Class... rootClasses); /** * Get the root classes for DetachAllOnCommit. * @return The detachment root classes * @since 2.0 */ Class[] getDetachmentRootClasses(); /** * Set the fetch size for large result set support. Use * {@link #FETCH_SIZE_OPTIMAL} to unset, and {@link #FETCH_SIZE_GREEDY} * to force loading of everything. * @param fetchSize the fetch size * @return the FetchPlan * @since 2.0 */ FetchPlan setFetchSize(int fetchSize); /** * Return the fetch size, or {@link #FETCH_SIZE_OPTIMAL} if not set, * or {@link #FETCH_SIZE_GREEDY} to fetch all. * @return the fetch size * @since 2.0 */ int getFetchSize(); /** * Set options to be used during detachment. Options are {@link * #DETACH_LOAD_FIELDS} and {@link #DETACH_UNLOAD_FIELDS}. */ FetchPlan setDetachmentOptions(int options); /** * Get options used during detachment. */ int getDetachmentOptions(); } api/src/java/javax/jdo/identity/ByteIdentity.java100664 10223 12500110371 22362 0ustarmbouschenstaff 0 0 /* * 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. */ /* * ByteIdentity.java * */ package javax.jdo.identity; import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectOutput; /** This class is for identity with a single byte field. * @version 2.0 */ public class ByteIdentity extends SingleFieldIdentity { /** The key. */ private byte key; /** Construct this instance with the key value. */ private void construct(byte key) { this.key = key; hashCode = super.hashClassName() ^ key; } /** Constructor with class and key. * @param pcClass the target class * @param key the key */ public ByteIdentity(Class pcClass, byte key) { super(pcClass); construct(key); } /** Constructor with class and key. * @param pcClass the target class * @param key the key */ public ByteIdentity(Class pcClass, Byte key) { super(pcClass); setKeyAsObject(key); construct(key.byteValue()); } /** Constructor with class and key. * @param pcClass the target class * @param str the key */ public ByteIdentity(Class pcClass, String str) { super(pcClass); assertKeyNotNull(str); construct(Byte.parseByte(str)); } /** Constructor only for Externalizable. */ public ByteIdentity() { } /** Return the key. * @return the key */ public byte getKey() { return key; } /** Return the String version of the key. * @return the key. */ public String toString() { return Byte.toString(key); } /** Determine if the other object represents the same object id. * @param obj the other object * @return true if both objects represent the same object id */ public boolean equals(Object obj) { if (this == obj) { return true; } else if (!super.equals (obj)) { return false; } else { ByteIdentity other = (ByteIdentity)obj; return key == other.key; } } /** Determine the ordering of identity objects. * @param o Other identity * @return The relative ordering between the objects * @since 2.2 */ public int compareTo(Object o) { if (o instanceof ByteIdentity) { ByteIdentity other = (ByteIdentity)o; int result = super.compare(other); if (result == 0) { return (key - other.key); } else { return result; } } else if (o == null) { throw new ClassCastException("object is null"); } throw new ClassCastException(this.getClass().getName() + " != " + o.getClass().getName()); } /** Create the key as an Object. * @return the key as an Object * @since 2.0 */ protected Object createKeyAsObject() { return new Byte(key); } /** Write this object. Write the superclass first. * @param out the output */ public void writeExternal(ObjectOutput out) throws IOException { super.writeExternal (out); out.writeByte (key); } /** Read this object. Read the superclass first. * @param in the input */ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { super.readExternal (in); key = in.readByte (); } } api/src/java/javax/jdo/identity/CharIdentity.java100664 10726 12500110371 22344 0ustarmbouschenstaff 0 0 /* * 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. */ /* * CharIdentity.java * */ package javax.jdo.identity; import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectOutput; import javax.jdo.spi.I18NHelper; /** This class is for identity with a single character field. * @version 2.0 */ public class CharIdentity extends SingleFieldIdentity { /** The Internationalization message helper. */ private static I18NHelper msg = I18NHelper.getInstance ("javax.jdo.Bundle"); //NOI18N /** The key. */ private char key; private void construct(char key) { this.key = key; hashCode = hashClassName() ^ key; } /** Constructor with class and key. * @param pcClass the target class * @param key the key */ public CharIdentity (Class pcClass, char key) { super (pcClass); construct(key); } /** Constructor with class and key. * @param pcClass the target class * @param key the key */ public CharIdentity (Class pcClass, Character key) { super (pcClass); setKeyAsObject(key); construct(key.charValue()); } /** Constructor with class and key. The String must have exactly one * character. * @param pcClass the target class * @param str the key */ public CharIdentity (Class pcClass, String str) { super(pcClass); assertKeyNotNull(str); if (str.length() != 1) throw new IllegalArgumentException( msg.msg("EXC_StringWrongLength")); //NOI18N construct(str.charAt(0)); } /** Constructor only for Externalizable. */ public CharIdentity () { } /** Return the key. * @return the key */ public char getKey () { return key; } /** Return the String form of the key. * @return the String form of the key */ public String toString () { return String.valueOf(key); } /** Determine if the other object represents the same object id. * @param obj the other object * @return true if both objects represent the same object id */ public boolean equals (Object obj) { if (this == obj) { return true; } else if (!super.equals (obj)) { return false; } else { CharIdentity other = (CharIdentity) obj; return key == other.key; } } /** Determine the ordering of identity objects. * @param o Other identity * @return The relative ordering between the objects * @since 2.2 */ public int compareTo(Object o) { if (o instanceof CharIdentity) { CharIdentity other = (CharIdentity)o; int result = super.compare(other); if (result == 0) { return (key - other.key); } else { return result; } } else if (o == null) { throw new ClassCastException("object is null"); } throw new ClassCastException(this.getClass().getName() + " != " + o.getClass().getName()); } /** Create the key as an Object. * @return the key as an Object * @since 2.0 */ protected Object createKeyAsObject() { return new Character(key); } /** Write this object. Write the superclass first. * @param out the output */ public void writeExternal(ObjectOutput out) throws IOException { super.writeExternal (out); out.writeChar(key); } /** Read this object. Read the superclass first. * @param in the input */ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { super.readExternal (in); key = in.readChar(); } } api/src/java/javax/jdo/identity/IntIdentity.java100664 10036 12500110371 22213 0ustarmbouschenstaff 0 0 /* * 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. */ /* * IntIdentity.java * */ package javax.jdo.identity; import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectOutput; /** This class is for identity with a single int field. * @version 2.0 */ public class IntIdentity extends SingleFieldIdentity { private int key; private void construct(int key) { this.key = key; hashCode = hashClassName() ^ key; } /** Constructor with class and key. * @param pcClass the class * @param key the key */ public IntIdentity (Class pcClass, int key) { super(pcClass); construct(key); } /** Constructor with class and key. * @param pcClass the class * @param key the key */ public IntIdentity (Class pcClass, Integer key) { super(pcClass); setKeyAsObject(key); construct(key.intValue ()); } /** Constructor with class and key. * @param pcClass the class * @param str the key */ public IntIdentity (Class pcClass, String str) { super(pcClass); assertKeyNotNull(str); construct(Integer.parseInt(str)); } /** Constructor only for Externalizable. */ public IntIdentity () { } /** Return the key. * @return the key */ public int getKey () { return key; } /** Return the String form of the key. * @return the String form of the key */ public String toString () { return Integer.toString(key); } /** Determine if the other object represents the same object id. * @param obj the other object * @return true if both objects represent the same object id */ public boolean equals (Object obj) { if (this == obj) { return true; } else if (!super.equals (obj)) { return false; } else { IntIdentity other = (IntIdentity) obj; return key == other.key; } } /** Determine the ordering of identity objects. * @param o Other identity * @return The relative ordering between the objects * @since 2.2 */ public int compareTo(Object o) { if (o instanceof IntIdentity) { IntIdentity other = (IntIdentity)o; int result = super.compare(other); if (result == 0) { return (key - other.key); } else { return result; } } else if (o == null) { throw new ClassCastException("object is null"); } throw new ClassCastException(this.getClass().getName() + " != " + o.getClass().getName()); } /** Create the key as an Object. * @return the key as an Object * @since 2.0 */ protected Object createKeyAsObject() { return new Integer(key); } /** Write this object. Write the superclass first. * @param out the output */ public void writeExternal(ObjectOutput out) throws IOException { super.writeExternal (out); out.writeInt(key); } /** Read this object. Read the superclass first. * @param in the input */ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { super.readExternal (in); key = in.readInt(); } } api/src/java/javax/jdo/identity/LongIdentity.java100664 10522 12500110371 22360 0ustarmbouschenstaff 0 0 /* * 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. */ /* * LongIdentity.java * */ package javax.jdo.identity; import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectOutput; /** This class is for identity with a single long field. * @version 2.0 */ public class LongIdentity extends SingleFieldIdentity { /** The key. */ private long key; private void construct(long key) { this.key = key; hashCode = hashClassName() ^ (int)key; } /** Constructor with class and key. * @param pcClass the class * @param key the key */ public LongIdentity (Class pcClass, long key) { super (pcClass); construct(key); } /** Constructor with class and key. * @param pcClass the class * @param key the key */ public LongIdentity (Class pcClass, Long key) { super(pcClass); setKeyAsObject(key); construct(key.longValue()); } /** Constructor with class and key. * @param pcClass the class * @param str the key */ public LongIdentity (Class pcClass, String str) { super(pcClass); assertKeyNotNull(str); construct(Long.parseLong(str)); } /** Constructor only for Externalizable. */ public LongIdentity () { } /** Return the key. * @return the key */ public long getKey () { return key; } /** Return the String form of the key. * @return the String form of the key */ public String toString () { return Long.toString(key); } /** Determine if the other object represents the same object id. * @param obj the other object * @return true if both objects represent the same object id */ public boolean equals (Object obj) { if (this == obj) { return true; } else if (!super.equals (obj)) { return false; } else { LongIdentity other = (LongIdentity) obj; return key == other.key; } } /** Determine the ordering of identity objects. * @param o Other identity * @return The relative ordering between the objects * @since 2.2 */ public int compareTo(Object o) { if (o instanceof LongIdentity) { LongIdentity other = (LongIdentity)o; int result = super.compare(other); if (result == 0) { long diff = key - other.key; if (diff == 0) { return 0; } else { if (diff < 0) { return -1; } else { return 1; } } } else { return result; } } else if (o == null) { throw new ClassCastException("object is null"); } throw new ClassCastException(this.getClass().getName() + " != " + o.getClass().getName()); } /** Create the key as an Object. * @return the key as an Object * @since 2.0 */ protected Object createKeyAsObject() { return new Long(key); } /** Write this object. Write the superclass first. * @param out the output */ public void writeExternal(ObjectOutput out) throws IOException { super.writeExternal (out); out.writeLong(key); } /** Read this object. Read the superclass first. * @param in the input */ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { super.readExternal (in); key = in.readLong(); } } api/src/java/javax/jdo/identity/ObjectIdentity.java100664 15153 12500110371 22674 0ustarmbouschenstaff 0 0 /* * 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. */ /* * ObjectIdentity.java * */ package javax.jdo.identity; import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectOutput; import java.security.AccessController; import java.security.PrivilegedAction; import javax.jdo.JDOUserException; import javax.jdo.spi.JDOImplHelper; /** This class is for identity with a single Object type field. * @version 2.0 */ public class ObjectIdentity extends SingleFieldIdentity { /** The key is stored in the superclass field keyAsObject. */ /** The JDOImplHelper instance used for parsing the String to an Object. */ private static JDOImplHelper helper = (JDOImplHelper) AccessController.doPrivileged( new PrivilegedAction () { public JDOImplHelper run () { return JDOImplHelper.getInstance(); } } ); /** The delimiter for String constructor. */ private static final String STRING_DELIMITER = ":"; //NOI18N /** Constructor with class and key. * @param pcClass the class * @param param the key */ @SuppressWarnings("static-access") public ObjectIdentity (Class pcClass, Object param) { super (pcClass); assertKeyNotNull(param); String paramString = null; String keyString = null; String className = null; if (param instanceof String) { /* The paramString is of the form ":" */ paramString = (String)param; if (paramString.length() < 3) { throw new JDOUserException( msg.msg("EXC_ObjectIdentityStringConstructionTooShort") + //NOI18N msg.msg("EXC_ObjectIdentityStringConstructionUsage", //NOI18N paramString)); } int indexOfDelimiter = paramString.indexOf(STRING_DELIMITER); if (indexOfDelimiter < 0) { throw new JDOUserException( msg.msg("EXC_ObjectIdentityStringConstructionNoDelimiter") + //NOI18N msg.msg("EXC_ObjectIdentityStringConstructionUsage", //NOI18N paramString)); } keyString = paramString.substring(indexOfDelimiter+1); className = paramString.substring(0, indexOfDelimiter); keyAsObject = helper.construct(className, keyString); } else { keyAsObject = param; } hashCode = hashClassName() ^ keyAsObject.hashCode(); } /** Constructor only for Externalizable. */ public ObjectIdentity () { } /** Return the key. * @return the key */ public Object getKey () { return keyAsObject; } /** Return the String form of the object id. The class of the * object id is written as the first part of the result so that * the class can be reconstructed later. Then the toString * of the key instance is appended. During construction, * this process is reversed. The class is extracted from * the first part of the String, and the String constructor * of the key is used to construct the key itself. * @return the String form of the key */ @Override public String toString () { return keyAsObject.getClass().getName() + STRING_DELIMITER + keyAsObject.toString(); } /** Determine if the other object represents the same object id. * @param obj the other object * @return true if both objects represent the same object id */ @Override public boolean equals (Object obj) { if (this == obj) { return true; } else if (!super.equals (obj)) { return false; } else { ObjectIdentity other = (ObjectIdentity) obj; return keyAsObject.equals(other.keyAsObject); } } /** Provide the hash code for this instance. The hash code is the * hash code of the contained key. * @return the hash code */ @Override public int hashCode() { return keyAsObject.hashCode(); } /** Determine the ordering of identity objects. * @param o Other identity * @return The relative ordering between the objects * @since 2.2 */ @SuppressWarnings("unchecked") public int compareTo(Object o) { if (o instanceof ObjectIdentity) { ObjectIdentity other = (ObjectIdentity)o; int result = super.compare(other); if (result == 0) { if (other.keyAsObject instanceof Comparable && keyAsObject instanceof Comparable) { return ((Comparable)keyAsObject).compareTo( (Comparable)other.keyAsObject); } else { throw new ClassCastException("The key class (" + keyAsObject.getClass().getName() + ") does not implement Comparable"); } } else { return result; } } else if (o == null) { throw new ClassCastException("object is null"); } throw new ClassCastException(this.getClass().getName() + " != " + o.getClass().getName()); } /** Write this object. Write the superclass first. * @param out the output */ @Override public void writeExternal(ObjectOutput out) throws IOException { super.writeExternal (out); out.writeObject(keyAsObject); } /** Read this object. Read the superclass first. * @param in the input */ @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { super.readExternal (in); keyAsObject = in.readObject(); } } api/src/java/javax/jdo/identity/package.html100664 2005 12500110371 21342 0ustarmbouschenstaff 0 0 Identity package This package contains the JDO specification identity interfaces and classes. api/src/java/javax/jdo/identity/ShortIdentity.java100664 10076 12500110371 22564 0ustarmbouschenstaff 0 0 /* * 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. */ /* * ShortIdentity.java * */ package javax.jdo.identity; import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectOutput; /** This class is for identity with a single short field. * @version 2.0 */ public class ShortIdentity extends SingleFieldIdentity { private short key; private void construct(short key) { this.key = key; hashCode = hashClassName() ^ key; } /** Constructor with class and key. * @param pcClass the class * @param key the key */ public ShortIdentity (Class pcClass, short key) { super(pcClass); construct(key); } /** Constructor with class and key. * @param pcClass the class * @param key the key */ public ShortIdentity (Class pcClass, Short key) { super(pcClass); setKeyAsObject(key); construct(key.shortValue()); } /** Constructor with class and key. * @param pcClass the class * @param str the key */ public ShortIdentity (Class pcClass, String str) { super(pcClass); assertKeyNotNull(str); construct(Short.parseShort (str)); } /** Constructor only for Externalizable. */ public ShortIdentity () { } /** Return the key. * @return the key */ public short getKey () { return key; } /** Return the String form of the key. * @return the String form of the key */ public String toString () { return Short.toString(key); } /** Determine if the other object represents the same object id. * @param obj the other object * @return true if both objects represent the same object id */ public boolean equals (Object obj) { if (this == obj) { return true; } else if (!super.equals (obj)) { return false; } else { ShortIdentity other = (ShortIdentity) obj; return key == other.key; } } /** Determine the ordering of identity objects. * @param o Other identity * @return The relative ordering between the objects * @since 2.2 */ public int compareTo(Object o) { if (o instanceof ShortIdentity) { ShortIdentity other = (ShortIdentity)o; int result = super.compare(other); if (result == 0) { return (key - other.key); } else { return result; } } else if (o == null) { throw new ClassCastException("object is null"); } throw new ClassCastException(this.getClass().getName() + " != " + o.getClass().getName()); } /** Create the key as an Object. * @return the key as an Object * @since 2.0 */ protected Object createKeyAsObject() { return new Short(key); } /** Write this object. Write the superclass first. * @param out the output */ public void writeExternal(ObjectOutput out) throws IOException { super.writeExternal (out); out.writeShort(key); } /** Read this object. Read the superclass first. * @param in the input */ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { super.readExternal (in); key = in.readShort(); } } api/src/java/javax/jdo/identity/SingleFieldIdentity.java100664 13611 12500110371 23650 0ustarmbouschenstaff 0 0 /* * 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. */ /* * SingleFieldIdentity.java * */ package javax.jdo.identity; import java.io.Externalizable; import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectOutput; import javax.jdo.JDOFatalInternalException; import javax.jdo.JDONullIdentityException; import javax.jdo.spi.I18NHelper; /** This class is the abstract base class for all single field identity * classes. A common case of application identity uses exactly one * persistent field in the class to represent identity. In this case, * the application can use a standard JDO class instead of creating * a new user-defined class for the purpose. * @version 2.0 */ public abstract class SingleFieldIdentity implements Externalizable, Comparable { /** The Internationalization message helper. */ protected static I18NHelper msg = I18NHelper.getInstance ("javax.jdo.Bundle"); //NOI18N /** The class of the target object. */ transient private Class targetClass; /** The name of the class of the target object. */ private String targetClassName; /** The hashCode. */ protected int hashCode; /** The key as an Object. */ protected Object keyAsObject; /** Constructor with target class. * @param pcClass the class of the target * @since 2.0 */ protected SingleFieldIdentity(Class pcClass) { if (pcClass == null) throw new NullPointerException(); targetClass = pcClass; targetClassName = pcClass.getName(); } /** Constructor only for Externalizable. * @since 2.0 */ public SingleFieldIdentity () { } /** Set the given key as the key for this instance. * Compute the hash code for the instance. * @since 2.0 */ protected void setKeyAsObject(Object key) { assertKeyNotNull(key); keyAsObject = key; } /** Assert that the key is not null. Throw a JDONullIdentityException * if the given key is null. * @since 2.0 */ protected void assertKeyNotNull(Object key) { if (key == null) { throw new JDONullIdentityException( msg.msg("EXC_SingleFieldIdentityNullParameter")); //NOI18N } } /** Return the target class. * @return the target class. * @since 2.0 */ public Class getTargetClass() { return targetClass; } /** Return the target class name. * @return the target class name. * @since 2.0 */ public String getTargetClassName() { return targetClassName; } /** Return the key as an Object. The method is synchronized to avoid * race conditions in multi-threaded environments. * @return the key as an Object. * @since 2.0 */ public synchronized Object getKeyAsObject() { if (keyAsObject == null) { keyAsObject = createKeyAsObject(); } return keyAsObject; } /** Create the key as an Object. * @return the key as an Object; * @since 2.0 */ protected Object createKeyAsObject() { throw new JDOFatalInternalException (msg.msg("EXC_CreateKeyAsObjectMustNotBeCalled")); } /** Check the class and class name and object type. If restored * from serialization, class will be null so compare class name. * @param obj the other object * @return true if the class or class name is the same */ public boolean equals(Object obj) { if (this == obj) { return true; } else if (obj == null || this.getClass() != obj.getClass()) { return false; } else { SingleFieldIdentity other = (SingleFieldIdentity) obj; if (targetClass != null && targetClass == other.targetClass) return true; return targetClassName.equals (other.targetClassName); } } /** Return the hash code of the class name. * @return the hash code of the class name * @since 2.0 */ protected int hashClassName() { return targetClassName.hashCode(); } /** Return the cached hash code. * @return the cached hash code. */ public int hashCode() { return hashCode; } /** Write to the output stream. * @param out the stream */ public void writeExternal(ObjectOutput out) throws IOException { out.writeObject(targetClassName); out.writeInt(hashCode); } /** Read from the input stream. * Creates a new instance with the target class name set */ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { targetClass = null; targetClassName = (String)in.readObject(); hashCode = in.readInt(); } /** Determine the ordering of identity objects. Only the class name * is compared. This method is only used by subclasses. * @param o Other identity * @return The relative ordering between the objects * @since 2.2 */ protected int compare(SingleFieldIdentity o) { return targetClassName.compareTo(o.targetClassName); } } api/src/java/javax/jdo/identity/StringIdentity.java100664 6773 12500110371 22724 0ustarmbouschenstaff 0 0 /* * 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. */ /* * StringIdentity.java * */ package javax.jdo.identity; import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectOutput; /** This class is for identity with a single String field. * @version 2.0 */ public class StringIdentity extends SingleFieldIdentity { /** The key is stored in the superclass field keyAsObject. */ /** Constructor with class and key. * @param pcClass the class * @param key the key */ public StringIdentity (Class pcClass, String key) { super (pcClass); setKeyAsObject(key); hashCode = hashClassName() ^ key.hashCode(); } /** Constructor only for Externalizable. */ public StringIdentity () { } /** Return the key. * @return the key */ public String getKey () { return (String)keyAsObject; } /** Return the String form of the key. * @return the String form of the key */ public String toString () { return (String)keyAsObject; } /** Determine if the other object represents the same object id. * @param obj the other object * @return true if both objects represent the same object id */ public boolean equals (Object obj) { if (this == obj) { return true; } else if (!super.equals (obj)) { return false; } else { StringIdentity other = (StringIdentity) obj; return keyAsObject.equals(other.keyAsObject); } } /** Determine the ordering of identity objects. * @param o Other identity * @return The relative ordering between the objects * @since 2.2 */ public int compareTo(Object o) { if (o instanceof StringIdentity) { StringIdentity other = (StringIdentity)o; int result = super.compare(other); if (result == 0) { return ((String)keyAsObject).compareTo((String)other.keyAsObject); } else { return result; } } else if (o == null) { throw new ClassCastException("object is null"); } throw new ClassCastException(this.getClass().getName() + " != " + o.getClass().getName()); } /** Write this object. Write the superclass first. * @param out the output */ public void writeExternal(ObjectOutput out) throws IOException { super.writeExternal (out); out.writeObject(keyAsObject); } /** Read this object. Read the superclass first. * @param in the input */ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { super.readExternal (in); keyAsObject = (String)in.readObject(); } } api/src/java/javax/jdo/InstanceCallbacks.java100664 6147 12500110371 21452 0ustarmbouschenstaff 0 0 /* * 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. */ /* * InstanceCallbacks.java * */ package javax.jdo; /** A PersistenceCapable class that provides callback methods for life * cycle events implements this interface. * *

For JDO 2.0, InstanceCallbacks has been refactored to extend * four other interfaces, without changing any of the methods or semantics. * This allows fine-grained control over callbacks, for * example to allow a class to implement the load callback without * implementing any of the other callbacks. For backward compatibility * with JDO 1.0, the InstanceCallbacks interface is preserved. * *

Classes which include non-persistent fields whose values depend * on the values of persistent fields require callbacks on specific * JDO instance life cycle events in order to correctly populate the * values in these fields. * *

The callbacks might also be used if the persistent instances * need to be put into the runtime infrastructure of the application. * For example, a persistent instance might notify other instances * on changes to state. The persistent instance might be in a list of * managed instances. When the persistent instance is made hollow, * it can no longer generate change events, and the persistent * instance should be removed from the list of managed instances. * *

To implement this, the application programmer would implement * jdoPostLoad to put itself into the list of managed * instances, and implement jdoPreClear to remove itself from * the list. With JDO 1.0, the domain class would be declared to implement * InstanceCallbacks. With JDO 2.0, the domain class * would be declared to implement * javax.jdo.listener.LoadCallback and * javax.jdo.listener.ClearCallback. * *

Note that JDO does not manage the state of non-persistent * fields, and when a JDO instance transitions to hollow, JDO clears * the persistent fields. It is the programmer's responsibility to * clear non-persistent fields so that garbage collection of * referred instances can occur. * * @since 1.0 * @version 2.0 */ public interface InstanceCallbacks extends javax.jdo.listener.ClearCallback, javax.jdo.listener.DeleteCallback, javax.jdo.listener.LoadCallback, javax.jdo.listener.StoreCallback { } api/src/java/javax/jdo/JDOCanRetryException.java100664 6027 12500110371 22046 0ustarmbouschenstaff 0 0 /* * 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. */ /* * JDOCanRetryException.java * */ package javax.jdo; /** This is the base class for exceptions that can be retried. * * @version 1.0 */ public class JDOCanRetryException extends JDOException { /** * Constructs a new JDOCanRetryException without a detail message. */ public JDOCanRetryException() { } /** * Constructs a new JDOCanRetryException with the specified detail message. * @param msg the detail message. */ public JDOCanRetryException(String msg) { super(msg); } /** * Constructs a new JDOCanRetryException with the specified detail * message and nested Throwables. * @param msg the detail message. * @param nested the nested Throwable[]. */ public JDOCanRetryException(String msg, Throwable[] nested) { super(msg, nested); } /** * Constructs a new JDOCanRetryException with the specified detail * message and nested Throwables. * @param msg the detail message. * @param nested the nested Throwable. */ public JDOCanRetryException(String msg, Throwable nested) { super(msg, nested); } /** Constructs a new JDOCanRetryException with the specified detail message * and failed object. * @param msg the detail message. * @param failed the failed object. */ public JDOCanRetryException(String msg, Object failed) { super(msg, failed); } /** Constructs a new JDOCanRetryException with the specified detail message, * nested Throwables, and failed object. * @param msg the detail message. * @param nested the nested Throwable[]. * @param failed the failed object. */ public JDOCanRetryException(String msg, Throwable[] nested, Object failed) { super(msg, nested, failed); } /** Constructs a new JDOCanRetryException with the specified detail message, * nested Throwables, and failed object. * @param msg the detail message. * @param nested the nested Throwable. * @param failed the failed object. */ public JDOCanRetryException(String msg, Throwable nested, Object failed) { super(msg, nested, failed); } } api/src/java/javax/jdo/JDODataStoreException.java100664 6060 12500110371 22202 0ustarmbouschenstaff 0 0 /* * 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. */ /* * JDODataStoreException.java * */ package javax.jdo; /** This class represents data store exceptions that can be retried. * * @version 1.0 */ public class JDODataStoreException extends JDOCanRetryException { /** * Constructs a new JDODataStoreException without a detail message. */ public JDODataStoreException() { } /** * Constructs a new JDODataStoreException with the specified detail message. * @param msg the detail message. */ public JDODataStoreException(String msg) { super(msg); } /** * Constructs a new JDODataStoreException with the specified * detail message and nested Throwables. * @param msg the detail message. * @param nested the nested Throwable[]. */ public JDODataStoreException(String msg, Throwable[] nested) { super(msg, nested); } /** * Constructs a new JDODataStoreException with the specified * detail message and nested Throwables. * @param msg the detail message. * @param nested the nested Throwable. */ public JDODataStoreException(String msg, Throwable nested) { super(msg, nested); } /** Constructs a new JDODataStoreException with the specified detail message * and failed object. * @param msg the detail message. * @param failed the failed object. */ public JDODataStoreException(String msg, Object failed) { super(msg, failed); } /** Constructs a new JDODataStoreException with the specified detail message, * nested Throwables, and failed object. * @param msg the detail message. * @param nested the nested Throwable[]. * @param failed the failed object. */ public JDODataStoreException(String msg, Throwable[] nested, Object failed) { super(msg, nested, failed); } /** Constructs a new JDODataStoreException with the specified detail message, * nested Throwables, and failed object. * @param msg the detail message. * @param nested the nested Throwable. * @param failed the failed object. */ public JDODataStoreException(String msg, Throwable nested, Object failed) { super(msg, nested, failed); } } api/src/java/javax/jdo/JDODetachedFieldAccessException.java100664 5014 12500110371 24101 0ustarmbouschenstaff 0 0 /* * 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. */ /* * JDODetachedFieldAccessException.java * */ package javax.jdo; /** This class represents exceptions caused by access of an unloaded field while * the instance is detached. * * @version 2.0 * @since 2.0 */ public class JDODetachedFieldAccessException extends JDOUserException { /** * Constructs a new JDODetachedFieldAccessException without a * detail message. * @since 2.0 */ public JDODetachedFieldAccessException() { } /** * Constructs a new JDODetachedFieldAccessException with the * specified detail message. * @param msg the detail message. * @since 2.0 */ public JDODetachedFieldAccessException(String msg) { super(msg); } /** Constructs a new JDODetachedFieldAccessException * with the specified detail message * and failed object. * @param msg the detail message. * @param failed the failed object. */ public JDODetachedFieldAccessException(String msg, Object failed) { super(msg, failed); } /** * Constructs a new JDODetachedFieldAccessException with the * specified detail message and nested Throwables. * @param msg the detail message. * @param nested the nested Throwable[]. * @since 2.0 */ public JDODetachedFieldAccessException(String msg, Throwable[] nested) { super(msg, nested); } /** * Constructs a new JDODetachedFieldAccessException with the * specified detail message and nested Throwables. * @param msg the detail message. * @param nested the nested Throwable. * @since 2.0 */ public JDODetachedFieldAccessException(String msg, Throwable nested) { super(msg, nested); } } api/src/java/javax/jdo/JDOEnhanceException.java100664 3770 12500110371 21662 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo; /** * Exception thrown when an error occurs during enhancement. * @since 3.0 */ public class JDOEnhanceException extends JDOException { /** * Constructs a new JDOEnhanceException without a * detail message. */ public JDOEnhanceException() { } /** * Constructs a new JDOEnhanceException with the * specified detail message. * @param msg the detail message. */ public JDOEnhanceException(String msg) { super(msg); } /** * Constructs a new JDOEnhanceException with the * specified detail message and nested Throwables. * @param msg the detail message. * @param nested the nested Throwable[]. */ public JDOEnhanceException(String msg, Throwable[] nested) { super(msg, nested); } /** * Constructs a new JDOEnhanceException with the * specified detail message and nested Throwables. * @param msg the detail message. * @param nested the nested Throwable. */ public JDOEnhanceException(String msg, Throwable nested) { super(msg, nested); } } api/src/java/javax/jdo/JDOEnhancer.java100664 13052 12500110371 20177 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo; import java.lang.instrument.ClassFileTransformer; import java.util.Properties; import javax.jdo.metadata.JDOMetadata; /** * Interface for a JDO Enhancer. * @since 3.0 */ public interface JDOEnhancer extends ClassFileTransformer { /** * Return non-configurable properties of this JDOEnhancer. * Properties with keys "VendorName" and "VersionNumber" are required. * Other keys are optional. * @return the non-configurable properties of this JDOEnhancer. */ Properties getProperties(); /** * Whether to provide verbose output * @param flag Verbose? * @return The enhancer */ JDOEnhancer setVerbose(boolean flag); /** * Mutator to set the location where enhanced classes are written. * Mutator to set the location where enhanced classes are written. * If this method is not called, classes will be enhanced in place, * overwriting the existing classes. If overwriting classes in a jar file, * the existing files in the jar file will be written unchanged except * for the enhanced classes. The directory name can be absolute or relative. * @param dirName Name of the directory * @return The enhancer */ JDOEnhancer setOutputDirectory(String dirName); /** * Mutator to set the class loader to use for loading classes. * @param loader ClassLoader to use * @return The enhancer */ JDOEnhancer setClassLoader(ClassLoader loader); /** * Add a persistence-unit to the items to be enhanced. * @param persistenceUnit Name of the persistence unit * @return The enhancer */ JDOEnhancer addPersistenceUnit(String persistenceUnit); /** * Add an in-memory class to the items to be enhanced. * The class name should be of the form "mydomain.MyClass". * @param className Name of the class * @param bytes The bytes of the class * @return The enhancer */ JDOEnhancer addClass(String className, byte[] bytes); /** * Add class(es) to the items to be enhanced. * The class names can be absolute file names, relative file names, or * names of CLASSPATH resources. * @param classNames Names of the classes * @return The enhancer */ JDOEnhancer addClasses(String... classNames); /** * Add metadata file(s) to the items to be enhanced. * The metadata file names can be absolute file names, relative file names, or * names of CLASSPATH resources. They should be JDO XML metadata files. * @param metadataFiles Names of the files * @return The enhancer */ JDOEnhancer addFiles(String... metadataFiles); /** * Add a jar file to the items to be enhanced. * The jar file name can be absolute, or relative or a CLASSPATH resource. * @param jarFileName Name of the jar file * @return The enhancer */ JDOEnhancer addJar(String jarFileName); /** * Method to enhance the items specified using addJar, addFiles, addClasses, addClass, * addPersistenceUnit. * @return Number of classes enhanced * @throws JDOEnhanceException if an error occurs during enhancement. If multiple * errors occur then the nested exceptions provides this detail. */ int enhance(); /** * Method to validate the items specified using addJar, addFiles, addClasses, addClass, * addPersistenceUnit. * @return Number of classes validated * @throws JDOEnhanceException if an error occurs during validation. If multiple * errors occur then the nested exceptions provides this detail. */ int validate(); /** * Method to retrieve the (enhanced) bytes of the specified class. * Only applies to the classes enhanced in the most recent enhance() call. * If no enhance has yet been performed will throw a JDOEnhanceException. * If the specified class hasn't been enhanced then will throw a JDOEnhanceException. * @param className Name of the class (of the form "mydomain.MyClass") * @return Enhanced bytes */ byte[] getEnhancedBytes(String className); /** * Method to register metadata with the enhancement process managed by this * JDOEnhancer. * Metadata can be created using the method {@link #newMetadata}. * If there is already metadata registered for a class contained in this metadata * object then a JDOUserException will be thrown. * @param metadata The Metadata to register. * @since 3.0 */ void registerMetadata(JDOMetadata metadata); /** * Method to return a new metadata object that can be subsequently modified * and registered with the enhancement process using the method {@link #registerMetadata}. * @return The metadata * @since 3.0 */ JDOMetadata newMetadata(); } api/src/java/javax/jdo/JDOException.java100664 24712 12500110371 20417 0ustarmbouschenstaff 0 0 /* * 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. */ /* * JDOException.java * */ package javax.jdo; import javax.jdo.spi.I18NHelper; /** This is the root of all JDO Exceptions. It contains an optional detail * message, an optional nested Throwable array and an optional failed object. * @author Craig Russell * @version 1.0.2 */ public class JDOException extends java.lang.RuntimeException { /** This exception was generated because of an exception in the runtime library. * @serial the nested Throwable array */ Throwable[] nested; /** This exception may be the result of incorrect parameters supplied * to an API. This is the object from which the user can determine * the cause of the problem. * @serial the failed Object */ Object failed; /** The Internationalization message helper. */ private static I18NHelper msg = I18NHelper.getInstance ("javax.jdo.Bundle"); //NOI18N /** Flag indicating whether printStackTrace is being executed. */ private boolean inPrintStackTrace = false; /** * Constructs a new JDOException without a detail message. */ public JDOException() { } /** * Constructs a new JDOException with the specified detail message. * @param msg the detail message. */ public JDOException(String msg) { super(msg); } /** Constructs a new JDOException with the specified detail message * and nested Throwables. * @param msg the detail message. * @param nested the nested Throwable[]. */ public JDOException(String msg, Throwable[] nested) { super(msg); this.nested = nested; } /** Constructs a new JDOException with the specified detail message * and nested Throwable. * @param msg the detail message. * @param nested the nested Throwable. */ public JDOException(String msg, Throwable nested) { super(msg); this.nested = new Throwable[] {nested}; } /** Constructs a new JDOException with the specified detail message * and failed object. * @param msg the detail message. * @param failed the failed object. */ public JDOException(String msg, Object failed) { super(msg); this.failed = failed; } /** Constructs a new JDOException with the specified detail message, * nested Throwables, and failed object. * @param msg the detail message. * @param nested the nested Throwable[]. * @param failed the failed object. */ public JDOException(String msg, Throwable[] nested, Object failed) { super(msg); this.nested = nested; this.failed = failed; } /** Constructs a new JDOException with the specified detail message, * nested Throwable, and failed object. * @param msg the detail message. * @param nested the nested Throwable. * @param failed the failed object. */ public JDOException(String msg, Throwable nested, Object failed) { super(msg); this.nested = new Throwable[] {nested}; this.failed = failed; } /** The exception may include a failed object. * @return the failed object. */ public Object getFailedObject() { return failed; } /** The exception may have been caused by multiple exceptions in the runtime. * If multiple objects caused the problem, each failed object will have * its own Exception. * @return the nested Throwable array. */ public Throwable[] getNestedExceptions() { return nested; } /** Often there is only one nested exception, and this method returns it. * If there are more than one, then this method returns the first nested * exception. If there is no nested exception, then null is returned. * @return the first or only nested Throwable. * @since 1.0.1 */ public synchronized Throwable getCause() { // super.printStackTrace calls getCause to handle the cause. // Returning null prevents the superclass from handling the cause; // instead the local implementation of printStackTrace should // handle the cause. Otherwise, the cause is printed twice. if (nested == null || nested.length == 0 || inPrintStackTrace) { return null; } else { return nested[0]; } } /** JDK 1.4 includes a new chaining mechanism for Throwable, but since * JDO has its own "legacy" chaining mechanism, the "standard" mechanism * cannot be used. This method always throws a JDOFatalInternalException. * @param cause ignored. * @return never. */ public Throwable initCause(Throwable cause) { throw new JDOFatalInternalException(msg.msg("ERR_CannotInitCause")); } /** The String representation includes the name of the class, * the descriptive comment (if any), * the String representation of the failed Object (if any), * and the String representation of the nested Throwables (if any). * @return the String. */ public synchronized String toString() { int len = nested==null?0:nested.length; // calculate approximate size of the String to return StringBuffer sb = new StringBuffer (10 + 100 * len); sb.append (super.toString()); // include failed object information if (failed != null) { sb.append ("\n").append (msg.msg ("MSG_FailedObject")); String failedToString = null; try { failedToString = failed.toString(); } catch (Exception ex) { // include the information from the exception thrown by failed.toString Object objectId = JDOHelper.getObjectId(failed); if (objectId == null) { failedToString = msg.msg("MSG_ExceptionGettingFailedToString", //NOI18N exceptionToString(ex)); } else { // include the ObjectId information String objectIdToString = null; try { objectIdToString = objectId.toString(); } catch (Exception ex2) { objectIdToString = exceptionToString(ex2); } failedToString = msg.msg("MSG_ExceptionGettingFailedToStringObjectId", //NOI18N exceptionToString(ex), objectIdToString); } } sb.append (failedToString); } // include nested Throwable information, but only if not called by // printStackTrace; the stacktrace will include the cause anyway. if (len > 0 && !inPrintStackTrace) { sb.append ("\n").append (msg.msg ("MSG_NestedThrowables")).append ("\n"); Throwable exception = nested[0]; sb.append (exception==null?"null":exception.toString()); //NOI18N for (int i=1; iJDOException and its backtrace to the * standard error output. * Print nested Throwables' stack trace as well. */ public void printStackTrace() { printStackTrace (System.err); } /** * Prints this JDOException and its backtrace to the * specified print stream. * Print nested Throwables' stack trace as well. * @param s PrintStream to use for output */ public synchronized void printStackTrace(java.io.PrintStream s) { int len = nested==null?0:nested.length; synchronized (s) { inPrintStackTrace = true; super.printStackTrace(s); if (len > 0) { s.println (msg.msg ("MSG_NestedThrowablesStackTrace")); for (int i=0; iJDOException and its backtrace to the specified * print writer. * Print nested Throwables' stack trace as well. * @param s PrintWriter to use for output */ public synchronized void printStackTrace(java.io.PrintWriter s) { int len = nested==null?0:nested.length; synchronized (s) { inPrintStackTrace = true; super.printStackTrace(s); if (len > 0) { s.println (msg.msg ("MSG_NestedThrowablesStackTrace")); for (int i=0; iJDOFatalDataStoreException without a detail message. */ public JDOFatalDataStoreException() { } /** * Constructs a new JDOFatalDataStoreException with the specified detail message. * @param msg the detail message. */ public JDOFatalDataStoreException(String msg) { super(msg); } /** Constructs a new JDOFatalDataStoreException with the specified detail message * and failed object. * @param msg the detail message. * @param failed the failed object. */ public JDOFatalDataStoreException(String msg, Object failed) { super(msg, failed); } /** * Constructs a new JDOFatalDataStoreException with the specified * detail message and nested Throwables. * @param msg the detail message. * @param nested the nested Throwable[]. */ public JDOFatalDataStoreException(String msg, Throwable[] nested) { super(msg, nested); } /** * Constructs a new JDOFatalDataStoreException with the specified * detail message and nested Throwables. * @param msg the detail message. * @param nested the nested Throwable. */ public JDOFatalDataStoreException(String msg, Throwable nested) { super(msg, nested); } /** * Constructs a new JDOFatalDataStoreException with the specified * detail message, nested Throwables, and failed object. * @param msg the detail message. * @param nested the nested Throwable[]. * @param failed the failed object. */ public JDOFatalDataStoreException(String msg, Throwable[] nested, Object failed) { super(msg, nested, failed); } /** * Constructs a new JDOFatalDataStoreException with the specified * detail message, nested Throwables, and failed object. * @param msg the detail message. * @param nested the nested Throwable. * @param failed the failed object. */ public JDOFatalDataStoreException(String msg, Throwable nested, Object failed) { super(msg, nested, failed); } } api/src/java/javax/jdo/JDOFatalException.java100664 6074 12500110371 21350 0ustarmbouschenstaff 0 0 /* * 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. */ /* * JDOFatalException.java * */ package javax.jdo; /** This class represents exceptions that are fatal; that is, the condition * that caused it cannot be bypassed even if the operation is retried. * * @version 1.0 */ public class JDOFatalException extends JDOException { /** * Constructs a new JDOFatalException without a detail message. */ public JDOFatalException() { } /** * Constructs a new JDOFatalException with the specified detail message. * @param msg the detail message. */ public JDOFatalException(String msg) { super(msg); } /** * Constructs a new JDOFatalException with the specified detail * message and nested Throwables. * @param msg the detail message. * @param nested the nested Throwable[]. */ public JDOFatalException(String msg, Throwable[] nested) { super(msg, nested); } /** * Constructs a new JDOFatalException with the specified detail * message and nested Throwables. * @param msg the detail message. * @param nested the nested Throwable. */ public JDOFatalException(String msg, Throwable nested) { super(msg, nested); } /** Constructs a new JDOFatalException with the specified detail message * and failed object. * @param msg the detail message. * @param failed the failed object. */ public JDOFatalException(String msg, Object failed) { super(msg, failed); } /** Constructs a new JDOFatalException with the specified detail message, * nested Throwables, and failed object. * @param msg the detail message. * @param nested the nested Throwable[]. * @param failed the failed object. */ public JDOFatalException(String msg, Throwable[] nested, Object failed) { super(msg, nested, failed); } /** Constructs a new JDOFatalException with the specified detail message, * nested Throwables, and failed object. * @param msg the detail message. * @param nested the nested Throwable. * @param failed the failed object. */ public JDOFatalException(String msg, Throwable nested, Object failed) { super(msg, nested, failed); } } api/src/java/javax/jdo/JDOFatalInternalException.java100664 6346 12500110371 23047 0ustarmbouschenstaff 0 0 /* * 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. */ /* * JDOFatalInternalException.java * */ package javax.jdo; /** This class represents errors in the implementation for which no user * error handling is possible. The error should be reported to the JDO * vendor for corrective action. * * @version 1.0 */ public class JDOFatalInternalException extends JDOFatalException { /** * Constructs a new JDOFatalInternalException without a detail message. */ public JDOFatalInternalException() { } /** * Constructs a new JDOFatalInternalException with the specified detail message. * @param msg the detail message. */ public JDOFatalInternalException(String msg) { super(msg); } /** * Constructs a new JDOFatalInternalException with the specified * detail message and nested Throwables. * @param msg the detail message. * @param nested the nested Throwable[]. */ public JDOFatalInternalException(String msg, Throwable[] nested) { super(msg, nested); } /** * Constructs a new JDOFatalInternalException with the specified * detail message and nested Throwables. * @param msg the detail message. * @param nested the nested Throwable. */ public JDOFatalInternalException(String msg, Throwable nested) { super(msg, nested); } /** * Constructs a new JDOFatalInternalException * with the specified detail message and failed object. * @param msg the detail message. * @param failed the failed object. */ public JDOFatalInternalException(String msg, Object failed) { super(msg, failed); } /** * Constructs a new JDOFatalInternalException with the specified * detail message, nested Throwables, and failed object. * @param msg the detail message. * @param nested the nested Throwable[]. * @param failed the failed object. */ public JDOFatalInternalException(String msg, Throwable[] nested, Object failed) { super(msg, nested, failed); } /** * Constructs a new JDOFatalInternalException with the specified * detail message, nested Throwables, and failed object. * @param msg the detail message. * @param nested the nested Throwable. * @param failed the failed object. */ public JDOFatalInternalException(String msg, Throwable nested, Object failed) { super(msg, nested, failed); } } api/src/java/javax/jdo/JDOFatalUserException.java100664 6047 12500110371 22207 0ustarmbouschenstaff 0 0 /* * 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. */ /* * JDOUserException.java * */ package javax.jdo; /** This class represents user errors that cannot be retried. * * @version 1.0 */ public class JDOFatalUserException extends JDOFatalException { /** * Constructs a new JDOFatalUserException without a detail message. */ public JDOFatalUserException() { } /** * Constructs a new JDOFatalUserException with the specified detail message. * @param msg the detail message. */ public JDOFatalUserException(String msg) { super(msg); } /** * Constructs a new JDOFatalUserException with the specified * detail message and nested Throwables. * @param msg the detail message. * @param nested the nested Throwable[]. */ public JDOFatalUserException(String msg, Throwable[] nested) { super(msg, nested); } /** * Constructs a new JDOFatalUserException with the specified * detail message and nested Throwables. * @param msg the detail message. * @param nested the nested Throwable. */ public JDOFatalUserException(String msg, Throwable nested) { super(msg, nested); } /** Constructs a new JDOFatalUserException with the specified * detail message and failed object. * @param msg the detail message. * @param failed the failed object. */ public JDOFatalUserException(String msg, Object failed) { super(msg, failed); } /** Constructs a new JDOFatalUserException with the specified * detail message, nested Throwables, and failed object. * @param msg the detail message. * @param nested the nested Throwable[]. * @param failed the failed object. */ public JDOFatalUserException(String msg, Throwable[] nested, Object failed) { super(msg, nested, failed); } /** Constructs a new JDOFatalUserException with the specified * detail message, nested Throwables, and failed object. * @param msg the detail message. * @param nested the nested Throwable. * @param failed the failed object. */ public JDOFatalUserException(String msg, Throwable nested, Object failed) { super(msg, nested, failed); } } api/src/java/javax/jdo/JDOHelper.java100664 244711 12500110371 17723 0ustarmbouschenstaff 0 0 /* * 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. */ /* * JDOHelper.java * */ package javax.jdo; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.net.URL; import java.security.AccessController; import java.security.PrivilegedAction; import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.Enumeration; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Properties; import javax.jdo.spi.I18NHelper; import javax.jdo.spi.JDOImplHelper; import javax.jdo.spi.JDOImplHelper.StateInterrogationBooleanReturn; import javax.jdo.spi.JDOImplHelper.StateInterrogationObjectReturn; import javax.jdo.spi.PersistenceCapable; import javax.jdo.spi.StateInterrogation; import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; import javax.rmi.PortableRemoteObject; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.FactoryConfigurationError; import javax.xml.parsers.ParserConfigurationException; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; import org.w3c.dom.NodeList; import org.xml.sax.ErrorHandler; import org.xml.sax.SAXException; import org.xml.sax.SAXParseException; /** * This class can be used by a JDO-aware application to call the JDO behavior * of PersistenceCapable instances without declaring them to be * PersistenceCapable. *

It is also used to acquire a PersistenceManagerFactory via * various methods. *

This helper class defines static methods that allow a JDO-aware * application to examine the runtime state of instances. For example, * an application can discover whether the instance is persistent, * transactional, dirty, new, deleted, or detached; and to get its associated * PersistenceManager if it has one. * * @version 2.1 */ public class JDOHelper implements Constants { /** * A mapping from jdoconfig.xsd element attributes to PMF properties. */ static final Map ATTRIBUTE_PROPERTY_XREF = createAttributePropertyXref(); /** The Internationalization message helper. */ private final static I18NHelper msg = I18NHelper.getInstance ("javax.jdo.Bundle"); //NOI18N /** * Creates a map from jdoconfig.xsd element attributes to PMF properties. * @return An unmodifiable Map of jdoconfig.xsd element attributes to PMF * properties. */ static Map createAttributePropertyXref() { Map xref = new HashMap(); xref.put( PMF_ATTRIBUTE_CLASS, PROPERTY_PERSISTENCE_MANAGER_FACTORY_CLASS); xref.put( PMF_ATTRIBUTE_CONNECTION_DRIVER_NAME, PROPERTY_CONNECTION_DRIVER_NAME); xref.put( PMF_ATTRIBUTE_CONNECTION_FACTORY_NAME, PROPERTY_CONNECTION_FACTORY_NAME); xref.put( PMF_ATTRIBUTE_CONNECTION_FACTORY2_NAME, PROPERTY_CONNECTION_FACTORY2_NAME); xref.put( PMF_ATTRIBUTE_CONNECTION_PASSWORD, PROPERTY_CONNECTION_PASSWORD); xref.put( PMF_ATTRIBUTE_CONNECTION_URL, PROPERTY_CONNECTION_URL); xref.put( PMF_ATTRIBUTE_CONNECTION_USER_NAME, PROPERTY_CONNECTION_USER_NAME); xref.put( PMF_ATTRIBUTE_IGNORE_CACHE, PROPERTY_IGNORE_CACHE); xref.put( PMF_ATTRIBUTE_MAPPING, PROPERTY_MAPPING); xref.put( PMF_ATTRIBUTE_MULTITHREADED, PROPERTY_MULTITHREADED); xref.put( PMF_ATTRIBUTE_NONTRANSACTIONAL_READ, PROPERTY_NONTRANSACTIONAL_READ); xref.put( PMF_ATTRIBUTE_NONTRANSACTIONAL_WRITE, PROPERTY_NONTRANSACTIONAL_WRITE); xref.put( PMF_ATTRIBUTE_OPTIMISTIC, PROPERTY_OPTIMISTIC); xref.put( PMF_ATTRIBUTE_PERSISTENCE_UNIT_NAME, PROPERTY_PERSISTENCE_UNIT_NAME); xref.put( PMF_ATTRIBUTE_NAME, PROPERTY_NAME); xref.put( PMF_ATTRIBUTE_RESTORE_VALUES, PROPERTY_RESTORE_VALUES); xref.put( PMF_ATTRIBUTE_RETAIN_VALUES, PROPERTY_RETAIN_VALUES); xref.put( PMF_ATTRIBUTE_DETACH_ALL_ON_COMMIT, PROPERTY_DETACH_ALL_ON_COMMIT); xref.put( PMF_ATTRIBUTE_SERVER_TIME_ZONE_ID, PROPERTY_SERVER_TIME_ZONE_ID); xref.put( PMF_ATTRIBUTE_DATASTORE_READ_TIMEOUT_MILLIS, PROPERTY_DATASTORE_READ_TIMEOUT_MILLIS); xref.put( PMF_ATTRIBUTE_DATASTORE_WRITE_TIMEOUT_MILLIS, PROPERTY_DATASTORE_WRITE_TIMEOUT_MILLIS); return Collections.unmodifiableMap(xref); } /** The JDOImplHelper instance used for handling non-binary-compatible * implementations. */ private static JDOImplHelper implHelper = (JDOImplHelper) AccessController.doPrivileged( new PrivilegedAction () { public JDOImplHelper run () { return JDOImplHelper.getInstance(); } } ); /** The singleton instance of JDOHelper. * @since 2.1 */ private static JDOHelper instance = new JDOHelper(); /** * Return the singleton instance of JDOHelper. This instance is * thread-safe. * @since 2.1 * @return the thread-safe singleton JDOHelper */ public static JDOHelper getInstance() { return instance; } /** Some applications might prefer to use instance * methods instead of static methods. * @since 2.1 */ public JDOHelper() {} /** The stateless instance used for handling non-binary-compatible * implementations of getPersistenceManager. */ static StateInterrogationObjectReturn getPersistenceManager = new StateInterrogationObjectReturn() { public Object get(Object pc, StateInterrogation si) { return si.getPersistenceManager(pc); } }; /** The stateless instance used for handling non-binary-compatible * implementations of getObjectId. */ static StateInterrogationObjectReturn getObjectId = new StateInterrogationObjectReturn() { public Object get(Object pc, StateInterrogation si) { return si.getObjectId(pc); } }; /** The stateless instance used for handling non-binary-compatible * implementations of getTransactionalObjectId. */ static StateInterrogationObjectReturn getTransactionalObjectId = new StateInterrogationObjectReturn() { public Object get(Object pc, StateInterrogation si) { return si.getTransactionalObjectId(pc); } }; /** The stateless instance used for handling non-binary-compatible * implementations of getVersion. */ static StateInterrogationObjectReturn getVersion = new StateInterrogationObjectReturn() { public Object get(Object pc, StateInterrogation si) { return si.getVersion(pc); } }; /** The stateless instance used for handling non-binary-compatible * implementations of isPersistent. */ static StateInterrogationBooleanReturn isPersistent = new StateInterrogationBooleanReturn() { public Boolean is(Object pc, StateInterrogation si) { return si.isPersistent(pc); } }; /** The stateless instance used for handling non-binary-compatible * implementations of isTransactional. */ static StateInterrogationBooleanReturn isTransactional = new StateInterrogationBooleanReturn() { public Boolean is(Object pc, StateInterrogation si) { return si.isTransactional(pc); } }; /** The stateless instance used for handling non-binary-compatible * implementations of isDirty. */ static StateInterrogationBooleanReturn isDirty = new StateInterrogationBooleanReturn() { public Boolean is(Object pc, StateInterrogation si) { return si.isDirty(pc); } }; /** The stateless instance used for handling non-binary-compatible * implementations of isNew. */ static StateInterrogationBooleanReturn isNew = new StateInterrogationBooleanReturn() { public Boolean is(Object pc, StateInterrogation si) { return si.isNew(pc); } }; /** The stateless instance used for handling non-binary-compatible * implementations of isDeleted. */ static StateInterrogationBooleanReturn isDeleted = new StateInterrogationBooleanReturn() { public Boolean is(Object pc, StateInterrogation si) { return si.isDeleted(pc); } }; /** The stateless instance used for handling non-binary-compatible * implementations of isDetached. */ static StateInterrogationBooleanReturn isDetached = new StateInterrogationBooleanReturn() { public Boolean is(Object pc, StateInterrogation si) { return si.isDetached(pc); } }; /** Return the associated PersistenceManager if there is one. * Transactional and persistent instances return the associated * PersistenceManager. * *

Transient non-transactional instances and instances of classes * that do not implement PersistenceCapable return * null. * @see PersistenceCapable#jdoGetPersistenceManager() * @param pc the PersistenceCapable instance. * @return the PersistenceManager associated with the parameter * instance. */ public static PersistenceManager getPersistenceManager(Object pc) { if (pc instanceof PersistenceCapable) { return ((PersistenceCapable)pc).jdoGetPersistenceManager(); } else { return (PersistenceManager) implHelper.nonBinaryCompatibleGet(pc, getPersistenceManager); } } /** Explicitly mark the parameter instance and field dirty. * Normally, PersistenceCapable classes are able to detect * changes made to their fields. However, if a reference to an array is * given to a method outside the class, and the array is modified, then the * persistent instance is not aware of the change. This API allows the * application to notify the instance that a change was made to a field. * *

Transient instances and instances of classes * that do not implement PersistenceCapable ignore this method. * @see PersistenceCapable#jdoMakeDirty(String fieldName) * @param pc the PersistenceCapable instance. * @param fieldName the name of the field to be marked dirty. */ public static void makeDirty(Object pc, String fieldName) { if (pc instanceof PersistenceCapable) { ((PersistenceCapable)pc).jdoMakeDirty(fieldName); } else { implHelper.nonBinaryCompatibleMakeDirty(pc, fieldName); } } /** Return a copy of the JDO identity associated with the parameter * instance. * *

Persistent instances of PersistenceCapable classes have a * JDO identity managed by the PersistenceManager. This method * returns a copy of the ObjectId that represents the JDO identity. * *

Transient instances and instances of classes that do not implement * PersistenceCapable return null. * *

The ObjectId may be serialized * and later restored, and used with a PersistenceManager from * the same JDO implementation to locate a persistent instance with the same * data store identity. * *

If the JDO identity is managed by the application, then the ObjectId * may be used with a PersistenceManager from any JDO * implementation that supports the PersistenceCapable class. * *

If the JDO identity is not managed by the application or the data * store, then the ObjectId returned is only valid within the current * transaction. *

* @see PersistenceManager#getObjectId(Object pc) * @see PersistenceCapable#jdoGetObjectId() * @see PersistenceManager#getObjectById(Object oid, boolean validate) * @param pc the PersistenceCapable instance. * @return a copy of the ObjectId of the parameter instance as of the * beginning of the transaction. */ public static Object getObjectId(Object pc) { if (pc instanceof PersistenceCapable) { return ((PersistenceCapable)pc).jdoGetObjectId(); } else { return implHelper.nonBinaryCompatibleGet(pc, getObjectId); } } /** Get object ids for a collection of instances. For each instance * in the parameter, the getObjectId method is called. This method * returns one identity instance for each element * in the parameter. The order of iteration of the returned * Collection exactly matches the order of iteration of the * parameter Collection. * @param pcs the persistence-capable instances * @return the object ids of the parameters * @see #getObjectId(Object pc) * @see #getObjectIds(Object[] pcs) * @since 2.0 */ public static Collection getObjectIds(Collection pcs) { ArrayList result = new ArrayList(); for (Iterator it = pcs.iterator(); it.hasNext();) { result.add(getObjectId(it.next())); } return result; } /** Get object ids for an array of instances. For each instance * in the parameter, the getObjectId method is called. This method * returns one identity instance for each element * in the parameter. The order of instances of the returned * array exactly matches the order of instances of the * parameter array. * @param pcs the persistence-capable instances * @return the object ids of the parameters * @see #getObjectId(Object pc) * @see #getObjectIds(Collection pcs) * @since 2.0 */ public static Object[] getObjectIds(Object[] pcs) { Object[] result = new Object[pcs.length]; for (int i = 0; i < pcs.length; ++i) { result[i] = getObjectId(pcs[i]); } return result; } /** Return a copy of the JDO identity associated with the parameter * instance. * * @see PersistenceCapable#jdoGetTransactionalObjectId() * @see PersistenceManager#getObjectById(Object oid, boolean validate) * @param pc the PersistenceCapable instance. * @return a copy of the ObjectId of the parameter instance as modified in * this transaction. */ public static Object getTransactionalObjectId(Object pc) { if (pc instanceof PersistenceCapable) { return ((PersistenceCapable)pc).jdoGetTransactionalObjectId(); } else { return implHelper.nonBinaryCompatibleGet( pc, getTransactionalObjectId); } } /** * Return the version of the instance. * @since 2.0 * @param pc the instance * @return the version of the instance */ public static Object getVersion (Object pc) { if (pc instanceof PersistenceCapable) { return ((PersistenceCapable)pc).jdoGetVersion(); } else { return implHelper.nonBinaryCompatibleGet(pc, getVersion); } } /** Tests whether the parameter instance is dirty. * * Instances that have been modified, deleted, or newly * made persistent in the current transaction return true. * *

Transient instances and instances of classes that do not implement * PersistenceCapable return false. *

* @see javax.jdo.spi.StateManager#makeDirty(PersistenceCapable pc, * String fieldName) * @see PersistenceCapable#jdoIsDirty() * @param pc the PersistenceCapable instance. * @return true if the parameter instance has been modified in * the current transaction. */ public static boolean isDirty(Object pc) { if (pc instanceof PersistenceCapable) { return ((PersistenceCapable)pc).jdoIsDirty(); } else { return implHelper.nonBinaryCompatibleIs(pc, isDirty); } } /** Tests whether the parameter instance is transactional. * * Instances whose state is associated with the current transaction * return true. * *

Transient instances and instances of classes that do not implement * PersistenceCapable return false. * @see PersistenceCapable#jdoIsTransactional() * @param pc the PersistenceCapable instance. * @return true if the parameter instance is transactional. */ public static boolean isTransactional(Object pc) { if (pc instanceof PersistenceCapable) { return ((PersistenceCapable)pc).jdoIsTransactional(); } else { return implHelper.nonBinaryCompatibleIs(pc, isTransactional); } } /** Tests whether the parameter instance is persistent. * * Instances that represent persistent objects in the data store * return true. * *

Transient instances and instances of classes that do not implement * PersistenceCapable return false. *

* @see PersistenceManager#makePersistent(Object pc) * @see PersistenceCapable#jdoIsPersistent() * @param pc the PersistenceCapable instance. * @return true if the parameter instance is persistent. */ public static boolean isPersistent(Object pc) { if (pc instanceof PersistenceCapable) { return ((PersistenceCapable)pc).jdoIsPersistent(); } else { return implHelper.nonBinaryCompatibleIs(pc, isPersistent); } } /** Tests whether the parameter instance has been newly made persistent. * * Instances that have been made persistent in the current transaction * return true. * *

Transient instances and instances of classes that do not implement * PersistenceCapable return false. *

* @see PersistenceManager#makePersistent(Object pc) * @see PersistenceCapable#jdoIsNew() * @param pc the PersistenceCapable instance. * @return true if the parameter instance was made persistent * in the current transaction. */ public static boolean isNew(Object pc) { if (pc instanceof PersistenceCapable) { return ((PersistenceCapable)pc).jdoIsNew(); } else { return implHelper.nonBinaryCompatibleIs(pc, isNew); } } /** Tests whether the parameter instance has been deleted. * * Instances that have been deleted in the current transaction return * true. * *

Transient instances and instances of classes that do not implement * PersistenceCapable return false. *

* @see PersistenceManager#deletePersistent(Object pc) * @see PersistenceCapable#jdoIsDeleted() * @param pc the PersistenceCapable instance. * @return true if the parameter instance was deleted * in the current transaction. */ public static boolean isDeleted(Object pc) { if (pc instanceof PersistenceCapable) { return ((PersistenceCapable)pc).jdoIsDeleted(); } else { return implHelper.nonBinaryCompatibleIs(pc, isDeleted); } } /** * Tests whether the parameter instance has been detached. * * Instances that have been detached return true. * *

Transient instances return false. *

* @see PersistenceCapable#jdoIsDetached() * @return true if this instance is detached. * @since 2.0 * @param pc the instance */ public static boolean isDetached(Object pc) { if (pc instanceof PersistenceCapable) { return ((PersistenceCapable)pc).jdoIsDetached(); } else { return implHelper.nonBinaryCompatibleIs(pc, isDetached); } } /** Accessor for the state of the passed object. * @param pc The object * @return The object state * @since 2.1 */ public static ObjectState getObjectState(Object pc) { if (pc == null) { return null; } if (isDetached(pc)) { if (isDirty(pc)) { // Detached Dirty return ObjectState.DETACHED_DIRTY; } else { // Detached Not Dirty return ObjectState.DETACHED_CLEAN; } } else { if (isPersistent(pc)) { if (isTransactional(pc)) { if (isDirty(pc)) { if (isNew(pc)) { if (isDeleted(pc)) { // Persistent Transactional Dirty New Deleted return ObjectState.PERSISTENT_NEW_DELETED; } else { // Persistent Transactional Dirty New Not Deleted return ObjectState.PERSISTENT_NEW; } } else { if (isDeleted(pc)) { // Persistent Transactional Dirty Not New Deleted return ObjectState.PERSISTENT_DELETED; } else { // Persistent Transactional Dirty Not New Not Deleted return ObjectState.PERSISTENT_DIRTY; } } } else { // Persistent Transactional Not Dirty return ObjectState.PERSISTENT_CLEAN; } } else { if (isDirty(pc)) { // Persistent Nontransactional Dirty return ObjectState.PERSISTENT_NONTRANSACTIONAL_DIRTY; } else { // Persistent Nontransactional Not Dirty return ObjectState.HOLLOW_PERSISTENT_NONTRANSACTIONAL; } } } else { if (isTransactional(pc)) { if (isDirty(pc)) { // Not Persistent Transactional Dirty return ObjectState.TRANSIENT_DIRTY; } else { // Not Persistent Transactional Not Dirty return ObjectState.TRANSIENT_CLEAN; } } else { // Not Persistent Not Transactional return ObjectState.TRANSIENT; } } } } /** Get the anonymous PersistenceManagerFactory configured via * the standard configuration file resource "META-INF/jdoconfig.xml", using * the current thread's context class loader * to locate the configuration file resource(s). * @return the anonymous PersistenceManagerFactory. * @since 2.1 * @see #getPersistenceManagerFactory(Map,String,ClassLoader,ClassLoader) */ public static PersistenceManagerFactory getPersistenceManagerFactory() { ClassLoader cl = getContextClassLoader(); return getPersistenceManagerFactory( null, ANONYMOUS_PERSISTENCE_MANAGER_FACTORY_NAME, cl, cl); } /** Get the anonymous PersistenceManagerFactory configured via * the standard configuration file resource "META-INF/jdoconfig.xml", using * the given class loader. * @return the anonymous PersistenceManagerFactory. * @param pmfClassLoader the ClassLoader used to load resources and classes * @since 2.1 * @see #getPersistenceManagerFactory(Map,String,ClassLoader,ClassLoader) */ public static PersistenceManagerFactory getPersistenceManagerFactory( ClassLoader pmfClassLoader) { return getPersistenceManagerFactory( null, ANONYMOUS_PERSISTENCE_MANAGER_FACTORY_NAME, pmfClassLoader, pmfClassLoader); } /** Get a PersistenceManagerFactory based on a Properties * instance, using the current thread's context class loader to locate the * PersistenceManagerFactory class. * @return the PersistenceManagerFactory. * @param props a Properties instance with properties of the * PersistenceManagerFactory. * @see #getPersistenceManagerFactory(java.util.Map,ClassLoader) */ public static PersistenceManagerFactory getPersistenceManagerFactory (Map props) { return getPersistenceManagerFactory( null, props, getContextClassLoader()); } /** Get a PersistenceManagerFactory based on a * Map and a class loader. * This method delegates to the getPersistenceManagerFactory * method that takes a Map of overrides and a Map of properties, * passing null as the overrides parameter. * @see #getPersistenceManagerFactory(java.util.Map, java.util.Map, ClassLoader) * @return the PersistenceManagerFactory. * @param props a Map with properties of the * PersistenceManagerFactory. * @param pmfClassLoader the class loader used to load the * PersistenceManagerFactory class * @since 1.0 */ public static PersistenceManagerFactory getPersistenceManagerFactory (Map props, ClassLoader pmfClassLoader) { return getPersistenceManagerFactory( null, props, pmfClassLoader); } /** * Get a PersistenceManagerFactory based on a * Map of overrides, a Map of * properties, and a class loader. * The following are standard key names: *
"javax.jdo.PersistenceManagerFactoryClass" *
"javax.jdo.option.Optimistic", *
"javax.jdo.option.RetainValues", *
"javax.jdo.option.RestoreValues", *
"javax.jdo.option.IgnoreCache", *
"javax.jdo.option.NontransactionalRead", *
"javax.jdo.option.NontransactionalWrite", *
"javax.jdo.option.Multithreaded", *
"javax.jdo.option.ConnectionUserName", *
"javax.jdo.option.ConnectionPassword", *
"javax.jdo.option.ConnectionURL", *
"javax.jdo.option.ConnectionFactoryName", *
"javax.jdo.option.ConnectionFactory2Name", *
"javax.jdo.option.Mapping", *
"javax.jdo.mapping.Catalog", *
"javax.jdo.mapping.Schema", *
"javax.jdo.option.PersistenceUnitName", *
"javax.jdo.option.DetachAllOnCommit", *
"javax.jdo.option.CopyOnAttach", *
"javax.jdo.option.ReadOnly", *
"javax.jdo.option.TransactionIsolationLevel", *
"javax.jdo.option.TransactionType", *
"javax.jdo.option.ServerTimeZoneID", *
"javax.jdo.option.DatastoreReadTimeoutMillis", *
"javax.jdo.option.DatastoreWriteTimeoutMillis", *
"javax.jdo.option.Name". *
* and properties of the form *
javax.jdo.option.InstanceLifecycleListener.{listenerClass}[=[{pcClasses}]] * where {listenerClass} is the fully qualified name of a * class that implements * {@link javax.jdo.listener.InstanceLifecycleListener}, and * {pcClasses} is an optional comma- or whitespace-delimited * list of persistence-capable classes to be observed; the absence of a * value for a property of this form means that instances of all * persistence-capable classes will be observed by an instance of the given * listener class. *

JDO implementations * are permitted to define key values of their own. Any key values not * recognized by the implementation must be ignored. Key values that are * recognized but not supported by an implementation must result in a * JDOFatalUserException thrown by the method. *

The returned PersistenceManagerFactory is not * configurable (the setXXX methods will throw an * exception). *

JDO implementations might manage a map of instantiated * PersistenceManagerFactory instances based on specified * property key values, and return a previously instantiated * PersistenceManagerFactory instance. In this case, the * properties of the returned instance must exactly match the requested * properties. * @return the PersistenceManagerFactory. * @param props a Properties instance with properties of the * PersistenceManagerFactory. * @param pmfClassLoader the class loader to use to load the * PersistenceManagerFactory class * @throws JDOFatalUserException if *

  • the pmfClassLoader passed is invalid; or *
  • a valid class name cannot be obtained from * either props or system resources * (an entry in META-INF/services/javax.jdo.PersistenceManagerFactory); or *
  • all implementations throw an exception. *
* @since 2.1 */ protected static PersistenceManagerFactory getPersistenceManagerFactory (Map overrides, Map props, ClassLoader pmfClassLoader) { List exceptions = new ArrayList(); if (pmfClassLoader == null) throw new JDOFatalUserException (msg.msg ( "EXC_GetPMFNullLoader")); //NOI18N JDOImplHelper.assertOnlyKnownStandardProperties(overrides); JDOImplHelper.assertOnlyKnownStandardProperties(props); // first try to get the class name from the properties object. String pmfClassName = (String) props.get ( PROPERTY_PERSISTENCE_MANAGER_FACTORY_CLASS); if (!isNullOrBlank(pmfClassName)) { // a valid name was returned from the properties. return invokeGetPersistenceManagerFactoryOnImplementation( pmfClassName, overrides, props, pmfClassLoader); } else { /* * If you have a jar file that provides the jdo implementation, * a file naming the implementation goes into the file * packaged into the jar file, called * META-INF/services/javax.jdo.PersistenceManagerFactory. * The contents of the file is a string that is the PMF class name, * null or blank. * For each file in pmfClassLoader named * META-INF/services/javax.jdo.PersistenceManagerFactory, * this method will try to invoke the getPersistenceManagerFactory * method of the implementation class. * Return the factory if a valid class name is extracted from * resources and the invocation returns an instance. * Otherwise add the exception thrown to * an exception list. */ Enumeration urls = null; try { urls = getResources(pmfClassLoader, SERVICE_LOOKUP_PMF_RESOURCE_NAME); } catch (Throwable ex) { exceptions.add(ex); } if (urls != null){ while (urls.hasMoreElements()) { try { pmfClassName = getClassNameFromURL( (URL) urls.nextElement()); // return the implementation that is valid. PersistenceManagerFactory pmf = invokeGetPersistenceManagerFactoryOnImplementation( pmfClassName, overrides, props, pmfClassLoader); return pmf; } catch (Throwable ex) { // remember exceptions from failed pmf invocations exceptions.add(ex); } } } } // no PMF class name in props and no services. throw new JDOFatalUserException(msg.msg( "EXC_GetPMFNoPMFClassNamePropertyOrPUNameProperty"), (Throwable[]) exceptions.toArray(new Throwable[exceptions.size()])); } /** Get a class name from a URL. The URL is from getResources with * e.g. META-INF/services/javax.jdo.PersistenceManagerFactory as the * parameter. Parse the file, removing blank lines, comment lines, * and comments. * @param url the URL of the services file * @return the name of the class contained in the file * @throws java.io.IOException * @since 2.1 */ protected static String getClassNameFromURL (URL url) throws IOException { InputStream is = openStream(url); BufferedReader reader = new BufferedReader(new InputStreamReader(is)); String line = null; try { while ((line = reader.readLine()) != null) { line = line.trim(); if (line.length() == 0 || line.startsWith("#")) { continue; } // else assume first line of text is the PMF class name String[] tokens = line.split("\\s"); String pmfClassName = tokens[0]; int indexOfComment = pmfClassName.indexOf("#"); if (indexOfComment == -1) { return pmfClassName; } // else pmfClassName has a comment at the end of it -- remove return pmfClassName.substring(0, indexOfComment); } return null; } finally { try { reader.close(); } catch (IOException x) { // gulp } } } /** * Returns a named {@link PersistenceManagerFactory} or persistence * unit. * * @since 2.1 * @see #getPersistenceManagerFactory(Map,String,ClassLoader,ClassLoader) */ public static PersistenceManagerFactory getPersistenceManagerFactory (String name) { ClassLoader cl = getContextClassLoader(); return getPersistenceManagerFactory(null, name, cl, cl); } /** * Returns a named {@link PersistenceManagerFactory} or persistence * unit. * * @since 1.0 * @see #getPersistenceManagerFactory(Map,String,ClassLoader,ClassLoader) */ public static PersistenceManagerFactory getPersistenceManagerFactory (String name, ClassLoader loader) { return getPersistenceManagerFactory(null, name, loader, loader); } /** * Returns a named {@link PersistenceManagerFactory} or persistence * unit. * * @since 2.0 * @see #getPersistenceManagerFactory(Map,String,ClassLoader,ClassLoader) */ public static PersistenceManagerFactory getPersistenceManagerFactory (String name, ClassLoader resourceLoader, ClassLoader pmfLoader) { return getPersistenceManagerFactory( null, name, resourceLoader, pmfLoader); } /** * Returns a named {@link PersistenceManagerFactory} or persistence * unit. * * @since 2.1 * @see #getPersistenceManagerFactory(Map,String,ClassLoader,ClassLoader) */ public static PersistenceManagerFactory getPersistenceManagerFactory (Map overrides, String name) { ClassLoader cl = getContextClassLoader(); return getPersistenceManagerFactory(overrides, name, cl, cl); } /** * Returns a named {@link PersistenceManagerFactory} or persistence * unit. * * @since 2.1 * @see #getPersistenceManagerFactory(Map,String,ClassLoader,ClassLoader) */ public static PersistenceManagerFactory getPersistenceManagerFactory (Map overrides, String name, ClassLoader resourceLoader) { return getPersistenceManagerFactory( overrides, name, resourceLoader, resourceLoader); } /** * Returns a {@link PersistenceManagerFactory} configured based * on the properties stored in the resource at * name, or, if not found, returns a * {@link PersistenceManagerFactory} with the given * name or, if not found, returns a * javax.persistence.EntityManagerFactory cast to a * {@link PersistenceManagerFactory}. If the name given is null or consists * only of whitespace, it is interpreted as * {@link Constants#ANONYMOUS_PERSISTENCE_MANAGER_FACTORY_NAME}. * The following are standard key names: *
"javax.jdo.PersistenceManagerFactoryClass" *
"javax.jdo.option.Optimistic", *
"javax.jdo.option.RetainValues", *
"javax.jdo.option.RestoreValues", *
"javax.jdo.option.IgnoreCache", *
"javax.jdo.option.NontransactionalRead", *
"javax.jdo.option.NontransactionalWrite", *
"javax.jdo.option.Multithreaded", *
"javax.jdo.option.ConnectionUserName", *
"javax.jdo.option.ConnectionPassword", *
"javax.jdo.option.ConnectionURL", *
"javax.jdo.option.ConnectionFactoryName", *
"javax.jdo.option.ConnectionFactory2Name", *
"javax.jdo.option.Mapping", *
"javax.jdo.mapping.Catalog", *
"javax.jdo.mapping.Schema", *
"javax.jdo.option.PersistenceUnitName". *
"javax.jdo.option.DetachAllOnCommit". *
"javax.jdo.option.CopyOnAttach". *
"javax.jdo.option.TransactionType". *
"javax.jdo.option.ServerTimeZoneID". *
"javax.jdo.option.DatastoreReadTimeoutMillis", *
"javax.jdo.option.DatastoreWriteTimeoutMillis", *
"javax.jdo.option.Name". *
* and properties of the form *
javax.jdo.option.InstanceLifecycleListener.{listenerClass}[=[{pcClasses}]] * where {listenerClass} is the fully qualified name of a * class that implements * {@link javax.jdo.listener.InstanceLifecycleListener}, and * {pcClasses} is an optional comma- or whitespace-delimited * list of persistence-capable classes to be observed; the absence of a * value for a property of this form means that instances of all * persistence-capable classes will be observed by an instance of the given * listener class. *

JDO implementations * are permitted to define key values of their own. Any key values not * recognized by the implementation must be ignored. Key values that are * recognized but not supported by an implementation must result in a * JDOFatalUserException thrown by the method. *

The returned PersistenceManagerFactory is not * configurable (the setXXX methods will throw an * exception). * * This method loads the properties found at name, if any, via * resourceLoader, and creates a {@link * PersistenceManagerFactory} with pmfLoader. Any * exceptions thrown during resource loading will * be wrapped in a {@link JDOFatalUserException}. * If multiple PMFs with the requested name are found, a * {@link JDOFatalUserException} is thrown. * @since 2.1 * @param overrides a Map containing properties that override properties * defined in any resources loaded according to the "name" parameter * @param name interpreted as the name of the resource containing the PMF * properties, the name of the PMF, or the persistence unit name, in that * order; if name is null, blank or whitespace, it is interpreted as * indicating the anonymous {@link PersistenceManagerFactory}. * @param resourceLoader the class loader to use to load properties file * resources; must be non-null if name is non-null or blank * @param pmfLoader the class loader to use to load the * {@link PersistenceManagerFactory} or * javax.persistence.EntityManagerFactory classes * @return the {@link PersistenceManagerFactory} with properties in the * given resource, with the given name, or with the given persitence unit * name * @see Constants#ANONYMOUS_PERSISTENCE_MANAGER_FACTORY_NAME */ public static PersistenceManagerFactory getPersistenceManagerFactory( Map overrides, String name, ClassLoader resourceLoader, ClassLoader pmfLoader) { if (pmfLoader == null) throw new JDOFatalUserException (msg.msg ( "EXC_GetPMFNullPMFLoader")); //NOI18N if (resourceLoader == null) { throw new JDOFatalUserException(msg.msg( "EXC_GetPMFNullPropsLoader")); //NOI18N } Map props = null; // trim spaces from name and ensure non-null name = (name == null?ANONYMOUS_PERSISTENCE_MANAGER_FACTORY_NAME:name.trim()); if (!ANONYMOUS_PERSISTENCE_MANAGER_FACTORY_NAME.equals(name)) { props = loadPropertiesFromResource(resourceLoader, name); } if (props != null) { // add the SPI property to inform the implementation that // the PMF was configured by the given resource name // and not via named PMF for proper deserialization props.put(PROPERTY_SPI_RESOURCE_NAME, name); props.remove(PROPERTY_NAME); return getPersistenceManagerFactory(overrides, props, pmfLoader); } // props were null; try getting from jdoconfig.xml props = getPropertiesFromJdoconfig(name, pmfLoader); if (props != null) { // inform the impl that the config came from a jdoconfig.xml // element with the given name props.put(PROPERTY_NAME, name); props.remove(PROPERTY_SPI_RESOURCE_NAME); // we have loaded a Properties, delegate to implementation return getPersistenceManagerFactory(overrides, props, pmfLoader); } // no properties found; last try to see if name is a JPA PU name if (!ANONYMOUS_PERSISTENCE_MANAGER_FACTORY_NAME.equals(name)) { props = new Properties(); props.put(PROPERTY_PERSISTENCE_UNIT_NAME, name); return getPersistenceManagerFactory(overrides, props, pmfLoader); } // no PMF found; give up throw new JDOFatalUserException (msg.msg ( "EXC_NoPMFConfigurableViaPropertiesOrXML", name)); //NOI18N } /** Invoke the getPersistenceManagerFactory method on the implementation. * If the overrides parameter to this method is not null, the static method * with Map overrides, Map properties parameters will be invoked. * If the overrides parameter to this method is null, the static method * with Map properties parameter will be invoked. * @param pmfClassName the name of the implementation factory class * @param overrides a Map of overrides * @param properties a Map of properties * @param cl the class loader to use to load the implementation class * @return the PersistenceManagerFactory */ protected static PersistenceManagerFactory invokeGetPersistenceManagerFactoryOnImplementation( String pmfClassName, Map overrides, Map properties, ClassLoader cl) { if (overrides != null) { // overrides is not null; use getPersistenceManagerFactory(Map overrides, Map props) try { Class implClass = forName(pmfClassName, true, cl); Method m = getMethod(implClass, "getPersistenceManagerFactory", //NOI18N new Class[]{Map.class, Map.class}); PersistenceManagerFactory pmf = (PersistenceManagerFactory) invoke(m, null, new Object[]{overrides, properties}); if (pmf == null) { throw new JDOFatalInternalException(msg.msg ( "EXC_GetPMFNullPMF", pmfClassName)); //NOI18N } return pmf; } catch (ClassNotFoundException e) { throw new JDOFatalUserException(msg.msg( "EXC_GetPMFClassNotFound", pmfClassName), e); //NOI18N } catch (NoSuchMethodException e) { throw new JDOFatalInternalException(msg.msg( "EXC_GetPMFNoSuchMethod2", pmfClassName), e); //NOI18N } catch (NullPointerException e) { throw new JDOFatalInternalException (msg.msg( "EXC_GetPMFNullPointerException", pmfClassName), e); //NOI18N } catch (IllegalAccessException e) { throw new JDOFatalUserException(msg.msg( "EXC_GetPMFIllegalAccess", pmfClassName), e); //NOI18N } catch (ClassCastException e) { throw new JDOFatalInternalException (msg.msg( "EXC_GetPMFClassCastException", pmfClassName), e); //NOI18N } catch (InvocationTargetException ite) { Throwable nested = ite.getTargetException(); if (nested instanceof JDOException) { throw (JDOException)nested; } else throw new JDOFatalInternalException (msg.msg( "EXC_GetPMFUnexpectedException"), ite); //NOI18N } } else { // overrides is null; use getPersistenceManagerFactory(Map props) try { Class implClass = forName(pmfClassName, true, cl); Method m = getMethod(implClass, "getPersistenceManagerFactory", //NOI18N new Class[]{Map.class}); PersistenceManagerFactory pmf = (PersistenceManagerFactory) invoke(m, null, new Object[]{properties}); if (pmf == null) { throw new JDOFatalInternalException(msg.msg ( "EXC_GetPMFNullPMF", pmfClassName)); //NOI18N } return pmf; } catch (ClassNotFoundException e) { throw new JDOFatalUserException(msg.msg( "EXC_GetPMFClassNotFound", pmfClassName), e); //NOI18N } catch (NoSuchMethodException e) { throw new JDOFatalInternalException(msg.msg( "EXC_GetPMFNoSuchMethod", pmfClassName), e); //NOI18N } catch (NullPointerException e) { throw new JDOFatalInternalException (msg.msg( "EXC_GetPMFNullPointerException", pmfClassName), e); //NOI18N } catch (IllegalAccessException e) { throw new JDOFatalUserException(msg.msg( "EXC_GetPMFIllegalAccess", pmfClassName), e); //NOI18N } catch (ClassCastException e) { throw new JDOFatalInternalException (msg.msg( "EXC_GetPMFClassCastException", pmfClassName), e); //NOI18N } catch (InvocationTargetException ite) { Throwable nested = ite.getTargetException(); if (nested instanceof JDOException) { throw (JDOException)nested; } else throw new JDOFatalInternalException (msg.msg( "EXC_GetPMFUnexpectedException"), ite); //NOI18N } } } /** Load a Properties instance by name from the class loader. * * @param resourceLoader the class loader from which to load the properties * @param name the name of the resource * @return a Properties instance or null if no resource is found */ protected static Map loadPropertiesFromResource( ClassLoader resourceLoader, String name) { InputStream in = null; Properties props = null; // try to load resources from properties file try { in = getResourceAsStream(resourceLoader, name); if (in != null) { // then some kind of resource was found by the given name; // assume that it's a properties file props = new Properties(); ((Properties) props).load(in); } } catch (IOException ioe) { throw new JDOFatalUserException(msg.msg( "EXC_GetPMFIOExceptionRsrc", name), ioe); //NOI18N } finally { if (in != null) { try { in.close(); } catch (IOException ioe) { } } } return props; } /** * @see #getNamedPMFProperties(String,ClassLoader,String) * @since 2.1 */ protected static Map getPropertiesFromJdoconfig( String name, ClassLoader resourceLoader) { return getNamedPMFProperties( name, resourceLoader, JDOCONFIG_RESOURCE_NAME); } /** * Find and return the named {@link PersistenceManagerFactory}'s properties, * or null if not found. * If multiple named PMF property sets with * the given name are found (including anonymous ones), throw * {@link JDOFatalUserException}. * This method is here only to facilitate testing; the parameter * "jdoconfigResourceName" in public usage should always have the value * given in the constant {@link Constants#JDOCONFIG_RESOURCE_NAME}. * * @param name The persistence unit name; null is disallowed. * @param resourceLoader The ClassLoader used to load the standard JDO * configuration file. * @param jdoconfigResourceName The name of the configuration file to read. * In public usage, this should always be the value of * {@link Constants#JDOCONFIG_RESOURCE_NAME}. * @return The named PersistenceManagerFactory properties if * found, null if not. * @since 2.1 * @throws JDOFatalUserException if multiple named PMF property sets are * found with the given name, or any other exception is encountered. */ protected static Map getNamedPMFProperties( String name, ClassLoader resourceLoader, String jdoconfigResourceName) { // key is PU name, value is Map of PU properties Map> propertiesByNameInAllConfigs = new HashMap>(); try { URL firstFoundConfigURL = null; // get all JDO configurations Enumeration resources = getResources(resourceLoader, jdoconfigResourceName); if (resources.hasMoreElements()) { ArrayList processedResources = new ArrayList(); // get ready to parse XML DocumentBuilderFactory factory = getDocumentBuilderFactory(); do { URL currentConfigURL = resources.nextElement(); if (processedResources.contains(currentConfigURL)) { continue; } else { processedResources.add(currentConfigURL); } Map> propertiesByNameInCurrentConfig = readNamedPMFProperties( currentConfigURL, name, factory); // try to detect duplicate requested PU if (propertiesByNameInCurrentConfig.containsKey(name)) { // possible dup -- check for it if (firstFoundConfigURL == null) { firstFoundConfigURL = currentConfigURL; } if (propertiesByNameInAllConfigs.containsKey(name)) throw new JDOFatalUserException (msg.msg( "EXC_DuplicateRequestedNamedPMFFoundInDifferentConfigs", "".equals(name) ? "(anonymous)" : name, firstFoundConfigURL.toExternalForm(), currentConfigURL.toExternalForm())); //NOI18N } // no dups -- add found PUs to all PUs and keep going propertiesByNameInAllConfigs .putAll(propertiesByNameInCurrentConfig); } while (resources.hasMoreElements()); } } catch (FactoryConfigurationError e) { throw new JDOFatalUserException( msg.msg("ERR_NoDocumentBuilderFactory"), e); } catch (IOException ioe) { throw new JDOFatalUserException (msg.msg ( "EXC_GetPMFIOExceptionRsrc", name), ioe); //NOI18N } // done with reading all config resources; // return what we found, which may very well be null return (Map) propertiesByNameInAllConfigs.get(name); } protected static DocumentBuilderFactory getDocumentBuilderFactory() { @SuppressWarnings("static-access") DocumentBuilderFactory factory = implHelper.getRegisteredDocumentBuilderFactory(); if (factory == null) { factory = getDefaultDocumentBuilderFactory(); } return factory; } protected static DocumentBuilderFactory getDefaultDocumentBuilderFactory() { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setIgnoringComments(true); factory.setNamespaceAware(true); factory.setValidating(false); factory.setIgnoringElementContentWhitespace(true); factory.setExpandEntityReferences(true); return factory; } protected static ErrorHandler getErrorHandler() { @SuppressWarnings("static-access") ErrorHandler handler = implHelper.getRegisteredErrorHandler(); if (handler == null) { handler = getDefaultErrorHandler(); } return handler; } protected static ErrorHandler getDefaultErrorHandler() { return new ErrorHandler() { public void error(SAXParseException exception) throws SAXException { throw exception; } public void fatalError(SAXParseException exception) throws SAXException { throw exception; } public void warning(SAXParseException exception) throws SAXException { // gulp: ignore warnings } }; } /** Reads JDO configuration file, creates a Map for each * persistence-manager-factory, then returns the map. * @param url URL of a JDO configuration file compliant with * javax/jdo/jdoconfig.xsd. * @param requestedPMFName The name of the requested * persistence unit (allows for fail-fast). * @param factory The DocumentBuilderFactory to use for XML * parsing. * @return a Map holding persistence unit configurations; for * the anonymous persistence unit, the * value of the String key is the empty string, "". */ protected static Map> readNamedPMFProperties( URL url, String requestedPMFName, DocumentBuilderFactory factory) { requestedPMFName = requestedPMFName == null ? "" : requestedPMFName.trim(); Map> propertiesByName = new HashMap>(); InputStream in = null; try { DocumentBuilder builder = factory.newDocumentBuilder(); builder.setErrorHandler(getErrorHandler()); in = openStream(url); Document doc = builder.parse(in); Element root = doc.getDocumentElement(); if (root == null) { throw new JDOFatalUserException( msg.msg("EXC_InvalidJDOConfigNoRoot", url.toExternalForm()) ); } NodeList pmfs = root.getElementsByTagName( ELEMENT_PERSISTENCE_MANAGER_FACTORY); for(int i = 0; i < pmfs.getLength(); i++) { Node pmfElement = pmfs.item(i); Properties pmfPropertiesFromAttributes = readPropertiesFromPMFElementAttributes(pmfElement); Properties pmfPropertiesFromElements = readPropertiesFromPMFSubelements(pmfElement, url); // for informative error handling, get name (or names) now String pmfNameFromAtts = pmfPropertiesFromAttributes.getProperty(PROPERTY_NAME); String pmfNameFromElem = pmfPropertiesFromElements.getProperty(PROPERTY_NAME); String pmfName = null; if (isNullOrBlank(pmfNameFromAtts)) { // no PMF name attribute given if (!isNullOrBlank(pmfNameFromElem)) { // PMF name element was given pmfName = pmfNameFromElem; } else { // PMF name not given at all, means the "anonymous" PMF pmfName = ANONYMOUS_PERSISTENCE_MANAGER_FACTORY_NAME; } } else { // PMF name given in an attribute if (!isNullOrBlank(pmfNameFromElem)) { // exception -- PMF name given as both att & elem throw new JDOFatalUserException( msg.msg( "EXC_DuplicatePMFNamePropertyFoundWithinConfig", pmfNameFromAtts, pmfNameFromElem, url.toExternalForm())); } pmfName = pmfNameFromAtts; } pmfName = pmfName == null ? "" : pmfName.trim(); // check for duplicate properties among atts & elems if (requestedPMFName.equals(pmfName)) { Iterator it = pmfPropertiesFromAttributes.keySet().iterator(); while (it.hasNext()) { String property = (String) it.next(); if (pmfPropertiesFromElements.contains(property)) { throw new JDOFatalUserException( msg.msg( "EXC_DuplicatePropertyFound", property, pmfName, url.toExternalForm())); } } } // at this point, we're guaranteed not to have duplicate // properties -- merge them Properties pmfProps = new Properties(); pmfProps.putAll(pmfPropertiesFromAttributes); pmfProps.putAll(pmfPropertiesFromElements); // check for duplicate requested PMF name if (pmfName.equals(requestedPMFName) && propertiesByName.containsKey(pmfName)) { throw new JDOFatalUserException(msg.msg( "EXC_DuplicateRequestedNamedPMFFoundInSameConfig", pmfName, url.toExternalForm())); } propertiesByName.put(pmfName, pmfProps); } return propertiesByName; } catch (IOException ioe) { throw new JDOFatalUserException( msg.msg("EXC_GetPMFIOExceptionRsrc", url.toString()), ioe); //NOI18N } catch (ParserConfigurationException e) { throw new JDOFatalInternalException( msg.msg("EXC_ParserConfigException"), e); } catch (SAXParseException e) { throw new JDOFatalUserException( msg.msg( "EXC_SAXParseException", url.toExternalForm(), new Integer(e.getLineNumber()), new Integer(e.getColumnNumber())), e); } catch (SAXException e) { throw new JDOFatalUserException( msg.msg("EXC_SAXException", url.toExternalForm()), e); } catch (JDOException e) { throw e; } catch (RuntimeException e) { throw new JDOFatalUserException( msg.msg("EXC_SAXException", url.toExternalForm()), e); } finally { if (in != null) { try { in.close(); } catch (IOException ioe) { /* gulp */ } } } } protected static Properties readPropertiesFromPMFElementAttributes( Node pmfElement) { Properties p = new Properties(); NamedNodeMap attributes = pmfElement.getAttributes(); if (attributes == null) { return p; } for(int i = 0; i < attributes.getLength(); i++) { Node att = attributes.item(i); String attName = att.getNodeName(); String attValue = att.getNodeValue().trim(); String jdoPropertyName = (String) ATTRIBUTE_PROPERTY_XREF.get(attName); p.put( jdoPropertyName != null ? jdoPropertyName : attName, attValue); } return p; } protected static Properties readPropertiesFromPMFSubelements( Node pmfElement, URL url) { Properties p = new Properties(); NodeList elements = pmfElement.getChildNodes(); if (elements == null) { return p; } for(int i = 0; i < elements.getLength(); i++) { Node element = elements.item(i); if (element.getNodeType() != Node.ELEMENT_NODE) { continue; } String elementName = element.getNodeName(); NamedNodeMap attributes = element.getAttributes(); if (ELEMENT_PROPERTY.equalsIgnoreCase(elementName)) { // // get the "name" attribute's value (required) Node nameAtt = attributes.getNamedItem(PROPERTY_ATTRIBUTE_NAME); if (nameAtt == null) { throw new JDOFatalUserException( msg.msg("EXC_PropertyElementHasNoNameAttribute", url)); } String name = nameAtt.getNodeValue().trim(); if ("".equals(name)) { throw new JDOFatalUserException( msg.msg( "EXC_PropertyElementNameAttributeHasNoValue", name, url)); } // The next call allows users to use either the // attribute names or the // "javax.jdo" property names in element "name" // attributes. Handy-dandy. String jdoPropertyName = (String) ATTRIBUTE_PROPERTY_XREF.get(name); String propertyName = jdoPropertyName != null ? jdoPropertyName : name; if (p.containsKey(propertyName)) { throw new JDOFatalUserException( msg.msg( "EXC_DuplicatePropertyNameGivenInPropertyElement", propertyName, url)); } // get the "value" attribute's value (optional) Node valueAtt = attributes.getNamedItem( PROPERTY_ATTRIBUTE_VALUE); String value = valueAtt == null ? null : valueAtt.getNodeValue().trim(); p.put(propertyName, value); } else if (ELEMENT_INSTANCE_LIFECYCLE_LISTENER.equals(elementName)) { // // get the "listener" attribute's value Node listenerAtt = attributes.getNamedItem( INSTANCE_LIFECYCLE_LISTENER_ATTRIBUTE_LISTENER); if (listenerAtt == null) { throw new JDOFatalUserException( msg.msg( "EXC_MissingListenerAttribute", url)); } String listener = listenerAtt.getNodeValue().trim(); if ("".equals(listener)) { throw new JDOFatalUserException( msg.msg( "EXC_MissingListenerAttributeValue", url)); } // listener properties are of the form // "javax.jdo.option.InstanceLifecycleListener." + listener listener = PROPERTY_PREFIX_INSTANCE_LIFECYCLE_LISTENER + listener; // get the "classes" attribute's value (optional) Node classesAtt = attributes.getNamedItem( INSTANCE_LIFECYCLE_LISTENER_ATTRIBUTE_CLASSES); String value = classesAtt == null ? "" : classesAtt.getNodeValue().trim(); p.put(listener, value); } } return p; } protected static boolean isNullOrBlank(String s) { return s == null || "".equals(s.trim()); } /** * Returns a {@link PersistenceManagerFactory} configured based * on the properties stored in the file at * propsFile. This method is equivalent to * invoking {@link * #getPersistenceManagerFactory(File,ClassLoader)} with * Thread.currentThread().getContextClassLoader() as * the loader argument. * @since 2.0 * @param propsFile the file containing the Properties * @return the PersistenceManagerFactory */ public static PersistenceManagerFactory getPersistenceManagerFactory (File propsFile) { return getPersistenceManagerFactory( propsFile, getContextClassLoader()); } /** * Returns a {@link PersistenceManagerFactory} configured based * on the properties stored in the file at * propsFile. Creates a {@link * PersistenceManagerFactory} with loader. Any * IOExceptions or * FileNotFoundExceptions thrown during resource * loading will be wrapped in a {@link JDOFatalUserException}. * @since 2.0 * @param propsFile the file containing the Properties * @param loader the class loader to use to load the * PersistenceManagerFactory class * @return the PersistenceManagerFactory */ public static PersistenceManagerFactory getPersistenceManagerFactory (File propsFile, ClassLoader loader) { if (propsFile == null) throw new JDOFatalUserException (msg.msg ( "EXC_GetPMFNullFile")); //NOI18N InputStream in = null; try { in = new FileInputStream(propsFile); return getPersistenceManagerFactory(in, loader); } catch (FileNotFoundException fnfe) { throw new JDOFatalUserException (msg.msg ( "EXC_GetPMFNoFile", propsFile), fnfe); //NOI18N } finally { if (in != null) try { in.close (); } catch (IOException ioe) { } } } /** * Returns a {@link PersistenceManagerFactory} at the JNDI * location specified by jndiLocation in the context * context. If context is * null, new InitialContext() will be * used. This method is equivalent to invoking {@link * #getPersistenceManagerFactory(String,Context,ClassLoader)} * with Thread.currentThread().getContextClassLoader() as * the loader argument. * @since 2.0 * @param jndiLocation the JNDI location containing the * PersistenceManagerFactory * @param context the context in which to find the named * PersistenceManagerFactory * @return the PersistenceManagerFactory */ public static PersistenceManagerFactory getPersistenceManagerFactory (String jndiLocation, Context context) { return getPersistenceManagerFactory (jndiLocation, context, getContextClassLoader()); } /** * Returns a {@link PersistenceManagerFactory} at the JNDI * location specified by jndiLocation in the context * context. If context is * null, new InitialContext() will be * used. Creates a {@link PersistenceManagerFactory} with * loader. Any NamingExceptions thrown * will be wrapped in a {@link JDOFatalUserException}. * @since 2.0 * @param jndiLocation the JNDI location containing the * PersistenceManagerFactory * @param context the context in which to find the named * PersistenceManagerFactory * @param loader the class loader to use to load the * PersistenceManagerFactory class * @return the PersistenceManagerFactory */ public static PersistenceManagerFactory getPersistenceManagerFactory (String jndiLocation, Context context, ClassLoader loader) { if (jndiLocation == null) throw new JDOFatalUserException (msg.msg ( "EXC_GetPMFNullJndiLoc")); //NOI18N if (loader == null) throw new JDOFatalUserException (msg.msg ( "EXC_GetPMFNullLoader")); //NOI18N try { if (context == null) context = new InitialContext (); Object o = context.lookup (jndiLocation); return (PersistenceManagerFactory) PortableRemoteObject.narrow (o, PersistenceManagerFactory.class); } catch (NamingException ne) { throw new JDOFatalUserException (msg.msg ( "EXC_GetPMFNamingException", jndiLocation, loader), ne); //NOI18N } } /** * Returns a {@link PersistenceManagerFactory} configured based * on the Properties stored in the input stream at * stream. This method is equivalent to * invoking {@link * #getPersistenceManagerFactory(InputStream,ClassLoader)} with * Thread.currentThread().getContextClassLoader() as * the loader argument. * @since 2.0 * @param stream the stream containing the Properties * @return the PersistenceManagerFactory */ public static PersistenceManagerFactory getPersistenceManagerFactory (InputStream stream) { return getPersistenceManagerFactory( stream, getContextClassLoader()); } /** * Returns a {@link PersistenceManagerFactory} configured based * on the Properties stored in the input stream at * stream. Creates a {@link * PersistenceManagerFactory} with loader. Any * IOExceptions thrown during resource * loading will be wrapped in a {@link JDOFatalUserException}. * @since 2.0 * @param stream the stream containing the Properties * @param loader the class loader to use to load the * PersistenceManagerFactory class * @return the PersistenceManagerFactory */ public static PersistenceManagerFactory getPersistenceManagerFactory (InputStream stream, ClassLoader loader) { if (stream == null) throw new JDOFatalUserException (msg.msg ( "EXC_GetPMFNullStream")); //NOI18N Properties props = new Properties (); try { props.load (stream); } catch (IOException ioe) { throw new JDOFatalUserException (msg.msg ("EXC_GetPMFIOExceptionStream"), ioe); //NOI18N } return getPersistenceManagerFactory (props, loader); } /** * Get a JDOEnhancer using the available enhancer(s) specified in * "META-INF/services/JDOEnhancer" using the context class loader. * @return the JDOEnhancer. * @throws JDOFatalUserException if no available enhancer * @since 3.0 */ public static JDOEnhancer getEnhancer() { return getEnhancer(getContextClassLoader()); } /** * Get a JDOEnhancer using the available enhancer(s) specified in * "META-INF/services/JDOEnhancer" * @param loader the loader to use for loading the JDOEnhancer class (if any) * @return the JDOEnhancer. * @throws JDOFatalUserException if no available enhancer * @since 3.0 */ public static JDOEnhancer getEnhancer(ClassLoader loader) { ClassLoader ctrLoader = loader; if (ctrLoader == null) { ctrLoader = Thread.currentThread().getContextClassLoader(); } /* * If you have a jar file that provides the jdo enhancer implementation, * a file naming the implementation goes into the file * packaged into the jar file, called "META-INF/services/javax.jdo.JDOEnhancer". * The contents of the file is a string that is the enhancer class name. * For each file in the class loader named "META-INF/services/javax.jdo.JDOEnhancer", * this method will invoke the default constructor of the implementation class. * Return the enhancer if a valid class name is extracted from resources and * the invocation returns an instance. * Otherwise add the exception thrown to an exception list. */ ArrayList exceptions = new ArrayList(); int numberOfJDOEnhancers = 0; try { Enumeration urls = getResources(loader, SERVICE_LOOKUP_ENHANCER_RESOURCE_NAME); if (urls != null) { while (urls.hasMoreElements()) { numberOfJDOEnhancers++; try { String enhancerClassName = getClassNameFromURL((URL)urls.nextElement()); Class enhancerClass = forName(enhancerClassName, true, ctrLoader); JDOEnhancer enhancer = (JDOEnhancer)enhancerClass.newInstance(); return enhancer; } catch (Throwable ex) { // remember exceptions from failed enhancer invocations exceptions.add(ex); } } } } catch (Throwable ex) { exceptions.add(ex); } throw new JDOFatalUserException(msg.msg("EXC_GetEnhancerNoValidEnhancerAvailable", numberOfJDOEnhancers), (Throwable[])exceptions.toArray(new Throwable[exceptions.size()])); } /** Get the context class loader associated with the current thread. * This is done in a doPrivileged block because it is a secure method. * @return the current thread's context class loader. * @since 2.0 */ private static ClassLoader getContextClassLoader() { return AccessController.doPrivileged( new PrivilegedAction () { public ClassLoader run () { return Thread.currentThread().getContextClassLoader(); } } ); } /** Get the named resource as a stream from the resource loader. * Perform this operation in a doPrivileged block. */ private static InputStream getResourceAsStream( final ClassLoader resourceLoader, final String name) { return AccessController.doPrivileged( new PrivilegedAction() { public InputStream run() { return resourceLoader.getResourceAsStream(name); } } ); } /** Get the named Method from the named class. * Perform this operation in a doPrivileged block. * * @param implClass the class * @param methodName the name of the method * @param parameterTypes the parameter types of the method * @return the Method instance */ private static Method getMethod( final Class implClass, final String methodName, final Class[] parameterTypes) throws NoSuchMethodException { try { return AccessController.doPrivileged( new PrivilegedExceptionAction() { public Method run() throws NoSuchMethodException { return implClass.getMethod(methodName, parameterTypes); } } ); } catch (PrivilegedActionException ex) { throw (NoSuchMethodException)ex.getException(); } } /** Invoke the method. * Perform this operation in a doPrivileged block. */ private static Object invoke(final Method method, final Object instance, final Object[] parameters) throws IllegalAccessException, InvocationTargetException { try { return (Object) AccessController.doPrivileged( new PrivilegedExceptionAction() { public Object run() throws IllegalAccessException, InvocationTargetException { return method.invoke (instance, parameters); } } ); } catch (PrivilegedActionException ex) { Exception cause = (Exception)ex.getException(); if (cause instanceof IllegalAccessException) throw (IllegalAccessException)cause; else //if (cause instanceof InvocationTargetException) throw (InvocationTargetException)cause; } } /** Get resources of the resource loader. * Perform this operation in a doPrivileged block. * @param resourceLoader * @param resourceName * @return the resources */ protected static Enumeration getResources( final ClassLoader resourceLoader, final String resourceName) throws IOException { try { return AccessController.doPrivileged( new PrivilegedExceptionAction>() { public Enumeration run() throws IOException { return resourceLoader.getResources(resourceName); } } ); } catch (PrivilegedActionException ex) { throw (IOException)ex.getException(); } } /** Get the named class. * Perform this operation in a doPrivileged block. * * @param name the name of the class * @param init whether to initialize the class * @param loader which class loader to use * @return the class */ private static Class forName( final String name, final boolean init, final ClassLoader loader) throws ClassNotFoundException { try { return AccessController.doPrivileged( new PrivilegedExceptionAction>() { public Class run() throws ClassNotFoundException { return Class.forName(name, init, loader); } } ); } catch (PrivilegedActionException ex) { throw (ClassNotFoundException)ex.getException(); } } /** Open an input stream on the url. * Perform this operation in a doPrivileged block. * * @param url * @return the input stream */ private static InputStream openStream(final URL url) throws IOException { try { return AccessController.doPrivileged( new PrivilegedExceptionAction() { public InputStream run() throws IOException { return url.openStream(); } } ); } catch (PrivilegedActionException ex) { throw (IOException)ex.getException(); } } } api/src/java/javax/jdo/JDONullIdentityException.java100664 4761 12500110371 22746 0ustarmbouschenstaff 0 0 /* * 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. */ /* * JDONullIdentityException.java * */ package javax.jdo; /** An instance of this class is thrown when attempting to create an object id * when the object id constructor parameter is null. This might occur when * creating an object id instance from a transient instance where an identity * field is null. * * @since 2.0 * @version 2.0 */ public class JDONullIdentityException extends JDOUserException { /** * Constructs a new JDONullIdentityException without a detail message. */ public JDONullIdentityException() { } /** * Constructs a new JDONullIdentityException with the specified detail message. * @param msg the detail message. */ public JDONullIdentityException(String msg) { super(msg); } /** Constructs a new JDONullIdentityException with the specified detail message * and failed object. * @param msg the detail message. * @param failed the failed object. */ public JDONullIdentityException(String msg, Object failed) { super(msg, failed); } /** * Constructs a new JDONullIdentityException with the specified * detail message and nested Throwables. * @param msg the detail message. * @param nested the nested Throwable[]. */ public JDONullIdentityException(String msg, Throwable[] nested) { super(msg, nested); } /** * Constructs a new JDONullIdentityException with the specified detail message * and nested Throwables. * @param msg the detail message. * @param nested the nested Throwable. */ public JDONullIdentityException(String msg, Throwable nested) { super(msg, nested); } } api/src/java/javax/jdo/JDOObjectNotFoundException.java100664 6330 12500110371 23177 0ustarmbouschenstaff 0 0 /* * 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. */ /* * JDOObjectNotFoundException.java * */ package javax.jdo; /** This class represents exceptions caused by the user accessing * an object that does not exist in the datastore. * * @since 1.0.1 * @version 1.0.1 */ public class JDOObjectNotFoundException extends JDODataStoreException { /** * Constructs a new JDOObjectNotFoundException * without a detail message. */ public JDOObjectNotFoundException() { } /** * Constructs a new JDOObjectNotFoundException * with the specified detail message. * @param msg the detail message. */ public JDOObjectNotFoundException(String msg) { super(msg); } /** Constructs a new JDOObjectNotFoundException with the specified detail message * and failed object. * @param msg the detail message. * @param failed the failed object. */ public JDOObjectNotFoundException(String msg, Object failed) { super(msg, failed); } /** * Constructs a new JDOObjectNotFoundException with the * specified detail message and nested Throwables. * @param msg the detail message. * @param nested the nested Throwable. */ public JDOObjectNotFoundException(String msg, Throwable nested) { super(msg, nested); } /** * Constructs a new JDOObjectNotFoundException with the * specified detail message and nested Throwables. * @param msg the detail message. * @param nested the nested Throwable[]. */ public JDOObjectNotFoundException(String msg, Throwable[] nested) { super(msg, nested); } /** * Constructs a new JDOObjectNotFoundException with the specified * detail message, nested Throwables, and failed object. * @param msg the detail message. * @param nested the nested Throwable[]. * @param failed the failed object. */ public JDOObjectNotFoundException(String msg, Throwable[] nested, Object failed) { super(msg, nested, failed); } /** * Constructs a new JDOFatalInternalException with the specified * detail message, nested Throwables, and failed object. * @param msg the detail message. * @param nested the nested Throwable. * @param failed the failed object. */ public JDOObjectNotFoundException(String msg, Throwable nested, Object failed) { super(msg, nested, failed); } } api/src/java/javax/jdo/JDOOptimisticVerificationException.java100664 6075 12500110371 25011 0ustarmbouschenstaff 0 0 /* * 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. */ /* * JDOOptimisticVerificationException.java * */ package javax.jdo; /** This class represents optimistic verification failures. The nested * exception array contains an exception for each instance that failed * the optimistic verification. * * @since 1.0.1 * @version 1.0.1 */ public class JDOOptimisticVerificationException extends JDOFatalDataStoreException { /** * Constructs a new JDOOptimisticVerificationException without a * detail message. */ public JDOOptimisticVerificationException() { } /** * Constructs a new JDOOptimisticVerificationException with the * specified detail message. * @param msg the detail message. */ public JDOOptimisticVerificationException(String msg) { super(msg); } /** Constructs a new JDOOptimisticVerificationException with the * specified detail message and failed object. * @param msg the detail message. * @param failed the failed object. */ public JDOOptimisticVerificationException(String msg, Object failed) { super(msg, failed); } /** * Constructs a new JDOOptimisticVerificationException with the * specified detail message and nested Throwable[]s. * @param msg the detail message. * @param nested the nested Throwable[]. */ public JDOOptimisticVerificationException(String msg, Throwable[] nested) { super(msg, nested); } /** * Constructs a new JDOOptimisticVerificationException with the specified * detail message, nested Throwables, and failed object. * @param msg the detail message. * @param nested the nested Throwable[]. * @param failed the failed object. */ public JDOOptimisticVerificationException(String msg, Throwable[] nested, Object failed) { super(msg, nested, failed); } /** * Constructs a new JDOOptimisticVerificationException with the specified * detail message, nested Throwables, and failed object. * @param msg the detail message. * @param nested the nested Throwable. * @param failed the failed object. */ public JDOOptimisticVerificationException(String msg, Throwable nested, Object failed) { super(msg, nested, failed); } } api/src/java/javax/jdo/JDOQueryInterruptedException.java100664 2703 12500110371 23647 0ustarmbouschenstaff 0 0 /* * 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. */ /* * JDOUnsupportedOptionException.java * */ package javax.jdo; /** * This class represents exceptions caused when a query is cancelled by a user calling * Query.cancel(). * * @since 3.0 */ public class JDOQueryInterruptedException extends JDOUserException { /** * Constructs a new JDOQueryInterruptedException without a detail message. */ public JDOQueryInterruptedException() { } /** * Constructs a new JDOQueryInterruptedException with the specified detail message. * @param msg the detail message. */ public JDOQueryInterruptedException(String msg) { super(msg); } } api/src/java/javax/jdo/JDOReadOnlyException.java100664 4155 12500110371 22034 0ustarmbouschenstaff 0 0 /* * 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. */ /* * JDOReadOnlyException.java */ package javax.jdo; /** This class represents exceptions caused by an attempt to update a datastore * when the PMF was created as "read-only". * * @version 2.2 * @since 2.2 */ public class JDOReadOnlyException extends JDOUserException { /** * Constructs a new JDOReadOnlyException without a * detail message. * @since 2.2 */ public JDOReadOnlyException() { } /** * Constructs a new JDOReadOnlyException with the * specified detail message. * @param msg the detail message. * @since 2.2 */ public JDOReadOnlyException(String msg) { super(msg); } /** * Constructs a new JDOReadOnlyException with the * specified detail message and nested Throwables. * @param msg the detail message. * @param nested the nested Throwable[]. * @since 2.2 */ public JDOReadOnlyException(String msg, Throwable[] nested) { super(msg, nested); } /** * Constructs a new JDOReadOnlyException with the * specified detail message and nested Throwables. * @param msg the detail message. * @param nested the nested Throwable. * @since 2.2 */ public JDOReadOnlyException(String msg, Throwable nested) { super(msg, nested); } }api/src/java/javax/jdo/JDOUnsupportedOptionException.java100664 4156 12500110371 24041 0ustarmbouschenstaff 0 0 /* * 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. */ /* * JDOUnsupportedOptionException.java * */ package javax.jdo; /** This class represents exceptions caused by the use of optional features * not supported by the JDO implementation. * * @version 1.0 */ public class JDOUnsupportedOptionException extends JDOUserException { /** * Constructs a new JDOUnsupportedOptionException without a detail message. */ public JDOUnsupportedOptionException() { } /** * Constructs a new JDOUnsupportedOptionException with the specified detail message. * @param msg the detail message. */ public JDOUnsupportedOptionException(String msg) { super(msg); } /** * Constructs a new JDOUnsupportedOptionException with the * specified detail message and nested Throwables. * @param msg the detail message. * @param nested the nested Throwable[]. */ public JDOUnsupportedOptionException(String msg, Throwable[] nested) { super(msg, nested); } /** * Constructs a new JDOUnsupportedOptionException with the * specified detail message and nested Throwables. * @param msg the detail message. * @param nested the nested Throwable. */ public JDOUnsupportedOptionException(String msg, Throwable nested) { super(msg, nested); } } api/src/java/javax/jdo/JDOUserCallbackException.java100664 6212 12500110371 22646 0ustarmbouschenstaff 0 0 /* * 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. */ /* * JDOUserCallbackException.java * */ package javax.jdo; /** This class represents exceptions caused by exceptions thrown * during execution of callbacks or listeners. * * @version 2.0 */ public class JDOUserCallbackException extends JDOUserException { /** * Constructs a new JDOUserCallbackException * without a detail message. */ public JDOUserCallbackException() { } /** * Constructs a new JDOUserCallbackException * with the specified detail message. * @param msg the detail message. */ public JDOUserCallbackException(String msg) { super(msg); } /** * Constructs a new JDOUserCallbackException with the * specified detail message and nested Throwables. * @param msg the detail message. * @param nested the nested Throwable[]. */ public JDOUserCallbackException(String msg, Throwable[] nested) { super(msg, nested); } /** * Constructs a new JDOUserCallbackException with the * specified detail message and nested Throwables. * @param msg the detail message. * @param nested the nested Throwable. */ public JDOUserCallbackException(String msg, Throwable nested) { super(msg, nested); } /** Constructs a new JDOUserCallbackException with the specified detail message * and failed object. * @param msg the detail message. * @param failed the failed object. */ public JDOUserCallbackException(String msg, Object failed) { super(msg, failed); } /** Constructs a new JDOUserCallbackException with the specified detail message, * nested Throwables, and failed object. * @param msg the detail message. * @param nested the nested Throwable[]. * @param failed the failed object. */ public JDOUserCallbackException(String msg, Throwable[] nested, Object failed) { super(msg, nested, failed); } /** Constructs a new JDOUserException with the specified detail message, * nested Throwables, and failed object. * @param msg the detail message. * @param nested the nested Throwable. * @param failed the failed object. */ public JDOUserCallbackException(String msg, Throwable nested, Object failed) { super(msg, nested, failed); } } api/src/java/javax/jdo/JDOUserException.java100664 5741 12500110371 21237 0ustarmbouschenstaff 0 0 /* * 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. */ /* * JDOUserException.java * */ package javax.jdo; /** This class represents user errors that can possibly be retried. * * @version 1.0 */ public class JDOUserException extends JDOCanRetryException { /** * Constructs a new JDOUserException without a detail message. */ public JDOUserException() { } /** * Constructs a new JDOUserException with the specified detail message. * @param msg the detail message. */ public JDOUserException(String msg) { super(msg); } /** * Constructs a new JDOUserException with the specified detail message * and nested Throwables. * @param msg the detail message. * @param nested the nested Throwable[]. */ public JDOUserException(String msg, Throwable[] nested) { super(msg, nested); } /** * Constructs a new JDOUserException with the specified detail message * and nested Throwables. * @param msg the detail message. * @param nested the nested Throwable. */ public JDOUserException(String msg, Throwable nested) { super(msg, nested); } /** Constructs a new JDOUserException with the specified detail message * and failed object. * @param msg the detail message. * @param failed the failed object. */ public JDOUserException(String msg, Object failed) { super(msg, failed); } /** Constructs a new JDOUserException with the specified detail message, * nested Throwables, and failed object. * @param msg the detail message. * @param nested the nested Throwable[]. * @param failed the failed object. */ public JDOUserException(String msg, Throwable[] nested, Object failed) { super(msg, nested, failed); } /** Constructs a new JDOUserException with the specified detail message, * nested Throwables, and failed object. * @param msg the detail message. * @param nested the nested Throwable. * @param failed the failed object. */ public JDOUserException(String msg, Throwable nested, Object failed) { super(msg, nested, failed); } } api/src/java/javax/jdo/listener/AttachCallback.java100664 3207 12500110371 22546 0ustarmbouschenstaff 0 0 /* * 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. */ /* * AttachCallback.java * */ package javax.jdo.listener; /** * This interface is used to notify instances of attach events. * @version 2.0 * @since 2.0 */ public interface AttachCallback { /** * This method is called during the execution of * {@link javax.jdo.PersistenceManager#makePersistent} on the detached * instance before the copy is made. * @since 2.0 */ public void jdoPreAttach(); /** * This method is called during the execution of * {@link javax.jdo.PersistenceManager#makePersistent} on the persistent * instance after the copy is made. * @param attached The corresponding (non-attached) instance that was * attached in the call to * {@link javax.jdo.PersistenceManager#makePersistent}. * @since 2.0 */ public void jdoPostAttach(Object attached); } api/src/java/javax/jdo/listener/AttachLifecycleListener.java100664 4022 12500110371 24453 0ustarmbouschenstaff 0 0 /* * 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. */ /* * AttachLifecycleListener.java * */ package javax.jdo.listener; /** * This interface is implemented by listeners to be notified of * attach events. * @version 2.0 * @since 2.0 */ public interface AttachLifecycleListener extends InstanceLifecycleListener { /** * This method is called before a detached instance is attached, via the * {@link javax.jdo.PersistenceManager#makePersistent} method. The source * instance is the detached instance. This method is called before the * corresponding {@link AttachCallback#jdoPreAttach} on the detached * instance. * @param event the attach event. * @since 2.0 */ void preAttach (InstanceLifecycleEvent event); /** * This method is called after a detached instance is attached, via the * {@link javax.jdo.PersistenceManager#makePersistent} method. The source * instance is the corresponding persistent instance in the cache; the * target instance is the detached instance. This method is called after * the corresponding {@link AttachCallback#jdoPostAttach} on the * persistent instance. * @param event the attach event. * @since 2.0 */ void postAttach (InstanceLifecycleEvent event); } api/src/java/javax/jdo/listener/ClearCallback.java100664 2511 12500110371 22365 0ustarmbouschenstaff 0 0 /* * 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. */ /* * ClearCallback.java * */ package javax.jdo.listener; /** * This interface is used to notify instances of clear events. * @version 2.0 * @since 2.0 */ public interface ClearCallback { /** * Called before the values in the instance are cleared. * *

Transient fields should be cleared in this method. * Associations between this * instance and others in the runtime environment should be cleared. * *

This method is not modified by the enhancer. */ void jdoPreClear(); } api/src/java/javax/jdo/listener/ClearLifecycleListener.java100664 4320 12500110371 24276 0ustarmbouschenstaff 0 0 /* * 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. */ /* * ClearLifecycleListener.java * */ package javax.jdo.listener; /** * This interface is implemented by listeners to be notified of * clear events. * @version 2.0 * @since 2.0 */ public interface ClearLifecycleListener extends InstanceLifecycleListener { /** * This method is called before the implementation calls the instance * method {@link ClearCallback#jdoPreClear} and before it clears the values * in the instance to their Java default values. This happens during * an application call to evict, and in afterCompletion for commit * with RetainValues false and rollback with RestoreValues false. *

The method is called during any state transition to hollow. * Non-persistent, non-transactional fields should be cleared * in this method. Associations between this instance and others * in the runtime environment should be cleared. *

This method is not modified by the enhancer, so access to fields * is not mediated. * @param event the clear event. * @since 2.0 */ void preClear (InstanceLifecycleEvent event); /** * This method is called after the {@link ClearCallback#jdoPreClear} * method is invoked on the instance and the fields have been cleared * by the JDO implementation. * @param event the clear event. * @since 2.0 */ void postClear (InstanceLifecycleEvent event); } api/src/java/javax/jdo/listener/CreateLifecycleListener.java100664 2547 12500110371 24464 0ustarmbouschenstaff 0 0 /* * 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. */ /* * CreateLifecycleListener.java * */ package javax.jdo.listener; /** * This interface is implemented by listeners to be notified of * create events. * @version 2.0 * @since 2.0 */ public interface CreateLifecycleListener extends InstanceLifecycleListener { /** * Invoked whenever an instance is made persistent via a * call to {@link javax.jdo.PersistenceManager#makePersistent} or during * persistence by reachability. * @param event the create event. * @since 2.0 */ void postCreate (InstanceLifecycleEvent event); } api/src/java/javax/jdo/listener/DeleteCallback.java100664 2666 12500110371 22554 0ustarmbouschenstaff 0 0 /* * 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. */ /* * DeleteCallback.java * */ package javax.jdo.listener; /** * This interface is used to notify instances of delete events. * @version 2.0 * @since 2.0 */ public interface DeleteCallback { /** * Called before the instance is deleted. * This method is called before the state transition to persistent-deleted * or persistent-new-deleted. Access to field values within this call * are valid. Access to field values after this call are disallowed. *

This method is modified by the enhancer so that fields referenced * can be used in the business logic of the method. */ void jdoPreDelete(); } api/src/java/javax/jdo/listener/DeleteLifecycleListener.java100664 3573 12500110371 24463 0ustarmbouschenstaff 0 0 /* * 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. */ /* * DeleteLifecycleListener.java * */ package javax.jdo.listener; /** * This interface is implemented by listeners to be notified of * delete events. * @version 2.0 * @since 2.0 */ public interface DeleteLifecycleListener extends InstanceLifecycleListener { /** * Invoked whenever a persistent instance is deleted, for example * during {@link javax.jdo.PersistenceManager#deletePersistent}. * Access to field values within this call are permitted. *

This method is called before the instance callback * {@link DeleteCallback#jdoPreDelete}. * @param event the delete event. * @since 2.0 */ void preDelete (InstanceLifecycleEvent event); /** * Invoked whenever a persistent instance is deleted, for example * during {@link javax.jdo.PersistenceManager#deletePersistent}. *

This method is called after the instance transitions * to persistent-deleted. Access to field values is not permitted. * @param event the delete event. * @since 2.0 */ void postDelete (InstanceLifecycleEvent event); } api/src/java/javax/jdo/listener/DetachCallback.java100664 3041 12500110371 22526 0ustarmbouschenstaff 0 0 /* * 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. */ /* * DetachCallback.java * */ package javax.jdo.listener; /** * This interface is used to notify instances of detach events. * @version 2.0 * @since 2.0 */ public interface DetachCallback { /** * This method is called during the execution of * {@link javax.jdo.PersistenceManager#detachCopy} on the * persistent instance before the copy is made. * @since 2.0 */ public void jdoPreDetach(); /** * This method is called during the execution of * {@link javax.jdo.PersistenceManager#detachCopy} on the * detached instance after the copy is made. * @param detached The corresponding (attached) persistent instance. * @since 2.0 */ public void jdoPostDetach(Object detached); } api/src/java/javax/jdo/listener/DetachLifecycleListener.java100664 3533 12500110371 24445 0ustarmbouschenstaff 0 0 /* * 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. */ /* * DetachLifecycleListener.java * */ package javax.jdo.listener; /** * This interface is implemented by listeners to be notified of * detach events. * @version 2.0 * @since 2.0 */ public interface DetachLifecycleListener extends InstanceLifecycleListener { /** * This method is called during the execution of * {@link javax.jdo.PersistenceManager#detachCopy} before the * detached copy is made. It is called before the method * {@link DetachCallback#jdoPreDetach} is called on the * instance to be detached. * @param event the detach event. * @since 2.0 */ void preDetach (InstanceLifecycleEvent event); /** * This method is called during the execution of * {@link javax.jdo.PersistenceManager#detachCopy} after the * detached copy is made. It is called after the method * {@link DetachCallback#jdoPreDetach} is called on * the detached instance. * @param event the detach event. * @since 2.0 */ void postDetach (InstanceLifecycleEvent event); } api/src/java/javax/jdo/listener/DirtyLifecycleListener.java100664 3165 12500110371 24351 0ustarmbouschenstaff 0 0 /* * 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. */ /* * DirtyLifecycleListener.java * */ package javax.jdo.listener; /** * This interface is implemented by listeners to be notified of * dirty events. * @version 2.0 * @since 2.0 */ public interface DirtyLifecycleListener extends InstanceLifecycleListener { /** * Invoked whenever a persistent instance is first made dirty, * during an operation that modifies the value of a persistent or * transactional field. Called before the value is changed. * @since 2.0 */ void preDirty (InstanceLifecycleEvent event); /** * Invoked whenever a persistent instance is first made dirty, * during an operation that modifies the value of a persistent or * transactional field. Called after the value is changed. * @since 2.0 */ void postDirty (InstanceLifecycleEvent event); } api/src/java/javax/jdo/listener/InstanceLifecycleEvent.java100664 14577 12500110371 24347 0ustarmbouschenstaff 0 0 /* * 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. */ /* * InstanceLifecycleEvent.java * */ package javax.jdo.listener; import javax.jdo.spi.I18NHelper; /** * This is the event class used in life cycle event notifications. *

Note that although InstanceLifecycleEvent inherits Serializable interface * from EventObject, it is not intended to be Serializable. Appropriate * serialization methods are implemented to throw NotSerializableException. * @version 2.0 * @since 2.0 */ public class InstanceLifecycleEvent extends java.util.EventObject { private static final int FIRST_EVENT_TYPE = 0; public static final int CREATE = 0; public static final int LOAD = 1; public static final int STORE = 2; public static final int CLEAR = 3; public static final int DELETE = 4; public static final int DIRTY = 5; public static final int DETACH = 6; public static final int ATTACH = 7; private static final int LAST_EVENT_TYPE = 7; /** The Internationalization message helper. */ private final static I18NHelper msg = I18NHelper.getInstance ("javax.jdo.Bundle"); //NOI18N /** * The event type that triggered the construction of this event object. */ private final int eventType; /** * The "other" object associated with the event. */ private final Object target; /** * Creates a new event object with the specified * source and type. * @param source the instance that triggered the event * @param type the event type * @since 2.0 */ public InstanceLifecycleEvent (Object source, int type) { this(source, type, null); } /** * Creates a new event object with the specified * source, type, and target. * @param source the instance that triggered the event * @param type the event type * @param target the "other" instance * @since 2.0 */ public InstanceLifecycleEvent (Object source, int type, Object target) { super (source); if (type < FIRST_EVENT_TYPE || type > LAST_EVENT_TYPE) { throw new IllegalArgumentException(msg.msg("EXC_IllegalEventType")); } eventType = type; this.target = target; } /** * Returns the event type that triggered this event. * @return the event type * @since 2.0 */ public int getEventType () { return eventType; } /** * The source object of the Event. Although not deprecated, * it is recommended that the the methods * getPersistentInstance() and * getDetachedInstance() be used instead. * * @return The persistent instance on any pre- callback except preAttach, * or the detached instance for a postDetach or preAttach callback. * * @see #getPersistentInstance() * @see #getDetachedInstance() * @see "Section 12.15, Java Data Objects 2.0 Specification" */ public Object getSource() { return super.getSource(); } /** * The target object of the Event. Although not deprecated, * it is recommended that the the methods * getPersistentInstance() and * getDetachedInstance() be used instead. * * @return The detached instance for preDetach and postAttach, * the persistent instance otherwise. * * @since 2.0 * @see #getPersistentInstance() * @see #getDetachedInstance() * @see "Section 12.15, Java Data Objects 2.0 Specification" */ public Object getTarget () { return target; } /** * Returns the persistent instance involved in the event. * * @return The persistent instance involved in the event, or null if there * was none. * * @see "Section 12.15, Java Data Objects 2.0 Specification" */ public Object getPersistentInstance() { switch (getEventType()) { case DETACH: return target == null ? getSource() // preDetach: source is persistent instance : getTarget(); // postDetach: target is persistent instance case ATTACH: return target == null ? null // preAttach: no persistent instance yet : getSource(); // postAttach: source is persistent instance } // for all other events, source is persistent instance return getSource(); } /** * Returns the detached instance involved in the event. * * @return The detached instance involved in the event, or null if there was none. * * @see "Section 12.15, Java Data Objects 2.0 Specification" */ public Object getDetachedInstance() { switch (getEventType()) { case DETACH: return target == null ? null // preDetach: no detached instance yet : getSource(); // postDetach: source is detached instance case ATTACH: return target == null ? getSource() // preAttach: source is detached instance : getTarget(); // postAttach: target is detached instance } // for all other events, there is no detached instance return null; } /** * Serialization is not supported for InstanceLifecycleEvents. * param out the output stream * @since 2.0 */ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { throw new java.io.NotSerializableException(); } } api/src/java/javax/jdo/listener/InstanceLifecycleListener.java100664 2324 12500110371 25016 0ustarmbouschenstaff 0 0 /* * 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. */ /* * InstanceLifecycleListener.java * */ package javax.jdo.listener; /** * All lifecycle listeners extend from this base interface. * In order to minimize the impact on domain classes, instance callbacks * can be defined to use a life-cycle listener pattern instead of * having the domain class implement the callback interface(s). * * @version 2.0 * @since 2.0 */ public interface InstanceLifecycleListener { } api/src/java/javax/jdo/listener/LoadCallback.java100664 2537 12500110371 22226 0ustarmbouschenstaff 0 0 /* * 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. */ /* * LoadCallback.java * */ package javax.jdo.listener; /** * This interface is used to notify instances of load events. * @version 2.0 * @since 2.0 */ public interface LoadCallback { /** * Called after the values are loaded from the data store into * this instance. * *

This method is not modified by the enhancer. *

Derived fields should be initialized in this method. * The context in which this call is made does not allow access to * other persistent JDO instances. */ void jdoPostLoad(); } api/src/java/javax/jdo/listener/LoadLifecycleListener.java100664 2560 12500110371 24133 0ustarmbouschenstaff 0 0 /* * 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. */ /* * LoadLifecycleListener.java * */ package javax.jdo.listener; /** * This interface is implemented by listeners to be notified of * load events. * @version 2.0 * @since 2.0 */ public interface LoadLifecycleListener extends InstanceLifecycleListener { /** * Invoked whenever a persistent instance is loaded from the data * store. It is called after the method {@link LoadCallback#jdoPostLoad} * is invoked on the persistent instance. * @param event the load event. * @since 2.0 */ void postLoad (InstanceLifecycleEvent event); } api/src/java/javax/jdo/listener/package.html100664 4566 12500110371 21354 0ustarmbouschenstaff 0 0 Listener package This package contains the JDO specification listener interfaces and classes.

There are two kinds of interfaces defined to allow an application to manage life cycle changes to persistent objects.

The first kind is defined on the persistent domain class itself. This allows methods in the domain class to be called during life cycle events. The domain class implements one or more of the interfaces {@link javax.jdo.listener.AttachCallback}, {@link javax.jdo.listener.ClearCallback}, {@link javax.jdo.listener.DeleteCallback}, {@link javax.jdo.listener.DetachCallback}, {@link javax.jdo.listener.LoadCallback}, or {@link javax.jdo.listener.StoreCallback}. The methods in the interfaces are called during life cycle events.

The second kind is defined on an external class using the listener pattern. Instances of classes that implement one or more of the listener interfaces {@link javax.jdo.listener.AttachLifecycleListener}, {@link javax.jdo.listener.ClearLifecycleListener}, {@link javax.jdo.listener.CreateLifecycleListener}, {@link javax.jdo.listener.DeleteLifecycleListener}, {@link javax.jdo.listener.DetachLifecycleListener}, {@link javax.jdo.listener.DirtyLifecycleListener}, {@link javax.jdo.listener.LoadLifecycleListener}, or {@link javax.jdo.listener.StoreLifecycleListener} are registered with the PersistenceManager or PersistenceManagerFactory and receive callbacks during life cycle events of the persistent instances of interest. api/src/java/javax/jdo/listener/StoreCallback.java100664 3034 12500110371 22434 0ustarmbouschenstaff 0 0 /* * 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. */ /* * StoreCallback.java * */ package javax.jdo.listener; /** * This interface is used to notify instances of store events. * @version 2.0 * @since 2.0 */ public interface StoreCallback { /** * Called before the values are stored from this instance to the * data store. * *

Data store fields that might have been affected by modified * non-persistent fields should be updated in this method. * *

This method is modified by the enhancer so that changes to * persistent fields will be reflected in the data store. * The context in which this call is made allows access to the * PersistenceManager and other persistent JDO instances. */ void jdoPreStore(); } api/src/java/javax/jdo/listener/StoreLifecycleListener.java100664 3440 12500110371 24346 0ustarmbouschenstaff 0 0 /* * 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. */ /* * StoreLifecycleListener.java * */ package javax.jdo.listener; /** * This interface is implemented by listeners to be notified of * store events. * @version 2.0 * @since 2.0 */ public interface StoreLifecycleListener extends InstanceLifecycleListener { /** * Invoked whenever a persistent instance is stored, for example during * {@link javax.jdo.PersistenceManager#flush} or * {@link javax.jdo.Transaction#commit}. It is called before the * method {@link StoreCallback#jdoPreStore} is invoked. * @param event the store event. * @since 2.0 */ void preStore (InstanceLifecycleEvent event); /** * Invoked whenever a persistent instance is stored, for example during * {@link javax.jdo.PersistenceManager#flush} or * {@link javax.jdo.Transaction#commit}. It is called after the * field values have been stored. * @param event the store event. * @since 2.0 */ void postStore (InstanceLifecycleEvent event); } api/src/java/javax/jdo/metadata/ArrayMetadata.java100664 4325 12500110371 22401 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.metadata; /** * Represents details of an array in a field/property in a class. * @since 3.0 */ public interface ArrayMetadata extends Metadata { /** * Method to set the name of the element type * * @param type Name of the element type */ ArrayMetadata setElementType(String type); /** * Accessor for the element type * * @return The element type */ String getElementType(); /** * Method to set whether the element is embedded * * @param val Whether it is embedded */ ArrayMetadata setEmbeddedElement(boolean val); /** * Accessor for whether the element is embedded * * @return whether the element is embedded */ Boolean getEmbeddedElement(); /** * Method to set whether the element is serialised * * @param val Whether it is serialised */ ArrayMetadata setSerializedElement(boolean val); /** * Accessor for whether the element is serialised * * @return whether the element is serialised */ Boolean getSerializedElement(); /** * Method to set whether the element is dependent * * @param val Whether it is dependent */ ArrayMetadata setDependentElement(boolean val); /** * Accessor for whether the element is dependent * * @return whether the element is dependent */ Boolean getDependentElement(); } api/src/java/javax/jdo/metadata/ClassMetadata.java100664 3141 12500110371 22363 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.metadata; import java.lang.reflect.Field; /** * Represents a class. * @since 3.0 */ public interface ClassMetadata extends TypeMetadata { /** * Method to define the persistence modifier. * @param mod persistence modifier */ ClassMetadata setPersistenceModifier(ClassPersistenceModifier mod); /** * Accessor for the persistence modifier. * @return persistence modifier */ ClassPersistenceModifier getPersistenceModifier(); /** * Add a new field to this class. * @param name Name of the field * @return The FieldMetadata */ FieldMetadata newFieldMetadata(String name); /** * Add a new field to this class. * @param fld The field * @return The FieldMetadata */ FieldMetadata newFieldMetadata(Field fld); } api/src/java/javax/jdo/metadata/ClassPersistenceModifier.java100664 2000 12500110371 24577 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.metadata; /** * Enumeration of the persistence-modifier values for a class. * @since 3.0 */ public enum ClassPersistenceModifier { PERSISTENCE_CAPABLE, PERSISTENCE_AWARE, NON_PERSISTENT } api/src/java/javax/jdo/metadata/CollectionMetadata.java100664 4362 12500110371 23417 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.metadata; /** * Represents details of a collection in a field/property in a class. * @since 3.0 */ public interface CollectionMetadata extends Metadata { /** * Method to set the name of the element type * * @param type Name of the element type */ CollectionMetadata setElementType(String type); /** * Accessor for the element type * * @return The element type */ String getElementType(); /** * Method to set whether the element is embedded * * @param val Whether it is embedded */ CollectionMetadata setEmbeddedElement(boolean val); /** * Accessor for whether the element is embedded * * @return whether the element is embedded */ Boolean getEmbeddedElement(); /** * Method to set whether the element is serialised * * @param val Whether it is serialised */ CollectionMetadata setSerializedElement(boolean val); /** * Accessor for whether the element is serialised * * @return whether the element is serialised */ Boolean getSerializedElement(); /** * Method to set whether the element is dependent * * @param val Whether it is dependent */ CollectionMetadata setDependentElement(boolean val); /** * Accessor for whether the element is dependent * * @return whether the element is dependent */ Boolean getDependentElement(); } api/src/java/javax/jdo/metadata/ColumnMetadata.java100664 7465 12500110371 22570 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.metadata; /** * Represents an element in a collection/array. * @since 3.0 */ public interface ColumnMetadata extends Metadata { /** * Method to set the column name. * * @param name Column name */ ColumnMetadata setName(String name); /** * Accessor for the name of the column. * * @return The name */ String getName(); /** * Method to set the target column (at the other side of the relation). * * @param target Target column */ ColumnMetadata setTarget(String target); /** * Accessor for the name of the target column. * * @return Target column name */ String getTarget(); /** * Method to set the target field (at the other side of the relation). * * @param target Target field */ ColumnMetadata setTargetField(String target); /** * Accessor for the name of the target field. * * @return Target field name */ String getTargetField(); /** * Method to set the JDBC type. * * @param type JDBC Type */ ColumnMetadata setJDBCType(String type); /** * Accessor for the JDBC Type * * @return JDBC Type */ String getJDBCType(); /** * Method to set the SQL type. * * @param type SQL Type */ ColumnMetadata setSQLType(String type); /** * Accessor for the SQL Type * * @return SQL Type */ String getSQLType(); /** * Method to set the length * * @param len Length */ ColumnMetadata setLength(int len); /** * Accessor for the length * * @return length */ Integer getLength(); /** * Method to set the scale * * @param scale scale */ ColumnMetadata setScale(int scale); /** * Accessor for the scale * * @return scale */ Integer getScale(); /** * Method to set whether it allows null. * * @param nulls Allows null? */ ColumnMetadata setAllowsNull(boolean nulls); /** * Accessor for whether the column allows null. * * @return Allows null? */ Boolean getAllowsNull(); /** * Method to set the default value. * * @param val Default value */ ColumnMetadata setDefaultValue(String val); /** * Accessor for the default value * * @return Default value */ String getDefaultValue(); /** * Method to set the insert value (for columns with no field/property). * * @param val Insert value */ ColumnMetadata setInsertValue(String val); /** * Accessor for the insert value (for columns with no field/property) * * @return Insert value */ String getInsertValue(); /** * Method to set the position * * @param pos Position */ ColumnMetadata setPosition(int pos); /** * Accessor for the position * * @return position */ Integer getPosition(); } api/src/java/javax/jdo/metadata/DatastoreIdentityMetadata.java100664 5422 12500110371 24762 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.metadata; import javax.jdo.annotations.IdGeneratorStrategy; /** * Represents the datastore identity of a class. * @since 3.0 */ public interface DatastoreIdentityMetadata extends Metadata { /** * Method to set the datastore identity column name. * * @param column Name of the datastore identity column */ DatastoreIdentityMetadata setColumn(String column); /** * Accessor for the datastore identity column name * * @return The column name */ String getColumn(); /** * Method to set the identity generation strategy. * * @param strategy The strategy */ DatastoreIdentityMetadata setStrategy(IdGeneratorStrategy strategy); /** * Accessor for the identity generation strategy. * * @return The strategy */ IdGeneratorStrategy getStrategy(); /** * Method to set the custom identity generation strategy. * * @param strategy The strategy */ DatastoreIdentityMetadata setCustomStrategy(String strategy); /** * Accessor for the custom strategy (overriding "strategy"). * * @return The strategy */ String getCustomStrategy(); /** * Method to set the sequence key (when using "sequence" strategy) * * @param seq Sequence key */ DatastoreIdentityMetadata setSequence(String seq); /** * Accessor for the sequence key (when using "sequence" strategy) * * @return The sequence */ String getSequence(); /** * Accessor for all column(s) defined on the datastore identity. * * @return The column(s) */ ColumnMetadata[] getColumns(); /** * Add a new column for this datastore identity. * * @return The ColumnMetadata */ ColumnMetadata newColumnMetadata(); /** * Accessor for the number of columns defined for this datastore identity. * * @return The number of columns */ int getNumberOfColumns(); } api/src/java/javax/jdo/metadata/DiscriminatorMetadata.java100664 6063 12500110371 24133 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.metadata; import javax.jdo.annotations.DiscriminatorStrategy; /** * Represents the discriminator for inheritance purposes for this class. * @since 3.0 */ public interface DiscriminatorMetadata extends Metadata { /** * Method to set the discriminator column. * * @param column Name of the discriminator clumn */ DiscriminatorMetadata setColumn(String column); /** * Accessor for the discriminator column name * * @return The column name */ String getColumn(); /** * Method to set the discriminator value (when using "value-map" strategy). * * @param val Value for the discriminator for this class */ DiscriminatorMetadata setValue(String val); /** * Accessor for the discriminator value (when using "value-map" strategy). * * @return The value */ String getValue(); /** * Method to set the discriminator strategy. * * @param strategy The strategy */ DiscriminatorMetadata setStrategy(DiscriminatorStrategy strategy); /** * Accessor for the discriminator strategy. * * @return The strategy */ DiscriminatorStrategy getStrategy(); /** * Method to set whether indexed. * * @param indexed Whether indexed (true | false | unique) */ DiscriminatorMetadata setIndexed(Indexed indexed); /** * Accessor for whether indexed (true|false|unique) * * @return Indexed? */ Indexed getIndexed(); /** * Accessor for all column(s) defined on the discriminator. * * @return The column(s) */ ColumnMetadata[] getColumns(); /** * Add a new column for this discriminator. * * @return The ColumnMetadata */ ColumnMetadata newColumnMetadata(); /** * Accessor for the number of columns defined for this discriminator. * * @return The number of columns */ int getNumberOfColumns(); /** * Method to set the index metadata for the discriminator * * @return The IndexMetadata */ IndexMetadata newIndexMetadata(); /** * Accessor for any index metadata for the discriminator * * @return Index metadata */ IndexMetadata getIndexMetadata(); } api/src/java/javax/jdo/metadata/ElementMetadata.java100664 7532 12500110371 22717 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.metadata; import javax.jdo.annotations.ForeignKeyAction; /** * Represents an element in a collection/array. * @since 3.0 */ public interface ElementMetadata extends Metadata { /** * Method to set the column name. * * @param column Column name */ ElementMetadata setColumn(String column); /** * Accessor for the name of the column. * * @return The name */ String getColumn(); /** * Method to set the table name. * * @param table Table name */ ElementMetadata setTable(String table); /** * Accessor for the name of the table. * * @return The name */ String getTable(); /** * Method to set the delete action of the FK * * @param action Delete action of the FK */ ElementMetadata setDeleteAction(ForeignKeyAction action); /** * Accessor for the delete action of the FK * * @return The FK delete-action */ ForeignKeyAction getDeleteAction(); /** * Method to set the update action of the FK * * @param action Update action of the FK */ ElementMetadata setUpdateAction(ForeignKeyAction action); /** * Accessor for the update action of the FK * * @return The FK update-action */ ForeignKeyAction getUpdateAction(); /** * Accessor for all column(s) defined on the element. * * @return The column(s) */ ColumnMetadata[] getColumns(); /** * Add a new column for this element. * * @return The ColumnMetadata */ ColumnMetadata newColumnMetadata(); /** * Accessor for the number of columns defined for this element. * * @return The number of columns */ int getNumberOfColumns(); /** * Method to set new embedded metadata for the element. * * @return The EmbeddedMetadata */ EmbeddedMetadata newEmbeddedMetadata(); /** * Accessor for any embedded metadata on this element * * @return The EmbeddedMetadata */ EmbeddedMetadata getEmbeddedMetadata(); /** * Method to set new index metadata for the element. * * @return The IndexMetadata */ IndexMetadata newIndexMetadata(); /** * Accessor for any index metadata on this element * * @return Index metadata */ IndexMetadata getIndexMetadata(); /** * Method to set new unique constraint metadata for the element * * @return The UniqueMetadata */ UniqueMetadata newUniqueMetadata(); /** * Accessor for any unique constraint metadata on this element. * * @return The UniqueMetadata */ UniqueMetadata getUniqueMetadata(); /** * Method to set new foreign key metadata for the element * * @return The ForeignKeyMetadata */ ForeignKeyMetadata newForeignKeyMetadata(); /** * Accessor for any foreign key metadata on this element. * * @return The ForeignKeyMetadata */ ForeignKeyMetadata getForeignKeyMetadata(); } api/src/java/javax/jdo/metadata/EmbeddedMetadata.java100664 6023 12500110371 23011 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.metadata; /** * Represents embedding details of a field/property in a class. * @since 3.0 */ public interface EmbeddedMetadata extends Metadata { /** * Method to set the name of the owner field/property. * * @param member Name of the owner member */ EmbeddedMetadata setOwnerMember(String member); /** * Accessor for the owner field/property name. * * @return The owner member name */ String getOwnerMember(); /** * Method to set any column that indicates a null embedded object * * @param col Null indicator column */ EmbeddedMetadata setNullIndicatorColumn(String col); /** * Accessor for any column indicating a null embedded object * * @return Whether to call post-load */ String getNullIndicatorColumn(); /** * Method to set the value of a null indicator column to signify null object * * @param val Null indicator value */ EmbeddedMetadata setNullIndicatorValue(String val); /** * Accessor for a null indicator value * * @return Null indicator value */ String getNullIndicatorValue(); /** * Accessor for all fields/properties defined on the fetch group. * * @return The members */ MemberMetadata[] getMembers(); /** * Accessor for the number of fields/properties defined for embedding * * @return The number of members */ int getNumberOfMembers(); /** * Add a new field to be embedded. * * @param name Name of the field * @return The FieldMetadata */ FieldMetadata newFieldMetadata(String name); /** * Add a new property for embedding * * @param name Name of the property * @return The PropertyMetadata */ PropertyMetadata newPropertyMetadata(String name); /** * Accessor for the discriminator metadata when handling inherited objects. * @return Discriminator details */ DiscriminatorMetadata getDiscriminatorMetadata(); /** * Method to define the new discriminator metadata for handling inherited embedded objects. * @return Discriminator metadata */ DiscriminatorMetadata newDiscriminatorMetadata(); } api/src/java/javax/jdo/metadata/ExtensionMetadata.java100664 2423 12500110371 23274 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.metadata; /** * A vendor extension defined in Metadata. * * @version 3.0 */ public interface ExtensionMetadata { /** * Accessor for the vendor name (set at construction). * @return The vendor */ String getVendorName(); /** * Accessor for the key (set at construction). * @return The key */ String getKey(); /** * Accessor for the value (set at construction). * @return The value */ String getValue(); } api/src/java/javax/jdo/metadata/FetchGroupMetadata.java100664 4136 12500110371 23371 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.metadata; /** * Represents a fetch group for a class. * @since 3.0 */ public interface FetchGroupMetadata extends Metadata { /** * Accessor for the fetch group name (set on construction). * * @return The fetch group name */ String getName(); /** * Method to set whether to call post load with this fetch group * * @param load Call post load */ FetchGroupMetadata setPostLoad(boolean load); /** * Accessor for whether to call post load for this fetch group * * @return Whether to call post-load */ Boolean getPostLoad(); /** * Accessor for all fields/properties defined on the fetch group. * @return The members */ MemberMetadata[] getMembers(); /** * Accessor for the number of fields/properties defined for this fetch group. * * @return The number of members */ int getNumberOfMembers(); /** * Add a new field for this fetch group. * * @param name Name of field * @return The FieldMetadata */ FieldMetadata newFieldMetadata(String name); /** * Add a new property for this fetch group * * @param name Name of property * @return The PropertyMetadata */ PropertyMetadata newPropertyMetadata(String name); } api/src/java/javax/jdo/metadata/FetchPlanMetadata.java100664 4250 12500110371 23164 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.metadata; /** * Represents a fetch plan for a class. * @since 3.0 */ public interface FetchPlanMetadata extends Metadata { /** * Accessor for the fetch plan name (set on construction). * * @return The fetch plan name */ String getName(); /** * Method to set the max fetch depth for this plan. * * @param depth The max fetch depth */ FetchPlanMetadata setMaxFetchDepth(int depth); /** * Accessor for the max fetch depth. * * @return The max fetch depth */ int getMaxFetchDepth(); /** * Method to set the fetch size. * * @param size The fetch size */ FetchPlanMetadata setFetchSize(int size); /** * Accessor for the max fetch depth. * * @return The max fetch depth */ int getFetchSize(); /** * Accessor for all fetch groups defined for this fetch plan. * * @return The fetch groups */ FetchGroupMetadata[] getFetchGroups(); /** * Add a new fetch group for this fetch plan. * * @param name Name of fetch group. * @return The FetchGroupMetadata */ FetchGroupMetadata newFetchGroupMetadata(String name); /** * Accessor for the number of fetch groups defined for this fetch plan. * * @return The number of fetch groups */ int getNumberOfFetchGroups(); } api/src/java/javax/jdo/metadata/FieldMetadata.java100664 1662 12500110371 22347 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.metadata; /** * Represents a field in a class. * @since 3.0 */ public interface FieldMetadata extends MemberMetadata { } api/src/java/javax/jdo/metadata/ForeignKeyMetadata.java100664 7417 12500110371 23372 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.metadata; import javax.jdo.annotations.ForeignKeyAction; /** * Represents a FK constraint in an ORM context. * @since 3.0 */ public interface ForeignKeyMetadata extends Metadata { /** * Method to set the name of the constraint * * @param name Name of the constraint */ ForeignKeyMetadata setName(String name); /** * Accessor for the constraint name. * * @return The constraint name */ String getName(); /** * Method to set the table name. * * @param table Table name */ ForeignKeyMetadata setTable(String table); /** * Accessor for the name of the table. * * @return The name */ String getTable(); /** * Method to set whether it is unique. * * @param unique Unique? */ ForeignKeyMetadata setUnique(boolean unique); /** * Accessor for whether unique. * * @return Unique? */ Boolean getUnique(); /** * Method to set whether it is deferred. * * @param def Deferred? */ ForeignKeyMetadata setDeferred(boolean def); /** * Accessor for whether the constraint can be deferred. * * @return Deferred? */ Boolean getDeferred(); /** * Method to set the delete action of the FK * * @param action Delete action of the FK */ ForeignKeyMetadata setDeleteAction(ForeignKeyAction action); /** * Accessor for the delete action of the FK * * @return The FK delete-action */ ForeignKeyAction getDeleteAction(); /** * Method to set the update action of the FK * * @param action Update action of the FK */ ForeignKeyMetadata setUpdateAction(ForeignKeyAction action); /** * Accessor for the update action of the FK * * @return The FK update-action */ ForeignKeyAction getUpdateAction(); /** * Accessor for all column(s) defined on the FK. * * @return The column(s) */ ColumnMetadata[] getColumns(); /** * Add a new column for this FK. * * @return The ColumnMetadata */ ColumnMetadata newColumnMetadata(); /** * Accessor for the number of columns defined for this FK. * * @return The number of columns */ int getNumberOfColumns(); /** * Accessor for all fields/properties defined on the FK. * @return The members */ MemberMetadata[] getMembers(); /** * Accessor for the number of fields/properties defined for this FK. * @return The number of members */ int getNumberOfMembers(); /** * Add a new field for this FK. * * @param name Name of the field * @return The FieldMetadata */ FieldMetadata newFieldMetadata(String name); /** * Add a new property for this FK. * * @param name Name of the property * @return The PropertyMetadata */ PropertyMetadata newPropertyMetadata(String name); } api/src/java/javax/jdo/metadata/Indexed.java100664 1730 12500110371 21237 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.metadata; /** * Enumeration of the indexed values. * * @version 3.0 * @since 3.0 */ public enum Indexed { UNSPECIFIED, TRUE, FALSE, UNIQUE } api/src/java/javax/jdo/metadata/IndexMetadata.java100664 5407 12500110371 22374 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.metadata; /** * Represents an index. * @since 3.0 */ public interface IndexMetadata extends Metadata { /** * Method to set the name of the index * * @param name Name of the index */ IndexMetadata setName(String name); /** * Accessor for the index name. * * @return The index name */ String getName(); /** * Method to set the table name. * * @param table Table name */ IndexMetadata setTable(String table); /** * Accessor for the name of the table. * * @return The name */ String getTable(); /** * Method to set whether it is unique. * * @param unique Unique? */ IndexMetadata setUnique(boolean unique); /** * Accessor for whether unique. * * @return Unique? */ boolean getUnique(); /** * Accessor for all column(s) defined on the index. * * @return The column(s) */ ColumnMetadata[] getColumns(); /** * Add a new column for this index. * * @return The ColumnMetadata */ ColumnMetadata newColumn(); /** * Accessor for the number of columns defined for this index. * * @return The number of columns */ int getNumberOfColumns(); /** * Accessor for all member(s) defined on the index. * * @return The fields/properties */ MemberMetadata[] getMembers(); /** * Accessor for the number of fields/properties defined for this index. * * @return The number of members */ int getNumberOfMembers(); /** * Add a new field for this index. * * @param name Name of the field * @return The FieldMetadata */ FieldMetadata newFieldMetadata(String name); /** * Add a new property for this index. * * @param name Name of the property * @return The PropertyMetadata */ PropertyMetadata newPropertyMetadata(String name); } api/src/java/javax/jdo/metadata/InheritanceMetadata.java100664 4312 12500110371 23550 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.metadata; import javax.jdo.annotations.InheritanceStrategy; /** * Represents the inheritance of a class. * @since 3.0 */ public interface InheritanceMetadata extends Metadata { /** * Method to set the inheritance strategy. * * @param strategy The strategy */ InheritanceMetadata setStrategy(InheritanceStrategy strategy); /** * Accessor for the inheritance strategy. * * @return The strategy */ InheritanceStrategy getStrategy(); /** * Method to set the custom inheritance strategy. * * @param strategy The strategy */ InheritanceMetadata setCustomStrategy(String strategy); /** * Accessor for the custom inheritance (overriding "strategy"). * * @return The strategy */ String getCustomStrategy(); /** * Method to define the new discriminator metadata. * * @return The DiscriminatorMetadata */ DiscriminatorMetadata newDiscriminatorMetadata(); /** * Accessor for the discriminator (if any). * * @return Discriminator */ DiscriminatorMetadata getDiscriminatorMetadata(); /** * Method to define the new join information * * @return The JoinMetadata */ JoinMetadata newJoinMetadata(); /** * Accessor for the join (if any). * * @return Join information */ JoinMetadata getJoinMetadata(); } api/src/java/javax/jdo/metadata/InterfaceMetadata.java100664 1674 12500110371 23227 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.metadata; /** * Represents a persistent-interface. * @since 3.0 */ public interface InterfaceMetadata extends TypeMetadata { } api/src/java/javax/jdo/metadata/JDOMetadata.java100664 7530 12500110371 21740 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.metadata; /** * Represents the top-level JDO metadata. * @since 3.0 */ public interface JDOMetadata extends Metadata { /** * Method to set the catalog (ORM) to apply to all classes in this * JDO Metadata. * * @param catalog Catalog name */ JDOMetadata setCatalog(String catalog); /** * Accessor for the catalog (ORM) that all classes in this JDO Metadata * default to. * * @return The catalog */ String getCatalog(); /** * Method to set the schema (ORM) to apply to all classes in this JDO * Metadata. * * @param schema Schema name */ JDOMetadata setSchema(String schema); /** * Accessor for the schema (ORM) that all classes in this JDO Metadata * default to. * * @return The schema */ String getSchema(); /** * Accessor for all packages defined on the JDO Metadata. * * @return The packages */ PackageMetadata[] getPackages(); /** * Add a new package to this JDO Metadata. * * @param pkgName Name of the package * @return The PackageMetadata */ PackageMetadata newPackageMetadata(String pkgName); /** * Add a new package to this JDO Metadata. * * @param pkg The package * @return The PackageMetadata */ PackageMetadata newPackageMetadata(Package pkg); /** * Accessor for the number of packages defined in this JDO Metadata. * * @return The number of packages. */ int getNumberOfPackages(); /** * Add a new class to this JDO Metadata. * Adds its package also if not yet existing. * * @param cls Class to add * @return The ClassMetadata */ ClassMetadata newClassMetadata(Class cls); /** * Add a new interface to this JDO Metadata. * Adds its package also if not yet existing. * * @param cls Class to add * @return The InterfaceMetadata */ InterfaceMetadata newInterfaceMetadata(Class cls); /** * Accessor for any named queries defined on the JDO Metadata. * * @return The queries */ QueryMetadata[] getQueries(); /** * Add a new named query to this JDO Metadata. * * @param name Name of the query * @return The QueryMetadata */ QueryMetadata newQueryMetadata(String name); /** * Accessor for the number of named queries defined in this JDO Metadata. * * @return The number of queries. */ int getNumberOfQueries(); /** * Accessor for any fetch plans defined on the JDO Metadata. * * @return The fetch plans */ FetchPlanMetadata[] getFetchPlans(); /** * Add a new fetch plan to this JDO Metadata. * * @param name Name of the query * @return The FetchPlanMetadata */ FetchPlanMetadata newFetchPlanMetadata(String name); /** * Accessor for the number of fetch plans defined in this JDO Metadata. * * @return The number of fetch plans. */ int getNumberOfFetchPlans(); } api/src/java/javax/jdo/metadata/JoinMetadata.java100664 10460 12500110371 22237 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.metadata; import javax.jdo.annotations.ForeignKeyAction; /** * Represents join information. * @since 3.0 */ public interface JoinMetadata extends Metadata { /** * Method to set the join column. * * @param column Name of the join column */ JoinMetadata setColumn(String column); /** * Accessor for the join column name * * @return The column name */ String getColumn(); /** * Method to set the table name. * * @param table Table name */ JoinMetadata setTable(String table); /** * Accessor for the name of the table. * * @return The name */ String getTable(); /** * Method to set whether to use an outer join * * @param outer Outer join? */ JoinMetadata setOuter(boolean outer); /** * Accessor for whether to use an outer join. * * @return Outer join? */ boolean getOuter(); /** * Method to set the delete action of the FK * * @param action Delete action of the FK */ JoinMetadata setDeleteAction(ForeignKeyAction action); /** * Accessor for the delete action of the FK * * @return The FK delete-action */ ForeignKeyAction getDeleteAction(); /** * Method to set whether indexed. * * @param indexed Whether indexed (true | false | unique) */ JoinMetadata setIndexed(Indexed indexed); /** * Accessor for whether indexed (true|false|unique) * * @return Indexed? */ Indexed getIndexed(); /** * Method to set whether it is unique. * * @param unique Unique? */ JoinMetadata setUnique(boolean unique); /** * Accessor for whether unique. * * @return Unique? */ Boolean getUnique(); /** * Method to set new index metadata for the join. * * @return The IndexMetadata */ IndexMetadata newIndexMetadata(); /** * Accessor for any index metadata on this join * * @return Index metadata */ IndexMetadata getIndexMetadata(); /** * Method to set new unique constraint metadata for the join * * @return The UniqueMetadata */ UniqueMetadata newUniqueMetadata(); /** * Accessor for any unique constraint metadata on this join. * * @return The UniqueMetadata */ UniqueMetadata getUniqueMetadata(); /** * Method to set new foreign key metadata for the join * * @return The ForeignKeyMetadata */ ForeignKeyMetadata newForeignKeyMetadata(); /** * Accessor for any foreign key metadata on this join. * * @return The ForeignKeyMetadata */ ForeignKeyMetadata getForeignKeyMetadata(); /** * Method to set new primary key metadata for the join * * @return The PrimaryKeyMetadata */ PrimaryKeyMetadata newPrimaryKeyMetadata(); /** * Accessor for any primary key metadata on this join. * * @return The PrimaryKeyMetadata */ PrimaryKeyMetadata getPrimaryKeyMetadata(); /** * Accessor for all column(s) defined on the join. * * @return The column(s) */ ColumnMetadata[] getColumns(); /** * Add a new column for this join. * * @return The ColumnMetadata */ ColumnMetadata newColumnMetadata(); /** * Accessor for the number of columns defined for this join. * * @return The number of columns */ int getNumberOfColumns(); } api/src/java/javax/jdo/metadata/KeyMetadata.java100664 7371 12500110371 22057 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.metadata; import javax.jdo.annotations.ForeignKeyAction; /** * Represents a key in a map. */ public interface KeyMetadata extends Metadata { /** * Method to set the column name. * * @param column Column name */ KeyMetadata setColumn(String column); /** * Accessor for the name of the column. * * @return The name */ String getColumn(); /** * Method to set the table name. * * @param table Table name */ KeyMetadata setTable(String table); /** * Accessor for the name of the table. * * @return The name */ String getTable(); /** * Method to set the delete action of the FK * * @param action Delete action of the FK */ KeyMetadata setDeleteAction(ForeignKeyAction action); /** * Accessor for the delete action of the FK * * @return The FK delete-action */ ForeignKeyAction getDeleteAction(); /** * Method to set the update action of the FK * * @param action Update action of the FK */ KeyMetadata setUpdateAction(ForeignKeyAction action); /** * Accessor for the update action of the FK * * @return The FK update-action */ ForeignKeyAction getUpdateAction(); /** * Accessor for all column(s) defined on the key. * * @return The column(s) */ ColumnMetadata[] getColumns(); /** * Add a new column for this key. * * @return The ColumnMetadata */ ColumnMetadata newColumnMetadata(); /** * Accessor for the number of columns defined for this key. * * @return The number of columns */ int getNumberOfColumns(); /** * Method to set new embedded metadata for the key. * * @return The EmbeddedMetadata */ EmbeddedMetadata newEmbeddedMetadata(); /** * Accessor for any embedded metadata on this key * * @return The EmbeddedMetadata */ EmbeddedMetadata getEmbeddedMetadata(); /** * Method to set new index metadata for the key. * * @return The IndexMetadata */ IndexMetadata newIndexMetadata(); /** * Accessor for any index metadata on this key * * @return Index metadata */ IndexMetadata getIndexMetadata(); /** * Method to set new unique constraint metadata for the key * * @return The UniqueMetadata */ UniqueMetadata newUniqueMetadata(); /** * Accessor for any unique constraint metadata on this key. * * @return The UniqueMetadata */ UniqueMetadata getUniqueMetadata(); /** * Method to set new foreign key metadata for the key * * @return The ForeignKeyMetadata */ ForeignKeyMetadata newForeignKeyMetadata(); /** * Accessor for any foreign key metadata on this key. * * @return The ForeignKeyMetadata */ ForeignKeyMetadata getForeignKeyMetadata(); }api/src/java/javax/jdo/metadata/MapMetadata.java100664 6515 12500110371 22043 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.metadata; /** * Represents details of a map in a field/property in a class. * @since 3.0 */ public interface MapMetadata extends Metadata { /** * Method to set the name of the key type * * @param type Name of the key type */ MapMetadata setKeyType(String type); /** * Accessor for the key type * * @return The key type */ String getKeyType(); /** * Method to set whether the key is embedded * * @param val Whether it is embedded */ MapMetadata setEmbeddedKey(boolean val); /** * Accessor for whether the key is embedded * * @return whether the key is embedded */ Boolean getEmbeddedKey(); /** * Method to set whether the key is serialised * * @param val Whether it is serialised */ MapMetadata setSerializedKey(boolean val); /** * Accessor for whether the key is serialised * * @return whether the key is serialised */ Boolean getSerializedKey(); /** * Method to set whether the key is dependent * * @param val Whether it is dependent */ MapMetadata setDependentKey(boolean val); /** * Accessor for whether the key is dependent * * @return whether the key is dependent */ Boolean getDependentKey(); /** * Method to set the name of the value type * * @param type Name of the value type */ MapMetadata setValueType(String type); /** * Accessor for the value type * * @return The value type */ String getValueType(); /** * Method to set whether the value is embedded * * @param val Whether it is embedded */ MapMetadata setEmbeddedValue(boolean val); /** * Accessor for whether the value is embedded * * @return whether the value is embedded */ Boolean getEmbeddedValue(); /** * Method to set whether the value is serialised * * @param val Whether it is serialised */ MapMetadata setSerializedValue(boolean val); /** * Accessor for whether the value is serialised * * @return whether the value is serialised */ Boolean getSerializedValue(); /** * Method to set whether the value is dependent * * @param val Whether it is dependent */ MapMetadata setDependentValue(boolean val); /** * Accessor for whether the value is dependent * * @return whether the value is dependent */ Boolean getDependentValue(); } api/src/java/javax/jdo/metadata/MemberMetadata.java100664 26200 12500110371 22546 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.metadata; import javax.jdo.annotations.ForeignKeyAction; import javax.jdo.annotations.IdGeneratorStrategy; import javax.jdo.annotations.NullValue; import javax.jdo.annotations.PersistenceModifier; /** * Represents a field/property in a class/persistent-interface. * @since 3.0 */ public interface MemberMetadata extends Metadata { /** * Method to set the name. * * @param name name */ MemberMetadata setName(String name); /** * Accessor for the name of the field/property. * * @return The name */ String getName(); /** * Method to set the table name. * * @param table Table name */ MemberMetadata setTable(String table); /** * Accessor for the name of the table. * * @return The name */ String getTable(); /** * Method to set the column name. * * @param col Column name */ MemberMetadata setColumn(String col); /** * Accessor for the name of the column. * * @return The column name */ String getColumn(); /** * Method to set the field type(s). For defining where we want to restrict * what type is stored in a field * * @param type Type of field */ MemberMetadata setFieldType(String type); /** * Accessor for the type storable in the field * * @return The field type */ String getFieldType(); /** * Method to set the delete action of the FK * * @param action Delete action of the FK */ MemberMetadata setDeleteAction(ForeignKeyAction action); /** * Accessor for the delete action of the FK * * @return The FK delete-action */ ForeignKeyAction getDeleteAction(); /** * Method to set the persistence-modifier of the field/property. * * @param mod persistence modifier */ MemberMetadata setPersistenceModifier(PersistenceModifier mod); /** * Accessor for the persistence modifier of the field/property. * * @return The persistence modifier */ PersistenceModifier getPersistenceModifier(); /** * Method to set the behaviour of a null value * * @param val Null value behaviour */ MemberMetadata setNullValue(NullValue val); /** * Accessor for the behaviour of a null value * * @return The null value behaviour */ NullValue getNullValue(); /** * Method to set whether it is in the DFG. * * @param dfg DFG? */ MemberMetadata setDefaultFetchGroup(boolean dfg); /** * Accessor for whether part of the DFG. * * @return dfg? */ Boolean getDefaultFetchGroup(); /** * Method to set whether it is unique. * * @param unique Unique? */ MemberMetadata setDependent(boolean unique); /** * Accessor for whether unique. * * @return Unique? */ Boolean getDependent(); /** * Method to set whether it is embedded. * * @param emb Embedded? */ MemberMetadata setEmbedded(boolean emb); /** * Accessor for whether it is embedded. * * @return embedded? */ Boolean getEmbedded(); /** * Method to set whether it is serialized. * * @param ser serialized? */ MemberMetadata setSerialized(boolean ser); /** * Accessor for whether it is serialized. * * @return serialized? */ Boolean getSerialized(); /** * Method to set whether it is part of the pk * * @param pk PK? */ MemberMetadata setPrimaryKey(boolean pk); /** * Accessor for whether it is part of the pk. * * @return pk? */ boolean getPrimaryKey(); /** * Method to set whether it is indexed. * * @param index Indexed? */ MemberMetadata setIndexed(boolean index); /** * Accessor for whether it is indexed. * * @return Indexed? */ Boolean getIndexed(); /** * Method to set whether it is unique. * * @param unique Unique? */ MemberMetadata setUnique(boolean unique); /** * Accessor for whether unique. * * @return Unique? */ Boolean getUnique(); /** * Method to set whether this is cacheable * * @param cacheable Cacheable? */ MemberMetadata setCacheable(boolean cacheable); /** * Accessor for whether this is cacheable. * * @return Detachable? */ boolean getCacheable(); /** * Method to set the recursion depth (when used in a fetch group). * * @param depth Recursion depth */ MemberMetadata setRecursionDepth(int depth); /** * Accessor for the recursion depth (when part of a fetch group). * * @return Recursion depth? */ int getRecursionDepth(); /** * Method to set the load fetch group. * * @param grp Load fetch group */ MemberMetadata setLoadFetchGroup(String grp); /** * Accessor for the name of the load fetch group * * @return The load fetch group */ String getLoadFetchGroup(); /** * Method to set the value strategy * * @param str Value strategy */ MemberMetadata setValueStrategy(IdGeneratorStrategy str); /** * Accessor for the value strategy * * @return Value strategy */ IdGeneratorStrategy getValueStrategy(); /** * Method to set the custom identity generation strategy. * * @param strategy The strategy */ MemberMetadata setCustomStrategy(String strategy); /** * Accessor for the custom strategy (overriding "strategy"). * * @return The strategy */ String getCustomStrategy(); /** * Method to set the sequence (when using value-strategy of "sequence") * * @param seq Sequence key */ MemberMetadata setSequence(String seq); /** * Accessor for the sequence (when using value-strategy of "sequence") * * @return Sequence key */ String getSequence(); /** * Method to set the field on the other side of a bidirectional relation * (this side is owner) * * @param map mapped-by field/property */ MemberMetadata setMappedBy(String map); /** * Accessor for the mapped-by field/property * * @return mapped-by field/property */ String getMappedBy(); /** * Method to define the array details (if the field/property is an array) * * @return The ArrayMetadata */ ArrayMetadata newArrayMetadata(); /** * Accessor for the array details. * * @return array details */ ArrayMetadata getArrayMetadata(); /** * Method to define the array details (if the field/property is an array) * * @return The ArrayMetadata */ CollectionMetadata newCollectionMetadata(); /** * Accessor for the array details. * * @return array details */ CollectionMetadata getCollectionMetadata(); /** * Method to define the map details (if the field/property is an map) * * @return The MapMetadata */ MapMetadata newMapMetadata(); /** * Accessor for the map details. * * @return map details */ MapMetadata getMapMetadata(); /** * Method to define the join details * * @return The JoinMetadata */ JoinMetadata newJoinMetadata(); /** * Accessor for the join details. * * @return join details */ JoinMetadata getJoinMetadata(); /** * Method to define the embedded details * * @return The EmbeddedMetadata */ EmbeddedMetadata newEmbeddedMetadata(); /** * Accessor for the embedded metadata. * * @return embedded metadata */ EmbeddedMetadata getEmbeddedMetadata(); /** * Method to define the new element details * * @return The ElementMetadata */ ElementMetadata newElementMetadata(); /** * Accessor for the element details * * @return element details */ ElementMetadata getElementMetadata(); /** * Method to define the key details * * @return The KeyMetadata */ KeyMetadata newKeyMetadata(); /** * Accessor for the key details * * @return key details */ KeyMetadata getKeyMetadata(); /** * Method to define the value details * * @return The ValueMetadata */ ValueMetadata newValueMetadata(); /** * Accessor for the value details * * @return value details */ ValueMetadata getValueMetadata(); /** * Method to set index metadata for the field/property * * @return The metadata for any index */ IndexMetadata newIndexMetadata(); /** * Accessor for any index metadata for the field/property * * @return Index metadata */ IndexMetadata getIndexMetadata(); /** * Method to set new unique constraint metadata for the field/property * * @return The UniqueMetadata */ UniqueMetadata newUniqueMetadata(); /** * Accessor for any unique constraint metadata on this field/property. * * @return The UniqueMetadata */ UniqueMetadata getUniqueMetadata(); /** * Method to set new foreign key metadata for the field/property * * @return The ForeignKeyMetadata */ ForeignKeyMetadata newForeignKeyMetadata(); /** * Accessor for any foreign key metadata on this field/property. * * @return The ForeignKeyMetadata */ ForeignKeyMetadata getForeignKeyMetadata(); /** * Method to define the order details. * * @return The OrdeMetadata */ OrderMetadata newOrderMetadata(); /** * Accessor for the order metadata. * * @return order metadata */ OrderMetadata getOrderMetadata(); /** * Accessor for all column(s) defined on the join. * * @return The column(s) */ ColumnMetadata[] getColumns(); /** * Add a new column for this join. * * @return The ColumnMetadata */ ColumnMetadata newColumnMetadata(); /** * Accessor for the number of columns defined for this join. * * @return The number of columns */ int getNumberOfColumns(); } api/src/java/javax/jdo/metadata/Metadata.java100664 3275 12500110371 21405 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.metadata; /** * This interface provides base level definitions for all metadata components. * * @version 3.0 */ public interface Metadata { /** * Add a vendor extension to this metadata component. * * @param vendor Identifier for the vendor * @param key The extension key * @param value Value for the extension * @return The ExtensionMetadata */ ExtensionMetadata newExtensionMetadata(String vendor, String key, String value); /** * Number of extensions on this component. * * @return Number of extensions */ int getNumberOfExtensions(); /** * Accessor for the defined extensions for this component * * @return The extensions */ ExtensionMetadata[] getExtensions(); /** * Accessor for the parent metadata component. * * @return The parent */ Metadata getParent(); } api/src/java/javax/jdo/metadata/OrderMetadata.java100664 4615 12500110371 22400 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.metadata; /** * Represents ordering of a collection field/property. * @since 3.0 */ public interface OrderMetadata extends Metadata { /** * Method to set the version column name. * * @param column Name of the version clumn */ OrderMetadata setColumn(String column); /** * Accessor for the version column name * * @return The version column name */ String getColumn(); /** * Method to set mapped-by information whether the order is present in the element class. * * @param mappedBy Field/property name in which to store the ordering in the element */ OrderMetadata setMappedBy(String mappedBy); /** * Accessor for the mapped-by field/property name in the element class. * * @return Name of field/property in element class */ String getMappedBy(); /** * Accessor for all column(s) defined on the ordering. * * @return The column(s) */ ColumnMetadata[] getColumns(); /** * Add a column for this ordering. * * @return The ColumnMetadata */ ColumnMetadata newColumnMetadata(); /** * Accessor for the number of columns defined for this ordering. * * @return The number of columns */ int getNumberOfColumns(); /** * Method to set index metadata for the ordering * * @return The metadata for any index */ IndexMetadata newIndexMetadata(); /** * Accessor for any index metadata for the ordering * * @return Index metadata */ IndexMetadata getIndexMetadata(); } api/src/java/javax/jdo/metadata/package.html100664 2105 12500110371 21272 0ustarmbouschenstaff 0 0 Metadata package This package contains classes representing the different components of the JDO Metadata. It mirrors the structure of the XML schema. api/src/java/javax/jdo/metadata/PackageMetadata.java100664 7326 12500110371 22662 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.metadata; import javax.jdo.annotations.SequenceStrategy; /** * Represents a package within a JDOMetadata. * @since 3.0 */ public interface PackageMetadata extends Metadata { /** * Accessor for the name of this package (set on construction). * * @return The name */ String getName(); /** * Method to set the catalog (ORM) to apply to all classes in this package. * * @param catalog Catalog name */ PackageMetadata setCatalog(String catalog); /** * Accessor for the catalog (ORM) that all classes in this package default * to. * * @return The catalog */ String getCatalog(); /** * Method to set the schema (ORM) to apply to all classes in this package. * * @param schema Schema name */ PackageMetadata setSchema(String schema); /** * Accessor for the schema (ORM) that all classes in this package default to. * * @return The schema */ String getSchema(); /** * Accessor for all classes defined in this package. * * @return The classes */ ClassMetadata[] getClasses(); /** * Add a new class to this package. * * @param name Name of the class * @return The ClassMetadata */ ClassMetadata newClassMetadata(String name); /** * Add a new class to this package. * * @param cls The class * @return The ClassMetadata */ ClassMetadata newClassMetadata(Class cls); /** * Accessor for the number of classes defined in this package. * * @return The number of classes. */ int getNumberOfClasses(); /** * Accessor for all interfaces defined in this package. * * @return The interfaces */ InterfaceMetadata[] getInterfaces(); /** * Add a new interface to this package. * * @param name The interface name * @return The InterfaceMetadata */ InterfaceMetadata newInterfaceMetadata(String name); /** * Add a new interface to this package. * * @param cls The class * @return The ClassMetadata */ InterfaceMetadata newInterfaceMetadata(Class cls); /** * Accessor for the number of interfaces defined in this package. * * @return The number of interfaces. */ int getNumberOfInterfaces(); /** * Accessor for any sequences defined on the package. * * @return The sequences */ SequenceMetadata[] getSequences(); /** * Add a new sequence to this package. * * @param name Name of the sequence * @param strategy Strategy for the sequence * @return The SequenceMetadata */ SequenceMetadata newSequenceMetadata(String name, SequenceStrategy strategy); /** * Accessor for the number of sequences defined for this package. * * @return The number of sequences. */ int getNumberOfSequences(); } api/src/java/javax/jdo/metadata/PrimaryKeyMetadata.java100664 3763 12500110371 23424 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.metadata; /** * Represents the primary key definition of a class. * @since 3.0 */ public interface PrimaryKeyMetadata extends Metadata { /** * Method to set the name of the PK constraint. * * @param name Name of the PK constraint * @return The PK metadata */ PrimaryKeyMetadata setName(String name); /** * Accessor for the name of the PK constraint. * * @return The PK constraint name */ String getName(); /** * Method to set the PK column name. * * @param column Name of the PK column * @return The PK metadata */ PrimaryKeyMetadata setColumn(String column); /** * Accessor for the PK column name * * @return The column name */ String getColumn(); /** * Accessor for all column(s) defined on the PK. * * @return The column(s) */ ColumnMetadata[] getColumns(); /** * Add a new column for this PK * * @return The ColumnMetadata */ ColumnMetadata newColumnMetadata(); /** * Accessor for the number of columns defined for this PK * * @return The number of columns */ int getNumberOfColumns(); } api/src/java/javax/jdo/metadata/PropertyMetadata.java100664 2337 12500110371 23150 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.metadata; /** * Represents a property in a class/persistent-interface. * @since 3.0 */ public interface PropertyMetadata extends MemberMetadata { /** * Method to set the field name (persistent interfaces) * * @param name field name */ PropertyMetadata setFieldName(String name); /** * Accessor for the field name * * @return Field name */ String getFieldName(); } api/src/java/javax/jdo/metadata/QueryMetadata.java100664 5430 12500110371 22426 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.metadata; /** * Represents a named query. * @since 3.0 */ public interface QueryMetadata extends Metadata { /** * Accessor for the name of the query (set on construction). * * @return The name */ String getName(); /** * Method to set the language of the query. * * @param lang Query language */ QueryMetadata setLanguage(String lang); /** * Accessor for the query language. * * @return The language */ String getLanguage(); /** * Method to set the single-string query. * * @param query The query */ QueryMetadata setQuery(String query); /** * Accessor for the single-string query. * * @return The query */ String getQuery(); /** * Method to set the result class name for the query * * @param clsName Result class name */ QueryMetadata setResultClass(String clsName); /** * Accessor for the result class name for the query. * * @return The result class name */ String getResultClass(); /** * Method to set if the query results are unique * * @param unique Whether they are unique */ QueryMetadata setUnique(boolean unique); /** * Accessor for whether results from the query are unique * * @return Results are unique? */ Boolean getUnique(); /** * Method to set the query as not being modifiable from now. */ QueryMetadata setUnmodifiable(); /** * Accessor for whether the query is unmodifiable. * * @return Can't be changed? */ boolean getUnmodifiable(); /** * Method to set the FetchPlan to use for this named query. * * @param fetchPlanName name of the FetchPlan */ QueryMetadata setFetchPlan(String fetchPlanName); /** * Accessor for the name of a fetch plan to use (if any). * * @return The fetch plan name */ String getFetchPlan(); } api/src/java/javax/jdo/metadata/SequenceMetadata.java100664 5213 12500110371 23070 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.metadata; import javax.jdo.annotations.SequenceStrategy; /** * Represents a sequence. * @since 3.0 */ public interface SequenceMetadata extends Metadata { /** * Accessor for the name of the sequence (set on construction). * * @return The name */ String getName(); /** * Accessor for the sequence strategy (set on construction). * * @return Sequence strategy */ SequenceStrategy getSequenceStrategy(); /** * Method to set the name of the datastore sequence that this maps to. * * @param seq Datastore sequence name */ SequenceMetadata setDatastoreSequence(String seq); /** * Accessor for the name of the datastore sequence that this maps to * * @return The datastore sequence name */ String getDatastoreSequence(); /** * Method to set the result class name for the query * * @param clsName Result class name */ SequenceMetadata setFactoryClass(String clsName); /** * Accessor for the factory class for this sequence. * * @return The factory class */ String getFactoryClass(); /** * Method to set the initial value for the sequence * * @param val Initial value to use * @since 3.1 */ SequenceMetadata setInitialValue(int val); /** * Accessor for the initial value of the sequence (if any). * * @return initial value * @since 3.1 */ Integer getInitialValue(); /** * Method to set the allocation size for the sequence * * @param size Allocation size to use * @since 3.1 */ SequenceMetadata setAllocationSize(int size); /** * Accessor for the allocation size of the sequence (if any). * * @return allocation size * @since 3.1 */ Integer getAllocationSize(); } api/src/java/javax/jdo/metadata/TypeMetadata.java100664 22651 12500110371 22266 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.metadata; import java.lang.reflect.Method; import javax.jdo.annotations.IdentityType; /** * Represents a class or interface. Extended for the specifics of those cases. * @since 3.0 */ public interface TypeMetadata extends Metadata { /** * Accessor for the name of this component (set on construction). * * @return The name */ String getName(); /** * Method to define the identity type to use. * * @param id identity type */ TypeMetadata setIdentityType(IdentityType id); /** * Accessor for the identity type to use. * * @return identity type */ IdentityType getIdentityType(); /** * Method to set the object-id (PK) class. * * @param idclass Object-id class */ TypeMetadata setObjectIdClass(String idclass); /** * Accessor for the object-id class (if defined). * * @return The object-id class */ String getObjectIdClass(); /** * Method to set whether the component requires an extent. * * @param extent Requires extent? */ TypeMetadata setRequiresExtent(boolean extent); /** * Accessor for whether the component requires an extent. * * @return Requires extent? */ boolean getRequiresExtent(); /** * Method to set whether this is detachable * * @param detachable Detachable? */ TypeMetadata setDetachable(boolean detachable); /** * Accessor for whether this is detachable. * * @return Detachable? */ boolean getDetachable(); /** * Method to set whether this is cacheable * * @param cacheable Cacheable? */ TypeMetadata setCacheable(boolean cacheable); /** * Accessor for whether this is cacheable. * * @return Detachable? */ boolean getCacheable(); /** * Method to set the default value of serializeRead for objects of this type. * * @param flag serializeRead */ TypeMetadata setSerializeRead(boolean flag); /** * Accessor for the value of serializeRead for objects of this type. * * @return SerializeRead? */ boolean getSerializeRead(); /** * Method to set whether it is stored only as embedded in other objects. * * @param embedded Whether it is only stored embedded */ TypeMetadata setEmbeddedOnly(boolean embedded); /** * Accessor for whether this is embedded only. * * @return Only stored as embedded */ Boolean getEmbeddedOnly(); /** * Method to set the catalog (ORM) for this component * * @param catalog Catalog name */ TypeMetadata setCatalog(String catalog); /** * Accessor for the catalog (ORM) for this component * * @return The catalog */ String getCatalog(); /** * Method to set the schema (ORM) for this component * * @param schema Schema name */ TypeMetadata setSchema(String schema); /** * Accessor for the schema (ORM) for this component * * @return The schema */ String getSchema(); /** * Method to set the table name. * * @param table Table name */ TypeMetadata setTable(String table); /** * Accessor for the name of the table. * * @return The name */ String getTable(); /** * Method to define the inheritance metadata. * * @return The InheritanceMetadata */ InheritanceMetadata newInheritanceMetadata(); /** * Accessor for the inheritance (if any). * * @return inheritance */ InheritanceMetadata getInheritanceMetadata(); /** * Method to define the version metadata. * * @return The VersionMetadata */ VersionMetadata newVersionMetadata(); /** * Accessor for the version (if any). * * @return version */ VersionMetadata getVersionMetadata(); /** * Method to define the datastore identity metadata details. * * @return The DatastoreIdentityMetadata */ DatastoreIdentityMetadata newDatastoreIdentityMetadata(); /** * Accessor for the datastore identity details. * * @return datastore identity details */ DatastoreIdentityMetadata getDatastoreIdentityMetadata(); /** * Method to define the primary key details. * * @return The PrimaryKeyMetadata */ PrimaryKeyMetadata newPrimaryKeyMetadata(); /** * Accessor for the primary key (if any). * * @return primary key details */ PrimaryKeyMetadata getPrimaryKeyMetadata(); /** * Accessor for all joins(s) defined on the component. * * @return The join(s) */ JoinMetadata[] getJoins(); /** * Add a join for this component. * * @return The JoinMetadata */ JoinMetadata newJoinMetadata(); /** * Accessor for the number of join(s) defined for this component. * * @return The number of join(s) */ int getNumberOfJoins(); /** * Accessor for all fk(s) defined on the component. * * @return The fk(s) */ ForeignKeyMetadata[] getForeignKeys(); /** * Add a new FK for this component. * * @return The ForeignKeyMetadata */ ForeignKeyMetadata newForeignKeyMetadata(); /** * Accessor for the number of FKs defined for this component. * * @return The number of FKs */ int getNumberOfForeignKeys(); /** * Accessor for all index(s) defined on the component. * * @return The index(s) */ IndexMetadata[] getIndices(); /** * Add a new index for this component. * * @return The IndexMetadata */ IndexMetadata newIndexMetadata(); /** * Accessor for the number of indices defined for this component. * * @return The number of indices */ int getNumberOfIndices(); /** * Accessor for all unique constraints defined on the component. * * @return The unique constraints */ UniqueMetadata[] getUniques(); /** * Add a new unique constraint for this component. * * @return The UniqueMetadata */ UniqueMetadata newUniqueMetadata(); /** * Accessor for the number of unique constraints defined for this component. * * @return The number of unique constraints */ int getNumberOfUniques(); /** * Accessor for all fields/properties defined on the component. * * @return The members */ MemberMetadata[] getMembers(); /** * Accessor for the number of fields/properties defined for this component. * * @return The number of members */ int getNumberOfMembers(); /** * Add a new property for this component. * * @param name Name of the property * @return The PropertyMetadata */ PropertyMetadata newPropertyMetadata(String name); /** * Add a new property for this component. * * @param method Java bean getter/setter method * @return The PropertyMetadata */ PropertyMetadata newPropertyMetadata(Method method); /** * Accessor for all named queries defined on the component. * * @return The queries */ QueryMetadata[] getQueries(); /** * Add a new query for this component. * * @param name * Name of the query to add * @return The QueryMetadata */ QueryMetadata newQueryMetadata(String name); /** * Accessor for the number of named queries defined for this component. * * @return The number of named queries */ int getNumberOfQueries(); /** * Accessor for all FetchGroup defined on the component. * * @return The FetchGroups */ FetchGroupMetadata[] getFetchGroups(); /** * Add a new FetchGroup for this component. * * @param name Name of the FetchGroup * @return The FetchGroupMetadata */ FetchGroupMetadata newFetchGroupMetadata(String name); /** * Accessor for the number of fetchGroups defined for this component. * * @return The number of fetch groups */ int getNumberOfFetchGroups(); /** * Accessor for all column(s) defined on the join. * * @return The column(s) */ ColumnMetadata[] getColumns(); /** * Add a new column for this join. * * @return The ColumnMetadata */ ColumnMetadata newColumnMetadata(); /** * Accessor for the number of columns defined for this join. * * @return The number of columns */ int getNumberOfColumns(); } api/src/java/javax/jdo/metadata/UniqueMetadata.java100664 5606 12500110371 22574 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.metadata; /** * Represents a unique constraint. * @since 3.0 */ public interface UniqueMetadata extends Metadata { /** * Method to set the name of the constraint * * @param name Name of the constraint */ UniqueMetadata setName(String name); /** * Accessor for the constraint name. * * @return The constraint name */ String getName(); /** * Method to set the table name. * * @param table Table name */ UniqueMetadata setTable(String table); /** * Accessor for the name of the table. * * @return The name */ String getTable(); /** * Method to set whether the constraint is deferred. * * @param def Deferred? */ UniqueMetadata setDeferred(boolean def); /** * Accessor for whether deferred. * * @return Deferred? */ Boolean getDeferred(); /** * Accessor for all column(s) defined on the unique constraint. * * @return The column(s) */ ColumnMetadata[] getColumns(); /** * Add a new column for this unique constraint. * * @return The ColumnMetadata */ ColumnMetadata newColumnMetadata(); /** * Accessor for the number of columns defined for this unique constraint. * * @return The number of columns */ int getNumberOfColumns(); /** * Accessor for all fields/properties defined on the unique constraint. * @return The members */ MemberMetadata[] getMembers(); /** * Accessor for the number of fields/properties defined for this unique constraint. * @return The number of members */ int getNumberOfMembers(); /** * Add a new field for this unique constraint. * * @param name Name of the field * @return The FieldMetadata */ FieldMetadata newFieldMetadata(String name); /** * Add a new property for this unique constraint. * * @param name Name of the property * @return The PropertyMetadata */ PropertyMetadata newPropertyMetadata(String name); } api/src/java/javax/jdo/metadata/ValueMetadata.java100664 7214 12500110371 22377 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.metadata; import javax.jdo.annotations.ForeignKeyAction; /** * Represents a value in a map. * @since 3.0 */ public interface ValueMetadata extends Metadata { /** * Method to set the column name. * * @param column Column name */ ValueMetadata setColumn(String column); /** * Accessor for the name of the column. * * @return The name */ String getColumn(); /** * Method to set the table name. * * @param table Table name */ ValueMetadata setTable(String table); /** * Accessor for the name of the table. * * @return The name */ String getTable(); /** * Method to set the delete action of the FK * * @param action Delete action of the FK */ ValueMetadata setDeleteAction(ForeignKeyAction action); /** * Accessor for the delete action of the FK * * @return The FK delete-action */ ForeignKeyAction getDeleteAction(); /** * Method to set the update action of the FK * * @param action Update action of the FK */ ValueMetadata setUpdateAction(ForeignKeyAction action); /** * Accessor for the update action of the FK * * @return The FK update-action */ ForeignKeyAction getUpdateAction(); /** * Accessor for all column(s) defined on the value. * * @return The column(s) */ ColumnMetadata[] getColumns(); /** * Add a new column for this value. * * @return The ColumnMetadata */ ColumnMetadata newColumnMetadata(); /** * Method to set new embedded metadata for the value. * * @return The EmbeddedMetadata */ EmbeddedMetadata newEmbeddedMetadata(); /** * Accessor for any embedded metadata on this value * * @return The EmbeddedMetadata */ EmbeddedMetadata getEmbeddedMetadata(); /** * Method to set new index metadata for the value. * * @return The IndexMetadata */ IndexMetadata newIndexMetadata(); /** * Accessor for any index metadata on this value * * @return Index metadata */ IndexMetadata getIndexMetadata(); /** * Method to set new unique constraint metadata for the value * * @return The UniqueMetadata */ UniqueMetadata newUniqueMetadata(); /** * Accessor for any unique constraint metadata on this value. * * @return The UniqueMetadata */ UniqueMetadata getUniqueMetadata(); /** * Method to set new foreign key metadata for the value * * @return The ForeignKeyMetadata */ ForeignKeyMetadata newForeignKeyMetadata(); /** * Accessor for any foreign key metadata on this value. * * @return The ForeignKeyMetadata */ ForeignKeyMetadata getForeignKeyMetadata(); } api/src/java/javax/jdo/metadata/VersionMetadata.java100664 5104 12500110371 22744 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.metadata; import javax.jdo.annotations.VersionStrategy; /** * Represents versioning of a class. * @since 3.0 */ public interface VersionMetadata extends Metadata { /** * Method to set the version strategy. * * @param strategy The strategy */ VersionMetadata setStrategy(VersionStrategy strategy); /** * Accessor for the version strategy. * * @return The strategy */ VersionStrategy getStrategy(); /** * Method to set the version column name. * * @param column Name of the version clumn */ VersionMetadata setColumn(String column); /** * Accessor for the version column name * * @return The version column name */ String getColumn(); /** * Method to set whether indexed. * * @param indexed Whether indexed (true | false | unique) */ VersionMetadata setIndexed(Indexed indexed); /** * Accessor for whether indexed (true|false|unique) * * @return Indexed? */ Indexed getIndexed(); /** * Accessor for all column(s) defined on the version. * * @return The column(s) */ ColumnMetadata[] getColumns(); /** * Add a new column for this version. * * @return The ColumnMetadata */ ColumnMetadata newColumnMetadata(); /** * Accessor for the number of columns defined for this version. * * @return The number of columns */ int getNumberOfColumns(); /** * Method to set index metadata for the version * * @return The IndexMetadata */ IndexMetadata newIndexMetadata(); /** * Accessor for any index metadata on this version * * @return Index metadata */ IndexMetadata getIndexMetadata(); } api/src/java/javax/jdo/ObjectState.java100664 3242 12500110371 20306 0ustarmbouschenstaff 0 0 /* * 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. */ /* * ObjectState.java * */ package javax.jdo; /** * This class defines the object states for JDO instances. * * @version 2.1 */ public enum ObjectState { TRANSIENT("transient"), TRANSIENT_CLEAN("transient-clean"), TRANSIENT_DIRTY("transient-dirty"), PERSISTENT_NEW("persistent-new"), HOLLOW_PERSISTENT_NONTRANSACTIONAL("hollow/persistent-nontransactional"), PERSISTENT_NONTRANSACTIONAL_DIRTY("persistent-nontransactional-dirty"), PERSISTENT_CLEAN("persistent-clean"), PERSISTENT_DIRTY("persistent-dirty"), PERSISTENT_DELETED("persistent-deleted"), PERSISTENT_NEW_DELETED("persistent-new-deleted"), DETACHED_CLEAN("detached-clean"), DETACHED_DIRTY("detached-dirty"); private final String value; private ObjectState(String value) { this.value = value; } public String toString() { return value; } } api/src/java/javax/jdo/package.html100664 11657 12500110371 17546 0ustarmbouschenstaff 0 0 JDO package This package contains the JDO specification interfaces and classes.

There are two major objectives of the JDO architecture: first, to provide application programmers a transparent, Java-centric view of persistent information, including enterprise data and locally stored data; and second, to enable pluggable implementations of data stores into application servers. Data stored in data stores is presented as instances of persistence-capable classes.

JDO defines interfaces and classes to be used by application programmers when using classes whose instances are to be stored in persistent storage (persistence-capable classes), and specifies the contracts between suppliers of persistence-capable classes and the runtime environment (which is part of the JDO implementation).

The JDO architecture defines a standard set of contracts between an application programmer and an JDO vendor. These contracts focus on the view of the Java instances of persistence capable classes.

The JDO PersistenceManagerFactory is the boostrap class for a JDO application. The application gets an instance of the PersistenceManagerFactory by construction or via JDNI lookup.

The application acquires an instance of the JDO PersistenceManager by calling the getPersistenceManager method on an instance of JDO PersistenceManagerFactory.

The JDO PersistenceManager is the primary interface for JDO-aware application components:

  • it gives access to the current Transaction interface;
  • it is the factory for the Query interface;
  • it contains methods for managing the life cycle of persistent instances.

A JDO PersistenceManager instance supports any number of JDO instances at a time. It is responsible for managing the identity of its associated JDO instances. A JDO instance is associated with either zero or one JDO PersistenceManager. It will be zero if and only if the JDO instance is transient nontransactional. As soon as the instance is made persistent or transactional, it will be associated with exactly one JDO PersistenceManager.

A JDO PersistenceManager instance supports one transaction at a time, and uses one connection to the underlying data source at a time. The JDO PersistenceManager instance might use multiple transactions serially, and might use multiple connections serially.

Normally, cache management is automatic and transparent. When instances are queried, navigated to, or modified, instantiation of instances and their fields and garbage collection of unreferenced instances occurs without any explicit control. When the transaction in which persistent instances are created, deleted, or modified commits, eviction is automatically done by the transaction completion mechanisms.

Operations on persistent JDO instances at the user's choice might be performed in the context of a transaction. That is, the view of data in the data store is transactionally consistent, according to the standard definition of ACID transactions.

The Transaction interface is used to mark the beginning and end of a application-defined unit of work. The PersistenceManager allows the application to get the instance that manages these transactional boundaries via the currentTransaction method.

The persistent manager instance is a factory for query instances, and queries are executed in the context of the persistent manager instance. The actual query execution might be performed by the JDO PersistenceManager or might be delegated by the JDO PersistenceManager to its data store. The actual query executed thus might be implemented in a very different language from Java, and might be optimized to take advantage of particular query language implementations.

Extents are collections of data store objects managed by the data store, not by explicit user operations on collections. Extent capability is a boolean property of classes that are persistence capable. If an instance of a class that has a managed extent is made persistent via reachability, the instance is put into the extent implicitly. api/src/java/javax/jdo/PersistenceManager.java100664 172063 12500110371 21726 0ustarmbouschenstaff 0 0 /* * 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. */ /* * PersistenceManager.java * */ package javax.jdo; import java.util.Collection; import java.util.Date; import java.util.EnumSet; import java.util.Map; import java.util.Set; import javax.jdo.datastore.JDOConnection; import javax.jdo.datastore.Sequence; import javax.jdo.listener.InstanceLifecycleListener; /** PersistenceManager is the primary interface for JDO-aware * application components. It is the factory for Query and * Transaction instances, and contains methods to manage the * life cycle of PersistenceCapable instances. * *

A PersistenceManager is obtained from the * {@link PersistenceManagerFactory} * (recommended) or by construction. * @version 2.1 */ public interface PersistenceManager { /** * A PersistenceManager instance can be used until it is * closed. * @return true if this PersistenceManager has * been closed. * @see #close() */ boolean isClosed (); /** Close this PersistenceManager so that no further requests * may be made on it. A PersistenceManager instance can be * used only until it is closed. * *

Closing a PersistenceManager might release it to the pool * of available PersistenceManagers, or might be garbage * collected, at the option of the JDO implementation. Before being used * again to satisfy a getPersistenceManager() request, the * default values for options will be restored to their values as specified * in the PersistenceManagerFactory. * *

This method closes the PersistenceManager. */ void close (); /** Return the Transaction instance associated with a * PersistenceManager. There is one Transaction * instance associated with each PersistenceManager instance. * The Transaction instance supports options as well as * transaction completion requests. * @return the Transaction associated with this * PersistenceManager. */ Transaction currentTransaction(); /** Mark an instance as no longer needed in the cache. Eviction is normally * done automatically by the PersistenceManager at transaction * completion. This method allows the application to explicitly provide a * hint to the PersistenceManager that the instance is no * longer needed in the cache. * @param pc the instance to evict from the cache. */ void evict (Object pc); /** Mark an array of instances as no longer needed in the cache. * @see #evict(Object pc) * @param pcs the array of instances to evict from the cache. */ void evictAll (Object... pcs); /** Mark a Collection of instances as no longer needed in the * cache. * @see #evict(Object pc) * @param pcs the Collection of instances to evict from the * cache. */ void evictAll (Collection pcs); /** Mark the parameter instances as no longer needed in the cache. * @param pcClass the class of instances to evict * @param subclasses if true, mark instances of subclasses also * @since 2.1 */ void evictAll (boolean subclasses, Class pcClass); /** Mark all persistent-nontransactional instances as no longer needed * in the cache. It transitions * all persistent-nontransactional instances to hollow. Transactional * instances are subject to eviction based on the RetainValues setting. * @see #evict(Object pc) */ void evictAll (); /** Refresh the state of the instance from the data store. * *

In an optimistic transaction, the state of instances in the cache * might not match the state in the data store. This method is used to * reload the state of the instance from the data store so that a subsequent * commit is more likely to succeed. *

Outside a transaction, this method will refresh nontransactional * state. * @param pc the instance to refresh. */ void refresh (Object pc); /** Refresh the state of an array of instances from the data store. * * @see #refresh(Object pc) * @param pcs the array of instances to refresh. */ void refreshAll (Object... pcs); /** Refresh the state of a Collection of instances from the * data store. * * @see #refresh(Object pc) * @param pcs the Collection of instances to refresh. */ void refreshAll (Collection pcs); /** Refresh the state of all applicable instances from the data store. *

If called with an active transaction, all transactional instances * will be refreshed. If called outside an active transaction, all * nontransactional instances will be refreshed. * @see #refresh(Object pc) */ void refreshAll (); /** * Refreshes all instances in the exception that failed verification. * * @since 2.0 */ void refreshAll (JDOException jdoe); /** Create a new Query with no elements. * @return the new Query. */ Query newQuery (); /** Create a new Query using elements from another * Query. The other Query must have been created * by the same JDO implementation. It might be active in a different * PersistenceManager or might have been serialized and * restored. *

All of the settings of the other Query are copied to this * Query, except for the candidate Collection or * Extent. * @return the new Query * @param compiled another Query from the same JDO * implementation */ Query newQuery (Object compiled); /** Create a Construct a new query instance using the specified String * as the single-string representation of the query. * @param query the single-string query * @return the new Query * @since 2.0 */ Query newQuery (String query); /** Create a new Query using the specified language. * @param language the language of the query parameter * @param query the query, which is of a form determined by the language * @return the new Query */ Query newQuery (String language, Object query); /** Create a new Query specifying the Class of the * candidate instances. * @param cls the Class of the candidate instances * @return the new Query */ Query newQuery (Class cls); /** Create a new Query with the Class of the * candidate instances and candidate Extent. * @param cln the Extent of candidate instances * @return the new Query */ Query newQuery (Extent cln); /** Create a new Query with the candidate Class * and Collection. * @param cls the Class of results * @param cln the Collection of candidate instances * @return the new Query */ Query newQuery (Class cls, Collection cln); /** Create a new Query with the Class of the * candidate instances and filter. * @param cls the Class of results * @param filter the filter for candidate instances * @return the new Query */ Query newQuery (Class cls, String filter); /** Create a new Query with the Class of the * candidate instances, * candidate Collection, and filter. * @param cls the Class of candidate instances * @param cln the Collection of candidate instances * @param filter the filter for candidate instances * @return the new Query */ Query newQuery (Class cls, Collection cln, String filter); /** Create a new Query with the * candidate Extent and filter; the class * is taken from the Extent. * @param cln the Extent of candidate instances * @param filter the filter for candidate instances * @return the new Query */ Query newQuery (Extent cln, String filter); /** * Create a new Query with the given candidate class * from a named query. The query name given must be the name of a * query defined in metadata. * @param cls the Class of candidate instances * @param queryName the name of the query to look up in metadata * @return the new Query */ Query newNamedQuery (Class cls, String queryName); /** The PersistenceManager manages a collection of instances in * the data store based on the class of the instances. This method returns * an Extent of instances in the data store that might be * iterated or given to a Query. The Extent * itself might not reference any instances, but only hold the class name * and an indicator as to whether subclasses are included in the * Extent. *

Note that the Extent might be very large. * @param persistenceCapableClass Class of instances * @param subclasses whether to include instances of subclasses * @return an Extent of the specified Class * @see Query */ Extent getExtent (Class persistenceCapableClass, boolean subclasses); /** * Equivalent to getExtent (persistenceCapableClass, * true). * @see #getExtent(Class,boolean) * @since 2.0 */ Extent getExtent (Class persistenceCapableClass); /** This method locates a persistent instance in the cache of instances * managed by this PersistenceManager. * The getObjectById method attempts * to find an instance in the cache with the specified JDO identity. * The oid parameter object might have been returned by an * earlier call to getObjectId or * getTransactionalObjectId, or might have been constructed by * the application. *

If the PersistenceManager is unable to resolve the * oid parameter to an ObjectId instance, then it throws a * JDOUserException. *

If the validate flag is false, and there is * already an instance in the cache with the same JDO identity as the * oid parameter, then this method returns it. There is no * change made to the state of the returned instance. *

If there is not an instance already in the cache with the same JDO * identity as the oid parameter, then this method creates an * instance with the specified JDO identity and returns it. If there is no * transaction in progress, the returned instance will be hollow or * persistent-nontransactional, at the choice of the implementation. *

If there is a transaction in progress, the returned instance will * be hollow, persistent-nontransactional, or persistent-clean, at the * choice of the implementation. *

It is an implementation decision whether to access the data store, * if required to determine the exact class. This will be the case of * inheritance, where multiple PersistenceCapable classes share * the same ObjectId class. *

If the validate flag is false, and the instance does not * exist in the data store, then this method might not fail. It is an * implementation choice whether to fail immediately with a * JDOObjectNotFoundException. But a subsequent access * of the fields of the * instance will throw a JDOObjectNotFoundException * if the instance does not * exist at that time. Further, if a relationship is established to this * instance, then the transaction in which the association was made will * fail. *

If the validate flag is true, and there is * already a transactional instance in the cache with the same JDO identity * as the oid parameter, then this method returns it. There is * no change made to the state of the returned instance. *

If there is an instance already in the cache with the same JDO * identity as the oid parameter, but the instance is not * transactional, then it must be verified in the data store. If the * instance does not exist in the datastore, then a * JDOObjectNotFoundException is thrown. *

If there is not an instance already in the cache with the same JDO * identity as the oid parameter, then this method creates an * instance with the specified JDO identity, verifies that it exists in the * data store, and returns it. If there is no transaction in progress, the * returned instance will be hollow or persistent-nontransactional, * at the choice of the implementation. *

If there is a data store transaction in progress, the returned * instance will be persistent-clean. * If there is an optimistic transaction in progress, the returned * instance will be persistent-nontransactional. * @see #getObjectId(Object pc) * @see #getTransactionalObjectId(Object pc) * @return the PersistenceCapable instance with the specified * ObjectId * @param oid an ObjectId * @param validate if the existence of the instance is to be validated */ Object getObjectById (Object oid, boolean validate); /** * Looks up the instance of the given type with the given key. * @param cls The type of object to load * @param key either the string representation of the object id, or * an object representation of a single field identity key * @return the corresponding persistent instance * @since 2.0 */ T getObjectById (Class cls, Object key); /** * Looks up the instance corresponding to the specified oid. This is * equivalent to getObjectById(oid, true); * @param oid The object id of the object to load * @return the corresponding persistent instance */ Object getObjectById (Object oid); /** The ObjectId returned by this method represents the JDO identity of * the instance. The ObjectId is a copy (clone) of the internal state * of the instance, and changing it does not affect the JDO identity of * the instance. *

The getObjectId method returns an ObjectId instance that * represents the object identity of the specified JDO instance. The * identity is guaranteed to be unique only in the context of the JDO * PersistenceManager that created the identity, and only for * two types of JDO Identity: those that are managed by the application, and * those that are managed by the data store. *

If the object identity is being changed in the transaction, by the * application modifying one or more of the application key fields, * then this method returns the identity as of the beginning of the * transaction. The value returned by getObjectId will be * different following afterCompletion processing for * successful transactions.

Within a transaction, the ObjectId returned * will compare equal to the ObjectId returned by only one among all JDO * instances associated with the PersistenceManager regardless * of the type of ObjectId. *

The ObjectId does not necessarily contain any internal state of the * instance, nor is it necessarily an instance of the class used to * manage identity internally. Therefore, if the application makes a * change to the ObjectId instance returned by this method, there is * no effect on the instance from which the ObjectId was obtained. *

The getObjectById method can be used between instances of * PersistenceManager of different JDO vendors only for * instances of persistence capable classes using application-managed * (primary key) JDO identity. If it is used for instances of classes using * datastore identity, the method might succeed, but there are no guarantees * that the parameter and return instances are related in any way. * @see #getTransactionalObjectId(Object pc) * @see #getObjectById(Object oid, boolean validate) * @param pc the PersistenceCapable instance * @return the ObjectId of the instance */ Object getObjectId (Object pc); /** The ObjectId returned by this method represents the JDO identity of * the instance. The ObjectId is a copy (clone) of the internal state * of the instance, and changing it does not affect the JDO identity of * the instance. *

If the object identity is being changed in the transaction, by the * application modifying one or more of the application key fields, * then this method returns the current identity in the transaction. *

If there is no transaction in progress, or if none of the key fields * is being modified, then this method will return the same value as * getObjectId. * @see #getObjectId(Object pc) * @see #getObjectById(Object oid, boolean validate) * @param pc a PersistenceCapable instance * @return the ObjectId of the instance */ Object getTransactionalObjectId (Object pc); /** * This method returns an object id instance corresponding to the pcClass * and key arguments. * @param pcClass the Class of the persistence-capable instance * @param key for single-field identity, the parameter for the * constructor; for non-single-field application identity, the result * of toString() on the object id instance. * @return an instance of the object identity class */ Object newObjectIdInstance (Class pcClass, Object key); /** * Return the objects with the given oids. * @param oids the oids of the objects to return * @param validate if true, the existance of the objects in * the datastore will be validated. * @return the objects that were looked up, in the * same order as the oids parameter. * @see #getObjectById(Object,boolean) * @since 2.0 */ Collection getObjectsById (Collection oids, boolean validate); /** * Return the objects with the given oids. This method is equivalent * to calling {@link #getObjectsById(Collection, boolean)} * with the validate flag true. * @param oids the oids of the objects to return * @return the objects that were looked up, in the * same order as the oids parameter. * @see #getObjectsById(Collection,boolean) * @since 2.0 */ Collection getObjectsById (Collection oids); /** * Return the objects with the given oids. * @param oids the oids of the objects to return * @param validate if true, the existance of the objects in * the datastore will be validated. * @return the objects that were looked up, in the * same order as the oids parameter. * @see #getObjectById(Object,boolean) * @see #getObjectsById(boolean,Object...) * @deprecated * @since 2.0 */ Object[] getObjectsById (Object[] oids, boolean validate); /** * Return the objects with the given oids. * @param oids the oids of the objects to return * @param validate if true, the existance of the objects in * the datastore will be validated. * @return the objects that were looked up, in the * same order as the oids parameter. * @see #getObjectById(Object,boolean) * @since 2.1 */ Object[] getObjectsById (boolean validate, Object... oids); /** * Return the objects with the given oids. This method is equivalent * to calling {@link #getObjectsById(boolean,Object...)} * with the validate flag true. * @param oids the oids of the objects to return * @return the objects that were looked up, in the * same order as the oids parameter. * @see #getObjectsById(boolean,Object...) * @since 2.0 */ Object[] getObjectsById (Object... oids); /** Make the parameter instance persistent in this * PersistenceManager. * This method makes transient instances persistent and applies detached * instance changes to the cache. It must be called in the context of * an active transaction, or a JDOUserException is thrown. For a transient * instance, it assigns an object identity to the instance and transitions * it to persistent-new. Any transient instances reachable from this * instance via persistent fields of this instance become provisionally * persistent, transitively. That is, they behave as persistent-new * instances (return true to isPersistent, isNew, and isDirty). * But at commit time, the reachability algorithm is run again, * and instances made provisionally persistent that are not then * reachable from persistent instances will revert to transient. *

During makePersistent of transient instances, the create life cycle * listener is called. *

For detached instances, it locates or instantiates a persistent * instance with the same JDO identity as the detached instance, * and merges the persistent state of the detached instance into the * persistent instance. Only the state of persistent fields is merged. * If non-persistent state needs to be copied, the application should * use the jdoPostAttach callback or the postAttach lifecycle event * listener. Any references to the detached instances from instances * in the closure of the parameter instances are modified to refer to * the corresponding persistent instance instead of to the * detached instance. *

During attachment of detached instances, the attach callbacks * and attach life cycle listeners are called. *

During application of changes of the detached state, if the JDO * implementation can determine that there were no changes made during * detachment, then the implementation is not required to mark the * corresponding instance dirty. If it cannot determine if changes * were made, then it must mark the instance dirty. * No consistency checking is done during makePersistent of detached * instances. If consistency checking is required by the application, * then flush or checkConsistency should be called after attaching the * instances. *

These methods have no effect on parameter persistent instances * already managed by this PersistenceManager. They will throw a * JDOUserException if the parameter instance is managed by a * different PersistenceManager. * If an instance is of a class whose identity type (application, * datastore, or none) is not supported by the JDO implementation, * then a JDOUserException will be thrown for that instance. * The return value for parameter instances in the transient or persistent * states is the same as the parameter value. The return value for * parameter instances in the detached state is the persistent instance * corresponding to the detached instance. * The return values for makePersistentAll methods correspond by position * to the parameter instances. * @param pc an instance of a Class that is persistent * capable. * @return the parameter instance for parameters in the transient or * persistent state, or the corresponding persistent instance * for detached parameter instances */ T makePersistent (T pc); /** Make an array of instances persistent. * @param pcs an array of instances * @return the parameter instances for parameters in the transient or * persistent state, or the corresponding persistent instance * for detached parameter instances, in the same order as in the * parameter array * @see #makePersistent(Object pc) */ T[] makePersistentAll (T... pcs); /** Make a Collection of instances persistent. * @param pcs a Collection of instances * @return the parameter instance for parameters in the transient or * persistent state, or the corresponding persistent instance * for detached parameter instances, with an iteration in the same order * as in the parameter Collection * @see #makePersistent(Object pc) */ Collection makePersistentAll (Collection pcs); /** Delete the persistent instance from the data store. * This method must be called in an active transaction. * The data store object will be removed at commit. * Unlike makePersistent, which makes the closure of the * instance persistent, the closure of the instance is not deleted from the * data store. This method has no effect if the instance is already deleted * in the current transaction. * This method throws JDOUserException if the instance is * transient or is managed by another PersistenceManager. * * @param pc a persistent instance */ void deletePersistent (Object pc); /** Delete an array of instances from the data store. * @param pcs a Collection of persistent instances * @see #deletePersistent(Object pc) */ void deletePersistentAll (Object... pcs); /** Delete a Collection of instances from the data store. * @param pcs a Collection of persistent instances * @see #deletePersistent(Object pc) */ void deletePersistentAll (Collection pcs); /** Make an instance transient, removing it from management by this * PersistenceManager. * *

The instance loses its JDO identity and it is no longer associated * with any PersistenceManager. The state of fields is * preserved unchanged. * @param pc the instance to make transient. */ void makeTransient (Object pc); /** Make an array of instances transient, removing them from management by * this PersistenceManager. * *

The instances lose their JDO identity and they are no longer * associated with any PersistenceManager. The state of fields * is preserved unchanged. * @param pcs the instances to make transient. */ void makeTransientAll (Object... pcs); /** Make a Collection of instances transient, removing them * from management by this PersistenceManager. * *

The instances lose their JDO identity and they are no longer * associated with any PersistenceManager. The state of fields * is preserved unchanged. * @param pcs the instances to make transient. */ void makeTransientAll (Collection pcs); /** Make an instance transient, removing it from management by this * PersistenceManager. If the useFetchPlan parameter is * false, this method behaves exactly as makeTransient(Object pc). *

The affected instance(s) lose their JDO identity and are no longer * associated with any PersistenceManager. The state * of fields is unchanged. *

If the useFetchPlan parameter is true, then the current FetchPlan * is applied to the pc parameter, as if detachCopy(Object) had been * called. After the graph of instances is loaded, the instances * reachable via loaded fields is made transient. The state of fields * in the affected instances is as specified by the FetchPlan. *

Unlike detachCopy, the instances are not detached; there is no * detachment information in the instances. *

The instances to be made transient do not need to * implement the javax.jdo.spi.Detachable interface. * @param pc the root instance to make transient. * @param useFetchPlan whether to use the current fetch plan to determine * which fields to load and which instances to make transient * @since 2.0 */ void makeTransient (Object pc, boolean useFetchPlan); /** Make instances transient, removing them from management * by this PersistenceManager. If the useFetchPlan parameter * is false, this method behaves exactly as makeTransientAll(Object[] pcs). *

The affected instance(s) lose their JDO identity and are no longer * associated with any PersistenceManager. The state * of fields is unchanged. *

If the useFetchPlan parameter is true, then the current FetchPlan * is applied to the pcs parameters and the entire graph of instances * reachable via loaded fields is made transient. The state of fields * in the affected instances is as specified by the FetchPlan. *

Unlike detachCopy, the instances are not detached; there is no * detachment information in the instances. *

The instances to be made transient do not need to * implement the javax.jdo.spi.Detachable interface. * @param pcs the root instances to make transient. * @param useFetchPlan whether to use the current fetch plan to determine * which fields to load and which instances to make transient * @see #makeTransientAll(boolean,Object...) * @deprecated * @since 2.0 */ void makeTransientAll (Object[] pcs, boolean useFetchPlan); /** Make instances transient, removing them from management * by this PersistenceManager. If the useFetchPlan parameter * is false, this method behaves exactly as makeTransientAll(Object[] pcs). *

The affected instance(s) lose their JDO identity and are no longer * associated with any PersistenceManager. The state * of fields is unchanged. *

If the useFetchPlan parameter is true, then the current FetchPlan * is applied to the pcs parameters and the entire graph of instances * reachable via loaded fields is made transient. The state of fields * in the affected instances is as specified by the FetchPlan. *

Unlike detachCopy, the instances are not detached; there is no * detachment information in the instances. *

The instances to be made transient do not need to * implement the javax.jdo.spi.Detachable interface. * @param pcs the root instances to make transient. * @param useFetchPlan whether to use the current fetch plan to determine * which fields to load and which instances to make transient * @since 2.1 */ void makeTransientAll (boolean useFetchPlan, Object... pcs); /** Make instances transient, removing them from management * by this PersistenceManager. If the useFetchPlan parameter * is false, this method behaves exactly as * makeTransientAll(Collection pcs). *

The affected instance(s) lose their JDO identity and are no longer * associated with any PersistenceManager. The state * of fields is unchanged. *

If the useFetchPlan parameter is true, then the current FetchPlan * is applied to the pcs parameters and the entire graph of instances * reachable via loaded fields is made transient. The state of fields * in the affected instances is as specified by the FetchPlan. *

Unlike detachCopy, the instances are not detached; there is no * detachment information in the instances. *

The instances to be made transient do not need to * implement the javax.jdo.spi.Detachable interface. * @param pcs the root instances to make transient. * @param useFetchPlan whether to use the current fetch plan to determine * which fields to load and which instances to make transient * @since 2.0 */ void makeTransientAll (Collection pcs, boolean useFetchPlan); /** Make an instance subject to transactional boundaries. * *

Transient instances normally do not observe transaction boundaries. * This method makes transient instances sensitive to transaction * completion. If an instance is modified in a transaction, and the * transaction rolls back, the state of the instance is restored to the * state before the first change in the transaction. * *

For persistent instances read in optimistic transactions, this method * allows the application to make the state of the instance part of the * transactional state. At transaction commit, the state of the instance in * the cache is compared to the state of the instance in the data store. If * they are not the same, then an exception is thrown. * @param pc the instance to make transactional. */ void makeTransactional (Object pc); /** Make an array of instances subject to transactional boundaries. * @param pcs the array of instances to make transactional. * @see #makeTransactional(Object pc) */ void makeTransactionalAll (Object... pcs); /** Make a Collection of instances subject to transactional * boundaries. * @param pcs the Collection of instances to make * transactional. * @see #makeTransactional(Object pc) */ void makeTransactionalAll (Collection pcs); /** Make an instance non-transactional after commit. * *

Normally, at transaction completion, instances are evicted from the * cache. This method allows an application to identify an instance as * not being evicted from the cache at transaction completion. Instead, * the instance remains in the cache with nontransactional state. * * @param pc the instance to make nontransactional. */ void makeNontransactional (Object pc); /** Make an array of instances non-transactional after commit. * * @param pcs the array of instances to make nontransactional. * @see #makeNontransactional(Object pc) */ void makeNontransactionalAll (Object... pcs); /** Make a Collection of instances non-transactional after * commit. * * @param pcs the Collection of instances to make * nontransactional. * @see #makeNontransactional(Object pc) */ void makeNontransactionalAll (Collection pcs); /** Retrieve field values of an instance from the store. This tells * the PersistenceManager that the application intends to use * the instance, and its field values must be retrieved. *

The PersistenceManager might use policy information about * the class to retrieve associated instances. * @param pc the instance */ void retrieve (Object pc); /** Retrieve field values of an instance from the store. This tells * the PersistenceManager that the application intends to use * the instance, and its field values must be retrieved. *

If the useFetchPlan parameter is false, this method behaves exactly * as the corresponding method without the useFetchPlan parameter. * If the useFetchPlan parameter is true, and the fetch plan has not been * modified from its default setting, all fields in the current fetch plan * are fetched, and other fields might be fetched lazily by the * implementation. If the useFetchPlan parameter is true, and the fetch * plan has been changed from its default setting, then the fields * specified by the fetch plan are loaded, along with related instances * specified by the fetch plan. * @param pc the instance * @param useFetchPlan whether to use the current fetch plan to determine * which fields to load and which instances to retrieve. * @since 2.0 */ void retrieve (Object pc, boolean useFetchPlan); /** Retrieve field values of instances from the store. This tells * the PersistenceManager that the application intends to use * the instances, and all field values must be retrieved. *

The PersistenceManager might use policy information about * the class to retrieve associated instances. * @param pcs the instances */ void retrieveAll (Collection pcs); /** Retrieve field values of instances from the store. This tells * the PersistenceManager that the application intends to use * the instances, and their field values should be retrieved. The fields * in the current fetch group must be retrieved, and the implementation * might retrieve more fields than the current fetch group. *

If the useFetchPlan parameter is false, this method behaves exactly * as the corresponding method without the useFetchPlan parameter. * If the useFetchPlan parameter is true, and the fetch plan has not been * modified from its default setting, all fields in the current fetch plan * are fetched, and other fields might be fetched lazily by the * implementation. If the useFetchPlan parameter is true, and the fetch * plan has been changed from its default setting, then the fields * specified by the fetch plan are loaded, along with related instances * specified by the fetch plan. * @param pcs the instances * @param useFetchPlan whether to use the current fetch plan to determine * which fields to load and which instances to retrieve. * @since 1.0.1 */ void retrieveAll (Collection pcs, boolean useFetchPlan); /** Retrieve field values of instances from the store. This tells * the PersistenceManager that the application intends to use * the instances, and all field values must be retrieved. *

The PersistenceManager might use policy information about * the class to retrieve associated instances. * @param pcs the instances */ void retrieveAll (Object... pcs); /** Retrieve field values of instances from the store. This tells * the PersistenceManager that the application intends to use * the instances, and their field values should be retrieved. The fields * in the current fetch group must be retrieved, and the implementation * might retrieve more fields than the current fetch group. *

If the useFetchPlan parameter is false, this method behaves exactly * as the corresponding method without the useFetchPlan parameter. * If the useFetchPlan parameter is true, and the fetch plan has not been * modified from its default setting, all fields in the current fetch plan * are fetched, and other fields might be fetched lazily by the * implementation. If the useFetchPlan parameter is true, and the fetch * plan has been changed from its default setting, then the fields * specified by the fetch plan are loaded, along with related instances * specified by the fetch plan. * @param pcs the instances * @param useFetchPlan whether to use the current fetch plan to determine * which fields to load and which instances to retrieve. * @deprecated * @see #retrieveAll(boolean,Object...) * @since 1.0.1 */ void retrieveAll (Object[] pcs, boolean useFetchPlan); /** Retrieve field values of instances from the store. This tells * the PersistenceManager that the application intends to use * the instances, and their field values should be retrieved. The fields * in the current fetch group must be retrieved, and the implementation * might retrieve more fields than the current fetch group. *

If the useFetchPlan parameter is false, this method behaves exactly * as the corresponding method without the useFetchPlan parameter. * If the useFetchPlan parameter is true, and the fetch plan has not been * modified from its default setting, all fields in the current fetch plan * are fetched, and other fields might be fetched lazily by the * implementation. If the useFetchPlan parameter is true, and the fetch * plan has been changed from its default setting, then the fields * specified by the fetch plan are loaded, along with related instances * specified by the fetch plan. * @param pcs the instances * @param useFetchPlan whether to use the current fetch plan to determine * which fields to load and which instances to retrieve. * @since 2.1 */ void retrieveAll (boolean useFetchPlan, Object... pcs); /** The application can manage the PersistenceManager instances * more easily by having an application object associated with each * PersistenceManager instance. * @param o the user instance to be remembered by the * PersistenceManager * @see #getUserObject */ void setUserObject (Object o); /** The application can manage the PersistenceManager instances * more easily by having an application object associated with each * PersistenceManager instance. * @return the user object associated with this * PersistenceManager * @see #setUserObject */ Object getUserObject (); /** This method returns the PersistenceManagerFactory used to * create this PersistenceManager. * @return the PersistenceManagerFactory that created * this PersistenceManager */ PersistenceManagerFactory getPersistenceManagerFactory(); /** Return the Class that implements the JDO Identity for the * specified PersistenceCapable class. The application can use * the returned Class to construct a JDO Identity instance for * application identity PersistenceCapable classes. This JDO * Identity instance can then be used to get an instance of the * PersistenceCapable class for use in the application. * *

In order for the application to construct an instance of the ObjectId * class it needs to know the class being used by the JDO implementation. * @param cls the PersistenceCapable Class * @return the Class of the ObjectId of the parameter * @see #getObjectById */ Class getObjectIdClass(Class cls); /** Set the Multithreaded flag for this PersistenceManager. * Applications that use multiple threads to invoke methods or access fields * from instances managed by this PersistenceManager must set * this flag to true. * Instances managed by this PersistenceManager include * persistent or transactional instances of PersistenceCapable * classes, as well as helper instances such as Query, * Transaction, or Extent. * @param flag the Multithreaded setting. */ void setMultithreaded (boolean flag); /** Get the current Multithreaded flag for this * PersistenceManager. * @see #setMultithreaded * @return the Multithreaded setting. */ boolean getMultithreaded(); /** Set the ignoreCache parameter for queries. * *

IgnoreCache set to true specifies that for all * Query instances created by this * PersistenceManager, the default is the cache should be * ignored for queries. * @param flag the ignoreCache setting. */ void setIgnoreCache(boolean flag); /** Get the ignoreCache setting for queries. * *

IgnoreCache set to true specifies that for all * Query instances created by this * PersistenceManager, the default is the cache should be * ignored for queries. * @return the ignoreCache setting. */ boolean getIgnoreCache(); /** * Specify a timeout interval (milliseconds) for any datastore read * operations associated with this persistence manager. To unset * the explicit timeout, specify null. For no timeout, specify 0. * Read operations include, for example, those associated with query, * getObjectById, refresh, retrieve, and extent iteration operations. * If the datastore granularity is larger than milliseconds, the * timeout value will be rounded up to the nearest supported datastore * value. * If a read operation hasn't completed within this interval, the operation * will throw a JDODatastoreException. * If multiple datastore operations are required to complete the query, * the timeout value applies to each of them individually. * If the datastore and JDO implementation support timeouts, then * javax.jdo.option.DatastoreTimeout is returned by * PersistenceManagerFactory.supportedOptions(). * If timeouts are not supported,this method will throw * JDOUnsupportedOptionException. * @since 3.0 * @param interval the timeout interval (milliseconds) */ void setDatastoreReadTimeoutMillis(Integer interval); /** Get the effective timeout setting for datastore read operations * associated with this persistence manager. * If the timeout has not been set on this persistence manager explicitly, * the default read timeout value from the persistence manager factory * is returned. * @see #setDatastoreReadTimeoutMillis(Integer) * @see PersistenceManagerFactory#setDatastoreReadTimeoutMillis(Integer) * @return the effective timeout setting (milliseconds). * @since 3.0 */ Integer getDatastoreReadTimeoutMillis(); /** * Specify a timeout interval (milliseconds) for any write operations * associated with this persistence manager. To unset the explicit timeout, * specify null. For no timeout, specify 0. * Datastore write operations include, for example, operations associated * with flush, commit, and delete by query. * If the datastore granularity is larger than milliseconds, the * timeout value will be rounded up to the nearest supported datastore * value. * If a write operation hasn't completed within this interval, methods * will throw a JDODatastoreException. * If multiple datastore operations are required to complete the method, * the timeout value applies to each of them individually. * If the datastore and JDO implementation support timeouts, then * javax.jdo.option.DatastoreTimeout is returned by * PersistenceManagerFactory.supportedOptions(). * If timeouts are not supported,this method will throw * JDOUnsupportedOptionException. * @since 3.0 * @param interval the timeout interval (milliseconds) */ void setDatastoreWriteTimeoutMillis(Integer interval); /** Get the effective timeout setting for write operations. * If the timeout has not been set on this persistence manager explicitly, * the default datastore write timeout value from the persistence manager * factory is returned. * @see #setDatastoreWriteTimeoutMillis(Integer) * @see PersistenceManagerFactory#setDatastoreWriteTimeoutMillis(Integer) * @return the effective timeout setting (milliseconds). * @since 3.0 */ Integer getDatastoreWriteTimeoutMillis(); /** Gets the detachAllOnCommit setting. * @see #setDetachAllOnCommit(boolean) * @since 2.0 * @return the detachAllOnCommit setting. */ boolean getDetachAllOnCommit(); /** Sets the detachAllOnCommit setting. * *

DetachAllOnCommit set to false specifies that the * state of persistent instances in the cache after commit is defined * by the retainValues flag. With this flag set to true, * during beforeCompletion all cached instances are prepared for * detachment according to the fetch plan in effect at commit. Loading * fields and unloading fields required by the fetch plan is done after * calling the user's beforeCompletion callback. During * afterCompletion, before calling the user's * afterCompletion callback, all detachable persistent * instances in the cache transition to detached; non-detachable * persistent instances transition to transient; and detachable * instances can be serialized as detached instances. Transient * transactional instances are unaffected by this flag. * * @see #getDetachAllOnCommit() * @since 2.0 */ void setDetachAllOnCommit(boolean flag); /** Gets the copyOnAttach setting. * @see #setCopyOnAttach(boolean) * @since 2.1 * @return the copyOnAttach setting. */ boolean getCopyOnAttach(); /** Sets the copyOnAttach setting. * *

CopyOnAttach set to true specifies that during * makePersistent, copies are made of detached parameter instances. * With this flag set to false, detached parameter * instances are attached directly and change their state from * detached-clean to persistent-clean or from detached-dirty to * persistent-dirty. * * @see #getCopyOnAttach() * @since 2.1 */ void setCopyOnAttach(boolean flag); /** * Detach the specified instance from the PersistenceManager. * The flags for detachment (DETACH_LOAD_FIELDS and DETACH_UNLOAD_FIELDS) * and the active fetch groups determine the scope of fetching for the * graph of instances reachable from the pc parameter. The state of fields * in the affected instances is as specified by the FetchPlan. * @param pc the instance to detach * @return the detached instance * @see #detachCopyAll(Object[]) * @since 2.0 */ T detachCopy (T pc); /** * Detach the specified instances from the PersistenceManager. * The flags for detachment (DETACH_LOAD_FIELDS and DETACH_UNLOAD_FIELDS) * and the active fetch groups determine the scope of fetching for the * graph of instances reachable from the pcs parameter. The state of fields * in the affected instances is as specified by the FetchPlan. * @param pcs the instances to detach * @return the detached instances * @see #detachCopyAll(Object[]) * @since 2.0 */ Collection detachCopyAll (Collection pcs); /** * Detach the specified instances from the PersistenceManager. * The flags for detachment (DETACH_LOAD_FIELDS and DETACH_UNLOAD_FIELDS) * and the active fetch groups determine the scope of fetching for the * graph of instances reachable from the pcs parameter. The state of fields * in the affected instances is as specified by the FetchPlan. * The objects returned can be manipulated and re-attached with * {@link #makePersistentAll(Object[])}. * The detached instances will be * unmanaged copies of the specified parameters, and are suitable * for serialization and manipulation outside of a JDO * environment. When detaching instances, only fields in the * current {@link FetchPlan} will be traversed. Thus, to detach a * graph of objects, relations to other persistent instances must * either be in the default-fetch-group, or in the * current custom {@link FetchPlan}. * @param pcs the instances to detach * @return the detached instances * @throws JDOUserException if any of the instances to be detached do not * implement the javax.jdo.spi.Detachable interface. * @see #makePersistentAll(Object[]) * @see #getFetchPlan * @since 2.0 */ T[] detachCopyAll (T... pcs); /** * Put the specified key-value pair into the map of user objects. * @since 2.0 */ Object putUserObject (Object key, Object val); /** * Get the value for the specified key from the map of user objects. * @param key the key of the object to be returned * @return the object * @since 2.0 */ Object getUserObject (Object key); /** * Remove the specified key and its value from the map of user objects. * @param key the key of the object to be removed * @since 2.0 */ Object removeUserObject (Object key); /** * Flushes all dirty, new, and deleted instances to the data * store. It has no effect if a transaction is not active. *

If a datastore transaction is active, this method * synchronizes the cache with the datastore and reports any * exceptions.

*

If an optimistic transaction is active, this method obtains * a datastore connection, synchronizes the cache with the * datastore using this connection and reports any * exceptions. The connection obtained by this method is held * until the end of the transaction.

*

If exceptions occur during flush, the implementation will * set the current transaction's RollbackOnly flag * (see {@link Transaction#setRollbackOnly}).

* @since 2.0 */ void flush (); /** * Validates the PersistenceManager cache with the * datastore. This method has no effect if a transaction is not * active. *

If a datastore transaction is active, this method verifies * the consistency of instances in the cache against the * datastore. An implementation might flush instances as if * {@link #flush} were called, but it is not required to do * so.

*

If an optimistic transaction is active, this method obtains * a datastore connection and verifies the consistency of the * instances in the cache against the datastore. If any * inconsistencies are detected, a {@link * JDOOptimisticVerificationException} is thrown. This exception * contains a nested {@link JDOOptimisticVerificationException} * for each object that failed the consistency check. No * datastore resources acquired during the execution of this * method are held beyond the scope of this method.

* @since 2.0 */ void checkConsistency (); /** * Returns the FetchPlan used by this * PersistenceManager. * @return the FetchPlan * @since 2.0 */ FetchPlan getFetchPlan (); /** * Creates an instance of a persistence-capable interface, * or of a concrete or abstract class. * The returned instance is transient. * @param pcClass Must be a persistence-capable interface, * or a concrete or abstract class that is declared in the metadata. * @return the created instance * @since 2.0 */ T newInstance (Class pcClass); /** * Returns the sequence identified by name. * @param name the name of the Sequence * @return the Sequence * @since 2.0 */ Sequence getSequence (String name); /** * If this method is called while a datastore transaction is * active, the object returned will be enlisted in the current * transaction. If called in an optimistic transaction or outside * an active transaction, the object returned will not be * enlisted in any transaction. * @return the JDOConnection instance * @since 2.0 */ JDOConnection getDataStoreConnection (); /** * Adds the listener instance to the list of lifecycle event * listeners. The classes parameter identifies all * of the classes of interest. If the classes * parameter is specified as null, events for all * persistent classes and interfaces will be sent to * listenerInstance. *

The listenerInstance will be called for each event for which it * implements the corresponding listenerInstance interface.

* @param listener the lifecycle listener * @param classes the classes of interest to the listener * @since 2.0 */ void addInstanceLifecycleListener (InstanceLifecycleListener listener, Class... classes); /** * Removes the listener instance from the list of lifecycle event listeners. * @param listener the listener instance to be removed * @since 2.0 */ void removeInstanceLifecycleListener (InstanceLifecycleListener listener); /** * Get the Date as seen by the server. * Clients using this method can order their operations according to * a single time source. Implementations use the setting of the * server time zone to prepare a Date instance that represents * UTC time on the server. * @return a Date instance corresponding to the UTC Date * as seen by the server * @since 2.1 */ Date getServerDate(); /** * Get the objects managed by this persistence manager. * @return the objects * @since 2.1 */ Set getManagedObjects(); /** * Get the objects managed by this persistence manager having the * specified object states. * @param states The states of objects that we are interested in * @return the objects * @since 2.1 */ Set getManagedObjects(EnumSet states); /** * Get the objects managed by this persistence manager being instances of * the specified classes. * @param classes The classes of objects that we are interested in * @return the objects * @since 2.1 */ Set getManagedObjects(Class... classes); /** * Get the objects managed by this persistence manager having the * specified object states and being instances of the specified classes. * @param states The states of objects that we are interested in * @param classes The classes of objects that we are interested in * @return the objects * @since 2.1 */ Set getManagedObjects(EnumSet states, Class... classes); /** * Get a modifiable FetchGroup for the Class and name. * If a modifiable FetchGroup already exists in the * PersistenceManager scope, return it. * If not, create and populate a new FetchGroup from the * existing definition in the {@link PersistenceManager} or * {@link PersistenceManagerFactory}. If the definition for the * FetchGroup is not in scope in either the * PersistenceManager or * PersistenceManagerFactory, create it with no members. * The FetchGroup immediately * becomes active and in scope of the PersistenceManager, and hides * the corresponding fetch group in the PersistenceManagerFactory. * @param cls the class or interface for the FetchGroup * @param name the name of the fetch group * @return the FetchGroup * @throws JDOUserException if the class is not a persistence-capable * class or interface * @since 2.2 */ FetchGroup getFetchGroup(Class cls, String name); /** * Set a persistence manager property. This can be a standard property * or a vendor-extension property. If a vendor-extension property is * not recognized, it is silently ignored. * @param propertyName name of property * @param value The value * @throws JDOUserException if the value is not supported for the property * @since 3.1 */ public void setProperty(String propertyName, Object value); /** * Get the properties and associated values currently in effect for the * persistence manager. Changing entries in the map will not have affect * the configuration of the persistence manager. * @return map of properties in effect * @since 3.1 */ public Map getProperties(); /** * Get the names of the properties that are supported for use with the * persistence manager. These can be standard JDO properties, or can be * vendor-extension properties. * @return property names Names of the properties accepted * @since 3.1 */ public Set getSupportedProperties(); } api/src/java/javax/jdo/PersistenceManagerFactory.java100664 76027 12500110371 23241 0ustarmbouschenstaff 0 0 /* * 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. */ /* * PersistenceManagerFactory.java * */ package javax.jdo; import javax.jdo.datastore.DataStoreCache; import javax.jdo.listener.InstanceLifecycleListener; import javax.jdo.metadata.TypeMetadata; import javax.jdo.metadata.JDOMetadata; import javax.jdo.spi.JDOPermission; // for getFetchGroups javadoc import java.io.Serializable; import java.util.Collection; import java.util.Properties; import java.util.Set; /** The PersistenceManagerFactory is the interface to use to obtain * PersistenceManager instances. * All PersistenceManager instances obtained from the same * PersistenceManagerFactory will have the same default properties. * *

PersistenceManagerFactory instances may be configured and * serialized for later use. They may be stored via JNDI and looked up * and used later. Any properties configured will be saved and restored. * *

Once the first PersistenceManager is obtained from the * PersistenceManagerFactory, the factory can no longer be * configured. *

If the ConnectionFactory property is set * (non-null) then all other Connection properties including * ConnectionFactoryName are ignored; * otherwise, if ConnectionFactoryName is set * (non-null) then all other Connection properties are ignored. * Similarly, if the ConnectionFactory2 property is set * (non-null) then ConnectionFactory2Name is ignored. *

Operational state (PersistenceManager pooling, connection * pooling, operational parameters) must not be serialized. * * @version 2.2 */ public interface PersistenceManagerFactory extends Serializable { /** Close this PersistenceManagerFactory. Check for * JDOPermission("closePersistenceManagerFactory") and if not authorized, * throw SecurityException. *

If the authorization check succeeds, check to see that all * PersistenceManager instances obtained from this PersistenceManagerFactory * have no active transactions. If any PersistenceManager instances have * an active transaction, throw a JDOUserException, with one nested * JDOUserException for each PersistenceManager with an active Transaction. *

If there are no active transactions, then close all PersistenceManager * instances obtained from this PersistenceManagerFactory, mark this * PersistenceManagerFactory as closed, disallow getPersistenceManager * methods, and allow all other get methods. If a set method or * getPersistenceManager method is called after close, then * JDOUserException is thrown. * @since 1.0.1 */ void close(); /** * A PersistenceManagerFactory instance can be used * until it is closed. * @return true if this PersistenceManagerFactory * has been closed. * @see #close() * @since 2.0 */ boolean isClosed(); /** Get an instance of PersistenceManager from this factory. * The instance has default values for options. * *

After the first use of getPersistenceManager, no "set" * methods will succeed. * * @return a PersistenceManager instance with default options. */ PersistenceManager getPersistenceManager(); /** Get a thread-safe instance of a proxy that dynamically binds * on each method call to an instance of PersistenceManager. *

When used with a PersistenceManagerFactory * that uses TransactionType JTA, * the proxy can be used in a server to dynamically bind to an instance * from this factory associated with the thread's current transaction. * In this case, the close method is ignored, as the * PersistenceManager is automatically closed when the * transaction completes. *

When used with a PersistenceManagerFactory * that uses TransactionType RESOURCE_LOCAL, the proxy uses an inheritable * ThreadLocal to bind to an instance of PersistenceManager * associated with the thread. In this case, the close method executed * on the proxy closes the PersistenceManager and then * clears the ThreadLocal. * Use of this method does not affect the configurability of the * PersistenceManagerFactory. * * @since 2.1 * @return a PersistenceManager proxy. */ PersistenceManager getPersistenceManagerProxy(); /** Get an instance of PersistenceManager from this factory. * The instance has default values for options. * The parameters userid and password are used * when obtaining datastore connections from the connection pool. * *

After the first use of getPersistenceManager, no "set" * methods will succeed. * * @return a PersistenceManager instance with default options. * @param userid the userid for the connection * @param password the password for the connection */ PersistenceManager getPersistenceManager(String userid, String password); /** Set the user name for the data store connection. * @param userName the user name for the data store connection. */ void setConnectionUserName(String userName); /** Get the user name for the data store connection. * @return the user name for the data store connection. */ String getConnectionUserName (); /** Set the password for the data store connection. * @param password the password for the data store connection. */ void setConnectionPassword (String password); /** Set the URL for the data store connection. * @param url the URL for the data store connection. */ void setConnectionURL (String url); /** Get the URL for the data store connection. * @return the URL for the data store connection. */ String getConnectionURL (); /** Set the driver name for the data store connection. * @param driverName the driver name for the data store connection. */ void setConnectionDriverName (String driverName); /** Get the driver name for the data store connection. * @return the driver name for the data store connection. */ String getConnectionDriverName (); /** Set the name for the data store connection factory. * @param connectionFactoryName the name of the data store connection * factory. */ void setConnectionFactoryName (String connectionFactoryName); /** Get the name for the data store connection factory. * @return the name of the data store connection factory. */ String getConnectionFactoryName (); /** Set the data store connection factory. JDO implementations * will support specific connection factories. The connection * factory interfaces are not part of the JDO specification. * @param connectionFactory the data store connection factory. */ void setConnectionFactory (Object connectionFactory); /** Get the data store connection factory. * @return the data store connection factory. */ Object getConnectionFactory (); /** Set the name for the second data store connection factory. This is * needed for managed environments to get nontransactional connections for * optimistic transactions. * @param connectionFactoryName the name of the data store connection * factory. */ void setConnectionFactory2Name (String connectionFactoryName); /** Get the name for the second data store connection factory. This is * needed for managed environments to get nontransactional connections for * optimistic transactions. * @return the name of the data store connection factory. */ String getConnectionFactory2Name (); /** Set the second data store connection factory. This is * needed for managed environments to get nontransactional connections for * optimistic transactions. JDO implementations * will support specific connection factories. The connection * factory interfaces are not part of the JDO specification. * @param connectionFactory the data store connection factory. */ void setConnectionFactory2 (Object connectionFactory); /** Get the second data store connection factory. This is * needed for managed environments to get nontransactional connections for * optimistic transactions. * @return the data store connection factory. */ Object getConnectionFactory2 (); /** Set the default Multithreaded setting for all * PersistenceManager instances obtained from this factory. * * @param flag the default Multithreaded setting. */ void setMultithreaded (boolean flag); /** Get the default Multithreaded setting for all * PersistenceManager instances obtained from this factory. * * @return the default Multithreaded setting. */ boolean getMultithreaded(); /** Set the Mapping setting for this factory. This is used to find the * object-datastore mapping file(s). * * @param mapping the Mapping setting. */ void setMapping (String mapping); /** Get the Mapping setting for this factory. This is used to find the * object-datastore mapping file(s). * * @return the Mapping setting. */ String getMapping (); /** Set the default Optimistic setting for all * PersistenceManager instances obtained from this factory. * * @param flag the default Optimistic setting. */ void setOptimistic (boolean flag); /** Get the default Optimistic setting for all * PersistenceManager instances obtained from this factory. * * @return the default Optimistic setting. */ boolean getOptimistic(); /** Set the default RetainValues setting for all * PersistenceManager instances obtained from this factory. * * @param flag the default RetainValues setting. */ void setRetainValues (boolean flag); /** Get the default RetainValues setting for all * PersistenceManager instances obtained from this factory. * * @return the default RetainValues setting. */ boolean getRetainValues (); /** Set the default value for the RestoreValues property. * If true, at rollback, fields of newly persistent instances * are restored to * their values as of the beginning of the transaction, and the instances * revert to transient. Additionally, fields of modified * instances of primitive types and immutable reference types * are restored to their values as of the beginning of the * transaction. *

If false, at rollback, the values of fields of * newly persistent instances are unchanged and the instances revert to * transient. Additionally, dirty instances transition to hollow. * If an implementation does not support this option, a * JDOUnsupportedOptionException is thrown. * @param restoreValues the value of the restoreValues property */ void setRestoreValues(boolean restoreValues); /** Get the default value for the RestoreValues property. * @return the value of the restoreValues property */ boolean getRestoreValues(); /** Set the default NontransactionalRead setting for all * PersistenceManager instances obtained from this factory. * * @param flag the default NontransactionalRead setting. */ void setNontransactionalRead (boolean flag); /** Get the default NontransactionalRead setting for all * PersistenceManager instances obtained from this factory. * * @return the default NontransactionalRead setting. */ boolean getNontransactionalRead (); /** Set the default NontransactionalWrite setting for all * PersistenceManager instances obtained from this factory. * * @param flag the default NontransactionalWrite setting. */ void setNontransactionalWrite (boolean flag); /** Get the default NontransactionalWrite setting for all * PersistenceManager instances obtained from this factory. * * @return the default NontransactionalWrite setting. */ boolean getNontransactionalWrite (); /** Set the default IgnoreCache setting for all * PersistenceManager instances obtained from this factory. * * @param flag the default IgnoreCache setting. */ void setIgnoreCache (boolean flag); /** Get the default IgnoreCache setting for all * PersistenceManager instances obtained from this factory. * * @return the default IngoreCache setting. */ boolean getIgnoreCache (); /** Gets the detachAllOnCommit setting. * @see #setDetachAllOnCommit(boolean) * @since 2.0 * @return the default detachAllOnCommit setting. */ boolean getDetachAllOnCommit(); /** Sets the default detachAllOnCommit setting for all * PersistenceManager instances obtained from this * factory. * @see #getDetachAllOnCommit() * @since 2.0 * @param flag the default DetachAllOnCommit setting */ void setDetachAllOnCommit(boolean flag); /** Gets the default copyOnAttach setting for all * PersistenceManager instances obtained from this * factory. * @see #setCopyOnAttach(boolean) * @since 2.1 * @return the copyOnAttach setting. */ boolean getCopyOnAttach(); /** Sets the default copyOnAttach setting for all * PersistenceManager instances obtained from this * factory. * *

CopyOnAttach set to true specifies that during * makePersistent, copies are made of detached parameter instances. * With this flag set to false, detached parameter * instances are attached directly and change their state from * detached-clean to persistent-clean or from detached-dirty to * persistent-dirty. * * @see #getCopyOnAttach() * @since 2.1 */ void setCopyOnAttach(boolean flag); /** * Sets the name of this PersistenceManagerFactory. * @since 2.1 * @param name the name of this PMF */ void setName(String name); /** * Gets the name of this PersistenceManagerFactory. * @since 2.1 * @return the name of this PMF */ String getName(); /** * Sets the PersistenceUnitName for this PersistenceManagerFactory. * This has the same semantics as the same-named property in * JSR-220 PersistenceUnitInfo. * @see #getPersistenceUnitName() * @since 2.1 * @param name the PersistenceUnitName */ void setPersistenceUnitName(String name); /** * Gets the PersistenceUnitName for this PersistenceManagerFactory. * @see #setPersistenceUnitName(String) * @since 2.1 * @return the PersistenceUnitName */ String getPersistenceUnitName(); /** * Sets the TimeZone ID of the server associated with this * PersistenceManagerFactory. The parameter is a String * suitable for use with TimeZone.getTimeZone(). The String * must match an ID returned by TimeZone.getAvailableIDs(). * If the ServerTimeZoneID is not set, or set to the null String, * assume that the server has the same TimeZone ID as the client. * If incorrectly set, the result of PersistenceManager.getServerDate() * might be incorrect. * @see #getServerTimeZoneID() * @see java.util.TimeZone#getTimeZone(String) * @see java.util.TimeZone#getAvailableIDs() * @see PersistenceManager#getServerDate() * @since 2.1 * @param timezoneid the TimeZone ID of the server * @throws JDOUserException if the parameter does not match * an ID from TimeZone.getAvailableIDs() */ void setServerTimeZoneID(String timezoneid); /** * Gets the TimeZone ID of the server associated with this * PersistenceManagerFactory. If not set, assume that * the server has the same TimeZone ID as the client. * @see #setServerTimeZoneID(String) * @since 2.1 * @return the TimeZone of the server */ String getServerTimeZoneID(); /** * Sets the TransactionType for this PersistenceManagerFactory. * Permitted values are "JTA" and "RESOURCE_LOCAL". * This has the same semantics as the same-named property in * JSR-220 EntityManagerFactory. * @see #getTransactionType() * @see Constants#JTA * @see Constants#RESOURCE_LOCAL * @since 2.1 * @param name the TransactionType * @throws JDOUserException if the parameter is not a permitted value */ void setTransactionType(String name); /** * Gets the TransactionType for this PersistenceManagerFactory. * @see #setTransactionType(String) * @since 2.1 * @return the TransactionType */ String getTransactionType(); /** Gets the value for read-only for this PMF. * Indicates whether the datastore is read-only or writable. * @see #setReadOnly(boolean) * @since 2.2 * @return the readOnly setting. */ boolean getReadOnly(); /** Sets the value for whether the datastore is to be considered * read-only. * *

ReadOnly set to false specifies that no updates * can be performed to the datastore, and if updates are attempted * a JDOReadOnlyException is thrown. * * @see #getReadOnly() * @since 2.2 */ void setReadOnly(boolean flag); /** Get the value for transaction isolation level for this PMF. * @return the transaction isolation level * @see #setTransactionIsolationLevel(String) * @since 2.2 */ String getTransactionIsolationLevel(); /** Set the value for transaction isolation level for this PMF. * Transaction isolation levels are defined in javax.jdo.Constants. * If the requested level is not available, but a higher level is * available, the higher level is silently used. * If the requested level is not available, and no higher level is * available, then JDOUnsupportedOptionException is thrown. * Standard values in order from low to high are: *

  • read-uncommitted *
  • read-committed *
  • repeatable-read *
  • snapshot *
  • serializable *
* @param level the transaction isolation level * @see #getTransactionIsolationLevel() * @see Constants#TX_READ_UNCOMMITTED * @see Constants#TX_READ_COMMITTED * @see Constants#TX_REPEATABLE_READ * @see Constants#TX_SNAPSHOT * @see Constants#TX_SERIALIZABLE * @since 2.2 */ void setTransactionIsolationLevel(String level); /** * Specify a default timeout interval (milliseconds) for any read * operations for persistence managers obtained from this persistence * manager factory. To unset the explicit timeout, specify null. * For no timeout, specify 0. * If the datastore and JDO implementation support timeouts, then * javax.jdo.option.DatastoreTimeout is returned by supportedOptions(). * If timeouts are not supported,this method will throw * JDOUnsupportedOptionException. * @since 3.0 * @param interval the timeout interval (milliseconds) */ void setDatastoreReadTimeoutMillis(Integer interval); /** Get the default timeout setting for read operations. * If timeouts are not supported,this method will return null. * @see #setDatastoreReadTimeoutMillis(Integer) * @return the default timeout setting (milliseconds). * @since 3.0 */ Integer getDatastoreReadTimeoutMillis(); /** * Specify a default timeout interval (milliseconds) for any write * operations for persistence managers obtained from this persistence * manager factory. To unset the explicit timeout, specify null. * For no timeout, specify 0. * If the datastore and JDO implementation support timeouts, then * javax.jdo.option.DatastoreTimeout is returned by supportedOptions(). * If timeouts are not supported,this method will throw * JDOUnsupportedOptionException. * @since 3.0 * @param interval the timeout interval (milliseconds) */ void setDatastoreWriteTimeoutMillis(Integer interval); /** Get the default timeout setting for write operations. * If timeouts are not supported,this method will return null. * @see #setDatastoreWriteTimeoutMillis(Integer) * @return the default timeout setting (milliseconds). * @since 3.0 */ Integer getDatastoreWriteTimeoutMillis(); /** Return non-configurable properties of this * PersistenceManagerFactory. * Properties with keys VendorName and * VersionNumber are required. Other keys are optional. * @return the non-configurable properties of this * PersistenceManagerFactory. */ Properties getProperties(); /** The application can determine from the results of this * method which optional features, and which query languages * are supported by the JDO implementation. *

Each supported JDO feature is represented by a * String with one of the following values: * *

javax.jdo.option.TransientTransactional *
javax.jdo.option.NontransactionalRead *
javax.jdo.option.NontransactionalWrite *
javax.jdo.option.RetainValues *
javax.jdo.option.Optimistic *
javax.jdo.option.ApplicationIdentity *
javax.jdo.option.DatastoreIdentity *
javax.jdo.option.NonDurableIdentity *
javax.jdo.option.ArrayList *
javax.jdo.option.HashMap *
javax.jdo.option.Hashtable *
javax.jdo.option.LinkedList *
javax.jdo.option.TreeMap *
javax.jdo.option.TreeSet *
javax.jdo.option.Vector *
javax.jdo.option.Map *
javax.jdo.option.List *
javax.jdo.option.Array *
javax.jdo.option.NullCollection *
javax.jdo.option.ChangeApplicationIdentity *
javax.jdo.option.BinaryCompatibility *
javax.jdo.option.GetDataStoreConnection *
javax.jdo.option.UnconstrainedQueryVariables *
javax.jdo.option.TransactionIsolationLevel.read-uncommitted *
javax.jdo.option.TransactionIsolationLevel.read-committed *
javax.jdo.option.TransactionIsolationLevel.repeatable-read *
javax.jdo.option.TransactionIsolationLevel.snapshot *
javax.jdo.option.TransactionIsolationLevel.serializable *
javax.jdo.option.QueryCancel *
javax.jdo.option.DatastoreTimeout *
javax.jdo.query.SQL *
javax.jdo.query.JDOQL *
* *

The standard JDO query language is represented by a * String: *

javax.jdo.query.JDOQL * @return the Collection of Strings representing * the supported options. */ Collection supportedOptions(); /** * Return the {@link DataStoreCache} that this factory uses for * controlling a second-level cache. If this factory does not use * a second-level cache, the returned instance does nothing. This * method never returns null. * @since 2.0 * @return the DataStoreCache */ DataStoreCache getDataStoreCache (); /** * Add the parameter listener to the list of * instance lifecycle event listeners set as the initial listeners * for each PersistenceManager created by this PersistenceManagerFactory. * The addInstanceLifecycleListener and * removeInstanceLifecycleListener * methods are considered to be configuration methods and * can only be called when the PersistenceManagerFactory * is configurable (before the first time {@link #getPersistenceManager} * is called). *

The classes parameter identifies all * of the classes of interest. If the classes * parameter is specified as null, events for all * persistent classes and interfaces will be sent to the listener.

*

The listener will be called for each event for which it * implements the corresponding {@link InstanceLifecycleListener} * interface.

* @param listener the lifecycle listener * @param classes the classes of interest to the listener * @since 2.0 */ void addInstanceLifecycleListener (InstanceLifecycleListener listener, Class[] classes); /** * Remove the parameter listener instance from the list of * instance lifecycle event listeners set as the initial listeners * for each PersistenceManager created by this PersistenceManagerFactory. * The addInstanceLifecycleListener and * removeInstanceLifecycleListener * methods are considered to be configuration methods and * can only be called when the PersistenceManagerFactory * is configurable (before the first time {@link #getPersistenceManager} * is called). * @param listener the listener instance to be removed * @since 2.0 */ void removeInstanceLifecycleListener (InstanceLifecycleListener listener); /** * Add the FetchGroups to the set of active fetch groups. * FetchGroups are made unmodifiable before being added. * FetchGroups that match existing FetchGroups * replace the corresponding FetchGroups. * The replaced FetchGroups become unscoped. * Match is based on identical class and equal name. * The methods {@link #addFetchGroups}, {@link #removeFetchGroups}, * {@link #getFetchGroups}, and {@link #removeAllFetchGroups} * are internally serialized. * @param groups an array of FetchGroups * @throws SecurityException if the caller is not authorized for * {@link JDOPermission} ("manageMetadata") * @since 2.2 */ void addFetchGroups(FetchGroup... groups); /** * Remove the FetchGroups from the set of active * FetchGroups. Existing FetchGroups that match * parameter FetchGroups are removed. Parameter * FetchGroups that do not match any existing * FetchGroup are ignored. * Removed FetchGroups become unscoped. * Match is based on identical class and equal name. * The methods {@link #addFetchGroups}, {@link #removeFetchGroups}, * {@link #getFetchGroups}, and {@link #removeAllFetchGroups} * are internally serialized. * @param groups an array of FetchGroups * @throws SecurityException if the caller is not authorized for * {@link JDOPermission} ("manageMetadata") * @since 2.2 */ void removeFetchGroups(FetchGroup... groups); /** * Remove all FetchGroups from the set of active * FetchGroups. * All removed FetchGroups become unscoped. * The methods {@link #addFetchGroups}, {@link #removeFetchGroups}, * {@link #getFetchGroups}, and {@link #removeAllFetchGroups} * are internally serialized. * @throws SecurityException if the caller is not authorized for * {@link JDOPermission} ("manageMetadata") * @since 2.2 */ void removeAllFetchGroups(); /** * Create an unscoped, modifiable FetchGroup for the Class and * name. If a corresponding FetchGroup already exists in * PersistenceManagerFactory scope, copy its definition * to a new FetchGroup. * If the FetchGroup does not already exist, create it * with no members. The FetchGroup does not become * in scope until it is added to the current set via * {@link #addFetchGroups}. * @param cls the class or interface for the FetchGroup * @param name the name of the fetch group * @return the FetchGroup * @throws JDOUserException if the class is not a persistence-capable * class or interface * @since 2.2 */ FetchGroup getFetchGroup(Class cls, String name); /** * Get a modifiable Set containing a mutable copy of all currently active * (in scope) fetch groups. * The methods {@link #addFetchGroups}, {@link #removeFetchGroups}, * {@link #getFetchGroups}, and {@link #removeAllFetchGroups} * are internally serialized. * @return a copy of all currently active fetch groups * @throws SecurityException if the caller is not authorized for * {@link JDOPermission} ("getMetadata") * @since 2.2 */ Set getFetchGroups(); /** * Method to register metadata with the persistence process managed by this * PersistenceManagerFactory. * Metadata can be created using the method {@link #newMetadata}. * If there is already metadata registered for a class contained in this metadata * object then a JDOUserException will be thrown. * @param metadata The Metadata to register. * @since 3.0 */ void registerMetadata(JDOMetadata metadata); /** * Method to return a new metadata object that can be subsequently modified * and registered with the persistence process using the method {@link #registerMetadata}. * @return The metadata * @since 3.0 */ JDOMetadata newMetadata(); /** * Method to return the metadata object for the specified class/interface, if there is * metadata defined for that class/interface. * If there is no metadata for the specified class/interface, or the parameter is null, * then null will be returned. * @return The metadata * @since 3.0 */ TypeMetadata getMetadata(String className); /** * Method to return the currently managed classes for this factory. * @return Collection of persistable classes that are managed by this factory * @since 3.1 */ Collection getManagedClasses(); } api/src/java/javax/jdo/Query.java100664 112704 12500110371 17250 0ustarmbouschenstaff 0 0 /* * 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. */ /* * Query.java * */ package javax.jdo; import java.io.Serializable; import java.util.Collection; import java.util.Map; /** The Query interface allows applications to obtain persistent * instances, values, and aggregate data * from the data store. * * The {@link PersistenceManager} is the factory for Query * instances. There may be many Query instances associated with a * PersistenceManager. Multiple queries might be executed * simultaneously by different threads, but the implementation might choose to * execute them serially. In either case, the implementation must be thread * safe. * *

There are three required elements in a Query: the class of * the results, the candidate collection of instances, and the filter. * *

There are optional elements: parameter declarations, variable * declarations, import statements, ordering and grouping specifications, * result and result class, the range of results, * and flags indicating whether the query result * is unique and whether the query can be modified. *

The query namespace is modeled after methods in Java: *

    *
  • setClass corresponds to the class definition *
  • declareParameters corresponds to formal parameters of a * method *
  • declareVariables corresponds to local variables of a method *
  • setFilter and setOrdering correspond to the * method body *
*

There are two namespaces in queries. Type names have their own * namespace that is separate from the namespace for fields, variables * and parameters. *

The method setClass introduces the name of the candidate * class in the type namespace. The method declareImports * introduces the names of the imported class or interface types in the type * namespace. Imported type names must be unique. When used (e.g. in a parameter * declaration, cast expression, etc.) a type name must be the name of the * candidate class, the name of a class or interface imported by method * declareImports, or denote a class or interface from the same * package as the candidate class. *

The method setClass introduces the names of the candidate * class fields. *

The method declareParameters introduces the names of the * parameters. A name introduced by declareParameters hides the * name of a candidate class field of the same name. Parameter names must be * unique. *

The method declareVariables introduces the names of the * variables. A name introduced by declareVariables hides the name * of a candidate class field if equal. Variable names must be unique and must * not conflict with parameter names. *

The result of the query by default is a list of result class instances, * but might be specified via setResult. The class of the result * by default is the candidate class, but might be specified via * setResultClass. *

A hidden field may be accessed using the 'this' qualifier: * this.fieldName. *

The Query interface provides methods which execute the query * based on the parameters given. They return a single instance or a * List of result class instances which the * user can iterate to get results. The signature * of the execute methods specifies that they return an * Object which must be cast to the appropriate result by the user. *

Any parameters passed to the execute methods are used only * for this execution, and are not remembered for future execution. * @version 2.1 */ public interface Query extends Serializable { /** * The string constant used as the first argument to * {@link PersistenceManager#newQuery(String,Object)} to identify that the * created query should obey the JDOQL syntax and semantic rules. *

This is the default query language used when creating a query with any * of the other {@link PersistenceManager#newQuery} methods, except * {@link PersistenceManager#newQuery(Object)}, which uses the query * language of the compiled query template object passed to that method.

* @since 2.0 */ String JDOQL = "javax.jdo.query.JDOQL"; /** * The string constant used as the first argument to {@link * PersistenceManager#newQuery(String,Object)} to identify that * the created query should use SQL semantics. This is only * meaningful for relational JDO implementations. *

If this is used, the Object argument to the * {@link PersistenceManager#newQuery(String,Object)} method * should be a String containing a SQL * SELECT statement.

* @since 2.0 */ String SQL = "javax.jdo.query.SQL"; /** Set the class of the candidate instances of the query. *

The class specifies the class * of the candidates of the query. Elements of the candidate collection * that are of the specified class are filtered before being * put into the result Collection. * * @param cls the Class of the candidate instances. */ void setClass(Class cls); /** Set the candidate Extent to query. * @param pcs the candidate Extent. */ void setCandidates(Extent pcs); /** Set the candidate Collection to query. * @param pcs the candidate Collection. */ void setCandidates(Collection pcs); /** Set the filter for the query. * *

The filter specification is a String containing a Boolean * expression that is to be evaluated for each of the instances * in the candidate collection. If the filter is not specified, * then it defaults to "true", which has the effect of filtering * the input Collection only for class type. *

An element of the candidate collection is returned in the result if: *

  • it is assignment compatible to the candidate Class * of the Query; and *
  • for all variables there exists a value for which the filter * expression evaluates to true. *
*

The user may denote uniqueness in the filter expression by * explicitly declaring an expression (for example, e1 != e2). *

Rules for constructing valid expressions follow the Java * language, except for these differences: *

    *
  • Equality and ordering comparisons between primitives and instances * of wrapper classes are valid. *
  • Equality and ordering comparisons of Date fields and * Date parameters are valid. *
  • White space (non-printing characters space, tab, carriage * return, and line feed) is a separator and is otherwise ignored. *
  • The assignment operators =, +=, etc. and * pre- and post-increment and -decrement are not supported. Therefore, * there are no side effects from evaluation of any expressions. *
  • Methods, including object construction, are not supported, except * for Collection.contains(Object o), * Collection.isEmpty(), * String.startsWith(String s), and * String.endsWith(String e). Implementations might choose to * support non-mutating method calls as non-standard extensions. *
  • Navigation through a null-valued field, which would * throw NullPointerException, is treated as if the filter * expression returned false for the evaluation of the current * set of variable values. Other values for variables might still qualify * the candidate instance for inclusion in the result set. *
  • Navigation through multi-valued fields (Collection * types) is specified using a variable declaration and the * Collection.contains(Object o) method. *
*

Identifiers in the expression are considered to be in the name * space of the specified class, with the addition of declared imports, * parameters and variables. As in the Java language, this is a * reserved word which means the element of the collection being evaluated. *

Navigation through single-valued fields is specified by the Java * language syntax of field_name.field_name....field_name. *

A JDO implementation is allowed to reorder the filter expression * for optimization purposes. * @param filter the query filter. */ void setFilter(String filter); /** Set the import statements to be used to identify the fully qualified * name of variables or parameters. Parameters and unbound variables might * come from a different class from the candidate class, and the names * need to be declared in an import statement to eliminate ambiguity. * Import statements are specified as a String with * semicolon-separated statements. *

The String parameter to this method follows the syntax of * the import statement of the Java language. * @param imports import statements separated by semicolons. */ void declareImports(String imports); /** Declare the list of parameters query execution. * * The parameter declaration is a String containing one or more * query parameter declarations separated with commas. Each parameter named * in the parameter declaration must be bound to a value when * the query is executed. *

The String parameter to this method follows the syntax * for formal parameters in the Java language. * @param parameters the list of parameters separated by commas. */ void declareParameters(String parameters); /** Declare the unbound variables to be used in the query. Variables * might be used in the filter, and these variables must be declared * with their type. The unbound variable declaration is a * String containing one or more unbound variable declarations * separated with semicolons. It follows the syntax for local variables in * the Java language. * @param variables the variables separated by semicolons. */ void declareVariables(String variables); /** Set the ordering specification for the result Collection. * The ordering specification is a String containing one or * more ordering declarations separated by commas. * *

Each ordering declaration is the name of the field on which * to order the results followed by one of the following words: * "ascending" or "descending". * *

The field must be declared in the candidate class or must be * a navigation expression starting with a field in the candidate class. * *

Valid field types are primitive types except boolean; * wrapper types except Boolean; BigDecimal; * BigInteger; String; and Date. * @param ordering the ordering specification. */ void setOrdering(String ordering); /** Set the ignoreCache option. The default value for this option was * set by the PersistenceManagerFactory or the * PersistenceManager used to create this Query. * * The ignoreCache option setting specifies whether the query should execute * entirely in the back end, instead of in the cache. If this flag is set * to true, an implementation might be able to optimize the * query execution by ignoring changed values in the cache. For optimistic * transactions, this can dramatically improve query response times. * @param ignoreCache the setting of the ignoreCache option. */ void setIgnoreCache(boolean ignoreCache); /** Get the ignoreCache option setting. * @return the ignoreCache option setting. * @see #setIgnoreCache */ boolean getIgnoreCache(); /** Verify the elements of the query and provide a hint to the query to * prepare and optimize an execution plan. */ void compile(); /** Execute the query and return the filtered Collection. *

Cancellation of the query using cancel() will result in JDOQueryInterruptedException * being thrown here * @return the filtered Collection. * @see #executeWithArray(Object[] parameters) */ Object execute(); /** Execute the query and return the filtered Collection. *

Cancellation of the query using cancel() will result in JDOQueryInterruptedException * being thrown here * @return the filtered Collection. * @see #executeWithArray(Object[] parameters) * @param p1 the value of the first parameter declared. */ Object execute(Object p1); /** Execute the query and return the filtered Collection. *

Cancellation of the query using cancel() will result in JDOQueryInterruptedException * being thrown here * @return the filtered Collection. * @see #executeWithArray(Object[] parameters) * @param p1 the value of the first parameter declared. * @param p2 the value of the second parameter declared. */ Object execute(Object p1, Object p2); /** Execute the query and return the filtered Collection. *

Cancellation of the query using cancel() will result in JDOQueryInterruptedException * being thrown here * @return the filtered Collection. * @see #executeWithArray(Object[] parameters) * @param p1 the value of the first parameter declared. * @param p2 the value of the second parameter declared. * @param p3 the value of the third parameter declared. */ Object execute(Object p1, Object p2, Object p3); /** Execute the query and return the filtered Collection. The * query is executed with the parameters set by the Map values. * Each Map entry consists of a key which is the name of the * parameter in the declareParameters method, and a value which * is the value used in the execute method. The keys in the * Map and the declared parameters must exactly match or a * JDOUserException is thrown. *

Cancellation of the query using cancel() will result in JDOQueryInterruptedException * being thrown here * @return the filtered Collection. * @see #executeWithArray(Object[] parameters) * @param parameters the Map containing all of the parameters. */ Object executeWithMap (Map parameters); /** Execute the query and return the filtered Collection. * *

The execution of the query obtains the values of the parameters and * matches them against the declared parameters in order. The names * of the declared parameters are ignored. The type of * the declared parameters must match the type of the passed parameters, * except that the passed parameters might need to be unwrapped to get * their primitive values. * *

The filter, import, declared parameters, declared variables, and * ordering statements are verified for consistency. * *

Each element in the candidate Collection is examined to * see that it is assignment compatible to the Class of the * query. It is then evaluated by the Boolean expression of the filter. * The element passes the filter if there exist unique values for all * variables for which the filter expression evaluates to true. *

Cancellation of the query using cancel() will result in JDOQueryInterruptedException * being thrown here * @return the filtered Collection. * @param parameters the Object array with all of the * parameters. */ Object executeWithArray (Object... parameters); /** Get the PersistenceManager associated with this * Query. * *

If this Query was restored from a serialized form, it has * no PersistenceManager, and this method returns * null. * @return the PersistenceManager associated with this * Query. */ PersistenceManager getPersistenceManager(); /** Close a query result and release any resources associated with it. The * parameter is the return from execute(...) and might have * iterators open on it. Iterators associated with the query result are * invalidated: they return false to hasNext() * and throw NoSuchElementException to next(). * @param queryResult the result of execute(...) on this * Query instance. */ void close (Object queryResult); /** Close all query results associated with this Query * instance, and release all resources associated with them. The query * results might have iterators open on them. Iterators associated with the * query results are invalidated: * they return false to hasNext() and throw * NoSuchElementException to next(). */ void closeAll (); /** * Set the grouping expressions, optionally including a "having" * clause. When grouping is specified, each result expression * must either be an expression contained in the grouping, or an * aggregate evaluated once per group. * * @param group a comma-delimited list of expressions, optionally * followed by the "having" keyword and a boolean expression * @since 2.0 */ void setGrouping (String group); /** * Specify that only the first result of the query should be * returned, rather than a collection. The execute method will * return null if the query result size is 0. * @since 2.0 * @param unique if true, only one element is returned */ void setUnique (boolean unique); /** * Specifies what type of data this query should return. If this * is unset or set to null, this query returns * instances of the query's candidate class. If set, this query * will return expressions, including field values (projections) and * aggregate function results. * @param data a comma-delimited list of expressions * (fields, functions on fields, or aggregate functions) * to return from this query * @since 2.0 */ void setResult (String data); /** * Specify the type of object in which to return each element of * the result of invoking {@link #execute} or one of its siblings. * If the result is not set or set to null, the result class defaults * to the candidate class of the query. If the result consists of one * expression, the result class defaults to the type of that expression. * If the result consists of more than one expression, the result class * defaults to Object[]. * The result class may be specified to be one of the java.lang classes * Character, Boolean, Byte, Short, Integer, Long, Float, Double, String, * or Object[]; or one of the java.math classes BigInteger or BigDecimal; * or the java.util class Date; or one of the java.sql classes Date, * Time, or Timestamp; or a user-defined class. *

If there are multiple result expressions, the result class * must be able to hold all elements of the result specification * or a JDOUserException is thrown. *

If there is only one result expression, the result class must be * assignable from the type of the result expression or must be able * to hold all elements of the result specification. A single value * must be able to be coerced into the specified result class * (treating wrapper classes as equivalent to their unwrapped * primitive types) or by matching. If the result class does not satisfy * these conditions, a JDOUserException is thrown. *

A constructor of a result class specified in the setResult method * will be used if the results specification matches the parameters * of the constructor by position and type. If more than one constructor * satisfies the requirements, the JDO implementation chooses one of them. * If no constructor satisfies the results requirements, or if the result * class is specified via the setResultClass method, the following * requirements apply: *

    *
  • A user-defined result class must have a no-args constructor and * one or more public set or put methods or * fields. *
  • Each result expression must match one of: *
      *
    • a public field that matches the name of the result expression * and is of the type (treating wrapper types equivalent to primitive * types) of the result expression; *
    • or if no public field matches the name and type, a public * setor if neither of the above applies,a public method must be found * with the signature void put(Object, Object). * During processing of the results, * the first argument is the name of the result expression and * the second argument is the value from the query result. *
    *
* Portable result classes do not invoke any persistence behavior * during their no-args constructor or setsetRange("50, 70");
or * setRange(":from, :to"); or * setRange("50, :to");. * The execution of the query is * modified to return only a subset of results. If the filter would * normally return 100 instances, and fromIncl is set to 50, and * toExcl is set to 70, then the first 50 results that would have * been returned are skipped, the next 20 results are returned and the * remaining 30 results are ignored. An implementation should execute * the query such that the range algorithm is done at the data store. * @param fromInclToExcl comma-separated fromIncl and toExcl values * @see #setRange(long, long) * @since 2.0 */ void setRange (String fromInclToExcl); /** * Add a vendor-specific extension to this query. The key and value * are not standard. * An implementation must ignore keys that are not recognized. * @param key the key of the extension * @param value the value of the extension * @since 2.0 */ void addExtension (String key, Object value); /** * Set multiple extensions, or use null to clear all extensions. * Map keys and values are not standard. * An implementation must ignore entries that are not recognized. * @param extensions the map of extensions * @see #addExtension * @since 2.0 */ void setExtensions (Map extensions); /** * Returns the FetchPlan used by this * Query. Modifications of the returned fetch plan will not * cause this query's owning PersistenceManager's * FetchPlan to be modified. * @since 2.0 * @return the fetch plan used by this query */ FetchPlan getFetchPlan (); /** * Deletes all the instances of the candidate class that pass the * filter. * @see #deletePersistentAll() * @param parameters for the query * @return the number of instances of the candidate class that were deleted * @since 2.0 */ long deletePersistentAll (Object... parameters); /** * Deletes all the instances of the candidate class that pass the * filter. * @see #deletePersistentAll() * @param parameters for the query * @return the number of instances of the candidate class that were deleted * @since 2.0 */ long deletePersistentAll (Map parameters); /** * Deletes all the instances of the candidate class that pass the * filter. Returns the number of instances of the candidate * class that were deleted, specifically not including the number * of dependent and embedded instances. *

Dirty instances of affected classes in the cache are first * flushed to the datastore. Instances in the cache or brought into * the cache as a result of executing one of the * deletePersistentAll * methods undergo life cycle changes as if deletePersistent * were called on them. *

Specifically, if the class of deleted instances implements the * delete callback interface, the corresponding callback methods * are called on the deleted instances. Similarly, if there are * lifecycle listeners registered for delete events on affected * classes, the listener is called for each appropriate deleted instance. *

Before returning control to the application, instances of affected * classes in the cache are refreshed to reflect whether they were * deleted from the datastore. * * @return the number of instances of the candidate class that were deleted * @since 2.0 */ long deletePersistentAll (); /** * The unmodifiable flag, when set, disallows further * modification of the query, except for specifying the range, * result class, and ignoreCache option. * The unmodifiable flag can also be set in metadata. * @since 2.0 */ void setUnmodifiable(); /** * The unmodifiable flag, when set, disallows further * modification of the query, except for specifying the range, * result class, and ignoreCache option. * @return the current setting of the flag * @since 2.0 */ boolean isUnmodifiable(); /** * Add a subquery to this query. * @param sub the subquery to add to this Query * @param variableDeclaration the name of the variable in the outer query * to bind the results of the subquery * @param candidateCollectionExpression the candidate collection * of the subquery as an expression using terms of the outer query * @see #addSubquery(Query sub, String variableDeclaration, * String candidateCollectionExpression, String... parameters) * @since 2.1 */ void addSubquery (Query sub, String variableDeclaration, String candidateCollectionExpression); /** * Add a subquery to this query. * The String version of the method binds the named expression * to the parameter implictly or explicitly declared in the * subquery. * @param sub the subquery to add to this Query * @param variableDeclaration the name of the variable * to be used in this Query * @param candidateCollectionExpression the candidate collection * to apply to the subquery * @param parameter the expression from the outer query to bind * the parameter in the subquery * @see #addSubquery(Query sub, String variableDeclaration, * String candidateCollectionExpression, String... parameters) * @since 2.1 */ void addSubquery (Query sub, String variableDeclaration, String candidateCollectionExpression, String parameter); /** * Add a subquery to this query. * A subquery is composed as a Query and subsequently attached * to a different query (the outer query) by calling this method. * The query parameter instance is unmodified as a result of the * addSubquery or subsequent execution of the outer query. * Only some of the query parts are copied for use as the subquery. * The parts copied include the candidate class, filter, parameter * declarations, variable declarations, imports, ordering specification, * uniqueness, result specification, and grouping specification. * The association with a PersistenceManager, the candidate collection * or extent, result class, and range limits are not used. * The String parameters are trimmed of white space. * The variableDeclaration parameter is the name of the variable * containing the results of the subquery execution. If the same value * of variableDeclaration is used to add multiple subqueries, the * subquery replaces the previous subquery for the same named variable. * If the subquery parameter is null, the variable is unset, * effectively making the variable named in the variableDeclaration * unbound. If the trimmed value is the empty String, or the parameter * is null, then JDOUserException is thrown. * The candidateCollectionExpression is the expression from the * outer query that represents the candidates over which the subquery * is evaluated. If the trimmed value is the empty String, or the * parameter is null, then the candidate collection is the extent * of the candidate class. * The String... version of the method binds the named expressions in * turn to parameters in the order in which they are declared in the * subquery, or in the order they are found in the filter if not * explicitly declared in the subquery. * @param sub the subquery to add to this Query * @param variableDeclaration the name of the variable in the outer query * to bind the results of the subquery * @param candidateCollectionExpression the candidate collection * of the subquery as an expression using terms of the outer query * @param parameters the expressions from the outer query to bind * the parameters in the subquery * @since 2.1 */ void addSubquery (Query sub, String variableDeclaration, String candidateCollectionExpression, String... parameters); /** * Add a subquery to this query. * The Map version of the method treats the key of each map entry as * the name of the parameter in the subquery, with or without the * leading ":", and the value as the name of the expression in the * outer query. If the trimmed expression is the empty String for * either the parameter or the value of the String[], or for any * map key or value, that expression is ignored. * @param sub the subquery to add to this Query * @param variableDeclaration the name of the variable * to be used in this Query * @param candidateCollectionExpression the candidate collection * to apply to the subquery * @param parameters the expressions from the outer query to bind * the parameter in the subquery * @see #addSubquery(Query sub, String variableDeclaration, * String candidateCollectionExpression, String... parameters) * @since 2.1 */ void addSubquery (Query sub, String variableDeclaration, String candidateCollectionExpression, Map parameters); /** * Specify a timeout interval (milliseconds) for any read operations * associated with this query. To unset the explicit timeout for this * query, specify null. For no timeout, specify 0. * If the datastore granularity is larger than milliseconds, the * timeout value will be rounded up to the nearest supported datastore * value. * If a read operation hasn't completed within this interval, executeXXX * will throw a JDODatastoreException. * If multiple datastore operations are required to complete the query, * the timeout value applies to each of them individually. * If the datastore and JDO implementation support timeouts, then * javax.jdo.option.DatastoreTimeout is returned by * PersistenceManagerFactory.supportedOptions(). * If timeouts are not supported,this method will throw * JDOUnsupportedOptionException. * @since 3.0 * @param interval the timeout interval (milliseconds) */ void setDatastoreReadTimeoutMillis(Integer interval); /** Get the effective timeout setting for read operations. * If the timeout has not been set on this query explicitly, the effective * datastore read timeout value from the persistence manager is returned. * @see #setDatastoreReadTimeoutMillis(Integer) * @see PersistenceManager#setDatastoreReadTimeoutMillis(Integer) * @return the effective timeout setting (milliseconds). * @since 3.0 */ Integer getDatastoreReadTimeoutMillis(); /** * Specify a timeout interval (milliseconds) for any write operations * associated with this query. To unset the explicit timeout for this * query, specify null. For no timeout, specify 0. * If the datastore granularity is larger than milliseconds, the * timeout value will be rounded up to the nearest supported datastore * value. * If a write operation hasn't completed within this interval, deleteXXX * will throw a JDODatastoreException. * If multiple datastore operations are required to complete the query, * the timeout value applies to each of them individually. * If the datastore and JDO implementation support timeouts, then * javax.jdo.option.DatastoreTimeout is returned by * PersistenceManagerFactory.supportedOptions(). * If timeouts are not supported,this method will throw * JDOUnsupportedOptionException. * @since 3.0 * @param interval the timeout interval (milliseconds) */ void setDatastoreWriteTimeoutMillis(Integer interval); /** Get the effective timeout setting for write operations. * If the timeout has not been set on this query explicitly, the effective * datastore write timeout value from the persistence manager is returned. * @see #setDatastoreWriteTimeoutMillis(Integer) * @see PersistenceManager#setDatastoreWriteTimeoutMillis(Integer) * @return the effective timeout setting (milliseconds). * @since 3.0 */ Integer getDatastoreWriteTimeoutMillis(); /** * Method to cancel any executing queries. * If the underlying datastore doesn't support cancellation of queries this will * throw JDOUnsupportedOptionException. * If the cancellation fails (e.g in the underlying datastore) then this will throw * a JDOException. * @since 3.0 */ void cancelAll(); /** * Method to cancel an executing query in the specified thread. * If the underlying datastore doesn't support cancellation of queries this will * throw JDOUnsupportedOptionException. * If the cancellation fails (e.g in the underlying datastore) then this will throw * a JDOException. * @since 3.0 */ void cancel(Thread thread); /** * If true, a lock will be applied to all objects read in this * query. *

If false then retrieved objects will not be locked. * If null will fallback to the value for metadata for the class in question. * @param serialize the value of the serializeRead property * @since 3.0 */ void setSerializeRead(Boolean serialize); /** * Return the current value of the serializeRead property. * @return the value of the serializeRead property * @since 3.0 */ Boolean getSerializeRead(); } api/src/java/javax/jdo/spi/Detachable.java100664 4043 12500110371 20706 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.spi; /** * This interface is implemented by classes that can be detached from the * persistence context and later attached. The interface includes the * contract by which the StateManager can set the object id, version, * BitSet of loaded fields, and BitSet of modified fields * so they are preserved while outside the persistence environment. *

The detached state is stored as a field in each instance of Detachable. * The field is serialized so as to maintain the state of the instance * while detached. While detached, only the BitSet of modified fields * will be modified. The structure of the Object[] jdoDetachedState * is as follows: *

  • jdoDetachedState[0]: the Object Id of the instance *
  • jdoDetachedState[1]: the Version of the instance *
  • jdoDetachedState[2]: a BitSet of loaded fields *
  • jdoDetachedState[3]: a BitSet of modified fields *
* @version 2.0 */ public interface Detachable { /** This method calls the StateManager with the current detached * state instance as a parameter and replaces the current detached * state instance with the value provided by the StateManager. * @since 2.0 */ public void jdoReplaceDetachedState(); } api/src/java/javax/jdo/spi/I18NHelper.java100664 33504 12500110371 20535 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.spi; import java.util.*; import java.text.MessageFormat; import java.security.AccessController; import java.security.PrivilegedAction; import javax.jdo.JDOFatalInternalException; /** Helper class for constructing messages from bundles. The intended usage * of this class is to construct a new instance bound to a bundle, as in *

* I18NHelper msg = I18NHelper.getInstance("javax.jdo.Bundle"); *

* This call uses the class loader that loaded the I18NHelper class to find * the specified Bundle. The class provides two overloaded getInstance * methods allowing to specify a different class loader: * {@link #getInstance(Class cls)} looks for a bundle * called "Bundle.properties" located in the package of the specified class * object and {@link #getInstance(String bundleName,ClassLoader loader)} * uses the specified class loader to find the bundle. *

* Subsequently, instance methods can be used to format message strings * using the text from the bundle, as in *

* throw new JDOFatalInternalException (msg.msg("ERR_NoMetadata", * cls.getName())); * @since 1.0.1 * @version 1.1 */ public class I18NHelper { /** Bundles that have already been loaded */ private static Hashtable bundles = new Hashtable(); /** Helper instances that have already been created */ private static Hashtable helpers = new Hashtable(); /** The default locale for this VM. */ private static Locale locale = Locale.getDefault(); /** The bundle used by this instance of the helper. */ private ResourceBundle bundle = null; /** Throwable if ResourceBundle couldn't be loaded */ private Throwable failure = null; /** The unqualified standard name of a bundle. */ private static final String bundleSuffix = ".Bundle"; // NOI18N /** Constructor */ private I18NHelper() { } /** Constructor for an instance bound to a bundle. * @param bundleName the name of the resource bundle * @param loader the class loader from which to load the resource * bundle */ private I18NHelper (String bundleName, ClassLoader loader) { try { bundle = loadBundle (bundleName, loader); } catch (Throwable e) { failure = e; } } /** An instance bound to a bundle. This method uses the current class * loader to find the bundle. * @param bundleName the name of the bundle * @return the helper instance bound to the bundle */ public static I18NHelper getInstance (String bundleName) { return getInstance (bundleName, I18NHelper.class.getClassLoader()); } /** An instance bound to a bundle. This method figures out the bundle name * for the class object's package and uses the class' class loader to * find the bundle. Note, the specified class object must not be * null. * @param cls the class object from which to load the resource bundle * @return the helper instance bound to the bundle */ public static I18NHelper getInstance (final Class cls) { ClassLoader classLoader = AccessController.doPrivileged ( new PrivilegedAction () { public ClassLoader run () { return cls.getClassLoader(); } } ); String bundle = getPackageName (cls.getName()) + bundleSuffix; return getInstance (bundle, classLoader); } /** An instance bound to a bundle. This method uses the specified class * loader to find the bundle. Note, the specified class loader must not * be null. * @param bundleName the name of the bundle * @param loader the class loader from which to load the resource * bundle * @return the helper instance bound to the bundle */ public static I18NHelper getInstance (String bundleName, ClassLoader loader) { I18NHelper helper = (I18NHelper) helpers.get (bundleName); if (helper != null) { return helper; } helper = new I18NHelper(bundleName, loader); helpers.put (bundleName, helper); // if two threads simultaneously create the same helper, return the first // one to be put into the Hashtable. The other will be garbage collected. return (I18NHelper) helpers.get (bundleName); } /** Message formatter * @param messageKey the message key * @return the resolved message text */ public String msg (String messageKey) { assertBundle (messageKey); return getMessage (bundle, messageKey); } /** Message formatter * @param messageKey the message key * @param arg1 the first argument * @return the resolved message text */ public String msg (String messageKey, Object arg1) { assertBundle (messageKey); return getMessage (bundle, messageKey, arg1); } /** Message formatter * @param messageKey the message key * @param arg1 the first argument * @param arg2 the second argument * @return the resolved message text */ public String msg (String messageKey, Object arg1, Object arg2) { assertBundle (messageKey); return getMessage (bundle, messageKey, arg1, arg2); } /** Message formatter * @param messageKey the message key * @param arg1 the first argument * @param arg2 the second argument * @param arg3 the third argument * @return the resolved message text */ public String msg (String messageKey, Object arg1, Object arg2, Object arg3) { assertBundle (messageKey); return getMessage (bundle, messageKey, arg1, arg2, arg3); } /** Message formatter * @param messageKey the message key * @param args the array of arguments * @return the resolved message text */ public String msg (String messageKey, Object[] args) { assertBundle (messageKey); return getMessage (bundle, messageKey, args); } /** Message formatter * @param messageKey the message key * @param arg the argument * @return the resolved message text */ public String msg (String messageKey, int arg) { assertBundle (messageKey); return getMessage(bundle, messageKey, arg); } /** Message formatter * @param messageKey the message key * @param arg the argument * @return the resolved message text */ public String msg (String messageKey, boolean arg) { assertBundle (messageKey); return getMessage(bundle, messageKey, arg); } /** Returns the resource bundle used by this I18NHelper. * @return the associated resource bundle * @since 1.1 */ public ResourceBundle getResourceBundle () { assertBundle (); return bundle; } //========= Internal helper methods ========== /** * Load ResourceBundle by bundle name * @param bundleName the name of the bundle * @param loader the class loader from which to load the resource bundle * @return the ResourceBundle */ final private static ResourceBundle loadBundle( String bundleName, ClassLoader loader) { ResourceBundle messages = (ResourceBundle)bundles.get(bundleName); if (messages == null) //not found as loaded - add { if (loader != null) { messages = ResourceBundle.getBundle(bundleName, locale, loader); } else { // the JDO library is loaded by the boostrap class loader messages = ResourceBundle.getBundle(bundleName, locale, getSystemClassLoaderPrivileged()); } bundles.put(bundleName, messages); } return messages; } /** Assert resources available * @since 1.1 * @throws JDOFatalInternalException if the resource bundle could not * be loaded during construction. */ private void assertBundle () { if (failure != null) throw new JDOFatalInternalException ( "No resources could be found for bundle:\"" + bundle + "\" ", failure); } /** Assert resources available * @param key the message key * @since 1.0.2 * @throws JDOFatalInternalException if the resource bundle could not * be loaded during construction. */ private void assertBundle (String key) { if (failure != null) throw new JDOFatalInternalException ( "No resources could be found to annotate error message key:\"" + key + "\"", failure); } /** * Returns message as String * @param messages the resource bundle * @param messageKey the message key * @return the resolved message text */ final private static String getMessage(ResourceBundle messages, String messageKey) { return messages.getString(messageKey); } /** * Formats message by adding array of arguments * @param messages the resource bundle * @param messageKey the message key * @param msgArgs an array of arguments to substitute into the message * @return the resolved message text */ final private static String getMessage(ResourceBundle messages, String messageKey, Object[] msgArgs) { for (int i=0; iObject argument. * @param messages the resource bundle * @param messageKey the message key * @param arg the argument * @return the resolved message text */ final private static String getMessage(ResourceBundle messages, String messageKey, Object arg) { Object []args = {arg}; return getMessage(messages, messageKey, args); } /** * Formats message by adding two Object arguments. * @param messages the resource bundle * @param messageKey the message key * @param arg1 the first argument * @param arg2 the second argument * @return the resolved message text */ final private static String getMessage(ResourceBundle messages, String messageKey, Object arg1, Object arg2) { Object []args = {arg1, arg2}; return getMessage(messages, messageKey, args); } /** * Formats message by adding three Object arguments. * @param messages the resource bundle * @param messageKey the message key * @param arg1 the first argument * @param arg2 the second argument * @param arg3 the third argument * @return the resolved message text */ final private static String getMessage(ResourceBundle messages, String messageKey, Object arg1, Object arg2, Object arg3) { Object []args = {arg1, arg2, arg3}; return getMessage(messages, messageKey, args); } /** * Formats message by adding an int as an argument. * @param messages the resource bundle * @param messageKey the message key * @param arg the argument * @return the resolved message text */ final private static String getMessage(ResourceBundle messages, String messageKey, int arg) { Object []args = {new Integer(arg)}; return getMessage(messages, messageKey, args); } /** * Formats message by adding a boolean as an argument. * @param messages the resource bundle * @param messageKey the message key * @param arg the argument * @return the resolved message text */ final private static String getMessage(ResourceBundle messages, String messageKey, boolean arg) { Object []args = {String.valueOf(arg)}; return getMessage(messages, messageKey, args); } /** * Returns the package portion of the specified class. * @param className the name of the class from which to extract the * package * @return package portion of the specified class */ final private static String getPackageName(final String className) { final int index = className.lastIndexOf('.'); return ((index != -1) ? className.substring(0, index) : ""); // NOI18N } /** * Get the system class loader. This must be done in a doPrivileged * block because of security. */ private static ClassLoader getSystemClassLoaderPrivileged() { return AccessController.doPrivileged ( new PrivilegedAction () { public ClassLoader run () { return ClassLoader.getSystemClassLoader(); } } ); } } api/src/java/javax/jdo/spi/JDOImplHelper.java100664 141715 12500110371 21340 0ustarmbouschenstaff 0 0 /* * 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. */ /* * JDOImplHelper.java * */ package javax.jdo.spi; import org.xml.sax.ErrorHandler; import java.lang.reflect.Constructor; import java.security.AccessController; import java.security.PrivilegedAction; import java.text.DateFormat; import java.text.ParsePosition; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.Currency; import java.util.Date; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.Set; import java.util.WeakHashMap; import javax.jdo.Constants; import javax.jdo.JDOException; import javax.jdo.JDOFatalInternalException; import javax.jdo.JDOFatalUserException; import javax.jdo.JDOHelper; import javax.jdo.JDOUserException; import javax.xml.parsers.DocumentBuilderFactory; /** This class is a helper class for JDO implementations. It contains methods * to register metadata for persistence-capable classes and to perform common * operations needed by implementations, not by end users. *

JDOImplHelper allows construction of instances of * persistence-capable classes without using reflection. *

Persistence-capable classes register themselves via a static method * at class load time. * There is no security restriction on this access. JDO implementations * get access to the functions provided by this class only if they are * authorized by the security manager. To avoid having every call go through * the security manager, only the call to get an instance is checked. Once an * implementation * has an instance, any of the methods can be invoked without security checks. * @version 2.1 * */ public class JDOImplHelper extends java.lang.Object { /** This synchronized HashMap contains a static mapping of * PersistenceCapable class to * metadata for the class used for constructing new instances. New entries * are added by the static method in each PersistenceCapable * class. Entries are never removed. */ private static Map registeredClasses = Collections.synchronizedMap(new HashMap ()); /** This Set contains all classes that have registered for setStateManager * permissions via authorizeStateManagerClass. * Only the key is used in order to maintain a weak set of classes. */ private static final Map authorizedStateManagerClasses = new WeakHashMap(); /** This list contains the registered listeners for * RegisterClassEvents. */ private static final List listeners = new ArrayList(); /** The list of registered StateInterrogation instances */ private static List stateInterrogations = new ArrayList(); /** The singleton JDOImplHelper instance. */ private static JDOImplHelper jdoImplHelper = new JDOImplHelper(); /** The Internationalization message helper. */ private final static I18NHelper msg = I18NHelper.getInstance ("javax.jdo.Bundle"); //NOI18N /** The DateFormat pattern. */ private static String dateFormatPattern; /** The default DateFormat instance. */ private static DateFormat dateFormat; /** * The DocumentBuilderFactory used during jdoconfig.xml parsing. */ private static DocumentBuilderFactory documentBuilderFactory; /** * The ErrorHandler used during jdoconfig.xml parsing. */ private static ErrorHandler errorHandler; /** * JDO standard properties that the user can configure. */ public static final Set USER_CONFIGURABLE_STANDARD_PROPERTIES = createUserConfigurableStandardProperties(); private static Set createUserConfigurableStandardProperties() { Set props = new HashSet(); props.add(Constants.PROPERTY_CONNECTION_DRIVER_NAME); props.add(Constants.PROPERTY_CONNECTION_FACTORY2_NAME); props.add(Constants.PROPERTY_CONNECTION_FACTORY_NAME); props.add(Constants.PROPERTY_CONNECTION_PASSWORD); props.add(Constants.PROPERTY_CONNECTION_URL); props.add(Constants.PROPERTY_CONNECTION_USER_NAME); props.add(Constants.PROPERTY_COPY_ON_ATTACH); props.add(Constants.PROPERTY_DATASTORE_READ_TIMEOUT_MILLIS); props.add(Constants.PROPERTY_DATASTORE_WRITE_TIMEOUT_MILLIS); props.add(Constants.PROPERTY_DETACH_ALL_ON_COMMIT); props.add(Constants.PROPERTY_IGNORE_CACHE); props.add(Constants.PROPERTY_INSTANCE_LIFECYCLE_LISTENER); props.add(Constants.PROPERTY_MAPPING); props.add(Constants.PROPERTY_MAPPING_CATALOG); props.add(Constants.PROPERTY_MAPPING_SCHEMA); props.add(Constants.PROPERTY_MULTITHREADED); props.add(Constants.PROPERTY_NAME); props.add(Constants.PROPERTY_NONTRANSACTIONAL_READ); props.add(Constants.PROPERTY_NONTRANSACTIONAL_WRITE); props.add(Constants.PROPERTY_OPTIMISTIC); props.add(Constants.PROPERTY_PERSISTENCE_MANAGER_FACTORY_CLASS); props.add(Constants.PROPERTY_PERSISTENCE_UNIT_NAME); props.add(Constants.PROPERTY_READONLY); props.add(Constants.PROPERTY_RESTORE_VALUES); props.add(Constants.PROPERTY_RETAIN_VALUES); props.add(Constants.PROPERTY_SERVER_TIME_ZONE_ID); props.add(Constants.PROPERTY_SPI_RESOURCE_NAME); props.add(Constants.PROPERTY_TRANSACTION_ISOLATION_LEVEL); props.add(Constants.PROPERTY_TRANSACTION_TYPE); return Collections.unmodifiableSet(props); } static final String JAVAX_JDO_PREFIX_LOWER_CASED = Constants.JAVAX_JDO_PREFIX.toLowerCase(); static final String PROPERTY_PREFIX_INSTANCE_LIFECYCLE_LISTENER_LOWER_CASED = Constants.PROPERTY_PREFIX_INSTANCE_LIFECYCLE_LISTENER.toLowerCase(); static final Set USER_CONFIGURABLE_STANDARD_PROPERTIES_LOWER_CASED = createUserConfigurableStandardPropertiesLowerCased(); static Set createUserConfigurableStandardPropertiesLowerCased() { Set mixedCased = createUserConfigurableStandardProperties(); Set lowerCased = new HashSet(mixedCased.size()); for (String propertyName : mixedCased) { lowerCased.add(propertyName.toLowerCase()); } return Collections.unmodifiableSet(lowerCased); } /** Register the default DateFormat instance. */ static { jdoImplHelper.registerDateFormat(getDateTimeInstance()); } /** Creates new JDOImplHelper */ private JDOImplHelper() { } /** Get an instance of JDOImplHelper. This method * checks that the caller is authorized for * JDOPermission("getMetadata"), and if not, throws * SecurityException. * @return an instance of JDOImplHelper. * @throws SecurityException if the caller is not authorized for * JDOPermission("getMetadata"). */ public static JDOImplHelper getInstance() throws SecurityException { SecurityManager sec = System.getSecurityManager(); if (sec != null) { // throws exception if caller is not authorized sec.checkPermission (JDOPermission.GET_METADATA); } return jdoImplHelper; } /** Get the field names for a PersistenceCapable class. The * order of fields is the natural ordering of the String class * (without considering localization). * @param pcClass the PersistenceCapable class. * @return the field names for the class. */ public String[] getFieldNames (Class pcClass) { Meta meta = getMeta (pcClass); return meta.getFieldNames(); } /** Get the field types for a PersistenceCapable class. The * order of fields is the same as for field names. * @param pcClass the PersistenceCapable class. * @return the field types for the class. */ public Class[] getFieldTypes (Class pcClass) { Meta meta = getMeta (pcClass); return meta.getFieldTypes(); } /** Get the field flags for a PersistenceCapable class. The * order of fields is the same as for field names. * @param pcClass the PersistenceCapable class. * @return the field types for the class. */ public byte[] getFieldFlags (Class pcClass) { Meta meta = getMeta (pcClass); return meta.getFieldFlags(); } /** Get the persistence-capable superclass for a * PersistenceCapable class. * @param pcClass the PersistenceCapable class. * @return The PersistenceCapable superclass for this class, * or null if there isn't one. */ public Class getPersistenceCapableSuperclass (Class pcClass) { Meta meta = getMeta (pcClass); return meta.getPersistenceCapableSuperclass(); } /** Create a new instance of the class and assign its * jdoStateManager. The new instance has its * jdoFlags set to LOAD_REQUIRED. * @see PersistenceCapable#jdoNewInstance(StateManager sm) * @param pcClass the PersistenceCapable class. * @param sm the StateManager which will own the new instance. * @return the new instance, or null if the class is not * registered. */ public PersistenceCapable newInstance (Class pcClass, StateManager sm) { Meta meta = getMeta (pcClass); PersistenceCapable pcInstance = meta.getPC(); return pcInstance == null?null:pcInstance.jdoNewInstance(sm); } /** Create a new instance of the class and assign its * jdoStateManager and key values from the ObjectId. If the * oid parameter is null, no key values are copied. * The new instance has its jdoFlags set to * LOAD_REQUIRED. * @see PersistenceCapable#jdoNewInstance(StateManager sm, Object oid) * @param pcClass the PersistenceCapable class. * @param sm the StateManager which will own the new instance. * @return the new instance, or null if the class is not * registered. * @param oid the ObjectId instance from which to copy key field values. */ public PersistenceCapable newInstance (Class pcClass, StateManager sm, Object oid) { Meta meta = getMeta (pcClass); PersistenceCapable pcInstance = meta.getPC(); return pcInstance == null?null:pcInstance.jdoNewInstance(sm, oid); } /** Create a new instance of the ObjectId class of this * PersistenceCapable class. * It is intended only for application identity. This method should * not be called for classes that use single field identity; * newObjectIdInstance(Class, Object) should be used instead. * If the class has been * enhanced for datastore identity, or if the class is abstract, * null is returned. * @param pcClass the PersistenceCapable class. * @return the new ObjectId instance, or null if the class * is not registered. */ public Object newObjectIdInstance (Class pcClass) { Meta meta = getMeta (pcClass); PersistenceCapable pcInstance = meta.getPC(); return pcInstance == null?null:pcInstance.jdoNewObjectIdInstance(); } /** Create a new instance of the class used by the parameter Class * for JDO identity, using the * key constructor of the object id class. It is intended for single * field identity. The identity * instance returned has no relationship with the values of the primary key * fields of the persistence-capable instance on which the method is called. * If the key is the wrong class for the object id class, null is returned. *

For classes that use single field identity, if the parameter is * of one of the following types, the behavior must be as specified: *

  • Number or Character: the * parameter must be the single field * type or the wrapper class of the primitive field type; the parameter * is passed to the single field identity constructor *
  • ObjectIdFieldSupplier: the field value * is fetched from the ObjectIdFieldSupplier and passed to the * single field identity constructor *
  • String: the String is passed to the * single field identity constructor *
* @return the new ObjectId instance, or null * if the class is not registered. * @param obj the Object form of the object id * @param pcClass the PersistenceCapable class. * @since 2.0 */ public Object newObjectIdInstance (Class pcClass, Object obj) { Meta meta = getMeta (pcClass); PersistenceCapable pcInstance = meta.getPC(); return (pcInstance == null)?null:pcInstance.jdoNewObjectIdInstance(obj); } /** Copy fields from an outside source to the key fields in the ObjectId. * This method is generated in the PersistenceCapable class to * generate a call to the field manager for each key field in the ObjectId. *

For example, an ObjectId class that has three key fields * (int id, String name, and * Float salary) would have the method generated: *

* void jdoCopyKeyFieldsToObjectId (Object oid, ObjectIdFieldSupplier fm) { *
oid.id = fm.fetchIntField (0); *
oid.name = fm.fetchStringField (1); *
oid.salary = fm.fetchObjectField (2); *
}
*

The implementation is responsible for implementing the * ObjectIdFieldSupplier to provide the values for the key * fields. * @param pcClass the PersistenceCapable Class. * @param oid the ObjectId target of the copy. * @param fm the field manager that supplies the field values. */ public void copyKeyFieldsToObjectId (Class pcClass, PersistenceCapable.ObjectIdFieldSupplier fm, Object oid) { Meta meta = getMeta (pcClass); PersistenceCapable pcInstance = meta.getPC(); if (pcInstance == null) { throw new JDOFatalInternalException (msg.msg( "ERR_AbstractClassNoIdentity", pcClass.getName())); //NOI18N } pcInstance.jdoCopyKeyFieldsToObjectId(fm, oid); } /** Copy fields to an outside source from the key fields in the ObjectId. * This method is generated in the PersistenceCapable class to * generate a call to the field manager for each key field in the ObjectId. * For example, an ObjectId class that has three key fields * (int id, String name, and * Float salary) would have the method generated: *

void jdoCopyKeyFieldsFromObjectId *
(PersistenceCapable oid, ObjectIdFieldConsumer fm) { *
fm.storeIntField (0, oid.id); *
fm.storeStringField (1, oid.name); *
fm.storeObjectField (2, oid.salary); *
}
*

The implementation is responsible for implementing the * ObjectIdFieldConsumer to store the values for the key * fields. * @param pcClass the PersistenceCapable class * @param oid the ObjectId source of the copy. * @param fm the field manager that receives the field values. */ public void copyKeyFieldsFromObjectId (Class pcClass, PersistenceCapable.ObjectIdFieldConsumer fm, Object oid) { Meta meta = getMeta (pcClass); PersistenceCapable pcInstance = meta.getPC(); if (pcInstance == null) { throw new JDOFatalInternalException (msg.msg( "ERR_AbstractClassNoIdentity", pcClass.getName())); //NOI18N } pcInstance.jdoCopyKeyFieldsFromObjectId(fm, oid); } /** Register metadata by class. The registration will be done in the * class named JDOImplHelper loaded by the same or an * ancestor class loader as the PersistenceCapable class * performing the registration. * * @param pcClass the PersistenceCapable class * used as the key for lookup. * @param fieldNames an array of String field names for * persistent and transactional fields * @param fieldTypes an array of Class field types * @param fieldFlags the Field Flags for persistent and transactional fields * @param pc an instance of the PersistenceCapable class * @param persistenceCapableSuperclass the most immediate superclass that is * PersistenceCapable */ public static void registerClass (Class pcClass, String[] fieldNames, Class[] fieldTypes, byte[] fieldFlags, Class persistenceCapableSuperclass, PersistenceCapable pc) { if (pcClass == null) throw new NullPointerException(msg.msg("ERR_NullClass")); //NOI18N Meta meta = new Meta (fieldNames, fieldTypes, fieldFlags, persistenceCapableSuperclass, pc); registeredClasses.put (pcClass, meta); // handle class registration listeners synchronized (listeners) { if (!listeners.isEmpty()) { RegisterClassEvent event = new RegisterClassEvent( jdoImplHelper, pcClass, fieldNames, fieldTypes, fieldFlags, persistenceCapableSuperclass); for (Iterator i = listeners.iterator(); i.hasNext();) { RegisterClassListener crl = (RegisterClassListener)i.next(); if (crl != null) { crl.registerClass(event); } } } } } /** * Unregister metadata by class loader. This method unregisters all * registered PersistenceCapable classes loaded by the * specified class loader. Any attempt to get metadata for unregistered * classes will result in a JDOFatalUserException. * @param cl the class loader. * @since 1.0.2 */ public void unregisterClasses (ClassLoader cl) { SecurityManager sec = System.getSecurityManager(); if (sec != null) { // throws exception if caller is not authorized sec.checkPermission (JDOPermission.MANAGE_METADATA); } synchronized(registeredClasses) { for (Iterator i = registeredClasses.keySet().iterator(); i.hasNext();) { Class pcClass = (Class)i.next(); // Note, the pc class was registered by calling the static // method JDOImplHelper.registerClass. This means the // JDOImplHelper class loader is the same as or an ancestor // of the class loader of the pc class. In this case method // getClassLoader does not perform a security check for // RuntimePermission("getClassLoader") and thus we do not // need a privileged block for the getClassLoader call. if ((pcClass != null) && (pcClass.getClassLoader() == cl)) { // unregister pc class, if its class loader is the // specified one. i.remove(); } } } } /** * Unregister metadata by class. This method unregisters the specified * class. Any further attempt to get metadata for the specified class will * result in a JDOFatalUserException. * @param pcClass the PersistenceCapable class to be * unregistered. * @since 1.0.2 */ public void unregisterClass (Class pcClass) { if (pcClass == null) throw new NullPointerException(msg.msg("ERR_NullClass")); //NOI18N SecurityManager sec = System.getSecurityManager(); if (sec != null) { // throws exception if caller is not authorized sec.checkPermission (JDOPermission.MANAGE_METADATA); } registeredClasses.remove(pcClass); } /** * Add the specified RegisterClassListener to the listener * list. * @param crl the listener to be added */ public void addRegisterClassListener (RegisterClassListener crl) { HashSet alreadyRegisteredClasses = null; synchronized (listeners) { listeners.add(crl); // Make a copy of the existing set of registered classes. // Between these two lines of code, any number of new class // registrations might occur, and will then all wait until this // synchronized block completes. Some of the class registrations // might be delivered twice to the newly registered listener. alreadyRegisteredClasses = new HashSet (registeredClasses.keySet()); } // new registrations will call the new listener while the following // occurs notify the new listener about already-registered classes for (Iterator it = alreadyRegisteredClasses.iterator(); it.hasNext();) { Class pcClass = (Class)it.next(); Meta meta = getMeta (pcClass); RegisterClassEvent event = new RegisterClassEvent( this, pcClass, meta.getFieldNames(), meta.getFieldTypes(), meta.getFieldFlags(), meta.getPersistenceCapableSuperclass()); crl.registerClass (event); } } /** * Remove the specified RegisterClassListener from the listener * list. * @param crl the listener to be removed */ public void removeRegisterClassListener (RegisterClassListener crl) { synchronized (listeners) { listeners.remove(crl); } } /** * Returns a collection of class objects of the registered * persistence-capable classes. * @return registered persistence-capable classes */ public Collection getRegisteredClasses() { return Collections.unmodifiableCollection(registeredClasses.keySet()); } /** Look up the metadata for a PersistenceCapable class. * @param pcClass the Class. * @return the Meta for the Class. */ private static Meta getMeta (Class pcClass) { Meta ret = (Meta) registeredClasses.get (pcClass); if (ret == null) { throw new JDOFatalUserException( msg.msg ("ERR_NoMetadata", pcClass.getName())); //NOI18N } return ret; } /** Register a class authorized to replaceStateManager. The caller of * this method must be authorized for JDOPermission("setStateManager"). * During replaceStateManager, a persistence-capable class will call * the corresponding checkAuthorizedStateManager and the class of the * instance of the parameter must have been registered. * @param smClass a Class that is authorized for * JDOPermission("setStateManager"). * @throws SecurityException if the caller is not authorized for * JDOPermission("setStateManager"). * @since 1.0.1 */ public static void registerAuthorizedStateManagerClass (Class smClass) throws SecurityException { if (smClass == null) throw new NullPointerException(msg.msg("ERR_NullClass")); //NOI18N SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(JDOPermission.SET_STATE_MANAGER); } synchronized (authorizedStateManagerClasses) { authorizedStateManagerClasses.put(smClass, null); } } /** Register classes authorized to replaceStateManager. The caller of * this method must be authorized for JDOPermission("setStateManager"). * During replaceStateManager, a persistence-capable class will call * the corresponding checkAuthorizedStateManager and the class of the * instance of the parameter must have been registered. * @param smClasses a Collection of Classes that are authorized for * JDOPermission("setStateManager"). * @throws SecurityException if the caller is not authorized for * JDOPermission("setStateManager"). * @since 1.0.1 */ public static void registerAuthorizedStateManagerClasses ( Collection smClasses) throws SecurityException { SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(JDOPermission.SET_STATE_MANAGER); synchronized (authorizedStateManagerClasses) { for (Iterator it = smClasses.iterator(); it.hasNext();) { Object smClass = it.next(); if (!(smClass instanceof Class)) { throw new ClassCastException( msg.msg("ERR_StateManagerClassCast", //NOI18N smClass.getClass().getName())); } registerAuthorizedStateManagerClass((Class)it.next()); } } } } /** * Register a DocumentBuilderFactory instance for use in parsing the * resource(s) META-INF/jdoconfig.xml. The default is governed by the * semantics of DocumentBuilderFactory.newInstance(). * * @param factory the DocumentBuilderFactory instance to use * @since 2.1 */ public synchronized void registerDocumentBuilderFactory( DocumentBuilderFactory factory) { documentBuilderFactory = factory; } /** * Return the registered instance of DocumentBuilderFactory. * @return the DocumentBuilderFactory if registered; null otherwise * @since 2.1 */ public static DocumentBuilderFactory getRegisteredDocumentBuilderFactory() { return documentBuilderFactory; } /** * Register an ErrorHandler instance for use in parsing the * resource(s) META-INF/jdoconfig.xml. The default is an ErrorHandler * that throws on error or fatalError and ignores warnings. * * @param handler the ErrorHandler instance to use * @since 2.1 */ public synchronized void registerErrorHandler(ErrorHandler handler) { errorHandler = handler; } /** * Return the registered instance of ErrorHandler. * @return the registered ErrorHandler if registered; null otherwise * @since 2.1 */ public static ErrorHandler getRegisteredErrorHandler() { return errorHandler; } /** Check that the parameter instance is of a class that is authorized for * JDOPermission("setStateManager"). This method is called by the * replaceStateManager method in persistence-capable classes. * A class that is passed as the parameter to replaceStateManager must be * authorized for JDOPermission("setStateManager"). To improve performance, * first the set of authorized classes is checked, and if not present, a * regular permission check is made. The regular permission check requires * that all callers on the stack, including the persistence-capable class * itself, must be authorized for JDOPermission("setStateManager"). * @param sm an instance of StateManager whose class is to be checked. * @since 1.0.1 */ public static void checkAuthorizedStateManager (StateManager sm) { checkAuthorizedStateManagerClass(sm.getClass()); } /** Check that the parameter instance is a class that is authorized for * JDOPermission("setStateManager"). This method is called by the * constructors of JDO Reference Implementation classes. * @param smClass a Class to be checked for JDOPermission("setStateManager") * @since 1.0.1 */ public static void checkAuthorizedStateManagerClass (Class smClass) { final SecurityManager scm = System.getSecurityManager(); if (scm == null) { // if no security manager, no checking. return; } synchronized(authorizedStateManagerClasses) { if (authorizedStateManagerClasses.containsKey(smClass)) { return; } } // if not already authorized, perform "long" security checking. scm.checkPermission(JDOPermission.SET_STATE_MANAGER); } /** * Construct an instance of a key class using a String as input. * This is a helper interface for use with ObjectIdentity. * Classes without a String constructor (such as those in java.lang * and java.util) will use this interface for constructing new instances. * The result might be a singleton or use some other strategy. */ public interface StringConstructor { /** * Construct an instance of the class for which this instance * is registered. * @param s the parameter for construction * @return the constructed object */ public Object construct(String s); } /** * Special StringConstructor instances for use with specific * classes that have no public String constructor. The Map is * keyed on class instance and the value is an instance of * StringConstructor. */ static final Map stringConstructorMap = new HashMap(); /** * * Register special StringConstructor instances. These instances * are for constructing instances from String parameters where there * is no String constructor for them. * @param cls the class to register a StringConstructor for * @param sc the StringConstructor instance * @return the previous StringConstructor registered for this class */ public Object registerStringConstructor(Class cls, StringConstructor sc) { synchronized(stringConstructorMap) { return stringConstructorMap.put(cls, sc); } } /** Register the default special StringConstructor instances. */ static { if (isClassLoadable("java.util.Currency")) { jdoImplHelper.registerStringConstructor( Currency.class, new StringConstructor() { public Object construct(String s) { try { return Currency.getInstance(s); } catch (IllegalArgumentException ex) { throw new javax.jdo.JDOUserException(msg.msg( "EXC_CurrencyStringConstructorIllegalArgument", //NOI18N s), ex); } catch (Exception ex) { throw new JDOUserException(msg.msg( "EXC_CurrencyStringConstructorException"), //NOI18N ex); } } }); } jdoImplHelper.registerStringConstructor(Locale.class, new StringConstructor() { public Object construct(String s) { try { return getLocale(s); } catch (Exception ex) { throw new JDOUserException(msg.msg( "EXC_LocaleStringConstructorException"), ex); //NOI18N } } }); jdoImplHelper.registerStringConstructor(Date.class, new StringConstructor() { public synchronized Object construct(String s) { try { // first, try the String as a Long return new Date(Long.parseLong(s)); } catch (NumberFormatException ex) { // not a Long; try the formatted date ParsePosition pp = new ParsePosition(0); Date result = dateFormat.parse(s, pp); if (result == null) { throw new JDOUserException (msg.msg( "EXC_DateStringConstructor", new Object[] //NOI18N {s, new Integer(pp.getErrorIndex()), dateFormatPattern})); } return result; } } }); } /** * Parse the String to a Locale. * @param s the name of the Locale * @return the Locale corresponding to the name */ private static Locale getLocale(String s) { String lang = s; int firstUnderbar = s.indexOf('_'); if (firstUnderbar == -1) { // nothing but language return new Locale(lang); } lang = s.substring(0, firstUnderbar); String country; int secondUnderbar = s.indexOf('_', firstUnderbar + 1); if (secondUnderbar == -1) { // nothing but language, country country = s.substring(firstUnderbar + 1); return new Locale(lang, country); } country = s.substring(firstUnderbar + 1, secondUnderbar); String variant = s.substring(secondUnderbar + 1); return new Locale(lang, country, variant); } /** * Determine if a class is loadable in the current environment. * @param className the fully-qualified name of the class * @return true if the class can be loaded; false otherwise */ private static boolean isClassLoadable(String className) { try { Class.forName(className); return true; } catch (ClassNotFoundException ex) { return false; } } /** * Construct an instance of the parameter class, using the keyString * as an argument to the constructor. If the class has a StringConstructor * instance registered, use it. If not, try to find a constructor for * the class with a single String argument. Otherwise, throw a * JDOUserException. * @param className the name of the class * @param keyString the String parameter for the constructor * @return the result of construction */ public static Object construct(String className, String keyString) { StringConstructor stringConstructor; try { Class keyClass = Class.forName(className); synchronized(stringConstructorMap) { stringConstructor = (StringConstructor) stringConstructorMap.get(keyClass); } if (stringConstructor != null) { return stringConstructor.construct(keyString); } else { Constructor keyConstructor = keyClass.getConstructor(new Class[]{String.class}); return keyConstructor.newInstance(new Object[]{keyString}); } } catch (JDOException ex) { throw ex; } catch (Exception ex) { /* ClassNotFoundException, NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException */ throw new JDOUserException( msg.msg("EXC_ObjectIdentityStringConstruction", //NOI18N new Object[] {ex.toString(), className, keyString}), ex); } } /** * Get the DateFormat instance for the default locale from the VM. * This requires the following privileges for JDOImplHelper in the * security permissions file: * permission java.util.PropertyPermission "user.country", "read"; * permission java.util.PropertyPermission "user.timezone", "read,write"; * permission java.util.PropertyPermission "java.home", "read"; * If these permissions are not present, or there is some other * problem getting the default date format, a simple formatter is returned. * @since 2.1 * @return the default date-time formatter */ static DateFormat getDateTimeInstance() { DateFormat result = null; try { result = AccessController.doPrivileged ( new PrivilegedAction () { public DateFormat run () { return DateFormat.getDateTimeInstance(); } } ); } catch (Exception ex) { result = DateFormat.getInstance(); } return result; } /** * Register a DateFormat instance for use with constructing Date * instances. The default is the default DateFormat instance. * If the new instance implements SimpleDateFormat, get its pattern * for error messages. * @since 2.0 * @param df the DateFormat instance to use */ public synchronized void registerDateFormat(DateFormat df) { dateFormat = df; if (df instanceof SimpleDateFormat) { dateFormatPattern = ((SimpleDateFormat)df).toPattern(); } else { dateFormatPattern = msg.msg("MSG_unknown"); //NOI18N } } /** This is a helper class to manage metadata per persistence-capable * class. The information is used at runtime to provide field names and * field types to the JDO Model. * * This is the value of the HashMap which * relates the PersistenceCapable Class * as a key to the metadata. */ static class Meta { /** Construct an instance of Meta. * @param fieldNames An array of String * @param fieldTypes An array of Class * @param fieldFlags an array of int * @param persistenceCapableSuperclass the most immediate * PersistenceCapable superclass * @param pc An instance of the PersistenceCapable class */ Meta (String[] fieldNames, Class[] fieldTypes, byte[] fieldFlags, Class persistenceCapableSuperclass, PersistenceCapable pc) { this.fieldNames = fieldNames; this.fieldTypes = fieldTypes; this.fieldFlags = fieldFlags; this.persistenceCapableSuperclass = persistenceCapableSuperclass; this.pc = pc; } /** This is an array of field names used * for the Model at runtime. The field * is passed by the static class initialization. */ String[] fieldNames; /** Get the field names from the metadata. * @return the array of field names. */ String[] getFieldNames() { return fieldNames; } /** This is an array of field types used * for the Model at runtime. The field * is passed by the static class initialization. */ Class[] fieldTypes; /** Get the field types from the metadata. * @return the array of field types. */ Class[] getFieldTypes() { return fieldTypes; } /** This is an array of field flags used * for the Model at runtime. The field * is passed by the static class initialization. */ byte[] fieldFlags; /** Get the field types from the metadata. * @return the array of field types. */ byte[] getFieldFlags() { return fieldFlags; } /** This is the Class instance of the * PersistenceCapable superclass. */ Class persistenceCapableSuperclass; /** Return the PersistenceCapable superclass. * @return the PersistenceCapable superclass */ Class getPersistenceCapableSuperclass() { return persistenceCapableSuperclass; } /** This is an instance of PersistenceCapable, * used at runtime to create new instances. */ PersistenceCapable pc; /** Get an instance of the PersistenceCapable class. * @return an instance of the PersistenceCapable Class. */ PersistenceCapable getPC() { return pc; } /** Return the string form of the metadata. * @return the string form */ public String toString() { return "Meta-" + pc.getClass().getName(); //NOI18N } } /** * Add a StateInterrogation to the list. Create a new list * in case there is an iterator open on the original list. * @param si the StateInterrogation to add */ public synchronized void addStateInterrogation(StateInterrogation si) { List newList = new ArrayList(stateInterrogations); newList.add(si); stateInterrogations = newList; } /** * Remove a StateInterrogation from the list. Create a new list * in case there is an iterator open on the original list. * @param si the StateInterrogation to remove */ public synchronized void removeStateInterrogation(StateInterrogation si) { List newList = new ArrayList(stateInterrogations); newList.remove(si); stateInterrogations = newList; } /** * Return an Iterator over all StateInterrogation instances. * Synchronize to avoid add/remove/iterate conflicts. * @return an Iterator over all StateInterrogation instances. */ private synchronized Iterator getStateInterrogationIterator() { return stateInterrogations.iterator(); } /** * Mark a non-binary-compatible instance dirty. Delegate to all * registered StateInterrogation instances until one of them * handles the call. * @param pc the instance to mark dirty * @param fieldName the field to mark dirty */ public void nonBinaryCompatibleMakeDirty(Object pc, String fieldName) { Iterator sit = getStateInterrogationIterator(); while (sit.hasNext()) { StateInterrogation si = (StateInterrogation)sit.next(); try { if (si.makeDirty(pc, fieldName)) return; } catch (Throwable t) { continue; // ignore exceptions from errant StateInterrogations } } } /** * Determine the state of a non-binary-compatible instance. * Delegate to all registered StateInterrogation instances until * one of them handles the call (returns a non-null Boolean * with the answer). * The caller provides the stateless "method object" that does * the actual call to the StateInterrogation instance. * @param pc the instance to be checked * @param sibr the method object that delegates to the * non-binary-compatible implementation * @return Boolean.TRUE if the instance satisfies the state interrogation; * Boolean.FALSE if the instance does not satisfy the interrogation; * or null if the implementation does not manage the class of the instance */ public boolean nonBinaryCompatibleIs(Object pc, StateInterrogationBooleanReturn sibr) { Iterator sit = getStateInterrogationIterator(); while (sit.hasNext()) { StateInterrogation si = (StateInterrogation)sit.next(); Boolean result; try { result = sibr.is(pc, si); } catch (Throwable t) { continue; // ignore exceptions from errant StateInterrogations } if (result != null) return result.booleanValue(); } return false; } /** * Return an object associated with a non-binary-compatible instance. * Delegate to all registered StateInterrogation instances until * one of them handles the call (returns a non-null answer). * The caller provides the stateless "method object" that does * the actual call to the StateInterrogation instance. * @param pc the instance whose associated object is needed * @param sibr the method object that delegates to the * non-binary-compatible implementation * @return the associated object or null if the implementation does not * manage the class of the instance */ public Object nonBinaryCompatibleGet(Object pc, StateInterrogationObjectReturn sibr) { Iterator sit = getStateInterrogationIterator(); while (sit.hasNext()) { StateInterrogation si = (StateInterrogation)sit.next(); Object result; try { result = sibr.get(pc, si); } catch (Throwable t) { continue; // ignore exceptions from errant StateInterrogations } if (result != null) return result; } return null; } /** This is an interface used to interrogate the state of an instance * that does not implement PersistenceCapable. It is used for the * methods that return a boolean value. */ public static interface StateInterrogationBooleanReturn { /** * Interrogate the state of the instance * @param pc the instance * @param si the method object * @return the state of the instance or null */ public Boolean is(Object pc, StateInterrogation si); } /** This is an interface used to interrogate the state of an instance * that does not implement PersistenceCapable. It is used for the * methods that return an Object value. */ public static interface StateInterrogationObjectReturn { /** * Return the associated instance. * @param pc the instance * @param si the method object * @return the associated object or null */ public Object get(Object pc, StateInterrogation si); } /** * Examines the given map for keys beginning with the JDO standard prefix, * {@link Constants#JAVAX_JDO_PREFIX}. If any property keys are found with * that prefix but are unknown to this version of the JDO standard, a * JDOUserException is thrown with a message indicating the unknown * property. Keys that are not strings are ignored, as are string keys * beginning with * {@link Constants#PROPERTY_PREFIX_INSTANCE_LIFECYCLE_LISTENER} or not * beginning with {@link Constants#JAVAX_JDO_PREFIX}. * * @param properties * The properties to examine. * * @see Constants#JAVAX_JDO_PREFIX * @see JDOHelper#USER_CONFIGURABLE_STANDARD_PROPERTIES * @since 3.1 */ public static void assertOnlyKnownStandardProperties(Map properties) { if (properties == null || properties.isEmpty()) return; List exceptions = new ArrayList(); StringBuilder unknowns = new StringBuilder(); for (Object key : properties.keySet()) { if (!(key instanceof String)) { continue; // ignore keys not of type string } String s = ((String) key).toLowerCase(); // compare case-insensitively if (!s.startsWith(JAVAX_JDO_PREFIX_LOWER_CASED)) { continue; // ignore vendor-specific keys } if (s.startsWith(PROPERTY_PREFIX_INSTANCE_LIFECYCLE_LISTENER_LOWER_CASED)) { continue; // ignore listener class names } if (!USER_CONFIGURABLE_STANDARD_PROPERTIES_LOWER_CASED.contains(s)) { exceptions.add(new JDOUserException(msg.msg( "EXC_UnknownStandardProperty", s))); if (exceptions.size() > 1) { unknowns.append(","); } unknowns.append(s); } } if (exceptions.size() == 1) { throw exceptions.get(0); } else if (exceptions.size() > 1) { throw new JDOUserException(msg.msg("EXC_UnknownStandardProperties", unknowns.toString()), exceptions.toArray(new JDOUserException[] {})); } } } api/src/java/javax/jdo/spi/JDOPermission.java100664 12164 12500110371 21402 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.spi; /** * The JDOPermission class is for operations that are reserved for * JDO implementations and should not be called by other code. A * JDOPermission is a named permission and has no * actions. There are two names currently defined. Each named permission * has a corresponding public static final field which contains an instance * of the named permission. *

* The following table * provides a summary description of what each named permission allows, * and discusses the risks of granting code the permission. *

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Permission Target NameWhat the Permission AllowsRisks of Allowing this Permission
setStateManagerThis allows setting the StateManager for an instance of * PersistenceCapable. The StateManager * has unlimited access to get and set persistent and transactional fields of * the PersistenceCapable instance.This is dangerous in that information (possibly confidential) * normally unavailable would be accessible to malicious code.
getMetadataThis allows getting metadata for any PersistenceCapable * class that has registered with JDOImplHelper.This is dangerous in that metadata information (possibly confidential) * normally unavailable would be accessible to malicious code.
manageMetadataThis allows managing metadata for any PersistenceCapable * class that has registered with JDOImplHelper.This is dangerous in that metadata information (possibly confidential) * normally unavailable would be manageable (modifiable) by malicious code. *
closePersistenceManagerFactoryThis allows closing a PersistenceManagerFactory, * thereby releasing resources.This is dangerous in that resources bound to the * PersistenceManagerFactory would be releaseable by * malicious code.
* * @see java.security.Permission * @see java.security.BasicPermission * @see javax.jdo.spi.JDOImplHelper * @see javax.jdo.spi.PersistenceCapable * @version 1.0.2 */ public final class JDOPermission extends java.security.BasicPermission { /** * Constructs a JDOPermission with the specified name. * * @param name the name of the JDOPermission */ public JDOPermission(String name) { super(name); } /** * Constructs a JDOPermission with the specified name and * actions. The actions should be null; they are ignored. * This constructor exists for use by the Policy object * to instantiate new Permission objects. * * @param name the name of the JDOPermission * @param actions should be null. */ public JDOPermission(String name, String actions) { super(name, actions); } /** An instance of JDOPermission to be used for * getMetadata permission checking. */ public final static JDOPermission GET_METADATA = new JDOPermission("getMetadata"); // NOI18N /** An instance of JDOPermission to be used for * manageMetadata permission checking. * @since 1.0.2 */ public final static JDOPermission MANAGE_METADATA = new JDOPermission("manageMetadata"); // NOI18N /** An instance of JDOPermission to be used for * setStateManager permission checking. */ public final static JDOPermission SET_STATE_MANAGER = new JDOPermission("setStateManager"); // NOI18N /** An instance of JDOPermission to be used for * closePersistenceManagerFactory permission checking. * @since 1.0.1 */ public final static JDOPermission CLOSE_PERSISTENCE_MANAGER_FACTORY = new JDOPermission("closePersistenceManagerFactory"); // NOI18N } api/src/java/javax/jdo/spi/package.html100664 4443 12500110371 20314 0ustarmbouschenstaff 0 0 JDO Service Provider Interface package

This package contains the interfaces and classes used by JDO implementations.

JDO defines interfaces and classes to be used by application programmers when using classes whose instances are to be stored in persistent storage (persistence-capable classes), and specifies the contracts between suppliers of persistence-capable classes and the runtime environment (which is part of the JDO implementation).

The PersistenceCapable interface is implemented by all classes whose instances are to be made persistent. The implementation might be done by a combination of techniques, as determined by the JDO vendor:

  • Pre-processing .java files
  • Post-processing .class files
  • Generating .java or .class files directly from an abstraction

The StateManager interface is the implementation's contact point with the PersistenceCapable instances. It defines methods that are called by the PersistenceCapable instances to implement the required PersistenceCapable behavior for persistent and transactional instances.

The JDOPermission class is used to manage security controls on JDO implementations.

The RegisterClassEvent class and RegisterClassListener interface are used by JDO implementations that need access to metadata of PersistenceCapable classes.

The JDOImplHelper class contains helper methods for JDO implementations. api/src/java/javax/jdo/spi/PersistenceCapable.java100664 64620 12500110371 22455 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.spi; import javax.jdo.PersistenceManager; /** * A class that can be managed by a binary-compatible JDO implementation * must implement this interface. * *

This interface defines methods that allow the implementation to manage * the instances. It also defines methods that allow a JDO aware * application to examine the runtime state of instances. For example, * an application can discover whether the instance is persistent, transactional, * dirty, new, deleted, or detached; and to get its associated * PersistenceManager, object identity, and version if it has one. * *

In the Reference Implementation, the JDO Enhancer modifies the class * to implement PersistenceCapable prior to loading the class into the runtime * environment. The Reference Enhancer also adds code to implement the * methods defined by PersistenceCapable. * *

The extra methods in the PersistenceCapable interface might be generated * by pre-processing a .java file, or might be generated from a tool directly. * The exact technique for generating the extra methods is not specified by * JDO. * *

The PersistenceCapable interface is designed to avoid name conflicts * in the scope of user-defined classes. All of its declared method * names are prefixed with 'jdo'. * @version 2.0 */ public interface PersistenceCapable { /** If jdoFlags is set to READ_WRITE_OK, then the fields in the default fetch group * can be accessed for read or write without notifying the StateManager. */ static final byte READ_WRITE_OK = 0; /** If jdoFlags is set to LOAD_REQUIRED, then the fields in the default fetch group * cannot be accessed for read or write without notifying the StateManager. */ static final byte LOAD_REQUIRED = 1; /** If jdoFlags is set to READ_OK, then the fields in the default fetch group * can be accessed for read without notifying the StateManager. */ static final byte READ_OK = -1; /** If jdoFieldFlags for a field includes CHECK_READ, then * the field has been enhanced to call the jdoStateManager on read * if the jdoFlags setting is not READ_OK or READ_WRITE_OK. */ static final byte CHECK_READ = 1; /** If jdoFieldFlags for a field includes MEDIATE_READ, then * the field has been enhanced to always call the jdoStateManager * on all reads. */ static final byte MEDIATE_READ = 2; /** If jdoFieldFlags for a field includes CHECK_WRITE, * then the field has been enhanced to call the * jdoStateManager on write if the jdoFlags setting is not * READ_WRITE_OK;. */ static final byte CHECK_WRITE = 4; /** If jdoFieldFlags for a field includes MEDIATE_WRITE, then * the field has been enhanced to always call the jdoStateManager * on all writes. */ static final byte MEDIATE_WRITE = 8; /** If jdoFieldFlags for a field includes SERIALIZABLE, * then the field is not declared as TRANSIENT. */ static final byte SERIALIZABLE = 16; /** Return the associated PersistenceManager if there is one. * Transactional and persistent instances return the associated * PersistenceManager. * *

Transient non-transactional instances return null. *

This method always delegates to the StateManager if it is non-null. * @return the PersistenceManager associated with this instance. */ PersistenceManager jdoGetPersistenceManager(); /** This method sets the StateManager instance that manages the state * of this instance. This method is normally used by the StateManager * during the process of making an instance persistent, transient, * or transactional. * * The caller of this method must have JDOPermission for the instance, * if the instance is not already owned by a StateManager. * If the parameter is null, and the StateManager approves the change, * then the jdoFlags field will be reset to READ_WRITE_OK. * If the parameter is not null, and the security manager approves * the change, then the jdoFlags field will be reset to LOAD_REQUIRED. * @param sm The StateManager which will own this instance, or null * to reset the instance to transient state * @throws SecurityException if the caller does not have JDOPermission * @see JDOPermission */ void jdoReplaceStateManager(StateManager sm) throws SecurityException; /** The owning StateManager uses this method to ask the instance to * provide the value of the single field identified by fieldNumber. * @param fieldNumber the field whose value is to be provided by * a callback to the StateManager's * providedXXXField method */ void jdoProvideField(int fieldNumber); /** The owning StateManager uses this method to ask the instance to * provide the values of the multiple fields identified by fieldNumbers. * @param fieldNumbers the fields whose values are to be provided by * multiple callbacks to the StateManager's * providedXXXField method */ void jdoProvideFields(int[] fieldNumbers); /** The owning StateManager uses this method to ask the instance to * replace the value of the single field identified by number. * @param fieldNumber the field whose value is to be replaced by * a callback to the StateManager's * replacingXXXField method */ void jdoReplaceField(int fieldNumber); /** The owning StateManager uses this method to ask the instance to * replace the values of the multiple fields identified by number. * @param fieldNumbers the fields whose values are to be replaced by * multiple callbacks to the StateManager's * replacingXXXField method */ void jdoReplaceFields(int[] fieldNumbers); /** The owning StateManager uses this method to ask the instance to * replace the value of the flags by calling back the StateManager * replacingFlags method. */ void jdoReplaceFlags(); /** Copy field values from another instance of the same class * to this instance. *

This method will throw an exception if the other instance is * not managed by the same StateManager as this instance. * @param other the PC instance from which field values are to be copied * @param fieldNumbers the field numbers to be copied into this instance */ void jdoCopyFields(Object other, int[] fieldNumbers); /** Explicitly mark this instance and this field dirty. * Normally, PersistenceCapable classes are able to detect changes made * to their fields. However, if a reference to an array is given to a * method outside the class, and the array is modified, then the * persistent instance is not aware of the change. This API allows the * application to notify the instance that a change was made to a field. * *

The field name should be the fully qualified name, including package * name and class name of the class declaring the field. This allows * unambiguous identification of the field to be marked dirty. * If multiple classes declare the same field, and * if the package and class name are not provided by the parameter in * this API, then the field marked * dirty is the field declared by the most derived class. *

Transient instances ignore this method. *

* @param fieldName the name of the field to be marked dirty. */ void jdoMakeDirty(String fieldName); /** Return a copy of the JDO identity associated with this instance. * *

Persistent instances of PersistenceCapable classes have a JDO identity * managed by the PersistenceManager. This method returns a copy of the * ObjectId that represents the JDO identity. * *

Transient instances return null. * *

The ObjectId may be serialized * and later restored, and used with a PersistenceManager from the same JDO * implementation to locate a persistent instance with the same data store * identity. * *

If the JDO identity is managed by the application, then the ObjectId may * be used with a PersistenceManager from any JDO implementation that supports * the PersistenceCapable class. * *

If the JDO identity is not managed by the application or the data store, * then the ObjectId returned is only valid within the current transaction. *

If the JDO identity is being changed in the transaction, this method * returns the object id as of the beginning of the current transaction. * * @see PersistenceManager#getObjectId(Object pc) * @see PersistenceManager#getObjectById(Object oid, boolean validate) * @return a copy of the ObjectId of this instance as of the beginning of the transaction. */ Object jdoGetObjectId(); /** Return a copy of the JDO identity associated with this instance. * This method is the same as jdoGetObjectId if the identity of the * instance has not changed in the current transaction. *

If the JDO identity is being changed in the transaction, this method * returns the current object id as modified in the current transaction. * * @see #jdoGetObjectId() * @see PersistenceManager#getObjectId(Object pc) * @see PersistenceManager#getObjectById(Object oid, boolean validate) * @return a copy of the ObjectId of this instance as modified in the transaction. */ Object jdoGetTransactionalObjectId(); /** Return the version of this instance. * @return the version * @since 2.0 */ Object jdoGetVersion(); /** Tests whether this object is dirty. * * Instances that have been modified, deleted, or newly * made persistent in the current transaction return true. * *

Transient instances return false. *

* @see javax.jdo.JDOHelper#isDirty(Object pc) * @see javax.jdo.JDOHelper#makeDirty(Object pc, String fieldName) * @see #jdoMakeDirty(String fieldName) * @return true if this instance has been modified in the current transaction. */ boolean jdoIsDirty(); /** Tests whether this object is transactional. * * Instances whose state is associated with the current transaction * return true. * *

Transient instances return false. *

* @see javax.jdo.JDOHelper#isTransactional(Object pc) * @see PersistenceManager#makeTransactional(Object pc) * @return true if this instance is transactional. */ boolean jdoIsTransactional(); /** Tests whether this object is persistent. * Instances that represent persistent objects in the data store * return true. * @see javax.jdo.JDOHelper#isPersistent(Object pc) * @see PersistenceManager#makePersistent(Object pc) * @return true if this instance is persistent. */ boolean jdoIsPersistent(); /** Tests whether this object has been newly made persistent. * * Instances that have been made persistent in the current transaction * return true. * *

Transient instances return false. *

* @see javax.jdo.JDOHelper#isNew(Object pc) * @see PersistenceManager#makePersistent(Object pc) * @return true if this instance was made persistent * in the current transaction. */ boolean jdoIsNew(); /** Tests whether this object has been deleted. * * Instances that have been deleted in the current transaction return true. * *

Transient instances return false. *

* @see javax.jdo.JDOHelper#isDeleted(Object pc) * @see PersistenceManager#deletePersistent(Object pc) * @return true if this instance was deleted * in the current transaction. */ boolean jdoIsDeleted(); /** Tests whether this object has been detached. * * Instances that have been detached return true. * *

Transient instances return false. *

* @see javax.jdo.JDOHelper#isDetached(Object pc) * @return true if this instance is detached. * @since 2.0 */ boolean jdoIsDetached(); /** Return a new instance of this class, with the jdoStateManager set to the * parameter, and jdoFlags set to LOAD_REQUIRED. *

This method is used as a performance optimization as an alternative to * using reflection to construct a new instance. It is used by the * JDOImplHelper class method newInstance. * @return a new instance of this class. * @see JDOImplHelper#newInstance(Class pcClass, StateManager sm) * @param sm the StateManager that will own the new instance. */ PersistenceCapable jdoNewInstance(StateManager sm); /** Return a new instance of this class, with the jdoStateManager set to the * parameter, key fields initialized to the values in the oid, and jdoFlags * set to LOAD_REQUIRED. *

This method is used as a performance optimization as an alternative to * using reflection to construct a new instance of a class that uses * application identity. It is used by the * JDOImplHelper class method newInstance. * @return a new instance of this class. * @see JDOImplHelper#newInstance(Class pcClass, StateManager sm) * @param sm the StateManager that will own the new instance. * @param oid an instance of the object id class (application identity). */ PersistenceCapable jdoNewInstance(StateManager sm, Object oid); /** Create a new instance of the * ObjectId class for this PersistenceCapable class and initialize * the key fields from the instance on which this method is called. * This method creates a new instance of the class used for JDO identity. * It is intended only for application identity. If the class has been * enhanced for datastore identity, or if the class is abstract, * null is returned. *

For classes using single field identity, this method must be called * on an instance of a persistence-capable class with its primary key * field initialized (not null), or a * JDONullIdentityException is thrown. *

The instance returned is initialized with the value(s) of the * primary key field(s) of the instance on which the method is called. * @return the new instance created. */ Object jdoNewObjectIdInstance(); /** Create a new instance of the class used for JDO identity, using the * key constructor of the object id class. It is intended for single * field identity. The identity * instance returned has no relationship with the values of the primary key * fields of the persistence-capable instance on which the method is called. * If the key is the wrong class for the object id class, null is returned. *

For classes that use single field identity, if the parameter is * of one of the following types, the behavior must be as specified: *

  • Number or Character: the * parameter must be the single field * type or the wrapper class of the primitive field type; the parameter * is passed to the single field identity constructor *
  • ObjectIdFieldSupplier: the field value * is fetched from the ObjectIdFieldSupplier and passed to the * single field identity constructor *
  • String: the String is passed to the * single field identity constructor *
* @return the new instance created. * @param o the object identity constructor parameter * @since 2.0 */ Object jdoNewObjectIdInstance(Object o); /** Copy fields from this PersistenceCapable instance to the Object Id * instance. For classes using single field identity, this method always * throws JDOUserException. * @param oid the ObjectId target of the key fields */ void jdoCopyKeyFieldsToObjectId(Object oid); /** Copy fields from an outside source to the key fields in the ObjectId. * This method is generated in the PersistenceCapable * class to generate * a call to the field manager for each key field in the ObjectId. For * example, an ObjectId class that has three key fields (int id, * String name, and Float salary) would have the method generated: * *

void jdoCopyKeyFieldsToObjectId *

(ObjectIdFieldSupplier fm, Object objectId) { *

EmployeeKey oid = (EmployeeKey)objectId; *

oid.id = fm.fetchIntField (0); *

oid.name = fm.fetchStringField (1); *

oid.salary = fm.fetchObjectField (2); *

} * *

The implementation is responsible for implementing the * ObjectIdFieldSupplier to produce the values * for the key fields. *

For classes using single field identity, this method always * throws JDOUserException. * @param oid the ObjectId target of the copy. * @param fm the field supplier that supplies the field values. */ void jdoCopyKeyFieldsToObjectId(ObjectIdFieldSupplier fm, Object oid); /** Copy fields to an outside consumer from the key fields in the ObjectId. * This method is generated in the PersistenceCapable * class to generate * a call to the field manager for each key field in the ObjectId. For * example, an ObjectId class that has three key fields (int id, * String name, and Float salary) would have the method generated: * *

void copyKeyFieldsFromObjectId *

(ObjectIdFieldConsumer fm, Object objectId) { *

EmployeeKey oid = (EmployeeKey)objectId; *

fm.storeIntField (0, oid.id); *

fm.storeStringField (1, oid.name); *

fm.storeObjectField (2, oid.salary); *

} * *

The implementation is responsible for implementing the * ObjectIdFieldConsumer to store the values for the * key fields. * @param oid the ObjectId source of the copy. * @param fm the field manager that receives the field values. */ void jdoCopyKeyFieldsFromObjectId(ObjectIdFieldConsumer fm, Object oid); /** This interface is a convenience interface that allows an instance to * implement both ObjectIdFieldSupplier and * ObjectIdFieldConsumer. */ static interface ObjectIdFieldManager extends ObjectIdFieldConsumer, ObjectIdFieldSupplier {} /** This interface is used to provide fields to the Object id instance. It is used * by the method copyKeyFieldsToObjectId. When the method is called, the * generated code calls the instance of ObjectIdFieldManager for each field in * the object id. */ static interface ObjectIdFieldSupplier { /** Fetch one field from the field manager. This field will be stored in the * proper field of the ObjectId. * @param fieldNumber the field number of the key field. * @return the value of the field to be stored into the ObjectId. */ boolean fetchBooleanField(int fieldNumber); /** Fetch one field from the field manager. This field will be stored in the * proper field of the ObjectId. * @param fieldNumber the field number of the key field. * @return the value of the field to be stored into the ObjectId. */ char fetchCharField(int fieldNumber); /** Fetch one field from the field manager. This field will be stored in the * proper field of the ObjectId. * @param fieldNumber the field number of the key field. * @return the value of the field to be stored into the ObjectId. */ byte fetchByteField(int fieldNumber); /** Fetch one field from the field manager. This field will be stored in the * proper field of the ObjectId. * @param fieldNumber the field number of the key field. * @return the value of the field to be stored into the ObjectId. */ short fetchShortField(int fieldNumber); /** Fetch one field from the field manager. This field will be stored in the * proper field of the ObjectId. * @param fieldNumber the field number of the key field. * @return the value of the field to be stored into the ObjectId. */ int fetchIntField(int fieldNumber); /** Fetch one field from the field manager. This field will be stored in the * proper field of the ObjectId. * @param fieldNumber the field number of the key field. * @return the value of the field to be stored into the ObjectId. */ long fetchLongField(int fieldNumber); /** Fetch one field from the field manager. This field will be stored in the * proper field of the ObjectId. * @param fieldNumber the field number of the key field. * @return the value of the field to be stored into the ObjectId. */ float fetchFloatField(int fieldNumber); /** Fetch one field from the field manager. This field will be stored in the * proper field of the ObjectId. * @param fieldNumber the field number of the key field. * @return the value of the field to be stored into the ObjectId. */ double fetchDoubleField(int fieldNumber); /** Fetch one field from the field manager. This field will be stored in the * proper field of the ObjectId. * @param fieldNumber the field number of the key field. * @return the value of the field to be stored into the ObjectId. */ String fetchStringField(int fieldNumber); /** Fetch one field from the field manager. This field will be stored in the * proper field of the ObjectId. * @param fieldNumber the field number of the key field. * @return the value of the field to be stored into the ObjectId. */ Object fetchObjectField(int fieldNumber); } /** This interface is used to store fields from the Object id instance. It is used * by the method copyKeyFieldsFromObjectId. When the method is called, the * generated code calls the instance of ObjectIdFieldManager for each field in * the object id. */ static interface ObjectIdFieldConsumer { /** Store one field into the field manager. This field was retrieved from * the field of the ObjectId. * @param fieldNumber the field number of the key field. * @param value the value of the field from the ObjectId. */ void storeBooleanField(int fieldNumber, boolean value); /** Store one field into the field manager. This field was retrieved from * the field of the ObjectId. * @param fieldNumber the field number of the key field. * @param value the value of the field from the ObjectId. */ void storeCharField(int fieldNumber, char value); /** Store one field into the field manager. This field was retrieved from * the field of the ObjectId. * @param fieldNumber the field number of the key field. * @param value the value of the field from the ObjectId. */ void storeByteField(int fieldNumber, byte value); /** Store one field into the field manager. This field was retrieved from * the field of the ObjectId. * @param fieldNumber the field number of the key field. * @param value the value of the field from the ObjectId. */ void storeShortField(int fieldNumber, short value); /** Store one field into the field manager. This field was retrieved from * the field of the ObjectId. * @param fieldNumber the field number of the key field. * @param value the value of the field from the ObjectId. */ void storeIntField(int fieldNumber, int value); /** Store one field into the field manager. This field was retrieved from * the field of the ObjectId. * @param fieldNumber the field number of the key field. * @param value the value of the field from the ObjectId. */ void storeLongField(int fieldNumber, long value); /** Store one field into the field manager. This field was retrieved from * the field of the ObjectId. * @param fieldNumber the field number of the key field. * @param value the value of the field from the ObjectId. */ void storeFloatField(int fieldNumber, float value); /** Store one field into the field manager. This field was retrieved from * the field of the ObjectId. * @param fieldNumber the field number of the key field. * @param value the value of the field from the ObjectId. */ void storeDoubleField(int fieldNumber, double value); /** Store one field into the field manager. This field was retrieved from * the field of the ObjectId. * @param fieldNumber the field number of the key field. * @param value the value of the field from the ObjectId. */ void storeStringField(int fieldNumber, String value); /** Store one field into the field manager. This field was retrieved from * the field of the ObjectId. * @param fieldNumber the field number of the key field. * @param value the value of the field from the ObjectId. */ void storeObjectField(int fieldNumber, Object value); } } api/src/java/javax/jdo/spi/RegisterClassEvent.java100664 7320 12500110371 22447 0ustarmbouschenstaff 0 0 /* * 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. */ /* * RegisterClassEvent.java * */ package javax.jdo.spi; import java.util.EventObject; /** * A RegisterClassEvent event gets delivered whenever a persistence-capable * class registers itself with the JDOImplHelper. * * @version 1.0 */ public class RegisterClassEvent extends EventObject { /** The class object of the registered persistence-capable class */ protected Class pcClass; /** The names of managed fields of the persistence-capable class */ protected String[] fieldNames; /** The types of managed fields of the persistence-capable class */ protected Class[] fieldTypes; /** The flags of managed fields of the persistence-capable class */ protected byte[] fieldFlags; /** */ protected Class persistenceCapableSuperclass; /** * Constructs a new RegisterClassEvent. * @param helper the JDOImplHelper instance * @param registeredClass the persistence-capable class * @param fieldNames the names of the managed fields * @param fieldTypes the types of the managed fields * @param fieldFlags the flags of the managed fields * @param persistenceCapableSuperclass the persistence-capable superclass **/ public RegisterClassEvent(JDOImplHelper helper, Class registeredClass, String[] fieldNames, Class[] fieldTypes, byte[] fieldFlags, Class persistenceCapableSuperclass) { super(helper); this.pcClass = registeredClass; this.fieldNames = fieldNames; this.fieldTypes = fieldTypes; this.fieldFlags = fieldFlags; this.persistenceCapableSuperclass = persistenceCapableSuperclass; } /** * Returns the class object of the registered persistence-capable class. * @return the persistence-capable class. */ public Class getRegisteredClass() { return pcClass; } /** * Returns the names of the managed field of the persistence-capable class. * @return the names of the managed fields */ public String[] getFieldNames() { return fieldNames; } /** * Returns the types of the managed field of the persistence-capable class. * @return the types of the managed fields */ public Class[] getFieldTypes() { return fieldTypes; } /** * Returns the flags of the managed field of the persistence-capable class. * @return the flags of the managed fields */ public byte[] getFieldFlags() { return fieldFlags; } /** * Returns the class object of the persistence-capable superclass. * @return the persistence-capable superclass. */ public Class getPersistenceCapableSuperclass() { return persistenceCapableSuperclass; } } api/src/java/javax/jdo/spi/RegisterClassListener.java100664 3031 12500110371 23146 0ustarmbouschenstaff 0 0 /* * 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. */ /* * RegisterClassListener.java * */ package javax.jdo.spi; import java.util.EventListener; /** * A "RegisterClassEvent" event gets fired whenever a persistence-capable class * is loaded and gets registered with the JDOImplHelper. You can register a * RegisterClassListener so as to be notified of any registration of a * persistence-capable class. * * @version 1.0 */ public interface RegisterClassListener extends EventListener { /** * This method gets called when a persistence-capable class is registered. * @param event a RegisterClassEvent instance describing the registered * class plus metadata. */ public void registerClass(RegisterClassEvent event); } api/src/java/javax/jdo/spi/StateInterrogation.java100664 23745 12500110371 22551 0ustarmbouschenstaff 0 0 /* * 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. */ /* * StateInterrogation.java * */ package javax.jdo.spi; import javax.jdo.PersistenceManager; /** * This interface is implemented by a non-binary-compatible JDO implementation * to provide state interrogation for non-enhanced persistent classes. * *

A call to JDOHelper to get the status of an instance is handled * internally if the parameter instance implements PersistenceCapable. * For non-binary-compatible implementations, there is no requirement * that persistent instances implement PersistenceCapable. Therefore, * if the parameter does not implement PersistenceCapable, JDOHelper * delegates to all registered instances of StateInterrogation until * an instance can handle the request. *

For JDOHelper isXXX methods, which return boolean, the * corresponding method in StateInterrogation returns Boolean. If the * return value is null then the StateInterrogation does * not recognize the parameter as being handled by it. A non-null return * value indicates that the implementation has determined the answer. *

For JDOHelper getXXX methods, which return an Object, each * registered StateInterrogation is given the parameter until one of * them returns a non-null value, which is passed to the caller. *

For JDOHelper makeDirty, each * registered StateInterrogation is given the parameter until one of * them returns true, indicating that it has handled the call. * An instance that implements this interface must be registered with the * {@link JDOImplHelper}. * @version 2.0 * @since 2.0 */ public interface StateInterrogation { /** Tests whether the parameter instance is persistent. * * Instances that represent persistent objects in the data store * return Boolean.TRUE. * *

Instances known by the implementation to be non-persistent * return Boolean.FALSE. * *

Instances not recognized by the implementation return * null. * * @see PersistenceManager#makePersistent(Object pc) * @see PersistenceCapable#jdoIsPersistent() * @param pc the instance. * @return Boolean.TRUE if the parameter instance is persistent. */ Boolean isPersistent (Object pc); /** Tests whether the parameter instance is transactional. * * Instances whose state is associated with the current transaction * return Boolean.TRUE. * *

Instances known by the implementation to be non-transactional * return Boolean.FALSE. * *

Instances not recognized by the implementation return * null. * * @see PersistenceCapable#jdoIsTransactional() * @param pc the instance. * @return Boolean.TRUE if the parameter instance is transactional. */ Boolean isTransactional (Object pc); /** Tests whether the parameter instance is dirty. * * Instances that have been modified, deleted, newly * made persistent in the current transaction, * or modified while detached return Boolean.TRUE. * *

Instances known by the implementation to be non-dirty * return Boolean.FALSE. * *

Instances not recognized by the implementation return * null. * * @see StateManager#makeDirty(PersistenceCapable pc, String fieldName) * @see PersistenceCapable#jdoIsDirty() * @param pc the instance. * @return Boolean.TRUE if the parameter instance has been modified * in the current transaction, or while detached. */ Boolean isDirty (Object pc); /** Tests whether the parameter instance has been newly made persistent. * * Instances that have been made persistent in the current transaction * return Boolean.TRUE. * *

Instances known by the implementation to be non-new * return Boolean.FALSE. * *

Instances not recognized by the implementation return * null. * * @see PersistenceManager#makePersistent(Object pc) * @see PersistenceCapable#jdoIsNew() * @param pc the instance. * @return Boolean.TRUE if the parameter instance was made persistent * in the current transaction. */ Boolean isNew (Object pc); /** Tests whether the parameter instance has been deleted. * * Instances that have been deleted in the current transaction * return Boolean.TRUE. * *

Instances known by the implementation to be non-deleted * return Boolean.FALSE. * *

Instances not recognized by the implementation return * null. * * @see PersistenceManager#deletePersistent(Object pc) * @see PersistenceCapable#jdoIsDeleted() * @param pc the instance. * @return Boolean.TRUE if the parameter instance was deleted * in the current transaction. */ Boolean isDeleted (Object pc); /** Tests whether the parameter instance is detached. * * Instances that are detached return Boolean.TRUE. * *

Instances known by the implementation to be non-detached * return Boolean.FALSE. * *

Instances not recognized by the implementation return * null. * * @see PersistenceManager#detachCopy(Object pc) * @see PersistenceCapable#jdoIsDeleted() * @param pc the instance. * @return Boolean.TRUE if the parameter instance is detached. */ Boolean isDetached (Object pc); /** Return the associated PersistenceManager if there is one. * Transactional and persistent instances return the associated * PersistenceManager. * *

Transient non-transactional instances return null. *

Instances unknown by the implementation return null. * @see PersistenceCapable#jdoGetPersistenceManager() * @param pc the instance. * @return the PersistenceManager associated with the * parameter instance. */ PersistenceManager getPersistenceManager (Object pc); /** Return a copy of the JDO identity associated with the parameter * instance. * *

Persistent instances of PersistenceCapable classes * have a JDO identity * managed by the PersistenceManager. This method returns * a copy of the * ObjectId that represents the JDO identity. * *

Instances unknown by the implementation return null. *

The ObjectId may be serialized * and later restored, and used with a PersistenceManager * from the same JDO * implementation to locate a persistent instance with the same data store * identity. * *

If the JDO identity is managed by the application, then the ObjectId * may be used with a PersistenceManager from any JDO * implementation that supports * the PersistenceCapable class. * *

If the JDO identity is not managed by the application or the data * store, then the ObjectId returned is only valid within the current * transaction. *

* @see PersistenceManager#getObjectId(Object pc) * @see PersistenceCapable#jdoGetObjectId() * @see PersistenceManager#getObjectById(Object oid, boolean validate) * @param pc the instance. * @return a copy of the ObjectId of the parameter instance as of the * beginning of the transaction. */ Object getObjectId (Object pc); /** Return a copy of the JDO identity associated with the parameter * instance. * *

Instances unknown by the implementation return null. * @see PersistenceCapable#jdoGetTransactionalObjectId() * @see PersistenceManager#getObjectById(Object oid, boolean validate) * @param pc the instance. * @return a copy of the ObjectId of the parameter instance as modified * in this transaction. */ Object getTransactionalObjectId (Object pc); /** Return the version of the parameter instance. * *

Instances unknown by the implementation return null. * @see PersistenceCapable#jdoGetVersion() * @param pc the instance. * @return a copy of the ObjectId of the parameter instance as modified * in this transaction. */ Object getVersion (Object pc); /** Explicitly mark the parameter instance and field dirty. * Normally, PersistenceCapable classes are able to detect * changes made * to their fields. However, if a reference to an array is given to a * method outside the class, and the array is modified, then the * persistent instance is not aware of the change. This API allows the * application to notify the instance that a change was made to a field. * *

Instances unknown by the implementation are unaffected. * @see PersistenceCapable#jdoMakeDirty(String fieldName) * @param pc the instance. * @param fieldName the name of the field to be marked dirty. */ boolean makeDirty (Object pc, String fieldName); } api/src/java/javax/jdo/spi/StateManager.java100664 54736 12500110371 21303 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.spi; import javax.jdo.PersistenceManager; /** This interface is the point of contact between managed instances of * PersistenceCapable classes and the JDO implementation. It * contains the methods used by PersistenceCapable instances to * delegate behavior to the JDO implementation. *

Each managed PersistenceCapable instance contains a reference * to a StateManager. A StateManager might manage one * or multiple instances of PersistenceCapable instances, at the * choice of the implementation. * * @version 2.0 * */ public interface StateManager { /** The owning StateManager uses this method to supply the * value of the flags to the PersistenceCapable instance. * @param pc the calling PersistenceCapable instance * @return the value of jdoFlags to be stored in the * PersistenceCapable instance */ byte replacingFlags(PersistenceCapable pc); /** Replace the current value of jdoStateManager. *

* This method is called by the PersistenceCapable whenever * jdoReplaceStateManager is called and there is already * an owning StateManager. This is a security precaution * to ensure that the owning StateManager is the only * source of any change to its reference in the * PersistenceCapable. * @return the new value for the jdoStateManager * @param pc the calling PersistenceCapable instance * @param sm the proposed new value for the jdoStateManager */ StateManager replacingStateManager (PersistenceCapable pc, StateManager sm); /** Tests whether this object is dirty. * * Instances that have been modified, deleted, or newly * made persistent in the current transaction return true. * *

Transient nontransactional instances return false. *

* @see PersistenceCapable#jdoMakeDirty(String fieldName) * @param pc the calling PersistenceCapable instance * @return true if this instance has been modified in the * current transaction. */ boolean isDirty(PersistenceCapable pc); /** Tests whether this object is transactional. * * Instances that respect transaction boundaries return true. * These instances include transient instances made transactional as a * result of being the target of a makeTransactional method * call; newly made persistent or deleted persistent instances; persistent * instances read in data store transactions; and persistent instances * modified in optimistic transactions. * *

Transient nontransactional instances return false. *

* @param pc the calling PersistenceCapable instance * @return true if this instance is transactional. */ boolean isTransactional(PersistenceCapable pc); /** Tests whether this object is persistent. * * Instances whose state is stored in the data store return * true. * *

Transient instances return false. *

* @see PersistenceManager#makePersistent(Object pc) * @param pc the calling PersistenceCapable instance * @return true if this instance is persistent. */ boolean isPersistent(PersistenceCapable pc); /** Tests whether this object has been newly made persistent. * * Instances that have been made persistent in the current transaction * return true. * *

Transient instances return false. *

* @see PersistenceManager#makePersistent(Object pc) * @param pc the calling PersistenceCapable instance * @return true if this instance was made persistent * in the current transaction. */ boolean isNew(PersistenceCapable pc); /** Tests whether this object has been deleted. * * Instances that have been deleted in the current transaction return * true. * *

Transient instances return false. *

* @see PersistenceManager#deletePersistent(Object pc) * @param pc the calling PersistenceCapable instance * @return true if this instance was deleted * in the current transaction. */ boolean isDeleted(PersistenceCapable pc); /** Return the PersistenceManager that owns this instance. * @param pc the calling PersistenceCapable instance * @return the PersistenceManager that owns this instance */ PersistenceManager getPersistenceManager (PersistenceCapable pc); /** Mark the associated PersistenceCapable field dirty. *

The StateManager will make a copy of the field * so it can be restored if needed later, and then mark * the field as modified in the current transaction. * @param pc the calling PersistenceCapable instance * @param fieldName the name of the field */ void makeDirty (PersistenceCapable pc, String fieldName); /** Return the object representing the JDO identity * of the calling instance. If the JDO identity is being changed in * the current transaction, this method returns the identity as of * the beginning of the transaction. * @param pc the calling PersistenceCapable instance * @return the object representing the JDO identity of the calling instance */ Object getObjectId (PersistenceCapable pc); /** Return the object representing the JDO identity * of the calling instance. If the JDO identity is being changed in * the current transaction, this method returns the current identity as * changed in the transaction. * @param pc the calling PersistenceCapable instance * @return the object representing the JDO identity of the calling instance */ Object getTransactionalObjectId (PersistenceCapable pc); /** Return the object representing the version * of the calling instance. * @param pc the calling PersistenceCapable instance * @return the object representing the version of the calling instance * @since 2.0 */ Object getVersion (PersistenceCapable pc); /** Return true if the field is cached in the calling * instance. * @param pc the calling PersistenceCapable instance * @param field the field number * @return whether the field is cached in the calling instance */ boolean isLoaded (PersistenceCapable pc, int field); /** Guarantee that the serializable transactional and persistent fields * are loaded into the instance. This method is called by the generated * jdoPreSerialize method prior to serialization of the * instance. * @param pc the calling PersistenceCapable instance */ void preSerialize (PersistenceCapable pc); /** Return the value for the field. * @param pc the calling PersistenceCapable instance * @param field the field number * @param currentValue the current value of the field * @return the new value for the field */ boolean getBooleanField ( PersistenceCapable pc, int field, boolean currentValue); /** Return the value for the field. * @param pc the calling PersistenceCapable instance * @param field the field number * @param currentValue the current value of the field * @return the new value for the field */ char getCharField (PersistenceCapable pc, int field, char currentValue); /** Return the value for the field. * @param pc the calling PersistenceCapable instance * @param field the field number * @param currentValue the current value of the field * @return the new value for the field */ byte getByteField (PersistenceCapable pc, int field, byte currentValue); /** Return the value for the field. * @param pc the calling PersistenceCapable instance * @param field the field number * @param currentValue the current value of the field * @return the new value for the field */ short getShortField (PersistenceCapable pc, int field, short currentValue); /** Return the value for the field. * @param pc the calling PersistenceCapable instance * @param field the field number * @param currentValue the current value of the field * @return the new value for the field */ int getIntField (PersistenceCapable pc, int field, int currentValue); /** Return the value for the field. * @param pc the calling PersistenceCapable instance * @param field the field number * @param currentValue the current value of the field * @return the new value for the field */ long getLongField (PersistenceCapable pc, int field, long currentValue); /** Return the value for the field. * @param pc the calling PersistenceCapable instance * @param field the field number * @param currentValue the current value of the field * @return the new value for the field */ float getFloatField (PersistenceCapable pc, int field, float currentValue); /** Return the value for the field. * @param pc the calling PersistenceCapable instance * @param field the field number * @param currentValue the current value of the field * @return the new value for the field */ double getDoubleField (PersistenceCapable pc, int field, double currentValue); /** Return the value for the field. * @param pc the calling PersistenceCapable instance * @param field the field number * @param currentValue the current value of the field * @return the new value for the field */ String getStringField (PersistenceCapable pc, int field, String currentValue); /** Return the value for the field. * @param pc the calling PersistenceCapable instance * @param field the field number * @param currentValue the current value of the field * @return the new value for the field */ Object getObjectField (PersistenceCapable pc, int field, Object currentValue); /** Mark the field as modified by the user. * @param pc the calling PersistenceCapable instance * @param field the field number * @param currentValue the current value of the field * @param newValue the proposed new value of the field */ void setBooleanField (PersistenceCapable pc, int field, boolean currentValue, boolean newValue); /** Mark the field as modified by the user. * @param pc the calling PersistenceCapable instance * @param field the field number * @param currentValue the current value of the field * @param newValue the proposed new value of the field */ void setCharField (PersistenceCapable pc, int field, char currentValue, char newValue); /** Mark the field as modified by the user. * @param pc the calling PersistenceCapable instance * @param field the field number * @param currentValue the current value of the field * @param newValue the proposed new value of the field */ void setByteField (PersistenceCapable pc, int field, byte currentValue, byte newValue); /** Mark the field as modified by the user. * @param pc the calling PersistenceCapable instance * @param field the field number * @param currentValue the current value of the field * @param newValue the proposed new value of the field */ void setShortField (PersistenceCapable pc, int field, short currentValue, short newValue); /** Mark the field as modified by the user. * @param pc the calling PersistenceCapable instance * @param field the field number * @param currentValue the current value of the field * @param newValue the proposed new value of the field */ void setIntField (PersistenceCapable pc, int field, int currentValue, int newValue); /** Mark the field as modified by the user. * @param pc the calling PersistenceCapable instance * @param field the field number * @param currentValue the current value of the field * @param newValue the proposed new value of the field */ void setLongField (PersistenceCapable pc, int field, long currentValue, long newValue); /** Mark the field as modified by the user. * @param pc the calling PersistenceCapable instance * @param field the field number * @param currentValue the current value of the field * @param newValue the proposed new value of the field */ void setFloatField (PersistenceCapable pc, int field, float currentValue, float newValue); /** Mark the field as modified by the user. * @param pc the calling PersistenceCapable instance * @param field the field number * @param currentValue the current value of the field * @param newValue the proposed new value of the field */ void setDoubleField (PersistenceCapable pc, int field, double currentValue, double newValue); /** Mark the field as modified by the user. * @param pc the calling PersistenceCapable instance * @param field the field number * @param currentValue the current value of the field * @param newValue the proposed new value of the field */ void setStringField (PersistenceCapable pc, int field, String currentValue, String newValue); /** Mark the field as modified by the user. * @param pc the calling PersistenceCapable instance * @param field the field number * @param currentValue the current value of the field * @param newValue the proposed new value of the field */ void setObjectField (PersistenceCapable pc, int field, Object currentValue, Object newValue); /** The value of the field requested to be provided to the * StateManager. * @param pc the calling PersistenceCapable instance * @param field the field number * @param currentValue the current value of the field */ void providedBooleanField (PersistenceCapable pc, int field, boolean currentValue); /** The value of the field requested to be provided to the * StateManager. * @param pc the calling PersistenceCapable instance * @param field the field number * @param currentValue the current value of the field */ void providedCharField (PersistenceCapable pc, int field, char currentValue); /** The value of the field requested to be provided to the * StateManager. * @param pc the calling PersistenceCapable instance * @param field the field number * @param currentValue the current value of the field */ void providedByteField (PersistenceCapable pc, int field, byte currentValue); /** The value of the field requested to be provided to the * StateManager. * @param pc the calling PersistenceCapable instance * @param field the field number * @param currentValue the current value of the field */ void providedShortField (PersistenceCapable pc, int field, short currentValue); /** The value of the field requested to be provided to the * StateManager. * @param pc the calling PersistenceCapable instance * @param field the field number * @param currentValue the current value of the field */ void providedIntField (PersistenceCapable pc, int field, int currentValue); /** The value of the field requested to be provided to the * StateManager. * @param pc the calling PersistenceCapable instance * @param field the field number * @param currentValue the current value of the field */ void providedLongField (PersistenceCapable pc, int field, long currentValue); /** The value of the field requested to be provided to the * StateManager. * @param pc the calling PersistenceCapable instance * @param field the field number * @param currentValue the current value of the field */ void providedFloatField (PersistenceCapable pc, int field, float currentValue); /** The value of the field requested to be provided to the * StateManager. * @param pc the calling PersistenceCapable instance * @param field the field number * @param currentValue the current value of the field */ void providedDoubleField (PersistenceCapable pc, int field, double currentValue); /** The value of the field requested to be provided to the * StateManager. * @param pc the calling PersistenceCapable instance * @param field the field number * @param currentValue the current value of the field */ void providedStringField (PersistenceCapable pc, int field, String currentValue); /** The value of the field requested to be provided to the * StateManager. * @param pc the calling PersistenceCapable instance * @param field the field number * @param currentValue the current value of the field */ void providedObjectField (PersistenceCapable pc, int field, Object currentValue); /** The replacement value of the field in the calling instance. * @param pc the calling PersistenceCapable instance * @param field the field number * @return the new value for the field */ boolean replacingBooleanField (PersistenceCapable pc, int field); /** The replacement value of the field in the calling instance. * @param pc the calling PersistenceCapable instance * @param field the field number * @return the new value for the field */ char replacingCharField (PersistenceCapable pc, int field); /** The replacement value of the field in the calling instance. * @param pc the calling PersistenceCapable instance * @param field the field number * @return the new value for the field */ byte replacingByteField (PersistenceCapable pc, int field); /** The replacement value of the field in the calling instance. * @param pc the calling PersistenceCapable instance * @param field the field number * @return the new value for the field */ short replacingShortField (PersistenceCapable pc, int field); /** The replacement value of the field in the calling instance. * @param pc the calling PersistenceCapable instance * @param field the field number * @return the new value for the field */ int replacingIntField (PersistenceCapable pc, int field); /** The replacement value of the field in the calling instance. * @param pc the calling PersistenceCapable instance * @param field the field number * @return the new value for the field */ long replacingLongField (PersistenceCapable pc, int field); /** The replacement value of the field in the calling instance. * @param pc the calling PersistenceCapable instance * @param field the field number * @return the new value for the field */ float replacingFloatField (PersistenceCapable pc, int field); /** The replacement value of the field in the calling instance. * @param pc the calling PersistenceCapable instance * @param field the field number * @return the new value for the field */ double replacingDoubleField (PersistenceCapable pc, int field); /** The replacement value of the field in the calling instance. * @param pc the calling PersistenceCapable instance * @param field the field number * @return the new value for the field */ String replacingStringField (PersistenceCapable pc, int field); /** The replacement value of the field in the calling instance. * @param pc the calling PersistenceCapable instance * @param field the field number * @return the new value for the field */ Object replacingObjectField (PersistenceCapable pc, int field); /** The replacement value of the detached state in the calling instance. * @param pc the calling Detachable instance * @param state the current value of the detached state * @return the replacement value for the detached state * @since 2.0 */ Object[] replacingDetachedState (Detachable pc, Object[] state); } api/src/java/javax/jdo/Transaction.java100664 24104 12500110371 20404 0ustarmbouschenstaff 0 0 /* * 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. */ /* * Transaction.java * */ package javax.jdo; import javax.transaction.Synchronization; /** The JDO Transaction interface provides for initiation and * completion of transactions under user control. * It is a sub-interface of the {@link PersistenceManager} * that deals with options and transaction demarcation. *

Transaction options include whether optimistic concurrency * control should be used for the current transaction, whether instances * may hold values in the cache outside transactions, and whether * values should be retained in the cache after transaction completion. These * options are valid for both managed and non-managed transactions. * *

Transaction initiation and completion methods have similar semantics to * javax.transaction.UserTransaction when used outside a managed * environment. When used in a managed environment, transaction initiation * and completion methods may only be used with bean-managed transaction * semantics. * @version 3.0 */ public interface Transaction { /** Begin a transaction. The type of transaction is determined by the * setting of the Optimistic flag. * @see #setOptimistic * @see #getOptimistic * @throws JDOUserException if transactions are managed by a container * in the managed environment, or if the transaction is already active. */ void begin(); /** Commit the current transaction. * @throws JDOUserException if transactions are managed by a container * in the managed environment, or if the transaction is not active. */ void commit(); /** Roll back the current transaction. * @throws JDOUserException if transactions are managed by a container * in the managed environment, or if the transaction is not active. */ void rollback(); /** Returns whether there is a transaction currently active. * @return true if the transaction is active. */ boolean isActive(); /** * Returns the rollback-only status of the transaction. When * begun, the rollback-only status is false. Either the * application or the JDO implementation may set this flag * using setRollbackOnly. * @return true if the transaction has been * marked for rollback. * @since 2.0 */ boolean getRollbackOnly(); /** * Sets the rollback-only status of the transaction to true. * After this flag is set to true, the transaction * can no longer be committed, and any attempt to commit the * transaction will throw JDOFatalDataStoreException. * @since 2.0 */ void setRollbackOnly(); /** If true, allow persistent instances to be read without * a transaction active. * If an implementation does not support this option, a * JDOUnsupportedOptionException is thrown. * @param nontransactionalRead the value of the nontransactionalRead * property */ void setNontransactionalRead (boolean nontransactionalRead); /** If true, allows persistent instances to be read without * a transaction active. * @return the value of the nontransactionalRead property */ boolean getNontransactionalRead (); /** If true, allow persistent instances to be written without * a transaction active. * If an implementation does not support this option, a * JDOUnsupportedOptionException is thrown. * @param nontransactionalWrite the value of the nontransactionalRead * property */ void setNontransactionalWrite (boolean nontransactionalWrite); /** If true, allows persistent instances to be written without * a transaction active. * @return the value of the nontransactionalWrite property */ boolean getNontransactionalWrite (); /** If true, at commit instances retain their values and the * instances transition to persistent-nontransactional. * If an implementation does not support this option, a * JDOUnsupportedOptionException is thrown. * @param retainValues the value of the retainValues property */ void setRetainValues(boolean retainValues); /** If true, at commit time instances retain their field * values. * @return the value of the retainValues property */ boolean getRetainValues(); /** If true, at rollback, fields of newly persistent instances * are restored to * their values as of the beginning of the transaction, and the instances * revert to transient. Additionally, fields of modified * instances of primitive types and immutable reference types * are restored to their values as of the beginning of the * transaction. *

If false, at rollback, the values of fields of * newly persistent instances are unchanged and the instances revert to * transient. Additionally, dirty instances transition to hollow. * If an implementation does not support this option, a * JDOUnsupportedOptionException is thrown. * @param restoreValues the value of the restoreValues property */ void setRestoreValues(boolean restoreValues); /** Return the current value of the restoreValues property. * @return the value of the restoreValues property */ boolean getRestoreValues(); /** Optimistic transactions do not hold data store locks until commit time. * If an implementation does not support this option, a * JDOUnsupportedOptionException is thrown. * @param optimistic the value of the Optimistic flag. */ void setOptimistic(boolean optimistic); /** Optimistic transactions do not hold data store locks until commit time. * @return the value of the Optimistic property. */ boolean getOptimistic(); /** Get the value for transaction isolation level for this transaction. * @return the transaction isolation level * @see #setIsolationLevel(String) * @since 2.2 */ String getIsolationLevel(); /** Set the value for transaction isolation level for this transaction. * Transaction isolation levels are defined in javax.jdo.Constants. * If the requested level is not available, but a higher level is * available, the higher level is silently used. * If the requested level is not available, and no higher level is * available, then JDOUnsupportedOptionException is thrown. * Five standard isolation levels are defined. Other isolation levels * might be supported by an implementation but are not standard. *

Standard values in order of low to high are: *

  • read-uncommitted *
  • read-committed *
  • repeatable-read *
  • snapshot *
  • serializable *
* @param level the transaction isolation level * @see #getIsolationLevel() * @see Constants#TX_READ_UNCOMMITTED * @see Constants#TX_READ_COMMITTED * @see Constants#TX_REPEATABLE_READ * @see Constants#TX_SNAPSHOT * @see Constants#TX_SERIALIZABLE * @since 2.2 */ void setIsolationLevel(String level); /** The user can specify a Synchronization instance to be * notified on transaction completions. The beforeCompletion * method is called prior to flushing instances to the data store. * *

The afterCompletion method is called after performing * state transitions of persistent and transactional instances, following * the data store commit or rollback operation. *

Only one Synchronization instance can be registered with * the Transaction. If the application requires more than one * instance to receive synchronization callbacks, then the single * application instance is responsible for managing them, and forwarding * callbacks to them. * @param sync the Synchronization instance to be notified; * null for none */ void setSynchronization(Synchronization sync); /** The user-specified Synchronization instance for this * Transaction instance. * @return the user-specified Synchronization instance. */ Synchronization getSynchronization(); /** The Transaction instance is always associated with exactly * one PersistenceManager. * * @return the PersistenceManager for this * Transaction instance */ PersistenceManager getPersistenceManager(); /** * If true, a lock will be applied to all objects read in this * transaction. *

If false then retrieved objects will not be locked. * If null will fallback to the value for metadata for the class in question. * @param serialize the value of the serializeRead property * @since 3.0 */ void setSerializeRead(Boolean serialize); /** * Return the current value of the serializeRead property. * @return the value of the serializeRead property * @since 3.0 */ Boolean getSerializeRead(); } api/src/schema/javax/jdo/jdo_2_0.dtd100664 26232 12500110371 17510 0ustarmbouschenstaff 0 0 api/src/schema/javax/jdo/jdo_2_0.xsd100664 140347 12500110371 17557 0ustarmbouschenstaff 0 0 api/src/schema/javax/jdo/jdo_2_1.xsd100664 143370 12500110371 17557 0ustarmbouschenstaff 0 0 Please note, the following subelements must not occur more than once: - datastore-identity - primary-key - inheritance - version Please note, the following subelements must not occur more than once: - the choice of array, collection and map, - join - embedded - key - value - order - foreign-key - index - unique Please note, the following subelements must not occur more than once: - datastore-identity - primary-key - inheritance - version Please note, the following subelements must not occur more than once: - primary-key - foreign-key - index - unique Please note, the following subelements must not occur more than once: - index Please note, the following subelements must not occur more than once: - join - discriminator Please note, the following subelements must not occur more than once: - index Please note, the following subelements must not occur more than once: - the choice of array, collection, and map - join - embedded - key - value - order - foreign-key - index - unique Please note, the following subelements must not occur more than once: - the choice of columns, fields and properties Please note, the following subelements must not occur more than once: - embedded - foreign-key - index - unique Please note, the following subelements must not occur more than once: - embedded - foreign-key - index - unique Please note, the following subelements must not occur more than once: - embedded - foreign-key - index - unique Please note, the following subelements must not occur more than once: - index Please note, the following subelements must not occur more than once: - the choice of columns, fields or properties Please note, the following subelements must not occur more than once: - the choice of columns, fields or properties api/src/schema/javax/jdo/jdo_2_2.dtd100664 27111 12500110371 17507 0ustarmbouschenstaff 0 0 api/src/schema/javax/jdo/jdo_2_2.xsd100664 146000 12500110371 17551 0ustarmbouschenstaff 0 0 Please note, the following subelements must not occur more than once: - datastore-identity - primary-key - inheritance - version Please note, the following subelements must not occur more than once: - the choice of array, collection and map, - join - embedded - key - value - order - foreign-key - index - unique Please note, the following subelements must not occur more than once: - datastore-identity - primary-key - inheritance - version Please note, the following subelements must not occur more than once: - primary-key - foreign-key - index - unique Please note, the following subelements must not occur more than once: - index Please note, the following subelements must not occur more than once: - join - discriminator Please note, the following subelements must not occur more than once: - index Please note, the following subelements must not occur more than once: - the choice of array, collection, and map - join - embedded - key - value - order - foreign-key - index - unique Please note, the following subelements must not occur more than once: - the choice of columns, fields and properties Please note, the following subelements must not occur more than once: - embedded - foreign-key - index - unique Please note, the following subelements must not occur more than once: - embedded - foreign-key - index - unique Please note, the following subelements must not occur more than once: - embedded - foreign-key - index - unique Please note, the following subelements must not occur more than once: - index Please note, the following subelements must not occur more than once: - the choice of columns, fields or properties Please note, the following subelements must not occur more than once: - the choice of columns, fields or properties api/src/schema/javax/jdo/jdo_3_0.dtd100664 27267 12500110371 17522 0ustarmbouschenstaff 0 0 api/src/schema/javax/jdo/jdo_3_0.xsd100664 147220 12500110371 17555 0ustarmbouschenstaff 0 0 Please note, the following subelements must not occur more than once: - datastore-identity - primary-key - inheritance - version Please note, the following subelements must not occur more than once: - the choice of array, collection and map, - join - embedded - key - value - order - foreign-key - index - unique Please note, the following subelements must not occur more than once: - datastore-identity - primary-key - inheritance - version Please note, the following subelements must not occur more than once: - primary-key - foreign-key - index - unique Please note, the following subelements must not occur more than once: - index Please note, the following subelements must not occur more than once: - join - discriminator Please note, the following subelements must not occur more than once: - index Please note, the following subelements must not occur more than once: - the choice of array, collection, and map - join - embedded - key - value - order - foreign-key - index - unique Please note, the following subelements must not occur more than once: - the choice of columns, fields and properties Please note, the following subelements must not occur more than once: - embedded - foreign-key - index - unique Please note, the following subelements must not occur more than once: - embedded - foreign-key - index - unique Please note, the following subelements must not occur more than once: - embedded - foreign-key - index - unique Please note, the following subelements must not occur more than once: - index Please note, the following subelements must not occur more than once: - the choice of columns, fields or properties Please note, the following subelements must not occur more than once: - the choice of columns, fields or properties api/src/schema/javax/jdo/jdo_3_1.dtd100664 27525 12500110371 17520 0ustarmbouschenstaff 0 0 api/src/schema/javax/jdo/jdo_3_1.xsd100664 147531 12500110371 17563 0ustarmbouschenstaff 0 0 Please note, the following subelements must not occur more than once: - datastore-identity - primary-key - inheritance - version Please note, the following subelements must not occur more than once: - the choice of array, collection and map, - join - embedded - key - value - order - foreign-key - index - unique Please note, the following subelements must not occur more than once: - datastore-identity - primary-key - inheritance - version Please note, the following subelements must not occur more than once: - primary-key - foreign-key - index - unique Please note, the following subelements must not occur more than once: - index Please note, the following subelements must not occur more than once: - join - discriminator Please note, the following subelements must not occur more than once: - index Please note, the following subelements must not occur more than once: - the choice of array, collection, and map - join - embedded - key - value - order - foreign-key - index - unique Please note, the following subelements must not occur more than once: - the choice of columns, fields and properties Please note, the following subelements must not occur more than once: - embedded - foreign-key - index - unique Please note, the following subelements must not occur more than once: - embedded - foreign-key - index - unique Please note, the following subelements must not occur more than once: - embedded - foreign-key - index - unique Please note, the following subelements must not occur more than once: - index Please note, the following subelements must not occur more than once: - the choice of columns, fields or properties Please note, the following subelements must not occur more than once: - the choice of columns, fields or properties api/src/schema/javax/jdo/jdoconfig_2_1.dtd100664 5402 12500110371 20653 0ustarmbouschenstaff 0 0 api/src/schema/javax/jdo/jdoconfig_2_1.xsd100664 23162 12500110371 20721 0ustarmbouschenstaff 0 0 This is the XML Schema for the JDO configuration file. The root configuration element for JDO. Standard JDO PersistenceManagerFactory configuration properties. Vendor-specific properties are set using additional vendor-specific attributes and/or property elements. Vendor-specific properties. javax.jdo.listener.InstanceLifecycleListener instance configuration. There is one instance-lifecycle-listener element per listener instance. Only one instance of the listener class is supported in this configuration file. If multiple instances of the same listener class is required, then the API PersistenceManagerFactory.addInstanceLifecycleListener(...) must be used. If attribute "classes" is missing, all persistence-capable instances are observed, otherwise it is a comma- or whitespace-delimited list of persistence-capable classes whose instances' will be observed. These are attributes corresponding to the standard properties defined in JDO 2.1. Any other attributes present, if unrecognized by a JDO implementation, may be silently ignored. api/src/schema/javax/jdo/jdoconfig_2_2.dtd100664 5637 12500110371 20666 0ustarmbouschenstaff 0 0 api/src/schema/javax/jdo/jdoconfig_2_2.xsd100664 20454 12500110371 20723 0ustarmbouschenstaff 0 0 This is the XML Schema for the JDO configuration file. The root configuration element for JDO. Standard JDO PersistenceManagerFactory configuration properties. Vendor-specific properties are set using additional vendor-specific attributes and/or property elements. Vendor-specific properties. javax.jdo.listener.InstanceLifecycleListener instance configuration. There is one instance-lifecycle-listener element per listener instance. Only one instance of the listener class is supported in this configuration file. If multiple instances of the same listener class is required, then the API PersistenceManagerFactory.addInstanceLifecycleListener(...) must be used. If attribute "classes" is missing, all persistence-capable instances are observed; otherwise it is a comma- or whitespace-delimited list of persistence-capable classes whose instances will be observed. These are attributes corresponding to the standard properties defined in JDO. Any other attributes present, if unrecognized by a JDO implementation, may be silently ignored. api/src/schema/javax/jdo/jdoconfig_3_0.dtd100664 6110 12500110371 20650 0ustarmbouschenstaff 0 0 api/src/schema/javax/jdo/jdoconfig_3_0.xsd100664 21174 12500110371 20722 0ustarmbouschenstaff 0 0 This is the XML Schema for the JDO configuration file. The root configuration element for JDO. Standard JDO PersistenceManagerFactory configuration properties. Vendor-specific properties are set using additional vendor-specific attributes and/or property elements. Vendor-specific properties. javax.jdo.listener.InstanceLifecycleListener instance configuration. There is one instance-lifecycle-listener element per listener instance. Only one instance of the listener class is supported in this configuration file. If multiple instances of the same listener class is required, then the API PersistenceManagerFactory.addInstanceLifecycleListener(...) must be used. If attribute "classes" is missing, all persistence-capable instances are observed; otherwise it is a comma- or whitespace-delimited list of persistence-capable classes whose instances will be observed. These are attributes corresponding to the standard properties defined in JDO. Any other attributes present, if unrecognized by a JDO implementation, may be silently ignored. api/src/schema/javax/jdo/jdoconfig_3_1.dtd100664 6110 12500110371 20651 0ustarmbouschenstaff 0 0 api/src/schema/javax/jdo/jdoconfig_3_1.xsd100664 21174 12500110371 20723 0ustarmbouschenstaff 0 0 This is the XML Schema for the JDO configuration file. The root configuration element for JDO. Standard JDO PersistenceManagerFactory configuration properties. Vendor-specific properties are set using additional vendor-specific attributes and/or property elements. Vendor-specific properties. javax.jdo.listener.InstanceLifecycleListener instance configuration. There is one instance-lifecycle-listener element per listener instance. Only one instance of the listener class is supported in this configuration file. If multiple instances of the same listener class is required, then the API PersistenceManagerFactory.addInstanceLifecycleListener(...) must be used. If attribute "classes" is missing, all persistence-capable instances are observed; otherwise it is a comma- or whitespace-delimited list of persistence-capable classes whose instances will be observed. These are attributes corresponding to the standard properties defined in JDO. Any other attributes present, if unrecognized by a JDO implementation, may be silently ignored. api/src/schema/javax/jdo/jdoquery_2_0.dtd100664 3356 12500110371 20560 0ustarmbouschenstaff 0 0 api/src/schema/javax/jdo/jdoquery_2_0.xsd100664 12060 12500110371 20613 0ustarmbouschenstaff 0 0 api/src/schema/javax/jdo/jdoquery_2_1.xsd100664 10741 12500110371 20620 0ustarmbouschenstaff 0 0 api/src/schema/javax/jdo/jdoquery_2_2.dtd100664 3356 12500110371 20562 0ustarmbouschenstaff 0 0 api/src/schema/javax/jdo/jdoquery_2_2.xsd100664 10741 12500110371 20621 0ustarmbouschenstaff 0 0 api/src/schema/javax/jdo/jdoquery_3_0.dtd100664 3553 12500110371 20560 0ustarmbouschenstaff 0 0 api/src/schema/javax/jdo/jdoquery_3_0.xsd100664 11134 12500110371 20615 0ustarmbouschenstaff 0 0 api/src/schema/javax/jdo/jdoquery_3_1.dtd100664 3553 12500110371 20561 0ustarmbouschenstaff 0 0 api/src/schema/javax/jdo/jdoquery_3_1.xsd100664 11134 12500110371 20616 0ustarmbouschenstaff 0 0 api/src/schema/javax/jdo/orm_2_0.dtd100664 20213 12500110371 17522 0ustarmbouschenstaff 0 0 api/src/schema/javax/jdo/orm_2_0.xsd100664 103173 12500110371 17574 0ustarmbouschenstaff 0 0 api/src/schema/javax/jdo/orm_2_1.xsd100664 106115 12500110371 17574 0ustarmbouschenstaff 0 0 Please note, the following subelements must not occur more than once: - datastore-identity - primary-key - inheritance - version Please note, the following subelements must not occur more than once: - join - embedded - key - value - order - foreign-key - index - unique Please note, the following subelements must not occur more than once: - datastore-identity - primary-key - inheritance - version Please note, the following subelements must not occur more than once: - primary-key - foreign-key - index - unique Please note, the following subelements must not occur more than once: - index Please note, the following subelements must not occur more than once: - join - discriminator Please note, the following subelements must not occur more than once: - index Please note, the following subelements must not occur more than once: - join - embedded - key - value - order - foreign-key - index - unique Please note, the following subelements must not occur more than once: - the choice of columns, fields and properties Please note, the following subelements must not occur more than once: - embedded - foreign-key - index - unique Please note, the following subelements must not occur more than once: - embedded - foreign-key - index - unique Please note, the following subelements must not occur more than once: - embedded - foreign-key - index - unique Please note, the following subelements must not occur more than once: - index Please note, the following subelements must not occur more than once: - the choice of columns, fields or properties Please note, the following subelements must not occur more than once: - the choice of columns, fields or properties api/src/schema/javax/jdo/orm_2_2.dtd100664 20213 12500110371 17524 0ustarmbouschenstaff 0 0 api/src/schema/javax/jdo/orm_2_2.xsd100664 106115 12500110371 17575 0ustarmbouschenstaff 0 0 Please note, the following subelements must not occur more than once: - datastore-identity - primary-key - inheritance - version Please note, the following subelements must not occur more than once: - join - embedded - key - value - order - foreign-key - index - unique Please note, the following subelements must not occur more than once: - datastore-identity - primary-key - inheritance - version Please note, the following subelements must not occur more than once: - primary-key - foreign-key - index - unique Please note, the following subelements must not occur more than once: - index Please note, the following subelements must not occur more than once: - join - discriminator Please note, the following subelements must not occur more than once: - index Please note, the following subelements must not occur more than once: - join - embedded - key - value - order - foreign-key - index - unique Please note, the following subelements must not occur more than once: - the choice of columns, fields and properties Please note, the following subelements must not occur more than once: - embedded - foreign-key - index - unique Please note, the following subelements must not occur more than once: - embedded - foreign-key - index - unique Please note, the following subelements must not occur more than once: - embedded - foreign-key - index - unique Please note, the following subelements must not occur more than once: - index Please note, the following subelements must not occur more than once: - the choice of columns, fields or properties Please note, the following subelements must not occur more than once: - the choice of columns, fields or properties api/src/schema/javax/jdo/orm_3_0.dtd100664 20213 12500110371 17523 0ustarmbouschenstaff 0 0 api/src/schema/javax/jdo/orm_3_0.xsd100664 106115 12500110371 17574 0ustarmbouschenstaff 0 0 Please note, the following subelements must not occur more than once: - datastore-identity - primary-key - inheritance - version Please note, the following subelements must not occur more than once: - join - embedded - key - value - order - foreign-key - index - unique Please note, the following subelements must not occur more than once: - datastore-identity - primary-key - inheritance - version Please note, the following subelements must not occur more than once: - primary-key - foreign-key - index - unique Please note, the following subelements must not occur more than once: - index Please note, the following subelements must not occur more than once: - join - discriminator Please note, the following subelements must not occur more than once: - index Please note, the following subelements must not occur more than once: - join - embedded - key - value - order - foreign-key - index - unique Please note, the following subelements must not occur more than once: - the choice of columns, fields and properties Please note, the following subelements must not occur more than once: - embedded - foreign-key - index - unique Please note, the following subelements must not occur more than once: - embedded - foreign-key - index - unique Please note, the following subelements must not occur more than once: - embedded - foreign-key - index - unique Please note, the following subelements must not occur more than once: - index Please note, the following subelements must not occur more than once: - the choice of columns, fields or properties Please note, the following subelements must not occur more than once: - the choice of columns, fields or properties api/src/schema/javax/jdo/orm_3_1.dtd100664 20451 12500110371 17530 0ustarmbouschenstaff 0 0 api/src/schema/javax/jdo/orm_3_1.xsd100664 106426 12500110371 17602 0ustarmbouschenstaff 0 0 Please note, the following subelements must not occur more than once: - datastore-identity - primary-key - inheritance - version Please note, the following subelements must not occur more than once: - join - embedded - key - value - order - foreign-key - index - unique Please note, the following subelements must not occur more than once: - datastore-identity - primary-key - inheritance - version Please note, the following subelements must not occur more than once: - primary-key - foreign-key - index - unique Please note, the following subelements must not occur more than once: - index Please note, the following subelements must not occur more than once: - join - discriminator Please note, the following subelements must not occur more than once: - index Please note, the following subelements must not occur more than once: - join - embedded - key - value - order - foreign-key - index - unique Please note, the following subelements must not occur more than once: - the choice of columns, fields and properties Please note, the following subelements must not occur more than once: - embedded - foreign-key - index - unique Please note, the following subelements must not occur more than once: - embedded - foreign-key - index - unique Please note, the following subelements must not occur more than once: - embedded - foreign-key - index - unique Please note, the following subelements must not occur more than once: - index Please note, the following subelements must not occur more than once: - the choice of columns, fields or properties Please note, the following subelements must not occur more than once: - the choice of columns, fields or properties api/test/java/javax/jdo/AbstractJDOConfigTest.java100664 11741 12500110371 22400 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo; import java.net.URL; import java.util.Enumeration; import java.util.Iterator; import java.util.Map; import java.util.Random; import javax.jdo.util.AbstractTest; public abstract class AbstractJDOConfigTest extends AbstractTest { /** * A class path prefix used in the various tests where the class path * needs to be set. */ protected static String JDOCONFIG_CLASSPATH_PREFIX = initJDOConfigClasspathPrefix(); /** * Returns the JDO configuration class path prefix's default value, which is * the project base directory suffixed by the path to the configuration * directory (test/schema/jdoconfig). * * @return the default class path prefix used by this test suite. * */ protected static String initJDOConfigClasspathPrefix() { return initBasedir() + "test/schema/jdoconfig"; } /** * The class path used to specify the location of test class files. * @return the class path where test class files can be found. */ protected static String TEST_CLASSPATH = initTestClasspath(); /** * Returns the default class path for JDO test class files * (target/test-classes/). * @return the default class path for JDO test class files. */ protected static String initTestClasspath() { return initBasedir() + "target/test-classes/"; } /** * The class path used to locate the JDO API class files. */ protected static String API_CLASSPATH = initAPIClasspath(); /** * Returns the default class path for JDO API class files * (target/classes/). * @return the default class path for JDO API class files. */ protected static String initAPIClasspath() { return initBasedir() + "target/classes/"; } /** * Returns the base directory for this project. This base directory * is used to build up the other class paths defined in this test suite. * The value returned is the value returned by * System.getProperty("basedir"). * A trailing slash is appended to the path if it doesn't exist. * * @return the default base directory of the project. */ protected static String initBasedir() { String basedir = System.getProperty("basedir"); if (basedir != null) { if (!basedir.endsWith("/")) { basedir += "/"; } } else { basedir = ""; } return basedir; } /** * A randomizer seeded with the system clock's current time. */ protected static Random RANDOM = new Random(System.currentTimeMillis()); /** * Fails the test if the number of properties in the two specified * {@link java.util.Map Map} objects are not identical or their values * do not match. * @param expected the first {@link java.util.Map Map} object to test. * @param actual the second {@link java.util.Map Map} object to test. */ static void assertEqualProperties(Map expected, Map actual) { Iterator i = expected.entrySet().iterator(); while (i.hasNext()) { Map.Entry entry = (Map.Entry) i.next(); String key = (String) entry.getKey(); String expectedValue = (String) entry.getValue(); String actualValue = (String) actual.get(key); assertEquals( "Actual property at key [" + key + "] with value [" + actualValue + "] not equal to expected value [" + expectedValue + "]", expectedValue, actualValue); } } protected String getPMFClassNameViaServiceLookup(ClassLoader loader) { try { Enumeration urls = JDOHelper.getResources(loader, SERVICE_LOOKUP_PMF_RESOURCE_NAME); while (urls.hasMoreElements()) { // return the first one found return JDOHelper.getClassNameFromURL((URL)urls.nextElement()); } } catch (Exception ex) { // ignore exceptions from i/o errors } return null; } } api/test/java/javax/jdo/annotations/Line.java100664 2006 12500110371 21510 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.annotations; /* * Line.java * * Created on July 18, 2007, 9:41 AM * */ public class Line { /** Creates a new instance of Line */ public Line() { } Point point1; Point point2; } api/test/java/javax/jdo/annotations/Point.java100664 2000 12500110371 21704 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.annotations; /* * Point.java * * Created on July 18, 2007, 9:41 AM * */ public class Point { /** Creates a new instance of Point */ public Point() { } int x; Integer y; } api/test/java/javax/jdo/annotations/TestEmbeddedMap.java100664 4073 12500110371 23616 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.annotations; import java.util.Map; /* * TestEmbeddedMap.java * * Created on July 18, 2007, 10:16 AM * */ public abstract class TestEmbeddedMap { /** Creates a new instance of TestEmbeddedMap */ public TestEmbeddedMap() { } @Persistent(table="INTEGER_LINES", embeddedKey="true", embeddedValue="true") @Join(column="OWNER_FK") @Key(column="INTEGER") @Value( embeddedMapping=@Embedded( members={ @Persistent(name="point1.x", column="POINT1_X"), @Persistent(name="point1.y", column="POINT2_Y"), @Persistent(name="point2.x", column="POINT2_X"), @Persistent(name="point2.y", column="POINT2_Y") })) Map integerLines; @Persistent(table="INTEGER_LINES", embeddedKey="true", embeddedValue="true") @Join(column="OWNER_FK") @Key(column="INTEGER") @Value( embeddedMapping=@Embedded( members={ @Persistent(name="point1.x", column="POINT1_X"), @Persistent(name="point1.y", column="POINT2_Y"), @Persistent(name="point2.x", column="POINT2_X"), @Persistent(name="point2.y", column="POINT2_Y") })) abstract Map getIntegerLines(); } api/test/java/javax/jdo/annotations/TestEmbeddedSet.java100664 3723 12500110371 23635 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.annotations; import java.util.Set; /* * TestEmbeddedSet.java * * Created on July 18, 2007, 9:40 AM * */ @PersistenceCapable public abstract class TestEmbeddedSet { /** Creates a new instance of TestEmbeddedSet */ public TestEmbeddedSet() { } @Persistent (table="LINES", embeddedElement="true") @Join(column="OWNER_FK") @Element ( embeddedMapping=@Embedded( members={ @Persistent(name="point1.x", column="POINT1_X"), @Persistent(name="point1.y", column="POINT2_Y"), @Persistent(name="point2.x", column="POINT2_X"), @Persistent(name="point2.y", column="POINT2_Y") })) Set lines; @Persistent (embeddedElement="true") @Join(column="OWNER_FK") @Element ( embeddedMapping=@Embedded( members={ @Persistent(name="point1.x", column="POINT1_X"), @Persistent(name="point1.y", column="POINT2_Y"), @Persistent(name="point2.x", column="POINT2_X"), @Persistent(name="point2.y", column="POINT2_Y") })) abstract Set getLines(); } api/test/java/javax/jdo/annotations/TestExtensions.java100664 4030 12500110371 23617 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.annotations; /* * TestExtensions verifies that annotations can include vendor extensions. * This class is not used except to verify that it compiles. * https://issues.apache.org/jira/browse/JDO-728 * Add extensions element to @Index, @ForeignKey, @Unique, @PrimaryKey annotations. */ public abstract class TestExtensions { /** Creates a new instance of TestExtensions */ public TestExtensions() { } @PrimaryKey(extensions= { @Extension(vendorName = "vendor 1", key = "key 1", value = "value 1"), @Extension(vendorName = "vendor 2", key = "key 2", value = "value 2")} ) long pk; @Index(extensions= { @Extension(vendorName = "vendor 1", key = "key 1", value = "value 1"), @Extension(vendorName = "vendor 2", key = "key 2", value = "value 2")} ) @Unique(extensions= { @Extension(vendorName = "vendor 1", key = "key 1", value = "value 1"), @Extension(vendorName = "vendor 2", key = "key 2", value = "value 2")} ) @ForeignKey(extensions= { @Extension(vendorName = "vendor 1", key = "key 1", value = "value 1"), @Extension(vendorName = "vendor 2", key = "key 2", value = "value 2")} ) long fk; } api/test/java/javax/jdo/EnhancerTest.java100664 51443 12500110371 20700 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.nio.CharBuffer; import java.util.ArrayList; import java.util.List; import java.util.UUID; import javax.jdo.util.AbstractTest; import javax.jdo.util.BatchTestRunner; /** * Tests class javax.jdo.Enhancer (Enhancer main class). *

*/ public class EnhancerTest extends AbstractTest { /** The path delimiter for constructing classpaths. */ private static String pathDelimiter = System.getProperty("path.separator"); /** The maven basedir identifying the directory of the execution environment. */ private static String basedir = System.getProperty("basedir"); /** */ public static void main(String args[]) { BatchTestRunner.run(EnhancerTest.class); } public void testUsageOption() { // invoke enhancer with a usage option InvocationResult result = invokeEnhancer("?"); String outputString = result.getOutputString(); String errorString = result.getErrorString(); assertEquals("Wrong exit code from Enhancer with stderr:\n" + errorString, 0, result.getExitValue()); assertTrue("Expected Usage message from out:\n" + outputString + " with err:\n" + errorString, outputString.contains("javax.jdo.Enhancer")); } public void testHelpOption() { // invoke enhancer with a usage option InvocationResult result = invokeEnhancer("-help"); String outputString = result.getOutputString(); String errorString = result.getErrorString(); assertEquals("Wrong exit code from Enhancer with stderr:\n" + errorString, 0, result.getExitValue()); assertTrue("Expected Usage message from out:\n" + outputString + " with err:\n" + errorString, outputString.contains("javax.jdo.Enhancer")); } public void testHOption() { // invoke enhancer with a usage option InvocationResult result = invokeEnhancer("-h"); String outputString = result.getOutputString(); String errorString = result.getErrorString(); assertEquals("Wrong exit code from Enhancer with stderr:\n" + errorString, 0, result.getExitValue()); assertTrue("Expected Usage message from out:\n" + outputString + " with err:\n" + errorString, outputString.contains("javax.jdo.Enhancer")); } public void testInvalidOption() { // invoke enhancer with an invalid option InvocationResult result = invokeEnhancer("-poo"); assertEquals("Wrong return value ", ENHANCER_USAGE_ERROR, result.getExitValue()); String errorString = result.getErrorString(); assertTrue("Expected Usage message from err:\n" + errorString, errorString.contains("javax.jdo.Enhancer")); } public void testProperties() { // invoke enhancer with verbose option InvocationResult result = invokeEnhancer("-v"); String outputString = result.getOutputString(); String errorString = result.getErrorString(); assertEquals("Wrong exit code from Enhancer with stderr:\n" + errorString, 0, result.getExitValue()); assertTrue("Expected MockEnhancer vendor message from out:\n" + outputString + " with err:\n" + errorString, outputString.contains(PROPERTY_ENHANCER_VENDOR_NAME)); assertTrue("Expected MockEnhancer version message from out:\n" + outputString + " with err:\n" + errorString, outputString.contains(PROPERTY_ENHANCER_VERSION_NUMBER)); assertTrue("Expected MockEnhancer vendor message from out:\n" + outputString + " with err:\n" + errorString, outputString.contains("Mock Enhancer")); assertTrue("Expected MockEnhancer vendor message from out:\n" + outputString + " with err:\n" + errorString, outputString.contains("2.3.0")); assertTrue("Expected MockEnhancer properties message from out:\n" + outputString + " with err:\n" + errorString, outputString.contains("MockKey")); } public void testVOption() { // invoke enhancer with verbose option InvocationResult result = invokeEnhancer("-v"); String outputString = result.getOutputString(); String errorString = result.getErrorString(); assertEquals("Wrong exit code from Enhancer with stderr:\n" + errorString, 0, result.getExitValue()); assertTrue("Expected Enhancer class message from out:\n" + outputString + " with err:\n" + errorString, outputString.contains("javax.jdo.MockEnhancer")); } public void testVerboseOption() { // invoke enhancer with verbose option InvocationResult result = invokeEnhancer("-verbose"); String outputString = result.getOutputString(); String errorString = result.getErrorString(); assertEquals("Wrong exit code from Enhancer with stderr:\n" + errorString, 0, result.getExitValue()); assertTrue("Expected Enhancer class message from out:\n" + outputString + " with err:\n" + errorString, outputString.contains("javax.jdo.MockEnhancer")); } public void testVerboseClasses() { // invoke enhancer with .class parameter InvocationResult result = invokeEnhancer("-v some.class"); String outputString = result.getOutputString(); String errorString = result.getErrorString(); assertEquals("Wrong exit code from Enhancer with stderr:\n" + errorString, 0, result.getExitValue()); assertTrue("Expected class message from out:\n" + outputString + " with err:\n" + errorString, outputString.contains("some.class")); assertTrue("Expected number of classes from out:\n" + outputString + " with err:\n" + errorString, outputString.contains("1")); } public void testVerboseJars() { // invoke enhancer with a .jar parameter InvocationResult result = invokeEnhancer("-v some.jar"); String outputString = result.getOutputString(); String errorString = result.getErrorString(); assertEquals("Wrong exit code from Enhancer with stderr:\n" + errorString, 0, result.getExitValue()); assertTrue("Expected jar message from out:\n" + outputString + " with err:\n" + errorString, outputString.contains("some.jar")); assertTrue("Expected number of jars from out:\n" + outputString + " with err:\n" + errorString, outputString.contains("1")); } public void testVerboseJDOs() { // invoke enhancer with a .jdo parameter InvocationResult result = invokeEnhancer("-v some.jdo"); String outputString = result.getOutputString(); String errorString = result.getErrorString(); assertEquals("Wrong exit code from Enhancer with stderr:\n" + errorString, 0, result.getExitValue()); assertTrue("Expected jdo message from out:\n" + outputString + " with err:\n" + errorString, outputString.contains("some.jdo")); assertTrue("Expected number of jdos from out:\n" + outputString + " with err:\n" + errorString, outputString.contains("1")); } public void testVerboseAll() { // invoke enhancer with multiple parameters InvocationResult result = invokeEnhancer("-v some.class some.jar some.jdo"); String outputString = result.getOutputString(); String errorString = result.getErrorString(); assertEquals("Wrong exit code from Enhancer with stderr:\n" + errorString, 0, result.getExitValue()); assertTrue("Expected jdo message from out:\n" + outputString + " with err:\n" + errorString, outputString.contains("some.jdo")); assertTrue("Expected jar message from out:\n" + outputString + " with err:\n" + errorString, outputString.contains("some.jar")); assertTrue("Expected class message from out:\n" + outputString + " with err:\n" + errorString, outputString.contains("some.class")); assertTrue("Expected number of elements from out:\n" + outputString + " with err:\n" + errorString, outputString.contains("3")); } public void testVerboseCheckonlyAll() { // invoke enhancer with a checkonly option InvocationResult result = invokeEnhancer("-v -checkonly some.class some.jar some.jdo"); String outputString = result.getOutputString(); String errorString = result.getErrorString(); assertEquals("Wrong exit code from Enhancer with stderr:\n" + errorString, 0, result.getExitValue()); assertTrue("Expected jdo message from out:\n" + outputString + " with err:\n" + errorString, outputString.contains("some.jdo")); assertTrue("Expected jar message from out:\n" + outputString + " with err:\n" + errorString, outputString.contains("some.jar")); assertTrue("Expected class message from out:\n" + outputString + " with err:\n" + errorString, outputString.contains("some.class")); assertTrue("Expected number of elements from out:\n" + outputString + " with err:\n" + errorString, outputString.contains("3")); } public void testMissingPU() { // invoke enhancer with missing parameter InvocationResult result = invokeEnhancer("-v -pu"); assertEquals("Wrong return value ", 3, result.getExitValue()); } public void testVerbosePU() { // invoke enhancer with a pu parameter InvocationResult result = invokeEnhancer("-v -pu myPU -pu yourPU"); String outputString = result.getOutputString(); String errorString = result.getErrorString(); assertEquals("Wrong exit code from Enhancer with stderr:\n" + errorString, 0, result.getExitValue()); assertTrue("Expected pu message from out:\n" + outputString + " with err:\n" + errorString, outputString.contains("myPU")); assertTrue("Expected pu message from out:\n" + outputString + " with err:\n" + errorString, outputString.contains("yourPU")); assertTrue("Expected number of elements from out:\n" + outputString + " with err:\n" + errorString, outputString.contains("2")); } public void testClasspath() { // invoke enhancer with a classpath parameter // JDOHelper must be loadable from this path // the File.toURI should append "/" to the path, so only "target/classes" is needed InvocationResult result = invokeEnhancer("-v -cp " + basedir + "/target/classes"); String outputString = result.getOutputString(); String errorString = result.getErrorString(); assertEquals("Wrong exit code from Enhancer with stderr:\n" + errorString, 0, result.getExitValue()); assertTrue("Expected classpath message from out:\n" + outputString + " with err:\n" + errorString, outputString.contains("target/classes")); } public void testBadClasspath() { // invoke enhancer with a bad classpath parameter // JDOHelper is not loadable from this path InvocationResult result = invokeEnhancer("-v -cp target"); String outputString = result.getOutputString(); String errorString = result.getErrorString(); assertEquals("Wrong exit code from Enhancer with stderr:\n" + errorString, 1, result.getExitValue()); assertTrue("Expected classpath error message from out:\n" + outputString + " with err:\n" + errorString, errorString.contains("JDOHelper")); } public void testClasspathJar() throws IOException, InterruptedException { // invoke enhancer with a classpath parameter // JDOHelper must be loadable from this path // create the jar file from the target/classes directory String uuid = UUID.randomUUID().toString(); File uuidDir = new File(basedir + "/target/" + uuid); uuidDir.mkdirs(); String enhancerJar = "target/" + uuid + "/enhancer-test.jar"; String enhancerJarPathname = basedir + "/" + enhancerJar; Process create = Runtime.getRuntime().exec("jar -cf " + enhancerJarPathname + " -C " + basedir + "/target/classes ."); int returnCode = create.waitFor(); assertEquals("jar command returned wrong return code.", 0, returnCode); // find the jdo.jar in target InvocationResult result = invokeEnhancer("-v -cp " + enhancerJar); String outputString = result.getOutputString(); String errorString = result.getErrorString(); assertEquals("Wrong exit code from Enhancer with stderr:\n" + errorString, 0, result.getExitValue()); assertTrue("Expected classpath message from out:\n" + outputString + " with err:\n" + errorString, outputString.contains(enhancerJar)); } public void testOutputDirectory() { // invoke enhancer with an output directory parameter InvocationResult result = invokeEnhancer("-v -d some/output/directory"); String outputString = result.getOutputString(); String errorString = result.getErrorString(); assertEquals("Wrong exit code from Enhancer with stderr:\n" + errorString, 0, result.getExitValue()); assertTrue("Expected directory message from out:\n" + outputString + " with err:\n" + errorString, outputString.contains("some/output/directory")); } public void testMissingOutputDirectory() { // invoke enhancer with missing parameter InvocationResult result = invokeEnhancer("-v -d"); assertEquals("Wrong return value ", 3, result.getExitValue()); } public void testDir() { // invoke enhancer with directory and not recurse InvocationResult result = invokeEnhancer("-v " + basedir + "/target/test-classes/enhancer-test-dir"); String outputString = result.getOutputString(); String errorString = result.getErrorString(); assertEquals("Wrong exit code from Enhancer with stderr:\n" + errorString, 0, result.getExitValue()); assertTrue("Expected directory enhancer-test-dir in message from out:\n" + outputString + " with err:\n" + errorString, outputString.contains("enhancer-test-dir")); assertTrue("Expected file file1.jdo in message from out:\n" + outputString + " with err:\n" + errorString, outputString.contains("file1.jdo")); assertTrue("Expected file file2.class in message from out:\n" + outputString + " with err:\n" + errorString, outputString.contains("file2.class")); assertTrue("Expected file file3.jar in message from out:\n" + outputString + " with err:\n" + errorString, outputString.contains("file3.jar")); assertFalse("Expected no directory enhancer-test-subdir in message from out:\n" + outputString + " with err:\n" + errorString, outputString.contains("enhancer-test-subdir")); assertTrue("Expected 3 files to be enhanced in message from out:\n" + outputString + " with err:\n" + errorString, outputString.contains("3")); } public void testDirRecurse() { // invoke enhancer with directory and recurse InvocationResult result = invokeEnhancer("-v -r " + basedir + "/target/test-classes/enhancer-test-dir"); String outputString = result.getOutputString(); String errorString = result.getErrorString(); assertEquals("Wrong exit code from Enhancer with stderr:\n" + errorString, 0, result.getExitValue()); assertTrue("Expected directory enhancer-test-dir in message from out:\n" + outputString + " with err:\n" + errorString, outputString.contains("enhancer-test-dir")); assertTrue("Expected directory enhancer-test-subdir in message from out:\n" + outputString + " with err:\n" + errorString, outputString.contains("enhancer-test-subdir")); assertTrue("Expected file file1.jdo in message from out:\n" + outputString + " with err:\n" + errorString, outputString.contains("file1.jdo")); assertTrue("Expected file file2.class in message from out:\n" + outputString + " with err:\n" + errorString, outputString.contains("file2.class")); assertTrue("Expected file file3.jar in message from out:\n" + outputString + " with err:\n" + errorString, outputString.contains("file3.jar")); assertTrue("Expected file file4.jdo in message from out:\n" + outputString + " with err:\n" + errorString, outputString.contains("file4.jdo")); assertTrue("Expected file file5.class in message from out:\n" + outputString + " with err:\n" + errorString, outputString.contains("file5.class")); assertTrue("Expected file file6.jar in message from out:\n" + outputString + " with err:\n" + errorString, outputString.contains("file6.jar")); assertTrue("Expected 6 files to be enhanced in message from out:\n" + outputString + " with err:\n" + errorString, outputString.contains("6")); } private InvocationResult invokeEnhancer(String string) { InvocationResult result = new InvocationResult(); try { // create the java command to invoke the Enhancer List commands = new ArrayList(); // find the java command in the user's path commands.add("java"); commands.add("-cp"); commands.add("" + basedir + "/target/classes" + pathDelimiter + "" + basedir + "/target/test-classes"); commands.add("javax.jdo.Enhancer"); // add the test options (from the method parameter) to the java command String[] optionArray = string.split(" "); for (String option: optionArray) { commands.add(option); } String[] cmdarray = commands.toArray(new String[commands.size()]); ProcessBuilder builder = new ProcessBuilder(cmdarray); Process proc = builder.start(); InputStream stdout = proc.getInputStream(); InputStream stderr = proc.getErrorStream(); CharBuffer outBuffer = CharBuffer.allocate(1000000); CharBuffer errBuffer = CharBuffer.allocate(1000000); Thread outputThread = createReaderThread(stdout, outBuffer); Thread errorThread = createReaderThread(stderr, errBuffer); int exitValue = proc.waitFor(); result.setExitValue(exitValue); errorThread.join(10000); // wait ten seconds to get stderr after process terminates outputThread.join(10000); // wait ten seconds to get stdout after process terminates result.setErrorString(errBuffer.toString()); result.setOutputString(outBuffer.toString()); // wait until the Enhancer command finishes } catch (InterruptedException ex) { throw new RuntimeException("InterruptedException", ex); } catch (IOException ex) { throw new RuntimeException("IOException", ex); } catch (JDOException jdoex) { jdoex.printStackTrace(); Throwable[] throwables = jdoex.getNestedExceptions(); System.out.println("Exception throwables of size: " + throwables.length); for (Throwable throwable: throwables) { throwable.printStackTrace(); } } return result; } private Thread createReaderThread(final InputStream input, final CharBuffer output) { final Reader reader = new InputStreamReader(input); Thread thread = new Thread( new Runnable() { public void run() { int count = 0; int outputBytesRead = 0; try { while (-1 != (outputBytesRead = reader.read(output))) { count += outputBytesRead; } } catch (IOException e) { e.printStackTrace(); } finally { output.flip(); } } }); thread.start(); return thread; } class InvocationResult { private int exitValue; private String errorString; private String outputString; int getExitValue() { return exitValue; } private void setExitValue(int exitValue) { this.exitValue = exitValue; } private void setErrorString(String errorString) { this.errorString = errorString; } String getErrorString() { return errorString; } private void setOutputString(String outputString) { this.outputString = outputString; } String getOutputString() { return outputString; } } } api/test/java/javax/jdo/identity/ByteIdentityTest.java100664 13452 12500110371 23421 0ustarmbouschenstaff 0 0 /* * 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. */ /* * ByteIdentityTest.java * */ package javax.jdo.identity; import javax.jdo.JDONullIdentityException; import javax.jdo.util.BatchTestRunner; /** * */ public class ByteIdentityTest extends SingleFieldIdentityTest { /** Creates a new instance of ByteIdentityTest */ public ByteIdentityTest() { } /** * @param args the command line arguments */ public static void main(String[] args) { BatchTestRunner.run(ByteIdentityTest.class); } public void testConstructor() { ByteIdentity c1 = new ByteIdentity(Object.class, (byte)1); ByteIdentity c2 = new ByteIdentity(Object.class, (byte)1); ByteIdentity c3 = new ByteIdentity(Object.class, (byte)2); assertEquals("Equal ByteIdentity instances compare not equal.", c1, c2); assertFalse ("Not equal ByteIdentity instances compare equal", c1.equals(c3)); } public void testByteConstructor() { ByteIdentity c1 = new ByteIdentity(Object.class, (byte)1); ByteIdentity c2 = new ByteIdentity(Object.class, new Byte((byte)1)); ByteIdentity c3 = new ByteIdentity(Object.class, new Byte((byte)2)); assertEquals ("Equal ByteIdentity instances compare not equal.", c1, c2); assertFalse ("Not equal ByteIdentity instances compare equal", c1.equals(c3)); } public void testToStringConstructor() { ByteIdentity c1 = new ByteIdentity(Object.class, (byte)1); ByteIdentity c2 = new ByteIdentity(Object.class, c1.toString()); assertEquals ("Equal ByteIdentity instances compare not equal.", c1, c2); } public void testStringConstructor() { ByteIdentity c1 = new ByteIdentity(Object.class, (byte)1); ByteIdentity c2 = new ByteIdentity(Object.class, "1"); ByteIdentity c3 = new ByteIdentity(Object.class, "2"); assertEquals ("Equal ByteIdentity instances compare not equal.", c1, c2); assertFalse ("Not equal ByteIdentity instances compare equal", c1.equals(c3)); } public void testIllegalStringConstructor() { try { ByteIdentity c1 = new ByteIdentity(Object.class, "b"); } catch (IllegalArgumentException iae) { return; // good } fail ("No exception caught for illegal String."); } public void testSerialized() { ByteIdentity c1 = new ByteIdentity(Object.class, (byte)1); ByteIdentity c2 = new ByteIdentity(Object.class, "1"); ByteIdentity c3 = new ByteIdentity(Object.class, "2"); Object[] scis = writeReadSerialized(new Object[] {c1, c2, c3}); Object sc1 = scis[0]; Object sc2 = scis[1]; Object sc3 = scis[2]; assertEquals ("Equal ByteIdentity instances compare not equal.", c1, sc1); assertEquals ("Equal ByteIdentity instances compare not equal.", c2, sc2); assertEquals ("Equal ByteIdentity instances compare not equal.", sc1, c2); assertEquals ("Equal ByteIdentity instances compare not equal.", sc2, c1); assertFalse ("Not equal ByteIdentity instances compare equal.", c1.equals(sc3)); assertFalse ("Not equal ByteIdentity instances compare equal.", sc1.equals(c3)); assertFalse ("Not equal ByteIdentity instances compare equal.", sc1.equals(sc3)); assertFalse ("Not equal ByteIdentity instances compare equal.", sc3.equals(sc1)); } public void testGetKeyAsObjectPrimitive() { ByteIdentity c1 = new ByteIdentity(Object.class, (byte)1); assertEquals("keyAsObject doesn't match.", c1.getKeyAsObject(), new Byte((byte)1)); } public void testGetKeyAsObject() { ByteIdentity c1 = new ByteIdentity(Object.class, new Byte((byte)1)); assertEquals("keyAsObject doesn't match.", c1.getKeyAsObject(), new Byte((byte)1)); } public void testBadConstructorNullByteParam() { try { ByteIdentity c1 = new ByteIdentity(Object.class, (Byte)null); } catch (JDONullIdentityException ex) { return; } fail ("Failed to catch expected exception."); } public void testBadConstructorNullStringParam() { try { ByteIdentity c1 = new ByteIdentity(Object.class, (String)null); } catch (JDONullIdentityException ex) { return; } fail ("Failed to catch expected exception."); } public void testCompareTo() { ByteIdentity c1 = new ByteIdentity(Object.class, (byte)1); ByteIdentity c2 = new ByteIdentity(Object.class, (byte)1); ByteIdentity c3 = new ByteIdentity(Object.class, (byte)2); ByteIdentity c4 = new ByteIdentity(Class.class, (byte)1); assertEquals("Equal ByteIdentity instances compare not equal.", 0, c1.compareTo(c2)); assertTrue("Not equal ByteIdentity instances have wrong compareTo result", c1.compareTo(c3) < 0); assertTrue("Not equal ByteIdentity instances have wrong compareTo result", c3.compareTo(c1) > 0); assertTrue("Not equal ByteIdentity instances have wrong compareTo result", c1.compareTo(c4) > 0); } } api/test/java/javax/jdo/identity/CharIdentityTest.java100664 14077 12500110371 23377 0ustarmbouschenstaff 0 0 /* * 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. */ /* * CharIdentityTest.java * */ package javax.jdo.identity; import javax.jdo.JDONullIdentityException; import javax.jdo.util.BatchTestRunner; /** * * @author clr */ public class CharIdentityTest extends SingleFieldIdentityTest { /** Creates a new instance of CharIdentityTest */ public CharIdentityTest() { } /** * @param args the command line arguments */ public static void main(String[] args) { BatchTestRunner.run(CharIdentityTest.class); } public void testConstructor() { CharIdentity c1 = new CharIdentity(Object.class, 'a'); CharIdentity c2 = new CharIdentity(Object.class, 'a'); CharIdentity c3 = new CharIdentity(Object.class, 'b'); assertEquals("Equal CharIdentity instances compare not equal.", c1, c2); assertFalse ("Not equal CharIdentity instances compare equal", c1.equals(c3)); } public void testCharacterConstructor() { CharIdentity c1 = new CharIdentity(Object.class, 'a'); CharIdentity c2 = new CharIdentity(Object.class, new Character('a')); CharIdentity c3 = new CharIdentity(Object.class, new Character('b')); assertEquals("Equal CharIdentity instances compare not equal.", c1, c2); assertFalse ("Not equal CharIdentity instances compare equal", c1.equals(c3)); } public void testToStringConstructor() { CharIdentity c1 = new CharIdentity(Object.class, 'a'); CharIdentity c2 = new CharIdentity(Object.class, c1.toString()); assertEquals ("Equal CharIdentity instances compare not equal.", c1, c2); } public void testStringConstructor() { CharIdentity c1 = new CharIdentity(Object.class, 'a'); CharIdentity c2 = new CharIdentity(Object.class, "a"); CharIdentity c3 = new CharIdentity(Object.class, "b"); assertEquals ("Equal CharIdentity instances compare not equal.", c1, c2); assertFalse ("Not equal CharIdentity instances compare equal", c1.equals(c3)); } public void testStringConstructorTooLong() { try { CharIdentity c1 = new CharIdentity(Object.class, "ab"); } catch (IllegalArgumentException iae) { return; // good } fail ("No exception caught for String too long."); } public void testStringConstructorTooShort() { try { CharIdentity c1 = new CharIdentity(Object.class, ""); } catch (IllegalArgumentException iae) { return; // good } fail ("No exception caught for String too short."); } public void testSerialized() { CharIdentity c1 = new CharIdentity(Object.class, 'a'); CharIdentity c2 = new CharIdentity(Object.class, "a"); CharIdentity c3 = new CharIdentity(Object.class, "b"); Object[] scis = writeReadSerialized(new Object[] {c1, c2, c3}); Object sc1 = scis[0]; Object sc2 = scis[1]; Object sc3 = scis[2]; assertEquals ("Equal CharIdentity instances compare not equal.", c1, sc1); assertEquals ("Equal CharIdentity instances compare not equal.", c2, sc2); assertEquals ("Equal CharIdentity instances compare not equal.", sc1, c2); assertEquals ("Equal CharIdentity instances compare not equal.", sc2, c1); assertFalse ("Not equal CharIdentity instances compare equal.", c1.equals(sc3)); assertFalse ("Not equal CharIdentity instances compare equal.", sc1.equals(c3)); assertFalse ("Not equal CharIdentity instances compare equal.", sc1.equals(sc3)); assertFalse ("Not equal CharIdentity instances compare equal.", sc3.equals(sc1)); } public void testGetKeyAsObjectPrimitive() { CharIdentity c1 = new CharIdentity(Object.class, '1'); assertEquals("keyAsObject doesn't match.", c1.getKeyAsObject(), new Character('1')); } public void testGetKeyAsObject() { CharIdentity c1 = new CharIdentity(Object.class, new Character('1')); assertEquals("keyAsObject doesn't match.", c1.getKeyAsObject(), new Character('1')); } public void testBadConstructorNullCharacterParam() { try { CharIdentity c1 = new CharIdentity(Object.class, (Character)null); } catch (JDONullIdentityException ex) { return; } fail ("Failed to catch expected exception."); } public void testBadConstructorNullStringParam() { try { CharIdentity c1 = new CharIdentity(Object.class, (String)null); } catch (JDONullIdentityException ex) { return; } fail ("Failed to catch expected exception."); } public void testCompareTo() { CharIdentity c1 = new CharIdentity(Object.class, '1'); CharIdentity c2 = new CharIdentity(Object.class, '1'); CharIdentity c3 = new CharIdentity(Object.class, '2'); CharIdentity c4 = new CharIdentity(Class.class, '1'); assertEquals("Equal CharIdentity instances compare not equal.", 0, c1.compareTo(c2)); assertTrue("Not equal CharIdentity instances have wrong compareTo result", c1.compareTo(c3) < 0); assertTrue("Not equal CharIdentity instances have wrong compareTo result", c3.compareTo(c1) > 0); assertTrue("Not equal CharIdentity instances have wrong compareTo result", c1.compareTo(c4) > 0); } } api/test/java/javax/jdo/identity/ConcreteTestIdentity.java100664 3520 12500110371 24233 0ustarmbouschenstaff 0 0 /* * 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. */ /* * ConcreteTestIdentity.java * */ package javax.jdo.identity; import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectOutput; /** * * @author clr */ public class ConcreteTestIdentity extends SingleFieldIdentity { ConcreteTestIdentity(Class cls) { super(cls); } /** This constructor is only for Serialization */ public ConcreteTestIdentity() { super(); } /** Determine the ordering of identity objects. * @param o Other identity * @return The relative ordering between the objects * @since 2.2 */ public int compareTo(Object o) { throw new ClassCastException("Not implemented"); } public void writeExternal(ObjectOutput out) throws IOException { super.writeExternal(out); } public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { super.readExternal(in); } } api/test/java/javax/jdo/identity/IntIdentityTest.java100664 13270 12500110371 23246 0ustarmbouschenstaff 0 0 /* * 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. */ /* * IntIdentityTest.java * */ package javax.jdo.identity; import javax.jdo.JDONullIdentityException; import javax.jdo.util.BatchTestRunner; /** * */ public class IntIdentityTest extends SingleFieldIdentityTest { /** Creates a new instance of IntIdentityTest */ public IntIdentityTest() { } /** * @param args the command line arguments */ public static void main(String[] args) { BatchTestRunner.run(IntIdentityTest.class); } public void testConstructor() { IntIdentity c1 = new IntIdentity(Object.class, (int)1); IntIdentity c2 = new IntIdentity(Object.class, (int)1); IntIdentity c3 = new IntIdentity(Object.class, (int)2); assertEquals("Equal IntIdentity instances compare not equal.", c1, c2); assertFalse ("Not equal IntIdentity instances compare equal", c1.equals(c3)); } public void testIntegerConstructor() { IntIdentity c1 = new IntIdentity(Object.class, (int)1); IntIdentity c2 = new IntIdentity(Object.class, new Integer((int)1)); IntIdentity c3 = new IntIdentity(Object.class, new Integer((int)2)); assertEquals ("Equal intIdentity instances compare not equal.", c1, c2); assertFalse ("Not equal IntIdentity instances compare equal", c1.equals(c3)); } public void testToStringConstructor() { IntIdentity c1 = new IntIdentity(Object.class, (int)1); IntIdentity c2 = new IntIdentity(Object.class, c1.toString()); assertEquals ("Equal IntIdentity instances compare not equal.", c1, c2); } public void testStringConstructor() { IntIdentity c1 = new IntIdentity(Object.class, (int)1); IntIdentity c2 = new IntIdentity(Object.class, "1"); IntIdentity c3 = new IntIdentity(Object.class, "2"); assertEquals ("Equal IntIdentity instances compare not equal.", c1, c2); assertFalse ("Not equal IntIdentity instances compare equal", c1.equals(c3)); } public void testIllegalStringConstructor() { try { IntIdentity c1 = new IntIdentity(Object.class, "b"); } catch (IllegalArgumentException iae) { return; // good } fail ("No exception caught for illegal String."); } public void testSerialized() { IntIdentity c1 = new IntIdentity(Object.class, (int)1); IntIdentity c2 = new IntIdentity(Object.class, "1"); IntIdentity c3 = new IntIdentity(Object.class, "2"); Object[] scis = writeReadSerialized(new Object[] {c1, c2, c3}); Object sc1 = scis[0]; Object sc2 = scis[1]; Object sc3 = scis[2]; assertEquals ("Equal IntIdentity instances compare not equal.", c1, sc1); assertEquals ("Equal IntIdentity instances compare not equal.", c2, sc2); assertEquals ("Equal IntIdentity instances compare not equal.", sc1, c2); assertEquals ("Equal IntIdentity instances compare not equal.", sc2, c1); assertFalse ("Not equal InrIdentity instances compare equal.", c1.equals(sc3)); assertFalse ("Not equal IntIdentity instances compare equal.", sc1.equals(c3)); assertFalse ("Not equal IntIdentity instances compare equal.", sc1.equals(sc3)); assertFalse ("Not equal IntIdentity instances compare equal.", sc3.equals(sc1)); } public void testGetKeyAsObjectPrimitive() { IntIdentity c1 = new IntIdentity(Object.class, 1); assertEquals("keyAsObject doesn't match.", c1.getKeyAsObject(), new Integer(1)); } public void testGetKeyAsObject() { IntIdentity c1 = new IntIdentity(Object.class, new Integer(1)); assertEquals("keyAsObject doesn't match.", c1.getKeyAsObject(), new Integer(1)); } public void testBadConstructorNullIntegerParam() { try { IntIdentity c1 = new IntIdentity(Object.class, (Integer)null); } catch (JDONullIdentityException ex) { return; } fail ("Failed to catch expected exception."); } public void testBadConstructorNullStringParam() { try { IntIdentity c1 = new IntIdentity(Object.class, (String)null); } catch (JDONullIdentityException ex) { return; } fail ("Failed to catch expected exception."); } public void testCompareTo() { IntIdentity c1 = new IntIdentity(Object.class, 1); IntIdentity c2 = new IntIdentity(Object.class, 1); IntIdentity c3 = new IntIdentity(Object.class, 2); IntIdentity c4 = new IntIdentity(Class.class, 1); assertEquals("Equal IntIdentity instances compare not equal.", 0, c1.compareTo(c2)); assertTrue("Not equal IntIdentity instances have wrong compareTo result", c1.compareTo(c3) < 0); assertTrue("Not equal IntIdentity instances have wrong compareTo result", c3.compareTo(c1) > 0); assertTrue("Not equal IntIdentity instances have wrong compareTo result", c1.compareTo(c4) > 0); } } api/test/java/javax/jdo/identity/LongIdentityTest.java100664 14036 12500110371 23414 0ustarmbouschenstaff 0 0 /* * 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. */ /* * LongIdentityTest.java * */ package javax.jdo.identity; import javax.jdo.JDONullIdentityException; import javax.jdo.util.BatchTestRunner; /** * */ public class LongIdentityTest extends SingleFieldIdentityTest { /** Creates a new instance of LongIdentityTest */ public LongIdentityTest() { } /** * @param args the command line arguments */ public static void main(String[] args) { BatchTestRunner.run(LongIdentityTest.class); } public void testConstructor() { LongIdentity c1 = new LongIdentity(Object.class, 1); LongIdentity c2 = new LongIdentity(Object.class, 1); LongIdentity c3 = new LongIdentity(Object.class, 2); LongIdentity c4 = new LongIdentity(Object.class, 0x100000001L); assertEquals("Equal LongIdentity instances compare not equal.", c1, c2); assertFalse ("Not equal LongIdentity instances compare equal", c1.equals(c3)); assertFalse ("Not equal LongIdentity instances compare equal", c4.equals(c1)); } public void testLongConstructor() { LongIdentity c1 = new LongIdentity(Object.class, 1); LongIdentity c2 = new LongIdentity(Object.class, new Long(1)); LongIdentity c3 = new LongIdentity(Object.class, new Long(2)); assertEquals ("Equal LongIdentity instances compare not equal.", c1, c2); assertFalse ("Not equal LongIdentity instances compare equal", c1.equals(c3)); } public void testToStringConstructor() { LongIdentity c1 = new LongIdentity(Object.class, Long.MAX_VALUE); LongIdentity c2 = new LongIdentity(Object.class, c1.toString()); assertEquals ("Equal LongIdentity instances compare not equal.", c1, c2); } public void testStringConstructor() { LongIdentity c1 = new LongIdentity(Object.class, 1); LongIdentity c2 = new LongIdentity(Object.class, "1"); LongIdentity c3 = new LongIdentity(Object.class, "2"); assertEquals ("Equal LongIdentity instances compare not equal.", c1, c2); assertFalse ("Not equal LongIdentity instances compare equal", c1.equals(c3)); } public void testIllegalStringConstructor() { try { LongIdentity c1 = new LongIdentity(Object.class, "b"); } catch (IllegalArgumentException iae) { return; // good } fail ("No exception caught for illegal String."); } public void testSerialized() { LongIdentity c1 = new LongIdentity(Object.class, 1); LongIdentity c2 = new LongIdentity(Object.class, "1"); LongIdentity c3 = new LongIdentity(Object.class, "2"); Object[] scis = writeReadSerialized(new Object[] {c1, c2, c3}); Object sc1 = scis[0]; Object sc2 = scis[1]; Object sc3 = scis[2]; assertEquals ("Equal LongIdentity instances compare not equal.", c1, sc1); assertEquals ("Equal LongIdentity instances compare not equal.", c2, sc2); assertEquals ("Equal LongIdentity instances compare not equal.", sc1, c2); assertEquals ("Equal LongIdentity instances compare not equal.", sc2, c1); assertFalse ("Not equal LongIdentity instances compare equal.", c1.equals(sc3)); assertFalse ("Not equal LongIdentity instances compare equal.", sc1.equals(c3)); assertFalse ("Not equal LongIdentity instances compare equal.", sc1.equals(sc3)); assertFalse ("Not equal LongIdentity instances compare equal.", sc3.equals(sc1)); } public void testGetKeyAsObjectPrimitive() { LongIdentity c1 = new LongIdentity(Object.class, 1L); assertEquals("keyAsObject doesn't match.", c1.getKeyAsObject(), new Long(1L)); } public void testGetKeyAsObject() { LongIdentity c1 = new LongIdentity(Object.class, new Long(1L)); assertEquals("keyAsObject doesn't match.", c1.getKeyAsObject(), new Long(1L)); } public void testBadConstructorNullShortParam() { try { LongIdentity c1 = new LongIdentity(Object.class, (Long)null); } catch (JDONullIdentityException ex) { return; } fail ("Failed to catch expected exception."); } public void testBadConstructorNullStringParam() { try { LongIdentity c1 = new LongIdentity(Object.class, (String)null); } catch (JDONullIdentityException ex) { return; } fail ("Failed to catch expected exception."); } public void testCompareTo() { LongIdentity c1 = new LongIdentity(Object.class, 1); LongIdentity c2 = new LongIdentity(Object.class, 1); LongIdentity c3 = new LongIdentity(Object.class, 2); LongIdentity c4 = new LongIdentity(Class.class, 1); LongIdentity c5 = new LongIdentity(Object.class, 0x100000001L); assertEquals("Equal LongIdentity instances compare not equal.", 0, c1.compareTo(c2)); assertTrue("Not equal LongIdentity instances have wrong compareTo result", c1.compareTo(c3) < 0); assertTrue("Not equal LongIdentity instances have wrong compareTo result", c3.compareTo(c1) > 0); assertTrue("Not equal LongIdentity instances have wrong compareTo result", c1.compareTo(c4) > 0); assertTrue("Not equal LongIdentity instances have wrong compareTo result", c5.compareTo(c1) > 0); } } api/test/java/javax/jdo/identity/ObjectIdentityTest.java100664 46723 12500110371 23733 0ustarmbouschenstaff 0 0 /* * 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. */ /* * ObjectIdentityTest.java * */ package javax.jdo.identity; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.io.Serializable; import java.math.BigDecimal; import java.security.AccessController; import java.security.PrivilegedAction; import java.text.SimpleDateFormat; import java.text.DateFormat; import java.util.Currency; import java.util.Date; import java.util.Locale; import javax.jdo.JDOUserException; import javax.jdo.JDONullIdentityException; import javax.jdo.spi.JDOImplHelper; import javax.jdo.util.BatchTestRunner; /** * */ public class ObjectIdentityTest extends SingleFieldIdentityTest { /** The JDOImplHelper instance used for Date formatting. */ private static JDOImplHelper helper = (JDOImplHelper) AccessController.doPrivileged( new PrivilegedAction () { public JDOImplHelper run () { return JDOImplHelper.getInstance(); } } ); /** Creates a new instance of ObjectIdentityTest */ public ObjectIdentityTest() { } /** * @param args the command line arguments */ public static void main(String[] args) { BatchTestRunner.run(ObjectIdentityTest.class); } public void testConstructor() { ObjectIdentity c1 = new ObjectIdentity(Object.class, new IdClass(1)); ObjectIdentity c2 = new ObjectIdentity(Object.class, new IdClass(1)); ObjectIdentity c3 = new ObjectIdentity(Object.class, new IdClass(2)); assertEquals("Equal ObjectIdentity instances compare not equal.", c1, c2); assertFalse ("Not equal ObjectIdentity instances compare equal", c1.equals(c3)); } public void testIntegerConstructor() { ObjectIdentity c1 = new ObjectIdentity(Object.class, new Integer(1)); ObjectIdentity c2 = new ObjectIdentity(Object.class, new Integer(1)); ObjectIdentity c3 = new ObjectIdentity(Object.class, new Integer(2)); assertEquals("Equal ObjectIdentity instances compare not equal.", c1, c2); assertFalse ("Not equal ObjectIdentity instances compare equal", c1.equals(c3)); } public void testLongConstructor() { ObjectIdentity c1 = new ObjectIdentity(Object.class, new Long(1)); ObjectIdentity c2 = new ObjectIdentity(Object.class, new Long(1)); ObjectIdentity c3 = new ObjectIdentity(Object.class, new Long(2)); assertEquals("Equal ObjectIdentity instances compare not equal.", c1, c2); assertFalse ("Not equal ObjectIdentity instances compare equal", c1.equals(c3)); } public void testDateConstructor() { ObjectIdentity c1 = new ObjectIdentity(Object.class, new Date(1)); ObjectIdentity c2 = new ObjectIdentity(Object.class, new Date(1)); ObjectIdentity c3 = new ObjectIdentity(Object.class, new Date(2)); assertEquals("Equal ObjectIdentity instances compare not equal.", c1, c2); assertFalse ("Not equal ObjectIdentity instances compare equal", c1.equals(c3)); } public void testLocaleConstructor() { ObjectIdentity c1 = new ObjectIdentity(Object.class, Locale.US); ObjectIdentity c2 = new ObjectIdentity(Object.class, Locale.US); ObjectIdentity c3 = new ObjectIdentity(Object.class, Locale.GERMANY); assertEquals("Equal ObjectIdentity instances compare not equal.", c1, c2); assertFalse ("Not equal ObjectIdentity instances compare equal", c1.equals(c3)); } public void testCurrencyConstructor() { if (!isClassLoadable("java.util.Currency")) return; ObjectIdentity c1 = new ObjectIdentity(Object.class, Currency.getInstance(Locale.US)); ObjectIdentity c2 = new ObjectIdentity(Object.class, Currency.getInstance(Locale.US)); ObjectIdentity c3 = new ObjectIdentity(Object.class, Currency.getInstance(Locale.GERMANY)); assertEquals("Equal ObjectIdentity instances compare not equal.", c1, c2); assertFalse ("Not equal ObjectIdentity instances compare equal", c1.equals(c3)); } public void testStringConstructor() { ObjectIdentity c1 = new ObjectIdentity(Object.class, "javax.jdo.identity.ObjectIdentityTest$IdClass:1"); ObjectIdentity c2 = new ObjectIdentity(Object.class, "javax.jdo.identity.ObjectIdentityTest$IdClass:1"); ObjectIdentity c3 = new ObjectIdentity(Object.class, "javax.jdo.identity.ObjectIdentityTest$IdClass:2"); assertEquals("Equal ObjectIdentity instances compare not equal.", c1, c2); assertFalse ("Not equal ObjectIdentity instances compare equal", c1.equals(c3)); } public void testToStringConstructor() { ObjectIdentity c1 = new ObjectIdentity(Object.class, new IdClass(1)); ObjectIdentity c2 = new ObjectIdentity(Object.class, c1.toString()); assertEquals ("Equal ObjectIdentity instances compare not equal.", c1, c2); } public void testDateCompareTo() { ObjectIdentity c1 = new ObjectIdentity(Object.class, new Date(1)); ObjectIdentity c2 = new ObjectIdentity(Object.class, new Date(1)); ObjectIdentity c3 = new ObjectIdentity(Object.class, new Date(2)); ObjectIdentity c4 = new ObjectIdentity(Class.class, new Date(1)); assertEquals("Equal ObjectIdentity instances compare not equal.", 0, c1.compareTo(c2)); assertTrue("Not equal ObjectIdentity instances have wrong compareTo result", c1.compareTo(c3) < 0); assertTrue("Not equal ObjectIdentity instances have wrong compareTo result", c3.compareTo(c1) > 0); assertTrue("Not equal ObjectIdentity instances have wrong compareTo result", c1.compareTo(c4) > 0); } public void testBadStringConstructorNullClass() { try { ObjectIdentity c1 = new ObjectIdentity(null, "1"); } catch (NullPointerException ex) { return; } fail ("Failed to catch expected exception."); } public void testBadStringConstructorNullParam() { try { ObjectIdentity c1 = new ObjectIdentity(Object.class, null); } catch (JDONullIdentityException ex) { return; } fail ("Failed to catch expected exception."); } public void testBadStringConstructorTooShort() { try { ObjectIdentity c1 = new ObjectIdentity(Object.class, "xx"); } catch (JDOUserException ex) { return; } fail ("Failed to catch expected exception."); } public void testBadStringConstructorNoDelimiter() { try { ObjectIdentity c1 = new ObjectIdentity(Object.class, "xxxxxxxxx"); } catch (JDOUserException ex) { return; } fail ("Failed to catch expected exception."); } public void testBadStringConstructorBadClassName() { try { ObjectIdentity c1 = new ObjectIdentity(Object.class, "xx:yy"); } catch (JDOUserException ex) { validateNestedException(ex, ClassNotFoundException.class); return; } fail ("Failed to catch expected ClassNotFoundException."); } public void testBadStringConstructorNoStringConstructor() { try { ObjectIdentity c1 = new ObjectIdentity(Object.class, "javax.jdo.identity.ObjectIdentityTest$BadIdClassNoStringConstructor:yy"); } catch (JDOUserException ex) { validateNestedException(ex, NoSuchMethodException.class); return; } fail ("Failed to catch expected NoSuchMethodException."); } public void testBadStringConstructorNoPublicStringConstructor() { try { ObjectIdentity c1 = new ObjectIdentity(Object.class, "javax.jdo.identity.ObjectIdentityTest$BadIdClassNoPublicStringConstructor:yy"); } catch (JDOUserException ex) { validateNestedException(ex, NoSuchMethodException.class); return; } fail ("Failed to catch expected NoSuchMethodException."); } public void testBadStringConstructorIllegalArgument() { try { ObjectIdentity c1 = new ObjectIdentity(Object.class, "javax.jdo.identity.ObjectIdentityTest$IdClass:yy"); } catch (JDOUserException ex) { validateNestedException(ex, InvocationTargetException.class); return; } fail ("Failed to catch expected InvocationTargetException."); } public void testStringDateConstructor() { SimpleDateFormat usDateFormat = new SimpleDateFormat ("MMM dd, yyyy hh:mm:ss a", Locale.US); helper.registerDateFormat(usDateFormat); Object c1 = new ObjectIdentity(Object.class, "java.util.Date:Jan 01, 1970 00:00:00 AM"); helper.registerDateFormat(DateFormat.getDateTimeInstance()); } public void testStringDefaultDateConstructor() { DateFormat dateFormat = DateFormat.getDateTimeInstance(); String rightNow = dateFormat.format(new Date()); Object c1 = new ObjectIdentity(Object.class, "java.util.Date:" + rightNow); } public void testBadStringDateConstructor() { try { ObjectIdentity c1 = new ObjectIdentity(Object.class, "java.util.Date:Jop 1, 1970 00:00:00"); } catch (JDOUserException ex) { return; } fail ("Failed to catch expected Exception."); } public void testStringLocaleConstructorLanguage() { if (!isClassLoadable("java.util.Currency")) return; SingleFieldIdentity c1 = new ObjectIdentity(Object.class, "java.util.Locale:en"); assertEquals(new Locale("en"), c1.getKeyAsObject()); } public void testStringLocaleConstructorCountry() { SingleFieldIdentity c1 = new ObjectIdentity(Object.class, "java.util.Locale:_US"); assertEquals(new Locale("","US"), c1.getKeyAsObject()); } public void testStringLocaleConstructorLanguageCountry() { SingleFieldIdentity c1 = new ObjectIdentity(Object.class, "java.util.Locale:en_US"); assertEquals(new Locale("en","US"), c1.getKeyAsObject()); } public void testStringLocaleConstructorLanguageCountryVariant() { SingleFieldIdentity c1 = new ObjectIdentity(Object.class, "java.util.Locale:en_US_MAC"); assertEquals(new Locale("en","US","MAC"), c1.getKeyAsObject()); } public void testStringCurrencyConstructor() { if (!isClassLoadable("java.util.Currency")) return; SingleFieldIdentity c1 = new ObjectIdentity(Object.class, "java.util.Currency:USD"); } public void testBadStringCurrencyConstructor() { if (!isClassLoadable("java.util.Currency")) return; try { ObjectIdentity c1 = new ObjectIdentity(Object.class, "java.util.Currency:NowhereInTheWorld"); } catch (JDOUserException ex) { validateNestedException(ex, IllegalArgumentException.class); return; } fail ("Failed to catch expected IllegalArgumentException."); } public void testSerializedIdClass() { ObjectIdentity c1 = new ObjectIdentity(Object.class, new IdClass(1)); ObjectIdentity c2 = new ObjectIdentity(Object.class, new IdClass(1)); ObjectIdentity c3 = new ObjectIdentity(Object.class, new IdClass(2)); Object[] scis = writeReadSerialized(new Object[] {c1, c2, c3}); Object sc1 = scis[0]; Object sc2 = scis[1]; Object sc3 = scis[2]; assertEquals ("Equal ObjectIdentity instances compare not equal.", c1, sc1); assertEquals ("Equal ObjectIdentity instances compare not equal.", c2, sc2); assertEquals ("Equal ObjectIdentity instances compare not equal.", sc1, c2); assertEquals ("Equal ObjectIdentity instances compare not equal.", sc2, c1); assertFalse ("Not equal ObjectIdentity instances compare equal.", c1.equals(sc3)); assertFalse ("Not equal ObjectIdentity instances compare equal.", sc1.equals(c3)); assertFalse ("Not equal ObjectIdentity instances compare equal.", sc1.equals(sc3)); assertFalse ("Not equal ObjectIdentity instances compare equal.", sc3.equals(sc1)); } public void testSerializedBigDecimal() { ObjectIdentity c1 = new ObjectIdentity(Object.class, new BigDecimal("123456789.012")); ObjectIdentity c2 = new ObjectIdentity(Object.class, new BigDecimal("123456789.012")); ObjectIdentity c3 = new ObjectIdentity(Object.class, new BigDecimal("123456789.01")); Object[] scis = writeReadSerialized(new Object[] {c1, c2, c3}); Object sc1 = scis[0]; Object sc2 = scis[1]; Object sc3 = scis[2]; assertEquals ("Equal ObjectIdentity instances compare not equal.", c1, sc1); assertEquals ("Equal ObjectIdentity instances compare not equal.", c2, sc2); assertEquals ("Equal ObjectIdentity instances compare not equal.", sc1, c2); assertEquals ("Equal ObjectIdentity instances compare not equal.", sc2, c1); assertFalse ("Not equal ObjectIdentity instances compare equal.", c1.equals(sc3)); assertFalse ("Not equal ObjectIdentity instances compare equal.", sc1.equals(c3)); assertFalse ("Not equal ObjectIdentity instances compare equal.", sc1.equals(sc3)); assertFalse ("Not equal ObjectIdentity instances compare equal.", sc3.equals(sc1)); } public void testSerializedCurrency() { if (!isClassLoadable("java.util.Currency")) return; ObjectIdentity c1 = new ObjectIdentity(Object.class, Currency.getInstance(Locale.US)); ObjectIdentity c2 = new ObjectIdentity(Object.class, Currency.getInstance(Locale.US)); ObjectIdentity c3 = new ObjectIdentity(Object.class, Currency.getInstance(Locale.GERMANY)); Object[] scis = writeReadSerialized(new Object[] {c1, c2, c3}); Object sc1 = scis[0]; Object sc2 = scis[1]; Object sc3 = scis[2]; assertEquals ("Equal ObjectIdentity instances compare not equal.", c1, sc1); assertEquals ("Equal ObjectIdentity instances compare not equal.", c2, sc2); assertEquals ("Equal ObjectIdentity instances compare not equal.", sc1, c2); assertEquals ("Equal ObjectIdentity instances compare not equal.", sc2, c1); assertFalse ("Not equal ObjectIdentity instances compare equal.", c1.equals(sc3)); assertFalse ("Not equal ObjectIdentity instances compare equal.", sc1.equals(c3)); assertFalse ("Not equal ObjectIdentity instances compare equal.", sc1.equals(sc3)); assertFalse ("Not equal ObjectIdentity instances compare equal.", sc3.equals(sc1)); } public void testSerializedDate() { ObjectIdentity c1 = new ObjectIdentity(Object.class, new Date(1)); ObjectIdentity c2 = new ObjectIdentity(Object.class, "java.util.Date:1"); ObjectIdentity c3 = new ObjectIdentity(Object.class, new Date(2)); Object[] scis = writeReadSerialized(new Object[] {c1, c2, c3}); Object sc1 = scis[0]; Object sc2 = scis[1]; Object sc3 = scis[2]; assertEquals ("Equal ObjectIdentity instances compare not equal.", c1, sc1); assertEquals ("Equal ObjectIdentity instances compare not equal.", c2, sc2); assertEquals ("Equal ObjectIdentity instances compare not equal.", sc1, c2); assertEquals ("Equal ObjectIdentity instances compare not equal.", sc2, c1); assertFalse ("Not equal ObjectIdentity instances compare equal.", c1.equals(sc3)); assertFalse ("Not equal ObjectIdentity instances compare equal.", sc1.equals(c3)); assertFalse ("Not equal ObjectIdentity instances compare equal.", sc1.equals(sc3)); assertFalse ("Not equal ObjectIdentity instances compare equal.", sc3.equals(sc1)); } public void testSerializedLocale() { ObjectIdentity c1 = new ObjectIdentity(Object.class, Locale.US); ObjectIdentity c2 = new ObjectIdentity(Object.class, Locale.US); ObjectIdentity c3 = new ObjectIdentity(Object.class, Locale.GERMANY); Object[] scis = writeReadSerialized(new Object[] {c1, c2, c3}); Object sc1 = scis[0]; Object sc2 = scis[1]; Object sc3 = scis[2]; assertEquals ("Equal ObjectIdentity instances compare not equal.", c1, sc1); assertEquals ("Equal ObjectIdentity instances compare not equal.", c2, sc2); assertEquals ("Equal ObjectIdentity instances compare not equal.", sc1, c2); assertEquals ("Equal ObjectIdentity instances compare not equal.", sc2, c1); assertFalse ("Not equal ObjectIdentity instances compare equal.", c1.equals(sc3)); assertFalse ("Not equal ObjectIdentity instances compare equal.", sc1.equals(c3)); assertFalse ("Not equal ObjectIdentity instances compare equal.", sc1.equals(sc3)); assertFalse ("Not equal ObjectIdentity instances compare equal.", sc3.equals(sc1)); } public void testGetKeyAsObject() { ObjectIdentity c1 = new ObjectIdentity(Object.class, new IdClass(1)); assertEquals("keyAsObject doesn't match.", c1.getKeyAsObject(), new IdClass(1)); } private void validateNestedException(JDOUserException ex, Class expected) { Throwable[] nesteds = ex.getNestedExceptions(); if (nesteds == null || nesteds.length != 1) { fail ("Nested exception is null or length 0"); } Throwable nested = nesteds[0]; if (nested != ex.getCause()) { fail ("Nested exception is not == getCause()"); } if (!(expected.isAssignableFrom(nested.getClass()))) { fail ("Wrong nested exception. Expected " + expected.getName() + ", got " + nested.toString()); } return; } public static class IdClass implements Serializable { public int value; public IdClass() {value = 0;} public IdClass(int value) {this.value = value;} public IdClass(String str) {this.value = Integer.parseInt(str);} public String toString() {return Integer.toString(value);} public int hashCode() { return value; } public boolean equals (Object obj) { if (this == obj) { return true; } else { IdClass other = (IdClass) obj; return value == other.value; } } } public static class BadIdClassNoStringConstructor { } public static class BadIdClassNoPublicStringConstructor { private BadIdClassNoPublicStringConstructor(String str) {} } } api/test/java/javax/jdo/identity/ShortIdentityTest.java100664 13605 12500110371 23615 0ustarmbouschenstaff 0 0 /* * 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. */ /* * ShortIdentityTest.java * */ package javax.jdo.identity; import javax.jdo.JDONullIdentityException; import javax.jdo.util.BatchTestRunner; /** * */ public class ShortIdentityTest extends SingleFieldIdentityTest { /** Creates a new instance of ShortIdentityTest */ public ShortIdentityTest() { } /** * @param args the command line arguments */ public static void main(String[] args) { BatchTestRunner.run(ShortIdentityTest.class); } public void testConstructor() { ShortIdentity c1 = new ShortIdentity(Object.class, (short)1); ShortIdentity c2 = new ShortIdentity(Object.class, (short)1); ShortIdentity c3 = new ShortIdentity(Object.class, (short)2); assertEquals("Equal ShortIdentity instances compare not equal.", c1, c2); assertFalse ("Not equal ShortIdentity instances compare equal", c1.equals(c3)); } public void testShortConstructor() { ShortIdentity c1 = new ShortIdentity(Object.class, (short)1); ShortIdentity c2 = new ShortIdentity(Object.class, new Short((short)1)); ShortIdentity c3 = new ShortIdentity(Object.class, new Short((short)2)); assertEquals ("Equal ShortIdentity instances compare not equal.", c1, c2); assertFalse ("Not equal ShortIdentity instances compare equal", c1.equals(c3)); } public void testToStringConstructor() { ShortIdentity c1 = new ShortIdentity(Object.class, Short.MAX_VALUE); ShortIdentity c2 = new ShortIdentity(Object.class, c1.toString()); assertEquals ("Equal ShortIdentity instances compare not equal.", c1, c2); } public void testStringConstructor() { ShortIdentity c1 = new ShortIdentity(Object.class, (short)1); ShortIdentity c2 = new ShortIdentity(Object.class, "1"); ShortIdentity c3 = new ShortIdentity(Object.class, "2"); assertEquals ("Equal ShortIdentity instances compare not equal.", c1, c2); assertFalse ("Not equal ShortIdentity instances compare equal", c1.equals(c3)); } public void testIllegalStringConstructor() { try { ShortIdentity c1 = new ShortIdentity(Object.class, "b"); } catch (IllegalArgumentException iae) { return; // good } fail ("No exception caught for illegal String."); } public void testSerialized() { ShortIdentity c1 = new ShortIdentity(Object.class, (short)1); ShortIdentity c2 = new ShortIdentity(Object.class, "1"); ShortIdentity c3 = new ShortIdentity(Object.class, "2"); Object[] scis = writeReadSerialized(new Object[] {c1, c2, c3}); Object sc1 = scis[0]; Object sc2 = scis[1]; Object sc3 = scis[2]; assertEquals ("Equal ShortIdentity instances compare not equal.", c1, sc1); assertEquals ("Equal ShortIdentity instances compare not equal.", c2, sc2); assertEquals ("Equal ShortIdentity instances compare not equal.", sc1, c2); assertEquals ("Equal ShortIdentity instances compare not equal.", sc2, c1); assertFalse ("Not equal ShortIdentity instances compare equal.", c1.equals(sc3)); assertFalse ("Not equal ShortIdentity instances compare equal.", sc1.equals(c3)); assertFalse ("Not equal ShortIdentity instances compare equal.", sc1.equals(sc3)); assertFalse ("Not equal ShortIdentity instances compare equal.", sc3.equals(sc1)); } public void testGetKeyAsObjectPrimitive() { ShortIdentity c1 = new ShortIdentity(Object.class, (short)1); assertEquals("keyAsObject doesn't match.", c1.getKeyAsObject(), new Short((short)1)); } public void testGetKeyAsObject() { ShortIdentity c1 = new ShortIdentity(Object.class, new Short((short)1)); assertEquals("keyAsObject doesn't match.", c1.getKeyAsObject(), new Short((short)1)); } public void testBadConstructorNullShortParam() { try { ShortIdentity c1 = new ShortIdentity(Object.class, (Short)null); } catch (JDONullIdentityException ex) { return; } fail ("Failed to catch expected exception."); } public void testBadConstructorNullStringParam() { try { ShortIdentity c1 = new ShortIdentity(Object.class, (String)null); } catch (JDONullIdentityException ex) { return; } fail ("Failed to catch expected exception."); } public void testCompareTo() { ShortIdentity c1 = new ShortIdentity(Object.class, (short)1); ShortIdentity c2 = new ShortIdentity(Object.class, (short)1); ShortIdentity c3 = new ShortIdentity(Object.class, (short)2); ShortIdentity c4 = new ShortIdentity(Class.class, (short)1); assertEquals("Equal ShortIdentity instances compare not equal.", 0, c1.compareTo(c2)); assertTrue("Not equal ShortIdentity instances have wrong compareTo result", c1.compareTo(c3) < 0); assertTrue("Not equal ShortIdentity instances have wrong compareTo result", c3.compareTo(c1) > 0); assertTrue("Not equal ShortIdentity instances have wrong compareTo result", c1.compareTo(c4) > 0); } } api/test/java/javax/jdo/identity/SingleFieldIdentityTest.java100664 7363 12500110371 24667 0ustarmbouschenstaff 0 0 /* * 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. */ /* * SingleFieldIdentityTest.java * */ package javax.jdo.identity; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.ObjectInput; import java.io.ObjectOutput; import javax.jdo.util.AbstractTest; import javax.jdo.util.BatchTestRunner; /** * */ public class SingleFieldIdentityTest extends AbstractTest { ConcreteTestIdentity cti1; ConcreteTestIdentity cti2; ConcreteTestIdentity cti3; Object scti1; Object scti2; Object scti3; /** Creates a new instance of SingleFieldIdentityTest */ public SingleFieldIdentityTest() { } /** * @param args the command line arguments */ public static void main(String[] args) { BatchTestRunner.run(SingleFieldIdentityTest.class); } public void testConstructor() { cti1 = new ConcreteTestIdentity(Object.class); cti2 = new ConcreteTestIdentity(Object.class); cti3 = new ConcreteTestIdentity(Class.class); assertEquals ("Equal identity instances compare not equal.", cti1, cti2); if (cti1.equals(cti3)) fail ("Not equal identity instances compare equal."); } public void testSerialized() { cti1 = new ConcreteTestIdentity(Object.class); cti2 = new ConcreteTestIdentity(Object.class); cti3 = new ConcreteTestIdentity(Class.class); Object[] sctis = writeReadSerialized(new Object[]{cti1, cti2, cti3}); scti1 = sctis[0]; scti2 = sctis[1]; scti3 = sctis[2]; assertEquals ("Deserialized instance compare not equal.", cti1, scti1); assertEquals ("Deserialized instance compare not equal.", cti2, scti2); assertEquals ("Deserialized instance compare not equal.", cti3, scti3); assertEquals ("Deserialized instance compare not equal.", scti1, cti1); assertEquals ("Deserialized instance compare not equal.", scti2, cti2); assertEquals ("Deserialized instance compare not equal.", scti3, cti3); if (scti1.equals(scti3)) fail ("Not equal identity instances compare equal."); } protected Object[] writeReadSerialized(Object[] in) { int length = in.length; Object[] result = new Object[length]; try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(baos); for (int i = 0; i < length; ++i) { oos.writeObject(in[i]); } byte[] ba = baos.toByteArray(); ByteArrayInputStream bais = new ByteArrayInputStream(ba); ObjectInputStream ois = new ObjectInputStream(bais); for (int i = 0; i < length; ++i) { result[i] = ois.readObject(); } } catch (Exception e) { fail(e.toString()); } return result; } } api/test/java/javax/jdo/identity/StringIdentityTest.java100664 10413 12500110371 23756 0ustarmbouschenstaff 0 0 /* * 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. */ /* * StringIdentityTest.java * */ package javax.jdo.identity; import javax.jdo.JDONullIdentityException; import javax.jdo.JDOUserException; import javax.jdo.util.BatchTestRunner; /** * */ public class StringIdentityTest extends SingleFieldIdentityTest { /** Creates a new instance of StringIdentityTest */ public StringIdentityTest() { } /** * @param args the command line arguments */ public static void main(String[] args) { BatchTestRunner.run(StringIdentityTest.class); } public void testConstructor() { StringIdentity c1 = new StringIdentity(Object.class, "1"); StringIdentity c2 = new StringIdentity(Object.class, "1"); StringIdentity c3 = new StringIdentity(Object.class, "2"); assertEquals("Equal StringIdentity instances compare not equal.", c1, c2); assertFalse ("Not equal StringIdentity instances compare equal", c1.equals(c3)); } public void testToStringConstructor() { StringIdentity c1 = new StringIdentity(Object.class, "Now who's talking!"); StringIdentity c2 = new StringIdentity(Object.class, c1.toString()); assertEquals ("Equal StringIdentity instances compare not equal.", c1, c2); } public void testSerialized() { StringIdentity c1 = new StringIdentity(Object.class, "1"); StringIdentity c2 = new StringIdentity(Object.class, "1"); StringIdentity c3 = new StringIdentity(Object.class, "2"); Object[] scis = writeReadSerialized(new Object[] {c1, c2, c3}); Object sc1 = scis[0]; Object sc2 = scis[1]; Object sc3 = scis[2]; assertEquals ("Equal StringIdentity instances compare not equal.", c1, sc1); assertEquals ("Equal StringIdentity instances compare not equal.", c2, sc2); assertEquals ("Equal StringIdentity instances compare not equal.", sc1, c2); assertEquals ("Equal StringIdentity instances compare not equal.", sc2, c1); assertFalse ("Not equal StringIdentity instances compare equal.", c1.equals(sc3)); assertFalse ("Not equal StringIdentity instances compare equal.", sc1.equals(c3)); assertFalse ("Not equal StringIdentity instances compare equal.", sc1.equals(sc3)); assertFalse ("Not equal StringIdentity instances compare equal.", sc3.equals(sc1)); } public void testGetKeyAsObject() { StringIdentity c1 = new StringIdentity(Object.class, "1"); assertEquals("keyAsObject doesn't match.", c1.getKeyAsObject(), "1"); } public void testBadConstructorNullParam() { try { StringIdentity c1 = new StringIdentity(Object.class, null); } catch (JDONullIdentityException ex) { return; } fail ("Failed to catch expected exception."); } public void testCompareTo() { StringIdentity c1 = new StringIdentity(Object.class, "1"); StringIdentity c2 = new StringIdentity(Object.class, "1"); StringIdentity c3 = new StringIdentity(Object.class, "2"); StringIdentity c4 = new StringIdentity(Class.class, "1"); assertEquals("Equal StringIdentity instances compare not equal.", 0, c1.compareTo(c2)); assertTrue("Not equal StringIdentity instances have wrong compareTo result", c1.compareTo(c3) < 0); assertTrue("Not equal StringIdentity instances have wrong compareTo result", c3.compareTo(c1) > 0); assertTrue("Not equal StringIdentity instances have wrong compareTo result", c1.compareTo(c4) > 0); } } api/test/java/javax/jdo/JDOConfigTestClassLoader.java100664 3562 12500110371 23013 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo; import java.io.File; import java.io.IOException; import java.net.URL; import java.net.URLClassLoader; /** * A class loader that allows the user to add classpath entries. */ public class JDOConfigTestClassLoader extends URLClassLoader { /** * Uses the CTCCL as the parent and adds the given path to this loader's classpath. */ public JDOConfigTestClassLoader(String... additionalPath) throws IOException { this(Thread.currentThread().getContextClassLoader(), additionalPath); } /** * Uses the given ClassLoader as the parent & adds the given paths to this loader's classpath. */ public JDOConfigTestClassLoader(ClassLoader parent, String... additionalPaths) throws IOException { super(new URL[] {}, parent); for (String path : additionalPaths) { addFile(path); } } public void addFile(String s) throws IOException { addFile(new File(s)); } public void addFile(File f) throws IOException { addURL(f.toURI().toURL()); } @Override public void addURL(URL url) { super.addURL(url); } } api/test/java/javax/jdo/JDOHelperConfigTest.java100664 46246 12500110371 22064 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo; import java.io.IOException; import java.io.InputStream; import java.net.URLClassLoader; import java.util.HashMap; import java.util.Map; import javax.jdo.util.BatchTestRunner; import junit.framework.TestSuite; /** * * Tests class javax.jdo.JDOHelper for META-INF/jdoconfig.xml compliance. * */ public class JDOHelperConfigTest extends AbstractJDOConfigTest implements Constants { public static void main(String args[]) { BatchTestRunner.run(JDOHelperConfigTest.class); } /** * {@inheritDoc} * * @return {@inheritDoc} */ public static TestSuite suite() { return new TestSuite(JDOHelperConfigTest.class); } /** * Builds up a {@link java.util.Map Map} object that contains key parameter * values specific to a named test. All of the properties needed to run a * particular test are loaded into this object. * * @param testVariant * the name of the test to include in the {@link java.util.Map * Map} values. * @param listenerCount * the number of life cycle listener class names to add to this * map. The listener names will begin with the value stored in * {@link javax.jdo.Constants.PROPERTY_INSTANCE_LIFECYCLE_LISTENER * PROPERTY_INSTANCE_LIFECYCLE_LISTENER}. * @param vendorSpecificPropertyCount * the number of properties named of the form * *

     * "property." + testVariant + ".name"
     * 
* * that are added to the map. * @param excludeName * if true the property specified by * {@link javax.jdo.Constants.PROPERTY_NAME PROPERTY_NAME} is not * added to the map. * @param excludePUName * if true the property specified by * {@link javax.jdo.Constants.PROPERTY_PERSISTENCE_UNIT_NAME * PROPERTY_PERSISTENCE_UNIT_NAME} is not added to the map. * @return a new {@link java.util.Map Map} object populated with properties * that can be used in this test suite. */ protected Map prepareInitialExpectedMap(String testVariant, int listenerCount, int vendorSpecificPropertyCount, boolean excludeName, boolean excludePUName) { Map expected = new HashMap(); if (!excludeName) { expected.put(PROPERTY_NAME, PMF_ATTRIBUTE_NAME + "." + testVariant); } if (!excludePUName) { expected.put(PROPERTY_PERSISTENCE_UNIT_NAME, PMF_ATTRIBUTE_PERSISTENCE_UNIT_NAME + "." + testVariant); } expected.put(PROPERTY_PERSISTENCE_MANAGER_FACTORY_CLASS, PMF_ATTRIBUTE_CLASS + "." + testVariant); expected.put(PROPERTY_CONNECTION_DRIVER_NAME, PMF_ATTRIBUTE_CONNECTION_DRIVER_NAME + "." + testVariant); expected.put(PROPERTY_CONNECTION_FACTORY_NAME, PMF_ATTRIBUTE_CONNECTION_FACTORY_NAME + "." + testVariant); expected.put(PROPERTY_CONNECTION_FACTORY2_NAME, PMF_ATTRIBUTE_CONNECTION_FACTORY2_NAME + "." + testVariant); expected.put(PROPERTY_CONNECTION_PASSWORD, PMF_ATTRIBUTE_CONNECTION_PASSWORD + "." + testVariant); expected.put(PROPERTY_CONNECTION_URL, PMF_ATTRIBUTE_CONNECTION_URL + "." + testVariant); expected.put(PROPERTY_CONNECTION_USER_NAME, PMF_ATTRIBUTE_CONNECTION_USER_NAME + "." + testVariant); expected.put(PROPERTY_IGNORE_CACHE, PMF_ATTRIBUTE_IGNORE_CACHE + "." + testVariant); expected.put(PROPERTY_MAPPING, PMF_ATTRIBUTE_MAPPING + "." + testVariant); expected.put(PROPERTY_MULTITHREADED, PMF_ATTRIBUTE_MULTITHREADED + "." + testVariant); expected.put(PROPERTY_NONTRANSACTIONAL_READ, PMF_ATTRIBUTE_NONTRANSACTIONAL_READ + "." + testVariant); expected.put(PROPERTY_NONTRANSACTIONAL_WRITE, PMF_ATTRIBUTE_NONTRANSACTIONAL_WRITE + "." + testVariant); expected.put(PROPERTY_OPTIMISTIC, PMF_ATTRIBUTE_OPTIMISTIC + "." + testVariant); expected.put(PROPERTY_RESTORE_VALUES, PMF_ATTRIBUTE_RESTORE_VALUES + "." + testVariant); expected.put(PROPERTY_RETAIN_VALUES, PMF_ATTRIBUTE_RETAIN_VALUES + "." + testVariant); expected.put(PROPERTY_DETACH_ALL_ON_COMMIT, PMF_ATTRIBUTE_DETACH_ALL_ON_COMMIT + "." + testVariant); expected.put(PROPERTY_SERVER_TIME_ZONE_ID, PMF_ATTRIBUTE_SERVER_TIME_ZONE_ID + "." + testVariant); // listeners for (int i = 0; i < listenerCount; i++) { expected.put(PROPERTY_PREFIX_INSTANCE_LIFECYCLE_LISTENER + "listener." + testVariant + ".listener" + i, "classes." + testVariant + ".classes" + i); } // vendor-specific properties for (int i = 0; i < vendorSpecificPropertyCount; i++) { expected.put("property." + testVariant + ".name" + i, "property." + testVariant + ".value" + i); } return expected; } /** * Performs a test specified by testVariantName, by building up a * property map and executing the test according to the property values. * With this version of doPositiveTest the property name ( * {@link javax.jdo.Constants.PROPERTY_NAME PROPERTY_NAME}) and the * {@link javax.jdo.Constants.PERSISTENCE_UNIT_NAME PERSISTENCE_UNIT_NAME}) * are included in the property map that is used to run the test. * * @param classpaths * class paths to add to the class loader that runs the test that * specify where jdoconfig.xml can be found. * @param testVariantName * the name of the test. * @param listenerCount * number of listeners utilized in the test. * @param vendorSpecificPropertyCount * number of vendor properties used in the test. * @param checkEqualProperties * if true the test's properties are tested. * @throws java.io.IOException * if an {@java.io.IOException * IOException} occurs during class loading or any part of the * test. */ protected void doPositiveTest(String[] classpaths, String testVariantName, int listenerCount, int vendorSpecificPropertyCount, boolean checkEqualProperties) throws IOException { doPositiveTest(classpaths, testVariantName, listenerCount, vendorSpecificPropertyCount, checkEqualProperties, false, false); } /** * Performs a test specified by testVariantName, by building up a * property map and executing the test according to the property values. An * assertion exeception is thrown if the test being run has a negative * (non-true) result. With this version of doPositiveTest the * property name ({@link javax.jdo.Constants.PROPERTY_NAME PROPERTY_NAME}) * and the {@link javax.jdo.Constants.PERSISTENCE_UNIT_NAME * PERSISTENCE_UNIT_NAME}) are included in the property map that is used to * run the test. * * @param classpaths * class paths to add to the class loader that runs the test that * specify where jdoconfig.xml can be found. * @param testVariantName * the name of the test. * @param listenerCount * number of listeners utilized in the test. * @param vendorSpecificPropertyCount * number of vendor properties used in the test. * @param checkEqualProperties * if true the test's properties are tested. * @param excludeName * if true the property specified by * {@link javax.jdo.Constants.PROPERTY_NAME PROPERTY_NAME} is not * added to the map. * @param excludePUName * if true the property specified by * {@link javax.jdo.Constants.PROPERTY_PERSISTENCE_UNIT_NAME * PROPERTY_PERSISTENCE_UNIT_NAME} is not added to the map. * @throws java.io.IOException * if an {@java.io.IOException * IOException} occurs during class loading or any part of the * test. */ protected void doPositiveTest(String[] classpaths, String testVariantName, int listenerCount, int vendorSpecificPropertyCount, boolean checkEqualProperties, boolean excludeName, boolean excludePUName) throws IOException { URLClassLoader loader = new JDOConfigTestClassLoader(getClass() .getClassLoader(), classpaths); Map expected = prepareInitialExpectedMap(testVariantName, listenerCount, vendorSpecificPropertyCount, excludeName, excludePUName); String name = testVariantName == null ? null : (String) expected .get(PROPERTY_NAME); Map actual = JDOHelper.getPropertiesFromJdoconfig(name, loader); assertNotNull("No properties found", actual); if (checkEqualProperties) { assertEqualProperties(expected, actual); } } public void testPositive00_PMF0_BasicPMFConfigUsingOnlyStandardAttributesAndListeners() throws IOException { doPositiveTest(new String[] { JDOCONFIG_CLASSPATH_PREFIX + "/Positive00" }, "positive00.pmf0", 2, 0, true); } public void testPositive00_PMF1_BasicPMFConfigUsingOnlyPropertyElementsWithStandardJavaxDotJDOProperties() throws IOException { doPositiveTest(new String[] { JDOCONFIG_CLASSPATH_PREFIX + "/Positive00" }, "positive00.pmf1", 2, 0, true); } public void testPositive00_PMF2_NestedPropertyElementsWithOnlyStandardAttributeNames() throws IOException { doPositiveTest(new String[] { JDOCONFIG_CLASSPATH_PREFIX + "/Positive00" }, "positive00.pmf2", 2, 0, true); } public void testPositive00_PMF3_StandardAttributesPlusNonstandardPropertiesInPropertyElements() throws IOException { doPositiveTest(new String[] { JDOCONFIG_CLASSPATH_PREFIX + "/Positive00" }, "positive00.pmf3", 2, 2, true); } public void testPositive00_PMF4_StandardAttributesPlusNonstandardAttributes() throws IOException { doPositiveTest(new String[] { JDOCONFIG_CLASSPATH_PREFIX + "/Positive00" }, "positive00.pmf4", 0, 2, true); } public void testPositive01_DuplicatePUsInDifferentConfigFilesButNotRequested() throws IOException { String[] classpaths = new String[] { JDOCONFIG_CLASSPATH_PREFIX + "/Positive01/1a", JDOCONFIG_CLASSPATH_PREFIX + "/Positive01/1b" }; URLClassLoader loader = new JDOConfigTestClassLoader(getClass() .getClassLoader(), classpaths); Map actual = JDOHelper.getPropertiesFromJdoconfig( ANONYMOUS_PERSISTENCE_MANAGER_FACTORY_NAME, loader); } public void testPositive02_GetAnonymousPMFWithNoProperties() throws IOException { URLClassLoader loader = new JDOConfigTestClassLoader(getClass() .getClassLoader(), JDOCONFIG_CLASSPATH_PREFIX + "/Positive02/"); Map properties = JDOHelper.getPropertiesFromJdoconfig( ANONYMOUS_PERSISTENCE_MANAGER_FACTORY_NAME, loader); assertNotNull("Anonymous PMF with no properties returned null", properties); assertTrue("Anonymous PMF with no properties had properties", properties.size() == 0); } public void testPositive03_PMF0_PMFClassNameViaServicesLookup() throws IOException { URLClassLoader loader = new JDOConfigTestClassLoader(getClass() .getClassLoader(), JDOCONFIG_CLASSPATH_PREFIX + "/Positive03/"); String expected = "class.positive03.pmf0"; String actual = getPMFClassNameViaServiceLookup(loader); assertNotNull("No PMF name found via services lookup", actual); assertEquals(expected, actual); } public void testPositive04_PMF0_PMFClassNameViaServicesLookup() throws IOException { URLClassLoader loader = new JDOConfigTestClassLoader(getClass() .getClassLoader(), JDOCONFIG_CLASSPATH_PREFIX + "/Positive04/"); String expected = "class.positive04.pmf0"; String actual = getPMFClassNameViaServiceLookup(loader); assertNotNull("No PMF name found via services lookup", actual); assertEquals(expected, actual); } public void testPositive05_PMF0_PMFClassNameViaServicesLookup() throws IOException { URLClassLoader loader = new JDOConfigTestClassLoader(getClass() .getClassLoader(), JDOCONFIG_CLASSPATH_PREFIX + "/Positive05/"); String expected = "class.positive05.pmf0"; String actual = getPMFClassNameViaServiceLookup(loader); assertNotNull("No PMF name found via services lookup", actual); assertEquals(expected, actual); } public void testPositive06_PMF0_GetAnonymousPMFProperties() throws IOException { URLClassLoader loader = new JDOConfigTestClassLoader(getClass() .getClassLoader(), JDOCONFIG_CLASSPATH_PREFIX + "/Positive06/"); Map expected = prepareInitialExpectedMap("positive06.pmf0", 2, 0, true, true); Map actual = JDOHelper.getPropertiesFromJdoconfig( ANONYMOUS_PERSISTENCE_MANAGER_FACTORY_NAME, loader); assertNotNull("No properties found", actual); assertEqualProperties(expected, actual); } public void testPositive07_PMF0_GetAnonymousPMFPropertiesWithPUName() throws IOException { URLClassLoader loader = new JDOConfigTestClassLoader(getClass() .getClassLoader(), JDOCONFIG_CLASSPATH_PREFIX + "/Positive07/"); Map expected = prepareInitialExpectedMap("positive07.pmf0", 2, 0, true, false); Map actual = JDOHelper.getPropertiesFromJdoconfig( ANONYMOUS_PERSISTENCE_MANAGER_FACTORY_NAME, loader); assertNotNull("No properties found", actual); assertEqualProperties(expected, actual); } public void testNegative00_EmptyJDOConfigXML() throws IOException { try { URLClassLoader loader = new JDOConfigTestClassLoader(getClass() .getClassLoader(), JDOCONFIG_CLASSPATH_PREFIX + "/Negative0/"); JDOHelper.getPersistenceManagerFactory(loader); fail("JDOHelper failed to throw JDOFatalUserException"); } catch (JDOFatalUserException x) { // sunny day } } public void testNegative01_NoPersistenceUnitsDefined() throws IOException { try { URLClassLoader loader = new JDOConfigTestClassLoader(getClass() .getClassLoader(), JDOCONFIG_CLASSPATH_PREFIX + "/Negative01/"); JDOHelper.getPersistenceManagerFactory(loader); fail("JDOHelper failed to throw JDOFatalUserException"); } catch (JDOFatalUserException x) { // joy, sweet joy } } public void testNegative02_DuplicateAnonymousPersistenceUnitsInSameConfig() throws IOException { try { URLClassLoader loader = new JDOConfigTestClassLoader(getClass() .getClassLoader(), JDOCONFIG_CLASSPATH_PREFIX + "/Negative02/"); JDOHelper.getPersistenceManagerFactory(loader); fail("JDOHelper failed to throw JDOFatalUserException"); } catch (JDOFatalUserException x) { // the cockles of my heart warmeth } } public void testNegative03_DuplicateNamedPersistenceUnitsInSameConfig() throws IOException { try { URLClassLoader loader = new JDOConfigTestClassLoader(getClass() .getClassLoader(), JDOCONFIG_CLASSPATH_PREFIX + "/Negative03/"); JDOHelper.getPersistenceManagerFactory("name.negative03", loader); fail("JDOHelper failed to throw JDOFatalUserException"); } catch (JDOFatalUserException x) { // warm fuzzies } } public void testNegative04_DuplicatePUNamePropertyInAttributeAndElement() throws IOException { try { URLClassLoader loader = new JDOConfigTestClassLoader(getClass() .getClassLoader(), JDOCONFIG_CLASSPATH_PREFIX + "/Negative04/"); JDOHelper.getPersistenceManagerFactory("name.negative04.value0", loader); fail("JDOHelper failed to throw JDOFatalUserException"); } catch (JDOFatalUserException x) { // no cold pricklies } } public void testNegative05_DuplicatePropertyInAttributeAndElement() throws IOException { try { URLClassLoader loader = new JDOConfigTestClassLoader(getClass() .getClassLoader(), JDOCONFIG_CLASSPATH_PREFIX + "/Negative05/"); JDOHelper.getPersistenceManagerFactory(loader); fail("JDOHelper failed to throw JDOFatalUserException"); } catch (JDOFatalUserException x) { // party! } } public void testNegative06_DuplicatePUInDifferentConfigFiles() throws IOException { try { URLClassLoader loader = new JDOConfigTestClassLoader(getClass() .getClassLoader(), JDOCONFIG_CLASSPATH_PREFIX + "/Negative06/6a/", JDOCONFIG_CLASSPATH_PREFIX + "/Negative06/6b/"); JDOHelper.getPersistenceManagerFactory("name.negative06", loader); fail("JDOHelper failed to throw JDOFatalUserException"); } catch (JDOFatalUserException x) { // clear blue sky } } public void testNegative07_EmptyServicesFile() throws IOException { JDOConfigTestClassLoader testLoader = new JDOConfigTestClassLoader( getClass().getClassLoader(), JDOCONFIG_CLASSPATH_PREFIX + "/Negative07/"); String shouldBeNull = getPMFClassNameViaServiceLookup(testLoader); assertNull(shouldBeNull); } public void testNegative08_NoResourcesFound() { String resource = "" + RANDOM.nextLong(); InputStream in = getClass().getClassLoader().getResourceAsStream( resource); assertNull(in); // resource pretty much guaranteed not to exist try { JDOHelper.getPersistenceManagerFactory(resource); fail("JDOHelper failed to throw JDOFatalUserException"); } catch (JDOFatalUserException x) { // happy path } } public void testNegative08_ServicesFileWithOnlyComments() throws IOException { JDOConfigTestClassLoader testLoader = new JDOConfigTestClassLoader( getClass().getClassLoader(), JDOCONFIG_CLASSPATH_PREFIX + "/Negative08/"); String shouldBeNull = getPMFClassNameViaServiceLookup(testLoader); assertNull(shouldBeNull); } public void testNegative09_MultipleInvalidClassesInDifferentServicesFiles() throws IOException { // no class name in Negative09/jdoconfig.xml // 9a and 9b include services/javax.jdo.PersistenceManagerFactory // with bad implementations try { URLClassLoader loader = new JDOConfigTestClassLoader(getClass() .getClassLoader(), JDOCONFIG_CLASSPATH_PREFIX + "/Negative09/9a/", JDOCONFIG_CLASSPATH_PREFIX + "/Negative09/9b/", TEST_CLASSPATH, API_CLASSPATH); JDOHelper.getPersistenceManagerFactory("name.negative09", loader); fail("JDOHelper failed to throw JDOFatalUserException"); } catch (JDOFatalException x) { Throwable[] nestedExceptions = x.getNestedExceptions(); if (nestedExceptions.length != 2) { appendMessage("JDOHelper.getPersistenceManagerFactory wrong number of " + "nested exceptions. Expected 2, got " + nestedExceptions.length + "\n" + x); } for (int i = 0; i < nestedExceptions.length; ++i) { Throwable exception = nestedExceptions[i]; if (!(exception instanceof JDOFatalException)) { appendMessage("Nested exception " + exception.getClass().getName() + " is not a JDOFatalException."); } } } failOnError(); } } api/test/java/javax/jdo/JDOHelperTest.java100664 60000 12500110371 20716 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo; import java.io.File; import java.io.InputStream; import java.util.HashMap; import java.util.Map; import java.util.Properties; import javax.jdo.pc.PCPoint; import javax.jdo.spi.JDOImplHelper; import javax.jdo.util.AbstractTest; import javax.jdo.util.BatchTestRunner; import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; /** * Tests class javax.jdo.JDOHelper. *

* TBD: implementation of testMakeDirty, * TBD: testing interrogative methods for persistent instances * TBD: getPMF for valid PMF class */ public class JDOHelperTest extends AbstractTest { /** */ public static void main(String args[]) { BatchTestRunner.run(JDOHelperTest.class); } /** The purpose of this test is simply to call some of the * methods on a constructed instance of JDOHelper and verify that * they do not throw exceptions. It is not a functional test. * @since 2.1 */ public void testConstructor() { JDOHelper helper = new JDOHelper(); assertNull("getObjectId(null) returned non-null", helper.getObjectId(null)); assertNull("getPersistenceManager(null) returned non-null", helper.getPersistenceManager(null)); assertNull("getTransactionalObjectId(null) returned non-null", helper.getTransactionalObjectId(null)); assertNull("getVersion(null) returned non-null", helper.getVersion(null)); assertFalse("isDeleted(null) returned non-null", helper.isDeleted(null)); assertFalse("isDetached(null) returned non-null", helper.isDetached(null)); assertFalse("isDirty(null) returned non-null", helper.isDirty(null)); assertFalse("isNew(null) returned non-null", helper.isNew(null)); assertFalse("isPersistent(null) returned non-null", helper.isPersistent(null)); assertFalse("isTransactional(null) returned non-null", helper.isTransactional(null)); } /** The purpose of this test is simply to call some of the * methods on the static instance of JDOHelper and verify that * they do not throw exceptions. It is not a functional test. * @since 2.1 */ public void testGetInstance() { JDOHelper helper = JDOHelper.getInstance(); assertNull("getObjectId(null) returned non-null", helper.getObjectId(null)); assertNull("getPersistenceManager(null) returned non-null", helper.getPersistenceManager(null)); assertNull("getTransactionalObjectId(null) returned non-null", helper.getTransactionalObjectId(null)); assertNull("getVersion(null) returned non-null", helper.getVersion(null)); assertFalse("isDeleted(null) returned non-null", helper.isDeleted(null)); assertFalse("isDetached(null) returned non-null", helper.isDetached(null)); assertFalse("isDirty(null) returned non-null", helper.isDirty(null)); assertFalse("isNew(null) returned non-null", helper.isNew(null)); assertFalse("isPersistent(null) returned non-null", helper.isPersistent(null)); assertFalse("isTransactional(null) returned non-null", helper.isTransactional(null)); } /** */ public void testGetPM() { PCPoint p = new PCPoint(1, new Integer(1)); if (JDOHelper.getPersistenceManager(p) != null) { fail("JDOHelper.getPersistenceManager should return null pm for non-persistent instance"); } // TBD: test for persistent instance } /** */ public void testMakeDirty() { // TBD: test JDOHelper.makeDirty(pc, fieldName); } /** */ public void testGetObjectId() { PCPoint p = new PCPoint(1, new Integer(1)); if (JDOHelper.getObjectId(p) != null) { fail("JDOHelper.getObjectId should return null ObjectId for non-persistent instance"); } // TBD test JDOHelper.getObjectId(pc) for persistent instance } /** */ public void testGetTransactionObjectId() { PCPoint p = new PCPoint(1, new Integer(1)); if (JDOHelper.getObjectId(p) != null) { fail("JDOHelper.getTransactionalObjectId should return null ObjectId for non-persistent instance"); } // TBD test JDOHelper.getTransactionalObjectId(pc) for persistent instance } /** */ public void testIsDirty() { PCPoint p = new PCPoint(1, new Integer(1)); if (JDOHelper.isDirty(p)) { fail("JDOHelper.isDirty should return false for non-persistent instance"); } // TBD test JDOHelper.isDirty(pc) for persistent instance } /** */ public void testIsTransactional() { PCPoint p = new PCPoint(1, new Integer(1)); if (JDOHelper.isTransactional(p)) { fail("JDOHelper.isTransactional should return false for non-persistent instance"); } // TBD test JDOHelper.isTransactional(pc) for persistent instance } /** */ public void testIsPersistent() { PCPoint p = new PCPoint(1, new Integer(1)); if (JDOHelper.isPersistent(p)) { fail("JDOHelper.isPersistent should return false for non-persistent instance"); } // TBD test JDOHelper.isPersistent(pc) for persistent instance } /** */ public void testIsNew() { PCPoint p = new PCPoint(1, new Integer(1)); if (JDOHelper.isNew(p)) { fail("JDOHelper.isNew should return false for non-persistent instance"); } // TBD test JDOHelper.isNew(pc) for persistent instance } /** */ public void testIsDeleted() { PCPoint p = new PCPoint(1, new Integer(1)); if (JDOHelper.isDeleted(p)) { fail("JDOHelper.isDeleted should return false for non-persistent instance"); } // TBD test JDOHelper.isDeleted(pc) for persistent instance } /** Test null String resource with no class loader. */ public void testGetPMFNullResource() { PersistenceManagerFactory pmf = null; try { pmf = JDOHelper.getPersistenceManagerFactory((String)null); fail("Null resource name should result in JDOFatalUserException"); } catch (JDOFatalUserException ex) { if (verbose) println("Caught expected exception " + ex); } } /** Test null String resource with good class loader. */ public void testGetPMFNullResourceGoodClassLoader() { PersistenceManagerFactory pmf = null; try { pmf = JDOHelper.getPersistenceManagerFactory((String)null, this.getClass().getClassLoader()); fail("Null resource name should result in JDOFatalUserException"); } catch (JDOFatalUserException ex) { if (verbose) println("Caught expected exception " + ex); } } /** Test bad String resource with no class loader. */ public void testGetPMFBadResource() { PersistenceManagerFactory pmf = null; try { pmf = JDOHelper.getPersistenceManagerFactory("Whatever"); fail("Null resource name should result in JDOFatalUserException"); } catch (JDOFatalUserException ex) { if (verbose) println("Caught expected exception " + ex); } } /** Test null String resource with good class loader. */ public void testGetPMFBadResourceGoodClassLoader() { PersistenceManagerFactory pmf = null; try { pmf = JDOHelper.getPersistenceManagerFactory("Whatever", this.getClass().getClassLoader()); fail("Null resource name should result in JDOFatalUserException"); } catch (JDOFatalUserException ex) { if (verbose) println("Caught expected exception " + ex); } } /** Test null File resource with no class loader. */ public void testGetPMFNullFile() { PersistenceManagerFactory pmf = null; try { pmf = JDOHelper.getPersistenceManagerFactory((File)null); fail("Null file should result in JDOFatalUserException"); } catch (JDOFatalUserException ex) { if (verbose) println("Caught expected exception " + ex); } } /** Test null File resource with good class loader. */ public void testGetPMFNullFileGoodClassLoader() { PersistenceManagerFactory pmf = null; try { pmf = JDOHelper.getPersistenceManagerFactory((File)null, this.getClass().getClassLoader()); fail("Null file should result in JDOFatalUserException"); } catch (JDOFatalUserException ex) { if (verbose) println("Caught expected exception " + ex); } } /** Test bad File resource with no class loader. */ public void testGetPMFBadFile() { PersistenceManagerFactory pmf = null; try { pmf = JDOHelper.getPersistenceManagerFactory(new File("Whatever")); fail("Null file should result in JDOFatalUserException"); } catch (JDOFatalUserException ex) { if (verbose) println("Caught expected exception " + ex); } } /** Test bad File resource with good class loader. */ public void testGetPMFBadFileGoodClassLoader() { PersistenceManagerFactory pmf = null; try { pmf = JDOHelper.getPersistenceManagerFactory(new File("Whatever"), this.getClass().getClassLoader()); fail("Null file should result in JDOFatalUserException"); } catch (JDOFatalUserException ex) { if (verbose) println("Caught expected exception " + ex); } } /** Test null JNDI resource name with no class loader. */ public void testGetPMFNullJNDI() { PersistenceManagerFactory pmf = null; try { pmf = JDOHelper.getPersistenceManagerFactory((String)null, getInitialContext()); fail("Null JNDI resource name should result in JDOFatalUserException"); } catch (JDOFatalUserException ex) { if (verbose) println("Caught expected exception " + ex); } } /** Test null JNDI resource name with good class loader. */ public void testGetPMFNullJNDIGoodClassLoader() { PersistenceManagerFactory pmf = null; try { pmf = JDOHelper.getPersistenceManagerFactory((String)null, getInitialContext(), this.getClass().getClassLoader()); fail("Null JNDI resource name should result in JDOFatalUserException"); } catch (JDOFatalUserException ex) { if (verbose) println("Caught expected exception " + ex); } } /** Test bad JNDI resource name with no class loader. */ public void testGetPMFBadJNDI() { PersistenceManagerFactory pmf = null; try { pmf = JDOHelper.getPersistenceManagerFactory("Whatever", getInitialContext()); fail("Bad JNDI resource name should result in JDOFatalUserException"); } catch (JDOFatalUserException ex) { if (verbose) println("Caught expected exception " + ex); } } /** Test bad JNDI resource name with good class loader. */ public void testGetPMFBadJNDIGoodClassLoader() { PersistenceManagerFactory pmf = null; try { pmf = JDOHelper.getPersistenceManagerFactory("Whatever", getInitialContext(), this.getClass().getClassLoader()); fail("Bad JNDI resource name should result in JDOFatalUserException"); } catch (JDOFatalUserException ex) { if (verbose) println("Caught expected exception " + ex); } } /** Test null stream with no class loader. */ public void testGetPMFNullStream() { PersistenceManagerFactory pmf = null; try { pmf = JDOHelper.getPersistenceManagerFactory((InputStream)null); fail("Null JNDI resource name should result in JDOFatalUserException"); } catch (JDOFatalUserException ex) { if (verbose) println("Caught expected exception " + ex); } } /** Test null stream with good class loader. */ public void testGetPMFNullStreamGoodClassLoader() { PersistenceManagerFactory pmf = null; try { pmf = JDOHelper.getPersistenceManagerFactory((InputStream)null, this.getClass().getClassLoader()); fail("Null JNDI resource name should result in JDOFatalUserException"); } catch (JDOFatalUserException ex) { if (verbose) println("Caught expected exception " + ex); } } /** Test null ClassLoader. */ public void testGetPMFNullClassLoader() { PersistenceManagerFactory pmf = null; try { pmf = JDOHelper.getPersistenceManagerFactory ("Whatever", (ClassLoader)null); fail("Null ClassLoader should result in JDOFatalUserException"); } catch (JDOFatalUserException ex) { if (verbose) println("Caught expected exception " + ex); } } /** Test both null ClassLoaders. */ public void testGetPMFBothNullClassLoader() { PersistenceManagerFactory pmf = null; try { pmf = JDOHelper.getPersistenceManagerFactory ("Whatever", (ClassLoader)null, (ClassLoader)null); fail("Null ClassLoader should result in JDOFatalUserException"); } catch (JDOFatalUserException ex) { if (verbose) println("Caught expected exception " + ex); } } /** Test missing property javax.jdo.PersistenceManagerFactoryClass. */ public void testGetPMFNoClassNameProperty() { PersistenceManagerFactory pmf = null; try { pmf = JDOHelper.getPersistenceManagerFactory(new Properties()); fail("Missing property PersistenceManagerFactoryClass should result in JDOFatalUserException "); } catch (JDOFatalUserException ex) { if (verbose) println("Caught expected exception " + ex); } } /** Test bad PMF class does not exist. */ public void testBadPMFClassNotFound() { PersistenceManagerFactory pmf = null; Properties props = new Properties(); props.put("javax.jdo.PersistenceManagerFactoryClass", "ThisClassDoesNotExist"); try { pmf = JDOHelper.getPersistenceManagerFactory(props); fail("Bad PersistenceManagerFactoryClass should result in JDOFatalUserException "); } catch (JDOFatalUserException ex) { if (verbose) println("Caught expected exception " + ex); } } /** Test bad PMF class no method getPersistenceManagerFactory(Properties). */ public void testBadPMFNoGetPMFPropertiesMethod() { PersistenceManagerFactory pmf = null; Properties props = new Properties(); props.put("javax.jdo.PersistenceManagerFactoryClass", "javax.jdo.JDOHelperTest$BadPMFNoGetPMFMethod"); try { pmf = JDOHelper.getPersistenceManagerFactory(props); fail("Bad PersistenceManagerFactory should result in JDOFatalInternalException "); } catch (JDOFatalInternalException ex) { if (ex.getCause() instanceof NoSuchMethodException) { if (verbose) println("Caught expected exception " + ex); } else { fail("Bad PersistenceManagerFactory should result in " + "JDOFatalInternalException with nested " + "NoSuchMethodException. " + "Actual nested exception was " + ex); } } } /** Test bad PMF class no method getPersistenceManagerFactory(Map). */ public void testBadPMFNoGetPMFMapMethod() { PersistenceManagerFactory pmf = null; Map props = new HashMap(); props.put("javax.jdo.PersistenceManagerFactoryClass", "javax.jdo.JDOHelperTest$BadPMFNoGetPMFMethod"); try { pmf = JDOHelper.getPersistenceManagerFactory(props); fail("Bad PersistenceManagerFactory should result in JDOFatalInternalException "); } catch (JDOFatalInternalException ex) { if (ex.getCause() instanceof NoSuchMethodException) { if (verbose) println("Caught expected exception " + ex); } else { fail("Bad PersistenceManagerFactory should result in " + "JDOFatalInternalException with nested " + "NoSuchMethodException. " + "Actual nested exception was " + ex); } } } /** Test bad PMF class non-static getPMF method. */ public void testBadPMFNonStaticGetPMFMethod() { PersistenceManagerFactory pmf = null; Properties props = new Properties(); props.put("javax.jdo.PersistenceManagerFactoryClass", "javax.jdo.JDOHelperTest$BadPMFNonStaticGetPMFMethod"); try { pmf = JDOHelper.getPersistenceManagerFactory(props); fail("Bad PersistenceManagerFactoryClass should result in JDOFatalInternalException "); } catch (JDOFatalInternalException ex) { if (verbose) println("Caught expected exception " + ex); } } /** Test bad PMF class doesn't implement PMF. */ public void testBadPMFWrongReturnType() { PersistenceManagerFactory pmf = null; Properties props = new Properties(); props.put("javax.jdo.PersistenceManagerFactoryClass", "javax.jdo.JDOHelperTest$BadPMFWrongReturnType"); try { pmf = JDOHelper.getPersistenceManagerFactory(props); fail("Bad PersistenceManagerFactoryClass should result in JDOFatalInternalException "); } catch (JDOFatalInternalException ex) { if (verbose) println("Caught expected exception " + ex); } } /** Test bad PMF class getPersistenceManagerFactory throws Exception. */ public void testBadPMFGetPMFMethodThrowsJDOException() { PersistenceManagerFactory pmf = null; Properties props = new Properties(); props.put("javax.jdo.PersistenceManagerFactoryClass", "javax.jdo.JDOHelperTest$BadPMFGetPMFMethodThrowsJDOException"); try { pmf = JDOHelper.getPersistenceManagerFactory(props); fail("BadPMFGetPMFMethodThrowsJDOException.GetPersistenceManagerFactory " + "should result in JDOUnsupportedOptionException. " + "No exception was thrown."); } catch (JDOUnsupportedOptionException ex) { if (verbose) println("Caught expected exception " + ex); } } /** Test bad PMF class getPersistenceManagerFactory returns null. */ public void testBadPMFGetPMFMethodReturnsNull() { PersistenceManagerFactory pmf = null; Properties props = new Properties(); props.put("javax.jdo.PersistenceManagerFactoryClass", "javax.jdo.JDOHelperTest$BadPMFGetPMFMethodReturnsNull"); try { pmf = JDOHelper.getPersistenceManagerFactory(props); fail("BadPMFGetPMFMethodReturnsNull.GetPersistenceManagerFactory " + "should result in JDOFatalInternalException. " + "No exception was thrown."); } catch (JDOFatalInternalException ex) { if (verbose) println("Caught expected exception " + ex); } } /** Test that an unknown standard property cause JDOUserException. */ public void testUnknownStandardProperty() { Properties p = new Properties(); p.setProperty("javax.jdo.unknown.standard.property", "value"); try { JDOHelper.getPersistenceManagerFactory(p); fail("testUnknownStandardProperties should result in JDOUserException. " + "No exception was thrown."); } catch (JDOUserException x) { if (verbose) println("Caught expected exception " + x); } } /** * Test that unknown standard properties cause JDOUserException w/nested * exceptions. */ public void testUnknownStandardProperties() { Properties p = new Properties(); p.setProperty("javax.jdo.unknown.standard.property.1", "value"); p.setProperty("javax.jdo.unknown.standard.property.2", "value"); JDOUserException x = null; try { JDOHelper.getPersistenceManagerFactory(p); fail("testUnknownStandardProperties should result in JDOUserException. " + "No exception was thrown."); } catch (JDOUserException thrown) { if (verbose) println("Caught expected exception " + thrown); x = thrown; } Throwable[] nesteds = x.getNestedExceptions(); assertNotNull(nesteds); assertEquals("should have been 2 nested exceptions", 2, nesteds.length); for (int i = 0; i < nesteds.length; i++) { Throwable t = nesteds[i]; assertTrue("nested exception " + i + " should have been JDOUserException", t instanceof JDOUserException); } } private Context getInitialContext() { try { return new InitialContext(); } catch (NamingException ne) { fail("Could not get Initial Context"); return null; } } public static class BadPMFNoGetPMFMethod { } public static class BadPMFNonStaticGetPMFMethod { public PersistenceManagerFactory getPersistenceManagerFactory(Map props) { return null; } } public static class BadPMFWrongReturnType { public static BadPMFWrongReturnType getPersistenceManagerFactory(Map props) { return new BadPMFWrongReturnType(); } } public static class BadPMFGetPMFMethodThrowsJDOException { public static PersistenceManagerFactory getPersistenceManagerFactory(Map props) { throw new JDOUnsupportedOptionException( "GetPMF method throws JDOUnsupportedOptionException"); } } public static class BadPMFGetPMFMethodThrowsJDOFatalInternalException { public static PersistenceManagerFactory getPersistenceManagerFactory(Map props) { throw new JDOFatalInternalException( "GetPMF method throws JDOFatalInternalException"); } } public static class BadPMFGetPMFMethodReturnsNull { public static PersistenceManagerFactory getPersistenceManagerFactory(Map props) { return null; } } } api/test/java/javax/jdo/listener/InstanceLifecycleEventTest.java100664 12421 12500110371 25361 0ustarmbouschenstaff 0 0 /* * 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. */ /* * InstanceLifecycleEventTest.java * */ package javax.jdo.listener; import javax.jdo.util.AbstractTest; import javax.jdo.util.BatchTestRunner; /** * Tests that instances of InstanceLifecycleEvent can be created and * that the source, type, and target instances are correct. */ public class InstanceLifecycleEventTest extends AbstractTest { Object created = new Object(); Object loaded = new Object(); Object stored = new Object(); Object cleared = new Object(); Object deleted = new Object(); Object dirtied = new Object(); Object attached = new Object(); Object attachTarget = new Object(); Object detached = new Object(); Object detachTarget = new Object(); /** Creates a new instance of SingleFieldIdentityTest */ public InstanceLifecycleEventTest() { } /** * @param args the command line arguments */ public static void main(String[] args) { BatchTestRunner.run(InstanceLifecycleEventTest.class); } public void testConstructorCreateEvent() { InstanceLifecycleEvent e = new InstanceLifecycleEvent (created, InstanceLifecycleEvent.CREATE); assertSame ("Create source differs.", created, e.getSource()); assertEquals ("Create type differs.", InstanceLifecycleEvent.CREATE, e.getEventType()); } public void testConstructorLoadEvent() { InstanceLifecycleEvent e = new InstanceLifecycleEvent (loaded, InstanceLifecycleEvent.LOAD); assertSame ("Load source differs.", loaded, e.getSource()); assertEquals ("Load type differs.", InstanceLifecycleEvent.LOAD, e.getEventType()); } public void testConstructorStoreEvent() { InstanceLifecycleEvent e = new InstanceLifecycleEvent (stored, InstanceLifecycleEvent.STORE); assertSame ("Store source differs.", stored, e.getSource()); assertEquals ("Store type differs.", InstanceLifecycleEvent.STORE, e.getEventType()); } public void testConstructorClearEvent() { InstanceLifecycleEvent e = new InstanceLifecycleEvent (cleared, InstanceLifecycleEvent.CLEAR); assertSame ("Clear source differs.", cleared, e.getSource()); assertEquals ("Clear type differs.", InstanceLifecycleEvent.CLEAR, e.getEventType()); } public void testConstructorDeleteEvent() { InstanceLifecycleEvent e = new InstanceLifecycleEvent (deleted, InstanceLifecycleEvent.DELETE); assertSame ("Delete source differs.", deleted, e.getSource()); assertEquals ("Delete type differs.", InstanceLifecycleEvent.DELETE, e.getEventType()); } public void testConstructorDirtyEvent() { InstanceLifecycleEvent e = new InstanceLifecycleEvent (dirtied, InstanceLifecycleEvent.DIRTY); assertSame ("Dirty source differs.", dirtied, e.getSource()); assertEquals ("Dirty type differs.", InstanceLifecycleEvent.DIRTY, e.getEventType()); } public void testConstructorDetachEvent() { InstanceLifecycleEvent e = new InstanceLifecycleEvent (detached, InstanceLifecycleEvent.DETACH, detachTarget); assertSame ("Detach source differs.", detached, e.getSource()); assertEquals ("Detach type differs.", InstanceLifecycleEvent.DETACH, e.getEventType()); assertSame ("Detach target differs.", detachTarget, e.getTarget()); } public void testConstructorAttachEvent() { InstanceLifecycleEvent e = new InstanceLifecycleEvent (attached, InstanceLifecycleEvent.ATTACH, attachTarget); assertSame ("Attach source differs.", attached, e.getSource()); assertEquals ("Attach type differs.", InstanceLifecycleEvent.ATTACH, e.getEventType()); assertSame ("Attach target differs.", attachTarget, e.getTarget()); } public void testIllegalConstructorTooSmall() { try { InstanceLifecycleEvent e = new InstanceLifecycleEvent (new Object(), -1); } catch (IllegalArgumentException e) { return; // good catch } fail ("Invalid event did not throw IllegalArgumentException."); } public void testIllegalConstructorTooBig() { try { InstanceLifecycleEvent e = new InstanceLifecycleEvent (new Object(), 8); } catch (IllegalArgumentException e) { return; // good catch } fail ("Invalid event did not throw IllegalArgumentException."); } } api/test/java/javax/jdo/MockEnhancer.java100664 10374 12500110371 20650 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo; import java.lang.instrument.IllegalClassFormatException; import java.security.ProtectionDomain; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Properties; import static javax.jdo.Constants.PROPERTY_ENHANCER_VENDOR_NAME; import static javax.jdo.Constants.PROPERTY_ENHANCER_VERSION_NUMBER; import javax.jdo.metadata.JDOMetadata; /** * Tests class javax.jdo.Enhancer (main class). *

*/ public class MockEnhancer implements JDOEnhancer { static Properties props = new Properties(); static { props.put(PROPERTY_ENHANCER_VENDOR_NAME, "Mock Enhancer"); props.put(PROPERTY_ENHANCER_VERSION_NUMBER, "2.3.0"); props.put("MockKey", "MockValue"); } @SuppressWarnings("unused") private boolean verbose; private int numberOfElements; private List classNames = new ArrayList(); private List jarNames = new ArrayList(); private List jdoNames = new ArrayList(); private List puNames = new ArrayList(); @SuppressWarnings("unused") private String outputDirectory = null; public MockEnhancer(){ } public Properties getProperties() { return props; } public JDOEnhancer setVerbose(boolean flag) { this.verbose = flag; return this; } public JDOEnhancer setOutputDirectory(String dirName) { outputDirectory = dirName; return this; } public JDOEnhancer setClassLoader(ClassLoader loader) { // check to see if JDOHelper is loadable from the loader try { loader.loadClass("javax.jdo.JDOHelper"); } catch (ClassNotFoundException ex) { // bad throw new JDOFatalInternalException("Should be able to load JDOHelper from the class loader"); } return this; } public JDOEnhancer addPersistenceUnit(String persistenceUnit) { numberOfElements++; this.puNames.add(persistenceUnit); return this; } public JDOEnhancer addClass(String className, byte[] bytes) { throw new UnsupportedOperationException("Not supported yet."); } public JDOEnhancer addClasses(String... classNames) { numberOfElements += classNames.length; this.classNames.addAll(Arrays.asList(classNames)); return this; } public JDOEnhancer addFiles(String... metadataFiles) { numberOfElements += metadataFiles.length; this.jdoNames.addAll(Arrays.asList(metadataFiles)); return this; } public JDOEnhancer addJar(String jarFileName) { numberOfElements++; this.jarNames.add(jarFileName); return this; } public int enhance() { return numberOfElements; } public int validate() { return numberOfElements; } public byte[] getEnhancedBytes(String className) { throw new UnsupportedOperationException("Not supported yet."); } public void registerMetadata(JDOMetadata metadata) { throw new UnsupportedOperationException("Not supported yet."); } public JDOMetadata newMetadata() { throw new UnsupportedOperationException("Not supported yet."); } public byte[] transform(ClassLoader loader, String className, Class classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws IllegalClassFormatException { throw new UnsupportedOperationException("Not supported yet."); } } api/test/java/javax/jdo/ObjectStateTest.java100664 21167 12500110371 21364 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; import java.lang.reflect.Proxy; import javax.jdo.spi.PersistenceCapable; import javax.jdo.util.AbstractTest; import javax.jdo.util.BatchTestRunner; /* * ObjectStateTest.java * This test class verifies the proper returned ObjectState for * each life cycle state. See Table 3 in section 7.4. * * @since 2.1 */ public class ObjectStateTest extends AbstractTest { static final int PERSISTENT = 1; static final int TRANSACTIONAL = 2; static final int DIRTY = 4; static final int NEW = 8; static final int DELETED = 16; static final int DETACHED = 32; private static final Method jdoIsPersistent = getDeclaredMethod( PersistenceCapable.class, "jdoIsPersistent", null); private static final Method jdoIsTransactional = getDeclaredMethod( PersistenceCapable.class, "jdoIsTransactional", null); private static final Method jdoIsDirty = getDeclaredMethod( PersistenceCapable.class, "jdoIsDirty", null); private static final Method jdoIsNew = getDeclaredMethod( PersistenceCapable.class, "jdoIsNew", null); private static final Method jdoIsDeleted = getDeclaredMethod( PersistenceCapable.class, "jdoIsDeleted", null); private static final Method jdoIsDetached = getDeclaredMethod( PersistenceCapable.class, "jdoIsDetached", null); /** */ public static void main(String args[]) { BatchTestRunner.run(ObjectStateTest.class); } public void testNull() { PersistenceCapable mock = null; assertObjectState("null", null, mock); } public void testTransient() { PersistenceCapable mock = newMock(0); assertObjectState("transient", ObjectState.TRANSIENT, mock); } public void testTransientClean() { PersistenceCapable mock = newMock(TRANSACTIONAL); assertObjectState("transient-clean", ObjectState.TRANSIENT_CLEAN, mock); } public void testTransientDirty() { PersistenceCapable mock = newMock(TRANSACTIONAL+DIRTY); assertObjectState("transient-dirty", ObjectState.TRANSIENT_DIRTY, mock); } public void testPersistentNew() { PersistenceCapable mock = newMock(PERSISTENT+TRANSACTIONAL+NEW+DIRTY); assertObjectState("persistent-new", ObjectState.PERSISTENT_NEW, mock); } public void testPersistentNontransactional() { PersistenceCapable mock = newMock(PERSISTENT); assertObjectState("persistent-nontransactional", ObjectState.HOLLOW_PERSISTENT_NONTRANSACTIONAL, mock); } public void testPersistentNontransactionalDirty() { PersistenceCapable mock = newMock(PERSISTENT+DIRTY); assertObjectState("persistent-nontransactional-dirty", ObjectState.PERSISTENT_NONTRANSACTIONAL_DIRTY, mock); } public void testPersistentClean() { PersistenceCapable mock = newMock(PERSISTENT+TRANSACTIONAL); assertObjectState("persistent-clean", ObjectState.PERSISTENT_CLEAN, mock); } public void testPersistentDirty() { PersistenceCapable mock = newMock(PERSISTENT+TRANSACTIONAL+DIRTY); assertObjectState("persistent-dirty", ObjectState.PERSISTENT_DIRTY, mock); } public void testPersistentDeleted() { PersistenceCapable mock = newMock(PERSISTENT+TRANSACTIONAL+DIRTY+DELETED); assertObjectState("persistent-deleted", ObjectState.PERSISTENT_DELETED, mock); } public void testPersistentNewDeleted() { PersistenceCapable mock = newMock(PERSISTENT+TRANSACTIONAL+NEW+DIRTY+DELETED); assertObjectState("persistent-new-deleted", ObjectState.PERSISTENT_NEW_DELETED, mock); } public void testDetachedClean() { PersistenceCapable mock = newMock(DETACHED); assertObjectState("detached-clean", ObjectState.DETACHED_CLEAN, mock); } public void testDetachedDirty() { PersistenceCapable mock = newMock(DETACHED+DIRTY); assertObjectState("detached-dirty", ObjectState.DETACHED_DIRTY, mock); } private void assertObjectState(String string, ObjectState expected, PersistenceCapable pc) { ObjectState actual = JDOHelper.getObjectState(pc); // test for == here because enums should be singleton if (actual == expected) return; fail("ObjectState failure for " + string + NL + "expected: " + expected + ", actual: " + actual); } /** * Construct a new mock instance of PersistenceCapable that responds * to methods jdoIsXXX by returning the bit value of its constructor * masked with the value of XXX. * @param i the sum of bit masks representing the life cycle state * @return a mock instance of PersistenceCapable */ private PersistenceCapable newMock(final int i) { return (PersistenceCapable) Proxy.newProxyInstance( PersistenceCapable.class.getClassLoader(), new Class[] {PersistenceCapable.class}, new MockInvocationHandler(i)); } private class MockInvocationHandler implements InvocationHandler { /** States is the sum of all life cycle interrogatives. */ private int states; /** * Constructs an invocation handler with the specified bit fields set * according to the sum of values of PERSISTENT, TRANSACTIONAL, DIRTY, * NEW, DELETED, and DETACHED. * @param i the bit field values for the life cycle interrogatives */ private MockInvocationHandler(int i) { states = i; } /** * * @param object the PersistenceCapable instance * @param method the method being invoked * @param parameters parameters (should be null) * @throws java.lang.Throwable unused * @return for jdoIsXXX methods only, returns whether the * bit field selected by the method is set in the * mock handler */ public Object invoke(Object object, Method method, Object[] parameters) throws Throwable { if (method.equals(jdoIsPersistent)) { return (0 != (states & PERSISTENT)); } if (method.equals(jdoIsTransactional)) { return (0 != (states & TRANSACTIONAL)); } if (method.equals(jdoIsDirty)) { return (0 != (states & DIRTY)); } if (method.equals(jdoIsNew)) { return (0 != (states & NEW)); } if (method.equals(jdoIsDeleted)) { return (0 != (states & DELETED)); } if (method.equals(jdoIsDetached)) { return (0 != (states & DETACHED)); } fail("Unexpected method called: " + method.getName()); return Boolean.FALSE; // not reached } } private static Method getDeclaredMethod (Class clazz, String methodName, Class[] parameters) { try { @SuppressWarnings("unchecked") Method result = clazz.getDeclaredMethod(methodName, parameters); return result; } catch (Exception ex) { // human-readable class.methodName(parameter[,parameter]) StringBuffer sb = new StringBuffer(methodName); String delimiter = "("; for (Class parameter: parameters) { sb.append(delimiter); sb.append(parameter.getName()); delimiter = ","; } sb.append(")"); throw new RuntimeException ("getDeclaredMethod for " + clazz.getName() + "." + sb + " threw..." + ex); } } } api/test/java/javax/jdo/pc/PCPoint.java100664 33676 12500110371 20243 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.pc; import java.io.*; import java.util.*; import javax.jdo.PersistenceManager; import javax.jdo.spi.*; import javax.jdo.spi.PersistenceCapable; /** * This is a hand-enhanced version of a simple class with two fields. The * enhanced code assumes datastore identity. * * @version 2.0 */ public class PCPoint implements PersistenceCapable { public int x; public Integer y; // JDO generated fields protected transient StateManager jdoStateManager; protected transient byte jdoFlags; private static final int jdoInheritedFieldCount = 0; private static final String jdoFieldNames[] = { "x", "y" }; private static final Class jdoFieldTypes[]; private static final byte jdoFieldFlags[] = { (byte)(PersistenceCapable.CHECK_READ + PersistenceCapable.CHECK_WRITE + PersistenceCapable.SERIALIZABLE), (byte)(PersistenceCapable.CHECK_READ + PersistenceCapable.CHECK_WRITE + PersistenceCapable.SERIALIZABLE), }; private static final Class jdoPersistenceCapableSuperclass; static { jdoFieldTypes = (new Class[] { Integer.TYPE, sunjdo$classForName$("java.lang.Integer") }); jdoPersistenceCapableSuperclass = null; JDOImplHelper.registerClass( sunjdo$classForName$("javax.jdo.pc.PCPoint"), jdoFieldNames, jdoFieldTypes, jdoFieldFlags, jdoPersistenceCapableSuperclass, new PCPoint()); } /** JDO required no-args constructor. */ public PCPoint() { } /** Constructor. */ public PCPoint(int x, Integer y) { jdoSetx(this, x); jdoSety(this, y); } /** */ public void setX(int x) { jdoSetx(this, x); } /** */ public int getX() { return jdoGetx(this); } /** */ public void setY(Integer y) { jdoSety(this, y); } /** */ public Integer getY() { return jdoGety(this); } /** */ public boolean equals(Object o) { if (o == null || !(o instanceof PCPoint)) return false; PCPoint other = (PCPoint)o; if (jdoGetx(this) != jdoGetx(other)) return false; if (jdoGety(this) == null) return jdoGety(other) == null; if (jdoGety(other) == null) return jdoGety(this) == null; else return jdoGety(this).intValue() == jdoGety(other).intValue(); } /** */ public int hashCode() { int code = getX(); if (getY() != null) { code += getY().intValue(); } return code; } /** */ public String toString() { return "PCPoint(x: " + getX() + ", y: " + getY() + ")"; } // Generated methods in least-derived PersistenceCapable class public final boolean jdoIsPersistent() { StateManager statemanager = jdoStateManager; if (statemanager != null) return statemanager.isPersistent(this); else return false; } public final boolean jdoIsTransactional() { StateManager statemanager = jdoStateManager; if (statemanager != null) return statemanager.isTransactional(this); else return false; } public final boolean jdoIsNew() { StateManager statemanager = jdoStateManager; if (statemanager != null) return statemanager.isNew(this); else return false; } public final boolean jdoIsDirty() { StateManager statemanager = jdoStateManager; if (statemanager != null) return statemanager.isDirty(this); else return false; } public final boolean jdoIsDeleted() { StateManager statemanager = jdoStateManager; if (statemanager != null) return statemanager.isDeleted(this); else return false; } public final boolean jdoIsDetached() { return false; } public final void jdoMakeDirty(String s) { StateManager statemanager = jdoStateManager; if (statemanager != null) statemanager.makeDirty(this, s); } public final PersistenceManager jdoGetPersistenceManager() { StateManager statemanager = jdoStateManager; if (statemanager != null) return statemanager.getPersistenceManager(this); else return null; } public final Object jdoGetObjectId() { StateManager statemanager = jdoStateManager; if (statemanager != null) return statemanager.getObjectId(this); else return null; } public final Object jdoGetTransactionalObjectId() { StateManager statemanager = jdoStateManager; if (statemanager != null) return statemanager.getTransactionalObjectId(this); else return null; } public final Object jdoGetVersion() { StateManager statemanager = jdoStateManager; if (statemanager != null) return statemanager.getVersion(this); else return null; } public final synchronized void jdoReplaceStateManager( StateManager statemanager) { StateManager statemanager1 = jdoStateManager; if (statemanager1 != null) { jdoStateManager = statemanager1.replacingStateManager( this, statemanager); return; } else { JDOImplHelper.checkAuthorizedStateManager(statemanager); jdoStateManager = statemanager; jdoFlags = PersistenceCapable.LOAD_REQUIRED; return; } } public final void jdoReplaceFlags() { StateManager statemanager = jdoStateManager; if (statemanager != null) jdoFlags = statemanager.replacingFlags(this); } public final void jdoReplaceFields(int fields[]) { if (fields == null) throw new IllegalArgumentException("fields is null"); int i = fields.length; for(int j = 0; j < i; j++) jdoReplaceField(fields[j]); } public final void jdoProvideFields(int fields[]) { if (fields == null) throw new IllegalArgumentException("fields is null"); int i = fields.length; for(int j = 0; j < i; j++) jdoProvideField(fields[j]); } protected final void jdoPreSerialize() { StateManager statemanager = jdoStateManager; if (statemanager != null) statemanager.preSerialize(this); } // Generated methods in PersistenceCapable root classes and all classes // that declare objectid-class in xml metadata: public void jdoCopyKeyFieldsToObjectId( PersistenceCapable.ObjectIdFieldSupplier objectidfieldsupplier, Object obj) { } public void jdoCopyKeyFieldsToObjectId(Object obj) { } public void jdoCopyKeyFieldsFromObjectId( PersistenceCapable.ObjectIdFieldConsumer objectidfieldconsumer, Object obj) { } protected void jdoCopyKeyFieldsFromObjectId(Object obj) { } public Object jdoNewObjectIdInstance() { return null; } public Object jdoNewObjectIdInstance(Object o) { return null; } // Generated methods in all PersistenceCapable classes public PersistenceCapable jdoNewInstance(StateManager statemanager) { PCPoint pcpoint = new PCPoint(); pcpoint.jdoFlags = PersistenceCapable.LOAD_REQUIRED; pcpoint.jdoStateManager = statemanager; return pcpoint; } public PersistenceCapable jdoNewInstance( StateManager statemanager, Object obj) { PCPoint pcpoint = new PCPoint(); pcpoint.jdoCopyKeyFieldsFromObjectId(obj); pcpoint.jdoFlags = PersistenceCapable.LOAD_REQUIRED; pcpoint.jdoStateManager = statemanager; return pcpoint; } protected static int jdoGetManagedFieldCount() { return 2; } public static final int jdoGetx(PCPoint pcpoint) { if (pcpoint.jdoFlags <= PersistenceCapable.READ_WRITE_OK) return pcpoint.x; StateManager statemanager = pcpoint.jdoStateManager; if (statemanager == null) return pcpoint.x; if (statemanager.isLoaded(pcpoint, jdoInheritedFieldCount + 0)) return pcpoint.x; else return statemanager.getIntField( pcpoint, jdoInheritedFieldCount + 0, pcpoint.x); } public static final Integer jdoGety(PCPoint pcpoint) { if (pcpoint.jdoFlags <= PersistenceCapable.READ_WRITE_OK) return pcpoint.y; StateManager statemanager = pcpoint.jdoStateManager; if (statemanager == null) return pcpoint.y; if (statemanager.isLoaded(pcpoint, jdoInheritedFieldCount + 1)) return pcpoint.y; else return (Integer)statemanager.getObjectField( pcpoint, jdoInheritedFieldCount + 1, pcpoint.y); } public static final void jdoSetx(PCPoint pcpoint, int i) { if (pcpoint.jdoFlags == PersistenceCapable.READ_WRITE_OK) { pcpoint.x = i; return; } StateManager statemanager = pcpoint.jdoStateManager; if (statemanager == null) { pcpoint.x = i; return; } else { statemanager.setIntField( pcpoint, jdoInheritedFieldCount + 0, pcpoint.x, i); return; } } public static final void jdoSety(PCPoint pcpoint, Integer integer) { if (pcpoint.jdoFlags == PersistenceCapable.READ_WRITE_OK) { pcpoint.y = integer; return; } StateManager statemanager = pcpoint.jdoStateManager; if (statemanager == null) { pcpoint.y = integer; return; } else { statemanager.setObjectField(pcpoint, jdoInheritedFieldCount + 1, pcpoint.y, integer); return; } } public void jdoReplaceField(int field) { StateManager statemanager = jdoStateManager; switch(field - jdoInheritedFieldCount) { case 0: if (statemanager == null) { throw new IllegalStateException("jdoStateManager is null"); } else { x = statemanager.replacingIntField(this, field); return; } case 1: if (statemanager == null) { throw new IllegalStateException("jdoStateManager is null"); } else { y = (Integer)statemanager.replacingObjectField(this, field); return; } } throw new IllegalArgumentException("field number out of range"); } public void jdoProvideField(int field) { StateManager statemanager = jdoStateManager; switch(field - jdoInheritedFieldCount) { case 0: if (statemanager == null) { throw new IllegalStateException("jdoStateManager is null"); } else { statemanager.providedIntField(this, field, x); return; } case 1: if (statemanager == null) { throw new IllegalStateException("jdoStateManager is null"); } else { statemanager.providedObjectField(this, field, y); return; } } throw new IllegalArgumentException("field number out of range"); } public void jdoCopyFields(Object obj, int fieldNumbers[]) { if (jdoStateManager == null) throw new IllegalStateException("jdoStateManager is null"); if (!(obj instanceof PCPoint)) throw new ClassCastException(obj.getClass().getName()); if (fieldNumbers == null) throw new IllegalArgumentException("fieldNumber is null"); PCPoint pcpoint = (PCPoint)obj; if (pcpoint.jdoStateManager != jdoStateManager) throw new IllegalArgumentException("wrong jdoStateManager"); int i = fieldNumbers.length; for(int j = 0; j < i; j++) jdoCopyField(pcpoint, fieldNumbers[j]); } protected final void jdoCopyField(PCPoint pcpoint, int fieldNumber) { switch(fieldNumber - jdoInheritedFieldCount) { case 0: if (pcpoint == null) { throw new IllegalArgumentException("pcpoint is null"); } else { x = pcpoint.x; return; } case 1: if (pcpoint == null) { throw new IllegalArgumentException("pcpoint is null"); } else { y = pcpoint.y; return; } } throw new IllegalArgumentException("field number out of range"); } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { jdoPreSerialize(); out.defaultWriteObject(); } protected static final Class sunjdo$classForName$(String s) { try { return Class.forName(s); } catch(ClassNotFoundException ex) { throw new NoClassDefFoundError(ex.getMessage()); } } } api/test/java/javax/jdo/PMFMapMapTest.java100664 37651 12500110371 20700 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.File; import java.net.MalformedURLException; import javax.jdo.util.AbstractTest; import java.io.IOException; import java.io.InputStream; import java.net.URL; import java.net.URLClassLoader; import java.util.Properties; import junit.framework.TestSuite; import javax.jdo.util.BatchTestRunner; /** * * Tests class javax.jdo.JDOHelper for calls to the impl's static method * getPersistenceManagerFactory(Map overrides, Map props). * */ public class PMFMapMapTest extends AbstractJDOConfigTest { static String expectedDriverName = "Jane Doe"; static String expectedDriverName4NamedPMF = "Larry"; static String expectedDriverNameWithOverrides = "Gerard Manley Hopkins"; static String PMFName = "BookSearch"; static String resourceDir = "/Pmfmapmap01/"; static String propsDir = "/Pmfmapmap02/"; static String pmfServiceClass = "javax.jdo.stub.StubPMF"; static String propertiesFile = "propsfile.props"; PersistenceManagerFactory pmf; Properties props; Properties overrides; URLClassLoader resourceClassLoader; ClassLoader saveContextClassLoader; public static void main(String args[]) { BatchTestRunner.run(PMFMapMapTest.class); } /** * {@inheritDoc} * * @return {@inheritDoc} */ public static TestSuite suite() { return new TestSuite(PMFMapMapTest.class); } void setupResourceClassLoader(String dir) throws IOException { switch (dir.charAt(dir.length() - 1)) { case '\\': dir = dir.substring(0, dir.length() - 1) + '/'; break; case '/': break; default: if (new File(dir).isDirectory()) { dir += '/'; } } resourceClassLoader = new JDOConfigTestClassLoader(getClass() .getClassLoader(), JDOCONFIG_CLASSPATH_PREFIX + dir); } /* * static PersistenceManagerFactory getPersistenceManagerFactory() Get the * anonymous PersistenceManagerFactory configured via the standard * configuration file resource "META-INF/jdoconfig.xml", using the current * thread's context class loader to locate the configuration file * resource(s). */ public void testJDOConfigXML() throws IOException { setupResourceClassLoader(resourceDir); Thread.currentThread().setContextClassLoader(resourceClassLoader); try { pmf = JDOHelper.getPersistenceManagerFactory(); } catch (JDOFatalUserException ex) { fail("Failed to find PersistenceManagerFactoryClass." + ex.getMessage()); } String driverName = pmf.getConnectionDriverName(); if (!expectedDriverName.equals(driverName)) { fail("Bad ConnectionDriverName(): " + driverName + ". Expected: \"" + expectedDriverName + "\""); } } /* * static PersistenceManagerFactory getPersistenceManagerFactory * (java.lang.ClassLoader pmfClassLoader) Get the anonymous * PersistenceManagerFactory configured via the standard configuration file * resource "META-INF/jdoconfig.xml", using the given class loader. */ public void testJDOConfigXMLWithLoader() throws IOException { setupResourceClassLoader(resourceDir); try { pmf = JDOHelper.getPersistenceManagerFactory(resourceClassLoader); } catch (JDOFatalUserException ex) { fail("Failed to find PersistenceManagerFactoryClass." + ex.getMessage()); } String driverName = pmf.getConnectionDriverName(); if (!expectedDriverName.equals(driverName)) { fail("Bad ConnectionDriverName(): " + driverName + ". Expected: \"" + expectedDriverName + "\""); } } /* * static PersistenceManagerFactory getPersistenceManagerFactory( * java.io.File propsFile) Returns a PersistenceManagerFactory configured * based on the properties stored in the file at propsFile. */ public void testPropsFile() throws IOException { setupResourceClassLoader(propsDir); Thread.currentThread().setContextClassLoader(resourceClassLoader); try { pmf = JDOHelper.getPersistenceManagerFactory(propertiesFile); } catch (JDOFatalUserException ex) { fail("Failed to find PersistenceManagerFactoryClass." + ex.getMessage()); } String driverName = pmf.getConnectionDriverName(); if (!expectedDriverName.equals(driverName)) { fail("Bad ConnectionDriverName(): " + driverName + ". Expected: \"" + expectedDriverName + "\""); } } /* * static PersistenceManagerFactory getPersistenceManagerFactory( * java.io.File propsFile, java.lang.ClassLoader loader) Returns a * PersistenceManagerFactory configured based on the properties stored in * the file at propsFile. */ public void testPropsFileAndLoader() throws IOException { setupResourceClassLoader(propsDir); try { pmf = JDOHelper.getPersistenceManagerFactory(propertiesFile, resourceClassLoader); } catch (JDOFatalUserException ex) { fail("Failed to find PersistenceManagerFactoryClass." + ex.getMessage()); } String driverName = pmf.getConnectionDriverName(); if (!expectedDriverName.equals(driverName)) { fail("Bad ConnectionDriverName(): " + driverName + ". Expected: \"" + expectedDriverName + "\""); } } /* * static PersistenceManagerFactory getPersistenceManagerFactory( * java.io.InputStream stream) Returns a PersistenceManagerFactory * configured based on the Properties stored in the input stream at stream. */ public void testInputStream() throws IOException { props = new Properties(); props.setProperty(PROPERTY_PERSISTENCE_MANAGER_FACTORY_CLASS, pmfServiceClass); props.setProperty(PROPERTY_CONNECTION_DRIVER_NAME, expectedDriverName); ByteArrayOutputStream outstream = new ByteArrayOutputStream(); try { props.store(outstream, ""); } catch (IOException ex) { fail(ex.getMessage()); } InputStream byteArrayInputStream = new ByteArrayInputStream( outstream.toByteArray()); setupResourceClassLoader(resourceDir); Thread.currentThread().setContextClassLoader(resourceClassLoader); try { pmf = JDOHelper.getPersistenceManagerFactory(byteArrayInputStream); } catch (JDOFatalUserException ex) { fail("Failed to find PersistenceManagerFactoryClass." + ex.getMessage()); } String driverName = pmf.getConnectionDriverName(); if (!expectedDriverName.equals(driverName)) { fail("Bad ConnectionDriverName(): " + driverName + ". Expected: \"" + expectedDriverName + "\""); } } /* * static PersistenceManagerFactory getPersistenceManagerFactory( * java.io.InputStream stream, java.lang.ClassLoader loader) Returns a * PersistenceManagerFactory configured based on the Properties stored in * the input stream at stream. */ public void testInputStreamWithLoader() throws IOException { props = new Properties(); props.setProperty(PROPERTY_PERSISTENCE_MANAGER_FACTORY_CLASS, pmfServiceClass); props.setProperty(PROPERTY_CONNECTION_DRIVER_NAME, expectedDriverName); ByteArrayOutputStream outstream = new ByteArrayOutputStream(); try { props.store(outstream, ""); } catch (IOException ex) { fail(ex.getMessage()); } InputStream byteArrayInputStream = new ByteArrayInputStream( outstream.toByteArray()); setupResourceClassLoader(resourceDir); try { pmf = JDOHelper.getPersistenceManagerFactory(byteArrayInputStream, resourceClassLoader); } catch (JDOFatalUserException ex) { fail("Failed to find PersistenceManagerFactoryClass." + ex.getMessage()); } String driverName = pmf.getConnectionDriverName(); if (!expectedDriverName.equals(driverName)) { fail("Bad ConnectionDriverName(): " + driverName + ". Expected: \"" + expectedDriverName + "\""); } } /* * static PersistenceManagerFactory getPersistenceManagerFactory( * java.util.Map props) Get a PersistenceManagerFactory based on a * Properties instance, using the current thread's context class loader to * locate the PersistenceManagerFactory class. */ public void testProperties() throws IOException { props = new Properties(); props.setProperty(PROPERTY_PERSISTENCE_MANAGER_FACTORY_CLASS, pmfServiceClass); props.setProperty(PROPERTY_CONNECTION_DRIVER_NAME, expectedDriverName); setupResourceClassLoader(resourceDir); Thread.currentThread().setContextClassLoader(resourceClassLoader); try { pmf = JDOHelper.getPersistenceManagerFactory(props); } catch (JDOFatalUserException ex) { fail("Failed to find PersistenceManagerFactoryClass." + ex.getMessage()); } String driverName = pmf.getConnectionDriverName(); if (!expectedDriverName.equals(driverName)) { fail("Bad ConnectionDriverName(): " + driverName + ". Expected: \"" + expectedDriverName + "\""); } } /* * static PersistenceManagerFactory getPersistenceManagerFactory( * java.util.Map props, java.lang.ClassLoader pmfClassLoader) Get a * PersistenceManagerFactory based on a Map and a class loader. */ public void testPropertiesAndLoader() throws IOException { props = new Properties(); props.setProperty(PROPERTY_PERSISTENCE_MANAGER_FACTORY_CLASS, pmfServiceClass); props.setProperty(PROPERTY_CONNECTION_DRIVER_NAME, expectedDriverName); setupResourceClassLoader(resourceDir); try { pmf = JDOHelper.getPersistenceManagerFactory(props, resourceClassLoader); } catch (JDOFatalUserException ex) { fail("Failed to find PersistenceManagerFactoryClass." + ex.getMessage()); } String driverName = pmf.getConnectionDriverName(); if (!expectedDriverName.equals(driverName)) { fail("Bad ConnectionDriverName(): " + driverName + ". Expected: \"" + expectedDriverName + "\""); } } /* * static PersistenceManagerFactory getPersistenceManagerFactory * (java.util.Map overrides, java.lang.String name) Returns a named * PersistenceManagerFactory or persistence unit. */ public void testNamedPMFWithOverrides() throws IOException { overrides = new Properties(); overrides.setProperty(PROPERTY_CONNECTION_DRIVER_NAME, expectedDriverNameWithOverrides); setupResourceClassLoader(resourceDir); Thread.currentThread().setContextClassLoader(resourceClassLoader); try { pmf = JDOHelper.getPersistenceManagerFactory(overrides, PMFName); } catch (JDOFatalUserException ex) { fail("Failed to find PersistenceManagerFactoryClass." + ex.getMessage()); } String driverName = pmf.getConnectionDriverName(); if (!expectedDriverNameWithOverrides.equals(driverName)) { fail("Bad ConnectionDriverName(): " + driverName + ". Expected: \"" + expectedDriverNameWithOverrides + "\""); } } /* * static PersistenceManagerFactory getPersistenceManagerFactory( * java.util.Map overrides, java.lang.String name, * java.lang.ClassLoader resourceLoader) Returns a named * PersistenceManagerFactory or persistence unit. */ public void testNamedPMFWithOverridesAndLoader() throws IOException { overrides = new Properties(); overrides.setProperty(PROPERTY_CONNECTION_DRIVER_NAME, expectedDriverNameWithOverrides); setupResourceClassLoader(resourceDir); try { pmf = JDOHelper.getPersistenceManagerFactory(overrides, PMFName, resourceClassLoader); } catch (JDOFatalUserException ex) { fail("Failed to find PersistenceManagerFactoryClass." + ex.getMessage()); } String driverName = pmf.getConnectionDriverName(); if (!expectedDriverNameWithOverrides.equals(driverName)) { fail("Bad ConnectionDriverName(): " + driverName + ". Expected: \"" + expectedDriverNameWithOverrides + "\""); } } /* * static PersistenceManagerFactory getPersistenceManagerFactory( * java.util.Map overrides, java.lang.String name, * java.lang.ClassLoader resourceLoader, java.lang.ClassLoader pmfLoader) * Returns a PersistenceManagerFactory configured based on the properties * stored in the resource at name, or, if not found, returns a * PersistenceManagerFactory with the given name or, if not found, returns a * javax.persistence.EntityManagerFactory cast to a * PersistenceManagerFactory. */ public void testNamedPMFWithOverridesAndTwoLoaders() throws IOException { overrides = new Properties(); overrides.setProperty(PROPERTY_CONNECTION_DRIVER_NAME, expectedDriverNameWithOverrides); setupResourceClassLoader(resourceDir); try { pmf = JDOHelper.getPersistenceManagerFactory(overrides, PMFName, resourceClassLoader, Thread.currentThread() .getContextClassLoader()); } catch (JDOFatalUserException ex) { fail("Failed to find PersistenceManagerFactoryClass. " + ex.getMessage()); } String driverName = pmf.getConnectionDriverName(); if (!expectedDriverNameWithOverrides.equals(driverName)) { fail("Bad ConnectionDriverName(): " + driverName + ". Expected: \"" + expectedDriverNameWithOverrides + "\""); } } /* * static PersistenceManagerFactory getPersistenceManagerFactory( * java.lang.String name) Returns a named PersistenceManagerFactory or * persistence unit. */ public void testNamedPMF() throws IOException { setupResourceClassLoader(resourceDir); Thread.currentThread().setContextClassLoader(resourceClassLoader); try { pmf = JDOHelper.getPersistenceManagerFactory(PMFName); } catch (JDOFatalUserException ex) { fail("Failed to find PersistenceManagerFactoryClass. " + ex.getMessage()); } String driverName = pmf.getConnectionDriverName(); if (!expectedDriverName4NamedPMF.equals(driverName)) { fail("Bad ConnectionDriverName(): " + driverName + ". Expected: \"" + expectedDriverName4NamedPMF + "\""); } } /* * static PersistenceManagerFactory getPersistenceManagerFactory * (java.lang.String name, java.lang.ClassLoader loader) Returns a named * PersistenceManagerFactory or persistence unit. */ public void testNamedPMFWithLoader() throws IOException { setupResourceClassLoader(resourceDir); try { pmf = JDOHelper.getPersistenceManagerFactory(PMFName, resourceClassLoader); } catch (JDOFatalUserException ex) { fail("Failed to find PersistenceManagerFactoryClass. " + ex.getMessage()); } String driverName = pmf.getConnectionDriverName(); if (!expectedDriverName4NamedPMF.equals(driverName)) { fail("Bad ConnectionDriverName(): " + driverName + ". Expected: \"" + expectedDriverName4NamedPMF + "\""); } } /* * static PersistenceManagerFactory getPersistenceManagerFactory( * java.lang.String name, java.lang.ClassLoader resourceLoader, * java.lang.ClassLoader pmfLoader) Returns a named * PersistenceManagerFactory or persistence unit. */ public void testNamedPMFWithTwoLoaders() throws IOException { setupResourceClassLoader(resourceDir); try { pmf = JDOHelper.getPersistenceManagerFactory(PMFName, resourceClassLoader, Thread.currentThread() .getContextClassLoader()); } catch (JDOFatalUserException ex) { fail("Failed to find PersistenceManagerFactoryClass. " + ex.getMessage()); } String driverName = pmf.getConnectionDriverName(); if (!expectedDriverName4NamedPMF.equals(driverName)) { fail("Bad ConnectionDriverName(): " + driverName + ". Expected: \"" + expectedDriverName4NamedPMF + "\""); } } } api/test/java/javax/jdo/PMFProxy.java100664 3576 12500110371 17765 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; import java.lang.reflect.Proxy; /** * *

*/ public class PMFProxy implements InvocationHandler { private String connectionDriverName; public static PersistenceManagerFactory newInstance() { PersistenceManagerFactory pmf = (PersistenceManagerFactory) Proxy.newProxyInstance( PMFProxy.class.getClassLoader(), new Class[]{PersistenceManagerFactory.class}, new PMFProxy()); return pmf; } /* * */ public Object invoke(Object proxy, Method m, Object[] args) throws Exception { Object result = null; if (m.getName().equals("getConnectionDriverName")) { result = connectionDriverName; } else if (m.getName().equals("setConnectionDriverName")) { connectionDriverName = (String) args[0]; } else { throw new Exception( "Unexpected invocation of method: " + m); } return result; } } api/test/java/javax/jdo/PMFService.java100664 3530 12500110371 20232 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo; import java.util.Map; /** * *

*/ public class PMFService implements Constants{ public PMFService() { } public static PersistenceManagerFactory getPersistenceManagerFactory( Map overrides, Map props) { PersistenceManagerFactory pmf = (PersistenceManagerFactory) PMFProxy.newInstance(); setPMFProperties(pmf, props, overrides); return pmf; } public static PersistenceManagerFactory getPersistenceManagerFactory( Map props) { PersistenceManagerFactory pmf = (PersistenceManagerFactory) PMFProxy.newInstance(); setPMFProperties(pmf, props, null); return pmf; } private static void setPMFProperties(PersistenceManagerFactory pmf, Map props, Map overrides) { pmf.setConnectionDriverName((String)props.get(PROPERTY_CONNECTION_DRIVER_NAME)); if (overrides != null) { pmf.setConnectionDriverName((String)overrides.get(PROPERTY_CONNECTION_DRIVER_NAME)); } } } api/test/java/javax/jdo/schema/XMLTest.java100664 11526 12500110371 21053 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.schema; import java.io.File; import java.io.IOException; import java.io.FilenameFilter; import java.util.Arrays; import java.util.List; import javax.jdo.JDOFatalException; import javax.jdo.util.AbstractTest; import javax.jdo.util.BatchTestRunner; import javax.jdo.util.XMLTestUtil; import javax.xml.parsers.*; import org.w3c.dom.Document; import org.xml.sax.*; import org.xml.sax.helpers.*; /** * Tests schema files. *

*/ public class XMLTest extends AbstractTest { /** */ protected static String BASEDIR = System.getProperty("basedir", "."); /** File prefix */ protected static final String FILE_PREFIX = BASEDIR + "/test/schema/"; /** */ protected static final File JDO_XSD_FILE = new File(BASEDIR + "/target/classes/javax/jdo/jdo_2_2.xsd"); /** */ protected static final File ORM_XSD_FILE = new File(BASEDIR + "/target/classes/javax/jdo/orm_2_2.xsd"); /** */ protected static final File JDOQUERY_XSD_FILE = new File(BASEDIR + "/target/classes/javax/jdo/jdoquery_2_2.xsd"); /** .xsd files */ protected static final File[] XSD_FILES = new File[] {JDO_XSD_FILE, ORM_XSD_FILE, JDOQUERY_XSD_FILE}; /** XSD metadata files. */ protected static File[] positiveXSDJDO = getFiles("Positive", "-xsd.jdo"); protected static File[] negativeXSDJDO = getFiles("Negative", "-xsd.jdo"); protected static File[] positiveXSDORM = getFiles("Positive", "-xsd.orm"); protected static File[] negativeXSDORM = getFiles("Negative", "-xsd.orm"); protected static File[] positiveXSDJDOQUERY = getFiles("Positive", "-xsd.jdoquery"); protected static File[] negativeXSDJDOQUERY = getFiles("Negative", "-xsd.jdoquery"); /** DTD metadata files. */ protected static File[] positiveDTDJDO = getFiles("Positive", "-dtd.jdo"); protected static File[] negativeDTDJDO = getFiles("Negative", "-dtd.jdo"); protected static File[] positiveDTDORM = getFiles("Positive", "-dtd.orm"); protected static File[] negativeDTDORM = getFiles("Negative", "-dtd.orm"); protected static File[] positiveDTDJDOQUERY = getFiles("Positive", "-dtd.jdoquery"); protected static File[] negativeDTDJDOQUERY = getFiles("Negative", "-dtd.jdoquery"); /** Returns array of files of matching file names. */ protected static File[] getFiles(final String prefix, final String suffix) { FilenameFilter filter = new FilenameFilter () { public boolean accept(File file, String name) { return (name.startsWith(prefix) && name.endsWith(suffix)); } }; File dir = new File(FILE_PREFIX); return dir.listFiles(filter); } /** */ public static void main(String args[]) { BatchTestRunner.run(XMLTest.class); } /** Test XSD files jdo.xsd, orm.xsd, and jdoquery.xsd. */ public void testXSD() { XMLTestUtil util = new XMLTestUtil(); appendMessage(util.checkXMLNonValidating(XSD_FILES)); failOnError(); } /** Test XSD based .jdo, .orm and .jdoquery files. */ public void testXSDBased() { XMLTestUtil util = new XMLTestUtil(); appendMessage(util.checkXML(positiveXSDJDO, true)); appendMessage(util.checkXML(negativeXSDJDO, false)); appendMessage(util.checkXML(positiveXSDORM, true)); appendMessage(util.checkXML(negativeXSDORM, false)); appendMessage(util.checkXML(positiveXSDJDOQUERY, true)); appendMessage(util.checkXML(negativeXSDJDOQUERY, false)); failOnError(); } /** Test DTD based .jdo, .orm and .jdoquery files. */ public void testDTDBased() { XMLTestUtil util = new XMLTestUtil(); appendMessage(util.checkXML(positiveDTDJDO, true)); appendMessage(util.checkXML(negativeDTDJDO, false)); appendMessage(util.checkXML(positiveDTDORM, true)); appendMessage(util.checkXML(negativeDTDORM, false)); appendMessage(util.checkXML(positiveDTDJDOQUERY, true)); appendMessage(util.checkXML(negativeDTDJDOQUERY, false)); failOnError(); } } api/test/java/javax/jdo/spi/JDOImplHelperTest.java100664 24574 12500110371 22353 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.spi; import java.util.Collection; import java.util.Properties; import javax.jdo.Constants; import javax.jdo.JDOHelper; import javax.jdo.JDOUserException; import javax.jdo.pc.PCPoint; import javax.jdo.util.AbstractTest; import javax.jdo.util.BatchTestRunner; /** * Tests class javax.jdo.spi.JDOImplHelper. *

* Missing: testNewInstance + testNewObjectIdInstance * Missing: tests for JDOImplHelper methods: copyKeyFieldsToObjectId and * copyKeyFieldsFromObjectId. */ public class JDOImplHelperTest extends AbstractTest { /** */ private RegisterClassEvent event; /** */ public static void main(String args[]) { BatchTestRunner.run(JDOImplHelperTest.class); } /** */ public void setUp() { // make sure PCClass is loaded before any tests are run PCPoint p = new PCPoint(1, new Integer(1)); } /** */ public void testGetFieldNames() { JDOImplHelper implHelper = JDOImplHelper.getInstance(); String[] fieldNames = implHelper.getFieldNames(PCPoint.class); if (fieldNames == null) { fail("array of field names is null"); } if (fieldNames.length != 2) { fail("Unexpected length of fieldNames; expected 2, got " + fieldNames.length); } if (!fieldNames[0].equals("x")) { fail("Unexpected field; expected x, got " + fieldNames[0]); } if (!fieldNames[1].equals("y")) { fail("Unexpected field; expected y, got " + fieldNames[1]); } } /** */ public void testGetFieldTypes() { JDOImplHelper implHelper = JDOImplHelper.getInstance(); Class[] fieldTypes = implHelper.getFieldTypes(PCPoint.class); if (fieldTypes == null) { fail("array of field types is null"); } if (fieldTypes.length != 2) { fail("Unexpected length of fieldTypes; expected 2, got " + fieldTypes.length); } if (fieldTypes[0] != int.class) { fail("Unexpected field type; expected int, got " + fieldTypes[0]); } if (fieldTypes[1] != Integer.class) { fail("Unexpected field type; expected Integer, got " + fieldTypes[1]); } } /** */ public void testGetFieldFlags() { byte expected = (byte) (PersistenceCapable.CHECK_READ + PersistenceCapable.CHECK_WRITE + PersistenceCapable.SERIALIZABLE); JDOImplHelper implHelper = JDOImplHelper.getInstance(); byte[] fieldFlags = implHelper.getFieldFlags(PCPoint.class); if (fieldFlags == null) { fail("array of field flags is null"); } if (fieldFlags.length != 2) { fail("Unexpected length of fieldFlags; expected 2, got " + fieldFlags.length); } if (fieldFlags[0] != expected) { fail("Unexpected field flag; expected " + expected + ", got " + fieldFlags[0]); } if (fieldFlags[1] != expected) { fail("Unexpected field flag; expected " + expected + ", got " + fieldFlags[1]); } } /** */ public void testGetPCSuperclass() { JDOImplHelper implHelper = JDOImplHelper.getInstance(); Class pcSuper = implHelper.getPersistenceCapableSuperclass(PCPoint.class); if (pcSuper != null) { fail("Wrong pc superclass of PCPoint; expected null, got " + pcSuper); } } /** */ public void testNewInstance() { // TBD: test JDOImplHelper.newInstance(pcClass, sm) and // JDOImplHelper.newInstance(pcClass, sm, oid) } /** */ public void testNewObjectIdInstance() { // TBD: test JDOImplHelper.newObjectIdInstance(pcClass) } /** */ public void testClassRegistration() { JDOImplHelper implHelper = JDOImplHelper.getInstance(); Collection registeredClasses = implHelper.getRegisteredClasses(); // test whether PCPoint is registered if (!registeredClasses.contains(PCPoint.class)) { fail("Missing registration of pc class PCPoint"); } // Save registered meta data for restoring String[] fieldNames = implHelper.getFieldNames(PCPoint.class); Class[] fieldTypes = implHelper.getFieldTypes(PCPoint.class); byte[] fieldFlags = implHelper.getFieldFlags(PCPoint.class); Class pcSuperclass = implHelper.getPersistenceCapableSuperclass(PCPoint.class); // test unregisterClass with null parameter try { implHelper.unregisterClass(null); fail("Missing exception when calling unregisterClass(null)"); } catch (NullPointerException ex) { // expected exception => OK } // test unregister PCPoint class implHelper.unregisterClass(PCPoint.class); registeredClasses = implHelper.getRegisteredClasses(); if (registeredClasses.contains(PCPoint.class)) { fail("PCPoint still registered"); } // register PCPoint again JDOImplHelper.registerClass(PCPoint.class, fieldNames, fieldTypes, fieldFlags, pcSuperclass, new PCPoint()); } /** */ public void testClassListenerRegistration() { JDOImplHelper implHelper = JDOImplHelper.getInstance(); // add listener and check event event = null; RegisterClassListener listener = new SimpleListener(); implHelper.addRegisterClassListener(listener); JDOImplHelper.registerClass(JDOImplHelperTest.class, new String[0], new Class[0], new byte[0], null, null); if (event == null) { fail("Missing event "); } // remove listener and check event event = null; implHelper.removeRegisterClassListener(listener); JDOImplHelper.registerClass(JDOImplHelperTest.class, new String[0], new Class[0], new byte[0], null, null); if (event != null) { fail("Unexpected event " + event); } } /** * Test that an unknown standard property causes JDOUserException. */ public void testUnknownStandardProperty() { Properties p = new Properties(); p.setProperty("javax.jdo.unknown.standard.property", "value"); JDOUserException x = null; try { JDOImplHelper.assertOnlyKnownStandardProperties(p); fail("testUnknownStandardProperty should result in JDOUserException. " + "No exception was thrown."); } catch (JDOUserException thrown) { if (verbose) println("Caught expected exception " + thrown); x = thrown; } assertNull("should have had no nested exceptions", x.getNestedExceptions()); } /** * Test that unknown standard properties cause JDOUserException w/nested * exceptions. */ public void testUnknownStandardProperties() { Properties p = new Properties(); p.setProperty("javax.jdo.unknown.standard.property.1", "value"); p.setProperty("javax.jdo.unknown.standard.property.2", "value"); JDOUserException x = null; try { JDOImplHelper.assertOnlyKnownStandardProperties(p); fail("testUnknownStandardProperties should result in JDOUserException. " + "No exception was thrown."); } catch (JDOUserException thrown) { if (verbose) println("Caught expected exception " + thrown); x = thrown; } Throwable[] nesteds = x.getNestedExceptions(); assertNotNull(nesteds); assertEquals("should have been 2 nested exceptions", 2, nesteds.length); for (int i = 0; i < nesteds.length; i++) { Throwable t = nesteds[i]; assertTrue("nested exception " + i + " should have been JDOUserException", t instanceof JDOUserException); } } /** * Test that unknown non-standard properties & well-formed listener * properties don't cause JDOUserException. */ public void testUnknownNonStandardPropertiesAndListeners() { Properties p = new Properties(); p.put("unknown.property", "value"); p.put(new Object(), "value"); p.put(Constants.PROPERTY_PREFIX_INSTANCE_LIFECYCLE_LISTENER + "unknown.listener", "value"); JDOImplHelper.assertOnlyKnownStandardProperties(p); } /** * Test that all JDO standard properties don't cause JDOUserException. */ public void testOnlyStandardProperties() { Properties props = new Properties(); for (String p : JDOImplHelper.USER_CONFIGURABLE_STANDARD_PROPERTIES) { props.setProperty(p, p); } JDOImplHelper.assertOnlyKnownStandardProperties(props); } /** * Test that an known standard property in mixed case succeeds. */ public void testKnownStandardPropertyThatDiffersInCaseOnly() { Properties p = new Properties(); p.setProperty("JaVaX.jDo.oPtIoN.CoNNectionDRiVerNamE", "value"); p.setProperty("jAvAx.JdO.lIsTeNeR.InstaNceLifeCycleLisTener.foo.Bar", ""); JDOImplHelper.assertOnlyKnownStandardProperties(p); } /** */ class SimpleListener implements RegisterClassListener { /** */ public void registerClass(RegisterClassEvent event) { JDOImplHelperTest.this.event = event; } } } api/test/java/javax/jdo/spi/StateInterrogationTest.java100664 46720 12500110371 23577 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.spi; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Proxy; import javax.jdo.JDOHelper; import javax.jdo.PersistenceManager; import javax.jdo.util.AbstractTest; import javax.jdo.util.BatchTestRunner; /** * This class tests the StateInterrogation interface. The test is in * several parts: *

  • Add and remove the StateInterrogation instance *
  • test interrogatives to return the correct answer *
  • test getters to return the correct answer *
  • test makeDirty to return. *
* We use an mock implementation of StateInterrogation interface to * log when calls are received and to return the correct replies. * We use a java.lang.reflect.Proxy for the getPersistenceManager call * because it's too much work to mock it. */ public class StateInterrogationTest extends AbstractTest { private JDOImplHelper implHelper = JDOImplHelper.getInstance(); private JDOHelper helper = new JDOHelper(); /** Creates a new instance of StateInterrogationTest */ public StateInterrogationTest() { } /** * @param args the command line arguments */ public static void main(String[] args) { BatchTestRunner.run(StateInterrogationTest.class); } public void testGetObjectIdNull() { Object id2 = helper.getObjectId(nbcpc2); assertNull("ObjectId should be null before addStateInterrogations", id2); addStateInterrogations(); Object id = helper.getObjectId(Boolean.TRUE); assertNull("ObjectId should be null for non-pc instances", id); } public void testGetObjectId() { addStateInterrogations(); Object id2 = helper.getObjectId(nbcpc2); assertNotNull("ObjectId should not be null", id2); assertEquals("ObjectId should be 2", 2, id2.hashCode()); Object id20 = helper.getObjectId(nbcpc2); assertEquals("ObjectIds from same object should be equal", id2, id20); } public void testRemoveStateInterrogation() { addStateInterrogations(); Object id2 = helper.getObjectId(nbcpc2); assertNotNull("ObjectId should not be null", id2); assertEquals("ObjectId should be 2", 2, id2.hashCode()); implHelper.removeStateInterrogation(si2); implHelper.removeStateInterrogation(si0); Object id21 = helper.getObjectId(nbcpc2); assertNull("ObjectId should be null after RemoveStateInterrogation", id21); Object id1 = helper.getObjectId(nbcpc1); assertNotNull("ObjectId should not be null", id1); assertEquals("ObjectId should be 1", 1, id1.hashCode()); } public void testGetTransactionalObjectIdNull() { Object id2 = helper.getTransactionalObjectId(nbcpc2); assertNull("TransactionalObjectId should be null before addStateInterrogations", id2); addStateInterrogations(); Object id = helper.getTransactionalObjectId(Boolean.TRUE); assertNull("TransactionalObjectId should be null for non-pc instances", id); } public void testGetTransactionalObjectId() { addStateInterrogations(); Object id2 = helper.getTransactionalObjectId(nbcpc2); assertNotNull("TransactionalObjectId should not be null", id2); assertEquals("TransactionalObjectId should be 2", 2, id2.hashCode()); Object id20 = helper.getTransactionalObjectId(nbcpc2); assertEquals("TransactionalObjectIds from same object should be equal", id2, id20); } public void testGetPersistenceManagerNull() { Object pm2 = helper.getPersistenceManager(nbcpc2); assertNull("PersistenceManager should be null before addStateInterrogations", pm2); addStateInterrogations(); Object pm = helper.getPersistenceManager(Boolean.TRUE); assertNull("PersistenceManager should be null for non-pc instances", pm); } public void testGetPersistenceManager() { addStateInterrogations(); Object pm2 = helper.getPersistenceManager(nbcpc2); assertNotNull("PersistenceManager should not be null", pm2); assertEquals("PersistenceManager should be 2", 2, pm2.hashCode()); Object pm20 = helper.getPersistenceManager(nbcpc2); assertEquals("PersistenceManagers from same object should be equal", pm2, pm20); } public void testGetVersionNull() { Object id2 = helper.getVersion(nbcpc2); assertNull("Version should be null before addStateInterrogations", id2); addStateInterrogations(); Object id = helper.getVersion(Boolean.TRUE); assertNull("Version should be null for non-pc instances", id); } public void testGetVersion() { addStateInterrogations(); Object id2 = helper.getVersion(nbcpc2); assertNotNull("Version should not be null", id2); assertEquals("Version should be 2", 2, id2.hashCode()); Object id20 = helper.getVersion(nbcpc2); assertEquals("Versions from same object should be equal", id2, id20); } public void testIsDeletedFalse() { assertFalse("IsDeleted should be false before addStateInterrogations", helper.isDeleted(nbcpc2)); addStateInterrogations(); assertFalse("IsDeleted should be false for non-pc instances", helper.isDeleted(Boolean.TRUE)); implHelper.removeStateInterrogation(si2); assertFalse("IsDeleted should be false after removeStateInterrogations", helper.isDeleted(nbcpc2)); } public void testIsDeletedMine() { addStateInterrogations(); assertTrue("IsDeleted should be true for nbcpc1", helper.isDeleted(nbcpc1)); assertFalse("IsDeleted should be false for nbcpc2", helper.isDeleted(nbcpc2)); } public void testIsDetachedFalse() { assertFalse("IsDetached should be false before addStateInterrogations", helper.isDetached(nbcpc2)); addStateInterrogations(); assertFalse("IsDetached should be false for non-pc instances", helper.isDetached(Boolean.TRUE)); implHelper.removeStateInterrogation(si2); assertFalse("IsDetached should be false after removeStateInterrogations", helper.isDetached(nbcpc2)); } public void testIsDetachedMine() { addStateInterrogations(); assertTrue("IsDetached should be true for nbcpc1", helper.isDetached(nbcpc1)); assertFalse("IsDetached should be false for nbcpc2", helper.isDetached(nbcpc2)); } public void testIsDirtyFalse() { assertFalse("IsDirty should be false before addStateInterrogations", helper.isDirty(nbcpc2)); addStateInterrogations(); assertFalse("IsDirty should be false for non-pc instances", helper.isDirty(Boolean.TRUE)); implHelper.removeStateInterrogation(si2); nbcpc2.setDirty(true); assertFalse("IsDirty should be false after removeStateInterrogations", helper.isDirty(nbcpc2)); nbcpc2.setDirty(false); } public void testIsDirtyMine() { addStateInterrogations(); nbcpc1.setDirty(true); assertTrue("IsDirty should be true for nbcpc1 after setDirty(true)", helper.isDirty(nbcpc1)); nbcpc1.setDirty(false); assertFalse("IsDirty should be false for nbcpc1 after setDirty(false)", helper.isDirty(nbcpc1)); assertFalse("IsDirty should be false for nbcpc2", helper.isDirty(nbcpc2)); } public void testIsNewFalse() { assertFalse("IsNew should be false before addStateInterrogations", helper.isNew(nbcpc2)); addStateInterrogations(); assertFalse("IsNew should be false for non-pc instances", helper.isNew(Boolean.TRUE)); implHelper.removeStateInterrogation(si2); assertFalse("IsNew should be false after removeStateInterrogations", helper.isNew(nbcpc2)); } public void testIsNewMine() { addStateInterrogations(); assertTrue("IsNew should be true for nbcpc1", helper.isNew(nbcpc1)); assertFalse("IsNew should be false for nbcpc2", helper.isNew(nbcpc2)); } public void testIsPersistentFalse() { assertFalse("IsPersistent should be false before addStateInterrogations", helper.isPersistent(nbcpc2)); addStateInterrogations(); assertFalse("IsPersistent should be false for non-pc instances", helper.isPersistent(Boolean.TRUE)); implHelper.removeStateInterrogation(si2); assertFalse("IsPersistent should be false after removeStateInterrogations", helper.isPersistent(nbcpc2)); } public void testIsPersistentMine() { addStateInterrogations(); assertTrue("IsPersistent should be true for nbcpc1", helper.isPersistent(nbcpc1)); assertFalse("IsPersistent should be false for nbcpc2", helper.isPersistent(nbcpc2)); } public void testIsTransactionalFalse() { assertFalse("IsTransactional should be false before addStateInterrogations", helper.isTransactional(nbcpc2)); addStateInterrogations(); assertFalse("IsTransactional should be false for non-pc instances", helper.isTransactional(Boolean.TRUE)); implHelper.removeStateInterrogation(si2); assertFalse("IsTransactional should be false after removeStateInterrogations", helper.isTransactional(nbcpc2)); } public void testIsTransactionalMine() { addStateInterrogations(); assertTrue("IsTransactional should be true for nbcpc1", helper.isTransactional(nbcpc1)); assertFalse("IsTransactional should be false for nbcpc2", helper.isTransactional(nbcpc2)); } public void testMakeDirtyFalse() { helper.makeDirty(nbcpc2, ""); nbcpc2.setDirty(true); assertFalse("IsDirty should be false before addStateInterrogations", helper.isDirty(nbcpc2)); addStateInterrogations(); implHelper.removeStateInterrogation(si2); nbcpc2.setDirty(false); helper.makeDirty(nbcpc2, ""); assertFalse("IsDirty should be false after removeStateInterrogations", helper.isDirty(nbcpc2)); } public void testMakeDirtyMine() { addStateInterrogations(); helper.makeDirty(nbcpc1, ""); assertTrue("IsDirty should be true for nbcpc1", helper.isDirty(nbcpc1)); nbcpc1.setDirty(false); assertFalse("IsDirty should be false after setDirty(false)", helper.isDirty(nbcpc1)); } public void tearDown() { removeStateInterrogations(); } public void addStateInterrogations() { implHelper.addStateInterrogation(si0); implHelper.addStateInterrogation(si1); implHelper.addStateInterrogation(si2); } public void removeStateInterrogations() { implHelper.removeStateInterrogation(si0); implHelper.removeStateInterrogation(si1); implHelper.removeStateInterrogation(si2); } /** * The non-binary-compatible PersistenceManager class instances. */ static private PersistenceManager pmProxy0 = (PersistenceManager) Proxy.newProxyInstance( PersistenceManager.class.getClassLoader(), new Class[] {PersistenceManager.class}, new InvocationHandlerImpl(0)); /** * The non-binary-compatible PersistenceManager class instances. */ static private PersistenceManager pmProxy1 = (PersistenceManager) Proxy.newProxyInstance( PersistenceManager.class.getClassLoader(), new Class[] {PersistenceManager.class}, new InvocationHandlerImpl(1)); /** * The non-binary-compatible PersistenceManager class instances. */ static private PersistenceManager pmProxy2 = (PersistenceManager) Proxy.newProxyInstance( PersistenceManager.class.getClassLoader(), new Class[] {PersistenceManager.class}, new InvocationHandlerImpl(2)); /** * The array of PersistenceManager proxies */ static PersistenceManager[] pmProxies = {pmProxy0, pmProxy1, pmProxy2}; /** * The array of NonBinaryCompatiblePersistenceCapable instances. */ NonBinaryCompatiblePersistenceCapable nbcpc0 = new NonBinaryCompatiblePersistenceCapable(0); NonBinaryCompatiblePersistenceCapable nbcpc1 = new NonBinaryCompatiblePersistenceCapable(1); NonBinaryCompatiblePersistenceCapable nbcpc2 = new NonBinaryCompatiblePersistenceCapable(2); NonBinaryCompatiblePersistenceCapable[] nbcpcs = {nbcpc0, nbcpc1, nbcpc2}; /** * The array of StateInterrogations */ static StateInterrogation si0 = new StateInterrogationImpl(0); static StateInterrogation si1 = new StateInterrogationImpl(1); static StateInterrogation si2 = new StateInterrogationImpl(2); static StateInterrogation[] sis = {si0, si1, si2}; /** * The StateInterrogation implementation manages * NonBinaryCompatiblePersistenceCapable instances that have a * hashCode equal to their own. * *

For the methods returning Object, return null if the object * is not managed by this StateInterrogation. * *

For the methods returning Boolean, return null if the object * is not managed by this StateInterrogation. * *

For the makeDirty method, return false if the object * is not managed by this StateInterrogation. */ private static class StateInterrogationImpl implements StateInterrogation { private int id; public int hashCode() { return id; } private StateInterrogationImpl(int id) { this.id = id; } public boolean equals(Object other) { if (other.getClass() != StateInterrogationImpl.class) return false; return (other.hashCode() == id); } private boolean isMine(Object pc) { return pc.hashCode() == id; } public javax.jdo.PersistenceManager getPersistenceManager(Object pc) { return isMine(pc)?pmProxies[id]:null; } public Object getObjectId(Object pc) { return isMine(pc)?new ObjectIdImpl(id):null; } public Object getTransactionalObjectId(Object pc) { return isMine(pc)?new ObjectIdImpl(id):null; } public Object getVersion(Object pc) { return isMine(pc)?new ObjectIdImpl(id):null; } public Boolean isDeleted(Object pc) { if (isMine(pc)) { return (pc.hashCode()==1)?Boolean.TRUE:Boolean.FALSE; } else return null; } public Boolean isDetached(Object pc) { if (isMine(pc)) { return (pc.hashCode()==1)?Boolean.TRUE:Boolean.FALSE; } else return null; } public Boolean isDirty(Object pc) { if (isMine(pc)) { return ((NonBinaryCompatiblePersistenceCapable)pc).isDirty() ?Boolean.TRUE:Boolean.FALSE; } else return null; } public Boolean isNew(Object pc) { if (isMine(pc)) { return (pc.hashCode()==1)?Boolean.TRUE:Boolean.FALSE; } else return null; } public Boolean isPersistent(Object pc) { if (isMine(pc)) { return (pc.hashCode()==1)?Boolean.TRUE:Boolean.FALSE; } else return null; } public Boolean isTransactional(Object pc) { if (isMine(pc)) { return (pc.hashCode()==1)?Boolean.TRUE:Boolean.FALSE; } else return null; } public boolean makeDirty(Object pc, String fieldName) { if (isMine(pc)) { ((NonBinaryCompatiblePersistenceCapable)pc).setDirty(true); return true; } else return false; } } /** * The non-binary-compatible PersistenceCapable class. */ public static class NonBinaryCompatiblePersistenceCapable { private int id; private boolean dirty = false; private NonBinaryCompatiblePersistenceCapable(int id) { this.id = id; } public int hashCode() { return id; } public void setDirty(boolean dirty) { this.dirty = dirty; } public boolean isDirty() { return dirty; } } /** * The non-binary-compatible object id class. */ public static class ObjectIdImpl { private int id; private ObjectIdImpl(int id) { this.id = id; } public int hashCode() { return id; } public boolean equals(Object other) { if (other.getClass() != ObjectIdImpl.class) return false; return (other.hashCode() == id); } } /** * The non-binary-compatible InvocationHandler class * for PersistenceManager proxy. */ private static class InvocationHandlerImpl implements InvocationHandler { private int id; private InvocationHandlerImpl(int id) { this.id = id; } public int hashCode() { return id; } public boolean equals(Object other) { if (other.getClass() != ObjectIdImpl.class) return false; return (other.hashCode() == id); } public Object invoke(Object obj, java.lang.reflect.Method method, Object[] params) throws Throwable { String name = method.getName(); if (name == "hashCode") { return new Integer(id); } else if (name == "equals") { Object other = params[0]; if (!(other instanceof PersistenceManager)) return Boolean.FALSE; int otherid = Proxy.getInvocationHandler(other).hashCode(); if (otherid == id) return Boolean.TRUE; return Boolean.FALSE; } return null; } } }api/test/java/javax/jdo/stub/StubPMF.java100664 40257 12500110371 20553 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.stub; import java.util.Collection; import java.util.Map; import java.util.Properties; import java.util.Set; import javax.jdo.Constants; import javax.jdo.FetchGroup; import javax.jdo.PersistenceManager; import javax.jdo.PersistenceManagerFactory; import javax.jdo.datastore.DataStoreCache; import javax.jdo.listener.InstanceLifecycleListener; import javax.jdo.metadata.JDOMetadata; import javax.jdo.metadata.TypeMetadata; public class StubPMF implements PersistenceManagerFactory, Constants { public static PersistenceManagerFactory getPersistenceManagerFactory( Map props) { StubPMF pmf = new StubPMF(); pmf.setProperties(props); for (Object key : props.keySet()) { if (!(key instanceof String)) { continue; } String prop = (String) key; if (!prop.startsWith("javax.jdo.")) { continue; } pmf.setProperty(prop, props.get(prop)); } return pmf; } public static PersistenceManagerFactory getPersistenceManagerFactory( Map overrides, Map props) { StubPMF pmf = new StubPMF(); pmf.setProperties(props); pmf.setProperties(overrides); return pmf; } String name; String persistenceManagerFactoryClassName; String spiResourceName; String optionConnectionUserName; String optionConnectionPassword; String optionConnectionURL; String optionConnectionDriverName; String optionConnectionFactoryName; Object optionConnectionFactory; String optionConnectionFactory2Name; Object optionConnectionFactory2; boolean optionMultithreaded; String optionMapping; boolean optionOptimistic; boolean optionRetainValues; boolean optionRestoreValues; boolean optionNontransactionalRead; boolean optionNontransactionalWrite; boolean optionIgnoreCache; boolean optionDetachAllOnCommit; boolean optionCopyOnAttach; String optionName; String optionPersistenceUnitName; String optionServerTimeZoneID; String optionTransactionType; boolean optionReadOnly; String optionTransactionIsolationLevel; Integer optionDatastoreReadTimeoutMillis; Integer optionDatastoreWriteTimeoutMillis; Properties properties = new Properties(); public String getConnectionUserName() { return optionConnectionUserName; } public void setConnectionUserName(String connectionUserName) { this.optionConnectionUserName = connectionUserName; } public void setConnectionPassword(String connectionPassword) { this.optionConnectionPassword = connectionPassword; } public String getConnectionURL() { return optionConnectionURL; } public void setConnectionURL(String connectionURL) { this.optionConnectionURL = connectionURL; } public String getConnectionDriverName() { return optionConnectionDriverName; } public void setConnectionDriverName(String connectionDriverName) { this.optionConnectionDriverName = connectionDriverName; } public String getConnectionFactoryName() { return optionConnectionFactoryName; } public void setConnectionFactoryName(String connectionFactoryName) { this.optionConnectionFactoryName = connectionFactoryName; } public Object getConnectionFactory() { return optionConnectionFactory; } public void setConnectionFactory(Object connectionFactory) { this.optionConnectionFactory = connectionFactory; } public String getConnectionFactory2Name() { return optionConnectionFactory2Name; } public void setConnectionFactory2Name(String connectionFactory2Name) { this.optionConnectionFactory2Name = connectionFactory2Name; } public Object getConnectionFactory2() { return optionConnectionFactory2; } public void setConnectionFactory2(Object connectionFactory2) { this.optionConnectionFactory2 = connectionFactory2; } public boolean getMultithreaded() { return optionMultithreaded; } public void setMultithreaded(boolean multithreaded) { this.optionMultithreaded = multithreaded; } public String getMapping() { return optionMapping; } public void setMapping(String mapping) { this.optionMapping = mapping; } public boolean getOptimistic() { return optionOptimistic; } public void setOptimistic(boolean optimistic) { this.optionOptimistic = optimistic; } public boolean getRetainValues() { return optionRetainValues; } public void setRetainValues(boolean retainValues) { this.optionRetainValues = retainValues; } public boolean getRestoreValues() { return optionRestoreValues; } public void setRestoreValues(boolean restoreValues) { this.optionRestoreValues = restoreValues; } public boolean getNontransactionalRead() { return optionNontransactionalRead; } public void setNontransactionalRead(boolean nontransactionalRead) { this.optionNontransactionalRead = nontransactionalRead; } public boolean getNontransactionalWrite() { return optionNontransactionalWrite; } public void setNontransactionalWrite(boolean nontransactionalWrite) { this.optionNontransactionalWrite = nontransactionalWrite; } public boolean getIgnoreCache() { return optionIgnoreCache; } public void setIgnoreCache(boolean ignoreCache) { this.optionIgnoreCache = ignoreCache; } public boolean getDetachAllOnCommit() { return optionDetachAllOnCommit; } public void setDetachAllOnCommit(boolean detachAllOnCommit) { this.optionDetachAllOnCommit = detachAllOnCommit; } public boolean getCopyOnAttach() { return optionCopyOnAttach; } public void setCopyOnAttach(boolean copyOnAttach) { this.optionCopyOnAttach = copyOnAttach; } public String getName() { return optionName; } public void setName(String name) { this.optionName = name; } public String getPersistenceUnitName() { return optionPersistenceUnitName; } public void setPersistenceUnitName(String persistenceUnitName) { this.optionPersistenceUnitName = persistenceUnitName; } public String getServerTimeZoneID() { return optionServerTimeZoneID; } public void setServerTimeZoneID(String serverTimeZoneID) { this.optionServerTimeZoneID = serverTimeZoneID; } public String getTransactionType() { return optionTransactionType; } public void setTransactionType(String transactionType) { this.optionTransactionType = transactionType; } public boolean getReadOnly() { return optionReadOnly; } public void setReadOnly(boolean readOnly) { this.optionReadOnly = readOnly; } public String getTransactionIsolationLevel() { return optionTransactionIsolationLevel; } public void setTransactionIsolationLevel(String transactionIsolationLevel) { this.optionTransactionIsolationLevel = transactionIsolationLevel; } public Integer getDatastoreReadTimeoutMillis() { return optionDatastoreReadTimeoutMillis; } public void setDatastoreReadTimeoutMillis(Integer datastoreReadTimeoutMillis) { this.optionDatastoreReadTimeoutMillis = datastoreReadTimeoutMillis; } public Integer getDatastoreWriteTimeoutMillis() { return optionDatastoreWriteTimeoutMillis; } public void setDatastoreWriteTimeoutMillis( Integer datastoreWriteTimeoutMillis) { this.optionDatastoreWriteTimeoutMillis = datastoreWriteTimeoutMillis; } public void close() { throw new UnsupportedOperationException("not implemented"); } public boolean isClosed() { return true; } public PersistenceManager getPersistenceManager() { throw new UnsupportedOperationException("not implemented"); } public PersistenceManager getPersistenceManagerProxy() { throw new UnsupportedOperationException("not implemented"); } public PersistenceManager getPersistenceManager(String userid, String password) { throw new UnsupportedOperationException("not implemented"); } public Properties getProperties() { return properties; } public Collection supportedOptions() { throw new UnsupportedOperationException("not implemented"); } public DataStoreCache getDataStoreCache() { return new DataStoreCache() { public void evict(Object oid) { } public void evictAll() { } public void evictAll(Object... oids) { } public void evictAll(Collection oids) { } public void evictAll(Class pcClass, boolean subclasses) { } public void evictAll(boolean subclasses, Class pcClass) { } public void pin(Object oid) { } public void pinAll(Collection oids) { } public void pinAll(Object... oids) { } public void pinAll(Class pcClass, boolean subclasses) { } public void pinAll(boolean subclasses, Class pcClass) { } public void unpin(Object oid) { } public void unpinAll(Collection oids) { } public void unpinAll(Object... oids) { } public void unpinAll(Class pcClass, boolean subclasses) { } public void unpinAll(boolean subclasses, Class pcClass) { } }; } public void addInstanceLifecycleListener( InstanceLifecycleListener listener, Class[] classes) { throw new UnsupportedOperationException("not implemented"); } public void removeInstanceLifecycleListener( InstanceLifecycleListener listener) { throw new UnsupportedOperationException("not implemented"); } public void addFetchGroups(FetchGroup... groups) { throw new UnsupportedOperationException("not implemented"); } public void removeFetchGroups(FetchGroup... groups) { throw new UnsupportedOperationException("not implemented"); } public void removeAllFetchGroups() { throw new UnsupportedOperationException("not implemented"); } @SuppressWarnings("rawtypes") public FetchGroup getFetchGroup(Class cls, String name) { throw new UnsupportedOperationException("not implemented"); } @SuppressWarnings("rawtypes") public Set getFetchGroups() { throw new UnsupportedOperationException("not implemented"); } public void registerMetadata(JDOMetadata metadata) { throw new UnsupportedOperationException("not implemented"); } public JDOMetadata newMetadata() { throw new UnsupportedOperationException("not implemented"); } public TypeMetadata getMetadata(String className) { throw new UnsupportedOperationException("not implemented"); } void setSpiResourceName(String spiPropertiesResourceName) { this.spiResourceName = spiPropertiesResourceName; } public String getSpiPropertiesResourceName() { return spiResourceName; } void setPersistenceManagerFactoryClass(String className) { this.persistenceManagerFactoryClassName = className; } public String getPersistenceManagerFactoryClass() { return this.persistenceManagerFactoryClassName; } void setProperty(String name, Object value) { String val = value.toString(); if (name.equals(PROPERTY_PERSISTENCE_MANAGER_FACTORY_CLASS)) { setPersistenceManagerFactoryClass(val); return; } if (name.equals(PROPERTY_CONNECTION_DRIVER_NAME)) { setConnectionDriverName(val); return; } if (name.equals(PROPERTY_CONNECTION_FACTORY_NAME)) { setConnectionFactoryName(val); return; } if (name.equals(PROPERTY_CONNECTION_FACTORY2_NAME)) { setConnectionFactory2Name(val); return; } if (name.equals(PROPERTY_CONNECTION_PASSWORD)) { setConnectionPassword(val); return; } if (name.equals(PROPERTY_CONNECTION_URL)) { setConnectionURL(val); return; } if (name.equals(PROPERTY_CONNECTION_USER_NAME)) { setConnectionUserName(val); return; } if (name.equals(PROPERTY_IGNORE_CACHE)) { setCopyOnAttach(Boolean.parseBoolean(val)); return; } if (name.equals(PROPERTY_DATASTORE_READ_TIMEOUT_MILLIS)) { setDatastoreReadTimeoutMillis(Integer.parseInt(val)); return; } if (name.equals(PROPERTY_DATASTORE_WRITE_TIMEOUT_MILLIS)) { setDatastoreWriteTimeoutMillis(Integer.parseInt(val)); return; } if (name.equals(PROPERTY_DETACH_ALL_ON_COMMIT)) { setDetachAllOnCommit(Boolean.parseBoolean(val)); return; } if (name.equals(PROPERTY_IGNORE_CACHE)) { setIgnoreCache(Boolean.parseBoolean(val)); return; } if (name.equals(PROPERTY_MAPPING)) { setMapping(val); return; } if (name.equals(PROPERTY_MULTITHREADED)) { setMultithreaded(Boolean.parseBoolean(val)); return; } if (name.equals(PROPERTY_NAME)) { setName(val); return; } if (name.equals(PROPERTY_NONTRANSACTIONAL_READ)) { setNontransactionalRead(Boolean.parseBoolean(val)); return; } if (name.equals(PROPERTY_NONTRANSACTIONAL_WRITE)) { setNontransactionalWrite(Boolean.parseBoolean(val)); return; } if (name.equals(PROPERTY_OPTIMISTIC)) { setOptimistic(Boolean.parseBoolean(val)); return; } if (name.equals(PROPERTY_PERSISTENCE_UNIT_NAME)) { setPersistenceUnitName(val); return; } if (name.equals(PROPERTY_READONLY)) { setReadOnly(Boolean.parseBoolean(val)); return; } if (name.equals(PROPERTY_RESTORE_VALUES)) { setRestoreValues(Boolean.parseBoolean(val)); return; } if (name.equals(PROPERTY_RETAIN_VALUES)) { setRetainValues(Boolean.parseBoolean(val)); return; } if (name.equals(PROPERTY_SERVER_TIME_ZONE_ID)) { setServerTimeZoneID(val); return; } if (name.equals(PROPERTY_TRANSACTION_ISOLATION_LEVEL)) { setTransactionIsolationLevel(val); return; } if (name.equals(PROPERTY_TRANSACTION_TYPE)) { setTransactionType(val); return; } if (name.equals(PROPERTY_SPI_RESOURCE_NAME)) { setSpiResourceName(val); return; } throw new IllegalArgumentException("unhandled stub PMF property " + name); } void setProperties(Map properties) { for (Object key : properties.keySet()) { String k = key.toString(); Object v = properties.get(key); this.properties.put(k, v); setProperty(k, v); } } public Collection getManagedClasses() { throw new UnsupportedOperationException("not implemented"); } } api/test/java/javax/jdo/util/AbstractTest.java100664 5503 12500110371 21651 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.util; import java.io.PrintStream; import javax.jdo.Constants; import junit.framework.TestCase; /** */ public abstract class AbstractTest extends TestCase implements Constants { /** */ protected static PrintStream out = System.out; /** If true, print extra messages. */ protected boolean verbose; /** * Construct and initialize from properties. */ protected AbstractTest() { super(null); verbose = Boolean.getBoolean("verbose"); } /** * Determine if a class is loadable in the current environment. */ protected static boolean isClassLoadable(String className) { try { Class.forName(className); return true; } catch (ClassNotFoundException ex) { return false; } } /** */ protected void println(String s) { if (verbose) out.println(s); } /** New line. */ public static final String NL = System.getProperty("line.separator"); /** A buffer of of error messages. */ protected static StringBuffer messages; /** Appends to error messages. */ protected static synchronized void appendMessage(String message) { if (message != null) { if (messages == null) { messages = new StringBuffer(); } messages.append(message); messages.append(NL); } } /** * Returns collected error messages, or null if there * are none, and clears the buffer. */ protected static synchronized String retrieveMessages() { if (messages == null) { return null; } final String msg = messages.toString(); messages = null; return msg; } /** * Fail the test if there are any error messages. */ protected void failOnError() { String errors = retrieveMessages(); if (errors != null) { fail (errors); } } } api/test/java/javax/jdo/util/BatchResultPrinter.java100664 6324 12500110371 23034 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.util; import java.io.PrintStream; import junit.framework.AssertionFailedError; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestResult; import junit.textui.ResultPrinter; /** * Default result printer implementation for running tests in batch mode. * * @author Michael Bouschen */ public class BatchResultPrinter extends ResultPrinter { /** */ public BatchResultPrinter(PrintStream writer) { super(writer); } /** Called in case of a test error. */ public void addError(Test test, Throwable t) { getWriter().print(" ERROR"); } /** Called in case of a test failure. */ public void addFailure(Test test, AssertionFailedError t) { getWriter().print(" FAILURE"); } /** Called when a test case is finished. */ public void endTest(Test test) { getWriter().println(); } /** Called when a test case is started. */ public void startTest(Test test) { String testName; if (test instanceof TestCase) { testName = getClassBaseName(test) + "." + ((TestCase)test).getName(); } else { testName = test.toString(); } getWriter().print("RUN " + testName); } /** */ protected void printHeader(long runTime) { getWriter().println("Time: "+elapsedTimeAsString(runTime)); } /** */ protected void printFooter(TestResult result) { if (result.wasSuccessful()) { getWriter().print("OK"); getWriter().println (" (" + result.runCount() + " test" + (result.runCount() == 1 ? "": "s") + ")"); } else { getWriter().println("FAILURES!!!"); getWriter().println("Tests run: "+result.runCount()+ ", Failures: "+result.failureCount()+ ", Errors: "+result.errorCount()); } } // helper method /** * @return Name of the class of the given object without package prefix */ private String getClassBaseName(Object obj) { if (obj == null) return null; String className = obj.getClass().getName(); int index = className.lastIndexOf('.'); if (index != -1) { className = className.substring(index + 1); } return className; } } api/test/java/javax/jdo/util/BatchTestRunner.java100664 13637 12500110371 22350 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.util; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.io.PrintStream; import junit.framework.Test; import junit.framework.TestResult; import junit.framework.TestSuite; import junit.textui.ResultPrinter; import junit.textui.TestRunner; /** * TestRunner class for running a single test or a test suite in batch * mode. The format of the test output is specified by the result printer * class. The main method sets an exit code according to the test result: *

    *
  • 0: success *
  • 1: failure, the test shows an unexpected behavior *
  • 2: exception, the test throws an unhandled excption *
* * @author Michael Bouschen */ public class BatchTestRunner extends TestRunner { /** Name of the system property to specify the result printer class. */ public static final String RESULTPRINTER_PROPERTY = "ResultPrinterClass"; /** Default of the system property ResultPrinterClass. */ public static final String RESULTPRINTER_DEFAULT = BatchResultPrinter.class.getName(); /** * Constructor. * It creates a result printer instance based on the system property * and delegates to the constructor taking a result printer argument. */ public BatchTestRunner() { super(); setPrinter(getResultPrinter()); } /** * Constructor. USes teh specified resultPrinter to format the test result. */ public BatchTestRunner(ResultPrinter resultPrinter) { super(resultPrinter); } /** Runs all test methods from the specified class. */ public static void run(Class clazz) { run(new TestSuite(clazz)); } /** Runs the specified test. */ public static TestResult run(Test test) { return new BatchTestRunner().doRun(test); } /** Runs the specified test and waits until the user types RETURN. */ public static void runAndWait(Test suite) { new BatchTestRunner().doRun(suite, true); } /** * Runs in batch mode and sets an exit code. If the specified String * array includes a single fully qualified class name, this test class * is executed. If it is empty it runs the TestListSuite. */ public static void main(String args[]) { BatchTestRunner aTestRunner= new BatchTestRunner(); try { /* if ((args == null) || args.length == 0) args = new String[] { TestListSuite.class.getName() }; */ TestResult r = aTestRunner.start(args); if (!r.wasSuccessful()) System.exit(FAILURE_EXIT); System.exit(SUCCESS_EXIT); } catch(Exception e) { System.err.println(e.getMessage()); System.exit(EXCEPTION_EXIT); } } /** Returns a result printer instance. n instance of tCheck the system property */ protected ResultPrinter getResultPrinter() { String className = System.getProperty(RESULTPRINTER_PROPERTY); if (className != null) { className = className.trim(); if (className.length() != 0) { String msg = null; try { // get class instance Class clazz = Class.forName(className); // constructor taking PrintStream arg Constructor ctor = clazz.getConstructor( new Class[] { PrintStream.class } ); // create instance return (ResultPrinter)ctor.newInstance( new Object[] { System.out }); } catch (ClassNotFoundException ex) { // specified ResultPrinter class not msg = "Cannot find specified result printer class " + className + "."; } catch (NoSuchMethodException ex) { msg = "Class " + className + " does not provide constructor taking a PrintStream."; } catch (InstantiationException ex) { msg = "Class " + className + " is abstract."; } catch (IllegalAccessException ex) { msg = "Constructor taking a PrintStream of class " + className + " is not accessible."; } catch (InvocationTargetException ex) { msg = "Constructor call results in exception " + ex + "."; } // ResultPrinter class specified, but not avaiable System.out.println(msg); ResultPrinter printer = getDefaultResultPrinter(); System.out.println("Using default result printer of class " + printer.getClass().getName()); } } // ResultPrinter class not specified => use default return getDefaultResultPrinter(); } /** * Returns an instance of the default result printer class * BatchResultPrinter. */ protected ResultPrinter getDefaultResultPrinter() { return new BatchResultPrinter(System.out); } } api/test/java/javax/jdo/util/XMLTestUtil.java100664 53703 12500110371 21431 0ustarmbouschenstaff 0 0 /* * 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 javax.jdo.util; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.InputStream; import java.io.InputStreamReader; import java.io.IOException; import java.io.FileFilter; import java.io.FilenameFilter; import java.security.AccessController; import java.security.PrivilegedAction; import java.util.Arrays; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.StringTokenizer; import javax.jdo.JDOFatalException; import javax.xml.parsers.*; import org.w3c.dom.Document; import org.xml.sax.*; import org.xml.sax.helpers.*; /** * Tests schema files. *

*/ public class XMLTestUtil { /** */ protected static String BASEDIR = System.getProperty("basedir", "."); /** "http://www.w3.org/2001/XMLSchema" */ protected static final String XSD_TYPE = "http://www.w3.org/2001/XMLSchema"; /** */ protected static final String SCHEMA_LANGUAGE_PROP = "http://java.sun.com/xml/jaxp/properties/schemaLanguage"; /** */ protected static final String SCHEMA_LOCATION_PROP = "http://apache.org/xml/properties/schema/external-schemaLocation"; /** jdo namespace */ protected static final String JDO_XSD_NS = "http://java.sun.com/xml/ns/jdo/jdo"; /** orm namespace */ protected static final String ORM_XSD_NS = "http://java.sun.com/xml/ns/jdo/orm"; /** jdoquery namespace */ protected static final String JDOQUERY_XSD_NS = "http://java.sun.com/xml/ns/jdo/jdoquery"; /** jdo xsd file */ protected static final File JDO_XSD_FILE = new File(BASEDIR + "/target/classes/javax/jdo/jdo_2_2.xsd"); /** orm xsd file */ protected static final File ORM_XSD_FILE = new File(BASEDIR + "/target/classes/javax/jdo/orm_2_2.xsd"); /** jdoquery xsd file */ protected static final File JDOQUERY_XSD_FILE = new File(BASEDIR + "/target/classes/javax/jdo/jdoquery_2_2.xsd"); /** Entity resolver */ protected static final EntityResolver resolver = new JDOEntityResolver(); /** Error handler */ protected static final Handler handler = new Handler(); /** Name of the metadata property, a comma separated list of JDO metadata * file or directories containing such files. */ protected static String METADATA_PROP = "javax.jdo.metadata"; /** Name of the recursive property, allowing recursive search of metadata * files. */ protected static String RECURSIVE_PROP = "javax.jdo.recursive"; /** Separator character for the metadata property. */ protected static final String DELIM = ",;"; /** Newline. */ protected static final String NL = System.getProperty("line.separator"); /** XSD builder for jdo namespace. */ private final DocumentBuilder jdoXsdBuilder = createBuilder(JDO_XSD_NS + " " + JDO_XSD_FILE.toURI().toString()); /** XSD builder for orm namespace. */ private final DocumentBuilder ormXsdBuilder = createBuilder(ORM_XSD_NS + " " + ORM_XSD_FILE.toURI().toString()); /** XSD builder for jdoquery namespace. */ private final DocumentBuilder jdoqueryXsdBuilder = createBuilder(JDOQUERY_XSD_NS + " " + JDOQUERY_XSD_FILE.toURI().toString()); /** DTD builder. */ private final DocumentBuilder dtdBuilder = createBuilder(true); /** Non validating builder. */ private final DocumentBuilder nonValidatingBuilder = createBuilder(false); /** Create XSD builder. */ private DocumentBuilder createBuilder(String location) { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setValidating(true); factory.setNamespaceAware(true); factory.setAttribute(SCHEMA_LANGUAGE_PROP, XSD_TYPE); factory.setAttribute(SCHEMA_LOCATION_PROP, location); return getParser(factory); } /** Create builder. */ private DocumentBuilder createBuilder(boolean validating) { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setValidating(validating); factory.setNamespaceAware(true); return getParser(factory); } /** Returns a parser obtained from specified factroy. */ private DocumentBuilder getParser(DocumentBuilderFactory factory) { try { DocumentBuilder builder = factory.newDocumentBuilder(); builder.setEntityResolver(resolver); builder.setErrorHandler(handler); return builder; } catch (ParserConfigurationException ex) { throw new JDOFatalException("Cannot create XML parser", ex); } } /** Parse the specified files. The valid parameter determines whether the * specified files are valid JDO metadata files. The method does not throw * an exception on an error, instead it instead it returns the error * message(s) as string. */ public String checkXML(File[] files, boolean valid) { StringBuffer messages = new StringBuffer(); for (int i = 0; i < files.length; i++) { String msg = checkXML(files[i], valid); if (msg != null) { messages.append(msg); } } return (messages.length() == 0) ? null : messages.toString(); } /** Parse the specified files using a non validating parser. The method * does not throw an exception on an error, instead it instead it returns * the error message(s) as string. */ public String checkXMLNonValidating(File[] files) { StringBuffer messages = new StringBuffer(); for (int i = 0; i < files.length; i++) { String msg = checkXML(nonValidatingBuilder, files[i], true); if (msg != null) { messages.append(msg); } } return (messages.length() == 0) ? null : messages.toString(); } /** Parse the specified file. The method checks whether it is a XSD or * DTD base file and parses the file using a builder according to the file * name suffix. The valid parameter determines whether the specified files * are valid JDO metadata files. The method does not throw an exception on * an error, instead it returns the error message(s) as string. */ private String checkXML(File file, boolean valid) { String messages = null; String fileName = file.getName(); try { if (isDTDBased(file)) { messages = checkXML(dtdBuilder, file, valid); } else if (fileName.endsWith(".jdo")) { messages = checkXML(jdoXsdBuilder, file, valid); } else if (fileName.endsWith(".orm")) { messages = checkXML(ormXsdBuilder, file, valid); } else if (fileName.endsWith(".jdoquery")) { messages = checkXML(jdoqueryXsdBuilder, file, valid); } } catch (SAXException ex) { messages = ex.getMessage(); } return messages; } /** Parse the specified file using the specified builder. The valid * parameter determines whether the specified files are valid JDO metadata * files. The method does not throw an exception on an error, instead it * returns the error message(s) as string. */ private String checkXML(DocumentBuilder builder, File file, boolean valid) { String messages = null; handler.init(file); try { builder.parse(file); } catch (SAXParseException ex) { handler.error(ex); } catch (Exception ex) { messages = "Fatal error processing " + file.getName() + ": " + ex + NL; } if (messages == null) { messages = handler.getMessages(); } if (!valid) { if (messages != null) { // expected error for negative test messages = null; } else { messages = file.getName() + " is not valid, " + "but the parser did not catch the error."; } } return messages; } /** Checks whether the specifeid file is DTD or XSD based. The method * throws a SAXException if the file has syntax errors. */ private boolean isDTDBased(File file) throws SAXException { handler.init(file); try { Document document = nonValidatingBuilder.parse(file); return document.getDoctype() != null; } catch (SAXParseException ex) { handler.error(ex); throw new SAXException(handler.getMessages()); } catch (Exception ex) { throw new SAXException( "Fatal error processing " + file.getName() + ": " + ex); } } /** ErrorHandler implementation. */ private static class Handler implements ErrorHandler { private File fileUnderTest; private String[] lines; private StringBuffer messages; public void error(SAXParseException ex) { append("Handler.error: ", ex); } public void fatalError(SAXParseException ex) { append("Handler.fatalError: ", ex); } public void warning(SAXParseException ex) { append("Handler.warning: ", ex); } public void init(File file) { this.fileUnderTest = file; this.messages = new StringBuffer(); this.lines = null; } public String getMessages() { return (messages.length() == 0) ? null : messages.toString(); } private void append(String prefix, SAXParseException ex) { int lineNumber = ex.getLineNumber(); int columnNumber = ex.getColumnNumber(); messages.append("------------------------").append(NL); messages.append(prefix).append(fileUnderTest.getName()); messages.append(" [line=").append(lineNumber); messages.append(", col=").append(columnNumber).append("]: "); messages.append(ex.getMessage()).append(NL); messages.append(getErrorLocation(lineNumber, columnNumber)); } private String[] getLines() { if (lines == null) { try { BufferedReader bufferedReader = new BufferedReader(new FileReader(fileUnderTest)); ArrayList tmp = new ArrayList(); while (bufferedReader.ready()) { tmp.add(bufferedReader.readLine()); } lines = (String[])tmp.toArray(new String[tmp.size()]); } catch (IOException ex) { throw new JDOFatalException("getLines: caught IOException", ex); } } return lines; } /** Return the error location for the file under test. */ private String getErrorLocation(int lineNumber, int columnNumber) { String[] lines = getLines(); int length = lines.length; if (lineNumber > length) { return "Line number " + lineNumber + " exceeds the number of lines in the file (" + lines.length + ")"; } else if (lineNumber < 1) { return "Line number " + lineNumber + " does not allow retriving the error location."; } StringBuffer buf = new StringBuffer(); if (lineNumber > 2) { buf.append(lines[lineNumber-3]); buf.append(NL); buf.append(lines[lineNumber-2]); buf.append(NL); } buf.append(lines[lineNumber-1]); buf.append(NL); for (int i = 1; i < columnNumber; ++i) { buf.append(' '); } buf.append("^\n"); if (lineNumber + 1 < length) { buf.append(lines[lineNumber]); buf.append(NL); buf.append(lines[lineNumber+1]); buf.append(NL); } return buf.toString(); } } /** Implementation of EntityResolver interface to check the jdo.dtd location **/ private static class JDOEntityResolver implements EntityResolver { private static final String RECOGNIZED_JDO_PUBLIC_ID = "-//Sun Microsystems, Inc.//DTD Java Data Objects Metadata 2.2//EN"; private static final String RECOGNIZED_JDO_SYSTEM_ID = "file:/javax/jdo/jdo_2_2.dtd"; private static final String RECOGNIZED_JDO_SYSTEM_ID2 = "http://java.sun.com/dtd/jdo_2_2.dtd"; private static final String RECOGNIZED_ORM_PUBLIC_ID = "-//Sun Microsystems, Inc.//DTD Java Data Objects Mapping Metadata 2.2//EN"; private static final String RECOGNIZED_ORM_SYSTEM_ID = "file:/javax/jdo/orm_2_2.dtd"; private static final String RECOGNIZED_ORM_SYSTEM_ID2 = "http://java.sun.com/dtd/orm_2_2.dtd"; private static final String RECOGNIZED_JDOQUERY_PUBLIC_ID = "-//Sun Microsystems, Inc.//DTD Java Data Objects Query Metadata 2.2//EN"; private static final String RECOGNIZED_JDOQUERY_SYSTEM_ID = "file:/javax/jdo/jdoquery_2_2.dtd"; private static final String RECOGNIZED_JDOQUERY_SYSTEM_ID2 = "http://java.sun.com/dtd/jdoquery_2_2.dtd"; private static final String JDO_DTD_FILENAME = "javax/jdo/jdo_2_2.dtd"; private static final String ORM_DTD_FILENAME = "javax/jdo/orm_2_2.dtd"; private static final String JDOQUERY_DTD_FILENAME = "javax/jdo/jdoquery_2_2.dtd"; static Map publicIds = new HashMap(); static Map systemIds = new HashMap(); static { publicIds.put(RECOGNIZED_JDO_PUBLIC_ID, JDO_DTD_FILENAME); publicIds.put(RECOGNIZED_ORM_PUBLIC_ID, ORM_DTD_FILENAME); publicIds.put(RECOGNIZED_JDOQUERY_PUBLIC_ID, JDOQUERY_DTD_FILENAME); systemIds.put(RECOGNIZED_JDO_SYSTEM_ID, JDO_DTD_FILENAME); systemIds.put(RECOGNIZED_ORM_SYSTEM_ID, ORM_DTD_FILENAME); systemIds.put(RECOGNIZED_JDOQUERY_SYSTEM_ID, JDOQUERY_DTD_FILENAME); systemIds.put(RECOGNIZED_JDO_SYSTEM_ID2, JDO_DTD_FILENAME); systemIds.put(RECOGNIZED_ORM_SYSTEM_ID2, ORM_DTD_FILENAME); systemIds.put(RECOGNIZED_JDOQUERY_SYSTEM_ID2, JDOQUERY_DTD_FILENAME); } public InputSource resolveEntity(String publicId, final String systemId) throws SAXException, IOException { // check for recognized ids String filename = (String)publicIds.get(publicId); if (filename == null) { filename = (String)systemIds.get(systemId); } final String finalName = filename; if (finalName == null) { return null; } else { // Substitute the dtd with the one from javax.jdo.jdo.dtd, // but only if the publicId is equal to RECOGNIZED_PUBLIC_ID // or there is no publicID and the systemID is equal to // RECOGNIZED_SYSTEM_ID. InputStream stream = AccessController.doPrivileged ( new PrivilegedAction () { public InputStream run () { return getClass().getClassLoader(). getResourceAsStream(finalName); } } ); if (stream == null) { throw new JDOFatalException("Cannot load " + finalName + ", because the file does not exist in the jdo.jar file, " + "or the JDOParser class is not granted permission to read this file. " + "The metadata .xml file contained PUBLIC=" + publicId + " SYSTEM=" + systemId + "."); } return new InputSource(new InputStreamReader(stream)); } } } /** Helper class to find all test JDO metadata files. */ public static class XMLFinder { private List metadataFiles = new ArrayList(); private final boolean recursive; /** Constructor. */ public XMLFinder(String[] fileNames, boolean recursive) { this.recursive = recursive; if (fileNames == null) return; for (int i = 0; i < fileNames.length; i++) { appendTestFiles(fileNames[i]); } } /** Returns array of files of matching file names. */ private File[] getFiles(File dir, final String suffix) { FilenameFilter filter = new FilenameFilter() { public boolean accept(File file, String name) { return name.endsWith(suffix); } }; return dir.listFiles(filter); } /** */ private File[] getDirectories(File dir) { FileFilter filter = new FileFilter() { public boolean accept(File pathname) { return pathname.isDirectory(); } }; return dir.listFiles(filter); } /** */ private void appendTestFiles(String fileName) { File file = new File(fileName); if (file.isDirectory()) { processDirectory(file); } else if (fileName.endsWith(".jdo") || fileName.endsWith(".orm") || fileName.endsWith(".jdoquery")) { metadataFiles.add(new File(fileName)); } } /** Adds all files with suffix .jdo, .orm and .jdoquery to the list of * metadata files. Recursively process subdirectories if recursive * flag is set. */ private void processDirectory(File dir) { metadataFiles.addAll(Arrays.asList(getFiles(dir, ".jdo"))); metadataFiles.addAll(Arrays.asList(getFiles(dir, ".orm"))); metadataFiles.addAll(Arrays.asList(getFiles(dir, ".jdoquery"))); if (recursive) { File[] subdirs = getDirectories(dir); for (int i = 0; i < subdirs.length; i++) { processDirectory(subdirs[i]); } } } /** Returns an array of test files with suffix .jdo, .orm or .jdoquery. */ public File[] getMetadataFiles() { return (File[])metadataFiles.toArray(new File[metadataFiles.size()]); } } /** */ private static String[] checkMetadataSystemProperty() { String[] ret = null; String metadata = System.getProperty(METADATA_PROP); if ((metadata != null) && (metadata.length() > 0)) { List entries = new ArrayList(); StringTokenizer st = new StringTokenizer(metadata, DELIM); while (st.hasMoreTokens()) { entries.add(st.nextToken()); } ret = (String[])entries.toArray(new String[entries.size()]); } return ret; } /** * Command line tool to test JDO metadata files. * Usage: XMLTestUtil [-r] + */ public static void main(String args[]) { String[] fromProp = checkMetadataSystemProperty(); boolean recursive = Boolean.getBoolean(RECURSIVE_PROP); // handle command line args String[] fileNames = null; if ((args.length > 0) && ("-r".equals(args[0]))) { recursive = true; fileNames = new String[args.length - 1]; System.arraycopy(args, 1, fileNames, 0, args.length - 1); } else { fileNames = args; } // check args if ((fileNames.length == 0) && (fromProp == null)) { System.err.println( "No commandline arguments and system property metadata not defined; " + "nothing to be tested.\nUsage: XMLTestUtil [-r] \n" + "\tAll .jdo, .orm, and .jdoquery files in the directory (recursively) will be tested."); } else if ((fileNames.length == 0) && (fromProp != null)) { // use metadata system property fileNames = fromProp; } else if ((fileNames.length != 0) && (fromProp != null)) { System.err.println( "Commandline arguments specified and system property metadata defined; " + "ignoring system property metadata."); } // run the test XMLTestUtil xmlTest = new XMLTestUtil(); File[] files = new XMLFinder(fileNames, recursive).getMetadataFiles(); for (int i = 0; i < files.length; i++) { File file = files[i]; System.out.print("Checking " + file.getPath() + ": "); String messages = xmlTest.checkXML(file, true); messages = (messages == null) ? "OK" : NL + messages; System.out.println(messages); } } } api/test/resources/enhancer-test-dir/enhancer-test-subdir/file4.jdo100664 1474 12500110370 25677 0ustarmbouschenstaff 0 0 api/test/resources/enhancer-test-dir/enhancer-test-subdir/file5.class100664 0 12500110370 26131 0ustarmbouschenstaff 0 0 api/test/resources/enhancer-test-dir/enhancer-test-subdir/file6.jar100664 0 12500110370 25601 0ustarmbouschenstaff 0 0 api/test/resources/enhancer-test-dir/file1.jdo100664 1474 12500110370 21646 0ustarmbouschenstaff 0 0 api/test/resources/enhancer-test-dir/file2.class100664 0 12500110370 22100 0ustarmbouschenstaff 0 0 api/test/resources/enhancer-test-dir/file3.jar100664 0 12500110370 21550 0ustarmbouschenstaff 0 0 api/test/resources/META-INF/services/javax.jdo.JDOEnhancer100664 1457 12500110370 23506 0ustarmbouschenstaff 0 0 # # 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. # javax.jdo.MockEnhancer api/test/schema/jdoconfig/Negative00/META-INF/jdoconfig.xml100664 1475 12500110370 23553 0ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Negative01/META-INF/jdoconfig.xml100664 1752 12500110370 23552 0ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Negative02/META-INF/jdoconfig.xml100664 2106 12500110370 23545 0ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Negative03/META-INF/jdoconfig.xml100664 2534 12500110370 23553 0ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Negative04/META-INF/jdoconfig.xml100664 2711 12500110370 23551 0ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Negative05/META-INF/jdoconfig.xml100664 2663 12500110370 23560 0ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Negative06/6a/META-INF/jdoconfig.xml100664 2454 12500110370 24065 0ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Negative06/6b/META-INF/jdoconfig.xml100664 2454 12500110370 24066 0ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Negative07/META-INF/services/javax.jdo.PersistenceManagerFactory100664 1430 12500110370 31625 0ustarmbouschenstaff 0 0 # # 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. # api/test/schema/jdoconfig/Negative08/META-INF/services/javax.jdo.PersistenceManagerFactory100664 1503 12500110370 31627 0ustarmbouschenstaff 0 0 # # 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. # # there are # only comments # in this file api/test/schema/jdoconfig/Negative09/9a/META-INF/jdoconfig.xml100664 2464 12500110370 24074 0ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Negative09/9a/META-INF/services/javax.jdo.PersistenceManagerFactory100664 1505 12500110370 32143 0ustarmbouschenstaff 0 0 # # 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. # javax.jdo.JDOHelperTest$BadPMFNoGetPMFMethod api/test/schema/jdoconfig/Negative09/9b/META-INF/services/javax.jdo.PersistenceManagerFactory100664 1542 12500110370 32145 0ustarmbouschenstaff 0 0 # # 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. # javax.jdo.JDOHelperTest$BadPMFGetPMFMethodThrowsJDOFatalInternalException api/test/schema/jdoconfig/Pmfmapmap01/META-INF/jdoconfig.xml100664 3211 12500110370 23716 0ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Pmfmapmap02/propsfile.props100664 1620 12500110370 23165 0ustarmbouschenstaff 0 0 # # 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. # javax.jdo.PersistenceManagerFactoryClass javax.jdo.stub.StubPMF javax.jdo.option.ConnectionDriverName Jane Doe api/test/schema/jdoconfig/Positive00/META-INF/jdoconfig.xml100664 26751 12500110370 23637 0ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Positive01/1a/META-INF/jdoconfig.xml100664 2537 12500110370 24115 0ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Positive01/1b/META-INF/jdoconfig.xml100664 2473 12500110370 24115 0ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Positive02/META-INF/jdoconfig.xml100664 2434 12500110370 23611 0ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Positive03/META-INF/jdoconfig.xml100664 2442 12500110370 23611 0ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Positive03/META-INF/services/javax.jdo.PersistenceManagerFactory100664 1456 12500110370 31671 0ustarmbouschenstaff 0 0 # # 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. # class.positive03.pmf0 api/test/schema/jdoconfig/Positive04/META-INF/jdoconfig.xml100664 2442 12500110370 23612 0ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Positive04/META-INF/services/javax.jdo.PersistenceManagerFactory100664 1533 12500110370 31666 0ustarmbouschenstaff 0 0 # # 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 is a comment class.positive04.pmf0 # this is another comment api/test/schema/jdoconfig/Positive05/META-INF/jdoconfig.xml100664 2442 12500110370 23613 0ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Positive05/META-INF/services/javax.jdo.PersistenceManagerFactory100664 1574 12500110370 31674 0ustarmbouschenstaff 0 0 # # 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. # class.positive05.pmf0# this is a comment without whitespace separating it from the uncommented text api/test/schema/jdoconfig/Positive06/META-INF/jdoconfig.xml100664 5302 12500110370 23612 0ustarmbouschenstaff 0 0 api/test/schema/jdoconfig/Positive07/META-INF/jdoconfig.xml100664 5434 12500110370 23621 0ustarmbouschenstaff 0 0 api/test/schema/Negative0-dtd.jdo100664 2001 12500110371 17137 0ustarmbouschenstaff 0 0 api/test/schema/Negative0-dtd.jdoquery100664 2033 12500110370 20231 0ustarmbouschenstaff 0 0 api/test/schema/Negative0-dtd.orm100664 2011 12500110371 17161 0ustarmbouschenstaff 0 0 api/test/schema/Negative0-xsd.jdo100664 2134 12500110371 17171 0ustarmbouschenstaff 0 0 api/test/schema/Negative0-xsd.jdoquery100664 2173 12500110371 20262 0ustarmbouschenstaff 0 0 api/test/schema/Negative0-xsd.orm100664 2134 12500110371 17212 0ustarmbouschenstaff 0 0 api/test/schema/Positive0-dtd.jdo100664 2043 12500110371 17205 0ustarmbouschenstaff 0 0 api/test/schema/Positive0-dtd.jdoquery100664 2275 12500110371 20302 0ustarmbouschenstaff 0 0 SELECT * FROM TestClass api/test/schema/Positive0-dtd.orm100664 2056 12500110371 17232 0ustarmbouschenstaff 0 0 api/test/schema/Positive0-xsd.jdo100664 2176 12500110371 17237 0ustarmbouschenstaff 0 0 api/test/schema/Positive0-xsd.jdoquery100664 2426 12500110371 20323 0ustarmbouschenstaff 0 0 SELECT * FROM TestClass api/test/schema/Positive0-xsd.orm100664 2176 12500110371 17260 0ustarmbouschenstaff 0 0 api/test/schema/Positive1-dtd.jdo100664 14532 12500110371 17234 0ustarmbouschenstaff 0 0 SELECT firstname, lastname INTO org.apache.jdo.tck.query.result.classes.FullName FROM org.apache.jdo.tck.pc.company.Person SELECT UNIQUE firstname, lastname INTO org.apache.jdo.tck.query.result.classes.FullName FROM org.apache.jdo.tck.pc.company.Person WHERE firstname == 'emp1First' SELECT UNIQUE firstname, lastname INTO org.apache.jdo.tck.query.result.classes.FullName FROM org.apache.jdo.tck.pc.company.Person SELECT firstname, lastname FROM org.apache.jdo.tck.pc.company.Person SELECT FROM org.apache.jdo.tck.pc.company.Person WHERE personid > 1 SELECT FROM org.apache.jdo.tck.pc.company.Person SeLeCt FrOm org.apache.jdo.tck.pc.company.Person api/test/schema/Positive1-dtd.orm100664 7455 12500110371 17243 0ustarmbouschenstaff 0 0 SELECT firstname, lastname INTO org.apache.jdo.tck.query.result.classes.FullName FROM org.apache.jdo.tck.pc.company.Person SELECT UNIQUE firstname, lastname INTO org.apache.jdo.tck.query.result.classes.FullName FROM org.apache.jdo.tck.pc.company.Person WHERE firstname == 'emp1First' SELECT UNIQUE firstname, lastname INTO org.apache.jdo.tck.query.result.classes.FullName FROM org.apache.jdo.tck.pc.company.Person SELECT firstname, lastname FROM org.apache.jdo.tck.pc.company.Person SELECT FROM org.apache.jdo.tck.pc.company.Person WHERE personid > 1 SELECT FROM org.apache.jdo.tck.pc.company.Person SeLeCt FrOm org.apache.jdo.tck.pc.company.Person api/test/schema/Positive1-xsd.jdo100664 14677 12500110370 17270 0ustarmbouschenstaff 0 0 SELECT firstname, lastname INTO org.apache.jdo.tck.query.result.classes.FullName FROM org.apache.jdo.tck.pc.company.Person SELECT UNIQUE firstname, lastname INTO org.apache.jdo.tck.query.result.classes.FullName FROM org.apache.jdo.tck.pc.company.Person WHERE firstname == 'emp1First' SELECT UNIQUE firstname, lastname INTO org.apache.jdo.tck.query.result.classes.FullName FROM org.apache.jdo.tck.pc.company.Person SELECT firstname, lastname FROM org.apache.jdo.tck.pc.company.Person SELECT FROM org.apache.jdo.tck.pc.company.Person WHERE personid > 1 SELECT FROM org.apache.jdo.tck.pc.company.Person SeLeCt FrOm org.apache.jdo.tck.pc.company.Person api/test/schema/Positive1-xsd.orm100664 7615 12500110371 17264 0ustarmbouschenstaff 0 0 SELECT firstname, lastname INTO org.apache.jdo.tck.query.result.classes.FullName FROM org.apache.jdo.tck.pc.company.Person SELECT UNIQUE firstname, lastname INTO org.apache.jdo.tck.query.result.classes.FullName FROM org.apache.jdo.tck.pc.company.Person WHERE firstname == 'emp1First' SELECT UNIQUE firstname, lastname INTO org.apache.jdo.tck.query.result.classes.FullName FROM org.apache.jdo.tck.pc.company.Person SELECT firstname, lastname FROM org.apache.jdo.tck.pc.company.Person SELECT FROM org.apache.jdo.tck.pc.company.Person WHERE personid > 1 SELECT FROM org.apache.jdo.tck.pc.company.Person SeLeCt FrOm org.apache.jdo.tck.pc.company.Person api/test/schema/Positive15.1-dtd.orm100664 2605 12500110371 17457 0ustarmbouschenstaff 0 0 api/test/schema/Positive15.1-xsd.orm100664 2725 12500110370 17504 0ustarmbouschenstaff 0 0 api/test/schema/Positive15.2.1-dtd.orm100664 3256 12500110371 17622 0ustarmbouschenstaff 0 0 api/test/schema/Positive15.2.1-xsd.orm100664 3376 12500110371 17650 0ustarmbouschenstaff 0 0 api/test/schema/Positive15.2.2-dtd.orm100664 3003 12500110371 17611 0ustarmbouschenstaff 0 0 api/test/schema/Positive15.2.2-xsd.orm100664 3123 12500110371 17637 0ustarmbouschenstaff 0 0 api/test/schema/Positive15.3.1-dtd.orm100664 2412 12500110371 17614 0ustarmbouschenstaff 0 0 api/test/schema/Positive15.3.1-xsd.orm100664 2532 12500110371 17642 0ustarmbouschenstaff 0 0 api/test/schema/Positive15.3.2-dtd.orm100664 2456 12500110371 17625 0ustarmbouschenstaff 0 0 api/test/schema/Positive15.3.2-xsd.orm100664 2576 12500110371 17653 0ustarmbouschenstaff 0 0 api/test/schema/Positive15.3.3-dtd.orm100664 2432 12500110371 17620 0ustarmbouschenstaff 0 0 api/test/schema/Positive15.3.3-xsd.orm100664 2552 12500110371 17646 0ustarmbouschenstaff 0 0 api/test/schema/Positive15.3.4-dtd.orm100664 2610 12500110371 17617 0ustarmbouschenstaff 0 0 api/test/schema/Positive15.3.4-xsd.orm100664 2730 12500110371 17645 0ustarmbouschenstaff 0 0 api/test/schema/Positive15.3.5-dtd.orm100664 2752 12500110371 17627 0ustarmbouschenstaff 0 0 api/test/schema/Positive15.3.5-xsd.orm100664 3063 12500110371 17646 0ustarmbouschenstaff 0 0 api/test/schema/Positive15.3.6-dtd.orm100664 2643 12500110371 17627 0ustarmbouschenstaff 0 0 api/test/schema/Positive15.3.6-xsd.orm100664 3375 12500110371 17655 0ustarmbouschenstaff 0 0 api/test/schema/Positive15.4-dtd.orm100664 3660 12500110371 17464 0ustarmbouschenstaff 0 0 api/test/schema/Positive15.4-xsd.orm100664 4000 12500110371 17474 0ustarmbouschenstaff 0 0 api/test/schema/Positive15.5-dtd.orm100664 2571 12500110371 17465 0ustarmbouschenstaff 0 0 api/test/schema/Positive15.5-xsd.orm100664 2711 12500110371 17504 0ustarmbouschenstaff 0 0 api/test/schema/Positive15.6-dtd.orm100664 2552 12500110371 17465 0ustarmbouschenstaff 0 0 api/test/schema/Positive15.6-xsd.orm100664 2672 12500110371 17513 0ustarmbouschenstaff 0 0 api/test/schema/Positive15.8.1-dtd.orm100664 3143 12500110371 17623 0ustarmbouschenstaff 0 0 api/test/schema/Positive15.8.1-xsd.orm100664 3263 12500110371 17651 0ustarmbouschenstaff 0 0 api/test/schema/Positive15.8.2-dtd.orm100664 3167 12500110371 17632 0ustarmbouschenstaff 0 0 api/test/schema/Positive15.8.2-xsd.orm100664 3307 12500110371 17651 0ustarmbouschenstaff 0 0 api/test/schema/Positive15.8.3-dtd.orm100664 2732 12500110371 17630 0ustarmbouschenstaff 0 0 api/test/schema/Positive15.8.3-xsd.orm100664 3052 12500110371 17647 0ustarmbouschenstaff 0 0 api/test/schema/Positive99-dtd.jdo100664 36476 12500110371 17350 0ustarmbouschenstaff 0 0 SELECT name FROM Employee api/test/schema/Positive99-dtd.jdoquery100664 4676 12500110370 20412 0ustarmbouschenstaff 0 0 SELECT name FROM Employee api/test/schema/Positive99-dtd.orm100664 27611 12500110371 17360 0ustarmbouschenstaff 0 0 SELECT name FROM Employee api/test/schema/Positive99-xsd.jdo100664 36761 12500110371 17370 0ustarmbouschenstaff 0 0 SELECT name FROM Employee api/test/schema/Positive99-xsd.jdoquery100664 5167 12500110371 20432 0ustarmbouschenstaff 0 0 SELECT name FROM Employee api/test/schema/Positive99-xsd.orm100664 30075 12500110371 17401 0ustarmbouschenstaff 0 0 SELECT name FROM Employee exectck/src/ 40775 0 12500110374 13210 5ustarmbouschenstaff 0 0 exectck/src/main/ 40775 0 12500110374 14134 5ustarmbouschenstaff 0 0 exectck/src/main/java/ 40775 0 12500110374 15055 5ustarmbouschenstaff 0 0 exectck/src/main/java/org/ 40775 0 12500110374 15644 5ustarmbouschenstaff 0 0 exectck/src/main/java/org/apache/ 40775 0 12500110374 17065 5ustarmbouschenstaff 0 0 exectck/src/main/java/org/apache/jdo/ 40775 0 12500110374 17641 5ustarmbouschenstaff 0 0 exectck/src/main/java/org/apache/jdo/exectck/ 40775 0 12500110374 21267 5ustarmbouschenstaff 0 0 exectck/src/main/resources/ 40775 0 12500110374 16146 5ustarmbouschenstaff 0 0 exectck/pom.xml100664 11517 12500110374 14060 0ustarmbouschenstaff 0 0 org.apache.jdo parent-pom 3.1 ../parent-pom 4.0.0 org.apache.jdo jdo-exectck maven-plugin 3.1 JDO TCK Execution Maven Mojo http://maven.apache.org scm:svn:http://svn.apache.org/repos/asf/db/jdo/tags/jdo-3.1/3.1 scm:svn:https://svn.apache.org/repos/asf/db/jdo/tags/jdo-3.1/3.1 http://svn.apache.org/viewvc/db/jdo/tags/jdo-3.1/3.1 org.apache.maven.plugins maven-compiler-plugin 2.0.2 1.6 1.6 org.apache.maven.plugins maven-deploy-plugin 2.6 true iut jdo.tck.impl iut jdori true org.apache.maven maven-plugin-api junit junit org.apache.derby derby org.apache.derby derbytools commons-io commons-io javax.jdo jdo-api org.springframework spring-core org.springframework spring-beans commons-collections commons-collections org.eclipse.persistence javax.persistence exectck/src/main/java/org/apache/jdo/exectck/AbstractTCKMojo.java100664 7456 12500110374 25175 0ustarmbouschenstaff 0 0 /* * Copyright 2006-2012 The Apache Software Foundation. * * Licensed 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.exectck; import java.io.File; import java.io.FileInputStream; import java.util.Collection; import java.util.HashSet; import java.util.Properties; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; /** * Abstract Mojo to be extended for the actual goals of this maven plugin. */ public abstract class AbstractTCKMojo extends AbstractMojo { /** * Location of TCK generated output. * @parameter property="project.build.directory" * default-value="${basedir}/target" * @required */ protected String buildDirectory; /** * Location of the logs directory. * @parameter property="project.log.directory" * default-value="${project.build.directory}/logs" * @required */ protected File logsDirectory; /** * Location of the configuration directory. * @parameter property="project.conf.directory" * default-value="${basedir}/src/conf" * @required */ protected String confDirectory; /** * Location of the configuration directory. * @parameter property="project.sql.directory" * default-value="${basedir}/src/sql" * @required */ protected String sqlDirectory; /** * List of configuration files, each describing a test configuration. * Note: Collection can only be configured in pom.xml. Using multi-valued * type because long String cannot be broken across lines in pom.xml. * @parameter * @optional */ protected Collection cfgs; /** * List of configuration files, each describing a test configuration. * Allows command line override of configured cfgs value. * @parameter property="jdo.tck.cfglist" * @optional */ protected String cfgList; /** * List of databases to run tests under. * Currently only derby is supported. * @parameter property="jdo.tck.dblist" * default-value="derby" * @required */ protected String dblist; protected Collection dbs = new HashSet(); /** * List of identity types to be tested. * @parameter property="jdo.tck.identitytypes" * default-value="applicationidentity datastoreidentity" * @required */ protected String identitytypes; protected Collection idtypes = new HashSet(); /** * Convenience method to set the cfgList from the file * "src/conf/configurations.list". * @throws MojoExecutionException If the file could not be found/opened */ protected void setCfgListFromFile() throws MojoExecutionException { try { Properties defaultProps = new Properties(); FileInputStream in = new FileInputStream(confDirectory + File.separator + "configurations.list"); defaultProps.load(in); in.close(); cfgList = defaultProps.getProperty("jdo.tck.cfglist"); } catch (Exception e) { // Error finding configurations.list throw new MojoExecutionException("No configuration specified and could not " + "find 'src/conf/configurations.list'"); } } } exectck/src/main/java/org/apache/jdo/exectck/Enhance.java100664 32673 12500110374 23623 0ustarmbouschenstaff 0 0 /* * 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.exectck; import java.net.MalformedURLException; import java.util.logging.Level; import java.util.logging.Logger; import org.apache.commons.io.FileUtils; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import java.io.File; import java.io.IOException; import java.net.URL; import java.net.URLClassLoader; import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; import java.util.Iterator; import javax.jdo.JDOEnhancer; import javax.jdo.JDOHelper; /** * Goal that enhances test classes for testing a JDO implementation. * * @goal enhance * * @phase integration-test */ public class Enhance extends AbstractMojo { private static final String[] PC_PKG_DIRS = { "org" + File.separator + "apache" + File.separator + "jdo" + File.separator + "tck" + File.separator + "api" + File.separator, "org" + File.separator + "apache" + File.separator + "jdo" + File.separator + "tck" + File.separator + "pc" + File.separator, "org" + File.separator + "apache" + File.separator + "jdo" + File.separator + "tck" + File.separator + "models" + File.separator + "inheritance" + File.separator }; /** * Location of TCK generated output. * @parameter property="jdo.tck.doEnhance" * default-value="true" * @required */ private boolean doEnhance; /** * Root of the TCK source installation. * @parameter property="project.src.directory" * default-value="${basedir}/src" * @required */ private String srcDirectory; /** * Location of the logs directory. * @parameter property="project.log.directory" * default-value="${project.build.directory}/logs" * @required */ private File logsDirectory; /** * Location of TCK generated output. * @parameter property="project.build.directory" * default-value="${basedir}/target" * @required */ private String buildDirectory; /** * Implementation to be tested (jdori or iut). * Any value other than "jdori" will test an appropriately configured IUT * @parameter property="jdo.tck.impl" * default-value="jdori" * @required */ private String impl; /** * Location of implementation log file. * @parameter property="jdo.tck.impl.logfile" * default-value="${user.dir}/datanucleus.txt" * @required */ private String implLogFile; /** * Location of jar files for implementation under test. * @parameter property="project.lib.iut.directory" * default-value="${basedir}/../lib/iut" * @required */ private String iutLibsDirectory; /** * Location of jar files for implementation under test. * @parameter property="project.lib.iut.directory" * default-value="${basedir}/../lib/jdori" * @required */ private String jdoriLibsDirectory; /** * List of identity types to be tested. * @parameter property="jdo.tck.identitytypes" * default-value="applicationidentity datastoreidentity" * @required */ private String identitytypes; private Collection idtypes; @Override public void execute() throws MojoExecutionException, MojoFailureException { if (!doEnhance) { System.out.println("Skipping Enhance goal!"); return; } idtypes = new HashSet(); PropertyUtils.string2Set(identitytypes, idtypes); // Create directory for enhancer logs String enhanceLogsDirName = logsDirectory + File.separator + "enhanced"; File enhancerLogsDir = new File(enhanceLogsDirName); if (!(enhancerLogsDir.exists()) && !(enhancerLogsDir.mkdirs())) { throw new MojoExecutionException("Failed to create directory " + enhancerLogsDir); } // Create directory for enhanced classes String enhancedDirName = buildDirectory + File.separator + "enhanced" + File.separator + impl + File.separator; File enhancedDir = new File(enhancedDirName); if (!(enhancedDir.exists()) && !(enhancedDir.mkdirs())) { throw new MojoExecutionException("Failed to create directory " + enhancedDir); } String[] metadataExtensions = {"jdo", "jdoquery", "orm", "xml", "properties"}; String[] srcDirs = {"jdo", "orm", "testdata"}; File toFile = null; File fromFile = null; String fromFileName = null; String pkgName = null; int startIdx = -1; Iterator fi = null; String[] classArray = new String[10]; String enhancedIdDirName = null; String classesDirName = buildDirectory + File.separator + "classes" + File.separator; ArrayList classes = null; // Copy metadata from src to enhanced for (String idtype : idtypes) { for (String srcDir : srcDirs) { String srcDirName = srcDirectory + File.separator + srcDir; // iterator over list of abs name of metadata files in src fi = FileUtils.iterateFiles( new File(srcDirName), metadataExtensions, true); while (fi.hasNext()) { try { fromFile = fi.next(); fromFileName = fromFile.toString(); if ((startIdx = fromFileName.indexOf(idtype + File.separator)) > -1) { // fully specified name of file (idtype + package + filename) pkgName = fromFileName.substring(startIdx); toFile = new File(enhancedDirName + File.separator + pkgName); FileUtils.copyFile(fromFile, toFile); } else if (srcDir.equals("testdata")) { startIdx = fromFileName.indexOf("org" + File.separator); pkgName = fromFileName.substring(startIdx); toFile = new File(enhancedDirName + File.separator + idtype + File.separator + pkgName); FileUtils.copyFile(fromFile, toFile); } else { continue; // idtype not in pathname, do not copy } } catch (IOException ex) { throw new MojoExecutionException("Failed to copy files from " + fromFileName + " to " + toFile.toString() + ": " + ex.getLocalizedMessage()); } } // Copy pc and pa classes from target/classes to enhanced String[] extensions = {"class"}; enhancedIdDirName = enhancedDirName + idtype + File.separator; classes = new ArrayList(); for (String pcPkgName : PC_PKG_DIRS) { // iterator over list of abs name of class files in target/classes fi = FileUtils.iterateFiles( new File(classesDirName + pcPkgName), extensions, true); while (fi.hasNext()) { try { fromFile = fi.next(); fromFileName = fromFile.toString(); // fully specified name of file (package + filename) int index = fromFileName.indexOf(pcPkgName); if (index == -1) { throw new MojoExecutionException( "Cannot get index of package path " + pcPkgName + " in file name" + fromFileName); } toFile = new File(enhancedIdDirName + fromFileName.substring(index)); FileUtils.copyFile(fromFile, toFile); classes.add(toFile.toString()); } catch (IOException ex) { throw new MojoExecutionException("Failed to copy files from " + fromFileName + " to " + toFile.toString() + ": " + ex.getLocalizedMessage()); } } } } // Enhance classes // Build ClassLoader for finding enhancer URL[] classPathURLs1 = new URL[2]; ArrayList cpList1 = new ArrayList(); ClassLoader enhancerLoader = null; try { // Must add enhancedIdDirName first!! cpList1.add((new File(enhancedIdDirName)).toURI().toURL()); String[] jars = {"jar"}; if (impl.equals("jdori")) { cpList1.add((new File(jdoriLibsDirectory)).toURI().toURL()); fi = FileUtils.iterateFiles(new File(jdoriLibsDirectory), jars, true); while (fi.hasNext()) { cpList1.add(fi.next().toURI().toURL()); } } else { cpList1.add((new File(iutLibsDirectory)).toURI().toURL()); fi = FileUtils.iterateFiles(new File(iutLibsDirectory), jars, true); while (fi.hasNext()) { cpList1.add(fi.next().toURI().toURL()); } } enhancerLoader = new URLClassLoader(cpList1.toArray(classPathURLs1), getClass().getClassLoader()); System.out.println("ClassLoader enhancerLoader:"); Utilities.printClasspath(enhancerLoader); } catch (MalformedURLException ex) { Logger.getLogger(Enhance.class.getName()).log(Level.SEVERE, null, ex); } // Context classloader for finding log4j.properties ClassLoader prevCl = Thread.currentThread().getContextClassLoader(); try { URL implUrl; if (impl.equals("jdori")) { implUrl = (new File(jdoriLibsDirectory)).toURI().toURL(); } else { implUrl = (new File(iutLibsDirectory)).toURI().toURL(); } URL enhancedClassesUrl = (new File(enhancedIdDirName)).toURI().toURL(); // Classes dir needed for org.apache.jdo.tck.util.TCKFileAppender URL classesUrl = (new File(classesDirName)).toURI().toURL(); ClassLoader loggingPropsCl = URLClassLoader.newInstance(new URL[]{implUrl, enhancedClassesUrl, classesUrl}, prevCl); Thread.currentThread().setContextClassLoader(loggingPropsCl); } catch (Exception e) { e.printStackTrace(); } System.out.println("ClassLoader ContextClassLoader:"); Utilities.printClasspath(Thread.currentThread().getContextClassLoader()); System.out.println("Get enhancer"); JDOEnhancer enhancer = JDOHelper.getEnhancer(enhancerLoader); System.out.println("enhancer.setVerbose()"); enhancer.setVerbose(true); System.out.println("enhancer.setClassLoader()"); enhancer.setClassLoader(enhancerLoader); String[] classArr = classes.toArray(classArray); enhancer.addClasses(classArr); System.out.println("Enhancing classes for identity type " + idtype); // enhancer needs org/apache/jdo/tck/util/DeepEquality enhancer.enhance(); Thread.currentThread().setContextClassLoader(prevCl); // Move log to per-test location String idname = "dsid"; if (idtype.trim().equals("applicationidentity")) { idname = "app"; } String testLogFilename = logsDirectory + File.separator + "enhanced" + File.separator + idname + "-" + impl + ".txt"; System.out.println("testLogFilename is " + testLogFilename); try { File logFile = new File(implLogFile); File testLogFile = new File(testLogFilename); FileUtils.copyFile(logFile, testLogFile); } catch (Exception e) { System.out.println(">> Error copying implementation log file: " + e.getMessage()); } } System.out.println(""); } } exectck/src/main/java/org/apache/jdo/exectck/Help.java100664 11117 12500110374 23140 0ustarmbouschenstaff 0 0 /* * 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.exectck; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; /** * Goal that displays help text for the exectck Maven plugin. * * @goal help * * @phase integration-test * */ public class Help extends AbstractMojo{ @Override public void execute() throws MojoExecutionException, MojoFailureException { StringBuffer msg = new StringBuffer(); msg.append("\n\n*** jdo-exectck Maven plugin ***\n\n"); msg.append("This plugin executes the JDO Technology Compatibility Kit (TCK)\n"); msg.append("against the Reference Implementation (RI) or an implementation under test (IUT).\n\n"); msg.append("- To display this help text, type \"mvn jdo-exectck:help\"\n"); msg.append("- To run the entire TCK type \"mvn integration-test\" or \"mvn install\"\n"); msg.append("- To run individual goals type \"mvn jdo-exectck:\"\n"); msg.append(" Specify command line parameters, described below, to configure the test.\n"); msg.append("\nGOALS\n"); msg.append("* installSchema\n"); msg.append(" Installs all of the database schemas required to execute tests\n"); msg.append(" in the current test configurations.\n"); msg.append("* enhance\n"); msg.append(" Enhances classes. Classes must first be compiled (mvn compile).\n"); msg.append("* runtck\n"); msg.append(" Runs the JDO Technology Compatibility Kit. Schema must first be installed and classes enhanced.\n"); msg.append("\nPARAMETERS\n"); msg.append("To set parameters from the command line, \n use the -D option and the parameter name.\n"); msg.append(" For example, \"mvn -Djdo.tck.identitytype=applicationidentity\"\n"); msg.append("* jdo.tck.impl\n"); msg.append(" jdori (reference implementation) or iut (mplementation under test\n"); msg.append("* jdo.tck.cfglist\n"); msg.append(" List of configuration files, each describing a test configuration.\n"); msg.append(" Default is all configurations.\n"); msg.append("* jdo.tck.dblist\n"); msg.append(" List of databases to run tests under.\n"); msg.append(" Currently only derby is supported\n"); msg.append("* jdo.tck.identitytypes\n"); msg.append(" List of identity types to be tested\n"); msg.append(" Default value is \"applicationidentity datastoreidentity\"\n"); msg.append("* project.lib.iut.directory\n"); msg.append(" Location of implementation jar files. Default: ${basedir}/../lib/iut\n"); msg.append("* jdo.tck.impl.logfile\n"); msg.append(" Location of implementation log file. Default: ${user.dir}/datanucleus.txt\n"); msg.append("* jdo.tck.doInstallSchema\n"); msg.append(" Setting this parameter to false will bypass schema installation.\n"); msg.append("* jdo.tck.doEnhance\n"); msg.append(" Setting this parameter to false will bypass enhancement.\n"); msg.append("* jdo.tck.doRunTCK\n"); msg.append(" Setting this parameter to false will bypass running the TCK.\n"); msg.append("* jdo.tck.runTCKVerbose\n"); msg.append(" Setting this parameter to true will display test progress and" + "error output while the TCK is running.\n"); msg.append("\n To run the TCK on an implementation under test, \n" + " place all required jars and their dependencies in lib/iut\n" + " and set jdo.tck.impl to iut:\n"); msg.append(" mvn integration-test -D jdo.tck.impl=\"iut\"\n\n"); msg.append("\n END EXECTCK HELP INFORMATION\n"); System.out.println(msg.toString()); } } exectck/src/main/java/org/apache/jdo/exectck/InstallSchema.java100664 17166 12500110374 25011 0ustarmbouschenstaff 0 0 /* * Copyright 2006-2012 The Apache Software Foundation. * * Licensed 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.exectck; import org.apache.commons.io.FileUtils; import org.apache.maven.plugin.MojoExecutionException; import java.io.File; import java.io.IOException; import java.util.Collection; import java.util.HashSet; /** * Goal that installs a database schema for testing a JDO implementation. * * @goal installSchema * * @phase integration-test */ public class InstallSchema extends AbstractTCKMojo { /** * Location of TCK generated output. * @parameter property="jdo.tck.doInstallSchema" * default-value="true" * @required */ private boolean doInstallSchema; /** * List of mappings required by the current configuration */ protected Collection mappings = new HashSet(); @Override public void execute() throws MojoExecutionException { if (!doInstallSchema) { System.out.println("Skipping InstallSchema goal!"); return; } if (cfgs == null) { if (cfgList != null) { System.out.println("cfgList is " + cfgList); cfgs = new HashSet(); PropertyUtils.string2Set(cfgList, cfgs); } else { // Fallback to "src/conf/configurations.list" setCfgListFromFile(); if (cfgList != null) { cfgs = new HashSet(); PropertyUtils.string2Set(cfgList, cfgs); } if (cfgList == null) { throw new MojoExecutionException( "Could not find configurations to run TCK. " + "Set cfgList parameter on command line or cfgs in pom.xml."); } } } PropertyUtils.string2Set(dblist, dbs); PropertyUtils.string2Set(identitytypes, idtypes); PropertyUtils.mappingsSet(cfgs, confDirectory, mappings); System.out.println("*>Schemas to be installed for \n configurations: " + cfgs.toString() + "\n databases: " + dbs.toString() + "\n identity types: " + identitytypes.toString()); System.setProperty("java.security.manager", "default"); System.setProperty("java.security.policy", confDirectory + File.separator + "security.policy"); for (String db : dbs) { if ("derby".equalsIgnoreCase(db)) { // Currently we support only derby. To support additional db's, configuration // data must be parameterized. // Create directory for db logs String dbLogsDirName = logsDirectory + File.separator + "database"; File dbLogsDir = new File(dbLogsDirName); if (!(dbLogsDir.exists()) && !(dbLogsDir.mkdirs())) { throw new MojoExecutionException("Failed to create directory " + dbLogsDir); } // Create database directory String dbDirName = buildDirectory + File.separator + "database" + File.separator + db; File dbDir = new File(dbDirName); if (!(dbDir.exists()) && !(dbDir.mkdirs())) { throw new MojoExecutionException("Failed to create directory " + dbDir); } // Copy derby.properties to db dir File dbConf = new File(confDirectory + File.separator + db + ".properties"); File targetDir = new File(dbDirName); try { FileUtils.copyFileToDirectory(dbConf, targetDir, false); } catch (IOException ex) { throw new MojoExecutionException("Failed to copy file " + dbConf + " to " + dbDir + ": " + ex.getLocalizedMessage()); } if (mappings.contains("0")) { // If schema was explicitly specified as "0" change to "" since // the schema file in that case is "schema.sql". Note that this // removes a duplicate entry too mappings.remove("0"); mappings.add(""); } // Create database for (String idtype : idtypes) { for (String mapping : mappings) { System.setProperty("ij.outfile", logsDirectory + File.separator + "database" + File.separator + db + "_" + idtype + "_" + mapping + ".txt"); System.out.print("*> Installing schema" + mapping + ".sql for " + db + " " + idtype + " ... "); String[] args = {sqlDirectory + File.separator + db + File.separator + idtype + File.separator + "schema" + mapping + ".sql"}; System.setProperty("derby.system.home", dbDirName); boolean success = true; try { org.apache.derby.tools.ij.main(args); } catch (IOException ioex) { success = false; System.out.println("FAILED!"); throw new MojoExecutionException( "*> Failed to execute ij: " + ioex.getLocalizedMessage()); } catch (Exception ex) { success = false; System.out.println("FAILED!"); ex.printStackTrace(); System.out.println("*> Classpath is "); new Utilities().printClasspath(); System.out.println("*> derby.system.home is \n " + System.getProperty("derby.system.home")); System.out.println("*> jdo.tck.basedir is \n " + System.getProperty("jdo.tck.basedir")); System.out.println("*> ij.outfile is \n " + System.getProperty("ij.outfile")); System.out.println("*> java.security.manager is \n " + System.getProperty("java.security.manager")); System.out.println("*> java.security.policy is \n " + System.getProperty("java.security.policy")); } finally { if (success) { System.out.println("done"); } } } } System.out.println("*> See diagnostic output in " + dbLogsDir + "."); System.out.println(""); } } } } exectck/src/main/java/org/apache/jdo/exectck/PropertyUtils.java100664 11002 12500110374 25106 0ustarmbouschenstaff 0 0 /* * Copyright 2006-2012 The Apache Software Foundation. * * Licensed 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.exectck; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.util.Collection; import java.util.List; import java.util.Properties; import java.util.logging.Level; import java.util.logging.Logger; /** * Helper class that sets properties required for running the JDO TCK. * */ public class PropertyUtils { /** * Separates white space separated items from a String into Collection entries * Used to collect command line argument lists into a Collection * * @param names String of white space separated items * @param list HashSet to contain String items */ public static void string2Set(String names, Collection list) { String[] items = names.split("[ \t\n]"); for (String s : items) { list.add(s); } } /** * Separates white space separated items from a String into HashSet entries * Used to collect command line argument lists into a Collection * * @param names String of white space separated items * @param list HashSet to contain String items */ public static void string2List(String names, List list) { // System.out.println("names are " + names); String[] items = names.split("[ \t\n]"); for (String s : items) { list.add(s); } // System.out.println("List names are " + list.toString()); } /** * Parses a set of config files for the mapping entry and * provides the mapping values in a Collection. * @param cfglist config file names * @param confDir directory where config files are found * @param mappings object to containg mapping values */ public static void mappingsSet(Collection cfglist, String confDir, Collection mappings) { for (String cfg : cfglist) { String mapping = ""; String confName = confDir + File.separator + cfg; Properties props = new Properties(); FileInputStream fis = null; // System.out.println("confName is " + confName); try { fis = new FileInputStream(confName); props.load(fis); mapping = props.getProperty("jdo.tck.mapping"); // System.out.println("Next mapping is " + mapping); } catch (IOException e) { e.printStackTrace(); try { if (fis != null) { fis.close(); } } catch (IOException ex) { Logger.getLogger(PropertyUtils.class.getName()).log(Level.SEVERE, null, ex); } return; } mappings.add(mapping); } } /* * Open a properties file and return a Properties object */ public static Properties getProperties(String fname){ Properties props = new Properties(); FileInputStream fis = null; try { fis = new FileInputStream(new File(fname)); props.load(fis); } catch (IOException e) { e.printStackTrace(); try { if (fis != null) { fis.close(); } } catch (IOException ex) { Logger.getLogger(PropertyUtils.class.getName()).log(Level.SEVERE, null, ex); } } return props; } /* * Set the value of key if found in properties. */ public static void setSysProperty(Properties properties, String key, String newkey) { String value = properties.getProperty("key"); if (value != null) { System.setProperty(newkey, value); } } public static void setSysProperty(Properties properties, String key) { setSysProperty(properties, key, key); } } exectck/src/main/java/org/apache/jdo/exectck/RunTCK.java100664 55132 12500110374 23363 0ustarmbouschenstaff 0 0 /* * Copyright 2006-2012 The Apache Software Foundation. * * Licensed 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.exectck; import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import java.net.URLClassLoader; import java.util.ArrayList; import java.util.Arrays; import java.util.Iterator; import java.util.List; import java.util.Properties; import java.util.logging.Level; import java.util.logging.Logger; import org.apache.commons.io.FileUtils; import org.apache.jdo.exectck.Utilities.InvocationResult; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; /** * Goal that runs the JDO TCK against the Reference Implementation (RI) * or an implementation under test (IUT). * * @goal runtck * * @phase integration-test */ public class RunTCK extends AbstractTCKMojo { /** * To skip running of TCK, set to false. * @parameter property="jdo.tck.doRunTCK" * default-value=true * @required */ private boolean doRunTCK; /** * To run the RunTCK plugin goal in verbose mode. * @parameter property="jdo.tck.runTCKVerbose" * default-value=false * @required */ private boolean runtckVerbose; /** * Run the TCK in a debugger. * @parameter property="jdo.tck.debugTCK" * default-value=false * @required */ private boolean debugTCK; /** * Implementation to be tested (jdori or iut). * Any value other than "jdori" will test an appropriately configured IUT * @parameter property="jdo.tck.impl" * default-value="jdori" * @required */ private String impl; /** * Location of third party libraries such as JNDI. * @parameter property="project.lib.ext.directory" * default-value="${basedir}/../lib/ext" * @required */ private String extLibsDirectory; /** * Location of implementation log file. * @parameter property="jdo.tck.impl.logfile" * default-value="${user.dir}/datanucleus.txt" * @required */ private String implLogFile; /** * Location of jar files for implementation under test. * @parameter property="project.lib.iut.directory" * default-value="${basedir}/../lib/iut" * @required */ private String iutLibsDirectory; /** * Location of jar files for implementation under test. * @parameter property="project.lib.iut.directory" * default-value="${basedir}/../lib/jdori" * @required */ private String jdoriLibsDirectory; /** * Name of file in src/conf containing pmf properties. * @parameter property="jdo.tck.pmfproperties" * default-value="jdori-pmf.properties" * @optional */ private String pmfProperties; /** * Name of file in src/conf containing property jdo.tck.exclude, * whose value is a list of files to be excluded from testing. * @parameter property="jdo.tck.excludefile" * default-value="exclude.list" * @required */ private String exclude; /** * Run the TCK tests in verbose mode. * @parameter property="jdo.tck.verbose" * default-value="false" * @optional */ private String verbose; /** * To retain test output for debugging, set to false. * @parameter property="jdo.tck.cleanupaftertest" * default-value="true" * @optional */ private String cleanupaftertest; /** * Properties to use in accessing database. * @parameter property="database.runtck.sysproperties" * default-value="-Dderby.system.home=${basedir}/target/database/derby" * @optional */ private String dbproperties; // NOTE: only allows for one db /** * Properties to use in accessing database. * @parameter property="jdo.tck.signaturefile" * default-value="${basedir}/src/conf/jdo-3_1-signatures.txt" * @optional */ private String signaturefile; /** * JVM properties. * @parameter property="jdo.tck.jvmproperties" * default-value="-Xmx512m" * @optional */ private String jvmproperties; /** * User-supplied arguments for debug directives. * @parameter property="jdo.tck.debug.jvmargs" * default-value="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=${jdo.tck.debug.port}" * @optional */ private String debugDirectives; /** * Class used to run a batch of tests. * @parameter property="jdo.tck.testrunnerclass" * default-value="org.apache.jdo.tck.util.BatchTestRunner" * @required */ private String testRunnerClass; /** * Class used to output test result and configuration information. * @parameter property="jdo.tck.resultprinterclass" * default-value="org.apache.jdo.tck.util.BatchResultPrinter" * @required */ private String resultPrinterClass; /** * Helper method returning the trimmed value of the specified property. * @param props the Properties object * @param ke the key of the property to be returned * @return the trimmed property value or the empty string if the property is not defined. + */ private String getTrimmedPropertyValue (Properties props, String key) { String value = props.getProperty(key); return value == null ? "" : value.trim(); } @Override public void execute() throws MojoExecutionException, MojoFailureException { if (!doRunTCK) { System.out.println("Skipping RunTCK goal!"); return; } Properties props = null; boolean alreadyran = false; String runonce = "false"; List propsString = new ArrayList(); List command; String cpString = null; InvocationResult result; File fromFile = null; File toFile = null; if (impl.equals("iut")) { pmfProperties="iut-pmf.properties"; } if (cfgs == null) { if (cfgList != null) { cfgs = new ArrayList(); PropertyUtils.string2List(cfgList, (List)cfgs); } else { // Fallback to "src/conf/configurations.list" setCfgListFromFile(); if (cfgList != null) { cfgs = new ArrayList(); PropertyUtils.string2List(cfgList, (List)cfgs); } if (cfgList == null) { throw new MojoExecutionException( "Could not find configurations to run TCK. " + "Set cfgList parameter on command line or cfgs in pom.xml"); } } } PropertyUtils.string2Set(dblist, dbs); PropertyUtils.string2Set(identitytypes, idtypes); System.out.println("*>TCK to be run for implementation '" + impl + "' on \n" + " configurations: " + cfgs.toString() + "\n" + " databases: " + dbs.toString() + "\n" + " identitytypes: " + identitytypes.toString()); // Properties required for test execution System.out.println("cleanupaftertest is " + cleanupaftertest); propsString.add("-DResultPrinterClass=" + resultPrinterClass); propsString.add("-Dverbose=" + verbose); propsString.add("-Djdo.tck.cleanupaftertest=" + cleanupaftertest); propsString.add("-DPMFProperties=" + buildDirectory + File.separator + "classes" + File.separator + pmfProperties); propsString.add("-DPMF2Properties=" + buildDirectory + File.separator + "classes" + File.separator + pmfProperties); String excludeFile = confDirectory + File.separator + exclude; propsString.add("-Djdo.tck.exclude=" + getTrimmedPropertyValue(PropertyUtils.getProperties(excludeFile), "jdo.tck.exclude")); // Create configuration log directory String timestamp = Utilities.now(); String thisLogDir = logsDirectory + File.separator + timestamp + File.separator; String cfgDirName = thisLogDir + "configuration"; File cfgDir = new File(cfgDirName); if (!(cfgDir.exists()) && !(cfgDir.mkdirs())) { throw new MojoExecutionException("Failed to create directory " + cfgDirName); } propsString.add("-Djdo.tck.log.directory=" + thisLogDir); // Copy JDO config files to classes dir try { fromFile = new File(confDirectory + File.separator + impl + "-jdoconfig.xml"); toFile = new File(buildDirectory + File.separator + "classes" + File.separator + "META-INF" + File.separator + "jdoconfig.xml"); FileUtils.copyFile(fromFile, toFile); fromFile = new File(confDirectory + File.separator + impl + "-persistence.xml"); toFile = new File(buildDirectory + File.separator + "classes" + File.separator + "META-INF" + File.separator + "persistence.xml"); FileUtils.copyFile(fromFile, toFile); } catch (IOException ex) { Logger.getLogger(RunTCK.class.getName()).log(Level.SEVERE, null, ex); } // Get ClassLoader URLs to build classpath below URL[] cpURLs = ((URLClassLoader) Thread.currentThread().getContextClassLoader()).getURLs(); ArrayList urlList = new ArrayList(Arrays.asList(cpURLs)); // Get contents of pmf properties file to build new file below String pmfPropsReadFileName = confDirectory + File.separator + pmfProperties; String defaultPropsContents = ""; try { defaultPropsContents = Utilities.readFile(pmfPropsReadFileName); } catch (IOException ex) { Logger.getLogger(RunTCK.class.getName()).log(Level.SEVERE, null, ex); } for (String db : dbs) { System.setProperty("jdo.tck.database", db); alreadyran = false; for (String idtype : idtypes) { List idPropsString = new ArrayList(); idPropsString.addAll(propsString); idPropsString.add("-Djdo.tck.identitytype=" + idtype); String enhancedDirName = buildDirectory + File.separator + "enhanced" + File.separator + impl + File.separator + idtype + File.separator; File enhancedDir = new File(enhancedDirName); if (!(enhancedDir.exists())) { throw new MojoExecutionException("Could not find enhanced directory " + enhancedDirName + ". Execute Enhance goal before RunTCK."); } // Set classpath string: add new entries to URLS from loader ArrayList cpList = new ArrayList(); cpList.addAll(urlList); try { URL url1 = enhancedDir.toURI().toURL(); URL url2 = new File(buildDirectory + File.separator + "classes" + File.separator).toURI().toURL(); if (runtckVerbose) { System.out.println("url2 is " + url2.toString()); } cpList.add(url1); cpList.add(url2); String[] jars = {"jar"}; Iterator fi = FileUtils.iterateFiles( new File(extLibsDirectory), jars, true); while (fi.hasNext()) { cpList.add(fi.next().toURI().toURL()); } if (impl.equals("iut")) { fi = FileUtils.iterateFiles( new File(iutLibsDirectory), jars, true); while (fi.hasNext()) { cpList.add(fi.next().toURI().toURL()); } } else { fi = FileUtils.iterateFiles( new File(jdoriLibsDirectory), jars, true); while (fi.hasNext()) { cpList.add(fi.next().toURI().toURL()); } } } catch (MalformedURLException ex) { ex.printStackTrace(); Logger.getLogger(RunTCK.class.getName()).log(Level.SEVERE, null, ex); } cpString = Utilities.urls2ClasspathString(cpList); if (runtckVerbose) { System.out.println("\nClasspath is " + cpString); } for (String cfg : cfgs) { List cfgPropsString = new ArrayList(); cfgPropsString.addAll(idPropsString); // Parse conf file and set properties String props = PropertyUtils.getProperties(confDirectory + File.separator + cfg); cfgPropsString.add("-Djdo.tck.testdata=" + getTrimmedPropertyValue(props, "jdo.tck.testdata")); cfgPropsString.add("-Djdo.tck.standarddata=" + getTrimmedPropertyValue(props, "jdo.tck.standarddata")); cfgPropsString.add("-Djdo.tck.mapping.companyfactory=" + getTrimmedPropertyValue(props, "jdo.tck.mapping.companyfactory")); // innerPropsString.append("-Djdo.tck.description=\"" + // props.getProperty("jdo.tck.description") + "\""); cfgPropsString.add("-Djdo.tck.requiredOptions=" + getTrimmedPropertyValue(props, "jdo.tck.requiredOptions")); cfgPropsString.add("-Djdo.tck.signaturefile=" + signaturefile); String mapping = getTrimmedPropertyValue(props, "jdo.tck.mapping"); if (mapping == null) { throw new MojoExecutionException( "Could not find mapping value in conf file: " + cfg); } String classes = getTrimmedPropertyValue(props, "jdo.tck.classes"); String excludeList = getTrimmedPropertyValue( PropertyUtils.getProperties(excludeFile), "jdo.tck.exclude"); if (classes == null) { throw new MojoExecutionException( "Could not find classes value in conf file: " + cfg); } classes = Utilities.removeSubstrs(classes, excludeList); if (classes.equals("")) { System.out.println("Skipping configuration " + cfg + ": classes excluded"); continue; } List classesList = Arrays.asList(classes.split(" ")); cfgPropsString.add("-Djdo.tck.schemaname=" + idtype + mapping); cfgPropsString.add("-Djdo.tck.cfg=" + cfg); runonce = getTrimmedPropertyValue(props, "runOnce"); runonce = (runonce == null) ? "false" : runonce; // Add Mapping and schemaname to properties file StringBuffer propsFileData = new StringBuffer(); propsFileData.append("\n### Properties below added by maven 2 goal RunTCK.jdori"); propsFileData.append("\njavax.jdo.mapping.Schema=" + idtype + mapping); mapping = (mapping.equals("0")) ? "" : mapping; propsFileData.append("\njavax.jdo.option.Mapping=standard" + mapping); propsFileData.append("\n"); String pmfPropsWriteFileName = buildDirectory + File.separator + "classes" + File.separator + pmfProperties; try { BufferedWriter out = new BufferedWriter(new FileWriter(pmfPropsWriteFileName, false)); out.write(defaultPropsContents + propsFileData.toString()); out.close(); } catch (IOException ex) { Logger.getLogger(RunTCK.class.getName()).log(Level.SEVERE, null, ex); } // build command line string command = new ArrayList(); command.add("java"); command.add("-cp"); command.add(cpString); command.addAll(cfgPropsString); command.add(dbproperties); command.add(jvmproperties); if (debugTCK) { command.add(debugDirectives); } command.add(testRunnerClass); command.addAll(classesList); if (runonce.equals("true") && alreadyran) { continue; } if (debugTCK) { System.out.println("Using debug arguments: \n" + debugDirectives); } // invoke class runner System.out.print("*> Running tests for " + cfg + " with " + idtype + " on '" + db + "'" + " mapping=" + mapping + " ... "); try { result = (new Utilities()).invokeTest(command); if (result.getExitValue() == 0) { System.out.println("success"); } else { System.out.println("FAIL"); } if (runtckVerbose) { System.out.println("\nCommand line is: \n" + command.toString()); System.out.println("Test exit value is " + result.getExitValue()); System.out.println("Test result output:\n" + result.getOutputString()); System.out.println("Test result error:\n" + result.getErrorString()); } } catch (java.lang.RuntimeException re) { System.out.println("Exception on command " + command); } // Move log to per-test location String idname = "dsid"; if (idtype.trim().equals("applicationidentity")) { idname = "app"; } String configName = cfg; if (cfg.indexOf('.') > 0) { configName = configName.substring(0, cfg.indexOf('.')); } String testLogFilename = thisLogDir + idname + "-" + configName + "-" + impl + ".txt"; try { File logFile = new File(implLogFile); FileUtils.copyFile(logFile, new File(testLogFilename)); } catch (Exception e) { System.out.println(">> Error copying implementation log file: " + e.getMessage()); } if (runonce.equals("true")) { alreadyran = true; } } } } // Remove log file try { FileUtils.forceDelete(new File(implLogFile)); } catch (Exception e) { System.out.println(">> Error deleting log file: " + e.getMessage()); } // Output results command = new ArrayList(); command.add("java"); command.add("-cp"); command.add(cpString); command.add("org.apache.jdo.tck.util.ResultSummary"); command.add(thisLogDir); result = (new Utilities()).invokeTest(command, new File(buildDirectory)); // Create system configuration description file command.set(3, "org.apache.jdo.tck.util.SystemCfgSummary"); command.set(4, cfgDirName); command.add("system_config.txt"); result = (new Utilities()).invokeTest(command, new File(buildDirectory)); // Copy metadata from enhanced to configuration logs directory for (String idtype : idtypes) { String fromDirName = buildDirectory + File.separator + "enhanced" + File.separator + impl + File.separator + idtype + File.separator; String[] metadataExtensions = {"jdo", "jdoquery", "orm", "xml", "properties"}; String fromFileName = null; String pkgName = null; int startIdx = -1; // iterator over list of abs name of metadata files in src Iterator fi = FileUtils.iterateFiles( new File(fromDirName), metadataExtensions, true); while (fi.hasNext()) { try { fromFile = fi.next(); fromFileName = fromFile.toString(); // System.out.println("Copying " + fromFileName); if ((startIdx = fromFileName.indexOf(idtype + File.separator)) > -1) { // fully specified name of file (idtype + package + filename) pkgName = fromFileName.substring(startIdx); toFile = new File(cfgDirName + File.separator + pkgName); // System.out.println("Copy from source dir to " + toFile.toString()); FileUtils.copyFile(fromFile, toFile); } } catch (IOException ex) { throw new MojoExecutionException("Failed to copy files from " + fromFileName + " to " + toFile.toString() + ": " + ex.getLocalizedMessage()); } } } } } exectck/src/main/java/org/apache/jdo/exectck/Utilities.java100664 21255 12500110374 24227 0ustarmbouschenstaff 0 0 /* * 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.exectck; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.net.URL; import java.net.URLClassLoader; import java.nio.CharBuffer; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; import java.util.List; import java.util.Map; import javax.jdo.JDOException; public class Utilities { Utilities() { } public static final String DATE_FORMAT_NOW = "yyyyMMdd-HHmmss"; /* * Return the current date/time as a String. */ public static String now() { Calendar cal = Calendar.getInstance(); SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW); return sdf.format(cal.getTime()); } /* * From an array of URLs, create a classpath String suitable for use * as a command line argument */ public static String urls2ClasspathString(ArrayList urls) { StringBuffer cp = new StringBuffer(); for (URL url: urls) { cp.append(url.getPath()); cp.append(File.pathSeparator); } return cp.toString(); } public static String removeSubstrs(String master, String exclude) { String [] deleteThese = exclude.split(" "); String filtered = master; for (String sub: deleteThese) { filtered = filtered.replaceAll(sub.trim(), ""); } return filtered.trim(); } public static void printClasspath(ClassLoader loader) { //Get the URLs URL[] urls = ((URLClassLoader) loader).getURLs(); System.out.println(urls.length + " URL(s) for loader: "); for (int i = 0; i < urls.length; i++) { if (urls[i] != null) { System.out.println(" " + urls[i].getFile()); } } } public void printClasspath() { //Get the System Classloader ClassLoader loader = ClassLoader.getSystemClassLoader(); //Get the URLs URL[] urls = ((URLClassLoader) loader).getURLs(); for (int i = 0; i < urls.length; i++) { System.out.println(" " + urls[i].getFile()); } //Get the System Classloader loader = Thread.currentThread().getContextClassLoader(); //Get the URLs urls = ((URLClassLoader) loader).getURLs(); for (int i = 0; i < urls.length; i++) { System.out.println(" " + urls[i].getFile()); } } static String readFile( String fileName ) throws IOException { BufferedReader reader = new BufferedReader( new FileReader (fileName)); String line = null; StringBuffer stringBuf = new StringBuffer(); String ls = System.getProperty("line.separator"); while( ( line = reader.readLine() ) != null ) { stringBuf.append( line ); stringBuf.append( ls ); } return stringBuf.toString(); } InvocationResult invokeTest(List command) { InvocationResult result = new InvocationResult(); try { ProcessBuilder builder = new ProcessBuilder(command); Map env = builder.environment(); Process proc = builder.start(); InputStream stdout = proc.getInputStream(); InputStream stderr = proc.getErrorStream(); CharBuffer outBuffer = CharBuffer.allocate(1000000); CharBuffer errBuffer = CharBuffer.allocate(1000000); Thread outputThread = createReaderThread(stdout, outBuffer); Thread errorThread = createReaderThread(stderr, errBuffer); int exitValue = proc.waitFor(); result.setExitValue(exitValue); errorThread.join(10000); // wait ten seconds to get stderr after process terminates outputThread.join(10000); // wait ten seconds to get stdout after process terminates result.setErrorString(errBuffer.toString()); result.setOutputString(outBuffer.toString()); // wait until the Enhancer command finishes } catch (InterruptedException ex) { throw new RuntimeException("InterruptedException", ex); } catch (IOException ex) { throw new RuntimeException("IOException", ex); } catch (JDOException jdoex) { jdoex.printStackTrace(); Throwable[] throwables = jdoex.getNestedExceptions(); System.out.println("Exception throwables of size: " + throwables.length); for (Throwable throwable: throwables) { throwable.printStackTrace(); } } return result; } InvocationResult invokeTest(List command, File directory) { InvocationResult result = new InvocationResult(); try { ProcessBuilder builder = new ProcessBuilder(command); builder.directory(directory); Map env = builder.environment(); Process proc = builder.start(); InputStream stdout = proc.getInputStream(); InputStream stderr = proc.getErrorStream(); CharBuffer outBuffer = CharBuffer.allocate(1000000); CharBuffer errBuffer = CharBuffer.allocate(1000000); Thread outputThread = createReaderThread(stdout, outBuffer); Thread errorThread = createReaderThread(stderr, errBuffer); int exitValue = proc.waitFor(); result.setExitValue(exitValue); errorThread.join(10000); // wait ten seconds to get stderr after process terminates outputThread.join(10000); // wait ten seconds to get stdout after process terminates result.setErrorString(errBuffer.toString()); result.setOutputString(outBuffer.toString()); // wait until the Enhancer command finishes } catch (InterruptedException ex) { throw new RuntimeException("InterruptedException", ex); } catch (IOException ex) { throw new RuntimeException("IOException", ex); } catch (JDOException jdoex) { jdoex.printStackTrace(); Throwable[] throwables = jdoex.getNestedExceptions(); System.out.println("Exception throwables of size: " + throwables.length); for (Throwable throwable: throwables) { throwable.printStackTrace(); } } return result; } private Thread createReaderThread(final InputStream input, final CharBuffer output) { final Reader reader = new InputStreamReader(input); Thread thread = new Thread( new Runnable() { public void run() { int count = 0; int outputBytesRead = 0; try { while (-1 != (outputBytesRead = reader.read(output))) { count += outputBytesRead; } } catch (IOException e) { e.printStackTrace(); } finally { output.flip(); } } }); thread.start(); return thread; } class InvocationResult { private int exitValue; private String errorString; private String outputString; int getExitValue() { return exitValue; } private void setExitValue(int exitValue) { this.exitValue = exitValue; } private void setErrorString(String errorString) { this.errorString = errorString; } String getErrorString() { return errorString; } private void setOutputString(String outputString) { this.outputString = outputString; } String getOutputString() { return outputString; } } } copyjdorijars/src/ 40775 0 12500110374 14444 5ustarmbouschenstaff 0 0 copyjdorijars/src/main/ 40775 0 12500110374 15370 5ustarmbouschenstaff 0 0 copyjdorijars/src/main/resources/ 40775 0 12500110374 17402 5ustarmbouschenstaff 0 0 copyjdorijars/pom.xml100664 11116 12500110374 15307 0ustarmbouschenstaff 0 0 org.apache.jdo parent-pom 3.1 ../parent-pom 4.0.0 org.apache.jdo copy-jdori-jars JDO RI Jar Copy 3.1 The Java Data Objects (JDO) API is a standard interface-based Java model abstraction of persistence, developed as Java Specification Request 243 under the auspices of the Java Community Process. scm:svn:http://svn.apache.org/repos/asf/db/jdo/tags/jdo-3.1/3.1 scm:svn:https://svn.apache.org/repos/asf/db/jdo/tags/jdo-3.1/3.1 http://svn.apache.org/viewvc/db/jdo/tags/jdo-3.1/3.1 src/main ${basedir}/src/main/resources ${basedir}/../lib/jdori maven-clean-plugin 2.5 ${basedir}/../lib/jdori * false org.apache.maven.plugins maven-dependency-plugin copy-dependencies package copy-dependencies ${basedir}/../lib/jdori org.apache.maven.plugins maven-deploy-plugin 2.6 true org.datanucleus datanucleus-core 4.0.5 org.datanucleus datanucleus-rdbms 4.0.8 org.datanucleus datanucleus-api-jdo 4.0.5 org.datanucleus datanucleus-api-jpa 4.0.6 c3p0 c3p0 0.9.0.2 log4j log4j 1.2.16 DataNucleus Nightly http://www.datanucleus.org/downloads/maven2-nightly false true copyjdorijars/src/main/resources/log4j.properties100664 7741 12500110374 22645 0ustarmbouschenstaff 0 0 # # 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. ############################# # TCK loggers and appenders ############################# # Root logger log4j.rootLogger = ERROR, TCK # TCK logger log4j.logger.org.apache.jdo.tck = INFO, TCK log4j.additivity.org.apache.jdo.tck = false # SpringFramework loggers log4j.logger.org.springframework = ERROR, TCK log4j.additivity.org.springframework = false log4j.logger.org.apache.jdo.tck.pc.company.CompanyModelReader = ERROR, TCK log4j.logger.org.apache.jdo.tck.pc.mylib.MylibReader = ERROR, TCK # TCK appenders log4j.appender.TCK = org.apache.jdo.tck.util.TCKFileAppender log4j.appender.TCK.File = tck.txt log4j.appender.TCK.layout = org.apache.log4j.PatternLayout log4j.appender.TCK.layout.ConversionPattern = %d{HH:mm:ss,SSS} (%t) %-5p [%c] - %m%n ############################################ # JDO vendor specific loggers and appenders ############################################ #log4j.logger. = INFO #log4j.additivity. = false #log4j.appender. = org.apache.jdo.tck.util.TCKFileAppender #log4j.appender..File = .txt #log4j.appender..layout = org.apache.log4j.PatternLayout #log4j.appender..layout.ConversionPattern = %d{HH:mm:ss,SSS} (%t) %-5p [%c] - %m%n ################################### # DataNucleus loggers and appenders ################################### # DataNucleus loggers # For more details on DataNucleus logging see # http://www.datanucleus.org/products/accessplatform/logging.html log4j.logger.DataNucleus = INFO, DataNucleus log4j.logger.DataNucleus.Enhancer = INFO, DataNucleus log4j.additivity.DataNucleus = false #log4j.logger.DataNucleus.JDO = INFO, DataNucleus #log4j.logger.DataNucleus.Persistence = INFO, DataNucleus #log4j.logger.DataNucleus.Query = INFO, DataNucleus #log4j.logger.DataNucleus.Lifecycle = INFO, DataNucleus #log4j.logger.DataNucleus.Reachability = INFO, DataNucleus #log4j.logger.DataNucleus.Cache = INFO, DataNucleus #log4j.logger.DataNucleus.ClassLoading = INFO, DataNucleus #log4j.logger.DataNucleus.MetaData = DEBUG, DataNucleus #log4j.logger.DataNucleus.Management = DEBUG, DataNucleus #log4j.logger.DataNucleus.General = DEBUG, DataNucleus #log4j.logger.DataNucleus.Connection = DEBUG, DataNucleus #log4j.logger.DataNucleus.JCA = DEBUG, DataNucleus #log4j.logger.DataNucleus.Transaction = INFO, DataNucleus #log4j.logger.DataNucleus.Plugin = INFO, DataNucleus #log4j.logger.DataNucleus.Store.Poid = INFO, DataNucleus #log4j.logger.DataNucleus.Datastore = DEBUG, DataNucleus #log4j.logger.DataNucleus.Datastore.Schema = INFO, DataNucleus #log4j.logger.DataNucleus.Datastore.Persist = INFO, DataNucleus #log4j.logger.DataNucleus.Datastore.Retrieve = DEBUG, DataNucleus #log4j.logger.DataNucleus.SchemaTool = INFO, DataNucleus # C3P0 loggers log4j.logger.com.mchange.v2 = INFO, DataNucleus log4j.additivity.com.mchange.v2 = false # DataNucleus appenders log4j.appender.DataNucleus = org.apache.jdo.tck.util.TCKFileAppender #log4j.appender.DataNucleus = org.apache.log4j.FileAppender log4j.appender.DataNucleus.Enhancer.File = datanucleus.txt log4j.appender.DataNucleus.File = datanucleus.txt log4j.appender.DataNucleus.layout = org.apache.log4j.PatternLayout log4j.appender.DataNucleus.layout.ConversionPattern = %d{HH:mm:ss,SSS} (%t) %-5p [%c] - %m%n tck/src/ 40775 0 12500110374 12343 5ustarmbouschenstaff 0 0 tck/src/conf/ 40775 0 12500110374 13270 5ustarmbouschenstaff 0 0 tck/src/java/ 40775 0 12500110372 13262 5ustarmbouschenstaff 0 0 tck/src/java/org/ 40775 0 12500110372 14051 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/ 40775 0 12500110372 15272 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/ 40775 0 12500110372 16046 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/ 40775 0 12500110374 16631 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/api/ 40775 0 12500110374 17402 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/api/exceptions/ 40775 0 12500110374 21563 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/api/fetchgroup/ 40775 0 12500110374 21550 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/api/instancecallbacks/ 40775 0 12500110374 23046 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/api/jdohelper/ 40775 0 12500110373 21355 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/api/persistencecapable/ 40775 0 12500110373 23235 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanager/ 40775 0 12500110374 23261 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanager/cache/ 40775 0 12500110374 24324 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanager/close/ 40775 0 12500110374 24366 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanager/detach/ 40775 0 12500110374 24511 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanager/extent/ 40775 0 12500110374 24570 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanager/fetchplan/ 40775 0 12500110374 25225 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanager/flags/ 40775 0 12500110374 24355 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanager/getobject/ 40775 0 12500110374 25227 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanager/lifecycle/ 40775 0 12500110374 25220 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanager/nullargs/ 40775 0 12500110374 25110 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanagerfactory/ 40775 0 12500110374 24651 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanagerfactory/config/ 40775 0 12500110374 26116 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanagerfactory/metadata/ 40775 0 12500110374 26431 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/enhancement/ 40775 0 12500110373 21115 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/extents/ 40775 0 12500110374 20323 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/lifecycle/ 40775 0 12500110374 20570 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/mapping/ 40775 0 12500110374 20264 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/models/ 40775 0 12500110373 20113 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/models/embedded/ 40775 0 12500110373 21644 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/models/fieldtypes/ 40775 0 12500110373 22263 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/models/inheritance/ 40775 0 12500110373 22404 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/pc/ 40775 0 12500110373 17232 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/pc/building/ 40775 0 12500110372 21026 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/pc/company/ 40775 0 12500110373 20700 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedFC/ 40775 0 12500110373 22747 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/ 40775 0 12500110372 23070 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPC/ 40775 0 12500110372 22760 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPI/ 40775 0 12500110372 22766 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/pc/companyListWithoutJoin/ 40775 0 12500110373 23740 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/pc/companyMapWithoutJoin/ 40775 0 12500110373 23542 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/pc/fieldtypes/ 40775 0 12500110373 21402 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/pc/inheritance/ 40775 0 12500110372 21522 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/pc/instancecallbacks/ 40775 0 12500110372 22675 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/pc/lifecycle/ 40775 0 12500110372 21170 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/pc/mylib/ 40775 0 12500110373 20346 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/pc/newInstance/ 40775 0 12500110373 21510 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/pc/order/ 40775 0 12500110373 20345 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/pc/query/ 40775 0 12500110372 20376 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/pc/shoppingcart/ 40775 0 12500110372 21732 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/pc/singlefieldidentity/ 40775 0 12500110372 23270 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/query/ 40775 0 12500110373 17775 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/query/api/ 40775 0 12500110373 20546 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/query/delete/ 40775 0 12500110373 21237 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/query/jdoql/ 40775 0 12500110373 21106 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/query/jdoql/keywords/ 40775 0 12500110373 22755 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/query/jdoql/methods/ 40775 0 12500110373 22551 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/query/jdoql/operators/ 40775 0 12500110373 23124 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/query/jdoql/parameters/ 40775 0 12500110373 23251 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/query/jdoql/subqueries/ 40775 0 12500110373 23275 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/query/jdoql/variables/ 40775 0 12500110373 23056 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/query/result/ 40775 0 12500110373 21313 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/query/result/classes/ 40775 0 12500110373 22750 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/query/sql/ 40775 0 12500110373 20574 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/transactions/ 40775 0 12500110373 21340 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/util/ 40775 0 12500110374 17606 5ustarmbouschenstaff 0 0 tck/src/java/org/apache/jdo/tck/util/signature/ 40775 0 12500110374 21607 5ustarmbouschenstaff 0 0 tck/src/jdo/ 40775 0 12500110372 13115 5ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/ 40775 0 12500110371 17171 5ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/ 40775 0 12500110371 17760 5ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/ 40775 0 12500110371 21201 5ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/ 40775 0 12500110371 21755 5ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/ 40775 0 12500110372 22537 5ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/api/ 40775 0 12500110371 23307 5ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/api/instancecallbacks/ 40775 0 12500110371 26753 5ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/ 40775 0 12500110372 23141 5ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/building/ 40775 0 12500110372 24736 5ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/company/ 40775 0 12500110371 24606 5ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/companyListWithoutJoin/ 40775 0 12500110371 27646 5ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/companyMapWithoutJoin/ 40775 0 12500110371 27450 5ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/ 40775 0 12500110371 25310 5ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/inheritance/ 40775 0 12500110371 25431 5ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/instancecallbacks/ 40775 0 12500110372 26605 5ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/lifecycle/ 40775 0 12500110372 25100 5ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/mylib/ 40775 0 12500110372 24255 5ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/newInstance/ 40775 0 12500110372 25417 5ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/order/ 40775 0 12500110371 24253 5ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/query/ 40775 0 12500110371 24305 5ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/shoppingcart/ 40775 0 12500110372 25642 5ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/singlefieldidentity/ 40775 0 12500110372 27200 5ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/ 40775 0 12500110372 16655 5ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/ 40775 0 12500110372 17444 5ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/ 40775 0 12500110372 20665 5ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/ 40775 0 12500110372 21441 5ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/ 40775 0 12500110372 22222 5ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/api/ 40775 0 12500110372 22773 5ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/api/instancecallbacks/ 40775 0 12500110372 26437 5ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/ 40775 0 12500110372 22624 5ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/building/ 40775 0 12500110372 24421 5ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/company/ 40775 0 12500110372 24272 5ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/companyListWithoutJoin/ 40775 0 12500110372 27332 5ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/companyMapWithoutJoin/ 40775 0 12500110372 27134 5ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/ 40775 0 12500110372 24774 5ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/inheritance/ 40775 0 12500110372 25115 5ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/instancecallbacks/ 40775 0 12500110372 26270 5ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/lifecycle/ 40775 0 12500110372 24563 5ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/mylib/ 40775 0 12500110372 23740 5ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/newInstance/ 40775 0 12500110372 25102 5ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/order/ 40775 0 12500110372 23737 5ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/query/ 40775 0 12500110372 23771 5ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/shoppingcart/ 40775 0 12500110372 25325 5ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/singlefieldidentity/ 40775 0 12500110372 26663 5ustarmbouschenstaff 0 0 tck/src/main/ 40775 0 12500110374 13267 5ustarmbouschenstaff 0 0 tck/src/main/resources/ 40775 0 12500110374 15301 5ustarmbouschenstaff 0 0 tck/src/main/resources/META-INF/ 40775 0 12500110374 16441 5ustarmbouschenstaff 0 0 tck/src/orm/ 40775 0 12500110372 13136 5ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/ 40775 0 12500110372 17213 5ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/ 40775 0 12500110372 20002 5ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/ 40775 0 12500110372 21223 5ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/ 40775 0 12500110372 21777 5ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/ 40775 0 12500110372 22560 5ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/api/ 40775 0 12500110372 23331 5ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/api/instancecallbacks/ 40775 0 12500110372 26775 5ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/ 40775 0 12500110372 23162 5ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/building/ 40775 0 12500110372 24757 5ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/company/ 40775 0 12500110372 24630 5ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/companyAnnotatedFC/ 40775 0 12500110372 26677 5ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/companyListWithoutJoin/ 40775 0 12500110372 27670 5ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/companyMapWithoutJoin/ 40775 0 12500110372 27472 5ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/ 40775 0 12500110372 25332 5ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/inheritance/ 40775 0 12500110372 25453 5ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/instancecallbacks/ 40775 0 12500110372 26626 5ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/lifecycle/ 40775 0 12500110372 25121 5ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/mylib/ 40775 0 12500110372 24276 5ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/newInstance/ 40775 0 12500110372 25440 5ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/order/ 40775 0 12500110372 24275 5ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/query/ 40775 0 12500110372 24327 5ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/shoppingcart/ 40775 0 12500110372 25663 5ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/singlefieldidentity/ 40775 0 12500110372 27221 5ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/ 40775 0 12500110372 16676 5ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/ 40775 0 12500110372 17465 5ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/ 40775 0 12500110372 20706 5ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/ 40775 0 12500110372 21462 5ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/ 40775 0 12500110372 22243 5ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/api/ 40775 0 12500110372 23014 5ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/api/instancecallbacks/ 40775 0 12500110372 26460 5ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/ 40775 0 12500110372 22645 5ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/building/ 40775 0 12500110372 24442 5ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/company/ 40775 0 12500110372 24313 5ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/companyAnnotatedFC/ 40775 0 12500110372 26362 5ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/companyListWithoutJoin/ 40775 0 12500110372 27353 5ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/companyMapWithoutJoin/ 40775 0 12500110372 27155 5ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/ 40775 0 12500110372 25015 5ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/inheritance/ 40775 0 12500110372 25136 5ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/instancecallbacks/ 40775 0 12500110372 26311 5ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/lifecycle/ 40775 0 12500110372 24604 5ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/mylib/ 40775 0 12500110372 23761 5ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/newInstance/ 40775 0 12500110372 25123 5ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/query/ 40775 0 12500110372 24012 5ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/shoppingcart/ 40775 0 12500110372 25346 5ustarmbouschenstaff 0 0 tck/src/sql/ 40775 0 12500110372 13140 5ustarmbouschenstaff 0 0 tck/src/sql/derby/ 40775 0 12500110372 14245 5ustarmbouschenstaff 0 0 tck/src/sql/derby/applicationidentity/ 40775 0 12500110372 20322 5ustarmbouschenstaff 0 0 tck/src/sql/derby/datastoreidentity/ 40775 0 12500110372 20005 5ustarmbouschenstaff 0 0 tck/src/testdata/ 40775 0 12500110374 14154 5ustarmbouschenstaff 0 0 tck/src/testdata/org/ 40775 0 12500110374 14743 5ustarmbouschenstaff 0 0 tck/src/testdata/org/apache/ 40775 0 12500110374 16164 5ustarmbouschenstaff 0 0 tck/src/testdata/org/apache/jdo/ 40775 0 12500110374 16740 5ustarmbouschenstaff 0 0 tck/src/testdata/org/apache/jdo/tck/ 40775 0 12500110374 17521 5ustarmbouschenstaff 0 0 tck/src/testdata/org/apache/jdo/tck/pc/ 40775 0 12500110374 20123 5ustarmbouschenstaff 0 0 tck/src/testdata/org/apache/jdo/tck/pc/company/ 40775 0 12500110374 21571 5ustarmbouschenstaff 0 0 tck/src/testdata/org/apache/jdo/tck/pc/companyListWithoutJoin/ 40775 0 12500110374 24631 5ustarmbouschenstaff 0 0 tck/src/testdata/org/apache/jdo/tck/pc/companyMapWithoutJoin/ 40775 0 12500110374 24433 5ustarmbouschenstaff 0 0 tck/src/testdata/org/apache/jdo/tck/pc/mylib/ 40775 0 12500110374 21237 5ustarmbouschenstaff 0 0 tck/src/testdata/org/apache/jdo/tck/pc/order/ 40775 0 12500110374 21236 5ustarmbouschenstaff 0 0 tck/src/uml/ 40775 0 12500110372 13136 5ustarmbouschenstaff 0 0 tck/src/uml/org/ 40775 0 12500110372 13725 5ustarmbouschenstaff 0 0 tck/src/uml/org/apache/ 40775 0 12500110372 15146 5ustarmbouschenstaff 0 0 tck/src/uml/org/apache/jdo/ 40775 0 12500110372 15722 5ustarmbouschenstaff 0 0 tck/src/uml/org/apache/jdo/tck/ 40775 0 12500110372 16503 5ustarmbouschenstaff 0 0 tck/src/uml/org/apache/jdo/tck/pc/ 40775 0 12500110372 17105 5ustarmbouschenstaff 0 0 tck/src/uml/org/apache/jdo/tck/pc/shoppingcart/ 40775 0 12500110372 21606 5ustarmbouschenstaff 0 0 tck/pom.xml100664 16764 12500110374 13224 0ustarmbouschenstaff 0 0 org.apache.jdo parent-pom 3.1 ../parent-pom 4.0.0 org.apache.jdo jdo-tck 3.1 JDO Technology Compatibility Kit (TCK) The Java Data Objects (JDO) API is a standard interface-based Java model abstraction of persistence, developed as Java Specification Request JSR 243 under the auspices of the Java Community Process. The JDO TCK is a test suite designed to test implementations of the Java Data Objects specification. In order to claim compatibility with JDO, an implementation must pass all relevant tests of the JDOTCK. NOTE!! There are no unit tests in this project. scm:svn:http://svn.apache.org/repos/asf/db/jdo/tags/jdo-3.1/3.1 scm:svn:https://svn.apache.org/repos/asf/db/jdo/tags/jdo-3.1/3.1 http://svn.apache.org/viewvc/db/jdo/tags/jdo-3.1/3.1 src/java META-INF src/main/resources META-INF/NOTICE.txt ${basedir}/src/conf ${basedir}/src/jdo ${basedir}/src/orm ${basedir}/src/sql ${basedir}/src/testdata org.apache.jdo jdo-exectck 3.1 integration-test help installSchema enhance runtck maven-compiler-plugin 1.5 1.5 maven-jar-plugin maven-javadoc-plugin ${project.name} ${pom.currentVersion} ${project.name} ${pom.currentVersion} org.apache.maven.plugins maven-deploy-plugin 2.6 true iut jdo.tck.impl iut jdori true javax.jdo jdo-api junit junit commons-logging commons-logging javax.transaction transaction-api org.springframework spring-core org.springframework spring-beans org.eclipse.persistence javax.persistence maven-changes-plugin ${basedir}/xdocs/changes.xml maven-checkstyle-plugin ${basedir}/../jdo_checks.xml ${basedir}/../LICENSE.txt maven-clean-plugin 2.5 ${basedir} query.ser datanucleus.txt tck/RunRules.html100664 24472 12500110371 14344 0ustarmbouschenstaff 0 0 JDO 3.1 Technology Compatibility Kit Run Rules

Running the JDO 3.1 Technology Compatibility Kit



7-March-2015

Overview

In order to demonstrate compliance with the Java Data Objects specification, an implementation must successfully run all of the TCK tests that are not on the "excluded" list. The implementation is hereinafter referred to as the IUT (Implementation Under Test).

The results must be posted on a publicly accessible web site for examination by the public. The posting includes the output of the test run, which consists of multiple log files containing configuration information and test results. For an example of the required posting, please see http://db.apache.org/jdo/tck/final.

Prerequisites

In order to run the TCK, you must install Maven 2.x Maven http://maven.apache.org/ is the driver of the test programs.

You must test the IUT on all configurations that the IUT supports. This includes different hardware and operating systems, different versions of Java, and different datastores. The TCK supports Java versions 1.5 to 1.6.

Installation

Download the jdo.3.x-src.zip or jdo.3.x-src.gz file from the distribution location. Unpack the archive file into a directory of your choice. Follow the instructions in the root level README.html file for building and running the JDO TCK. Please take note of the following files:

    • Maven configuration file "pom.xml" in the top level directory and subprojects. These files must not be changed.

    • lib/ext - Copy the jar files fscontext.jar and providerutil.jar used by the JNDI tests into this directory. It is permitted to use a different JNDI implementation; see README.html for more information.

    • lib/iut - this directory is where the JDO implementation jars are installed. It is empty in the distribution. To use the maven target runtck (required for an implementation to prove compliance), copy the JDO implementation jar files into this directory. Alternatively, update the build.properties file in the TCK directory to refer to an existing location of the IUT jar files.

    • the TCK directory, which contains:

      • assertions - contains the assertions file identifying the assertions tested by the tests. This is for reference.

      • target - this directory contains artifacts of compiling and running the tests. It does not exist in the distribution and will be created by the maven build process.

      • src - this directory contains the test configuration files and directories:

        • testdata - this directory contains data (represented as .xml files) loaded into the datastore for tests. These files must not be modified.

        • sql - this directory contains DDL to define the tables used in the tests. The files distributed must not be modified. Files may be created for databases for which the DDL for the database under test is not provided.

        • jdo - this directory contains .jdo metadata files for the persistent classes used in the tests. These files must not be modified.

        • orm - this directory contains .orm metadata files to map the persistent classes to the sql tables. These files must not be modified except to add DDL-generation information (which is not used by the TCK).

        • java - this directory contains the source code to the TCK tests. These files must not be modified.

        • conf - this directory contains the configuration information for the test runs. The files iut-pmf.properties, iut-jdoconfig.xml, and iut-persistence.xml in this directory must be changed to provide properties for the IUT persistence manager factory. The file jndi.properties may be changed to use a different jndi provider. Other files must not be modified, except to put a successfully challenged test case into the trunk/tck20/test/conf/exclude.list. Please see below.

Modifying the Configuration

The Implementation Under Test (IUT) can be installed into the lib/iut directory. Any jar files in this directory are added to the class path used to run the tests.

There are properties in the build.properties file in the TCK directory that must be changed to configure the IUT execution and enhancement (optional) environment. These properties begin with iut.runtck and iut.enhancer.

There is are three properties files that must be modified to be IUT-specific, all located in the TCK src/conf directory. The iut-pmf.properties file contains information used to construct the PersistenceManagerFactory used in the tests. iut-jdoconfig.xml and iut-persistence.xml also contain PersistenceManagerFactory properties used only in tests in the org.apache.jdo.tck.api.persistencemanagerfactory.config package.

SQL DDL files are provided for the sql table definitions. The existing files must not be changed, but files may be added in the directory in order to provide DDL for additional databases supported by the JDO implementation under test.

Running the Tests

Follow the instructions in README.html for running the TCK on the JDO Reference Implementation and the Implementation Under Test. This will produce console output plus a directory in the tck/target/logs directory whose name contains the date/time the tests were started. This directory contains the output of the tests. This is the directory to be published.

Some of the TCK tests require the implementation to support up to 20 instances of PersistenceManager with open transactions simultaneously.

Debugging the IUT while Running TCK tests

Execute "mvn jdo-exectck:help" in the TCK directory in order to get information on running the TCK tests with a debugger. In particular, properties jdo.tck.cleanupaftertest, jdo.tck.cfglist, jdo.tck.identitytypes, and jdo.tck.dblist may be useful.

If you make a change to the IUT enhancer while debugging the TCK tests (for implementations that use an enhancer) you must remove the target/classes directory before continuing in order to make sure that the classes are re-enhanced by the changed code.

Publishing the Results of the TCK Tests

With a successful test run, the log directory with the results of the tests must be published on a publicly-available web site. The unmodified directory is the self-certification of the successful TCK test run.

First Level TCK Appeals Process

If any test does not pass on the JDO implementation under test, this may be due to an error in the implementation or in the TCK test. If you believe that the failure is due to an error in the TCK test, you may challenge the test. To do so, send email to: jdo-dev@db.apache.org with a subject line containing "CHALLENGE" and the name of the test program, e.g. org.apache.jdo.tck.api.persistencemanager.ThreadSafe.java; and the body of the email containing the details of the challenge.

The Maintenance Lead will respond within 15 working days with a decision on whether there is an error in the test case. If the issue is found by the Maintenance Lead to be due to an error in the test case, the Maintenance Lead might patch the erroneous test or add the test to the exclude list. The user can obtain the TCK updates by checking out the latest minor version branch, 3.n.1. If a fix is not provided within 15 working days of the receipt of the challenge, then the user may put the test into the TCK file src/conf/exclude.list and it will not be run as part of the TCK.

Decisions of the Maintenance Lead may be appealed to the full expert group. A vote of the full expert group will be conducted by the Maintenance Lead, and a majority of votes cast will decide the issue. The Maintenance Lead has one vote, as does each member of the expert group at the time of the vote.

tck/src/conf/applicationidentity.conf100664 1714 12500110374 20314 0ustarmbouschenstaff 0 0 # 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. # either datastoreidentity or applicationidentity jdo.tck.identitytype = applicationidentity jdo.tck.testclasses = ${jdo.tck.alltests} jdo.tck.schema = schema1.sql jdo.tck.requiredOptions = tck/src/conf/commons-logging.properties100664 3351 12500110374 20604 0ustarmbouschenstaff 0 0 # # 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 is a sample apache commons logging configuration file defining logging # properties for the JDO TCK. It defines what logging implementation # the apache commons logging API should use by specifying the property # org.apache.commons.logging.Log (see below). Please note, that there are # separate property files for each logging implementation to set the log # level of the loggers: # - SimpleLog: simplelog.properties # - JDK1.4 logging: logging.properties # # The JDO TCK test cases use the following logger instance: # org.apache.jdo.tck # # Uncomment the next line if you want to use the apache simple logger #org.apache.commons.logging.Log = org.apache.commons.logging.impl.SimpleLog # Uncomment the next line if you want to use JDK 1.4 logging #org.apache.commons.logging.Log = org.apache.jdo.tck.util.JDOJdk14Logger # Uncomment the next line if you want to use Log4j logging org.apache.commons.logging.Log = org.apache.commons.logging.impl.Log4JLogger tck/src/conf/company1-1Relationships.conf100664 2117 12500110374 20667 0ustarmbouschenstaff 0 0 # 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 = Completeness test with standard mapping, basic testdata with 1-1 relationships. jdo.tck.mapping.companyfactory = jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest jdo.tck.testdata = org/apache/jdo/tck/pc/company/company1-1Relationships.xml jdo.tck.mapping = 0 jdo.tck.requiredOptions = tck/src/conf/company1-MRelationships.conf100664 2117 12500110374 20723 0ustarmbouschenstaff 0 0 # 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 = Completeness test with standard mapping, basic testdata with 1-M relationships. jdo.tck.mapping.companyfactory = jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest jdo.tck.testdata = org/apache/jdo/tck/pc/company/company1-MRelationships.xml jdo.tck.mapping = 0 jdo.tck.requiredOptions = tck/src/conf/companyAllRelationships.conf100664 2146 12500110374 21103 0ustarmbouschenstaff 0 0 # 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 = Completeness test with standard mapping, basic testdata with all relationships \ and embedded objects. jdo.tck.mapping.companyfactory = jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyAllRelationships.xml jdo.tck.mapping = 0 jdo.tck.requiredOptions = tck/src/conf/companyAnnotated1-1RelationshipsFCPM.conf100664 2252 12500110374 23173 0ustarmbouschenstaff 0 0 # 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 = Completeness test with standard mapping, basic testdata with 1-1 relationships, annotations. jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.companyAnnotatedFC.CompanyFactoryAnnotatedFCPMDelegator jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest jdo.tck.testdata = org/apache/jdo/tck/pc/company/company1-1Relationships.xml jdo.tck.mapping = 0 jdo.tck.requiredOptions = tck/src/conf/companyAnnotated1-MRelationshipsFCPM.conf100664 2252 12500110374 23227 0ustarmbouschenstaff 0 0 # 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 = Completeness test with standard mapping, basic testdata with 1-M relationships, annotations. jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.companyAnnotatedFC.CompanyFactoryAnnotatedFCPMDelegator jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest jdo.tck.testdata = org/apache/jdo/tck/pc/company/company1-MRelationships.xml jdo.tck.mapping = 0 jdo.tck.requiredOptions = tck/src/conf/companyAnnotatedAllRelationshipsFCConcrete.conf100664 2307 12500110374 24634 0ustarmbouschenstaff 0 0 # 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 = Completeness test with standard mapping, basic testdata with all relationships \ and embedded objects, annotations. jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.companyAnnotatedFC.CompanyFactoryAnnotatedFCConcreteDelegator jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyAllRelationships.xml jdo.tck.mapping = 0 jdo.tck.requiredOptions = tck/src/conf/companyAnnotatedAllRelationshipsFCPM.conf100664 2301 12500110374 23400 0ustarmbouschenstaff 0 0 # 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 = Completeness test with standard mapping, basic testdata with all relationships \ and embedded objects, annotations. jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.companyAnnotatedFC.CompanyFactoryAnnotatedFCPMDelegator jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyAllRelationships.xml jdo.tck.mapping = 0 jdo.tck.requiredOptions = tck/src/conf/companyAnnotatedAllRelationshipsJPAConcrete.conf100664 2257 12500110374 24762 0ustarmbouschenstaff 0 0 # 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 = Completeness test with standard mapping, basic testdata with M-M relationships, annotations. jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.companyAnnotatedJPA.CompanyFactoryAnnotatedJPAAppConcrete jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTestJPA jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyAllRelationships.xml jdo.tck.mapping = 0 jdo.tck.requiredOptions = tck/src/conf/companyAnnotatedAllRelationshipsJPAPM.conf100664 2300 12500110374 23521 0ustarmbouschenstaff 0 0 # 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 = Completeness test with standard mapping, basic testdata with all relationships \ and embedded objects, annotations. jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.companyAnnotatedJPA.CompanyFactoryAnnotatedJPAAppPM jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTestJPA jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyAllRelationships.xml jdo.tck.mapping = 0 jdo.tck.requiredOptions = tck/src/conf/companyAnnotatedAllRelationshipsPCConcrete.conf100664 2307 12500110374 24646 0ustarmbouschenstaff 0 0 # 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 = Completeness test with standard mapping, basic testdata with all relationships \ and embedded objects, annotations. jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.companyAnnotatedPC.CompanyFactoryAnnotatedPCConcreteDelegator jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyAllRelationships.xml jdo.tck.mapping = 0 jdo.tck.requiredOptions = tck/src/conf/companyAnnotatedAllRelationshipsPCPM.conf100664 2301 12500110374 23412 0ustarmbouschenstaff 0 0 # 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 = Completeness test with standard mapping, basic testdata with all relationships \ and embedded objects, annotations. jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.companyAnnotatedPC.CompanyFactoryAnnotatedPCPMDelegator jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyAllRelationships.xml jdo.tck.mapping = 0 jdo.tck.requiredOptions = tck/src/conf/companyAnnotatedAllRelationshipsPIPM.conf100664 2234 12500110374 23425 0ustarmbouschenstaff 0 0 # 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 = Completeness test with standard mapping, basic testdata with no relationships. jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.companyAnnotatedPI.CompanyFactoryAnnotatedPIPMDelegator jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyAllRelationships.xml jdo.tck.mapping = 0 jdo.tck.requiredOptions = tck/src/conf/companyAnnotatedEmbeddedFCPM.conf100664 2270 12500110374 21621 0ustarmbouschenstaff 0 0 # 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 = Completeness test with standard mapping, basic testdata with no relationships \ and embedded objects, annotations. jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.companyAnnotatedFC.CompanyFactoryAnnotatedFCPMDelegator jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyEmbedded.xml jdo.tck.mapping = 0 jdo.tck.requiredOptions = tck/src/conf/companyAnnotatedEmbeddedJPAConcrete.conf100664 2231 12500110374 23166 0ustarmbouschenstaff 0 0 # 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 = Completeness test with standard mapping, basic testdata with no relationships. jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.companyAnnotatedJPA.CompanyFactoryAnnotatedJPAAppConcrete jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTestJPA jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyEmbedded.xml jdo.tck.mapping = 0 jdo.tck.requiredOptions = tck/src/conf/companyAnnotatedEmbeddedJPAPM.conf100664 2270 12500110374 21743 0ustarmbouschenstaff 0 0 # 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 = Completeness test with standard mapping, basic testdata with all relationships \ and embedded objects, annotations. jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.companyAnnotatedJPA.CompanyFactoryAnnotatedJPAAppPM jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTestJPA jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyEmbedded.xml jdo.tck.mapping = 0 jdo.tck.requiredOptions = tck/src/conf/companyAnnotatedM-MRelationshipsFCConcrete.conf100664 2260 12500110374 24510 0ustarmbouschenstaff 0 0 # 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 = Completeness test with standard mapping, basic testdata with M-M relationships, annotations. jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.companyAnnotatedFC.CompanyFactoryAnnotatedFCConcreteDelegator jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyM-MRelationships.xml jdo.tck.mapping = 0 jdo.tck.requiredOptions = tck/src/conf/companyAnnotatedM-MRelationshipsFCPM.conf100664 2252 12500110374 23263 0ustarmbouschenstaff 0 0 # 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 = Completeness test with standard mapping, basic testdata with M-M relationships, annotations. jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.companyAnnotatedFC.CompanyFactoryAnnotatedFCPMDelegator jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyM-MRelationships.xml jdo.tck.mapping = 0 jdo.tck.requiredOptions = tck/src/conf/companyAnnotatedNoRelationshipsFCConcrete.conf100664 2241 12500110374 24475 0ustarmbouschenstaff 0 0 # 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 = Completeness test with standard mapping, basic testdata with no relationships. jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.companyAnnotatedFC.CompanyFactoryAnnotatedFCConcreteDelegator jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyNoRelationships.xml jdo.tck.mapping = 0 jdo.tck.requiredOptions = tck/src/conf/companyAnnotatedNoRelationshipsFCPM.conf100664 2233 12500110374 23250 0ustarmbouschenstaff 0 0 # 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 = Completeness test with standard mapping, basic testdata with no relationships. jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.companyAnnotatedFC.CompanyFactoryAnnotatedFCPMDelegator jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyNoRelationships.xml jdo.tck.mapping = 0 jdo.tck.requiredOptions = tck/src/conf/companyAnnotatedNoRelationshipsPCConcrete.conf100664 2241 12500110374 24507 0ustarmbouschenstaff 0 0 # 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 = Completeness test with standard mapping, basic testdata with no relationships. jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.companyAnnotatedPC.CompanyFactoryAnnotatedPCConcreteDelegator jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyNoRelationships.xml jdo.tck.mapping = 0 jdo.tck.requiredOptions = tck/src/conf/companyAnnotatedNoRelationshipsPCPM.conf100664 2233 12500110374 23262 0ustarmbouschenstaff 0 0 # 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 = Completeness test with standard mapping, basic testdata with no relationships. jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.companyAnnotatedPC.CompanyFactoryAnnotatedPCPMDelegator jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyNoRelationships.xml jdo.tck.mapping = 0 jdo.tck.requiredOptions = tck/src/conf/companyAnnotatedNoRelationshipsPIPM.conf100664 2233 12500110374 23270 0ustarmbouschenstaff 0 0 # 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 = Completeness test with standard mapping, basic testdata with no relationships. jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.companyAnnotatedPI.CompanyFactoryAnnotatedPIPMDelegator jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyNoRelationships.xml jdo.tck.mapping = 0 jdo.tck.requiredOptions = tck/src/conf/companyEmbedded.conf100664 2135 12500110374 17315 0ustarmbouschenstaff 0 0 # 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 = Completeness test with standard mapping, basic testdata with no relationships \ and embedded objects. jdo.tck.mapping.companyfactory = jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyEmbedded.xml jdo.tck.mapping = 0 jdo.tck.requiredOptions = tck/src/conf/companyListWithoutJoin.conf100664 2243 12500110374 20743 0ustarmbouschenstaff 0 0 # 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 = Completeness test with companyListWithoutJoin model. jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.companyListWithoutJoin.CompanyFactoryPMClass jdo.tck.testdata = org/apache/jdo/tck/pc/companyListWithoutJoin/companyListWithoutJoin.xml jdo.tck.standarddata = jdo.tck.mapping = 10 jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTestList jdo.tck.requiredOptions = tck/src/conf/companyM-MRelationships.conf100664 2117 12500110374 20757 0ustarmbouschenstaff 0 0 # 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 = Completeness test with standard mapping, basic testdata with M-M relationships. jdo.tck.mapping.companyfactory = jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyM-MRelationships.xml jdo.tck.mapping = 0 jdo.tck.requiredOptions = tck/src/conf/companyMapWithoutJoin.conf100664 2235 12500110374 20546 0ustarmbouschenstaff 0 0 # 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 = Completeness test with companyMapWithoutJoin model. jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.companyMapWithoutJoin.CompanyFactoryPMClass jdo.tck.testdata = org/apache/jdo/tck/pc/companyMapWithoutJoin/companyMapWithoutJoin.xml jdo.tck.standarddata = jdo.tck.mapping = 9 jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTestMap jdo.tck.requiredOptions = tck/src/conf/companyNoRelationships.conf100664 2115 12500110374 20743 0ustarmbouschenstaff 0 0 # 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 = Completeness test with standard mapping, basic testdata with no relationships. jdo.tck.mapping.companyfactory = jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyNoRelationships.xml jdo.tck.mapping = 0 jdo.tck.requiredOptions = tck/src/conf/companyOverrideAnnotatedAllRelationshipsFCPM.conf100664 2323 12500110374 25104 0ustarmbouschenstaff 0 0 # 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 = Completeness test with mapping 11 overriding annotations, basic testdata with all relationships \ and embedded objects, annotations. jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.companyAnnotatedFC.CompanyFactoryAnnotatedFCPMDelegator jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyAllRelationships.xml jdo.tck.mapping = 11 jdo.tck.requiredOptions = tck/src/conf/companyPMClass.conf100664 2232 12500110374 17124 0ustarmbouschenstaff 0 0 # 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 = Completeness test with standard mapping, basic testdata with all relationships \ and embedded objects. jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.company.CompanyFactoryPMClass jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyAllRelationships.xml jdo.tck.mapping = 0 jdo.tck.requiredOptions = tck/src/conf/companyPMInterface.conf100664 2236 12500110374 17763 0ustarmbouschenstaff 0 0 # 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 = Completeness test with standard mapping, basic testdata with all relationships \ and embedded objects. jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.company.CompanyFactoryPMInterface jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyAllRelationships.xml jdo.tck.mapping = 0 jdo.tck.requiredOptions = tck/src/conf/compoundIdentity.conf100664 2167 12500110374 17600 0ustarmbouschenstaff 0 0 # 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 = Completeness test with standard mapping using order model for compound identity testing jdo.tck.mapping.companyfactory = org.apache.jdo.tck.pc.order.OrderFactoryPMClass jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTestOrder jdo.tck.testdata = org/apache/jdo/tck/pc/order/order.xml jdo.tck.mapping = 0 jdo.tck.requiredOptions = tck/src/conf/configurations.list100664 7001 12500110374 17312 0ustarmbouschenstaff 0 0 # 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.cfglist = \ runonce.conf \ instancecallbacks.conf \ jdohelper.conf \ pm.conf \ pmf.conf \ detach.conf \ embeddedInheritance.conf \ enhancement.conf \ extents.conf \ fetchplan.conf \ fetchgroup.conf \ lifecycle.conf \ models.conf \ models1.conf \ query.conf \ jdoql.conf \ jdoql1.conf \ transactions.conf \ companyNoRelationships.conf \ companyEmbedded.conf \ company1-1Relationships.conf \ company1-MRelationships.conf \ companyM-MRelationships.conf \ companyAllRelationships.conf \ companyMapWithoutJoin.conf \ companyListWithoutJoin.conf \ companyPMClass.conf \ companyPMInterface.conf \ companyAnnotated1-1RelationshipsFCPM.conf \ companyAnnotated1-MRelationshipsFCPM.conf \ companyAnnotatedAllRelationshipsFCConcrete.conf \ companyAnnotatedAllRelationshipsFCPM.conf \ companyAnnotatedAllRelationshipsPCConcrete.conf \ companyAnnotatedAllRelationshipsJPAConcrete.conf \ companyAnnotatedAllRelationshipsJPAPM.conf \ companyAnnotatedAllRelationshipsPCPM.conf \ companyAnnotatedAllRelationshipsPIPM.conf \ companyAnnotatedEmbeddedFCPM.conf \ companyAnnotatedM-MRelationshipsFCConcrete.conf \ companyAnnotatedM-MRelationshipsFCPM.conf \ companyAnnotatedNoRelationshipsFCConcrete.conf \ companyAnnotatedNoRelationshipsFCPM.conf \ companyAnnotatedNoRelationshipsPCConcrete.conf \ companyAnnotatedEmbeddedJPAConcrete.conf \ companyAnnotatedEmbeddedJPAPM.conf \ companyAnnotatedNoRelationshipsPCPM.conf \ companyAnnotatedNoRelationshipsPIPM.conf \ companyOverrideAnnotatedAllRelationshipsFCPM.conf \ inheritance1.conf \ inheritance2.conf \ inheritance3.conf \ inheritance4.conf \ relationshipAllRelationships.conf \ relationshipNoRelationships.conf \ schemaAttributeClass.conf \ schemaAttributeOrm.conf \ schemaAttributePackage.conf \ compoundIdentity.conf \ throwOnUnknownStandardProperties.conf tck/src/conf/datastoreidentity.conf100664 1712 12500110374 17775 0ustarmbouschenstaff 0 0 # 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. # either datastoreidentity or applicationidentity jdo.tck.identitytype = datastoreidentity jdo.tck.testclasses = ${jdo.tck.alltests} jdo.tck.schema = schema2.sql jdo.tck.requiredOptions = tck/src/conf/derby.properties100664 5452 12500110374 16616 0ustarmbouschenstaff 0 0 # 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 flag must be set on Mac OSX #derby.storage.fileSyncTransactionLog=true #When this property is set to true, Derby writes the query plan information #into the derby.log file for all executed queries. #Default: false #derby.language.logQueryPlan=true #When this property is set to true, Derby writes the text and parameter values #of all executed statements to the information log at the beginning of #execution. It also writes information about commits and rollbacks. #Information includes the time and thread number. #Default: false #derby.language.logStatementText=true #Specifies name of the file to which the error log is written. #If the file name is relative, it is taken as relative to the system directory. #If this property is set, the derby.stream.error.method and #derby.stream.error.field properties are ignored. #Default: derby.log derby.stream.error.file=../../logs/database/derby.txt #Specifies which errors are logged to the Derby error log #(typically the derby.log file). In test environments, use the setting #derby.stream.error.logSeverityLevel=0 so that all problems are reported. #Any error raised in a Derby system is given a level of severity. #This property indicates the minimum severity necessary for an error to appear #in the error log. The severities are defined in the class #org.apache.derby.types.ExceptionSeverity. #The higher the number, the more severe the error. #20000: Errors that cause the statement to be rolled back, #for example syntax errors and constraint violations. #30000: Errors that cause the transaction to be rolled back, #for example deadlocks. #40000: Errors that cause the connection to be closed. #50000: Errors that shut down the Derby system. #Default: 40000 #derby.stream.error.logSeverityLevel=0 #Specifies whether to append to or destroy and re-create the derby.log file, #which is used to record error and other information #when Derby starts up in a JVM. #You can set this property even if the file does not yet exist; #Derby creates the file. #Default: false derby.infolog.append=true tck/src/conf/detach.conf100664 3250 12500110374 15464 0ustarmbouschenstaff 0 0 # 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 = 8 jdo.tck.classes = \ org.apache.jdo.tck.api.jdohelper.IsDetached \ org.apache.jdo.tck.api.persistencemanager.detach.DetachAllOnCommit \ org.apache.jdo.tck.api.persistencemanager.detach.DetachAttach \ org.apache.jdo.tck.api.persistencemanager.detach.DetachAttachDirty \ org.apache.jdo.tck.api.persistencemanager.detach.DetachCopy \ org.apache.jdo.tck.api.persistencemanager.detach.DetachSerialize \ org.apache.jdo.tck.api.persistencemanager.detach.SetDetachAllOnCommit \ org.apache.jdo.tck.api.persistencemanager.detach.DetachUndetachable \ org.apache.jdo.tck.api.persistencemanager.detach.DetachAccessUnloadedField \ org.apache.jdo.tck.api.persistencemanager.detach.CopyOnAttachFalse jdo.tck.requiredOptions = tck/src/conf/detach.list100664 1500 12500110374 15506 0ustarmbouschenstaff 0 0 # 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.cfglist = \ detach.conf tck/src/conf/embeddedInheritance.conf100664 2045 12500110374 20140 0ustarmbouschenstaff 0 0 # 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 = tck/src/conf/enhancement-test.properties100664 2415 12500110374 20747 0ustarmbouschenstaff 0 0 # # 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. org.apache.jdo.tck.pc.inheritance=AllPersist,AllPersist2,AllPersist3,AllPersist4,FieldSameName,FieldSameName2,FieldSameName3,FieldSameName4,TopNonPersistB,TopNonPersistE,TopNonPersistF,TopNonPersistH,TopPersist,TopPersistE,TopPersistF,TopPersistH org.apache.jdo.tck.pc.company=Address,Company,DentalInsurance,Department,Employee,FullTimeEmployee,Insurance,MedicalInsurance,PartTimeEmployee,Person,Project org.apache.jdo.tck.pc.instancecallbacks=InstanceCallbackClass,InstanceCallbackNonPersistFdsClass tck/src/conf/enhancement.conf100664 2207 12500110374 16522 0ustarmbouschenstaff 0 0 # 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 = All enhancement, persistencecapable tests with standard mapping, no testdata. jdo.tck.mapping.companyfactory = jdo.tck.testdata = jdo.tck.standarddata = jdo.tck.mapping = 0 jdo.tck.requiredOptions = jdo.tck.classes = \ org.apache.jdo.tck.api.persistencecapable.CopyKeyFieldsFromObjectId \ org.apache.jdo.tck.api.persistencecapable.NewObjectIdInstance tck/src/conf/exclude.list100664 1440 12500110374 15712 0ustarmbouschenstaff 0 0 # 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.exclude = tck/src/conf/extents.conf100664 3271 12500110374 15731 0ustarmbouschenstaff 0 0 # 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 = All extent tests with standard mapping, no testdata. jdo.tck.mapping.companyfactory = jdo.tck.testdata = jdo.tck.standarddata = jdo.tck.mapping = 0 jdo.tck.requiredOptions = jdo.tck.classes = \ org.apache.jdo.tck.extents.CloseAll \ org.apache.jdo.tck.extents.CloseOfExtentIteratorIsIteratorSpecific \ org.apache.jdo.tck.extents.GetCandidateClass \ org.apache.jdo.tck.extents.GetPersistenceManager \ org.apache.jdo.tck.extents.HasSubclassesFalse \ org.apache.jdo.tck.extents.HasSubclassesTrue \ org.apache.jdo.tck.extents.InstancesDeletedPriorToIterationNotReturned \ org.apache.jdo.tck.extents.InstancesPersistedPriorToIterationReturned \ org.apache.jdo.tck.extents.IteratorHasNextFalseAfterExtentClose \ org.apache.jdo.tck.extents.IteratorMutatingMethods \ org.apache.jdo.tck.extents.IteratorNextAfterExtentClose \ org.apache.jdo.tck.extents.IteratorNextAfterExtentCloseAll \ org.apache.jdo.tck.extents.Iterators tck/src/conf/fetchgroup.conf100664 1767 12500110374 16415 0ustarmbouschenstaff 0 0 # 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 = FetchGroup test. jdo.tck.mapping.companyfactory = jdo.tck.testdata = jdo.tck.standarddata = jdo.tck.mapping = 0 jdo.tck.requiredOptions = jdo.tck.classes = \ org.apache.jdo.tck.api.fetchgroup.FetchGroupTest tck/src/conf/fetchplan.conf100664 2623 12500110374 16203 0ustarmbouschenstaff 0 0 # 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 = All pm tests with standard mapping, no testdata. jdo.tck.mapping.companyfactory = jdo.tck.testdata = jdo.tck.standarddata = jdo.tck.mapping = 0 jdo.tck.requiredOptions = jdo.tck.classes = \ org.apache.jdo.tck.api.persistencemanager.fetchplan.FetchPlanInterface \ org.apache.jdo.tck.api.persistencemanager.fetchplan.FetchPlanMakeTransient \ org.apache.jdo.tck.api.persistencemanager.fetchplan.FetchPlanQuery \ org.apache.jdo.tck.api.persistencemanager.fetchplan.FetchPlanRefresh \ org.apache.jdo.tck.api.persistencemanager.fetchplan.FetchPlanRetrieve \ org.apache.jdo.tck.api.persistencemanager.fetchplan.FetchPlanIsCopy tck/src/conf/inheritance1.conf100664 2401 12500110374 16603 0ustarmbouschenstaff 0 0 # 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 = Completeness test with inheritance mapping 1: \ Separate table for each class in the inheritance hierarchy. \ Each table contains columns for the declared fields. \ Inheritance strategy: new-table for all classes. jdo.tck.mapping.companyfactory = jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyAllRelationships.xml jdo.tck.mapping = 1 jdo.tck.requiredOptions = javax.jdo.option.mapping.JoinedTablePerClass tck/src/conf/inheritance2.conf100664 3215 12500110374 16610 0ustarmbouschenstaff 0 0 # 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 = Completeness test with inheritance mapping 2: \ Separate table for each class in the inheritance hierarchy. \ No tables for abstract classes. \ Each table contains columns for all fields. \ Managers, mentors, hradvisors, and employees of the month \ are fulltime employees. \ Only fulltime employees can have insurances, can be project members, \ and can be project reviewers. \ Separate phone number type tables for persons, fulltime employees, \ and parttime employees. \ Inheritance strategy: new-table for all classes. jdo.tck.mapping.companyfactory = jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyAllRelationships.xml jdo.tck.mapping = 2 jdo.tck.requiredOptions = javax.jdo.option.mapping.NonJoinedTablePerConcreteClass \ javax.jdo.option.mapping.RelationSubclassTable tck/src/conf/inheritance3.conf100664 2744 12500110374 16617 0ustarmbouschenstaff 0 0 # 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 = Completeness test with inheritance mapping 3: \ Person has inheritance strategy "new-table". \ Employee has inheritance strategy "subclass-table". \ PartTimeEmployee and FullTimeEmployee has inheritance strategy "new-table". \ Insurance has inheritance strategy "subclass-table". \ MedicalInsurance and DentalInsurance have inheritance strategy "new-table". jdo.tck.mapping.companyfactory = jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyAllRelationships.xml jdo.tck.mapping = 3 jdo.tck.requiredOptions = javax.jdo.option.mapping.JoinedTablePerConcreteClass \ javax.jdo.option.mapping.RelationSubclassTable tck/src/conf/inheritance4.conf100664 2362 12500110374 16614 0ustarmbouschenstaff 0 0 # 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 = Completeness test with inheritance mapping 4: \ Person, Employee, and Insurance have inheritance strategy "new-table". \ PartTimeEmployee, FullTimeEmployee, MedicalInsurance, and DentalInsurance \ have inheritance strategy "superclass-table". jdo.tck.mapping.companyfactory = jdo.tck.classes = org.apache.jdo.tck.mapping.CompletenessTest jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyAllRelationships.xml jdo.tck.mapping = 4 jdo.tck.requiredOptions = tck/src/conf/instancecallbacks.conf100664 4164 12500110374 17705 0ustarmbouschenstaff 0 0 # 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 = All instancecallback tests with standard mapping, no testdata. jdo.tck.mapping.companyfactory = jdo.tck.testdata = jdo.tck.standarddata = jdo.tck.mapping = 0 jdo.tck.requiredOptions = jdo.tck.classes = \ org.apache.jdo.tck.api.instancecallbacks.AccessOtherInstancesInPrestore \ org.apache.jdo.tck.api.instancecallbacks.AccessingFieldsInPredelete \ org.apache.jdo.tck.api.instancecallbacks.CallingJdoPostload \ org.apache.jdo.tck.api.instancecallbacks.CallingJdoPreclear \ org.apache.jdo.tck.api.instancecallbacks.CallingJdoPredelete \ org.apache.jdo.tck.api.instancecallbacks.CallingJdoPrestore \ org.apache.jdo.tck.api.instancecallbacks.InstanceLifecycleListenerAttach \ org.apache.jdo.tck.api.instancecallbacks.InstanceLifecycleListenerClear \ org.apache.jdo.tck.api.instancecallbacks.InstanceLifecycleListenerCreate \ org.apache.jdo.tck.api.instancecallbacks.InstanceLifecycleListenerDelete \ org.apache.jdo.tck.api.instancecallbacks.InstanceLifecycleListenerDetach \ org.apache.jdo.tck.api.instancecallbacks.InstanceLifecycleListenerDirty \ org.apache.jdo.tck.api.instancecallbacks.InstanceLifecycleListenerLoad \ org.apache.jdo.tck.api.instancecallbacks.InstanceLifecycleListenerStore \ org.apache.jdo.tck.api.instancecallbacks.ModificationOfNontransactionalNonpersistentFields \ org.apache.jdo.tck.api.instancecallbacks.NoAccessToFieldsAfterPredelete tck/src/conf/jdo-3_1-signatures.txt100664 241647 12500110374 17522 0ustarmbouschenstaff 0 0 /* * 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. */ public interface javax.jdo.Constants { static String JAVAX_JDO = "javax.jdo"; static String JAVAX_JDO_PREFIX = "javax.jdo."; static String SERVICE_LOOKUP_PMF_RESOURCE_NAME = "META-INF/services/javax.jdo.PersistenceManagerFactory"; static String SERVICE_LOOKUP_ENHANCER_RESOURCE_NAME = "META-INF/services/javax.jdo.JDOEnhancer"; static String JDOCONFIG_RESOURCE_NAME = "META-INF/jdoconfig.xml"; static String JDOCONFIG_XSD_NS = "http://java.sun.com/xml/ns/jdo/jdoconfig"; static String JDO_XSD_NS = "http://java.sun.com/xml/ns/jdo/jdo"; static String ORM_XSD_NS = "http://java.sun.com/xml/ns/jdo/orm"; static String JDOQUERY_XSD_NS = "http://java.sun.com/xml/ns/jdo/jdoquery"; static String ELEMENT_PERSISTENCE_MANAGER_FACTORY = "persistence-manager-factory"; static String PMF_ATTRIBUTE_CLASS = "class"; static String PMF_ATTRIBUTE_NAME = "name"; static String PMF_ATTRIBUTE_PERSISTENCE_UNIT_NAME = "persistence-unit-name"; static String PMF_ATTRIBUTE_OPTIMISTIC = "optimistic"; static String PMF_ATTRIBUTE_READONLY = "readonly"; static String PMF_ATTRIBUTE_RETAIN_VALUES = "retain-values"; static String PMF_ATTRIBUTE_RESTORE_VALUES = "restore-values"; static String PMF_ATTRIBUTE_IGNORE_CACHE = "ignore-cache"; static String PMF_ATTRIBUTE_NONTRANSACTIONAL_READ = "nontransactional-read"; static String PMF_ATTRIBUTE_NONTRANSACTIONAL_WRITE = "nontransactional-write"; static String PMF_ATTRIBUTE_MULTITHREADED = "multithreaded"; static String PMF_ATTRIBUTE_CONNECTION_DRIVER_NAME = "connection-driver-name"; static String PMF_ATTRIBUTE_CONNECTION_USER_NAME = "connection-user-name"; static String PMF_ATTRIBUTE_CONNECTION_PASSWORD = "connection-password"; static String PMF_ATTRIBUTE_CONNECTION_URL = "connection-url"; static String PMF_ATTRIBUTE_CONNECTION_FACTORY_NAME = "connection-factory-name"; static String PMF_ATTRIBUTE_CONNECTION_FACTORY2_NAME = "connection-factory2-name"; static String PMF_ATTRIBUTE_DETACH_ALL_ON_COMMIT = "detach-all-on-commit"; static String PMF_ATTRIBUTE_COPY_ON_ATTACH = "copy-on-attach"; static String PMF_ATTRIBUTE_MAPPING = "mapping"; static String PMF_ATTRIBUTE_SERVER_TIME_ZONE_ID = "server-time-zone-id"; static String PMF_ATTRIBUTE_DATASTORE_READ_TIMEOUT_MILLIS = "datastore-read-timeout-millis"; static String PMF_ATTRIBUTE_DATASTORE_WRITE_TIMEOUT_MILLIS = "datastore-write-timeout-millis"; static String ELEMENT_PROPERTY = "property"; static String PROPERTY_ATTRIBUTE_NAME = "name"; static String PROPERTY_ATTRIBUTE_VALUE = "value"; static String ELEMENT_INSTANCE_LIFECYCLE_LISTENER = "instance-lifecycle-listener"; static String INSTANCE_LIFECYCLE_LISTENER_ATTRIBUTE_LISTENER = "listener"; static String INSTANCE_LIFECYCLE_LISTENER_ATTRIBUTE_CLASSES = "classes"; static String OPTION_TRANSACTIONAL_TRANSIENT = "javax.jdo.option.TransientTransactional"; static String OPTION_NONTRANSACTIONAL_READ = "javax.jdo.option.NontransactionalRead"; static String OPTION_NONTRANSACTIONAL_WRITE = "javax.jdo.option.NontransactionalWrite"; static String OPTION_RETAIN_VALUES = "javax.jdo.option.RetainValues"; static String OPTION_OPTIMISTIC = "javax.jdo.option.Optimistic"; static String OPTION_APPLICATION_IDENTITY = "javax.jdo.option.ApplicationIdentity"; static String OPTION_DATASTORE_IDENTITY = "javax.jdo.option.DatastoreIdentity"; static String OPTION_NONDURABLE_IDENTITY = "javax.jdo.option.NonDurableIdentity"; static String OPTION_ARRAYLIST = "javax.jdo.option.ArrayList"; static String OPTION_LINKEDLIST = "javax.jdo.option.LinkedList"; static String OPTION_TREEMAP = "javax.jdo.option.TreeMap"; static String OPTION_TREESET = "javax.jdo.option.TreeSet"; static String OPTION_VECTOR = "javax.jdo.option.Vector"; static String OPTION_ARRAY = "javax.jdo.option.Array"; static String OPTION_NULL_COLLECTION = "javax.jdo.option.NullCollection"; static String OPTION_CHANGE_APPLICATION_IDENTITY = "javax.jdo.option.ChangeApplicationIdentity"; static String OPTION_BINARY_COMPATIBILITY = "javax.jdo.option.BinaryCompatibility"; static String OPTION_GET_DATASTORE_CONNECTION = "javax.jdo.option.GetDataStoreConnection"; static String OPTION_GET_JDBC_CONNECTION = "javax.jdo.option.GetJDBCConnection"; static String OPTION_DATASTORE_TIMEOUT = "javax.jdo.option.DatastoreTimeout"; static String OPTION_QUERY_SQL = "javax.jdo.query.SQL"; static String OPTION_QUERY_CANCEL = "javax.jdo.option.QueryCancel"; static String OPTION_UNCONSTRAINED_QUERY_VARIABLES = "javax.jdo.option.UnconstrainedQueryVariables"; static String OPTION_VERSION_DATETIME = "javax.jdo.option.version.DateTime"; static String OPTION_VERSION_STATE_IMAGE = "javax.jdo.option.version.StateImage"; static String OPTION_PREDIRTY_EVENT = "javax.jdo.option.PreDirtyEvent"; static String OPTION_MAPPING_HETEROGENEOUS_OBJECT_TYPE = "javax.jdo.option.mapping.HeterogeneousObjectType"; static String OPTION_MAPPING_HETEROGENEOUS_INTERFACE_TYPE = "javax.jdo.option.mapping.HeterogeneousInterfaceType"; static String OPTION_MAPPING_JOINED_TABLE_PER_CLASS = "javax.jdo.option.mapping.JoinedTablePerClass"; static String OPTION_MAPPING_JOINED_TABLE_PER_CONCRETE_CLASS = "javax.jdo.option.mapping.JoinedTablePerConcreteClass"; static String OPTION_MAPPING_NON_JOINED_TABLE_PER_CONCRETE_CLASS = "javax.jdo.option.mapping.NonJoinedTablePerConcreteClass"; static String OPTION_MAPPING_RELATION_SUBCLASS_TABLE = "javax.jdo.option.mapping.RelationSubclassTable"; static String PROPERTY_PERSISTENCE_MANAGER_FACTORY_CLASS = "javax.jdo.PersistenceManagerFactoryClass"; static String PROPERTY_OPTIMISTIC = "javax.jdo.option.Optimistic"; static String PROPERTY_READONLY = "javax.jdo.option.ReadOnly"; static String PROPERTY_RETAIN_VALUES = "javax.jdo.option.RetainValues"; static String PROPERTY_RESTORE_VALUES = "javax.jdo.option.RestoreValues"; static String PROPERTY_IGNORE_CACHE = "javax.jdo.option.IgnoreCache"; static String PROPERTY_NONTRANSACTIONAL_READ = "javax.jdo.option.NontransactionalRead"; static String PROPERTY_NONTRANSACTIONAL_WRITE = "javax.jdo.option.NontransactionalWrite"; static String PROPERTY_MULTITHREADED = "javax.jdo.option.Multithreaded"; static String PROPERTY_TRANSACTION_ISOLATION_LEVEL = "javax.jdo.option.TransactionIsolationLevel"; static String PROPERTY_TRANSACTION_ISOLATION_LEVEL_READ_UNCOMMITTED = "javax.jdo.option.TransactionIsolationLevel.read-uncommitted"; static String PROPERTY_TRANSACTION_ISOLATION_LEVEL_READ_COMMITTED = "javax.jdo.option.TransactionIsolationLevel.read-committed"; static String PROPERTY_TRANSACTION_ISOLATION_LEVEL_REPEATABLE_READ = "javax.jdo.option.TransactionIsolationLevel.repeatable-read"; static String PROPERTY_TRANSACTION_ISOLATION_LEVEL_SNAPSHOT = "javax.jdo.option.TransactionIsolationLevel.snapshot"; static String PROPERTY_TRANSACTION_ISOLATION_LEVEL_SERIALIZABLE = "javax.jdo.option.TransactionIsolationLevel.serializable"; static String PROPERTY_DETACH_ALL_ON_COMMIT = "javax.jdo.option.DetachAllOnCommit"; static String PROPERTY_COPY_ON_ATTACH = "javax.jdo.option.CopyOnAttach"; static String PROPERTY_CONNECTION_DRIVER_NAME = "javax.jdo.option.ConnectionDriverName"; static String PROPERTY_CONNECTION_USER_NAME = "javax.jdo.option.ConnectionUserName"; static String PROPERTY_CONNECTION_PASSWORD = "javax.jdo.option.ConnectionPassword"; static String PROPERTY_CONNECTION_URL = "javax.jdo.option.ConnectionURL"; static String PROPERTY_CONNECTION_FACTORY_NAME = "javax.jdo.option.ConnectionFactoryName"; static String PROPERTY_CONNECTION_FACTORY2_NAME = "javax.jdo.option.ConnectionFactory2Name"; static String PROPERTY_MAPPING = "javax.jdo.option.Mapping"; static String PROPERTY_NAME = "javax.jdo.option.Name"; static String PROPERTY_SPI_RESOURCE_NAME = "javax.jdo.option.spi.ResourceName"; static String PROPERTY_PERSISTENCE_UNIT_NAME = "javax.jdo.option.PersistenceUnitName"; static String PROPERTY_INSTANCE_LIFECYCLE_LISTENER = "javax.jdo.listener.InstanceLifecycleListener"; static String PROPERTY_PREFIX_INSTANCE_LIFECYCLE_LISTENER = "javax.jdo.listener.InstanceLifecycleListener."; static String PROPERTY_MAPPING_CATALOG = "javax.jdo.mapping.Catalog"; static String PROPERTY_MAPPING_SCHEMA = "javax.jdo.mapping.Schema"; static String PROPERTY_SERVER_TIME_ZONE_ID = "javax.jdo.option.ServerTimeZoneID"; static String PROPERTY_DATASTORE_READ_TIMEOUT_MILLIS = "javax.jdo.option.DatastoreReadTimeoutMillis"; static String PROPERTY_DATASTORE_WRITE_TIMEOUT_MILLIS = "javax.jdo.option.DatastoreWriteTimeoutMillis"; static String NONCONFIGURABLE_PROPERTY_VENDOR_NAME = "VendorName"; static String NONCONFIGURABLE_PROPERTY_VERSION_NUMBER = "VersionNumber"; static String JTA = "JTA"; static String RESOURCE_LOCAL = "RESOURCE_LOCAL"; static String JDOCONFIG_DTD_RESOURCE = "javax/jdo/jdoconfig_3_0.dtd"; static String JDOCONFIG_XSD_RESOURCE = "javax/jdo/jdoconfig_3_0.xsd"; static String JDO_DTD_RESOURCE = "javax/jdo/jdo_3_0.dtd"; static String JDO_XSD_RESOURCE = "javax/jdo/jdo_3_0.xsd"; static String ORM_DTD_RESOURCE = "javax/jdo/orm_3_0.dtd"; static String ORM_XSD_RESOURCE = "javax/jdo/orm_3_0.xsd"; static String JDOQUERY_DTD_RESOURCE = "javax/jdo/jdoquery_3_0.dtd"; static String JDOQUERY_XSD_RESOURCE = "javax/jdo/jdoquery_3_0.xsd"; static String ANONYMOUS_PERSISTENCE_MANAGER_FACTORY_NAME = ""; public static final String TX_READ_UNCOMMITTED = "read-uncommitted"; public static final String TX_READ_COMMITTED = "read-committed"; public static final String TX_REPEATABLE_READ = "repeatable-read"; public static final String TX_SNAPSHOT = "snapshot"; public static final String TX_SERIALIZABLE = "serializable"; public static final String PROPERTY_ENHANCER_VENDOR_NAME = "VendorName"; public static final String PROPERTY_ENHANCER_VERSION_NUMBER = "VersionNumber"; public static final String PROPERTY_TRANSACTION_TYPE = "javax.jdo.option.TransactionType"; public static final int ENHANCER_EXCEPTION = 1; public static final int ENHANCER_NO_JDO_ENHANCER_FOUND = 2; public static final int ENHANCER_USAGE_ERROR = 3; } public interface javax.jdo.datastore.DataStoreCache { public void evict(Object oid); public void evictAll(); public varargs void evictAll(Object[] oids); public void evictAll(java.util.Collection oids); public void evictAll(Class pcClass, boolean subclasses); public void evictAll(boolean subclasses, Class pcClass); public void pin(Object oid); public void pinAll(java.util.Collection oids); public varargs void pinAll(Object[] oids); public void pinAll(Class pcClass, boolean subclasses); public void pinAll(boolean subclasses, Class pcClass); public void unpin(Object oid); public void unpinAll(java.util.Collection oids); public varargs void unpinAll(Object[] oids); public void unpinAll(Class pcClass, boolean subclasses); public void unpinAll(boolean subclasses, Class pcClass); } public interface javax.jdo.datastore.JDOConnection { public Object getNativeConnection(); public void close(); } public interface javax.jdo.datastore.Sequence { public String getName(); public Object next(); public void allocate(int additional); public Object current(); public long nextValue(); public long currentValue(); } public interface javax.jdo.Extent extends java.lang.Iterable { public java.util.Iterator iterator(); public boolean hasSubclasses(); public Class getCandidateClass(); public javax.jdo.PersistenceManager getPersistenceManager(); public void closeAll(); public void close(java.util.Iterator it); public javax.jdo.FetchPlan getFetchPlan(); } public interface javax.jdo.FetchPlan { public static final String DEFAULT = "default"; public static final String ALL = "all"; public static final int DETACH_UNLOAD_FIELDS = 2; public static final int DETACH_LOAD_FIELDS = 1; public static final int FETCH_SIZE_GREEDY = -1; public static final int FETCH_SIZE_OPTIMAL = 0; public javax.jdo.FetchPlan addGroup(String fetchGroupName); public javax.jdo.FetchPlan removeGroup(String fetchGroupName); public javax.jdo.FetchPlan clearGroups(); public java.util.Set getGroups(); public javax.jdo.FetchPlan setGroups(java.util.Collection fetchGroupNames); public varargs javax.jdo.FetchPlan setGroups(String[]fetchGroupNames); public javax.jdo.FetchPlan setGroup(String fetchGroupName); public javax.jdo.FetchPlan setMaxFetchDepth(int fetchDepth); public int getMaxFetchDepth(); public javax.jdo.FetchPlan setDetachmentRoots(java.util.Collection roots); public java.util.Collection getDetachmentRoots(); public varargs javax.jdo.FetchPlan setDetachmentRootClasses(Class[] rootClasses); public Class[] getDetachmentRootClasses(); public javax.jdo.FetchPlan setFetchSize(int fetchSize); public int getFetchSize(); public javax.jdo.FetchPlan setDetachmentOptions(int options); public int getDetachmentOptions(); } public class javax.jdo.identity.ByteIdentity extends javax.jdo.identity.SingleFieldIdentity { public ByteIdentity(Class pcClass, byte key); public ByteIdentity(Class pcClass, Byte key); public ByteIdentity(Class pcClass, String str); public ByteIdentity(); public byte getKey(); public String toString(); public boolean equals(Object obj); public int compareTo(Object obj); public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException; public void readExternal(java.io.ObjectInput in) throws java.io.IOException, ClassNotFoundException; } public class javax.jdo.identity.CharIdentity extends javax.jdo.identity.SingleFieldIdentity { public CharIdentity(Class pcClass, char key); public CharIdentity(Class pcClass, Character key); public CharIdentity(Class pcClass, String str); public CharIdentity(); public char getKey(); public String toString(); public boolean equals(Object obj); public int compareTo(Object obj); public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException; public void readExternal(java.io.ObjectInput in) throws java.io.IOException, ClassNotFoundException; } public class javax.jdo.identity.IntIdentity extends javax.jdo.identity.SingleFieldIdentity { public IntIdentity(Class pcClass, int key); public IntIdentity(Class pcClass, Integer key); public IntIdentity(Class pcClass, String str); public IntIdentity(); public int getKey(); public String toString(); public boolean equals(Object obj); public int compareTo(Object obj); public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException; public void readExternal(java.io.ObjectInput in) throws java.io.IOException, ClassNotFoundException; } public class javax.jdo.identity.LongIdentity extends javax.jdo.identity.SingleFieldIdentity { public LongIdentity(Class pcClass, long key); public LongIdentity(Class pcClass, Long key); public LongIdentity(Class pcClass, String str); public LongIdentity(); public long getKey(); public String toString(); public boolean equals(Object obj); public int compareTo(Object obj); public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException; public void readExternal(java.io.ObjectInput in) throws java.io.IOException, ClassNotFoundException; } public class javax.jdo.identity.ObjectIdentity extends javax.jdo.identity.SingleFieldIdentity { public ObjectIdentity(Class pcClass, Object param); public ObjectIdentity(); public Object getKey(); public String toString(); public boolean equals(Object obj); public int hashCode(); public int compareTo(Object obj); public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException; public void readExternal(java.io.ObjectInput in) throws java.io.IOException, ClassNotFoundException; } public class javax.jdo.identity.ShortIdentity extends javax.jdo.identity.SingleFieldIdentity { public ShortIdentity(Class pcClass, short key); public ShortIdentity(Class pcClass, Short key); public ShortIdentity(Class pcClass, String str); public ShortIdentity(); public short getKey(); public String toString(); public boolean equals(Object obj); public int compareTo(Object obj); public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException; public void readExternal(java.io.ObjectInput in) throws java.io.IOException, ClassNotFoundException; } public abstract class javax.jdo.identity.SingleFieldIdentity implements java.io.Externalizable, java.lang.Comparable { public SingleFieldIdentity(); public Class getTargetClass(); public String getTargetClassName(); public synchronized Object getKeyAsObject(); public boolean equals(Object obj); public int hashCode(); public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException; public void readExternal(java.io.ObjectInput in) throws java.io.IOException, ClassNotFoundException; } public class javax.jdo.identity.StringIdentity extends javax.jdo.identity.SingleFieldIdentity { public StringIdentity(Class pcClass, String key); public StringIdentity(); public String getKey(); public String toString(); public boolean equals(Object obj); public int compareTo(Object obj); public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException; public void readExternal(java.io.ObjectInput in) throws java.io.IOException, ClassNotFoundException; } public interface javax.jdo.InstanceCallbacks extends javax.jdo.listener.ClearCallback, javax.jdo.listener.DeleteCallback, javax.jdo.listener.LoadCallback, javax.jdo.listener.StoreCallback { } public class javax.jdo.JDOCanRetryException extends javax.jdo.JDOException { public JDOCanRetryException(); public JDOCanRetryException(String msg); public JDOCanRetryException(String msg, Throwable[] nested); public JDOCanRetryException(String msg, Throwable nested); public JDOCanRetryException(String msg, Object failed); public JDOCanRetryException(String msg, Throwable[] nested, Object failed); public JDOCanRetryException(String msg, Throwable nested, Object failed); } public class javax.jdo.JDODataStoreException extends javax.jdo.JDOCanRetryException { public JDODataStoreException(); public JDODataStoreException(String msg); public JDODataStoreException(String msg, Throwable[] nested); public JDODataStoreException(String msg, Throwable nested); public JDODataStoreException(String msg, Object failed); public JDODataStoreException(String msg, Throwable[] nested, Object failed); public JDODataStoreException(String msg, Throwable nested, Object failed); } public class javax.jdo.JDODetachedFieldAccessException extends javax.jdo.JDOUserException { public JDODetachedFieldAccessException(); public JDODetachedFieldAccessException(String msg); public JDODetachedFieldAccessException(String, Object); public JDODetachedFieldAccessException(String msg, Throwable[] nested); public JDODetachedFieldAccessException(String msg, Throwable nested); } public class javax.jdo.JDOException extends RuntimeException { public JDOException(); public JDOException(String msg); public JDOException(String msg, Throwable[] nested); public JDOException(String msg, Throwable nested); public JDOException(String msg, Object failed); public JDOException(String msg, Throwable[] nested, Object failed); public JDOException(String msg, Throwable nested, Object failed); public Object getFailedObject(); public Throwable[] getNestedExceptions(); public synchronized Throwable getCause(); public Throwable initCause(Throwable cause); public synchronized String toString(); public void printStackTrace(); public synchronized void printStackTrace(java.io.PrintStream s); public synchronized void printStackTrace(java.io.PrintWriter s); } public class javax.jdo.JDOFatalDataStoreException extends javax.jdo.JDOFatalException { public JDOFatalDataStoreException(); public JDOFatalDataStoreException(String msg); public JDOFatalDataStoreException(String msg, Object failed); public JDOFatalDataStoreException(String msg, Throwable[] nested); public JDOFatalDataStoreException(String msg, Throwable nested); public JDOFatalDataStoreException(String msg, Throwable[] nested, Object failed); public JDOFatalDataStoreException(String msg, Throwable nested, Object failed); } public class javax.jdo.JDOFatalException extends javax.jdo.JDOException { public JDOFatalException(); public JDOFatalException(String msg); public JDOFatalException(String msg, Throwable[] nested); public JDOFatalException(String msg, Throwable nested); public JDOFatalException(String msg, Object failed); public JDOFatalException(String msg, Throwable[] nested, Object failed); public JDOFatalException(String msg, Throwable nested, Object failed); } public class javax.jdo.JDOFatalInternalException extends javax.jdo.JDOFatalException { public JDOFatalInternalException(); public JDOFatalInternalException(String msg); public JDOFatalInternalException(String msg, Throwable[] nested); public JDOFatalInternalException(String msg, Throwable nested); public JDOFatalInternalException(String msg, Object failed); public JDOFatalInternalException(String msg, Throwable[] nested, Object failed); public JDOFatalInternalException(String msg, Throwable nested, Object failed); } public class javax.jdo.JDOFatalUserException extends javax.jdo.JDOFatalException { public JDOFatalUserException(); public JDOFatalUserException(String msg); public JDOFatalUserException(String msg, Throwable[] nested); public JDOFatalUserException(String msg, Throwable nested); public JDOFatalUserException(String msg, Object failed); public JDOFatalUserException(String msg, Throwable[] nested, Object failed); public JDOFatalUserException(String msg, Throwable nested, Object failed); } public class javax.jdo.JDOHelper implements javax.jdo.Constants { public JDOHelper(); public static javax.jdo.JDOHelper getInstance(); public static javax.jdo.PersistenceManager getPersistenceManager(Object pc); public static void makeDirty(Object pc, String fieldName); public static Object getObjectId(Object pc); public static java.util.Collection getObjectIds(java.util.Collection pcs); public static Object[] getObjectIds(Object[] pcs); public static Object getTransactionalObjectId(Object pc); public static Object getVersion(Object pc); public static boolean isDirty(Object pc); public static boolean isTransactional(Object pc); public static boolean isPersistent(Object pc); public static boolean isNew(Object pc); public static boolean isDeleted(Object pc); public static boolean isDetached(Object pc); public static enum javax.jdo.ObjectState getObjectState(Object pc); public static javax.jdo.PersistenceManagerFactory getPersistenceManagerFactory(); public static javax.jdo.PersistenceManagerFactory getPersistenceManagerFactory(java.util.Map props); public static javax.jdo.PersistenceManagerFactory getPersistenceManagerFactory(java.util.Map props, ClassLoader cl); public static javax.jdo.PersistenceManagerFactory getPersistenceManagerFactory(java.util.Map props, java.lang.String name, ClassLoader propsloader, ClassLoader pmfloader); public static javax.jdo.PersistenceManagerFactory getPersistenceManagerFactory(java.util.Map props, java.lang.String name, ClassLoader pmfloader); public static javax.jdo.PersistenceManagerFactory getPersistenceManagerFactory(java.util.Map props, java.lang.String name); public static javax.jdo.PersistenceManagerFactory getPersistenceManagerFactory(String propsResource); public static javax.jdo.PersistenceManagerFactory getPersistenceManagerFactory(String propsResource, ClassLoader loader); public static javax.jdo.PersistenceManagerFactory getPersistenceManagerFactory(String propsResource, ClassLoader propsLoader, ClassLoader pmfLoader); public static javax.jdo.PersistenceManagerFactory getPersistenceManagerFactory(ClassLoader pmfLoader); public static javax.jdo.PersistenceManagerFactory getPersistenceManagerFactory(java.io.File propsFile); public static javax.jdo.PersistenceManagerFactory getPersistenceManagerFactory(java.io.File propsFile, ClassLoader loader); public static javax.jdo.PersistenceManagerFactory getPersistenceManagerFactory(String jndiLocation, javax.naming.Context context); public static javax.jdo.PersistenceManagerFactory getPersistenceManagerFactory(String jndiLocation, javax.naming.Context context, ClassLoader loader); public static javax.jdo.PersistenceManagerFactory getPersistenceManagerFactory(java.io.InputStream stream); public static javax.jdo.PersistenceManagerFactory getPersistenceManagerFactory(java.io.InputStream stream, ClassLoader loader); public static javax.jdo.JDOEnhancer getEnhancer(); public static javax.jdo.JDOEnhancer getEnhancer(ClassLoader loader); } public class javax.jdo.JDONullIdentityException extends javax.jdo.JDOUserException { public JDONullIdentityException(); public JDONullIdentityException(String msg); public JDONullIdentityException(String msg, Object failed); public JDONullIdentityException(String msg, Throwable[] nested); public JDONullIdentityException(String msg, Throwable nested); } public class javax.jdo.JDOObjectNotFoundException extends javax.jdo.JDODataStoreException { public JDOObjectNotFoundException(); public JDOObjectNotFoundException(String msg); public JDOObjectNotFoundException(String msg, Object failed); public JDOObjectNotFoundException(String msg, Throwable nested); public JDOObjectNotFoundException(String msg, Throwable nested, Object failed); public JDOObjectNotFoundException(String msg, Throwable[] nested); public JDOObjectNotFoundException(String msg, Throwable[] nested, Object failed); } public class javax.jdo.JDOOptimisticVerificationException extends javax.jdo.JDOFatalDataStoreException { public JDOOptimisticVerificationException(); public JDOOptimisticVerificationException(String msg); public JDOOptimisticVerificationException(String msg, Object failed); public JDOOptimisticVerificationException(String msg, Throwable[] nested); public JDOOptimisticVerificationException(String msg, Throwable nested, Object failed); public JDOOptimisticVerificationException(String msg, Throwable[] nested, Object failed); } public class javax.jdo.JDOUnsupportedOptionException extends javax.jdo.JDOUserException { public JDOUnsupportedOptionException(); public JDOUnsupportedOptionException(String msg); public JDOUnsupportedOptionException(String msg, Throwable[] nested); public JDOUnsupportedOptionException(String msg, Throwable nested); } public class javax.jdo.JDOUserCallbackException extends javax.jdo.JDOUserException { public JDOUserCallbackException(); public JDOUserCallbackException(String msg); public JDOUserCallbackException(String msg, Throwable[] nested); public JDOUserCallbackException(String msg, Throwable nested); public JDOUserCallbackException(String msg, Object failed); public JDOUserCallbackException(String msg, Throwable[] nested, Object failed); public JDOUserCallbackException(String msg, Throwable nested, Object failed); } public class javax.jdo.JDOUserException extends javax.jdo.JDOCanRetryException { public JDOUserException(); public JDOUserException(String msg); public JDOUserException(String msg, Throwable[] nested); public JDOUserException(String msg, Throwable nested); public JDOUserException(String msg, Object failed); public JDOUserException(String msg, Throwable[] nested, Object failed); public JDOUserException(String msg, Throwable nested, Object failed); } public interface javax.jdo.listener.AttachCallback { public void jdoPreAttach(); public void jdoPostAttach(Object attached); } public interface javax.jdo.listener.AttachLifecycleListener extends javax.jdo.listener.InstanceLifecycleListener { public void preAttach(javax.jdo.listener.InstanceLifecycleEvent event); public void postAttach(javax.jdo.listener.InstanceLifecycleEvent event); } public interface javax.jdo.listener.ClearCallback { public void jdoPreClear(); } public interface javax.jdo.listener.ClearLifecycleListener extends javax.jdo.listener.InstanceLifecycleListener { public void preClear(javax.jdo.listener.InstanceLifecycleEvent event); public void postClear(javax.jdo.listener.InstanceLifecycleEvent event); } public interface javax.jdo.listener.CreateLifecycleListener extends javax.jdo.listener.InstanceLifecycleListener { public void postCreate(javax.jdo.listener.InstanceLifecycleEvent event); } public interface javax.jdo.listener.DeleteCallback { public void jdoPreDelete(); } public interface javax.jdo.listener.DeleteLifecycleListener extends javax.jdo.listener.InstanceLifecycleListener { public void preDelete(javax.jdo.listener.InstanceLifecycleEvent event); public void postDelete(javax.jdo.listener.InstanceLifecycleEvent event); } public interface javax.jdo.listener.DetachCallback { public void jdoPreDetach(); public void jdoPostDetach(Object detached); } public interface javax.jdo.listener.DetachLifecycleListener extends javax.jdo.listener.InstanceLifecycleListener { public void preDetach(javax.jdo.listener.InstanceLifecycleEvent event); public void postDetach(javax.jdo.listener.InstanceLifecycleEvent event); } public interface javax.jdo.listener.DirtyLifecycleListener extends javax.jdo.listener.InstanceLifecycleListener { public void preDirty(javax.jdo.listener.InstanceLifecycleEvent event); public void postDirty(javax.jdo.listener.InstanceLifecycleEvent event); } public class javax.jdo.listener.InstanceLifecycleEvent extends java.util.EventObject { public static final int CREATE = 0; public static final int LOAD = 1; public static final int STORE = 2; public static final int CLEAR = 3; public static final int DELETE = 4; public static final int DIRTY = 5; public static final int DETACH = 6; public static final int ATTACH = 7; public InstanceLifecycleEvent(Object source, int type); public InstanceLifecycleEvent(Object source, int type, Object target); public int getEventType(); public Object getSource(); public Object getTarget(); public Object getPersistentInstance(); public Object getDetachedInstance(); } public interface javax.jdo.listener.InstanceLifecycleListener { } public interface javax.jdo.listener.LoadCallback { public void jdoPostLoad(); } public interface javax.jdo.listener.LoadLifecycleListener extends javax.jdo.listener.InstanceLifecycleListener { public void postLoad(javax.jdo.listener.InstanceLifecycleEvent event); } public interface javax.jdo.listener.StoreCallback { public void jdoPreStore(); } public interface javax.jdo.listener.StoreLifecycleListener extends javax.jdo.listener.InstanceLifecycleListener { public void preStore(javax.jdo.listener.InstanceLifecycleEvent event); public void postStore(javax.jdo.listener.InstanceLifecycleEvent event); } public interface javax.jdo.PersistenceManager { public boolean isClosed(); public void close(); public javax.jdo.Transaction currentTransaction(); public void evict(Object pc); public varargs void evictAll(Object[] pcs); public void evictAll(java.util.Collection pcs); public void evictAll(boolean, Class); public void evictAll(); public void refresh(Object pc); public varargs void refreshAll(Object[] pcs); public void refreshAll(java.util.Collection pcs); public void refreshAll(); public void refreshAll(javax.jdo.JDOException jdoe); public javax.jdo.Query newQuery(); public javax.jdo.Query newQuery(Object compiled); public javax.jdo.Query newQuery(String query); public javax.jdo.Query newQuery(String language, Object query); public javax.jdo.Query newQuery(Class cls); public javax.jdo.Query newQuery(javax.jdo.Extent cln); public javax.jdo.Query newQuery(Class cls, java.util.Collection cln); public javax.jdo.Query newQuery(Class cls, String filter); public javax.jdo.Query newQuery(Class cls, java.util.Collection cln, String filter); public javax.jdo.Query newQuery(javax.jdo.Extent cln, String filter); public javax.jdo.Query newNamedQuery(Class cls, String queryName); public javax.jdo.Extent getExtent(Class persistenceCapableClass, boolean subclasses); public javax.jdo.Extent getExtent(Class persistenceCapableClass); public Object getObjectById(Object oid, boolean validate); public Object getObjectById(Class cls, Object key); public Object getObjectById(Object oid); public Object getObjectId(Object pc); public Object getTransactionalObjectId(Object pc); public Object newObjectIdInstance(Class pcClass, Object key); public java.util.Collection getObjectsById(java.util.Collection oids, boolean validate); public java.util.Collection getObjectsById(java.util.Collection oids); public Object[] getObjectsById(Object[] oids, boolean validate); public varargs Object[] getObjectsById(boolean validate,Object[] oids); public varargs Object[] getObjectsById(Object[] oids); public Object makePersistent(Object pc); public varargs Object[] makePersistentAll(Object[] pcs); public java.util.Collection makePersistentAll(java.util.Collection pcs); public void deletePersistent(Object pc); public varargs void deletePersistentAll(Object[] pcs); public void deletePersistentAll(java.util.Collection pcs); public void makeTransient(Object pc); public varargs void makeTransientAll(Object[] pcs); public void makeTransientAll(java.util.Collection pcs); public void makeTransient(Object pc, boolean useFetchPlan); public void makeTransientAll(Object[] pcs, boolean useFetchPlan); public varargs void makeTransientAll(boolean useFetchPlan, Object[] pcs); public void makeTransientAll(java.util.Collection pcs, boolean useFetchPlan); public void makeTransactional(Object pc); public varargs void makeTransactionalAll(Object[] pcs); public void makeTransactionalAll(java.util.Collection pcs); public void makeNontransactional(Object pc); public varargs void makeNontransactionalAll(Object[] pcs); public void makeNontransactionalAll(java.util.Collection pcs); public void retrieve(Object pc); public void retrieve(Object pc, boolean FGOnly); public void retrieveAll(java.util.Collection pcs); public void retrieveAll(java.util.Collection pcs, boolean FGOnly); public varargs void retrieveAll(Object[] pcs); public void retrieveAll(Object[] pcs, boolean FGOnly); public varargs void retrieveAll(boolean FGOnly, Object[] pcs); public void setUserObject(Object o); public Object getUserObject(); public javax.jdo.PersistenceManagerFactory getPersistenceManagerFactory(); public Class getObjectIdClass(Class cls); public void setMultithreaded(boolean flag); public boolean getMultithreaded(); public void setIgnoreCache(boolean flag); public boolean getIgnoreCache(); public boolean getDetachAllOnCommit(); public void setDetachAllOnCommit(boolean flag); public boolean getCopyOnAttach(); public void setCopyOnAttach(boolean flag); public Object detachCopy(Object pc); public java.util.Collection detachCopyAll(java.util.Collection pcs); public varargs Object[] detachCopyAll(Object [] pcs); public Object putUserObject(Object key, Object val); public Object getUserObject(Object key); public Object removeUserObject(Object key); public void flush(); public void checkConsistency(); public javax.jdo.FetchPlan getFetchPlan(); public Object newInstance(Class pcClass); public java.util.Date getServerDate(); public javax.jdo.datastore.Sequence getSequence(String name); public javax.jdo.datastore.JDOConnection getDataStoreConnection(); public varargs void addInstanceLifecycleListener(javax.jdo.listener.InstanceLifecycleListener listener, Class[] classes); public void removeInstanceLifecycleListener(javax.jdo.listener.InstanceLifecycleListener listener); public java.util.Set getManagedObjects(); public java.util.Set getManagedObjects(java.util.EnumSet states); public varargs java.util.Set getManagedObjects(Class[] classes); public varargs java.util.Set getManagedObjects(java.util.EnumSet states, Class[] classes); javax.jdo.FetchGroup getFetchGroup(Class cls, String name); public void setDatastoreReadTimeoutMillis(Integer interval); public Integer getDatastoreReadTimeoutMillis(); public void setDatastoreWriteTimeoutMillis(Integer interval); public Integer getDatastoreWriteTimeoutMillis(); public void setProperty(String propertyName, Object value); public java.util.Map getProperties(); public java.util.Set getSupportedProperties(); } public interface javax.jdo.PersistenceManagerFactory extends java.io.Serializable { public void close(); public boolean isClosed(); public javax.jdo.PersistenceManager getPersistenceManager(); public javax.jdo.PersistenceManager getPersistenceManagerProxy(); public javax.jdo.PersistenceManager getPersistenceManager(String userid, String password); public void setConnectionUserName(String userName); public String getConnectionUserName(); public void setConnectionPassword(String password); public void setConnectionURL(String URL); public String getConnectionURL(); public void setConnectionDriverName(String driverName); public String getConnectionDriverName(); public void setConnectionFactoryName(String connectionFactoryName); public String getConnectionFactoryName(); public void setConnectionFactory(Object connectionFactory); public Object getConnectionFactory(); public void setConnectionFactory2Name(String connectionFactoryName); public String getConnectionFactory2Name(); public void setConnectionFactory2(Object connectionFactory); public Object getConnectionFactory2(); public void setMultithreaded(boolean flag); public boolean getMultithreaded(); public void setMapping(String mapping); public String getMapping(); public void setOptimistic(boolean flag); public boolean getOptimistic(); public void setRetainValues(boolean flag); public boolean getRetainValues(); public void setRestoreValues(boolean restoreValues); public boolean getRestoreValues(); public void setNontransactionalRead(boolean flag); public boolean getNontransactionalRead(); public void setNontransactionalWrite(boolean flag); public boolean getNontransactionalWrite(); public void setIgnoreCache(boolean flag); public boolean getIgnoreCache(); public boolean getDetachAllOnCommit(); public void setDetachAllOnCommit(boolean flag); public boolean getCopyOnAttach(); public void setCopyOnAttach(boolean flag); public java.lang.String getName(); public void setName(java.lang.String); public java.lang.String getPersistenceUnitName(); public void setPersistenceUnitName(java.lang.String); public java.lang.String getServerTimeZoneID(); public void setServerTimeZoneID(java.lang.String); public java.lang.String getTransactionType(); public void setTransactionType(java.lang.String); public void setReadOnly(boolean flag); public boolean getReadOnly(); public void setTransactionIsolationLevel(String); public String getTransactionIsolationLevel(); public java.util.Properties getProperties(); public java.util.Collection supportedOptions(); public javax.jdo.datastore.DataStoreCache getDataStoreCache(); public void addInstanceLifecycleListener(javax.jdo.listener.InstanceLifecycleListener listener, Class[] classes); public void removeInstanceLifecycleListener(javax.jdo.listener.InstanceLifecycleListener listener); varargs void addFetchGroups(javax.jdo.FetchGroup[] groups); varargs void removeFetchGroups(javax.jdo.FetchGroup[] groups); void removeAllFetchGroups(); javax.jdo.FetchGroup getFetchGroup(Class cls, String name); java.util.Set getFetchGroups(); public void registerMetadata(javax.jdo.metadata.JDOMetadata metadata); public javax.jdo.metadata.JDOMetadata newMetadata(); public javax.jdo.metadata.TypeMetadata getMetadata(String className); public void setDatastoreReadTimeoutMillis(Integer interval); public Integer getDatastoreReadTimeoutMillis(); public void setDatastoreWriteTimeoutMillis(Integer interval); public Integer getDatastoreWriteTimeoutMillis(); public java.util.Collection getManagedClasses(); } public interface javax.jdo.Query extends java.io.Serializable { public static final String JDOQL = "javax.jdo.query.JDOQL"; public static final String SQL = "javax.jdo.query.SQL"; public void setClass(Class cls); public void setCandidates(javax.jdo.Extent pcs); public void setCandidates(java.util.Collection pcs); public void setFilter(String filter); public void declareImports(String imports); public void declareParameters(String parameters); public void declareVariables(String variables); public void setOrdering(String ordering); public void setIgnoreCache(boolean ignoreCache); public void addSubquery(javax.jdo.Query, java.lang.String, java.lang.String); public void addSubquery(javax.jdo.Query, java.lang.String, java.lang.String, java.lang.String); public varargs void addSubquery(javax.jdo.Query, java.lang.String, java.lang.String, java.lang.String[]); public void addSubquery(javax.jdo.Query, java.lang.String, java.lang.String, java.util.Map); public boolean getIgnoreCache(); public void compile(); public Object execute(); public Object execute(Object p1); public Object execute(Object p1, Object p2); public Object execute(Object p1, Object p2, Object p3); public Object executeWithMap(java.util.Map parameters); public varargs Object executeWithArray(Object[] parameters); public javax.jdo.PersistenceManager getPersistenceManager(); public void close(Object queryResult); public void closeAll(); public void setGrouping(String group); public void setUnique(boolean unique); public void setResult(String data); public void setResultClass(Class cls); public void setRange(long fromIncl, long toExcl); public void setRange(String fromInclToExcl); public void addExtension(String key, Object value); public void setExtensions(java.util.Map extensions); public javax.jdo.FetchPlan getFetchPlan(); public varargs long deletePersistentAll(Object[] parameters); public long deletePersistentAll(java.util.Map parameters); public long deletePersistentAll(); public void setUnmodifiable(); public boolean isUnmodifiable(); public void cancelAll(); public void cancel(Thread); public Boolean getSerializeRead(); public void setSerializeRead(Boolean); public void setDatastoreReadTimeoutMillis(Integer interval); public Integer getDatastoreReadTimeoutMillis(); public void setDatastoreWriteTimeoutMillis(Integer interval); public Integer getDatastoreWriteTimeoutMillis(); } public interface javax.jdo.spi.Detachable { public void jdoReplaceDetachedState(); } public class javax.jdo.spi.JDOImplHelper extends Object { public static javax.jdo.spi.JDOImplHelper getInstance() throws SecurityException; public String[] getFieldNames(Class pcClass); public Class[] getFieldTypes(Class pcClass); public byte[] getFieldFlags(Class pcClass); public Class getPersistenceCapableSuperclass(Class pcClass); public javax.jdo.spi.PersistenceCapable newInstance(Class pcClass, javax.jdo.spi.StateManager sm); public javax.jdo.spi.PersistenceCapable newInstance(Class pcClass, javax.jdo.spi.StateManager sm, Object oid); public Object newObjectIdInstance(Class pcClass); public Object newObjectIdInstance(Class pcClass, Object obj); public void copyKeyFieldsToObjectId(Class pcClass, javax.jdo.spi.PersistenceCapable$ObjectIdFieldSupplier fm, Object oid); public void copyKeyFieldsFromObjectId(Class pcClass, javax.jdo.spi.PersistenceCapable$ObjectIdFieldConsumer fm, Object oid); public static void registerClass(Class pcClass, String[] fieldNames, Class[] fieldTypes, byte[] fieldFlags, Class persistenceCapableSuperclass, javax.jdo.spi.PersistenceCapable pc); public void unregisterClasses(ClassLoader cl); public void unregisterClass(Class pcClass); public void addRegisterClassListener(javax.jdo.spi.RegisterClassListener crl); public void removeRegisterClassListener(javax.jdo.spi.RegisterClassListener crl); public java.util.Collection getRegisteredClasses(); public static void registerAuthorizedStateManagerClass(Class smClass) throws SecurityException; public static void registerAuthorizedStateManagerClasses(java.util.Collection smClasses) throws SecurityException; public static void checkAuthorizedStateManager(javax.jdo.spi.StateManager sm); public static void checkAuthorizedStateManagerClass(Class smClass); public Object registerStringConstructor(Class cls, javax.jdo.spi.JDOImplHelper$StringConstructor sc); public static Object construct(String className, String keyString); public synchronized void registerDateFormat(java.text.DateFormat df); public synchronized void registerErrorHandler(org.xml.sax.ErrorHandler); public static org.xml.sax.ErrorHandler getRegisteredErrorHandler(); public synchronized void registerDocumentBuilderFactory(javax.xml.parsers.DocumentBuilderFactory); public static javax.xml.parsers.DocumentBuilderFactory getRegisteredDocumentBuilderFactory(); public synchronized void addStateInterrogation(javax.jdo.spi.StateInterrogation si); public synchronized void removeStateInterrogation(javax.jdo.spi.StateInterrogation si); public void nonBinaryCompatibleMakeDirty(Object pc, String fieldName); public boolean nonBinaryCompatibleIs(Object pc, javax.jdo.spi.JDOImplHelper$StateInterrogationBooleanReturn sibr); public Object nonBinaryCompatibleGet(Object pc, javax.jdo.spi.JDOImplHelper$StateInterrogationObjectReturn sibr); public static void assertOnlyKnownStandardProperties(java.util.Map properties); public static final java.util.Set USER_CONFIGURABLE_STANDARD_PROPERTIES; } static public interface javax.jdo.spi.JDOImplHelper$StringConstructor { public Object construct(String s); } static public interface javax.jdo.spi.JDOImplHelper$StateInterrogationBooleanReturn { public Boolean is(Object pc, javax.jdo.spi.StateInterrogation si); } static public interface javax.jdo.spi.JDOImplHelper$StateInterrogationObjectReturn { public Object get(Object pc, javax.jdo.spi.StateInterrogation si); } public final class javax.jdo.spi.JDOPermission extends java.security.BasicPermission { public JDOPermission(String name); public JDOPermission(String name, String actions); public static final javax.jdo.spi.JDOPermission GET_METADATA; public static final javax.jdo.spi.JDOPermission MANAGE_METADATA; public static final javax.jdo.spi.JDOPermission SET_STATE_MANAGER; public static final javax.jdo.spi.JDOPermission CLOSE_PERSISTENCE_MANAGER_FACTORY; } public interface javax.jdo.spi.PersistenceCapable { public static final byte READ_WRITE_OK = 0; public static final byte LOAD_REQUIRED = 1; public static final byte READ_OK = -1; public static final byte CHECK_READ = 1; public static final byte MEDIATE_READ = 2; public static final byte CHECK_WRITE = 4; public static final byte MEDIATE_WRITE = 8; public static final byte SERIALIZABLE = 16; public javax.jdo.PersistenceManager jdoGetPersistenceManager(); public void jdoReplaceStateManager(javax.jdo.spi.StateManager sm) throws SecurityException; public void jdoProvideField(int fieldNumber); public void jdoProvideFields(int[] fieldNumbers); public void jdoReplaceField(int fieldNumber); public void jdoReplaceFields(int[] fieldNumbers); public void jdoReplaceFlags(); public void jdoCopyFields(Object other, int[] fieldNumbers); public void jdoMakeDirty(String fieldName); public Object jdoGetObjectId(); public Object jdoGetTransactionalObjectId(); public Object jdoGetVersion(); public boolean jdoIsDirty(); public boolean jdoIsTransactional(); public boolean jdoIsPersistent(); public boolean jdoIsNew(); public boolean jdoIsDeleted(); public boolean jdoIsDetached(); public javax.jdo.spi.PersistenceCapable jdoNewInstance(javax.jdo.spi.StateManager sm); public javax.jdo.spi.PersistenceCapable jdoNewInstance(javax.jdo.spi.StateManager sm, Object oid); public Object jdoNewObjectIdInstance(); public Object jdoNewObjectIdInstance(Object o); public void jdoCopyKeyFieldsToObjectId(Object oid); public void jdoCopyKeyFieldsToObjectId(javax.jdo.spi.PersistenceCapable$ObjectIdFieldSupplier fm, Object oid); public void jdoCopyKeyFieldsFromObjectId(javax.jdo.spi.PersistenceCapable$ObjectIdFieldConsumer fm, Object oid); } static public interface javax.jdo.spi.PersistenceCapable$ObjectIdFieldManager extends javax.jdo.spi.PersistenceCapable$ObjectIdFieldConsumer, javax.jdo.spi.PersistenceCapable$ObjectIdFieldSupplier { } static public interface javax.jdo.spi.PersistenceCapable$ObjectIdFieldSupplier { public boolean fetchBooleanField(int fieldNumber); public char fetchCharField(int fieldNumber); public byte fetchByteField(int fieldNumber); public short fetchShortField(int fieldNumber); public int fetchIntField(int fieldNumber); public long fetchLongField(int fieldNumber); public float fetchFloatField(int fieldNumber); public double fetchDoubleField(int fieldNumber); public String fetchStringField(int fieldNumber); public Object fetchObjectField(int fieldNumber); } static public interface javax.jdo.spi.PersistenceCapable$ObjectIdFieldConsumer { public void storeBooleanField(int fieldNumber, boolean value); public void storeCharField(int fieldNumber, char value); public void storeByteField(int fieldNumber, byte value); public void storeShortField(int fieldNumber, short value); public void storeIntField(int fieldNumber, int value); public void storeLongField(int fieldNumber, long value); public void storeFloatField(int fieldNumber, float value); public void storeDoubleField(int fieldNumber, double value); public void storeStringField(int fieldNumber, String value); public void storeObjectField(int fieldNumber, Object value); } public class javax.jdo.spi.RegisterClassEvent extends java.util.EventObject { public RegisterClassEvent(javax.jdo.spi.JDOImplHelper helper, Class registeredClass, String[] fieldNames, Class[] fieldTypes, byte[] fieldFlags, Class persistenceCapableSuperclass); public Class getRegisteredClass(); public String[] getFieldNames(); public Class[] getFieldTypes(); public byte[] getFieldFlags(); public Class getPersistenceCapableSuperclass(); } public interface javax.jdo.spi.RegisterClassListener extends java.util.EventListener { public void registerClass(javax.jdo.spi.RegisterClassEvent event); } public interface javax.jdo.spi.StateInterrogation { public Boolean isPersistent(Object pc); public Boolean isTransactional(Object pc); public Boolean isDirty(Object pc); public Boolean isNew(Object pc); public Boolean isDeleted(Object pc); public Boolean isDetached(Object pc); public javax.jdo.PersistenceManager getPersistenceManager(Object pc); public Object getObjectId(Object pc); public Object getTransactionalObjectId(Object pc); public Object getVersion(Object pc); public boolean makeDirty(Object pc, String fieldName); } public interface javax.jdo.spi.StateManager { public byte replacingFlags(javax.jdo.spi.PersistenceCapable pc); public javax.jdo.spi.StateManager replacingStateManager(javax.jdo.spi.PersistenceCapable pc, javax.jdo.spi.StateManager sm); public boolean isDirty(javax.jdo.spi.PersistenceCapable pc); public boolean isTransactional(javax.jdo.spi.PersistenceCapable pc); public boolean isPersistent(javax.jdo.spi.PersistenceCapable pc); public boolean isNew(javax.jdo.spi.PersistenceCapable pc); public boolean isDeleted(javax.jdo.spi.PersistenceCapable pc); public javax.jdo.PersistenceManager getPersistenceManager(javax.jdo.spi.PersistenceCapable pc); public void makeDirty(javax.jdo.spi.PersistenceCapable pc, String fieldName); public Object getObjectId(javax.jdo.spi.PersistenceCapable pc); public Object getTransactionalObjectId(javax.jdo.spi.PersistenceCapable pc); public Object getVersion(javax.jdo.spi.PersistenceCapable pc); public boolean isLoaded(javax.jdo.spi.PersistenceCapable pc, int field); public void preSerialize(javax.jdo.spi.PersistenceCapable pc); public boolean getBooleanField(javax.jdo.spi.PersistenceCapable pc, int field, boolean currentValue); public char getCharField(javax.jdo.spi.PersistenceCapable pc, int field, char currentValue); public byte getByteField(javax.jdo.spi.PersistenceCapable pc, int field, byte currentValue); public short getShortField(javax.jdo.spi.PersistenceCapable pc, int field, short currentValue); public int getIntField(javax.jdo.spi.PersistenceCapable pc, int field, int currentValue); public long getLongField(javax.jdo.spi.PersistenceCapable pc, int field, long currentValue); public float getFloatField(javax.jdo.spi.PersistenceCapable pc, int field, float currentValue); public double getDoubleField(javax.jdo.spi.PersistenceCapable pc, int field, double currentValue); public String getStringField(javax.jdo.spi.PersistenceCapable pc, int field, String currentValue); public Object getObjectField(javax.jdo.spi.PersistenceCapable pc, int field, Object currentValue); public void setBooleanField(javax.jdo.spi.PersistenceCapable pc, int field, boolean currentValue, boolean newValue); public void setCharField(javax.jdo.spi.PersistenceCapable pc, int field, char currentValue, char newValue); public void setByteField(javax.jdo.spi.PersistenceCapable pc, int field, byte currentValue, byte newValue); public void setShortField(javax.jdo.spi.PersistenceCapable pc, int field, short currentValue, short newValue); public void setIntField(javax.jdo.spi.PersistenceCapable pc, int field, int currentValue, int newValue); public void setLongField(javax.jdo.spi.PersistenceCapable pc, int field, long currentValue, long newValue); public void setFloatField(javax.jdo.spi.PersistenceCapable pc, int field, float currentValue, float newValue); public void setDoubleField(javax.jdo.spi.PersistenceCapable pc, int field, double currentValue, double newValue); public void setStringField(javax.jdo.spi.PersistenceCapable pc, int field, String currentValue, String newValue); public void setObjectField(javax.jdo.spi.PersistenceCapable pc, int field, Object currentValue, Object newValue); public void providedBooleanField(javax.jdo.spi.PersistenceCapable pc, int field, boolean currentValue); public void providedCharField(javax.jdo.spi.PersistenceCapable pc, int field, char currentValue); public void providedByteField(javax.jdo.spi.PersistenceCapable pc, int field, byte currentValue); public void providedShortField(javax.jdo.spi.PersistenceCapable pc, int field, short currentValue); public void providedIntField(javax.jdo.spi.PersistenceCapable pc, int field, int currentValue); public void providedLongField(javax.jdo.spi.PersistenceCapable pc, int field, long currentValue); public void providedFloatField(javax.jdo.spi.PersistenceCapable pc, int field, float currentValue); public void providedDoubleField(javax.jdo.spi.PersistenceCapable pc, int field, double currentValue); public void providedStringField(javax.jdo.spi.PersistenceCapable pc, int field, String currentValue); public void providedObjectField(javax.jdo.spi.PersistenceCapable pc, int field, Object currentValue); public boolean replacingBooleanField(javax.jdo.spi.PersistenceCapable pc, int field); public char replacingCharField(javax.jdo.spi.PersistenceCapable pc, int field); public byte replacingByteField(javax.jdo.spi.PersistenceCapable pc, int field); public short replacingShortField(javax.jdo.spi.PersistenceCapable pc, int field); public int replacingIntField(javax.jdo.spi.PersistenceCapable pc, int field); public long replacingLongField(javax.jdo.spi.PersistenceCapable pc, int field); public float replacingFloatField(javax.jdo.spi.PersistenceCapable pc, int field); public double replacingDoubleField(javax.jdo.spi.PersistenceCapable pc, int field); public String replacingStringField(javax.jdo.spi.PersistenceCapable pc, int field); public Object replacingObjectField(javax.jdo.spi.PersistenceCapable pc, int field); public Object[] replacingDetachedState(javax.jdo.spi.Detachable pc, Object[] state); } public interface javax.jdo.Transaction { public void begin(); public void commit(); public void rollback(); public boolean isActive(); public boolean getRollbackOnly(); public void setRollbackOnly(); public void setNontransactionalRead(boolean nontransactionalRead); public boolean getNontransactionalRead(); public void setNontransactionalWrite(boolean nontransactionalWrite); public boolean getNontransactionalWrite(); public void setRetainValues(boolean retainValues); public boolean getRetainValues(); public void setRestoreValues(boolean restoreValues); public boolean getRestoreValues(); public void setOptimistic(boolean optimistic); public boolean getOptimistic(); void setIsolationLevel(String level); String getIsolationLevel(); public void setSynchronization(javax.transaction.Synchronization sync); public javax.transaction.Synchronization getSynchronization(); public javax.jdo.PersistenceManager getPersistenceManager(); public Boolean getSerializeRead(); public void setSerializeRead(Boolean); } public final enum javax.jdo.ObjectState extends java.lang.Enum { public static final enum javax.jdo.ObjectState TRANSIENT; public static final enum javax.jdo.ObjectState TRANSIENT_CLEAN; public static final enum javax.jdo.ObjectState TRANSIENT_DIRTY; public static final enum javax.jdo.ObjectState PERSISTENT_NEW; public static final enum javax.jdo.ObjectState HOLLOW_PERSISTENT_NONTRANSACTIONAL; public static final enum javax.jdo.ObjectState PERSISTENT_NONTRANSACTIONAL_DIRTY; public static final enum javax.jdo.ObjectState PERSISTENT_CLEAN; public static final enum javax.jdo.ObjectState PERSISTENT_DIRTY; public static final enum javax.jdo.ObjectState PERSISTENT_DELETED; public static final enum javax.jdo.ObjectState PERSISTENT_NEW_DELETED; public static final enum javax.jdo.ObjectState DETACHED_CLEAN; public static final enum javax.jdo.ObjectState DETACHED_DIRTY; public static enum javax.jdo.ObjectState valueOf(java.lang.String); public static javax.jdo.ObjectState[] values(); public String toString(); } public annotation javax.jdo.annotations.Column extends java.lang.annotation.Annotation { String name() default ""; String target() default ""; String targetMember() default ""; String jdbcType() default ""; String sqlType() default ""; int length() default -1; int scale() default -1; String allowsNull() default ""; String defaultValue() default ""; String insertValue() default ""; javax.jdo.annotations.Extension[] extensions() default {}; int position() default -1; } public annotation javax.jdo.annotations.Columns extends java.lang.annotation.Annotation { javax.jdo.annotations.Column[] value(); } public annotation javax.jdo.annotations.DatastoreIdentity extends java.lang.annotation.Annotation { enum javax.jdo.annotations.IdGeneratorStrategy strategy() default javax.jdo.annotations.IdGeneratorStrategy.UNSPECIFIED; String customStrategy() default ""; String sequence() default ""; String column() default ""; javax.jdo.annotations.Column[] columns() default {}; javax.jdo.annotations.Extension[] extensions() default {}; } public annotation javax.jdo.annotations.Discriminator extends java.lang.annotation.Annotation { enum javax.jdo.annotations.DiscriminatorStrategy strategy() default javax.jdo.annotations.DiscriminatorStrategy.UNSPECIFIED; String customStrategy() default ""; String indexed() default ""; String column() default ""; String value() default ""; javax.jdo.annotations.Column[] columns() default {}; } public final enum javax.jdo.annotations.DiscriminatorStrategy extends java.lang.Enum { public static final enum javax.jdo.annotations.DiscriminatorStrategy UNSPECIFIED; public static final enum javax.jdo.annotations.DiscriminatorStrategy NONE; public static final enum javax.jdo.annotations.DiscriminatorStrategy VALUE_MAP; public static final enum javax.jdo.annotations.DiscriminatorStrategy CLASS_NAME; public static enum javax.jdo.annotations.DiscriminatorStrategy valueOf(java.lang.String); public static javax.jdo.annotations.DiscriminatorStrategy[] values(); } public annotation javax.jdo.annotations.Element extends java.lang.annotation.Annotation { Class[] types() default {}; String serialized() default ""; String embedded() default ""; javax.jdo.annotations.Embedded[] embeddedMapping() default {}; String dependent() default ""; String table() default ""; String column() default ""; enum javax.jdo.annotations.ForeignKeyAction deleteAction() default javax.jdo.annotations.ForeignKeyAction.UNSPECIFIED; enum javax.jdo.annotations.ForeignKeyAction updateAction() default javax.jdo.annotations.ForeignKeyAction.UNSPECIFIED; String indexed() default ""; String index() default ""; String unique() default ""; String uniqueKey() default ""; String mappedBy() default ""; javax.jdo.annotations.Column[] columns() default {}; String generateForeignKey() default ""; String foreignKey() default ""; javax.jdo.annotations.Extension[] extensions() default {}; } public annotation javax.jdo.annotations.Embedded extends java.lang.annotation.Annotation { String ownerMember() default ""; String nullIndicatorColumn() default ""; String nullIndicatorValue() default ""; javax.jdo.annotations.Persistent[] members() default {}; javax.jdo.annotations.Discriminator discriminatorColumnName() default @javax.jdo.annotations.Discriminator; } public annotation javax.jdo.annotations.EmbeddedOnly extends java.lang.annotation.Annotation { } public annotation javax.jdo.annotations.Extension extends java.lang.annotation.Annotation { String vendorName(); String key(); String value(); } public annotation javax.jdo.annotations.Extensions extends java.lang.annotation.Annotation { javax.jdo.annotations.Extension[] value(); } public annotation javax.jdo.annotations.FetchGroup extends java.lang.annotation.Annotation { String name() default ""; String postLoad() default ""; javax.jdo.annotations.Persistent[] members(); String[] fetchGroups() default {}; } public annotation javax.jdo.annotations.FetchGroups extends java.lang.annotation.Annotation { javax.jdo.annotations.FetchGroup[] value(); } public annotation javax.jdo.annotations.FetchPlan extends java.lang.annotation.Annotation { String name() default ""; String[] fetchGroups() default {}; int maxFetchDepth() default 1; int fetchSize() default 0; } public annotation javax.jdo.annotations.FetchPlans extends java.lang.annotation.Annotation { javax.jdo.annotations.FetchPlan[] value(); } public annotation javax.jdo.annotations.ForeignKey extends java.lang.annotation.Annotation { String name() default ""; String table() default ""; String deferred() default ""; String unique() default ""; enum javax.jdo.annotations.ForeignKeyAction deleteAction() default javax.jdo.annotations.ForeignKeyAction.RESTRICT; enum javax.jdo.annotations.ForeignKeyAction updateAction() default javax.jdo.annotations.ForeignKeyAction.RESTRICT; String[] members() default {}; javax.jdo.annotations.Column[] columns() default {}; javax.jdo.annotations.Extension[] extensions() default {}; } public final enum javax.jdo.annotations.ForeignKeyAction extends java.lang.Enum { public static final enum javax.jdo.annotations.ForeignKeyAction UNSPECIFIED; public static final enum javax.jdo.annotations.ForeignKeyAction RESTRICT; public static final enum javax.jdo.annotations.ForeignKeyAction CASCADE; public static final enum javax.jdo.annotations.ForeignKeyAction NULL; public static final enum javax.jdo.annotations.ForeignKeyAction DEFAULT; public static final enum javax.jdo.annotations.ForeignKeyAction NONE; public static enum javax.jdo.annotations.ForeignKeyAction valueOf(java.lang.String); public static javax.jdo.annotations.ForeignKeyAction[] values(); } public annotation javax.jdo.annotations.ForeignKeys extends java.lang.annotation.Annotation { javax.jdo.annotations.ForeignKey[] value(); } public final enum javax.jdo.annotations.IdGeneratorStrategy extends java.lang.Enum { public static final enum javax.jdo.annotations.IdGeneratorStrategy UNSPECIFIED; public static final enum javax.jdo.annotations.IdGeneratorStrategy NATIVE; public static final enum javax.jdo.annotations.IdGeneratorStrategy SEQUENCE; public static final enum javax.jdo.annotations.IdGeneratorStrategy IDENTITY; public static final enum javax.jdo.annotations.IdGeneratorStrategy INCREMENT; public static final enum javax.jdo.annotations.IdGeneratorStrategy UUIDSTRING; public static final enum javax.jdo.annotations.IdGeneratorStrategy UUIDHEX; public static enum javax.jdo.annotations.IdGeneratorStrategy valueOf(java.lang.String); public static javax.jdo.annotations.IdGeneratorStrategy[] values(); } public final enum javax.jdo.annotations.IdentityType extends java.lang.Enum { public static final enum javax.jdo.annotations.IdentityType UNSPECIFIED; public static final enum javax.jdo.annotations.IdentityType APPLICATION; public static final enum javax.jdo.annotations.IdentityType DATASTORE; public static final enum javax.jdo.annotations.IdentityType NONDURABLE; public static enum javax.jdo.annotations.IdentityType valueOf(java.lang.String); public static javax.jdo.annotations.IdentityType[] values(); } public annotation javax.jdo.annotations.Index extends java.lang.annotation.Annotation { String name() default ""; String table() default ""; String unique() default ""; String[] members() default {}; javax.jdo.annotations.Column[] columns() default {}; javax.jdo.annotations.Extension[] extensions() default {}; } public annotation javax.jdo.annotations.Indices extends java.lang.annotation.Annotation { javax.jdo.annotations.Index[] value(); } public annotation javax.jdo.annotations.Inheritance extends java.lang.annotation.Annotation { enum javax.jdo.annotations.InheritanceStrategy strategy() default javax.jdo.annotations.InheritanceStrategy.UNSPECIFIED; String customStrategy() default ""; } public final enum javax.jdo.annotations.InheritanceStrategy extends java.lang.Enum { public static final enum javax.jdo.annotations.InheritanceStrategy UNSPECIFIED; public static final enum javax.jdo.annotations.InheritanceStrategy NEW_TABLE; public static final enum javax.jdo.annotations.InheritanceStrategy SUBCLASS_TABLE; public static final enum javax.jdo.annotations.InheritanceStrategy SUPERCLASS_TABLE; public static final enum javax.jdo.annotations.InheritanceStrategy COMPLETE_TABLE; public static enum javax.jdo.annotations.InheritanceStrategy valueOf(java.lang.String); public static javax.jdo.annotations.InheritanceStrategy[] values(); } public annotation javax.jdo.annotations.Join extends java.lang.annotation.Annotation { String table() default ""; String column() default ""; String indexed() default ""; String index() default ""; String unique() default ""; String uniqueKey() default ""; String outer() default ""; enum javax.jdo.annotations.ForeignKeyAction deleteAction() default javax.jdo.annotations.ForeignKeyAction.UNSPECIFIED; javax.jdo.annotations.Column[] columns() default {}; String generatePrimaryKey() default ""; String primaryKey() default ""; String generateForeignKey() default ""; String foreignKey() default ""; javax.jdo.annotations.Extension[] extensions() default {}; } public annotation javax.jdo.annotations.Joins extends java.lang.annotation.Annotation { javax.jdo.annotations.Join[] value(); } public annotation javax.jdo.annotations.Key extends java.lang.annotation.Annotation { Class[] types() default {}; String serialized() default ""; String embedded() default ""; javax.jdo.annotations.Embedded[] embeddedMapping() default {}; String dependent() default ""; String table() default ""; String column() default ""; enum javax.jdo.annotations.ForeignKeyAction deleteAction() default javax.jdo.annotations.ForeignKeyAction.UNSPECIFIED; enum javax.jdo.annotations.ForeignKeyAction updateAction() default javax.jdo.annotations.ForeignKeyAction.UNSPECIFIED; String indexed() default ""; String index() default ""; String unique() default ""; String uniqueKey() default ""; String mappedBy() default ""; javax.jdo.annotations.Column[] columns() default {}; String generateForeignKey() default ""; String foreignKey() default ""; javax.jdo.annotations.Extension[] extensions() default {}; } public annotation javax.jdo.annotations.NotPersistent extends java.lang.annotation.Annotation { } public final enum javax.jdo.annotations.NullValue extends java.lang.Enum { public static final enum javax.jdo.annotations.NullValue NONE; public static final enum javax.jdo.annotations.NullValue EXCEPTION; public static final enum javax.jdo.annotations.NullValue DEFAULT; public static enum javax.jdo.annotations.NullValue valueOf(java.lang.String); public static javax.jdo.annotations.NullValue[] values(); } public annotation javax.jdo.annotations.Order extends java.lang.annotation.Annotation { String column() default ""; String mappedBy() default ""; javax.jdo.annotations.Column[] columns() default {}; javax.jdo.annotations.Extension[] extensions() default {}; } public annotation javax.jdo.annotations.PersistenceAware extends java.lang.annotation.Annotation { } public annotation javax.jdo.annotations.PersistenceCapable extends java.lang.annotation.Annotation { javax.jdo.annotations.Persistent[] members() default {}; String table() default ""; String catalog() default ""; String schema() default ""; String requiresExtent() default ""; String embeddedOnly() default ""; String detachable() default ""; enum javax.jdo.annotations.IdentityType identityType() default javax.jdo.annotations.IdentityType.UNSPECIFIED; Class objectIdClass() default void.class; javax.jdo.annotations.Extension[] extensions() default {}; String cacheable() default "true"; String serializeRead() default "false"; } public final enum javax.jdo.annotations.PersistenceModifier extends java.lang.Enum { public static final enum javax.jdo.annotations.PersistenceModifier UNSPECIFIED; public static final enum javax.jdo.annotations.PersistenceModifier PERSISTENT; public static final enum javax.jdo.annotations.PersistenceModifier TRANSACTIONAL; public static final enum javax.jdo.annotations.PersistenceModifier NONE; public static enum javax.jdo.annotations.PersistenceModifier valueOf(java.lang.String); public static javax.jdo.annotations.PersistenceModifier[] values(); } public annotation javax.jdo.annotations.Persistent extends java.lang.annotation.Annotation { enum javax.jdo.annotations.PersistenceModifier persistenceModifier() default javax.jdo.annotations.PersistenceModifier.UNSPECIFIED; String table() default ""; String defaultFetchGroup() default ""; enum javax.jdo.annotations.NullValue nullValue() default javax.jdo.annotations.NullValue.NONE; String embedded() default ""; String embeddedElement() default ""; String embeddedKey() default ""; String embeddedValue() default ""; String serialized() default ""; String serializedElement() default ""; String serializedKey() default ""; String serializedValue() default ""; String dependent() default ""; String dependentElement() default ""; String dependentKey() default ""; String dependentValue() default ""; String primaryKey() default ""; enum javax.jdo.annotations.IdGeneratorStrategy valueStrategy() default javax.jdo.annotations.IdGeneratorStrategy.UNSPECIFIED; String customValueStrategy() default ""; String sequence() default ""; String loadFetchGroup() default ""; Class[] types() default {}; String mappedBy() default ""; javax.jdo.annotations.Column[] columns() default {}; String column() default ""; String nullIndicatorColumn() default ""; String name() default ""; int recursionDepth() default 1; javax.jdo.annotations.Extension[] extensions() default {}; String cacheable() default "true"; } public annotation javax.jdo.annotations.PrimaryKey extends java.lang.annotation.Annotation { String name() default ""; String column() default ""; javax.jdo.annotations.Column[] columns() default {}; javax.jdo.annotations.Extension[] extensions() default {}; } public annotation javax.jdo.annotations.Queries extends java.lang.annotation.Annotation { javax.jdo.annotations.Query[] value(); } public annotation javax.jdo.annotations.Query extends java.lang.annotation.Annotation { String name(); String value(); String language() default "JDOQL"; String unmodifiable() default ""; String unique() default ""; Class resultClass() default void.class; String fetchPlan() default ""; javax.jdo.annotations.Extension[] extensions() default {}; } public annotation javax.jdo.annotations.Sequence extends java.lang.annotation.Annotation { String name(); enum javax.jdo.annotations.SequenceStrategy strategy(); String datastoreSequence() default ""; Class factoryClass() default void.class; javax.jdo.annotations.Extension[] extensions() default {}; int initialValue() default 1; int allocationSize() default 50; } public final enum javax.jdo.annotations.SequenceStrategy extends java.lang.Enum { public static final enum javax.jdo.annotations.SequenceStrategy NONTRANSACTIONAL; public static final enum javax.jdo.annotations.SequenceStrategy CONTIGUOUS; public static final enum javax.jdo.annotations.SequenceStrategy NONCONTIGUOUS; public static enum javax.jdo.annotations.SequenceStrategy valueOf(java.lang.String); public static javax.jdo.annotations.SequenceStrategy[] values(); } public annotation javax.jdo.annotations.Serialized extends java.lang.annotation.Annotation { } public annotation javax.jdo.annotations.Transactional extends java.lang.annotation.Annotation { } public annotation javax.jdo.annotations.Unique extends java.lang.annotation.Annotation { String name() default ""; String table() default ""; String deferred() default ""; String[] members() default {}; javax.jdo.annotations.Column[] columns() default {}; javax.jdo.annotations.Extension[] extensions() default {}; } public annotation javax.jdo.annotations.Uniques extends java.lang.annotation.Annotation { javax.jdo.annotations.Unique[] value(); } public annotation javax.jdo.annotations.Value extends java.lang.annotation.Annotation { Class[] types() default {}; String serialized() default ""; String embedded() default ""; javax.jdo.annotations.Embedded[] embeddedMapping() default {}; String dependent() default ""; String table() default ""; String column() default ""; enum javax.jdo.annotations.ForeignKeyAction deleteAction() default javax.jdo.annotations.ForeignKeyAction.UNSPECIFIED; enum javax.jdo.annotations.ForeignKeyAction updateAction() default javax.jdo.annotations.ForeignKeyAction.UNSPECIFIED; String indexed() default ""; String index() default ""; String unique() default ""; String uniqueKey() default ""; String mappedBy() default ""; javax.jdo.annotations.Column[] columns() default {}; String generateForeignKey() default ""; String foreignKey() default ""; javax.jdo.annotations.Extension[] extensions() default {}; } public annotation javax.jdo.annotations.Version extends java.lang.annotation.Annotation { enum javax.jdo.annotations.VersionStrategy strategy() default javax.jdo.annotations.VersionStrategy.UNSPECIFIED; String customStrategy() default ""; String column() default ""; String indexed() default ""; javax.jdo.annotations.Column[] columns() default {}; javax.jdo.annotations.Extension[] extensions() default {}; } public final enum javax.jdo.annotations.VersionStrategy extends java.lang.Enum { public static final enum javax.jdo.annotations.VersionStrategy UNSPECIFIED; public static final enum javax.jdo.annotations.VersionStrategy NONE; public static final enum javax.jdo.annotations.VersionStrategy STATE_IMAGE; public static final enum javax.jdo.annotations.VersionStrategy DATE_TIME; public static final enum javax.jdo.annotations.VersionStrategy VERSION_NUMBER; public static enum javax.jdo.annotations.VersionStrategy valueOf(java.lang.String); public static javax.jdo.annotations.VersionStrategy[] values(); } public annotation javax.jdo.annotations.Cacheable extends java.lang.annotation.Annotation { String value() default "true"; } public interface javax.jdo.FetchGroup { public static final String DEFAULT = "default"; public static final String RELATIONSHIP = "relationship"; public static final String MULTIVALUED = "multivalued"; public static final String BASIC = "basic"; public static final String ALL = "all"; String getName(); Class getType(); boolean getPostLoad(); javax.jdo.FetchGroup setPostLoad(boolean postLoad); javax.jdo.FetchGroup addMember(String memberName); varargs javax.jdo.FetchGroup addMembers(String[] memberNames); javax.jdo.FetchGroup removeMember(String memberName); varargs javax.jdo.FetchGroup removeMembers(String[] memberNames); javax.jdo.FetchGroup addCategory(String categoryName); javax.jdo.FetchGroup removeCategory(String categoryName); javax.jdo.FetchGroup setRecursionDepth(String memberName, int recursionDepth); int getRecursionDepth(String memberName); java.util.Set getMembers(); javax.jdo.FetchGroup setUnmodifiable(); boolean isUnmodifiable(); int hashCode(); boolean equals(Object other); } /*** This causes some NPE in SignatureTest whatever that means ***/ /* public interface JDOEnhancer extends java.lang.instrument.ClassFileTransformer { java.util.Properties getProperties(); javax.jdo.JDOEnhancer setVerbose(boolean flag); javax.jdo.JDOEnhancer setOutputDirectory(String dirName); javax.jdo.JDOEnhancer setClassLoader(ClassLoader loader); javax.jdo.JDOEnhancer addPersistenceUnit(String persistenceUnit); javax.jdo.JDOEnhancer addClass(String className, byte[] bytes); javax.jdo.JDOEnhancer addClasses(String... classNames); javax.jdo.JDOEnhancer addFiles(String... metadataFiles); javax.jdo.JDOEnhancer addJar(String jarFileName); int enhance(); int validate(); byte[] getEnhancedBytes(String className); void registerMetadata(javax.jdo.metadata.JDOMetadata metadata); javax.jdo.metadata.JDOMetadata newMetadata(); } */ tck/src/conf/jdohelper.conf100664 6523 12500110374 16216 0ustarmbouschenstaff 0 0 # 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 = All jdohelper tests with standard mapping, no testdata. jdo.tck.mapping.companyfactory = jdo.tck.testdata = jdo.tck.standarddata = jdo.tck.mapping = 0 jdo.tck.requiredOptions = jdo.tck.classes = \ org.apache.jdo.tck.api.jdohelper.GetObjectId \ org.apache.jdo.tck.api.jdohelper.GetObjectIdForNull \ org.apache.jdo.tck.api.jdohelper.GetObjectIdForTransient \ org.apache.jdo.tck.api.jdohelper.GetObjectIdNotPersistenceCapable \ org.apache.jdo.tck.api.jdohelper.GetObjectIds \ org.apache.jdo.tck.api.jdohelper.GetPersistenceManager \ org.apache.jdo.tck.api.jdohelper.GetPersistenceManagerForNull \ org.apache.jdo.tck.api.jdohelper.GetPersistenceManagerForTransient \ org.apache.jdo.tck.api.jdohelper.GetPersistenceManagerNotPersistenceCapable \ org.apache.jdo.tck.api.jdohelper.GetTransactionalObjectId \ org.apache.jdo.tck.api.jdohelper.GetTransactionalObjectIdForNull \ org.apache.jdo.tck.api.jdohelper.GetTransactionalObjectIdForTransient \ org.apache.jdo.tck.api.jdohelper.GetTransactionalObjectIdNotPersistenceCapable \ org.apache.jdo.tck.api.jdohelper.IsDeleted \ org.apache.jdo.tck.api.jdohelper.IsDeletedFalse \ org.apache.jdo.tck.api.jdohelper.IsDeletedForNull \ org.apache.jdo.tck.api.jdohelper.IsDeletedForTransient \ org.apache.jdo.tck.api.jdohelper.IsDeletedNotPersistenceCapable \ org.apache.jdo.tck.api.jdohelper.IsDirty \ org.apache.jdo.tck.api.jdohelper.IsDirtyFalse \ org.apache.jdo.tck.api.jdohelper.IsDirtyForNull \ org.apache.jdo.tck.api.jdohelper.IsDirtyForTransient \ org.apache.jdo.tck.api.jdohelper.IsDirtyNotPersistenceCapable \ org.apache.jdo.tck.api.jdohelper.IsNew \ org.apache.jdo.tck.api.jdohelper.IsNewFalse \ org.apache.jdo.tck.api.jdohelper.IsNewForNull \ org.apache.jdo.tck.api.jdohelper.IsNewForTransient \ org.apache.jdo.tck.api.jdohelper.IsNewNotPersistenceCapable \ org.apache.jdo.tck.api.jdohelper.IsPersistent \ org.apache.jdo.tck.api.jdohelper.IsPersistentFalse \ org.apache.jdo.tck.api.jdohelper.IsPersistentForNull \ org.apache.jdo.tck.api.jdohelper.IsPersistentForTransient \ org.apache.jdo.tck.api.jdohelper.IsPersistentNotPersistenceCapable \ org.apache.jdo.tck.api.jdohelper.IsTransactional \ org.apache.jdo.tck.api.jdohelper.IsTransactionalFalse \ org.apache.jdo.tck.api.jdohelper.IsTransactionalForNull \ org.apache.jdo.tck.api.jdohelper.IsTransactionalForTransient \ org.apache.jdo.tck.api.jdohelper.IsTransactionalNotPersistenceCapable \ org.apache.jdo.tck.api.jdohelper.MakeDirty \ org.apache.jdo.tck.api.jdohelper.MakeDirtyForNull \ org.apache.jdo.tck.api.jdohelper.MakeDirtyForTransient \ org.apache.jdo.tck.api.jdohelper.MakeDirtyNotPersistenceCapable tck/src/conf/jdoql.conf100664 15745 12500110374 15401 0ustarmbouschenstaff 0 0 # 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 = All jdoql tests with standard mapping, no testdata. jdo.tck.mapping.companyfactory = jdo.tck.testdata = jdo.tck.standarddata = jdo.tck.mapping = 0 jdo.tck.requiredOptions = jdo.tck.classes = \ org.apache.jdo.tck.query.jdoql.AssignmentPrePostIncrementDecrementNotSupported \ org.apache.jdo.tck.query.jdoql.Cast \ org.apache.jdo.tck.query.jdoql.CharacterAndStringLiterals \ org.apache.jdo.tck.query.jdoql.ComparingCollectionFieldToNull \ org.apache.jdo.tck.query.jdoql.ComparingPersistentAndNonPersistentInstance \ org.apache.jdo.tck.query.jdoql.DenoteUniquenessInFilter \ org.apache.jdo.tck.query.jdoql.ExecuteQueryWhenPersistenceManagerIsClosed \ org.apache.jdo.tck.query.jdoql.ExecutingMultipleQueriesSimultaneouslyIsThreadSafe \ org.apache.jdo.tck.query.jdoql.ExecutingQueryWhenNoTransactionNoNontransactionalRead \ org.apache.jdo.tck.query.jdoql.Having \ org.apache.jdo.tck.query.jdoql.IdentifiersEqualFieldNames \ org.apache.jdo.tck.query.jdoql.IfElseInFilter \ org.apache.jdo.tck.query.jdoql.IgnoreCacheFalse \ org.apache.jdo.tck.query.jdoql.MultipleActiveQueryInstanceInSamePersistenceManager \ org.apache.jdo.tck.query.jdoql.MultipleIdenticalImports \ org.apache.jdo.tck.query.jdoql.NamespaceOfIdentifiers \ org.apache.jdo.tck.query.jdoql.NavigationThroughACollectionField \ org.apache.jdo.tck.query.jdoql.NavigationThroughANullValuedField \ org.apache.jdo.tck.query.jdoql.NavigationThroughReferencesUsesDotOperator \ org.apache.jdo.tck.query.jdoql.NegativeRange \ org.apache.jdo.tck.query.jdoql.NullCollectionsAndContainsMethod \ org.apache.jdo.tck.query.jdoql.NullCollectionsAndIsEmpty \ org.apache.jdo.tck.query.jdoql.OrderingSpecification \ org.apache.jdo.tck.query.jdoql.ParenthesesMarkOperatorPrecedence \ org.apache.jdo.tck.query.jdoql.PositiveRange \ org.apache.jdo.tck.query.jdoql.QueryIsSerializable \ org.apache.jdo.tck.query.jdoql.QueryResultPassedToAnotherQuery \ org.apache.jdo.tck.query.jdoql.QueryWithNoFilter \ org.apache.jdo.tck.query.jdoql.RangeAsString \ org.apache.jdo.tck.query.jdoql.RestoredSerializedQueryInstanceLosesAssociationWithPM \ org.apache.jdo.tck.query.jdoql.SeparateNamespaceForTypeNames \ org.apache.jdo.tck.query.jdoql.WhiteSpaceIsACharacterAndIgnored \ org.apache.jdo.tck.query.jdoql.keywords.InvalidUseOfKeywords \ org.apache.jdo.tck.query.jdoql.keywords.KeywordsAsFieldNames \ org.apache.jdo.tck.query.jdoql.keywords.SingleString \ org.apache.jdo.tck.query.jdoql.keywords.ThisIsReservedWordForElementOfCollection \ org.apache.jdo.tck.query.jdoql.keywords.UppercaseLowercase \ org.apache.jdo.tck.query.jdoql.keywords.UseOfThisToAcessHiddenField \ org.apache.jdo.tck.query.jdoql.methods.EnumMethodToString \ org.apache.jdo.tck.query.jdoql.methods.MethodsAndObjectConstructionNotSupported \ org.apache.jdo.tck.query.jdoql.methods.StartsWithAndEndsWith \ org.apache.jdo.tck.query.jdoql.methods.SupportedCollectionMethods \ org.apache.jdo.tck.query.jdoql.methods.SupportedDateMethods \ org.apache.jdo.tck.query.jdoql.methods.SupportedTimeMethods \ org.apache.jdo.tck.query.jdoql.methods.SupportedJDOHelperMethods \ org.apache.jdo.tck.query.jdoql.methods.SupportedListMethods \ org.apache.jdo.tck.query.jdoql.methods.SupportedMapMethods \ org.apache.jdo.tck.query.jdoql.methods.SupportedMathMethods \ org.apache.jdo.tck.query.jdoql.methods.SupportedStringMethods \ org.apache.jdo.tck.query.jdoql.operators.BinaryAddition \ org.apache.jdo.tck.query.jdoql.operators.BinarySubtraction \ org.apache.jdo.tck.query.jdoql.operators.BitwiseComplement \ org.apache.jdo.tck.query.jdoql.operators.BooleanLogicalAND \ org.apache.jdo.tck.query.jdoql.operators.BooleanLogicalOR \ org.apache.jdo.tck.query.jdoql.operators.ConditionalAND \ org.apache.jdo.tck.query.jdoql.operators.ConditionalOR \ org.apache.jdo.tck.query.jdoql.operators.Division \ org.apache.jdo.tck.query.jdoql.operators.Equality \ org.apache.jdo.tck.query.jdoql.operators.EqualityAndComparisonsBetweenDateFieldsAndParameters \ org.apache.jdo.tck.query.jdoql.operators.EqualityAndComparisonsBetweenPrimitivesAndWrapperInstances \ org.apache.jdo.tck.query.jdoql.operators.EqualityAndComparisonsBetweenStringFieldsAndParameters \ org.apache.jdo.tck.query.jdoql.operators.GreaterThan \ org.apache.jdo.tck.query.jdoql.operators.GreaterThanOrEqual \ org.apache.jdo.tck.query.jdoql.operators.Instanceof \ org.apache.jdo.tck.query.jdoql.operators.LessThan \ org.apache.jdo.tck.query.jdoql.operators.LessThanOrEqual \ org.apache.jdo.tck.query.jdoql.operators.LogicalComplement \ org.apache.jdo.tck.query.jdoql.operators.Multiplication \ org.apache.jdo.tck.query.jdoql.operators.Modulo \ org.apache.jdo.tck.query.jdoql.operators.NotEquals \ org.apache.jdo.tck.query.jdoql.operators.PromotionOfNumericOperands \ org.apache.jdo.tck.query.jdoql.operators.SignInversion \ org.apache.jdo.tck.query.jdoql.operators.StringConcatenation \ org.apache.jdo.tck.query.jdoql.operators.UnaryPlus \ org.apache.jdo.tck.query.jdoql.parameters.BoundParameterCheck \ org.apache.jdo.tck.query.jdoql.parameters.ImplicitParameters \ org.apache.jdo.tck.query.jdoql.parameters.MixedParameters \ org.apache.jdo.tck.query.jdoql.parameters.OrderOfParameters \ org.apache.jdo.tck.query.jdoql.parameters.ParameterBoundToDifferentPM \ org.apache.jdo.tck.query.jdoql.parameters.ParameterDeclaredWithSameNameAsFieldOfCandidateClass \ org.apache.jdo.tck.query.jdoql.parameters.PrimitiveParameterPassedAsNull \ org.apache.jdo.tck.query.jdoql.subqueries.AggregateOnSize \ org.apache.jdo.tck.query.jdoql.subqueries.CorrelatedSubqueries \ org.apache.jdo.tck.query.jdoql.subqueries.CorrelatedSubqueriesWithParameters \ org.apache.jdo.tck.query.jdoql.subqueries.MultipleCallsReplaceSubquery \ org.apache.jdo.tck.query.jdoql.subqueries.NonCorrelatedSubqueries \ org.apache.jdo.tck.query.jdoql.subqueries.NullCandidateCollectionExpression \ org.apache.jdo.tck.query.jdoql.subqueries.NullSubqueryParameter \ org.apache.jdo.tck.query.jdoql.subqueries.NullVariableDeclaration \ org.apache.jdo.tck.query.jdoql.subqueries.UnmodifiedSubqueryInstance \ org.apache.jdo.tck.query.jdoql.variables.MixedVariables \ org.apache.jdo.tck.query.jdoql.variables.UnconstrainedVariable \ org.apache.jdo.tck.query.jdoql.variables.VariablesAndFields \ org.apache.jdo.tck.query.jdoql.variables.VariablesWithoutExtent \ org.apache.jdo.tck.query.jdoql.variables.VariableDeclaredWithSameNameAsFieldOfCandidateClass tck/src/conf/jdoql1.conf100664 2062 12500110374 15426 0ustarmbouschenstaff 0 0 # 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 = Special jdoql test with mapping 1 which maps Enums to integer columns jdo.tck.mapping.companyfactory = jdo.tck.testdata = jdo.tck.standarddata = jdo.tck.mapping = 1 jdo.tck.requiredOptions = jdo.tck.classes = \ org.apache.jdo.tck.query.jdoql.methods.EnumMethodOrdinal tck/src/conf/jdori-jdoconfig.xml100664 27175 12500110374 17212 0ustarmbouschenstaff 0 0 /> tck/src/conf/jdori-persistence.xml100664 13237 12500110374 17566 0ustarmbouschenstaff 0 0 relations.Deity tck/src/conf/jdori-pmf.properties100664 3766 12500110374 17406 0ustarmbouschenstaff 0 0 # 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. # ------------------------------------------------------------------- # P R O J E C T P R O P E R T I E S # ------------------------------------------------------------------- # # JDORI PMF Properties javax.jdo.PersistenceManagerFactoryClass=org.datanucleus.api.jdo.JDOPersistenceManagerFactory javax.jdo.option.ConnectionDriverName=org.apache.derby.jdbc.EmbeddedDriver javax.jdo.option.ConnectionURL=jdbc:derby:jdotckdb javax.jdo.option.ConnectionUserName=tckuser javax.jdo.option.ConnectionPassword=tckuser javax.jdo.option.Optimistic=false javax.jdo.option.NontransactionalWrite=false javax.jdo.option.NontransactionalRead=false javax.jdo.option.RetainValues=false javax.jdo.option.RestoreValues=false datanucleus.metadata.validate=false datanucleus.validateTables=false datanucleus.validateConstraints=false datanucleus.autoCreateSchema=false datanucleus.autoCreateTables=false datanucleus.autoCreateConstraints=false datanucleus.autoCreateColumns=false datanucleus.rdbms.CheckExistTablesOrViews=false datanucleus.autoStartMechanism=None datanucleus.connectionPoolingType=C3P0 datanucleus.connectionPool.maxStatements=20 datanucleus.implementationCreatorName=asm datanucleus.rdbms.omitDatabaseMetaDataGetColumns=true datanucleus.nontx.atomic=false tck/src/conf/jndi.properties100664 1535 12500110374 16433 0ustarmbouschenstaff 0 0 # # 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. java.naming.factory.initial=com.sun.jndi.fscontext.RefFSContextFactory tck/src/conf/lifecycle.conf100664 4052 12500110374 16174 0ustarmbouschenstaff 0 0 # 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 = All lifecycle tests with standard mapping, no testdata. jdo.tck.mapping.companyfactory = jdo.tck.testdata = jdo.tck.standarddata = jdo.tck.mapping = 0 jdo.tck.requiredOptions = jdo.tck.classes = \ org.apache.jdo.tck.lifecycle.HollowInstanceMaintainsPK \ org.apache.jdo.tck.lifecycle.MultiplePMsReturnInstancesRepresentingSamePC \ org.apache.jdo.tck.lifecycle.NontransactionalWriteThrows \ org.apache.jdo.tck.lifecycle.NontransactionalWriteDatastoreRollback \ org.apache.jdo.tck.lifecycle.NontransactionalWriteDatastoreCommit \ org.apache.jdo.tck.lifecycle.NontransactionalWriteDatastoreCommitConflict \ org.apache.jdo.tck.lifecycle.NontransactionalWriteOptimisticRollback \ org.apache.jdo.tck.lifecycle.NontransactionalWriteOptimisticCommit \ org.apache.jdo.tck.lifecycle.NontransactionalWriteOptimisticCommitConflict \ org.apache.jdo.tck.lifecycle.ObjectIdNotModifiedWhenObjectIdInstanceModified \ org.apache.jdo.tck.lifecycle.PMReturnsIdenticalInstancesForEqualObjIds \ org.apache.jdo.tck.lifecycle.PMsCanSharePCClassesButNotPCInstances \ org.apache.jdo.tck.lifecycle.StateTransitions \ org.apache.jdo.tck.lifecycle.StateTransitionsReturnedObjects \ org.apache.jdo.tck.lifecycle.TransientTransactionalStateCommit \ org.apache.jdo.tck.lifecycle.TransientTransactionalStateRollback tck/src/conf/log4j.properties100664 7741 12500110374 16533 0ustarmbouschenstaff 0 0 # # 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. ############################# # TCK loggers and appenders ############################# # Root logger log4j.rootLogger = ERROR, TCK # TCK logger log4j.logger.org.apache.jdo.tck = INFO, TCK log4j.additivity.org.apache.jdo.tck = false # SpringFramework loggers log4j.logger.org.springframework = ERROR, TCK log4j.additivity.org.springframework = false log4j.logger.org.apache.jdo.tck.pc.company.CompanyModelReader = ERROR, TCK log4j.logger.org.apache.jdo.tck.pc.mylib.MylibReader = ERROR, TCK # TCK appenders log4j.appender.TCK = org.apache.jdo.tck.util.TCKFileAppender log4j.appender.TCK.File = tck.txt log4j.appender.TCK.layout = org.apache.log4j.PatternLayout log4j.appender.TCK.layout.ConversionPattern = %d{HH:mm:ss,SSS} (%t) %-5p [%c] - %m%n ############################################ # JDO vendor specific loggers and appenders ############################################ #log4j.logger. = INFO #log4j.additivity. = false #log4j.appender. = org.apache.jdo.tck.util.TCKFileAppender #log4j.appender..File = .txt #log4j.appender..layout = org.apache.log4j.PatternLayout #log4j.appender..layout.ConversionPattern = %d{HH:mm:ss,SSS} (%t) %-5p [%c] - %m%n ################################### # DataNucleus loggers and appenders ################################### # DataNucleus loggers # For more details on DataNucleus logging see # http://www.datanucleus.org/products/accessplatform/logging.html log4j.logger.DataNucleus = INFO, DataNucleus log4j.logger.DataNucleus.Enhancer = INFO, DataNucleus log4j.additivity.DataNucleus = false #log4j.logger.DataNucleus.JDO = INFO, DataNucleus #log4j.logger.DataNucleus.Persistence = INFO, DataNucleus #log4j.logger.DataNucleus.Query = INFO, DataNucleus #log4j.logger.DataNucleus.Lifecycle = INFO, DataNucleus #log4j.logger.DataNucleus.Reachability = INFO, DataNucleus #log4j.logger.DataNucleus.Cache = INFO, DataNucleus #log4j.logger.DataNucleus.ClassLoading = INFO, DataNucleus #log4j.logger.DataNucleus.MetaData = DEBUG, DataNucleus #log4j.logger.DataNucleus.Management = DEBUG, DataNucleus #log4j.logger.DataNucleus.General = DEBUG, DataNucleus #log4j.logger.DataNucleus.Connection = DEBUG, DataNucleus #log4j.logger.DataNucleus.JCA = DEBUG, DataNucleus #log4j.logger.DataNucleus.Transaction = INFO, DataNucleus #log4j.logger.DataNucleus.Plugin = INFO, DataNucleus #log4j.logger.DataNucleus.Store.Poid = INFO, DataNucleus #log4j.logger.DataNucleus.Datastore = DEBUG, DataNucleus #log4j.logger.DataNucleus.Datastore.Schema = INFO, DataNucleus #log4j.logger.DataNucleus.Datastore.Persist = INFO, DataNucleus #log4j.logger.DataNucleus.Datastore.Retrieve = DEBUG, DataNucleus #log4j.logger.DataNucleus.SchemaTool = INFO, DataNucleus # C3P0 loggers log4j.logger.com.mchange.v2 = INFO, DataNucleus log4j.additivity.com.mchange.v2 = false # DataNucleus appenders log4j.appender.DataNucleus = org.apache.jdo.tck.util.TCKFileAppender #log4j.appender.DataNucleus = org.apache.log4j.FileAppender log4j.appender.DataNucleus.Enhancer.File = datanucleus.txt log4j.appender.DataNucleus.File = datanucleus.txt log4j.appender.DataNucleus.layout = org.apache.log4j.PatternLayout log4j.appender.DataNucleus.layout.ConversionPattern = %d{HH:mm:ss,SSS} (%t) %-5p [%c] - %m%n tck/src/conf/logging.properties100664 3762 12500110374 17141 0ustarmbouschenstaff 0 0 # # 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 is a sample properties file to configure standard JDK 1.4 logging for # the JDO TCK test cases. Below you find an entry for each of the JDO TCK # logger instances. Please uncomment the line and adapt the log level to your # needs, in case to want to enable a particular logger. # # The following describes the mapping between the log level of JDK 1.4 logging # and apache commns logging: # JDK 1.4 Apache # FINEST trace # FINE, FINER debug # INFO, CONFIG info # WARNING warn # SEVERE error, fatal # ############################# # TCK loggers and appenders ############################# # Root logger .level = SEVERE # TCK logger org.apache.jdo.tck.level = INFO # SpringFramework loggers org.springframework.level = SEVERE org.apache.jdo.tck.pc.company.CompanyModelReader.level = SEVERE org.apache.jdo.tck.pc.mylib.MylibReader = SEVERE org.apache.jdo.tck.util.TCKFileHandler.fileName = tck.txt org.apache.jdo.tck.util.TCKFileHandler.level = FINEST ############################## # JDO vendor specific loggers ############################## # = INFO ###################### # Default handlers ###################### handlers = org.apache.jdo.tck.util.TCKFileHandler tck/src/conf/models.conf100664 10173 12500110374 15541 0ustarmbouschenstaff 0 0 # 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 = All model tests with standard mapping, no testdata. jdo.tck.mapping.companyfactory = jdo.tck.testdata = jdo.tck.standarddata = jdo.tck.mapping = 0 jdo.tck.requiredOptions = jdo.tck.classes = \ org.apache.jdo.tck.models.embedded.SecondClassObjectsTrackTheirChanges \ org.apache.jdo.tck.models.fieldtypes.TestArrayCollections \ org.apache.jdo.tck.models.fieldtypes.TestArrayListCollections \ org.apache.jdo.tck.models.fieldtypes.TestCollectionCollections \ org.apache.jdo.tck.models.fieldtypes.TestFieldsOfBigDecimal \ org.apache.jdo.tck.models.fieldtypes.TestFieldsOfBigInteger \ org.apache.jdo.tck.models.fieldtypes.TestFieldsOfBoolean \ org.apache.jdo.tck.models.fieldtypes.TestFieldsOfByte \ org.apache.jdo.tck.models.fieldtypes.TestFieldsOfCharacter \ org.apache.jdo.tck.models.fieldtypes.TestFieldsOfDate \ org.apache.jdo.tck.models.fieldtypes.TestFieldsOfDouble \ org.apache.jdo.tck.models.fieldtypes.TestFieldsOfFloat \ org.apache.jdo.tck.models.fieldtypes.TestFieldsOfInteger \ org.apache.jdo.tck.models.fieldtypes.TestFieldsOfLocale \ org.apache.jdo.tck.models.fieldtypes.TestFieldsOfLong \ org.apache.jdo.tck.models.fieldtypes.TestFieldsOfObject \ org.apache.jdo.tck.models.fieldtypes.TestFieldsOfPrimitiveboolean \ org.apache.jdo.tck.models.fieldtypes.TestFieldsOfPrimitivebyte \ org.apache.jdo.tck.models.fieldtypes.TestFieldsOfPrimitivechar \ org.apache.jdo.tck.models.fieldtypes.TestFieldsOfPrimitivedouble \ org.apache.jdo.tck.models.fieldtypes.TestFieldsOfPrimitivefloat \ org.apache.jdo.tck.models.fieldtypes.TestFieldsOfPrimitiveint \ org.apache.jdo.tck.models.fieldtypes.TestFieldsOfPrimitivelong \ org.apache.jdo.tck.models.fieldtypes.TestFieldsOfPrimitiveshort \ org.apache.jdo.tck.models.fieldtypes.TestFieldsOfShort \ org.apache.jdo.tck.models.fieldtypes.TestFieldsOfSimpleClass \ org.apache.jdo.tck.models.fieldtypes.TestFieldsOfSimpleEnum \ org.apache.jdo.tck.models.fieldtypes.TestFieldsOfSimpleInterface \ org.apache.jdo.tck.models.fieldtypes.TestFieldsOfString \ org.apache.jdo.tck.models.fieldtypes.TestHashMapStringKeyCollections \ org.apache.jdo.tck.models.fieldtypes.TestHashMapStringValueCollections \ org.apache.jdo.tck.models.fieldtypes.TestHashSetCollections \ org.apache.jdo.tck.models.fieldtypes.TestHashtableStringKeyCollections \ org.apache.jdo.tck.models.fieldtypes.TestHashtableStringValueCollections \ org.apache.jdo.tck.models.fieldtypes.TestLinkedListCollections \ org.apache.jdo.tck.models.fieldtypes.TestListCollections \ org.apache.jdo.tck.models.fieldtypes.TestMapStringKeyCollections \ org.apache.jdo.tck.models.fieldtypes.TestMapStringValueCollections \ org.apache.jdo.tck.models.fieldtypes.TestSetCollections \ org.apache.jdo.tck.models.fieldtypes.TestTreeMapStringKeyCollections \ org.apache.jdo.tck.models.fieldtypes.TestTreeMapStringValueCollections \ org.apache.jdo.tck.models.fieldtypes.TestTreeSetCollections \ org.apache.jdo.tck.models.fieldtypes.TestVectorCollections \ org.apache.jdo.tck.models.inheritance.FieldWithSameNameInSuperclass \ org.apache.jdo.tck.models.inheritance.NonPersistentFieldsAreNonPersistentInSubclasses \ org.apache.jdo.tck.models.inheritance.NonpersistentSuperClass \ org.apache.jdo.tck.models.inheritance.PersistenceCapableFlexibilityInInheritanceHierarchy \ org.apache.jdo.tck.models.inheritance.PersistentFieldsArePersistentInSubClasses \ org.apache.jdo.tck.models.inheritance.TransactionalFieldsAreTransactionalInSubclasses tck/src/conf/models1.conf100664 2044 12500110374 15600 0ustarmbouschenstaff 0 0 # 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 = All model tests with standard mapping, no testdata. jdo.tck.mapping.companyfactory = jdo.tck.testdata = jdo.tck.standarddata = jdo.tck.mapping = 1 jdo.tck.requiredOptions = jdo.tck.classes = \ org.apache.jdo.tck.models.fieldtypes.TestFieldsOfSimpleEnum tck/src/conf/pm.conf100664 23113 12500110374 14670 0ustarmbouschenstaff 0 0 # 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 = All pm tests with standard mapping, no testdata. jdo.tck.mapping.companyfactory = jdo.tck.testdata = jdo.tck.standarddata = jdo.tck.mapping = 0 jdo.tck.requiredOptions = jdo.tck.classes = \ org.apache.jdo.tck.api.persistencemanager.ChangingObjectIdHasNoEffectOnInstance \ org.apache.jdo.tck.api.persistencemanager.ConcurrentPersistenceManagers \ org.apache.jdo.tck.api.persistencemanager.ConcurrentPersistenceManagersSameClasses \ org.apache.jdo.tck.api.persistencemanager.CurrentTransaction \ org.apache.jdo.tck.api.persistencemanager.DataStoreCacheTest \ org.apache.jdo.tck.api.persistencemanager.DataStoreConnection \ org.apache.jdo.tck.api.persistencemanager.DataStoreConnectionThrows \ org.apache.jdo.tck.api.persistencemanager.DatastoreTimeout \ org.apache.jdo.tck.api.persistencemanager.DeletePersistent \ org.apache.jdo.tck.api.persistencemanager.DeletePersistentAllFails \ org.apache.jdo.tck.api.persistencemanager.DeletePersistentFailsIfInstanceIsTransient \ org.apache.jdo.tck.api.persistencemanager.DeletePersistentFailsIfInstanceManagedByAnotherPersistenceManager \ org.apache.jdo.tck.api.persistencemanager.DeletePersistentHasNoEffectOnDeletedInstances \ org.apache.jdo.tck.api.persistencemanager.GetPersistenceManagerFactory \ org.apache.jdo.tck.api.persistencemanager.GetProperties \ org.apache.jdo.tck.api.persistencemanager.GetSetUserObject \ org.apache.jdo.tck.api.persistencemanager.GetTransactionalObjectIdWhenObjectIdBeingChanged \ org.apache.jdo.tck.api.persistencemanager.GetTransactionalObjectIdWithNoTransaction \ org.apache.jdo.tck.api.persistencemanager.NewInstance \ org.apache.jdo.tck.api.persistencemanager.NoPersistenceManagerIfTransient \ org.apache.jdo.tck.api.persistencemanager.ObjectIdUniqueAmongInstances \ org.apache.jdo.tck.api.persistencemanager.OneInstanceOfObjectPerPersistenceManager \ org.apache.jdo.tck.api.persistencemanager.OnePersistenceManagerIfPersistentOrTransactional \ org.apache.jdo.tck.api.persistencemanager.OptimisticFailure \ org.apache.jdo.tck.api.persistencemanager.SameTransactionInstanceForAllCallsToCurrentTransaction \ org.apache.jdo.tck.api.persistencemanager.ThreadSafe \ org.apache.jdo.tck.api.persistencemanager.TransientTransactionalInstanceRetainsValuesAtCommit \ org.apache.jdo.tck.api.persistencemanager.cache.CallingEvictAllWithCollectionContainingNulls \ org.apache.jdo.tck.api.persistencemanager.cache.CallingRefreshAllWithCollectionContainingNulls \ org.apache.jdo.tck.api.persistencemanager.cache.EvictAllWithNoParameters \ org.apache.jdo.tck.api.persistencemanager.cache.EvictingCollectionOfInstancesSideEffects \ org.apache.jdo.tck.api.persistencemanager.cache.EvictingWithRestoreValuesFalse \ org.apache.jdo.tck.api.persistencemanager.cache.EvictingWithRetainValuesFalse \ org.apache.jdo.tck.api.persistencemanager.cache.PassingNullToEvictAllThrowsException \ org.apache.jdo.tck.api.persistencemanager.cache.PassingNullToEvictHasNoEffect \ org.apache.jdo.tck.api.persistencemanager.cache.PassingNullToRefreshAllThrowsException \ org.apache.jdo.tck.api.persistencemanager.cache.PassingNullToRefreshHasNoEffect \ org.apache.jdo.tck.api.persistencemanager.cache.RefreshAllNoParameterSideEffects \ org.apache.jdo.tck.api.persistencemanager.cache.RefreshAllSideEffects \ org.apache.jdo.tck.api.persistencemanager.cache.RefreshAllWithNoParameters \ org.apache.jdo.tck.api.persistencemanager.cache.RefreshSideEffects \ org.apache.jdo.tck.api.persistencemanager.cache.Retrieve \ org.apache.jdo.tck.api.persistencemanager.close.AfterCloseAllMethodsThrowException \ org.apache.jdo.tck.api.persistencemanager.close.CloseThrowsExceptionWhenActiveTx \ org.apache.jdo.tck.api.persistencemanager.close.IsClosedIsFalseUponConstruction \ org.apache.jdo.tck.api.persistencemanager.close.IsClosedIsFalseUponRetrievalFromPool \ org.apache.jdo.tck.api.persistencemanager.close.IsClosedIsTrueAfterClose \ org.apache.jdo.tck.api.persistencemanager.extent.GetExtentWithInstancesMadePersistentViaReachability \ org.apache.jdo.tck.api.persistencemanager.extent.GetExtentWithNoSubclasses \ org.apache.jdo.tck.api.persistencemanager.extent.GetExtentWithSubclasses \ org.apache.jdo.tck.api.persistencemanager.flags.GetIgnoreCache \ org.apache.jdo.tck.api.persistencemanager.flags.SetIgnoreCacheToFalse \ org.apache.jdo.tck.api.persistencemanager.flags.SetIgnoreCacheToTrue \ org.apache.jdo.tck.api.persistencemanager.flags.SetMultithreadedFalse \ org.apache.jdo.tck.api.persistencemanager.flags.SetMultithreadedTrue \ org.apache.jdo.tck.api.persistencemanager.flags.SettingFlagsWithTransactionInstance \ org.apache.jdo.tck.api.persistencemanager.getobject.GetObjectById \ org.apache.jdo.tck.api.persistencemanager.getobject.GetObjectByIdExactClass \ org.apache.jdo.tck.api.persistencemanager.getobject.GetObjectByIdNoValidationInstanceInCache \ org.apache.jdo.tck.api.persistencemanager.getobject.GetObjectByIdNoValidationInstanceInCacheNoStateChange \ org.apache.jdo.tck.api.persistencemanager.getobject.GetObjectByIdNoValidationInstanceNotInCache \ org.apache.jdo.tck.api.persistencemanager.getobject.GetObjectByIdNoValidationInstanceNotInCacheNoTx \ org.apache.jdo.tck.api.persistencemanager.getobject.GetObjectByIdNoValidationInstanceNotInDatastore \ org.apache.jdo.tck.api.persistencemanager.getobject.GetObjectByIdNotResolved \ org.apache.jdo.tck.api.persistencemanager.getobject.GetObjectByIdWithValidationInstanceInCache \ org.apache.jdo.tck.api.persistencemanager.getobject.GetObjectByIdWithValidationInstanceInCacheNotInDatastore \ org.apache.jdo.tck.api.persistencemanager.getobject.GetObjectByIdWithValidationInstanceNotInCacheNotInDatastore \ org.apache.jdo.tck.api.persistencemanager.getobject.GetObjectsById \ org.apache.jdo.tck.api.persistencemanager.getobject.GetObjectId \ org.apache.jdo.tck.api.persistencemanager.getobject.GetObjectIdClass \ org.apache.jdo.tck.api.persistencemanager.getobject.GetObjectIdClassForAbstractOrNonPersistenceCapableClass \ org.apache.jdo.tck.api.persistencemanager.getobject.GetObjectIdForNullOrNotPersistent \ org.apache.jdo.tck.api.persistencemanager.getobject.GetObjectIdWithApplicationModifyingIdentity \ org.apache.jdo.tck.api.persistencemanager.lifecycle.MakeNontransactionalAllFails \ org.apache.jdo.tck.api.persistencemanager.lifecycle.MakeNontransactionalDirtyInstance \ org.apache.jdo.tck.api.persistencemanager.lifecycle.MakeNontransactionalIsImmediate \ org.apache.jdo.tck.api.persistencemanager.lifecycle.MakeNontransactionalPersistentCleanInstance \ org.apache.jdo.tck.api.persistencemanager.lifecycle.MakeNontransactionalTransientCleanInstance \ org.apache.jdo.tck.api.persistencemanager.lifecycle.MakePersistent \ org.apache.jdo.tck.api.persistencemanager.lifecycle.MakePersistentAllFails \ org.apache.jdo.tck.api.persistencemanager.lifecycle.MakePersistentAndInstancesNotReachable \ org.apache.jdo.tck.api.persistencemanager.lifecycle.MakePersistentAssignsObjectId \ org.apache.jdo.tck.api.persistencemanager.lifecycle.MakePersistentFailsIfInstanceManagedByAnotherPersistenceManager \ org.apache.jdo.tck.api.persistencemanager.lifecycle.MakePersistentHasNoEffectOnPersistentInstances \ org.apache.jdo.tck.api.persistencemanager.lifecycle.MakeTransactional \ org.apache.jdo.tck.api.persistencemanager.lifecycle.MakeTransactionalANontransactionalPersistentInstance \ org.apache.jdo.tck.api.persistencemanager.lifecycle.MakeTransactionalAllFails \ org.apache.jdo.tck.api.persistencemanager.lifecycle.MakeTransactionalIsImmediate \ org.apache.jdo.tck.api.persistencemanager.lifecycle.MakeTransactionalPriorToTransactionRolledback \ org.apache.jdo.tck.api.persistencemanager.lifecycle.MakeTransactionalWithinTransactionRolledback \ org.apache.jdo.tck.api.persistencemanager.lifecycle.MakeTransient \ org.apache.jdo.tck.api.persistencemanager.lifecycle.MakeTransientAllFails \ org.apache.jdo.tck.api.persistencemanager.lifecycle.MakeTransientCausesLossOfIdentity \ org.apache.jdo.tck.api.persistencemanager.lifecycle.MakeTransientFailsWithDirtyInstance \ org.apache.jdo.tck.api.persistencemanager.lifecycle.MakeTransientFieldsPreservedUnchanged \ org.apache.jdo.tck.api.persistencemanager.lifecycle.MakeTransientHasNoEffectOnTransientInstances \ org.apache.jdo.tck.api.persistencemanager.lifecycle.MakeTransientNotSubjectToRollback \ org.apache.jdo.tck.api.persistencemanager.nullargs.MakePersistentNullArgs \ org.apache.jdo.tck.api.persistencemanager.nullargs.DeletePersistentNullArgs \ org.apache.jdo.tck.api.persistencemanager.nullargs.DetachCopyNullArgs \ org.apache.jdo.tck.api.persistencemanager.nullargs.MakeTransientNullArgs \ org.apache.jdo.tck.api.persistencemanager.nullargs.EvictNullArgs \ org.apache.jdo.tck.api.persistencemanager.nullargs.MakeNontransactionalNullArgs \ org.apache.jdo.tck.api.persistencemanager.nullargs.MakeTransactionalNullArgs \ org.apache.jdo.tck.api.persistencemanager.nullargs.RefreshNullArgs \ org.apache.jdo.tck.api.persistencemanager.nullargs.RetrieveNullArgs \ org.apache.jdo.tck.api.persistencemanager.nullargs.RetrieveWithFetchPlanNullArgs tck/src/conf/pmf.conf100664 7145 12500110374 15025 0ustarmbouschenstaff 0 0 # 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 = All pmf tests with standard mapping, no testdata. jdo.tck.mapping.companyfactory = jdo.tck.testdata = jdo.tck.standarddata = jdo.tck.mapping = 0 jdo.tck.requiredOptions = jdo.tck.classes = \ org.apache.jdo.tck.api.persistencemanagerfactory.AfterCloseGetPMThrowsException \ org.apache.jdo.tck.api.persistencemanagerfactory.AfterCloseSetMethodsThrowException \ org.apache.jdo.tck.api.persistencemanagerfactory.AfterGetPersistenceManagerNoSetMethodsSucceed \ org.apache.jdo.tck.api.persistencemanagerfactory.Close \ org.apache.jdo.tck.api.persistencemanagerfactory.CloseFailsIfTransactionActive \ org.apache.jdo.tck.api.persistencemanagerfactory.CloseWithoutPermissionThrowsSecurityException \ org.apache.jdo.tck.api.persistencemanagerfactory.FlushThrowsIfReadOnly \ org.apache.jdo.tck.api.persistencemanagerfactory.GetManagedClasses \ org.apache.jdo.tck.api.persistencemanagerfactory.GetPMFByFile \ org.apache.jdo.tck.api.persistencemanagerfactory.GetPMFByFileAndClassLoader \ org.apache.jdo.tck.api.persistencemanagerfactory.GetPMFByResource \ org.apache.jdo.tck.api.persistencemanagerfactory.GetPMFByResourceAndClassLoader \ org.apache.jdo.tck.api.persistencemanagerfactory.GetPMFByStream \ org.apache.jdo.tck.api.persistencemanagerfactory.GetPMFByStreamAndClassLoader \ org.apache.jdo.tck.api.persistencemanagerfactory.GetPMFByJNDILocation \ org.apache.jdo.tck.api.persistencemanagerfactory.GetPMFByJNDILocationAndClassLoader \ org.apache.jdo.tck.api.persistencemanagerfactory.GetPersistenceManager \ org.apache.jdo.tck.api.persistencemanagerfactory.GetPersistenceManagerFactoryByPropertiesInstance \ org.apache.jdo.tck.api.persistencemanagerfactory.GetPersistenceManagerForUser \ org.apache.jdo.tck.api.persistencemanagerfactory.GetProperties \ org.apache.jdo.tck.api.persistencemanagerfactory.SetConnectionPassword \ org.apache.jdo.tck.api.persistencemanagerfactory.SetConnectionURL \ org.apache.jdo.tck.api.persistencemanagerfactory.SetConnectionUserName \ org.apache.jdo.tck.api.persistencemanagerfactory.SetIgnoreCache \ org.apache.jdo.tck.api.persistencemanagerfactory.SetMultithreaded \ org.apache.jdo.tck.api.persistencemanagerfactory.SetNonTransactionalRead \ org.apache.jdo.tck.api.persistencemanagerfactory.SetNonTransactionalWrite \ org.apache.jdo.tck.api.persistencemanagerfactory.SetOptimistic \ org.apache.jdo.tck.api.persistencemanagerfactory.SetReadOnly \ org.apache.jdo.tck.api.persistencemanagerfactory.SetRetainValues \ org.apache.jdo.tck.api.persistencemanagerfactory.SetTransactionIsolationLevel \ org.apache.jdo.tck.api.persistencemanagerfactory.SupportedOptions \ org.apache.jdo.tck.api.persistencemanagerfactory.config.Jdoconfig \ org.apache.jdo.tck.api.persistencemanagerfactory.config.Persistence \ org.apache.jdo.tck.api.persistencemanagerfactory.config.JDOConfigListener \ org.apache.jdo.tck.api.persistencemanagerfactory.metadata.GetMetadataTest tck/src/conf/query.conf100664 11003 12500110374 15414 0ustarmbouschenstaff 0 0 # 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 = All query tests with standard mapping, no testdata. jdo.tck.mapping.companyfactory = jdo.tck.testdata = jdo.tck.standarddata = jdo.tck.mapping = 0 jdo.tck.requiredOptions = jdo.tck.classes = \ org.apache.jdo.tck.query.api.ChangeQuery \ org.apache.jdo.tck.query.api.Close \ org.apache.jdo.tck.query.api.CloseAll \ org.apache.jdo.tck.query.api.CompileQuery \ org.apache.jdo.tck.query.api.DeclareImports \ org.apache.jdo.tck.query.api.DeclareParameters \ org.apache.jdo.tck.query.api.DeclareVariables \ org.apache.jdo.tck.query.api.ExecuteQuery \ org.apache.jdo.tck.query.api.ExecuteQueryWithArray \ org.apache.jdo.tck.query.api.ExecuteQueryWithMap \ org.apache.jdo.tck.query.api.GetFetchPlan \ org.apache.jdo.tck.query.api.GetIgnoreCache \ org.apache.jdo.tck.query.api.GetPersistenceManager \ org.apache.jdo.tck.query.api.GetPersistenceManagerFromRestoredSerializedQuery \ org.apache.jdo.tck.query.api.InvalidNamedQuery \ org.apache.jdo.tck.query.api.MetadataSearchOrder \ org.apache.jdo.tck.query.api.NamedQueryNotFound \ org.apache.jdo.tck.query.api.NewNamedQuery \ org.apache.jdo.tck.query.api.NewQueryFromExistingQueryBoundToPMFromSameVendor \ org.apache.jdo.tck.query.api.NewQueryFromRestoredSerializedQuery \ org.apache.jdo.tck.query.api.NewQueryWithCandidateClass \ org.apache.jdo.tck.query.api.NewQueryWithCandidateClassAndCollection \ org.apache.jdo.tck.query.api.NewQueryWithCandidateClassAndExtent \ org.apache.jdo.tck.query.api.NewQueryWithCandidateClassAndFilter \ org.apache.jdo.tck.query.api.NewQueryWithCandidateClassCollectionFilter \ org.apache.jdo.tck.query.api.NewQueryWithExtent \ org.apache.jdo.tck.query.api.NewQueryWithExtentAndFilter \ org.apache.jdo.tck.query.api.NewQueryWithSpecifiedLanguageAndQuery \ org.apache.jdo.tck.query.api.NewQuerySingleString \ org.apache.jdo.tck.query.api.QueryExtentions \ org.apache.jdo.tck.query.api.SetCandidateCollection \ org.apache.jdo.tck.query.api.SetCandidateExtent \ org.apache.jdo.tck.query.api.SetFilter \ org.apache.jdo.tck.query.api.SetGrouping \ org.apache.jdo.tck.query.api.SetIgnoreCache \ org.apache.jdo.tck.query.api.SetOrdering \ org.apache.jdo.tck.query.api.SetRange \ org.apache.jdo.tck.query.api.SetResult \ org.apache.jdo.tck.query.api.SetResultClass \ org.apache.jdo.tck.query.api.SetUnique \ org.apache.jdo.tck.query.api.SetterReplacePreviousValues \ org.apache.jdo.tck.query.api.SingleStringQuery \ org.apache.jdo.tck.query.api.UnmodifiableQuery \ org.apache.jdo.tck.query.delete.DeleteCallback \ org.apache.jdo.tck.query.delete.DeletePersistentAll \ org.apache.jdo.tck.query.delete.DeleteQueryElements \ org.apache.jdo.tck.query.result.AggregateResult \ org.apache.jdo.tck.query.result.DefaultResult \ org.apache.jdo.tck.query.result.DefaultUnique \ org.apache.jdo.tck.query.result.DistinctCandidateInstances \ org.apache.jdo.tck.query.result.DistinctQuery \ org.apache.jdo.tck.query.result.Grouping \ org.apache.jdo.tck.query.result.IfElseResult \ org.apache.jdo.tck.query.result.ImmutableQueryResult \ org.apache.jdo.tck.query.result.MethodsInResult \ org.apache.jdo.tck.query.result.NPEInResultExpr \ org.apache.jdo.tck.query.result.NullResults \ org.apache.jdo.tck.query.result.ProjectedSCODoesNotTrackChanges \ org.apache.jdo.tck.query.result.ResultClassRequirements \ org.apache.jdo.tck.query.result.ResultExpressions \ org.apache.jdo.tck.query.result.ShapeOfResult \ org.apache.jdo.tck.query.result.Unique \ org.apache.jdo.tck.query.result.VariableInResult \ org.apache.jdo.tck.query.result.VariableInResultNavigation \ org.apache.jdo.tck.query.result.VariableInResultMultipleNavigation \ org.apache.jdo.tck.query.sql.ShapeOfResult \ org.apache.jdo.tck.query.sql.NoCandidateClass \ org.apache.jdo.tck.query.sql.AllowedAPIMethods \ org.apache.jdo.tck.query.sql.NewQuery \ org.apache.jdo.tck.query.sql.ExecuteWithMap tck/src/conf/relationshipAllRelationships.conf100664 2471 12500110374 22137 0ustarmbouschenstaff 0 0 # 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 = Managed relationship tests with standard mapping, \ basic testdata with all relationships. jdo.tck.mapping.companyfactory = jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyAllRelationships.xml jdo.tck.mapping = 0 jdo.tck.requiredOptions = jdo.tck.classes = org.apache.jdo.tck.mapping.Relationship1To1AllRelationships \ org.apache.jdo.tck.mapping.Relationship1ToManyAllRelationships \ org.apache.jdo.tck.mapping.RelationshipManyToManyAllRelationships \ org.apache.jdo.tck.mapping.RelationshipNegative1To1Test tck/src/conf/relationshipNoRelationships.conf100664 2466 12500110374 22007 0ustarmbouschenstaff 0 0 # 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 = Managed relationship tests with standard mapping, \ basic testdata with no relationships. jdo.tck.mapping.companyfactory = jdo.tck.testdata = org/apache/jdo/tck/pc/company/companyNoRelationships.xml jdo.tck.mapping = 0 jdo.tck.requiredOptions = jdo.tck.classes = org.apache.jdo.tck.mapping.Relationship1To1NoRelationships \ org.apache.jdo.tck.mapping.Relationship1ToManyNoRelationships \ org.apache.jdo.tck.mapping.RelationshipManyToManyNoRelationships \ org.apache.jdo.tck.mapping.RelationshipNegative1ToManyTest tck/src/conf/runonce.conf100664 2172 12500110374 15707 0ustarmbouschenstaff 0 0 # 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 = Verification of the JDO API classes and interfaces jdo.tck.testdata = jdo.tck.standarddata = jdo.tck.mapping = 0 jdo.tck.requiredOptions = # The runOnce flag must only be set in this configuration and no others runOnce = true jdo.tck.classes = \ org.apache.jdo.tck.api.SignatureTest \ org.apache.jdo.tck.api.exceptions.ExceptionConstructor tck/src/conf/schemaAttributeClass.conf100664 2352 12500110374 20350 0ustarmbouschenstaff 0 0 # 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 = MakePersistent test with schema name specified as class attribute in orm for PCPoint. The schema name derived from jdo.tck.mapping 7, applicationidentity7 or datastoreidentity7, is overriden in the orm to specify schema applicationidentity_cls or datastoreidentity_cls. jdo.tck.mapping.companyfactory = jdo.tck.classes = org.apache.jdo.tck.api.persistencemanager.lifecycle.MakePersistent jdo.tck.testdata = jdo.tck.mapping = 7 jdo.tck.requiredOptions = tck/src/conf/schemaAttributeOrm.conf100664 2350 12500110374 20036 0ustarmbouschenstaff 0 0 # 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 = MakePersistent test with schema name specified as orm attribute in orm for PCPoint. The schema name derived from jdo.tck.mapping 5, applicationidentity5 or datastoreidentity5, is overriden in the orm to specify schema applicationidentity_orm or datastoreidentity_orm. jdo.tck.mapping.companyfactory = jdo.tck.classes = org.apache.jdo.tck.api.persistencemanager.lifecycle.MakePersistent jdo.tck.testdata = jdo.tck.mapping = 5 jdo.tck.requiredOptions = tck/src/conf/schemaAttributePackage.conf100664 2354 12500110374 20640 0ustarmbouschenstaff 0 0 # 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 = MakePersistent test with schema name specified as package attribute in orm for PCPoint. The schema name derived from jdo.tck.mapping 6, applicationidentity6 or datastoreidentity6, is overriden in the orm to specify schema applicationidentity_pkg or datastoreidentity_pkg. jdo.tck.mapping.companyfactory = jdo.tck.classes = org.apache.jdo.tck.api.persistencemanager.lifecycle.MakePersistent jdo.tck.testdata = jdo.tck.mapping = 6 jdo.tck.requiredOptions = tck/src/conf/security.conf100664 4765 12500110374 16117 0ustarmbouschenstaff 0 0 # 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.security = true jdo.tck.description = All pmf tests with standard mapping, no testdata. jdo.tck.mapping.companyfactory = jdo.tck.testdata = jdo.tck.standarddata = jdo.tck.mapping = 0 jdo.tck.requiredOptions = jdo.tck.classes = \ org.apache.jdo.tck.api.persistencemanagerfactory.AfterCloseGetPMThrowsException \ org.apache.jdo.tck.api.persistencemanagerfactory.AfterCloseSetMethodsThrowException \ org.apache.jdo.tck.api.persistencemanagerfactory.AfterGetPersistenceManagerNoSetMethodsSucceed \ org.apache.jdo.tck.api.persistencemanagerfactory.Close \ org.apache.jdo.tck.api.persistencemanagerfactory.CloseFailsIfTransactionActive \ org.apache.jdo.tck.api.persistencemanagerfactory.CloseWithoutPermissionThrowsSecurityException \ org.apache.jdo.tck.api.persistencemanagerfactory.GetPMFByFile \ org.apache.jdo.tck.api.persistencemanagerfactory.GetPMFByFileAndClassLoader \ org.apache.jdo.tck.api.persistencemanagerfactory.GetPMFByResource \ org.apache.jdo.tck.api.persistencemanagerfactory.GetPMFByResourceAndClassLoader \ org.apache.jdo.tck.api.persistencemanagerfactory.GetPMFByStream \ org.apache.jdo.tck.api.persistencemanagerfactory.GetPMFByStreamAndClassLoader \ org.apache.jdo.tck.api.persistencemanagerfactory.GetPMFByJNDILocation \ org.apache.jdo.tck.api.persistencemanagerfactory.GetPMFByJNDILocationAndClassLoader \ org.apache.jdo.tck.api.persistencemanagerfactory.GetPersistenceManager \ org.apache.jdo.tck.api.persistencemanagerfactory.GetPersistenceManagerForUser \ org.apache.jdo.tck.api.persistencemanagerfactory.GetProperties \ org.apache.jdo.tck.api.persistencemanagerfactory.config.Jdoconfig \ org.apache.jdo.tck.api.persistencemanagerfactory.config.Persistence \ org.apache.jdo.tck.api.persistencemanagerfactory.config.JDOConfigListener tck/src/conf/security.policy100664 10551 12500110374 16477 0ustarmbouschenstaff 0 0 // 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. // JUnit code base grant codeBase "file:/D:/users\\michael\\.maven/repository/junit/jars/junit-3.8.1.jar" { permission java.io.FilePermission "${user.home}${/}junit.properties", "read"; }; // Springbeans code base grant codeBase "file:/D:/users\\michael\\.maven/repository/org.springframework/jars/spring-beans-2.0.jar" { permission java.lang.RuntimePermission "accessDeclaredMembers"; permission java.lang.reflect.ReflectPermission "suppressAccessChecks"; permission java.lang.RuntimePermission "getClassLoader"; }; // Springcore code base grant codeBase "file:/D:/users\\michael\\.maven/repository/org.springframework/jars/spring-core-2.0.jar" { permission java.lang.RuntimePermission "accessDeclaredMembers"; }; // TCK test classes grant codeBase "file:/D:/projects/jdo/workspace/jdo/trunk/tck2/target/classes/-" { permission javax.jdo.spi.JDOPermission "closePersistenceManagerFactory"; permission javax.jdo.spi.JDOPermission "setStateManager"; // needed for Springbeans permission java.lang.RuntimePermission "accessDeclaredMembers"; permission java.lang.reflect.ReflectPermission "suppressAccessChecks"; permission java.lang.RuntimePermission "getClassLoader"; }; // TCK PC enhanced classes grant codebase "file:/D:/projects/jdo/workspace/jdo/trunk/tck2/target/enhanced/-" { permission javax.jdo.spi.JDOPermission "setStateManager"; }; // JDO API code base grant codeBase "file:/D:/users\\michael\\.maven/repository/javax.jdo/jars/jdo2-api-2.2-SNAPSHOT.jar" { permission javax.jdo.spi.JDOPermission "getMetadata"; permission javax.jdo.spi.JDOPermission "setStateManager"; }; // JDO RI code base grant codeBase "file:/D:/users\\michael\\.maven/repository/org.datanucleus/jars/datanucleus-core-1.0-SNAPSHOT.jar" { permission javax.jdo.spi.JDOPermission "closePersistenceManagerFactory"; permission javax.jdo.spi.JDOPermission "getMetadata"; permission javax.jdo.spi.JDOPermission "setStateManager"; permission java.lang.RuntimePermission "accessDeclaredMembers"; permission java.lang.reflect.ReflectPermission "suppressAccessChecks"; permission java.lang.RuntimePermission "getClassLoader"; permission java.lang.RuntimePermission "accessClassInPackage.sun.reflect"; }; // JDO RI enhancer base grant codeBase "file:/D:/users\\michael\\.maven/repository/org.datanucleus/jars/datanucleus-enhancer-1.0-SNAPSHOT.jar" { permission java.lang.RuntimePermission "accessDeclaredMembers"; permission java.lang.RuntimePermission "accessClassInPackage.sun.reflect"; }; // JDO RI store.rdbms code base grant codeBase "file:/D:/users\\michael\\.maven/repository/org.datanucleus/jars/datanucleus-rdbms-1.0-SNAPSHOT.jar" { permission java.lang.RuntimePermission "accessDeclaredMembers"; permission java.lang.reflect.ReflectPermission "suppressAccessChecks"; permission java.lang.RuntimePermission "getClassLoader"; }; // All classes in the classpath grant { // c3p0 seems to require PropertyPermission of write (don't know why) permission java.util.PropertyPermission "*", "read, write"; permission java.io.FilePermission "${user.home}${/}.maven/repository${/}-", "read"; permission java.io.FilePermission "${jdo.tck.basedir}${/}target${/}-", "read, write"; // bug in security? needed for Derby to create tck2/target/database/derby/../../logs permission java.io.FilePermission "${jdo.tck.basedir}${/}-", "read, write, delete"; // needed for JNDI FSContext permission java.io.FilePermission "${/}", "read"; permission java.lang.RuntimePermission "createClassLoader"; permission java.io.FilePermission "${user.dir}${/}-", "read"; }; tck/src/conf/simplelog.properties100664 3226 12500110374 17501 0ustarmbouschenstaff 0 0 # # 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 is a sample properties file to configure apache commons logging SimpleLog # implementation for the JDO TCK test cases. Below you find an entry for each of # the JDO TCK logger instances. Please uncomment the line and adapt the log # level to your needs, in case to want to enable a particular logger. # ###################### # Loggers ###################### # Root logger org.apache.commons.logging.simplelog.defaultlog = error # TCK logger org.apache.commons.logging.simplelog.log.org.apache.jdo.tck = info # SpringFramework loggers org.apache.commons.logging.simplelog.log.org.springframework = error org.apache.commons.logging.simplelog.log.org.apache.jdo.tck.pc.company.CompanyModelReader = error org.apache.commons.logging.simplelog.log.org.apache.jdo.tck.pc.mylib.MylibReader = error # JDO vendor specific loggers #org.apache.commons.logging.simplelog.log. = info tck/src/conf/throwOnUnknownStandardProperties.conf100664 2114 12500110374 23010 0ustarmbouschenstaff 0 0 # 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 = Checks that the implementation throws JDOUserException on unknown JDO standard properties. jdo.tck.mapping.companyfactory = jdo.tck.classes = org.apache.jdo.tck.api.persistencemanagerfactory.config.ThrowOnUnknownStandardProperties jdo.tck.testdata = jdo.tck.mapping = jdo.tck.requiredOptions = tck/src/conf/transactions.conf100664 5325 12500110374 16751 0ustarmbouschenstaff 0 0 # 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 = All transaction tests with standard mapping, no testdata. jdo.tck.mapping.companyfactory = jdo.tck.testdata = jdo.tck.standarddata = jdo.tck.mapping = 0 jdo.tck.requiredOptions = jdo.tck.classes = \ org.apache.jdo.tck.transactions.AfterCompletionMethodCalledWhenCommitted \ org.apache.jdo.tck.transactions.AfterCompletionMethodCalledWhenRolledback \ org.apache.jdo.tck.transactions.AfterSetRollbackOnlyCommitFails \ org.apache.jdo.tck.transactions.BeforeCompletionMethodCalled \ org.apache.jdo.tck.transactions.BeforeCompletionMethodNotCalledBeforeRollback \ org.apache.jdo.tck.transactions.Commit \ org.apache.jdo.tck.transactions.GetPersistenceManager \ org.apache.jdo.tck.transactions.GetRetainValues \ org.apache.jdo.tck.transactions.GetRollbackOnlyReturnsFalseUntilSet \ org.apache.jdo.tck.transactions.GetSynchronization \ org.apache.jdo.tck.transactions.IsActive \ org.apache.jdo.tck.transactions.IsActiveUntilAfterCompletionMethodCalled \ org.apache.jdo.tck.transactions.Rollback \ org.apache.jdo.tck.transactions.SetIsolationLevel \ org.apache.jdo.tck.transactions.SetNontransactionalRead \ org.apache.jdo.tck.transactions.WhenNontransactionalReadIsFalse \ org.apache.jdo.tck.transactions.SetNontransactionalReadCalledDuringTxCompletion \ org.apache.jdo.tck.transactions.SetNontransactionalWriteCalledDuringTxCompletion \ org.apache.jdo.tck.transactions.SetNontransactionalReadTrueWhenNotSupported \ org.apache.jdo.tck.transactions.SetOptimistic \ org.apache.jdo.tck.transactions.SetOptimisticCalledDuringTxCompletion \ org.apache.jdo.tck.transactions.SetOptimisticDuringTransaction \ org.apache.jdo.tck.transactions.SetOptimisticTrueWhenNotSupported \ org.apache.jdo.tck.transactions.SetRetainValues \ org.apache.jdo.tck.transactions.SetRetainValuesCalledDuringTxCompletion \ org.apache.jdo.tck.transactions.SetRetainValuesTrueWhenNotSupported \ org.apache.jdo.tck.transactions.SetSynchronization \ org.apache.jdo.tck.transactions.SetSynchronizationToNull tck/src/java/org/apache/jdo/tck/AbstractReaderTest.java100664 5034 12500110373 23320 0ustarmbouschenstaff 0 0 /* * 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; import java.security.AccessController; import java.security.PrivilegedAction; import java.util.HashMap; import java.util.List; import java.util.Map; import org.springframework.beans.factory.xml.XmlBeanFactory; /* * Abstract class for managed relationship tests */ public class AbstractReaderTest extends JDO_Test { /** The list of all objects in the bean collection. */ protected List rootOids; /** The name of the root object in the bean collection. */ protected static final String rootName = "root"; /** The name of the file containing the bean collection (test data). */ protected final String inputFilename = System.getProperty("jdo.tck.testdata"); /** The map of String (bean name) to Object (bean). */ protected Map oidMap = new HashMap(); /** Get the named bean from the bean factory. * * @param reader the xml bean reader * @param name the name of the bean * @return the named object */ protected Object getBean(final XmlBeanFactory reader, final String name) { return AccessController.doPrivileged( new PrivilegedAction() { public Object run() { return reader.getBean(name); } } ); } /** Get the root object from the bean factory. * * @param reader the xml bean reader * @return the List of objects */ protected List getRootList(XmlBeanFactory reader) { return (List) getBean(reader, rootName); } /** Get the named object from the Map of objects. * * @param name the bean name * @return the named object */ protected Object getOidByName(String name) { return oidMap.get((Object)name); } } tck/src/java/org/apache/jdo/tck/api/exceptions/ExceptionConstructor.java100664 34014 12500110374 26751 0ustarmbouschenstaff 0 0 /* * 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.api.exceptions; import java.lang.reflect.Constructor; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Exception Constructor *
*Keywords: exception *
*Assertion ID: *
*Assertion Description: */ public class ExceptionConstructor extends JDO_Test { protected static final Class[] classArrayEmpty = new Class[] {}; protected static final Class[] classArrayString = new Class[] {String.class}; protected static final Class[] classArrayStringObject = new Class[] {String.class, Object.class}; protected static final Class[] classArrayStringThrowable = new Class[] {String.class, Throwable.class}; protected static final Class[] classArrayStringThrowableArray = new Class[] {String.class, Throwable[].class}; protected static final Class[] classArrayStringThrowableObject = new Class[] {String.class, Throwable.class, Object.class}; protected static final Class[] classArrayStringThrowableArrayObject = new Class[] {String.class, Throwable[].class, Object.class}; protected static final String message = "Message"; protected static final Object object = "Failed Object"; protected static final Throwable throwable = new Throwable("Throwable"); protected static final Object[] objectArrayEmpty = new Object[]{}; protected static final Object[] objectArrayString = new Object[]{message}; protected static final Object[] objectArrayStringObject = new Object[]{message, object}; protected static final Object[] objectArrayStringThrowableArray = new Object[] {message, new Throwable[] {throwable}}; protected static final Object[] objectArrayStringThrowable = new Object[] {message, throwable}; protected static final Object[] objectArrayStringThrowableArrayObject = new Object[] {message, new Throwable[] {throwable}, object}; protected static final Object[] objectArrayStringThrowableObject = new Object[] {message, throwable, object}; /** * The main 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(ExceptionConstructor.class); } /* test all constructors * */ public void testConstructors() { constructJDOCanRetryException(); constructJDODataStoreException(); constructJDODetachedFieldAccessException(); constructJDOException(); constructJDOFatalDataStoreException(); constructJDOFatalException(); constructJDOFatalInternalException(); constructJDOFatalUserException(); constructJDONullIdentityException(); constructJDOObjectNotFoundException(); constructJDOOptimisticVerificationException(); constructJDOUnsupportedOptionException(); constructJDOUserCallbackException(); failOnError(); } protected void constructJDOCanRetryException() { constructEmpty(javax.jdo.JDOCanRetryException.class); constructString(javax.jdo.JDOCanRetryException.class); constructStringThrowableArray(javax.jdo.JDOCanRetryException.class); constructStringThrowable(javax.jdo.JDOCanRetryException.class); constructStringObject(javax.jdo.JDOCanRetryException.class); constructStringThrowableArrayObject(javax.jdo.JDOCanRetryException.class); constructStringThrowableObject(javax.jdo.JDOCanRetryException.class); } protected void constructJDODataStoreException() { constructEmpty(javax.jdo.JDODataStoreException.class); constructString(javax.jdo.JDODataStoreException.class); constructStringThrowableArray(javax.jdo.JDODataStoreException.class); constructStringThrowable(javax.jdo.JDODataStoreException.class); constructStringObject(javax.jdo.JDODataStoreException.class); constructStringThrowableArrayObject(javax.jdo.JDODataStoreException.class); constructStringThrowableObject(javax.jdo.JDODataStoreException.class); } protected void constructJDODetachedFieldAccessException() { constructEmpty(javax.jdo.JDODetachedFieldAccessException.class); constructString(javax.jdo.JDODetachedFieldAccessException.class); constructStringThrowableArray(javax.jdo.JDODetachedFieldAccessException.class); constructStringThrowable(javax.jdo.JDODetachedFieldAccessException.class); constructStringObject(javax.jdo.JDODetachedFieldAccessException.class); } protected void constructJDOException() { constructEmpty(javax.jdo.JDOException.class); constructString(javax.jdo.JDOException.class); constructStringThrowableArray(javax.jdo.JDOException.class); constructStringThrowable(javax.jdo.JDOException.class); constructStringObject(javax.jdo.JDOException.class); constructStringThrowableArrayObject(javax.jdo.JDOException.class); constructStringThrowableObject(javax.jdo.JDOException.class); } protected void constructJDOFatalDataStoreException() { constructEmpty(javax.jdo.JDOFatalDataStoreException.class); constructString(javax.jdo.JDOFatalDataStoreException.class); constructStringThrowableArray(javax.jdo.JDOFatalDataStoreException.class); constructStringThrowable(javax.jdo.JDOFatalDataStoreException.class); constructStringObject(javax.jdo.JDOFatalDataStoreException.class); } protected void constructJDOFatalException() { constructEmpty(javax.jdo.JDOFatalException.class); constructString(javax.jdo.JDOFatalException.class); constructStringThrowableArray(javax.jdo.JDOFatalException.class); constructStringThrowable(javax.jdo.JDOFatalException.class); constructStringObject(javax.jdo.JDOFatalException.class); constructStringThrowableArrayObject(javax.jdo.JDOFatalException.class); constructStringThrowableObject(javax.jdo.JDOFatalException.class); } protected void constructJDOFatalInternalException() { constructEmpty(javax.jdo.JDOFatalInternalException.class); constructString(javax.jdo.JDOFatalInternalException.class); constructStringThrowableArray(javax.jdo.JDOFatalInternalException.class); constructStringThrowable(javax.jdo.JDOFatalInternalException.class); constructStringObject(javax.jdo.JDOFatalInternalException.class); constructStringThrowableArrayObject(javax.jdo.JDOFatalInternalException.class); constructStringThrowableObject(javax.jdo.JDOFatalInternalException.class); } protected void constructJDOFatalUserException() { constructEmpty(javax.jdo.JDOFatalUserException.class); constructString(javax.jdo.JDOFatalUserException.class); constructStringThrowableArray(javax.jdo.JDOFatalUserException.class); constructStringThrowable(javax.jdo.JDOFatalUserException.class); constructStringObject(javax.jdo.JDOFatalUserException.class); constructStringThrowableArrayObject(javax.jdo.JDOFatalUserException.class); constructStringThrowableObject(javax.jdo.JDOFatalUserException.class); } protected void constructJDONullIdentityException() { constructEmpty(javax.jdo.JDONullIdentityException.class); constructString(javax.jdo.JDONullIdentityException.class); constructStringThrowableArray(javax.jdo.JDONullIdentityException.class); constructStringThrowable(javax.jdo.JDONullIdentityException.class); constructStringObject(javax.jdo.JDONullIdentityException.class); } protected void constructJDOObjectNotFoundException() { constructEmpty(javax.jdo.JDOObjectNotFoundException.class); constructString(javax.jdo.JDOObjectNotFoundException.class); constructStringThrowableArray(javax.jdo.JDOObjectNotFoundException.class); constructStringObject(javax.jdo.JDOObjectNotFoundException.class); constructStringThrowableArrayObject(javax.jdo.JDOObjectNotFoundException.class); constructStringThrowableObject(javax.jdo.JDOObjectNotFoundException.class); } protected void constructJDOOptimisticVerificationException() { constructEmpty(javax.jdo.JDOOptimisticVerificationException.class); constructString(javax.jdo.JDOOptimisticVerificationException.class); constructStringThrowableArray(javax.jdo.JDOOptimisticVerificationException.class); constructStringObject(javax.jdo.JDOOptimisticVerificationException.class); constructStringThrowableArrayObject(javax.jdo.JDOOptimisticVerificationException.class); constructStringThrowableObject(javax.jdo.JDOOptimisticVerificationException.class); } protected void constructJDOUnsupportedOptionException() { constructEmpty(javax.jdo.JDOUnsupportedOptionException.class); constructString(javax.jdo.JDOUnsupportedOptionException.class); constructStringThrowableArray(javax.jdo.JDOUnsupportedOptionException.class); constructStringThrowable(javax.jdo.JDOUnsupportedOptionException.class); } protected void constructJDOUserCallbackException() { constructEmpty(javax.jdo.JDOUserCallbackException.class); constructString(javax.jdo.JDOUserCallbackException.class); constructStringThrowableArray(javax.jdo.JDOUserCallbackException.class); constructStringThrowable(javax.jdo.JDOUserCallbackException.class); constructStringObject(javax.jdo.JDOUserCallbackException.class); constructStringThrowableArrayObject(javax.jdo.JDOUserCallbackException.class); constructStringThrowableObject(javax.jdo.JDOUserCallbackException.class); } protected void constructEmpty(Class clazz) { construct(clazz, classArrayEmpty, objectArrayEmpty, null, null, null); } protected void constructString(Class clazz) { construct(clazz, classArrayString, objectArrayString, message, null, null); } protected void constructStringObject(Class clazz) { construct(clazz, classArrayStringObject, objectArrayStringObject, message, object, null); } protected void constructStringThrowableArray(Class clazz) { construct(clazz, classArrayStringThrowableArray, objectArrayStringThrowableArray, message, null, throwable); } protected void constructStringThrowable(Class clazz) { construct(clazz, classArrayStringThrowable, objectArrayStringThrowable, message, null, throwable); } protected void constructStringThrowableArrayObject(Class clazz) { construct(clazz, classArrayStringThrowableArrayObject, objectArrayStringThrowableArrayObject, message, object, throwable); } protected void constructStringThrowableObject(Class clazz) { construct(clazz, classArrayStringThrowableObject, objectArrayStringThrowableObject, message, object, throwable); } protected void construct(Class clazz, Class[] formal, Object[] params, String expectedMessage, Object expectedObject, Throwable expectedCause) { Constructor ctor = null; try { ctor = clazz.getConstructor(formal); } catch (Throwable ex) { appendMessage ("Throwable caught during getConstructor. " + ex); return; } try { throw (Throwable)ctor.newInstance(params); } catch (javax.jdo.JDOException ex) { // good catch if (clazz.isInstance(ex)) { Object actualObject = ex.getFailedObject(); if (expectedObject != null && !expectedObject.equals(actualObject)) { appendMessage("Wrong failed object for exception of " + clazz + "; Expected: " + expectedObject + " Actual: " + actualObject); } String actualMessage = ex.getMessage(); if (expectedMessage != null && !expectedMessage.equals(actualMessage)) { appendMessage("Wrong message for exception of " + clazz + "; Expected: " + expectedMessage + " Actual: " + actualMessage); } Throwable actualCause = ex.getCause(); if (expectedCause != null && !expectedCause.equals(actualCause)) { appendMessage("Wrong cause for exception of " + clazz + "; Expected: " + expectedCause + " Actual: " + actualCause); } return; } else { appendMessage ("Wrong Throwable type caught for " + clazz + "; Expected:" + clazz + " Actual: " + ex.getClass()); } } catch (Throwable t) { appendMessage ("Wrong Throwable type caught for " + clazz + "; Expected:" + clazz + " Actual: " + t.getClass()); } } } tck/src/java/org/apache/jdo/tck/api/fetchgroup/FetchGroupTest.java100664 56464 12500110374 25455 0ustarmbouschenstaff 0 0 /* * 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.api.fetchgroup; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.Map; import java.util.Set; import javax.jdo.FetchGroup; import javax.jdo.JDOException; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.Address; import org.apache.jdo.tck.pc.company.Company; import org.apache.jdo.tck.pc.company.DentalInsurance; import org.apache.jdo.tck.pc.company.Department; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.pc.company.FullTimeEmployee; import org.apache.jdo.tck.pc.company.IEmployee; import org.apache.jdo.tck.pc.company.Insurance; import org.apache.jdo.tck.pc.company.MedicalInsurance; import org.apache.jdo.tck.pc.company.PIEmployee; import org.apache.jdo.tck.pc.company.PartTimeEmployee; import org.apache.jdo.tck.pc.company.Person; import org.apache.jdo.tck.pc.company.Project; import org.apache.jdo.tck.util.BatchTestRunner; /** * This class is an abstract superclass for the fetch plan tests. * It contains methods useful for testing the behavior of the * fetch plan. */ public class FetchGroupTest extends JDO_Test { /** * The main 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(FetchGroupTest.class); } /** All fetch groups in this PMF. */ protected Set allPMFFetchGroups; /** All fetch groups in this PMF. */ /** * Employee.java: private Date hiredate; private double weeklyhours; private DentalInsurance dentalInsurance; private MedicalInsurance medicalInsurance; private Department department; private Department fundingDept; private Employee manager; private Employee mentor; private Employee protege; private Employee hradvisor; private transient Set reviewedProjects = new HashSet(); // element-type is Project private transient Set projects = new HashSet(); // element-type is Project private transient Set team = new HashSet(); // element-type is Employee private transient Set hradvisees = new HashSet(); // element-type is Employee * Person.java: private long personid; private String firstname; private String lastname; private String middlename; private Date birthdate; private Address address; private Map phoneNumbers = new HashMap(); */ protected String[] basicMembers = new String[]{"hiredate", "weeklyhours", "personid", "firstname", "lastname", "middlename", "birthdate"}; /** In org/apache/jdo/tck/pc/package.jdo, middlename is not in DFG */ protected String[] defaultMembers = new String[]{"hiredate", "weeklyhours", "personid", "firstname", "lastname","birthdate"}; protected String[] allMembers = new String[]{"hiredate", "weeklyhours", "dentalInsurance", "medicalInsurance", "department", "fundingDept", "manager", "mentor", "protege", "hradvisor", "reviewedProjects", "projects", "team", "hradvisees", "personid", "firstname", "lastname", "middlename", "birthdate", "address", "phoneNumbers"}; /** Address address is of type Address and is a relationship */ protected String[] relationshipMembers = new String[]{ "dentalInsurance", "medicalInsurance", "department", "fundingDept", "manager", "mentor", "protege", "hradvisor", "reviewedProjects", "projects", "team", "hradvisees", "address"}; /** Map phoneNumbers is not a relationship but is multivalued */ protected String[] multivaluedMembers = new String[]{ "reviewedProjects", "projects", "team", "hradvisees", "phoneNumbers"}; protected String[] allButMultivaluedMembers = new String[] {"hiredate", "weeklyhours", "dentalInsurance", "medicalInsurance", "department", "fundingDept", "manager", "mentor", "protege", "hradvisor", "personid", "firstname", "lastname", "middlename", "birthdate", "address"}; /** * SetUp for test. */ public void localSetUp() { getPM(); // initialize pmf and pm fields } public void testPMFGetFetchGroup() { allPMFFetchGroups = pmf.getFetchGroups(); Map unscopedFetchGroupMap = new HashMap(); unscopedFetchGroupMap.put("Address+default", pmf.getFetchGroup(Address.class, "default")); unscopedFetchGroupMap.put("Company+default", pmf.getFetchGroup(Company.class, "default")); unscopedFetchGroupMap.put("DentalInsurance+default", pmf.getFetchGroup(DentalInsurance.class, "default")); unscopedFetchGroupMap.put("Department+default", pmf.getFetchGroup(Department.class, "default")); unscopedFetchGroupMap.put("Employee+default", pmf.getFetchGroup(Employee.class, "default")); unscopedFetchGroupMap.put("FullTimeEmployee+default", pmf.getFetchGroup(FullTimeEmployee.class, "default")); unscopedFetchGroupMap.put("Insurance+default", pmf.getFetchGroup(Insurance.class, "default")); unscopedFetchGroupMap.put("MedicalInsurance+default", pmf.getFetchGroup(MedicalInsurance.class, "default")); unscopedFetchGroupMap.put("PartTimeEmployee+default", pmf.getFetchGroup(PartTimeEmployee.class, "default")); unscopedFetchGroupMap.put("Person+default", pmf.getFetchGroup(Person.class, "default")); unscopedFetchGroupMap.put("Project+default", pmf.getFetchGroup(Project.class, "default")); } public void testPMFGetFetchGroupHashCode() { FetchGroup scoped = pm.getFetchGroup(Address.class, "default"); FetchGroup unscoped = pmf.getFetchGroup(Address.class, "default"); int actual = scoped.hashCode(); int expected = unscoped.hashCode(); assertEquals("Scoped hash code does not equal unscoped hash code;" + "Expected: " + expected + " actual: " + actual, actual, expected); } public void testPMGetFetchGroupIdentical() { FetchGroup scoped = pm.getFetchGroup(Address.class, "default"); FetchGroup identical = pm.getFetchGroup(Address.class, "default"); assertSame("Modifiable FetchGroup is not identical to modifiable FetchGroup;" + "FetchGroup: " + printFetchGroup(scoped) + " identical: " + printFetchGroup(identical), scoped, identical); } public void testPMGetFetchGroupUnmodifiableNotIdentical() { FetchGroup scoped = pm.getFetchGroup(Address.class, "default"); scoped.setUnmodifiable(); FetchGroup modifiable = pm.getFetchGroup(Address.class, "default"); assertNotSame("Unmodifiable FetchGroup is identical to modifiable FetchGroup;" + "\nunmodifiable: " + printFetchGroup(scoped) + "\n modifiable: " + printFetchGroup(modifiable), scoped, modifiable); } public void testPMFGetFetchGroupNotIdentical() { FetchGroup first = pmf.getFetchGroup(Address.class, "default"); FetchGroup second = pmf.getFetchGroup(Address.class, "default"); assertNotSame("First FetchGroup is identical to second FetchGroup;" + "\n first: " + printFetchGroup(first) + "\nsecond: " + printFetchGroup(second), first, second); } public void testPMGetFetchGroupEquals() { FetchGroup unmodifiable = pm.getFetchGroup(Address.class, "default"); unmodifiable.setUnmodifiable(); FetchGroup modifiable = pm.getFetchGroup(Address.class, "default"); assertEquals("Unmodifiable FetchGroup is not equal to modifiable FetchGroup;" + "\nunmodifiable: " + printFetchGroup(unmodifiable) + "\n modifiable: " + printFetchGroup(modifiable), unmodifiable, modifiable); } public void testPMModifiable() { FetchGroup scoped = pm.getFetchGroup(Address.class, "default"); assertFalse("Scoped FetchGroup should be modifiable initially, but is unmodifiable.", scoped.isUnmodifiable()); scoped.setUnmodifiable(); assertTrue("Scoped FetchGroup should be unmodifiable after setUnmodifiable, but is modifiable.", scoped.isUnmodifiable()); } public void testPMFModifiable() { FetchGroup scoped = pmf.getFetchGroup(Address.class, "default"); assertFalse("Unscoped FetchGroup should be modifiable initially, but is unmodifiable.", scoped.isUnmodifiable()); scoped.setUnmodifiable(); assertTrue("Unscoped FetchGroup should be unmodifiable after setUnmodifiable, but is modifiable.", scoped.isUnmodifiable()); } public void testCategoriesClass() { checkAddCategory(Employee.class, FetchGroup.ALL, allMembers); checkAddCategory(Employee.class, FetchGroup.BASIC, basicMembers); checkAddCategory(Employee.class, FetchGroup.DEFAULT, defaultMembers); checkAddCategory(Employee.class, FetchGroup.RELATIONSHIP, relationshipMembers); checkAddCategory(Employee.class, FetchGroup.MULTIVALUED, multivaluedMembers); failOnError(); } public void testCategoriesInterface() { checkAddCategory(PIEmployee.class, FetchGroup.ALL, allMembers); checkAddCategory(PIEmployee.class, FetchGroup.BASIC, basicMembers); checkAddCategory(PIEmployee.class, FetchGroup.DEFAULT, defaultMembers); checkAddCategory(PIEmployee.class, FetchGroup.RELATIONSHIP, relationshipMembers); checkAddCategory(PIEmployee.class, FetchGroup.MULTIVALUED, multivaluedMembers); failOnError(); } public void testRemoveCategory() { FetchGroup fg = pm.getFetchGroup(Employee.class, "testRemoveCategory"); Set expectedSet = new HashSet(); expectedSet.addAll(Arrays.asList(allButMultivaluedMembers)); Set members = fg.getMembers(); fg.addCategory(FetchGroup.ALL); fg.removeCategory(FetchGroup.MULTIVALUED); members = fg.getMembers(); assertEquals("FetchGroup.addCategory(all).removeCategory(multivalued)" + " should contain all but multivalued members.\n", expectedSet, members); } public void testAddMember() { FetchGroup fg = pm.getFetchGroup(Employee.class, "testAddMember"); for (int i = 0; i < allMembers.length; ++i) { String member = allMembers[i]; fg.addMember(member); Set members = fg.getMembers(); assertTrue("FetchGroup should contain " + member + " but does not.\n" + printFetchGroup(fg), members.contains(member)); assertEquals("FetchGroup should contain " + i+1 + "members, but does not; ", i+1, members.size()); } } public void testAddMembers() { FetchGroup fg = pm.getFetchGroup(Employee.class, "testAddMembers"); fg.addMembers(multivaluedMembers); fg.addMembers(allButMultivaluedMembers); Set members = fg.getMembers(); Set expectedSet = new HashSet(); expectedSet.addAll(Arrays.asList(allMembers)); assertEquals("FetchGroup should contain all members.\n", expectedSet, members); } public void testRemoveMembers() { FetchGroup fg = pm.getFetchGroup(Employee.class, "testRemoveMembers"); fg.addMembers(allMembers); fg.removeMembers(relationshipMembers); Set members = fg.getMembers(); Set expectedSet = new HashSet(); expectedSet.addAll(Arrays.asList(basicMembers)); expectedSet.add("phoneNumbers"); assertEquals("FetchGroup should contain basic members " + "plus address plus phoneNumbers.\n", expectedSet, members); fg.removeMembers(basicMembers); members = fg.getMembers(); expectedSet = new HashSet(); expectedSet.add("phoneNumbers"); assertEquals("FetchGroup should contain address plus phoneNumbers.\n", expectedSet, members); } public void testRemoveMember() { FetchGroup fg = pm.getFetchGroup(Employee.class, "testRemoveMember"); fg.addCategory(FetchGroup.ALL); for (int i = allMembers.length - 1; i >= 0; --i) { String member = allMembers[i]; fg.removeMember(member); Set members = fg.getMembers(); assertFalse("FetchGroup should not contain " + member + " but does.\n" + printFetchGroup(fg), members.contains(member)); assertEquals("FetchGroup should contain " + i + "members, but does not; ", i, members.size()); } } public void testRecursionDepth() { FetchGroup fg = pm.getFetchGroup(Employee.class, "testRecursionDepth"); fg.addMember("manager"); int depth = fg.getRecursionDepth("manager"); assertEquals("Initial recursion depth for manager should be 1." + printFetchGroup(fg), 1, depth); fg.setRecursionDepth("manager", 64); assertEquals("Recursion depth for manager should be 64." + printFetchGroup(fg), 64, fg.getRecursionDepth("manager")); } public void testPostLoad() { FetchGroup fg = pm.getFetchGroup(Employee.class, "testPostLoad"); assertFalse("New FetchGroup should have post-load false; " + printFetchGroup(fg), fg.getPostLoad()); fg.setPostLoad(true); assertTrue("After setPostLoad(true) FetchGroup should have post-load true; " + printFetchGroup(fg), fg.getPostLoad()); fg.setPostLoad(false); assertFalse("After setPostLoad, FetchGroup should have post-load false; " + printFetchGroup(fg), fg.getPostLoad()); } public void testUnmodifiableSetPostLoad() { FetchGroup fg = pm.getFetchGroup(Employee.class, "testUnmodifiableSetPostLoad"); fg.setUnmodifiable(); try { fg.setPostLoad(true); fail("Unmodifiable FetchGroup should throw on setPostLoad."); } catch(JDOException ex) { // good catch! } } public void testUnmodifiableAddMember() { FetchGroup fg = pm.getFetchGroup(Employee.class, "testUnmodifiableAddMember"); fg.setUnmodifiable(); try { fg.addMember("hiredate"); fail("Unmodifiable FetchGroup should throw on addMember."); } catch(JDOException ex) { // good catch! } } public void testUnmodifiableAddMembers() { FetchGroup fg = pm.getFetchGroup(Employee.class, "testUnmodifiableAddMembers"); fg.setUnmodifiable(); try { fg.addMembers(allMembers); fail("Unmodifiable FetchGroup should throw on addMembers."); } catch(JDOException ex) { // good catch! } } public void testUnmodifiableRemoveMember() { FetchGroup fg = pm.getFetchGroup(Employee.class, "testUnmodifiableRemoveMember"); fg.addMembers(allMembers); fg.setUnmodifiable(); try { fg.removeMember("hiredate"); fail("Unmodifiable FetchGroup should throw on removeMember."); } catch(JDOException ex) { // good catch! } } public void testUnmodifiableRemoveMembers() { FetchGroup fg = pm.getFetchGroup(Employee.class, "testUnmodifiableRemoveMembers"); fg.addMembers(allMembers); fg.setUnmodifiable(); try { fg.removeMembers(allMembers); fail("Unmodifiable FetchGroup should throw on removeMembers."); } catch(JDOException ex) { // good catch! } } public void testUnmodifiableAddCategory() { FetchGroup fg = pm.getFetchGroup(Employee.class, "testUnmodifiableAddCategory"); fg.setUnmodifiable(); try { fg.addCategory(FetchGroup.ALL); fail("Unmodifiable FetchGroup should throw on addCategory."); } catch(JDOException ex) { // good catch! } } public void testUnmodifiableRemoveCategory() { FetchGroup fg = pm.getFetchGroup(Employee.class, "testUnmodifiableRemoveCategory"); fg.addCategory(FetchGroup.ALL); fg.setUnmodifiable(); try { fg.removeCategory(FetchGroup.ALL); fail("Unmodifiable FetchGroup should throw on removeCategory."); } catch(JDOException ex) { // good catch! } } public void testUnmodifiableSetRecursionDepth() { FetchGroup fg = pm.getFetchGroup(Employee.class, "testUnmodifiableSetRecursionDepth"); fg.setUnmodifiable(); try { fg.setRecursionDepth("hiredate", 64); fail("Unmodifiable FetchGroup should throw on setRecursionDepth."); } catch(JDOException ex) { // good catch! } } public void testUnmodifiableSetUnmodifiable() { FetchGroup fg = pm.getFetchGroup(Employee.class, "testUnmodifiableSetUnmodifiable"); fg.setUnmodifiable(); fg.setUnmodifiable(); // should be ok } public void testPMGetFetchGroupClassNotPersistenceCapable() { try { FetchGroup fg = pm.getFetchGroup(Integer.class, "testPMGetFetchGroupClassNotPersistenceCapable"); fail("getFetchGroup should throw on nonPersistenceCapable class."); } catch(JDOException ex) { // good catch! } } public void testPMGetFetchGroupInterfaceNotPersistenceCapable() { try { FetchGroup fg = pm.getFetchGroup(IEmployee.class, "testPMGetFetchGroupInterfaceNotPersistenceCapable"); fail("getFetchGroup should throw on nonPersistenceCapable interface."); } catch(JDOException ex) { // good catch! } } public void testPMFGetFetchGroupClassNotPersistenceCapable() { try { FetchGroup fg = pmf.getFetchGroup(Integer.class, "testtestPMFGetFetchGroupClassNotPersistenceCapableGetFetchGroupClassNotPersistenceCapable"); fail("getFetchGroup should throw on nonPersistenceCapable class."); } catch(JDOException ex) { // good catch! } } public void testPMFGetFetchGroupInterfaceNotPersistenceCapable() { try { FetchGroup fg = pmf.getFetchGroup(IEmployee.class, "testPMFGetFetchGroupInterfaceNotPersistenceCapable"); fail("getFetchGroup should throw on nonPersistenceCapable interface."); } catch(JDOException ex) { // good catch! } } public void testAddMemberNotAMember() { FetchGroup fg = pm.getFetchGroup(Employee.class, "testAddMemberNotAMember"); try { fg.addMember("NotAMember"); fail("FetchGroup should throw on addMember(NotAMember)."); } catch(JDOException ex) { // good catch! } } public void testAddMembersNotAMember() { FetchGroup fg = pm.getFetchGroup(Employee.class, "testAddMembersNotAMember"); try { fg.addMembers(new String[]{"NotAMember"}); fail("FetchGroup should throw on addMembers(NotAMember)."); } catch(JDOException ex) { // good catch! } } public void testRemoveMemberNotAMember() { FetchGroup fg = pm.getFetchGroup(Employee.class, "testRemoveMemberNotAMember"); fg.addCategory(FetchGroup.ALL); try { fg.removeMember("NotAMember"); fail("FetchGroup should throw on removeMember(NotAMember)."); } catch(JDOException ex) { // good catch! } } public void testRemoveMembersNotAMember() { FetchGroup fg = pm.getFetchGroup(Employee.class, "testRemoveMembersNotAMember"); fg.addCategory(FetchGroup.ALL); try { fg.removeMembers(new String[]{"NotAMember"}); fail("FetchGroup should throw on removeMembers(NotAMember)."); } catch(JDOException ex) { // good catch! } } public void testSetRecursionDepthNotAMember() { FetchGroup fg = pm.getFetchGroup(Employee.class, "testSetRecursionDepthNotAMember"); try { fg.setRecursionDepth("NotAMember", 64); fail("FetchGroup should throw on setRecursionDepth(NotAMember)."); } catch(JDOException ex) { // good catch! } } private void checkAddCategory(Class cls, String category, String[] expected) { FetchGroup fg = pm.getFetchGroup(cls, "test" + count() + category); Set expectedSet = new HashSet(); expectedSet.addAll(Arrays.asList(expected)); Set members = fg.getMembers(); assertTrue("New FetchGroup should have no members; " + printFetchGroup(fg), members.isEmpty()); fg.addCategory(category); members = fg.getMembers(); if (!members.equals(expectedSet)) { appendMessage("FetchGroup(" + cls.getName() + ".addCategory(" + category + ") should contain\n" + expectedSet + " but contains\n" + members); } } private String printFetchGroup(FetchGroup fg) { StringBuffer sb = new StringBuffer("FetchGroup ("); sb.append(fg.getType().isInterface()?"interface: ":"class: "); sb.append(fg.getType().getName()); sb.append("; name: "); sb.append(fg.getName()); sb.append(fg.isUnmodifiable()?"; unmodifiable":"; modifiable"); Set members = fg.getMembers(); Iterator it = members.iterator(); if (it.hasNext()) { sb.append("; members: "); String member = (String)it.next(); formatMember(sb, fg, member); } while (it.hasNext()) { sb.append(", "); String member = (String)it.next(); formatMember(sb, fg, member); } sb.append(")"); return sb.toString(); } protected void formatMember(StringBuffer sb, FetchGroup fg, String member) { sb.append(member); sb.append("["); sb.append(fg.getRecursionDepth(member)); sb.append("]"); } /** Counter */ protected int counter = 0; protected String count() { return String.valueOf(counter++); } } tck/src/java/org/apache/jdo/tck/api/instancecallbacks/AbstractInstanceLifecycleListener.java100664 51073 12500110374 32612 0ustarmbouschenstaff 0 0 /* * 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.api.instancecallbacks; import java.util.ArrayList; import java.util.List; import javax.jdo.JDOHelper; import javax.jdo.listener.InstanceLifecycleEvent; import javax.jdo.listener.InstanceLifecycleListener; import javax.jdo.listener.AttachLifecycleListener; import javax.jdo.listener.ClearLifecycleListener; import javax.jdo.listener.CreateLifecycleListener; import javax.jdo.listener.DeleteLifecycleListener; import javax.jdo.listener.DetachLifecycleListener; import javax.jdo.listener.DirtyLifecycleListener; import javax.jdo.listener.LoadLifecycleListener; import javax.jdo.listener.StoreLifecycleListener; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** * Title: Abstract test AbstractInstanceLifecycleListener *
* Keywords: LifeCycleListener lifecycle listener callback *
* Assertion IDs: A12.15-1, A12.15-2, A12.15-3, A12.15-4, A12.15-5, * A12.15-6, A12.15-7, A12.15-8, A12.15-9, A12.15-10, A12.15-11, A12.15-12, * A12.15-13, A12.15-14, *
* Assertion Description: * A12.15-1 void postCreate(InstanceLifecycleEvent event); * This method is called whenever a persistent instance is created, * during makePersistent. It is called after the instance transitions * to persistent-new. * A12.15-2 void postLoad(InstanceLifecycleEvent event); * This method is called whenever a persistent instance is loaded. * It is called after the jdoPostLoad method is invoked on the instance. * A12.15-3 void preStore(InstanceLifecycleEvent event); * This method is called whenever a persistent instance is stored, * for example during flush or commit. It is called * before the jdoPreStore method is invoked on the instance. * A12.15-4 void postStore(InstanceLifecycleEvent event); * This method is called whenever a persistent instance is stored, * for example during flush or commit. It is called * after the jdoPreStore method is invoked on the instance. * An object identity for a per?sistent-new instance must have been assigned * to the instance when this callback is invoked. * A12.15-5 void preClear(InstanceLifecycleEvent event); * This method is called whenever a persistent instance * is cleared, for example during afterCompletion. It is called * before the jdoPreClear method is invoked on the instance. * A12.15-6 void postClear(InstanceLifecycleEvent event); * This method is called whenever a persistent instance * is cleared, for example during afterCom?pletion. It is called * after the jdoPreClear method is invoked on the instance and the fields * have been cleared by the JDO implementation. * A12.15-7 void preDelete(InstanceLifecycleEvent event); * This method is called whenever a persistent instance * is deleted, during deletePersistent. It is called before * the state transition and before the jdoPreDelete method * is invoked on the instance. * A12.15-8 void postDelete(InstanceLifecycleEvent event); * This method is called whenever a persistent instance * is deleted, during deletePersistent. It is called * after the jdoPreDelete method is invoked on the instance * and after the state transition. * A12.15-9 void preDirty(InstanceLifecycleEvent event); * This method is called whenever a persistent clean instance * is first made dirty, during an operation that modifies * the value of a persistent or transactional field. It is called * before the field value is changed. * A12.15-10 void postDirty(InstanceLifecycleEvent event); * This method is called whenever a persistent clean instance * is first made dirty, during an operation that modifies * the value of a persistent or transactional field. It is called * after the field value was changed. * A12.15-11 void preDetach(InstanceLifecycleEvent event); * This method is called before a persistent instance is copied * for detachment. * A12.15-12 void postDetach(InstanceLifecycleEvent event); * This method is called whenever a persistent instance is copied * for detachment. * The source instance is the detached copy; the target instance * is the persistent instance. * A12.15-13 void preAttach(InstanceLifecycleEvent event); * This method is called before a detached instance is attached. * The source instance is the detached instance]. * A12.15-14 void postAttach(InstanceLifecycleEvent event); * This method is called after a detached instance is attached. * The source instance is the corresponding persistent instance in the cache; * the target instance is the detached instance. * * This is the abstract base class for the lifecycle listener test classes. * It contains constants, variables, and methods used by each listener test * class. This class implements the setup and teardown methods used by each * concrete test class. * * This class also includes the listener base class that is extended by * each specific listener. * * The strategy of each test case is the same. A specific listener is * implemented that responds only to events for that specific test; a * specific persistence-capable class is also implemented, that responds * only to callbacks for the specific test. A sequence of operations that * stimulates the callbacks is executed. During these operations, listener * events and callbacks are collected by the listener instance. Finally, * the actual events and callbacks that were collected are analyzed and * differences are reported. */ public abstract class AbstractInstanceLifecycleListener extends JDO_Test { /** */ protected static final String ASSERTION1_FAILED = "Assertion A12.15-1 (TestInstanceLifecycleListenerCreate) failed: "; protected static final String ASSERTION2_FAILED = "Assertion A12.15-2 (TestInstanceLifecycleListener) failed: "; protected static final String ASSERTION3_FAILED = "Assertion A12.15-3 (TestInstanceLifecycleListener) failed: "; protected static final String ASSERTION4_FAILED = "Assertion A12.15-4 (TestInstanceLifecycleListener) failed: "; protected static final String ASSERTION5_FAILED = "Assertion A12.15-5 (TestInstanceLifecycleListener) failed: "; protected static final String ASSERTION6_FAILED = "Assertion A12.15-6 (TestInstanceLifecycleListener) failed: "; protected static final String ASSERTION7_FAILED = "Assertion A12.15-7 (TestInstanceLifecycleListenerDelete) failed: "; protected static final String ASSERTION8_FAILED = "Assertion A12.15-8 (TestInstanceLifecycleListenerDelete) failed: "; protected static final String ASSERTION9_FAILED = "Assertion A12.15-9 (TestInstanceLifecycleListener) failed: "; protected static final String ASSERTION10_FAILED = "Assertion A12.15-10 (TestInstanceLifecycleListener) failed: "; protected static final String ASSERTION11_FAILED = "Assertion A12.15-11 (TestInstanceLifecycleListener) failed: "; protected static final String ASSERTION12_FAILED = "Assertion A12.15-12 (TestInstanceLifecycleListener) failed: "; protected static final String ASSERTION13_FAILED = "Assertion A12.15-13 (TestInstanceLifecycleListener) failed: "; protected static final String ASSERTION14_FAILED = "Assertion A12.15-14 (TestInstanceLifecycleListener) failed: "; /** * The listener to be used for the test. This method is implemented * by the subclasses to use the proper listener. */ protected abstract InstanceLifecycleListenerImpl getListener(); /** * The classes to be used for the test. This method is implemented * by the subclasses to use the proper classes. The classes returned * by this method are used for two purposes: they are used to register * listeners; and they are used as the teardown classes whose instances * are removed from the datastore at the end of the test. */ protected abstract Class[] getPersistentClasses(); /** * Register a new InstanceLifecycleListenerImpl with the * PersistenceManager. */ protected void addListener() { getPM(); pm.addInstanceLifecycleListener(getListener(), getPersistentClasses()); } /** * Unregister the InstanceLifecycleListenerImpl with the * PersistenceManager. */ protected void removeListener() { getPM(); pm.removeInstanceLifecycleListener(getListener()); } /** * Set up for lifecycle tests: * Register the LifecycleListener; add PCPoint to tearDownClasses. */ protected void localSetUp() { addListener(); addTearDownClass(getPersistentClasses()); } /** * Clean up after lifecycle tests: * Unregister the LifecycleListener. */ protected void localTearDown() { removeListener(); // no callbacks for teardown super.localTearDown(); } /** * The LifeCycleListener to be registered with the * PersistenceManager. This is the base class that is extended * by each test. */ protected abstract static class InstanceLifecycleListenerImpl implements AttachLifecycleListener, ClearLifecycleListener, CreateLifecycleListener, DeleteLifecycleListener, DetachLifecycleListener, DirtyLifecycleListener, LoadLifecycleListener, StoreLifecycleListener { protected InstanceLifecycleListenerImpl() {} protected Object expectedSource = null; protected Object expectedTarget = null; public void setExpectedSource(Object source) { expectedSource = source; } public void setExpectedTarget(Object target) { expectedTarget = target; } /** * This is the list names of locations for listener events and * callbacks. Each instance of an event or callback has a specific * name that is associated with the value. The values * are used during collection of events and both names and values * are used for reporting results. */ private static List locations = new ArrayList(); /** These are indexes into the sequence array. Each index * represents the position in the sequence array for the * corresponding callback or listener event. */ public static final int PRE_ATTACH_CALLBACK; public static final int POST_ATTACH_CALLBACK; public static final int PRE_ATTACH_LISTENER; public static final int POST_ATTACH_LISTENER; public static final int PRE_CLEAR_CALLBACK; public static final int PRE_CLEAR_LISTENER; public static final int POST_CLEAR_LISTENER; public static final int POST_CREATE_LISTENER; public static final int PRE_DELETE_CALLBACK; public static final int PRE_DELETE_LISTENER; public static final int POST_DELETE_LISTENER; public static final int PRE_DETACH_CALLBACK; public static final int POST_DETACH_CALLBACK; public static final int PRE_DETACH_LISTENER; public static final int POST_DETACH_LISTENER; public static final int PRE_DIRTY_LISTENER; public static final int POST_DIRTY_LISTENER; public static final int POST_LOAD_CALLBACK; public static final int POST_LOAD_LISTENER; public static final int PRE_STORE_CALLBACK; public static final int PRE_STORE_LISTENER; public static final int POST_STORE_LISTENER; /** * Initialize the list of names and the associated values. For each * listener event and callback, add the name and then assign the value. */ static { int index = 0; locations.add("PRE_ATTACH_LISTENER"); PRE_ATTACH_LISTENER = index++; locations.add("PRE_ATTACH_CALLBACK"); PRE_ATTACH_CALLBACK = index++; locations.add("POST_ATTACH_CALLBACK"); POST_ATTACH_CALLBACK = index++; locations.add("POST_ATTACH_LISTENER"); POST_ATTACH_LISTENER = index++; locations.add("PRE_CLEAR_LISTENER"); PRE_CLEAR_LISTENER = index++; locations.add("PRE_CLEAR_CALLBACK"); PRE_CLEAR_CALLBACK = index++; locations.add("POST_CLEAR_LISTENER"); POST_CLEAR_LISTENER = index++; locations.add("POST_CREATE_LISTENER"); POST_CREATE_LISTENER = index++; locations.add("PRE_DELETE_LISTENER"); PRE_DELETE_LISTENER = index++; locations.add("PRE_DELETE_CALLBACK"); PRE_DELETE_CALLBACK = index++; locations.add("POST_DELETE_LISTENER"); POST_DELETE_LISTENER = index++; locations.add("POST_DETACH_CALLBACK"); POST_DETACH_CALLBACK = index++; locations.add("PRE_DETACH_LISTENER"); PRE_DETACH_LISTENER = index++; locations.add("PRE_DETACH_CALLBACK"); PRE_DETACH_CALLBACK = index++; locations.add("POST_DETACH_LISTENER"); POST_DETACH_LISTENER = index++; locations.add("PRE_DIRTY_LISTENER"); PRE_DIRTY_LISTENER = index++; locations.add("POST_DIRTY_LISTENER"); POST_DIRTY_LISTENER = index++; locations.add("POST_LOAD_CALLBACK"); POST_LOAD_CALLBACK = index++; locations.add("POST_LOAD_LISTENER"); POST_LOAD_LISTENER = index++; locations.add("PRE_STORE_LISTENER"); PRE_STORE_LISTENER = index++; locations.add("PRE_STORE_CALLBACK"); PRE_STORE_CALLBACK = index++; locations.add("POST_STORE_LISTENER"); POST_STORE_LISTENER = index++; } private int[] actual = new int[locations.size()]; /** Track the current sequence of callbacks. */ private int current = 0; public void notifyEvent(int event) { actual[event] = ++current; } /** * Initialize the expected ordering of callbacks and listeners. * Each entry in the sequence is one of the PRE_ or POST_XXX_LISTENER * or _CALLBACK above. The order in the sequence is the expected * calling order. */ private static int[] newExpected(int[] sequence) { int order = 0; int[] result = new int[locations.size()]; for (int i = 0; i < sequence.length; ++i) { result[sequence[i]] = ++order; } return result; } /** * The error message buffer to report exceptions. */ protected StringBuffer messages = new StringBuffer(); protected void checkEventType(String where, int expected, int actual) { if (expected != actual) { messages.append(where + "wrong event type: " + "expected <" + expected + ">, actual <" + actual + ">\n"); } } protected void checkEventSource(String where, Object eventSource) { if (expectedSource != eventSource) { messages.append(where + "wrong event source: " + "expected <" + expectedSource + ">, actual <" + eventSource + ">\n"); } } protected void checkEventTarget(String where, Object eventTarget) { if (expectedTarget != eventTarget) { messages.append(where + "wrong event target: " + "expected <" + expectedTarget + ">, actual <" + eventTarget + ">\n"); } } protected void checkTrue(String where, boolean condition) { if (!condition) { messages.append(where + "was not true.\n"); } } protected void checkSame(String where, Object expected, Object actual) { if (expected != actual) { messages.append(where + "expected <" + expected + ">, actual <" + actual + ">\n"); } } protected void checkPersistent(String where, Object obj) { if (!JDOHelper.isPersistent(obj)) { messages.append(where + "object should be persistent.\n"); } } protected void checkNotPersistent(String where, Object obj) { if (JDOHelper.isPersistent(obj)) { messages.append(where + "object should not be persistent.\n"); } } protected void checkDirty(String where, Object obj) { if (!JDOHelper.isDirty(obj)) { messages.append(where + "object should be dirty.\n"); } } protected void checkNotDirty(String where, Object obj) { if (JDOHelper.isDirty(obj)) { messages.append(where + "object should not be dirty.\n"); } } protected void checkNew(String where, Object obj) { if (!JDOHelper.isNew(obj)) { messages.append(where + "object should be new.\n"); } } protected void checkNotNew(String where, Object obj) { if (JDOHelper.isNew(obj)) { messages.append(where + "object should not be new.\n"); } } protected void checkDeleted(String where, Object obj) { if (!JDOHelper.isDeleted(obj)) { messages.append(where + "object should be deleted.\n"); } } protected void checkNotDeleted(String where, Object obj) { if (JDOHelper.isDeleted(obj)) { messages.append(where + "object should not be deleted.\n"); } } /** * Verify the actual sequence of callbacks and listeners * against the expected. Each of the expected and actual are * int arrays in which each listener and callback have one * position in the array and the value of the array at that * position is the order, starting with 1, of the callback. * If the callback or listener was never invoked, the value * is 0. */ public void verifyCallbacks(String where, int[] expected) { int[] expectedSequence = newExpected(expected); for (int index = 0; index < locations.size(); ++index) { if (expectedSequence[index] != actual[index]) { messages.append("\nSequence verification failed for " + locations.get(index) + "; expected: <" + expectedSequence[index] + "> actual: <" + actual[index] + ">\n"); } } if (messages.length() > 0) { fail(where + "\n" + messages.toString()); } } public void postAttach(InstanceLifecycleEvent event) { } public void postClear(InstanceLifecycleEvent event) { } public void postCreate(InstanceLifecycleEvent event) { } public void postDelete(InstanceLifecycleEvent event) { } public void postDetach(InstanceLifecycleEvent event) { } public void postDirty(InstanceLifecycleEvent event) { } public void postLoad(InstanceLifecycleEvent event) { } public void postStore(InstanceLifecycleEvent event) { } public void preAttach(InstanceLifecycleEvent event) { } public void preClear(InstanceLifecycleEvent event) { } public void preDelete(InstanceLifecycleEvent event) { } public void preDetach(InstanceLifecycleEvent event) { } public void preDirty(InstanceLifecycleEvent event) { } public void preStore(InstanceLifecycleEvent event) { } } } tck/src/java/org/apache/jdo/tck/api/instancecallbacks/AccessingFieldsInPredelete.java100664 20357 12500110374 31204 0ustarmbouschenstaff 0 0 /* * 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.api.instancecallbacks; import java.util.Date; import javax.jdo.JDODataStoreException; import javax.jdo.JDOUserException; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.instancecallbacks.InstanceCallbackClass; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Accessing Fields In Predelete *
*Keywords: instancecallbacks *
*Assertion ID: A10.4-2. *
*Assertion Description: Access to field values within a call to jdoPreDelete() of a class implementing InstanceCallbacks are valid. */ /* * Define a PersistenceCapable class containing some primative types, * a Date attribute, a String attribute, * one reference to an object of the same class and one * Set collection attribute containing two instances of objects of this class. * * Create an object of this class (along with the referenced object and two members in the Set) and commit. * Delete the object. * Within jdoPreDelete(), capture the values of attribues and delete the referenced object * and one of the two Set members. * * In the next transaction, verify the data captured from the attriubtes was what was expected and * that all the objects that should have been deleted have been deleted and the * Set member that was not deleted is still present. * Also verify that jdoPreDelete() is called on each of these objects deleted within the first jdoPreDelete(). */ public class AccessingFieldsInPredelete extends TestParts { private static final String ASSERTION_FAILED = "Assertion A10.4-2 (AccessingFieldsInPredelete) failed: "; /** * The main 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(AccessingFieldsInPredelete.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(InstanceCallbackClass.class); } /** */ public void test() throws Exception { pm = getPM(); Transaction t = pm.currentTransaction(); InstanceCallbackClass.initializeStaticsForTest(); InstanceCallbackClass.performPreDeleteTests = true; t.begin(); Date createTime = new Date(); InstanceCallbackClass secondaryObj = new InstanceCallbackClass("secondaryObj", createTime, 2, 2.0, (short)-1, '2', null); InstanceCallbackClass primaryObj = new InstanceCallbackClass("primaryObj", createTime, 1, 1.0, (short)3, '1', secondaryObj); InstanceCallbackClass childA = new InstanceCallbackClass("childA", createTime, 3, 3.0, (short)-2, '3', null); InstanceCallbackClass childB = new InstanceCallbackClass("childB", createTime, 4, 4.0, (short)-3, '4', null); pm.makePersistent(primaryObj); pm.makePersistent(secondaryObj); pm.makePersistent(childA); pm.makePersistent(childB); primaryObj.addChild(childA); primaryObj.addChild(childB); Object secondaryObjId = pm.getObjectId(secondaryObj); Object primaryObjId = pm.getObjectId(primaryObj); Object childAId = pm.getObjectId(childA); Object childBId = pm.getObjectId(childB); t.commit(); t.begin(); primaryObj = (InstanceCallbackClass)pm.getObjectById(primaryObjId, true); pm.deletePersistent(primaryObj); t.commit(); t.begin(); try { primaryObj = (InstanceCallbackClass)pm.getObjectById(primaryObjId, true); fail(ASSERTION_FAILED, "primaryObj deleted but getObjectById() on its Id succeeded."); } catch (JDOUserException e) { // expected one of these exceptions } catch (JDODataStoreException e) { // expected one of these exceptions } // check that jdoPreDelete() provided proper access to the attributes in primaryObj checkFieldValues(ASSERTION_FAILED, "jdoPreDelete attribute access: ", 1, "primaryObj", createTime, 1.0, (short)3, '1'); checkInstances(ASSERTION_FAILED, "jdoPreDelete instance access: ", 1, "secondaryObj", 2, 7); checkPMAccess(ASSERTION_FAILED, "jdoPreDelete PersistenceManager access: ", 1, true); // check that secondaryObj had jdoPreDelete() called on it and provided proper access to its attributes. checkFieldValues(ASSERTION_FAILED, "jdoPreDelete attribute access: ", 2, "secondaryObj", createTime, 2.0, (short)-1, '2'); checkInstances(ASSERTION_FAILED, "jdoPreDelete instance access: ", 2, null, 0, 0); checkPMAccess(ASSERTION_FAILED, "jdoPreDelete PersistenceManager access: ", 2, true); // check that secondaryObj was deleted. try { secondaryObj = (InstanceCallbackClass)pm.getObjectById(secondaryObjId, true); fail(ASSERTION_FAILED, "secondaryObj should have been deleted but getObjectById() on its Id succeeded."); } catch (JDOUserException e) { // expected one of these exceptions } catch (JDODataStoreException e) { // expected one of these exceptions } // check that first added member of Set had jdoPreDelete() called on it and provided proper access to its attributes. checkFieldValues(ASSERTION_FAILED, "jdoPreDelete attribute access: ", 3, "childA", createTime, 3.0, (short)-2, '3'); checkInstances(ASSERTION_FAILED, "jdoPreDelete instance access: ", 3, null, 0, 0); checkPMAccess(ASSERTION_FAILED, "jdoPreDelete PersistenceManager access: ", 3, true); // verify first added member of Set was actaully deleted. try { childA = (InstanceCallbackClass)pm.getObjectById(childAId, true); fail(ASSERTION_FAILED, "First added member of Set primaryObj.children should have been deleted but getObjectById() on its Id succeeded."); } catch (JDOUserException e) { // expected one of these exceptions } catch (JDODataStoreException e) { // expected one of these exceptions } // check that the second added member of Set did not have jdoPreDelete() called on it and it was not deleted. if(InstanceCallbackClass.processedIndex[4] == true) { fail(ASSERTION_FAILED, "jdoPreDelete() called on childB--it was not deleted."); } try { childB = (InstanceCallbackClass)pm.getObjectById(childBId, true); if( childB == null ){ if (debug) logger.debug("childB object is null"); } else { if( childB.name == null ) if (debug) logger.debug("childB.name is null"); } if(!childB.name.equals("childB")) { fail(ASSERTION_FAILED, "childB.name should be \"childB\". Instead its value is \"" + childB.name + "\"."); } } catch (JDOUserException e) { fail(ASSERTION_FAILED, "Second added member of Set primaryObj.children should exist but getObjectById() got JDOUserException " + e); } catch (JDODataStoreException e) { fail(ASSERTION_FAILED, "Second added member of Set primaryObj.children should exist but getObjectById() got JDODataStoreException " + e); } t.rollback(); pm.close(); pm = null; } } tck/src/java/org/apache/jdo/tck/api/instancecallbacks/AccessOtherInstancesInPrestore.java100664 11052 12500110374 32113 0ustarmbouschenstaff 0 0 /* * 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.api.instancecallbacks; import java.util.Date; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.instancecallbacks.InstanceCallbackClass; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Access Other Instances In Prestore Method *
*Keywords: instancecallbacks *
*Assertion ID: A10.2-3. *
*Assertion Description: The context in which a call is made to jdoPreStore() allows access to the PersistenceManager and other persistent JDO instances. */ /* * Within jdoPreStore(), locate the PersistenceManager (JDOHelper.getPersistenceManager()) and use it * to call currentTransaction(). Use the Transaction to call isActive() and verify active. These operations * are done to help verify that we had access to a usable PersistenceManager. * * Create objects. * Within jdoPreStore(), capture information about objects referenced. * This includes a String, Date and Collection attribute. * After commit() verify jdoPreStore() called and found what expected. */ public class AccessOtherInstancesInPrestore extends TestParts { /** */ private static final String ASSERTION_FAILED = "Assertion A10.2-3 (AccessOtherInstancesInPrestore) failed: "; /** * The main 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(AccessOtherInstancesInPrestore.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(InstanceCallbackClass.class); } /** */ public void test() throws Exception { pm = getPM(); Transaction t = pm.currentTransaction(); InstanceCallbackClass.initializeStaticsForTest(); InstanceCallbackClass.performPreStoreTests = true; t.begin(); // Create primaryObj which has a collection (children) of two objects and references another (nextObj). // None of the other objects have a non-empty collection. The also all have nextObj set to null. Date createTime = new Date(); InstanceCallbackClass secondaryObj = new InstanceCallbackClass("secondaryObj", createTime, 2, 2.0, (short)-1, '2', null); InstanceCallbackClass primaryObj = new InstanceCallbackClass("primaryObj", createTime, 1, 1.0, (short)3, '1', secondaryObj); InstanceCallbackClass childA = new InstanceCallbackClass("childA", createTime, 3, 3.0, (short)-2, '3', null); InstanceCallbackClass childB = new InstanceCallbackClass("childB", createTime, 4, 4.0, (short)-3, '4', null); pm.makePersistent(primaryObj); primaryObj.addChild(childA); primaryObj.addChild(childB); t.commit(); // check that jdoPreStore provides access to instances for primaryObj checkInstances(ASSERTION_FAILED, "jdoStore instance access: ", 1, "secondaryObj", 2, 7); // check that jdoPreStore provides access to PersistenceManager for primaryObj checkPMAccess(ASSERTION_FAILED, "jdoPreDelete PersistenceManager access: ", 1, true); // check that jdoPreStore provides access to instances for secondaryObj checkInstances(ASSERTION_FAILED, "jdoStore instance access: ", 2, null, 0, 0); // check that jdoPreStore provides access to PersistenceManager for secondaryObj checkPMAccess(ASSERTION_FAILED, "jdoPreDelete PersistenceManager access: ", 2, true); // There is no need to check childA or childB. They are no different than secondaryObj. pm.close(); pm = null; } } tck/src/java/org/apache/jdo/tck/api/instancecallbacks/CallingJdoPostload.java100664 14500 12500110374 27542 0ustarmbouschenstaff 0 0 /* * 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.api.instancecallbacks; import javax.jdo.JDODataStoreException; import javax.jdo.JDOUserException; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.instancecallbacks.InstanceCallbackNonPersistFdsClass; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Calling InstanceCallbacks Postload Method *
*Keywords: instancecallbacks *
*Assertion ID: A10.1-1. *
*Assertion Description: The jdoPostLoad() method of a class implementing InstanceCallbacks is called after the default fetch group values are loaded from the StateManager into the instance. */ /* * Create a persistent object and commit(). * * Retrieve object in the next transaction and verify its state is hollow. * * Reference a persistent attribute and verify: * the call to jdoPostLoad() occurred just before this reference--and after the object was retrieved (via getObjectById()), * jdoPostLoad() was called exactly once and * once the attribute has been referenced, the state of the object is persistent-clean * * Verify that the values of the persistent attributes available in jdoPostLoad() are the values actually in the object (the * values have already been restored be the time jdoPostLoad() is called). */ public class CallingJdoPostload extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A10.1-1 (CallingJdoPostload) failed"; /** * The main 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(CallingJdoPostload.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(InstanceCallbackNonPersistFdsClass.class); } /** */ public void test() throws Exception { pm = getPM(); Transaction t = pm.currentTransaction(); t.setRetainValues(false); InstanceCallbackNonPersistFdsClass.initializeStaticsForTest(); t.begin(); // create instance InstanceCallbackNonPersistFdsClass obj1 = new InstanceCallbackNonPersistFdsClass(2.2f, 13); pm.makePersistent(obj1); Object objPtr1 = pm.getObjectId (obj1); obj1.setNonPersist(1, (char)2, 3.3, (short)4); t.commit(); t.begin(); // set applicationStep before and after getObjectById() to be sure when jdoPostLoad() gets called. InstanceCallbackNonPersistFdsClass.applicationStep = InstanceCallbackNonPersistFdsClass.beforeGetObjectById; try { obj1 = (InstanceCallbackNonPersistFdsClass)pm.getObjectById(objPtr1, true); // jdoPreLoad() called } catch (JDOUserException e) { // could not locate persistent object created in previous transaction fail(ASSERTION_FAILED, "CallingJdoPostload: Could not locate persistent object obj1 created in previous transaction " + e); return; } catch (JDODataStoreException e) { // could not locate persistent object created in previous transaction fail(ASSERTION_FAILED, "CallingJdoPostload: Could not locate persistent object obj1 created in previous transaction " + e); return; } int objectState = currentState(obj1); // expect state to be hollow or persistent-clean if(objectState != HOLLOW && objectState != PERSISTENT_CLEAN) { fail(ASSERTION_FAILED, "State of object was not hollow or persistent clean after accessed via getObjectById((), state is " + states[objectState]); } InstanceCallbackNonPersistFdsClass.applicationStep = InstanceCallbackNonPersistFdsClass.afterGetObjectById; int getIntValue = obj1.intValue; // reference attribute in default fetch group objectState = currentState(obj1); // expect jdoPostLoad() was called if(!InstanceCallbackNonPersistFdsClass.postloadCalled) { fail(ASSERTION_FAILED, "jdoPostLoad() never called"); } // only check other information if jdoPostLoad() called if(InstanceCallbackNonPersistFdsClass.postloadCalled) { // expect jdoPostLoad() was called only once if(InstanceCallbackNonPersistFdsClass.postloadCalledMultipleTimes) { fail(ASSERTION_FAILED, "jdoPostLoad was called more than once for the same loaded object"); } // verify the value of intValue was available in jdoPostLoad() if(InstanceCallbackNonPersistFdsClass.savedIntValue != getIntValue) { fail(ASSERTION_FAILED, "intValue available in jdoPostLoad is incorrect. It was " + InstanceCallbackNonPersistFdsClass.savedIntValue + ", it should be " + getIntValue); } // verify the value of floatValue was available in jdoPostLoad() if(InstanceCallbackNonPersistFdsClass.savedFloatValue != obj1.floatValue) { fail(ASSERTION_FAILED, "floatValue available in jdoPostLoad is incorrect. It was " + InstanceCallbackNonPersistFdsClass.savedFloatValue + ", it should be " + obj1.floatValue); } } t.rollback(); pm.close(); pm = null; } } tck/src/java/org/apache/jdo/tck/api/instancecallbacks/CallingJdoPreclear.java100664 13245 12500110374 27517 0ustarmbouschenstaff 0 0 /* * 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.api.instancecallbacks; import java.util.Calendar; import java.util.Date; import javax.jdo.JDODataStoreException; import javax.jdo.JDOUserException; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.instancecallbacks.InstanceCallbackClass; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Calling Jdo Preclear *
*Keywords: instancecallbacks *
*Assertion ID: A10.3-1. *
*Assertion Description: The jdoPreClear() method of a class implementing InstanceCallbacks is called before the values in the instance are cleared. (This happens during the state transition to hollow.) */ /* * Create a new object, reference an existing object and * modify an existing object and then commit. * * Check that each instance contains the values set into * the persistent attributes prior to commit. */ public class CallingJdoPreclear extends TestParts { /** */ private static final String ASSERTION_FAILED = "Assertion A10.3-1 (CallingJdoPreclear) failed"; /** * The main 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(CallingJdoPreclear.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(InstanceCallbackClass.class); } /** */ public void test() throws Exception { pm = getPM(); Transaction t = pm.currentTransaction(); t.setRetainValues(false); // instances transit'n to hollow after commit InstanceCallbackClass.initializeStaticsForTest(); t.begin(); Calendar cal = Calendar.getInstance(); cal.set(1999, 1, 15, 12, 0); Date createTime = cal.getTime(); cal.set(2002, 1, 15, 12, 0); Date laterDate = cal.getTime(); InstanceCallbackClass secondaryObj = new InstanceCallbackClass("secondaryObj", createTime, 2, 2.2, (short)-20, '2', null); InstanceCallbackClass primaryObj = new InstanceCallbackClass("primaryObj", laterDate, 1, 1.1, (short)-10, '1', secondaryObj); pm.makePersistent(primaryObj); pm.makePersistent(secondaryObj); Object secondaryObjId = pm.getObjectId(secondaryObj); Object primaryObjId = pm.getObjectId(primaryObj); t.commit(); InstanceCallbackClass.performPreClearTests = true; t.setOptimistic(false); t.begin(); try { primaryObj = (InstanceCallbackClass)pm.getObjectById(primaryObjId, true); pm.retrieve(primaryObj); // load fields (make it persistent-clean) } catch (JDOUserException e) { fail(ASSERTION_FAILED, "Failed to find primaryObj created in " + "previous transaction. Got JDOUserException " + e); return; } catch (JDODataStoreException e) { fail(ASSERTION_FAILED, "Failed to find primaryObj created in " + "previous transaction. Got JDODataStoreException " + e); return; } secondaryObj = primaryObj.nextObj; if(secondaryObj == null) { fail(ASSERTION_FAILED, "Failed to find secondaryObj created in " + "previous transaction using reference from primaryObj."); return; } pm.retrieve(secondaryObj); // primaryObj contains one child; secondaryObj contains none primaryObj.addChild(secondaryObj); // primaryObj is now dirty cal.set(2005, 6, 28, 0, 0); Date stillLaterDate = cal.getTime(); InstanceCallbackClass ternaryObj = new InstanceCallbackClass("ternaryObj", stillLaterDate, 3, 3.3, (short)-30, '3', null); pm.makePersistent(ternaryObj); ternaryObj.addChild(primaryObj); t.commit(); // verify attributes in what was persistent-clean object--secondaryObj checkFieldValues(ASSERTION_FAILED, "jdoPreClear attribute access: ", 2, "secondaryObj", createTime, 2.2, (short)-20, '2'); // verify attributes in what was persistent-dirty object--primaryObj checkFieldValues(ASSERTION_FAILED, "jdoPreClear attribute access: ", 1, "primaryObj", laterDate, 1.1, (short)-10, '1'); // verify attributes in what was persistent-new object--ternaryObj checkFieldValues(ASSERTION_FAILED, "jdoPreClear attribute access: ", 3, "ternaryObj", stillLaterDate, 3.3, (short)-30, '3'); pm.close(); pm = null; InstanceCallbackClass.performPreClearTests = false; } } tck/src/java/org/apache/jdo/tck/api/instancecallbacks/CallingJdoPredelete.java100664 13530 12500110374 27670 0ustarmbouschenstaff 0 0 /* * 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.api.instancecallbacks; import javax.jdo.JDOException; import javax.jdo.JDOUserException; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.instancecallbacks.InstanceCallbackClass; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Calling JDO Predelete *
*Keywords: instancecallbacks *
*Assertion ID: A10.4-1. *
*Assertion Description: jdoPreDelete() is called during the execution of deletePersistent before the state transition to persistent-deleted or persistent-new-deleted. */ /* * Use the same PersistenceCapable class and objects as in the test AccessingFieldsInPredelete (but the * referenced object and Set need not be created). * * Delete one such new persistent, one persistent clean and one persistent dirty object. * * For each of these objects: * determine jdoPredelete is called after deletePersistent is called * determine jdoPredelete is called before statements after deletePersistent is called. * determine that in jdoPredelete, the state of the object is persistent-new, persistent-clean, or persistent-dirty * (appropriately). * determine that the state of the object after return from deletePersistent is persistent-deleted or * persitent-new-deleted (appropriately). * */ public class CallingJdoPredelete extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A10.4-1 (CallingJdoPredelete) failed"; /** * The main 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(CallingJdoPredelete.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(InstanceCallbackClass.class); } /** */ public void test() throws Exception { pm = getPM(); Transaction t = pm.currentTransaction(); InstanceCallbackClass.initializeStaticsForTest(); InstanceCallbackClass.performPreDeleteTests = true; // enabling PreDelete tests t.begin(); InstanceCallbackClass a = new InstanceCallbackClass(null, null, 1, 1.0, (short)-1, '1', null); InstanceCallbackClass b = new InstanceCallbackClass(null, null, 2, 2.0, (short)-1, '2', null); pm.makePersistent(a); pm.makePersistent(b); Object aId = pm.getObjectId(a); Object bId = pm.getObjectId(b); t.commit(); t.begin(); try { a = (InstanceCallbackClass)pm.getObjectById(aId, true); } catch (JDOUserException e) { fail(ASSERTION_FAILED, "CallingJdoPredelete: Failed to find object a created in previous transaction, got JDOUserException " + e); return; } try { b = (InstanceCallbackClass)pm.getObjectById(bId, true); } catch (JDOException e) { fail(ASSERTION_FAILED, "CallingJdoPredelete: Failed to find object b created in previous transaction, got JDOUserException " + e); return; } int getfld = a.intValue; // cause instance to be persistent-clean int getfld2 = a.childToDelete; b.childToDelete++; // make second object dirty InstanceCallbackClass c = new InstanceCallbackClass(null, null, 3, 3.0, (short)-1, '3', null); pm.makePersistent(c); // create persistent-new object InstanceCallbackClass.preDeleteCalled = false; pm.deletePersistent(a); if(!InstanceCallbackClass.preDeleteCalled) { fail(ASSERTION_FAILED, "jdoPreDelete not called when PERSISTENT_CLEAN object deleted."); } else { if(InstanceCallbackClass.objectState == PERSISTENT_DELETED) { fail(ASSERTION_FAILED, "Error, state was persistent-deleted in jdoPredelete callback"); } } InstanceCallbackClass.preDeleteCalled = false; pm.deletePersistent(b); if(!InstanceCallbackClass.preDeleteCalled) { fail(ASSERTION_FAILED, "jdoPreDelete not called when PERSISTENT_DIRTY object deleted."); } else { if(InstanceCallbackClass.objectState == PERSISTENT_DELETED) { fail(ASSERTION_FAILED, "Error, state was persistent-deleted in jdoPredelete callback"); } } InstanceCallbackClass.preDeleteCalled = false; pm.deletePersistent(c); if(!InstanceCallbackClass.preDeleteCalled) { fail(ASSERTION_FAILED,"jdoPreDelete not called when PERSISTENT_NEW object deleted."); } else { if(InstanceCallbackClass.objectState == PERSISTENT_NEW_DELETED) { fail(ASSERTION_FAILED, "Error, state was persistent-new-deleted in jdoPredelete callback"); } } t.rollback(); pm.close(); pm = null; } } tck/src/java/org/apache/jdo/tck/api/instancecallbacks/CallingJdoPrestore.java100664 23516 12500110374 27567 0ustarmbouschenstaff 0 0 /* * 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.api.instancecallbacks; import javax.jdo.JDODataStoreException; import javax.jdo.JDOUserException; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.instancecallbacks.InstanceCallbackClass; import org.apache.jdo.tck.pc.instancecallbacks.InstanceCallbackNonPersistFdsClass; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Calling InstanceCallbacks Prestore Method *
*Keywords: instancecallbacks *
*Assertion ID: A10.2-1. *
*Assertion Description: The jdoPreStore() method of a class implementing InstanceCallbacks is called before the values are stored from the instance to the StateManager. */ /* * Use non-managed and transactional values to construct a persistent attribute value to store in database. * Check to see this constructed persistent attribute got stored. * * jdoPreStore() should have been called when obj1 and obj2 were created. * jdoPreStore() should have been called again when obj2 was modified. * jdoPreStore() should not be called a second time on obj1 because it was not modified. /* This test is accomplished in three transactions. 1) object1 and object2 are created. At commit, we expect jdoPreStore() to be called on each and calculate values of persistent attributes from non-presistent attributes. 2) Retrieve object1 and object2 from the database and verify the persistent attributes have values calculated in the jdoPreStore()s called in the previous transaction. Change non-persistent fields in each but only change a persistent field in one of them. 3) Retrieve object1 and object2 from the database and verify that again jdoPreStore() was called for each in the previous transaction. */ public class CallingJdoPrestore extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A10.2-1 (CallingJdoPrestore) failed"; /** * The main 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(CallingJdoPrestore.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(InstanceCallbackNonPersistFdsClass.class); } /** */ public void test() throws Exception { pm = getPM(); Transaction t = pm.currentTransaction(); InstanceCallbackClass.initializeStaticsForTest(); InstanceCallbackClass.performPreStoreTests = true; t.begin(); int expectedIntValue1, expectedIntValue2; float expectedFloatValue1, expectedFloatValue2; int origIntValue1 = 10, origIntValue2 = 12; float origFloatValue1 = 2.5f, origFloatValue2 = -3.0f; // create two instances InstanceCallbackNonPersistFdsClass obj1 = new InstanceCallbackNonPersistFdsClass(origFloatValue1, origIntValue1); pm.makePersistent(obj1); Object objPtr1 = pm.getObjectId (obj1); obj1.setNonPersist(5, (char)10, .25, (short)100); expectedIntValue1 = obj1.calcIntValue(); expectedFloatValue1 = obj1.calcFloatValue(); InstanceCallbackNonPersistFdsClass obj2 = new InstanceCallbackNonPersistFdsClass(origFloatValue2, origIntValue2); pm.makePersistent(obj2); Object objPtr2 = pm.getObjectId (obj2); obj2.setNonPersist(2, (char)125, .1, (short)750); expectedIntValue2 = obj2.calcIntValue(); expectedFloatValue2 = obj2.calcFloatValue(); t.commit(); t.begin(); // read both objects back in to determine persistent state is as expected. try { obj1 = (InstanceCallbackNonPersistFdsClass)pm.getObjectById(objPtr1, true); checkValues("Object1 created and read back in: ", origIntValue1, expectedIntValue1, obj1.intValue); checkValues("Object1 created and read back in: ", origFloatValue1, expectedFloatValue1, obj1.floatValue); origIntValue1 = obj1.intValue; origFloatValue1 = obj1.floatValue; obj1.setNonManaged(-1, (char)62); expectedIntValue1 = obj1.calcIntValue(); expectedFloatValue1 = obj1.calcFloatValue(); } catch (JDOUserException e) { // could not locate persistent object created in previous transaction fail(ASSERTION_FAILED, "CallingJdoPrestore: Failed to find object obj1 created in previous transaction, got " + e); return; } catch (JDODataStoreException e) { // could not locate persistent object created in previous transaction fail(ASSERTION_FAILED, "CallingJdoPrestore: Failed to find object obj1 created in previous transaction, got " + e); return; } try { obj2 = (InstanceCallbackNonPersistFdsClass)pm.getObjectById(objPtr2, true); checkValues("Object2 created and read back in: ", origIntValue2, expectedIntValue2, obj2.intValue); checkValues("Object2 created and read back in: ", origFloatValue2, expectedFloatValue2, obj2.floatValue); origIntValue2 = obj2.intValue; origFloatValue2 = obj2.floatValue; obj2.setNonPersist(12, (char)30, 5.0, (short)137); expectedIntValue2 = obj2.calcIntValue(); expectedFloatValue2 = obj2.calcFloatValue(); // change obj2 making it persistent dirty (leave obj1 persistent clean). obj2.incrementIntValue(); } catch (JDOUserException e) { // could not locate persistent object created in previous transaction fail(ASSERTION_FAILED, "CallingJdoPrestore: Failed to find object obj2 created in previous transaction, got " + e); return; } catch (JDODataStoreException e) { // could not locate persistent object created in previous transaction fail(ASSERTION_FAILED, "CallingJdoPrestore: Failed to find object obj2 created in previous transaction, got " + e); return; } t.commit(); t.begin(); // read both objects back in to determine persistent state is as expected. try { // obj1 not made dirty, so jdoPreStore() should not have been called. obj1 = (InstanceCallbackNonPersistFdsClass)pm.getObjectById(objPtr1, true); checkValues("Object1, did not expect jdoPreStore to be called: ", origIntValue1, origIntValue1, obj1.intValue); checkValues("Object1, did not expect jdoPreStore to be called: ", origFloatValue1, origFloatValue1, obj1.floatValue); } catch (JDOUserException e) { // could not locate persistent object created in previous transaction fail(ASSERTION_FAILED, "CallingJdoPrestore: Failed to find object obj1 created in previous transaction, got " + e); return; } catch (JDODataStoreException e) { // could not locate persistent object created in previous transaction fail(ASSERTION_FAILED, "CallingJdoPrestore: Failed to find object obj1 created in previous transaction, got " + e); return; } try { obj2 = (InstanceCallbackNonPersistFdsClass)pm.getObjectById(objPtr2, true); checkValues("Object2, expected jdoPreStore() to be called: ", origIntValue2, expectedIntValue2, obj2.intValue); checkValues("Object2, expected jdoPreStore() to be called: ", origFloatValue2, expectedFloatValue2, obj2.floatValue); } catch (JDOUserException e) { // could not locate persistent object created in previous transaction fail(ASSERTION_FAILED, "CallingJdoPrestore: Failed to find object obj2 created in previous transaction, got " + e); return; } catch (JDODataStoreException e) { // could not locate persistent object created in previous transaction fail(ASSERTION_FAILED, "CallingJdoPrestore: Failed to find object obj2 created in previous transaction, got " + e); return; } t.rollback(); pm.close(); pm = null; } /** */ void checkValues(String title, int origIntValue, int expectedIntValue, int intValue) { if(expectedIntValue != intValue) { fail(ASSERTION_FAILED, title + "Original persistent intValue is " + origIntValue + ", expected " + expectedIntValue + ". Instead intValue is " + intValue); } } /** */ void checkValues(String title, float origFloatValue, float expectedFloatValue, float floatValue) { if(expectedFloatValue != floatValue) { fail(ASSERTION_FAILED, title + "Original persistent floatValue is " + origFloatValue + ", expected " + expectedFloatValue + ". Instead floatVal is " + floatValue); } } } tck/src/java/org/apache/jdo/tck/api/instancecallbacks/InstanceLifecycleListenerAttach.java100664 14034 12500110374 32247 0ustarmbouschenstaff 0 0 /* * 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.api.instancecallbacks; import java.util.Date; import javax.jdo.listener.AttachCallback; import javax.jdo.JDOHelper; import javax.jdo.listener.InstanceLifecycleEvent; import javax.jdo.listener.InstanceLifecycleListener; import javax.jdo.listener.ClearLifecycleListener; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** * Title: Test TestInstanceLifecycleListenerAttach *
* Keywords: LifeCycleListener preAttach postAttach *
* Assertion IDs: A12.15-13 A12.15-14 *
* Assertion Description: * A12.15-13 void preAttach(InstanceLifecycleEvent event); * This method is called before a detached instance is attached. * The source instance is the detached instance]. * A12.15-14 void postAttach(InstanceLifecycleEvent event); * This method is called after a detached instance is attached. * The source instance is the corresponding persistent instance in the cache; * the target instance is the detached instance. */ public class InstanceLifecycleListenerAttach extends AbstractInstanceLifecycleListener { /** * The InstanceLifecycleListener used for this test */ InstanceLifecycleListenerImpl listener = new InstanceLifecycleListenerAttachImpl(); /** Return the listener. */ protected InstanceLifecycleListenerImpl getListener() { return listener; } /** * The persistent classes used for this test. */ private static Class[] persistentClasses = new Class[] {PC.class}; /** Return the persistent classes. */ protected Class[] getPersistentClasses() { return persistentClasses; } /** * The main 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(InstanceLifecycleListenerAttach.class); } /** * This test creates a new persistent instance and detaches it. * The instance is attached in a new transaction, which causes * the attach callbacks and listeners to be called. */ public void testAttach() { // set up the persistent instance PC pc = new PC(); getPM(); pm.currentTransaction().begin(); pm.makePersistent(pc); PC detached = (PC)pm.detachCopy(pc); detached.listener = listener; pm.currentTransaction().commit(); pm.currentTransaction().begin(); listener.setExpectedSource(detached); // makePersistent should cause the attach listeners to be called PC attached = (PC)pm.makePersistent(detached); pm.currentTransaction().commit(); // now check the callback and listener were called listener.verifyCallbacks(ASSERTION13_FAILED, new int[] { listener.PRE_ATTACH_LISTENER, listener.PRE_ATTACH_CALLBACK, listener.POST_ATTACH_LISTENER}); } /** * The LifeCycleListener to be registered with the * PersistenceManager. */ private static class InstanceLifecycleListenerAttachImpl extends InstanceLifecycleListenerImpl { public void preAttach(InstanceLifecycleEvent event) { notifyEvent(PRE_ATTACH_LISTENER); checkEventType(ASSERTION13_FAILED, InstanceLifecycleEvent.ATTACH, event.getEventType()); checkEventSource(ASSERTION13_FAILED, event.getSource()); } public void postAttach(InstanceLifecycleEvent event) { notifyEvent(POST_ATTACH_LISTENER); checkEventType(ASSERTION14_FAILED, InstanceLifecycleEvent.ATTACH, event.getEventType()); checkPersistent(ASSERTION14_FAILED + "in postAttach, source ", event.getSource()); checkTrue(ASSERTION14_FAILED + "in postAttach, source wasPostAttachCalled() ", ((PC)event.getSource()).wasPostAttachCalled()); checkSame(ASSERTION14_FAILED + "in postAttach, target ", expectedSource, event.getTarget()); } } /** The persistence-capable class that implements the attach callback. */ public static class PC implements AttachCallback { transient InstanceLifecycleListenerImpl listener; transient boolean postAttachCalled = false; public boolean wasPostAttachCalled() { return postAttachCalled; } transient Object postAttachObject = null; public Object getPostAttachObject() { return postAttachObject; } int id; public PC() { } public PC(InstanceLifecycleListenerImpl listener) { id = counter++; this.listener = listener; } static int counter = (int)(new Date().getTime()); public void jdoPreAttach() { if (listener != null) { listener.notifyEvent(listener.PRE_ATTACH_CALLBACK); } } public void jdoPostAttach(Object obj) { postAttachCalled = true; postAttachObject = obj; } } } tck/src/java/org/apache/jdo/tck/api/instancecallbacks/InstanceLifecycleListenerClear.java100664 12731 12500110374 32073 0ustarmbouschenstaff 0 0 /* * 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.api.instancecallbacks; import java.util.Date; import javax.jdo.listener.ClearCallback; import javax.jdo.JDOHelper; import javax.jdo.listener.InstanceLifecycleEvent; import javax.jdo.listener.InstanceLifecycleListener; import javax.jdo.listener.ClearLifecycleListener; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** * Title: Test TestInstanceLifecycleListenerClear *
* Keywords: LifeCycleListener hollow preClear postClear *
* Assertion IDs: A12.15-5 A12.15-6 *
* Assertion Description: * A12.15-5 void preClear(InstanceLifecycleEvent event); * This method is called whenever a persistent instance * is cleared, for example during afterCompletion. It is called * before the jdoPreClear method is invoked on the instance. * A12.15-6 void postClear(InstanceLifecycleEvent event); * This method is called whenever a persistent instance * is cleared, for example during afterCompletion. It is called * after the jdoPreClear method is invoked on the instance and the fields * have been cleared by the JDO implementation. */ public class InstanceLifecycleListenerClear extends AbstractInstanceLifecycleListener { /** * The InstanceLifecycleListener used for this test */ InstanceLifecycleListenerImpl listener = new InstanceLifecycleListenerClearImpl(); /** Return the listener. */ protected InstanceLifecycleListenerImpl getListener() { return listener; } /** * The persistent classes used for this test. */ private static Class[] persistentClasses = new Class[] {PC.class}; /** Return the persistent classes. */ protected Class[] getPersistentClasses() { return persistentClasses; } /** * The main 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(InstanceLifecycleListenerClear.class); } /** * This test creates a new persistent instance and commits it. * Since the RetainValues flag is set to false, the persistent * fields will be cleared, and the pre-clear listener, * pre-clear callback, and post-clear listener will be called. */ public void testClear() { // set up the persistent instance PC pc = new PC(listener); listener.setExpectedSource(pc); // commit should cause the clear listeners to be called getPM(); pm.currentTransaction().begin(); pm.currentTransaction().setRetainValues(false); pm.makePersistent(pc); pm.currentTransaction().commit(); // now check the callback and listeners were called listener.verifyCallbacks(ASSERTION5_FAILED, new int[] { listener.PRE_CLEAR_LISTENER, listener.PRE_CLEAR_CALLBACK, listener.POST_CLEAR_LISTENER}); } /** * The LifeCycleListener to be registered with the * PersistenceManager. */ private static class InstanceLifecycleListenerClearImpl extends InstanceLifecycleListenerImpl { public void preClear(InstanceLifecycleEvent event) { notifyEvent(PRE_CLEAR_LISTENER); checkEventType(ASSERTION5_FAILED, InstanceLifecycleEvent.CLEAR, event.getEventType()); checkEventSource(ASSERTION5_FAILED, event.getSource()); checkPersistent(ASSERTION5_FAILED + " in preClear, ", expectedSource); } public void postClear(InstanceLifecycleEvent event) { notifyEvent(POST_CLEAR_LISTENER); checkEventType(ASSERTION6_FAILED, InstanceLifecycleEvent.CLEAR, event.getEventType()); checkEventSource(ASSERTION6_FAILED, event.getSource()); checkPersistent(ASSERTION6_FAILED + " in postClear, ", expectedSource); } } /** The persistence-capable class that implements the clear callback. */ public static class PC implements ClearCallback { transient InstanceLifecycleListenerImpl listener; int id; public PC() { } public PC(InstanceLifecycleListenerImpl listener) { id = counter++; this.listener = listener; } static int counter = (int)(new Date().getTime()); public void jdoPreClear() { if (listener != null) { listener.notifyEvent(listener.PRE_CLEAR_CALLBACK); } } } } tck/src/java/org/apache/jdo/tck/api/instancecallbacks/InstanceLifecycleListenerCreate.java100664 10135 12500110374 32244 0ustarmbouschenstaff 0 0 /* * 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.api.instancecallbacks; import javax.jdo.JDOHelper; import javax.jdo.listener.InstanceLifecycleEvent; import javax.jdo.listener.InstanceLifecycleListener; import javax.jdo.listener.AttachLifecycleListener; import javax.jdo.listener.ClearLifecycleListener; import javax.jdo.listener.CreateLifecycleListener; import javax.jdo.listener.DeleteLifecycleListener; import javax.jdo.listener.DetachLifecycleListener; import javax.jdo.listener.LoadLifecycleListener; import javax.jdo.listener.StoreLifecycleListener; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** * Title: Test TestInstanceLifecycleListener *
* Keywords: addLifeCycleListener removeLifeCycleListener *
* Assertion IDs: A12.15-1 *
* Assertion Description: * A12.15-1 void postCreate(InstanceLifecycleEvent event); * This method is called whenever a persistent instance is created, * during makePersistent. It is called after the instance transitions * to persistent-new. */ public class InstanceLifecycleListenerCreate extends AbstractInstanceLifecycleListener { /** * The InstanceLifecycleListener used for this test */ InstanceLifecycleListenerImpl listener = new InstanceLifecycleListenerCreateImpl(); /** Return the listener. */ protected InstanceLifecycleListenerImpl getListener() { return listener; } /** * The persistent classes used for this test. */ private static Class[] persistentClasses = new Class[] {PCPoint.class}; /** Return the persistent classes. */ protected Class[] getPersistentClasses() { return persistentClasses; } /** * The main 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(InstanceLifecycleListenerCreate.class); } /** */ public void testCreate() { // set up the persistent instance PCPoint point = new PCPoint(12, 15); listener.setExpectedSource(point); // makePersistent should cause the create listener to be called getPM(); pm.currentTransaction().begin(); pm.makePersistent(point); pm.currentTransaction().commit(); // verify that the listener was called listener.verifyCallbacks(ASSERTION1_FAILED, new int[] { listener.POST_CREATE_LISTENER}); } /** * The LifeCycleListener class to be registered with the * PersistenceManager. */ private static class InstanceLifecycleListenerCreateImpl extends InstanceLifecycleListenerImpl { public void postCreate(InstanceLifecycleEvent event) { notifyEvent(POST_CREATE_LISTENER); checkEventType(ASSERTION1_FAILED, InstanceLifecycleEvent.CREATE, event.getEventType()); checkEventSource(ASSERTION1_FAILED, event.getSource()); checkPersistent(ASSERTION1_FAILED + " in postCreate, ", expectedSource); checkNew(ASSERTION1_FAILED + " in postCreate, ", expectedSource); } } } tck/src/java/org/apache/jdo/tck/api/instancecallbacks/InstanceLifecycleListenerDelete.java100664 13124 12500110374 32244 0ustarmbouschenstaff 0 0 /* * 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.api.instancecallbacks; import java.util.Date; import javax.jdo.listener.DeleteCallback; import javax.jdo.JDOHelper; import javax.jdo.listener.InstanceLifecycleEvent; import javax.jdo.listener.InstanceLifecycleListener; import javax.jdo.listener.DeleteLifecycleListener; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** * Title: Test TestInstanceLifecycleListenerDelete *
* Keywords: LifeCycleListener deletePersistent preDelete postDelete *
* Assertion IDs: A12.15-7 A12.15-8 *
* Assertion Description: * A12.15-7 void preDelete(InstanceLifecycleEvent event); * This method is called whenever a persistent instance * is deleted, during deletePersistent. It is called before * the state transition and before the jdoPreDelete method * is invoked on the instance. * A12.15-8 void postDelete(InstanceLifecycleEvent event); * This method is called whenever a persistent instance * is deleted, during deletePersistent. It is called * after the jdoPreDelete method is invoked on the instance * and after the state transition. */ public class InstanceLifecycleListenerDelete extends AbstractInstanceLifecycleListener { /** * The InstanceLifecycleListener used for this test */ InstanceLifecycleListenerImpl listener = new InstanceLifecycleListenerDeleteImpl(); /** Return the listener. */ protected InstanceLifecycleListenerImpl getListener() { return listener; } /** * The persistent classes used for this test. */ private static Class[] persistentClasses = new Class[] {PC.class}; /** Return the persistent classes. */ protected Class[] getPersistentClasses() { return persistentClasses; } /** * The main 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(InstanceLifecycleListenerDelete.class); } /** * This test creates a new persistent instance, and deletes it. * The pre-delete listener, pre-delete callback, and post-delete * listener will be called. */ public void testDelete() { // set up the persistent instance PC pc = new PC(listener); listener.setExpectedSource(pc); // deletePersistent should cause the delete listeners to be called getPM(); pm.currentTransaction().begin(); pm.makePersistent(pc); pm.deletePersistent(pc); pm.currentTransaction().commit(); // now check the callback and listeners were called listener.verifyCallbacks(ASSERTION7_FAILED, (new int[] { listener.PRE_DELETE_LISTENER, listener.PRE_DELETE_CALLBACK, listener.POST_DELETE_LISTENER})); } /** * The LifeCycleListener to be registered with the * PersistenceManager. */ private static class InstanceLifecycleListenerDeleteImpl extends InstanceLifecycleListenerImpl { public void preDelete(InstanceLifecycleEvent event) { notifyEvent(PRE_DELETE_LISTENER); checkEventType(ASSERTION7_FAILED, InstanceLifecycleEvent.DELETE, event.getEventType()); checkEventSource(ASSERTION7_FAILED, event.getSource()); checkPersistent(ASSERTION7_FAILED + " in preDelete, ", expectedSource); checkNotDeleted(ASSERTION7_FAILED + " in preDelete, ", expectedSource); } public void postDelete(InstanceLifecycleEvent event) { notifyEvent(POST_DELETE_LISTENER); checkEventType(ASSERTION8_FAILED, InstanceLifecycleEvent.DELETE, event.getEventType()); checkEventSource(ASSERTION8_FAILED, event.getSource()); checkPersistent(ASSERTION8_FAILED + " in postDelete, ", expectedSource); checkDeleted(ASSERTION8_FAILED + " in postDelete, ", expectedSource); } } /** The persistence-capable class that implements the delete callback. */ public static class PC implements DeleteCallback { transient InstanceLifecycleListenerImpl listener; int id; public PC() { } public PC(InstanceLifecycleListenerImpl listener) { id = counter++; this.listener = listener; } static int counter = (int)(new Date().getTime()); public void jdoPreDelete() { if (listener != null) { listener.notifyEvent(listener.PRE_DELETE_CALLBACK); } } } } tck/src/java/org/apache/jdo/tck/api/instancecallbacks/InstanceLifecycleListenerDetach.java100664 14062 12500110374 32234 0ustarmbouschenstaff 0 0 /* * 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.api.instancecallbacks; import java.util.Date; import javax.jdo.listener.DetachCallback; import javax.jdo.JDOHelper; import javax.jdo.listener.InstanceLifecycleEvent; import javax.jdo.listener.InstanceLifecycleListener; import javax.jdo.listener.ClearLifecycleListener; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** * Title: Test InstanceLifecycleListenerDetach *
* Keywords: LifeCycleListener preDetach postDetach *
* Assertion IDs: A12.15-11 A12.15-12 *
* Assertion Description: * A12.15-11 void preDetach(InstanceLifecycleEvent event); * This method is called before a persistent instance is copied * for detachment. * A12.15-12 void postDetach(InstanceLifecycleEvent event); * This method is called whenever a persistent instance is copied * for detachment. * The source instance is the detached copy; the target instance * is the persistent instance. */ public class InstanceLifecycleListenerDetach extends AbstractInstanceLifecycleListener { /** * The InstanceLifecycleListener used for this test */ InstanceLifecycleListenerImpl listener = new InstanceLifecycleListenerDetachImpl(); /** Return the listener. */ protected InstanceLifecycleListenerImpl getListener() { return listener; } /** * The persistent classes used for this test. */ private static Class[] persistentClasses = new Class[] {PC.class}; /** Return the persistent classes. */ protected Class[] getPersistentClasses() { return persistentClasses; } /** * The main 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(InstanceLifecycleListenerLoad.class); } /** * This test creates a new persistent instance and commits it. * Since the RetainValues flag is set to false, the persistent * fields will be cleared, and the pre-clear listener, * pre-clear callback, and post-clear listener will be called. */ public void testDetach() { // set up the persistent instance PC pc = new PC(listener); listener.setExpectedSource(pc); getPM(); pm.currentTransaction().begin(); pm.makePersistent(pc); // detachCopy should cause the detach listeners to be called PC detached = (PC)pm.detachCopy(pc); pm.currentTransaction().commit(); // now check the callback and listener were called listener.verifyCallbacks(ASSERTION11_FAILED, new int[] { listener.PRE_DETACH_LISTENER, listener.PRE_DETACH_CALLBACK, listener.POST_DETACH_LISTENER}); } /** * The LifeCycleListener to be registered with the * PersistenceManager. */ private static class InstanceLifecycleListenerDetachImpl extends InstanceLifecycleListenerImpl { public void preDetach(InstanceLifecycleEvent event) { notifyEvent(PRE_DETACH_LISTENER); checkEventType(ASSERTION11_FAILED, InstanceLifecycleEvent.DETACH, event.getEventType()); checkEventSource(ASSERTION11_FAILED, event.getSource()); checkPersistent(ASSERTION11_FAILED + "in preDetach, source ", event.getSource()); } public void postDetach(InstanceLifecycleEvent event) { notifyEvent(POST_DETACH_LISTENER); checkEventType(ASSERTION12_FAILED, InstanceLifecycleEvent.DETACH, event.getEventType()); checkSame(ASSERTION12_FAILED + "in postDetach, target ", expectedSource, event.getTarget()); checkNotPersistent(ASSERTION12_FAILED + "in postDetach, source ", event.getSource()); checkPersistent(ASSERTION12_FAILED + "in postDetach, target ", event.getTarget()); checkTrue(ASSERTION12_FAILED + "in postDetach, source wasPostDetachCalled() ", ((PC)event.getSource()).wasPostDetachCalled()); } } /** The persistence-capable class that implements the load callback. */ public static class PC implements DetachCallback { transient InstanceLifecycleListenerImpl listener; int id; public PC() { } public PC(InstanceLifecycleListenerImpl listener) { id = counter++; this.listener = listener; } static int counter = (int)(new Date().getTime()); transient boolean postDetachCalled = false; public boolean wasPostDetachCalled() { return postDetachCalled; } transient Object postDetachObject = null; public Object getPostDetachObject() { return postDetachObject; } public void jdoPreDetach() { if (listener != null) { listener.notifyEvent(listener.PRE_DETACH_CALLBACK); } } public void jdoPostDetach(Object obj) { postDetachCalled = true; postDetachObject = obj; } } } tck/src/java/org/apache/jdo/tck/api/instancecallbacks/InstanceLifecycleListenerDirty.java100664 11765 12500110374 32146 0ustarmbouschenstaff 0 0 /* * 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.api.instancecallbacks; import java.util.Date; import javax.jdo.JDOHelper; import javax.jdo.listener.InstanceLifecycleEvent; import javax.jdo.listener.InstanceLifecycleListener; import javax.jdo.listener.ClearLifecycleListener; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** * Title: Test InstanceLifecycleListenerDirty *
* Keywords: LifeCycleListener preDirty postDirty *
* Assertion IDs: A12.15-9 A12.15-10 *
* Assertion Description: * A12.15-9 void preDirty(InstanceLifecycleEvent event); * This method is called whenever a persistent clean instance * is first made dirty, during an operation that modifies * the value of a persistent or transactional field. It is called * before the field value is changed. * A12.15-10 void postDirty(InstanceLifecycleEvent event); * This method is called whenever a persistent clean instance * is first made dirty, during an operation that modifies * the value of a persistent or transactional field. It is called * after the field value was changed. */ public class InstanceLifecycleListenerDirty extends AbstractInstanceLifecycleListener { /** * The InstanceLifecycleListener used for this test */ InstanceLifecycleListenerImpl listener = new InstanceLifecycleListenerDirtyImpl(); /** Return the listener. */ protected InstanceLifecycleListenerImpl getListener() { return listener; } /** * The persistent classes used for this test. */ private static Class[] persistentClasses = new Class[] {PCPoint.class}; /** Return the persistent classes. */ protected Class[] getPersistentClasses() { return persistentClasses; } /** * The main 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(InstanceLifecycleListenerDirty.class); } /** * This test creates a new persistent instance and commits it. * A new transaction is started and a persistent field is modified. * This will call the dirty listeners. */ public void testDirty() { // set up the persistent instance PCPoint pc = new PCPoint(100, 200); listener.setExpectedSource(pc); // setY should cause the dirty listeners to be called getPM(); pm.currentTransaction().begin(); pm.makePersistent(pc); pm.currentTransaction().commit(); pm.currentTransaction().begin(); pc.setY(new Integer(666)); pm.currentTransaction().commit(); // now check the callback and listener were called listener.verifyCallbacks(ASSERTION10_FAILED, new int[] { listener.PRE_DIRTY_LISTENER, listener.POST_DIRTY_LISTENER}); } /** * The LifeCycleListener to be registered with the * PersistenceManager. */ private static class InstanceLifecycleListenerDirtyImpl extends InstanceLifecycleListenerImpl { public void preDirty(InstanceLifecycleEvent event) { notifyEvent(PRE_DIRTY_LISTENER); checkEventType(ASSERTION9_FAILED, InstanceLifecycleEvent.DIRTY, event.getEventType()); checkEventSource(ASSERTION9_FAILED, event.getSource()); checkPersistent(ASSERTION9_FAILED + " in preDirty, ", expectedSource); checkNotDirty(ASSERTION9_FAILED + " in preDirty, ", expectedSource); } public void postDirty(InstanceLifecycleEvent event) { notifyEvent(POST_DIRTY_LISTENER); checkEventType(ASSERTION10_FAILED, InstanceLifecycleEvent.DIRTY, event.getEventType()); checkEventSource(ASSERTION10_FAILED, event.getSource()); checkPersistent(ASSERTION10_FAILED + " in postDirty,", expectedSource); checkDirty(ASSERTION9_FAILED + " in postDirty, ", expectedSource); } } } tck/src/java/org/apache/jdo/tck/api/instancecallbacks/InstanceLifecycleListenerLoad.java100664 11447 12500110374 31727 0ustarmbouschenstaff 0 0 /* * 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.api.instancecallbacks; import java.util.Date; import javax.jdo.listener.LoadCallback; import javax.jdo.JDOHelper; import javax.jdo.listener.InstanceLifecycleEvent; import javax.jdo.listener.InstanceLifecycleListener; import javax.jdo.listener.ClearLifecycleListener; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** * Title: Test InstanceLifecycleListenerLoad *
* Keywords: LifeCycleListener postLoad *
* Assertion IDs: A12.15-2 *
* Assertion Description: * A12.15-2 void postLoad(InstanceLifecycleEvent event); * This method is called whenever a persistent instance is loaded. * It is called after the jdoPostLoad method is invoked on the instance. */ public class InstanceLifecycleListenerLoad extends AbstractInstanceLifecycleListener { /** * The InstanceLifecycleListener used for this test */ InstanceLifecycleListenerImpl listener = new InstanceLifecycleListenerLoadImpl(); /** Return the listener. */ protected InstanceLifecycleListenerImpl getListener() { return listener; } /** * The persistent classes used for this test. */ private static Class[] persistentClasses = new Class[] {PC.class}; /** Return the persistent classes. */ protected Class[] getPersistentClasses() { return persistentClasses; } /** * The main 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(InstanceLifecycleListenerLoad.class); } /** * This test creates a new persistent instance and commits it. * In a new transaction, a value is accessed, which causes the * instance to be loaded. */ public void testLoad() { // set up the persistent instance PC pc = new PC(listener); listener.setExpectedSource(pc); // field access should cause the load listeners to be called getPM(); pm.currentTransaction().begin(); pm.currentTransaction().setRetainValues(false); pm.makePersistent(pc); pm.currentTransaction().commit(); pm.currentTransaction().begin(); pc.getValue(); pm.currentTransaction().commit(); // now check the callback and listener were called listener.verifyCallbacks(ASSERTION2_FAILED, new int[] { listener.POST_LOAD_CALLBACK, listener.POST_LOAD_LISTENER}); } /** * The LifeCycleListener to be registered with the * PersistenceManager. */ private static class InstanceLifecycleListenerLoadImpl extends InstanceLifecycleListenerImpl { public void postLoad(InstanceLifecycleEvent event) { notifyEvent(POST_LOAD_LISTENER); checkEventType(ASSERTION2_FAILED, InstanceLifecycleEvent.LOAD, event.getEventType()); checkEventSource(ASSERTION2_FAILED, event.getSource()); checkPersistent(ASSERTION2_FAILED + " in postLoad, ", expectedSource); checkNotNew(ASSERTION2_FAILED + " in postLoad, ", expectedSource); } } /** The persistence-capable class that implements the load callback. */ public static class PC implements LoadCallback { transient InstanceLifecycleListenerImpl listener; int id; int value; public int getValue() { return value; } public PC() { } public PC(InstanceLifecycleListenerImpl listener) { id = counter++; this.listener = listener; } static int counter = (int)(new Date().getTime()); public void jdoPostLoad() { if (listener != null) { listener.notifyEvent(listener.POST_LOAD_CALLBACK); } } } } tck/src/java/org/apache/jdo/tck/api/instancecallbacks/InstanceLifecycleListenerStore.java100664 12430 12500110374 32135 0ustarmbouschenstaff 0 0 /* * 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.api.instancecallbacks; import java.util.Date; import javax.jdo.listener.StoreCallback; import javax.jdo.JDOHelper; import javax.jdo.listener.InstanceLifecycleEvent; import javax.jdo.listener.InstanceLifecycleListener; import javax.jdo.listener.ClearLifecycleListener; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** * Title: Test InstanceLifecycleListenerLoad *
* Keywords: LifeCycleListener preStore postStore *
* Assertion IDs: A12.15-3 A12.15-4 *
* Assertion Description: * A12.15-3 void preStore(InstanceLifecycleEvent event); * This method is called whenever a persistent instance is stored, * for example during flush or commit. It is called * before the jdoPreStore method is invoked on the instance. * A12.15-4 void postStore(InstanceLifecycleEvent event); * This method is called whenever a persistent instance is stored, * for example during flush or commit. It is called * after the jdoPreStore method is invoked on the instance. * An object identity for a per?sistent-new instance must have been assigned * to the instance when this callback is invoked. */ public class InstanceLifecycleListenerStore extends AbstractInstanceLifecycleListener { /** * The InstanceLifecycleListener used for this test */ InstanceLifecycleListenerImpl listener = new InstanceLifecycleListenerStoreImpl(); /** Return the listener. */ protected InstanceLifecycleListenerImpl getListener() { return listener; } /** * The persistent classes used for this test. */ private static Class[] persistentClasses = new Class[] {PC.class}; /** Return the persistent classes. */ protected Class[] getPersistentClasses() { return persistentClasses; } /** * The main 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(InstanceLifecycleListenerStore.class); } /** * This test creates a new persistent instance and commits it. * The store callback and listeners will be called. */ public void testStore() { // set up the persistent instance PC pc = new PC(listener); listener.setExpectedSource(pc); // commit should cause the store listeners to be called getPM(); pm.currentTransaction().begin(); pm.makePersistent(pc); pm.currentTransaction().commit(); // now check the callback and listener were called listener.verifyCallbacks(ASSERTION2_FAILED, new int[] { listener.PRE_STORE_LISTENER, listener.PRE_STORE_CALLBACK, listener.POST_STORE_LISTENER}); } /** * The LifeCycleListener to be registered with the * PersistenceManager. */ private static class InstanceLifecycleListenerStoreImpl extends InstanceLifecycleListenerImpl { public void preStore(InstanceLifecycleEvent event) { notifyEvent(PRE_STORE_LISTENER); checkEventType(ASSERTION3_FAILED, InstanceLifecycleEvent.STORE, event.getEventType()); checkEventSource(ASSERTION3_FAILED, event.getSource()); checkPersistent(ASSERTION3_FAILED + " in preStore, ", expectedSource); } public void postStore(InstanceLifecycleEvent event) { notifyEvent(POST_STORE_LISTENER); checkEventType(ASSERTION4_FAILED, InstanceLifecycleEvent.STORE, event.getEventType()); checkEventSource(ASSERTION4_FAILED, event.getSource()); checkPersistent(ASSERTION4_FAILED + " in postStore, ", expectedSource); } } /** The persistence-capable class that implements the load callback. */ public static class PC implements StoreCallback { transient InstanceLifecycleListenerImpl listener; int id; public PC() { } public PC(InstanceLifecycleListenerImpl listener) { id = counter++; this.listener = listener; } static int counter = (int)(new Date().getTime()); public void jdoPreStore() { if (listener != null) { listener.notifyEvent(listener.PRE_STORE_CALLBACK); } } } } ././@LongLink100644 0 0 155 12500111677 10254 Lustar 0 0 tck/src/java/org/apache/jdo/tck/api/instancecallbacks/ModificationOfNontransactionalNonpersistentFields.javatck/src/java/org/apache/jdo/tck/api/instancecallbacks/ModificationOfNontransactionalNonpersistentFie100664 17273 12500110374 34470 0ustarmbouschenstaff 0 0 /* * 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.api.instancecallbacks; import java.util.Iterator; import javax.jdo.JDODataStoreException; import javax.jdo.JDOUserException; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.instancecallbacks.InstanceCallbackNonPersistFdsClass; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Modification of Nontransactional Nonpersistent Fields *
*Keywords: instancecallbacks *
*Assertion ID: A6.4.1-3. *
*Assertion Description: Nontransactional non-persistent fields may be modified during execution of user-written callbacks defined in interface InstanceCallbacks at specific points in the life cycle. */ /* * Test jdoPostLoad() by setting values into the non-managed and transactional attriubes. * This includes creating and populating a collection and initializing a Date. * Verify those values are set once the object is referenced. * * Test jdoPreClear(), jdoPreDelete() & jdoPreStore() by setting values into the nonmanaged and transactional attributes. * This includes setting a collection and Date to null. * Verify that no exceptions are thrown. */ public class ModificationOfNontransactionalNonpersistentFields extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A6.4.1-3 (ModificationOfNontransactionalNonpersistentFields) failed"; /** * The main 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(ModificationOfNontransactionalNonpersistentFields.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(InstanceCallbackNonPersistFdsClass.class); } /** */ public void test() throws Exception { pm = getPM(); Transaction t = pm.currentTransaction(); t.setRetainValues(false); InstanceCallbackNonPersistFdsClass.initializeStaticsForTest(); t.begin(); // create instance InstanceCallbackNonPersistFdsClass obj1 = new InstanceCallbackNonPersistFdsClass(1.1f, 1); pm.makePersistent(obj1); Object objPtr1 = pm.getObjectId (obj1); obj1.setNonPersist(1, (char)1, 0, (short)0); t.commit(); // jdoPreStore() and jdoPreClear() called t.begin(); try { obj1 = (InstanceCallbackNonPersistFdsClass)pm.getObjectById(objPtr1, true); // jdoPostLoad() called } catch (JDOUserException e) { // could not locate persistent object created in previous transaction fail(ASSERTION_FAILED, "ModificationOfNontransactionalNonpersistentFields: Could not locate persistent object obj1 created in previous transaction, got " + e); return; } catch (JDODataStoreException e) { // could not locate persistent object created in previous transaction fail(ASSERTION_FAILED, "ModificationOfNontransactionalNonpersistentFields: Could not locate persistent object obj1 created in previous transaction, got " + e); return; } // check fields set in jdoPostLoad() if(obj1.i != -10) { fail(ASSERTION_FAILED, "jdoPostLoad: Value incorrect, obj1.i != -10; it is " + obj1.i); } if(obj1.c != '2') { fail(ASSERTION_FAILED, "jdoPostLoad: Value incorrect, obj1.c != '2'; it is " + obj1.c); } if(obj1.d != 30.0) { fail(ASSERTION_FAILED, "jdoPostLoad: Value incorrect, obj1.d != 30.0; it is " + obj1.d); } if(obj1.s != 40) { fail(ASSERTION_FAILED, "jdoPostLoad: Value incorrect, obj1.s != 40; it is " + obj1.s); } if(obj1.loadTime != InstanceCallbackNonPersistFdsClass.savedLoadTime) { fail(ASSERTION_FAILED, "jdoPostLoad: Value incorrect, obj1.loadTime != " + InstanceCallbackNonPersistFdsClass.savedLoadTime + "; it is " + obj1.loadTime); } boolean childrenValueIncorrect = false; if(obj1.children.size() != 3) { childrenValueIncorrect = true; }else { if(!obj1.children.contains(InstanceCallbackNonPersistFdsClass.member1)) { childrenValueIncorrect = true; } if(!obj1.children.contains(InstanceCallbackNonPersistFdsClass.member2)) { childrenValueIncorrect = true; } if(!obj1.children.contains(InstanceCallbackNonPersistFdsClass.member3)) { childrenValueIncorrect = true; } } if(childrenValueIncorrect) { if (debug) { logger.debug("jdoPostLoad: Value incorrect, obj1.children does not contain the correct String members"); logger.debug("The members should be: " + InstanceCallbackNonPersistFdsClass.member1 + ", " + InstanceCallbackNonPersistFdsClass.member2 + ", " + InstanceCallbackNonPersistFdsClass.member3); logger.debug("obj1.children contains " + obj1.children.size() + " members"); if(obj1.children.size() != 0) { logger.debug("Those members are:"); for(Iterator i = obj1.children.iterator(); i.hasNext();) { logger.debug((String)i.next()); } } } fail(ASSERTION_FAILED, "jdoPostLoad: Value incorrect, obj1.children does not contain the correct String members"); } pm.deletePersistent(obj1); // jdoPreDelete() called t.commit(); // check result of jdoPreStore(), jdoPreClear() and jdoPreDelete() if (!InstanceCallbackNonPersistFdsClass.preClearCalled) { fail(ASSERTION_FAILED, "jdoPreClear() never called on obj1"); } if(!InstanceCallbackNonPersistFdsClass.preStoreCalled) { fail(ASSERTION_FAILED, "jdoPreStore() never called on obj1"); } if(!InstanceCallbackNonPersistFdsClass.preDeleteCalled) { fail(ASSERTION_FAILED, "jdoPreDelete() never called on obj1"); } if(InstanceCallbackNonPersistFdsClass.exceptions.size() != 0) { for(int index = 0; index < InstanceCallbackNonPersistFdsClass.exceptions.size(); index++) { fail(ASSERTION_FAILED, "" + InstanceCallbackNonPersistFdsClass.callbackCalled.get(index) + "operation " + InstanceCallbackNonPersistFdsClass.attributeOpCausingExceptions.get(index) + " resulted in exception " + InstanceCallbackNonPersistFdsClass.exceptions.get(index)); } } pm.close(); pm = null; } } tck/src/java/org/apache/jdo/tck/api/instancecallbacks/NoAccessToFieldsAfterPredelete.java100664 14372 12500110374 32001 0ustarmbouschenstaff 0 0 /* * 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.api.instancecallbacks; import java.util.Date; import java.util.HashSet; import javax.jdo.JDODataStoreException; import javax.jdo.JDOUserException; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.instancecallbacks.InstanceCallbackClass; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: No Access To Fields After Predelete *
*Keywords: instancecallbacks *
*Assertion ID: A10.4-3. *
*Assertion Description: Access to field values after a call to jdoPreDelete() of a class implementing InstanceCallbacks are disallowed. */ /* * Delete a persistent object and new object. While the objects are in state persitent-deleted (or persistent-new-deleted) * access persistent fields (except do not reference primary key fields). * * Verify the field access results in a JDOUserException. */ public class NoAccessToFieldsAfterPredelete extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A10.4-3 (NoAccessToFieldsAfterPredelete) failed"; /** * The main 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(NoAccessToFieldsAfterPredelete.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(InstanceCallbackClass.class); } /** */ public void test() throws Exception { pm = getPM(); Transaction t = pm.currentTransaction(); InstanceCallbackClass.initializeStaticsForTest(); t.begin(); // make intValue outside the range of zero to arraySize-1 to skip most jdoPreDelete() code. InstanceCallbackClass a = new InstanceCallbackClass("object a", null, InstanceCallbackClass.arraySize, 6.0, (short)-1, '6', null); pm.makePersistent(a); Object aId = pm.getObjectId(a); t.commit(); t.begin(); // relocte object. try { a = (InstanceCallbackClass)pm.getObjectById(aId, true); } catch (JDOUserException e) { fail(ASSERTION_FAILED, "NoAccessToFieldsAfterPredelete: Could not locate persistent object created in previous transaction, got " + e); return; } catch (JDODataStoreException e) { fail(ASSERTION_FAILED, "NoAccessToFieldsAfterPredelete: Could not locate persistent object created in previous transaction, got " + e); return; } pm.deletePersistent(a); performAccessFieldTests("Object in state persistent-deleted: ", a); InstanceCallbackClass b = new InstanceCallbackClass("object b", null, InstanceCallbackClass.arraySize + 1, 7.0, (short)-1, '7', null); pm.makePersistent(b); pm.deletePersistent(b); performAccessFieldTests("Object in state persistent-new-deleted: ", b); t.rollback(); pm.close(); pm = null; } /** */ void performAccessFieldTests(String title, InstanceCallbackClass o) { try { short x1 = o.childToDelete; // http://issues.apache.org/jira/browse/JDO-413 // fail(ASSERTION_FAILED, title + "Accessed persistent short field childToDelete--should have gotten JDOUserException"); } catch (JDOUserException e) { // expected } try { double x2 = o.doubleValue; // http://issues.apache.org/jira/browse/JDO-413 // fail(ASSERTION_FAILED, title + "Accessed persistent double field doubleValue--should have gotten JDOUserException"); } catch (JDOUserException e) { // expected } try { char x3 = o.charValue; // http://issues.apache.org/jira/browse/JDO-413 // fail(ASSERTION_FAILED, title + "Accessed persistent char field charValue--should have gotten JDOUserException"); } catch (JDOUserException e) { // expected } try { String x4 = o.name; // http://issues.apache.org/jira/browse/JDO-413 // fail(ASSERTION_FAILED,title + "Accessed persistent String field name--should have gotten JDOUserException"); } catch (JDOUserException e) { // expected } try { Date x5 = o.timeStamp; // http://issues.apache.org/jira/browse/JDO-413 // fail(ASSERTION_FAILED, title + "Accessed persistent Date field timeStamp--should have gotten JDOUserException"); } catch (JDOUserException e) { // expected } try { HashSet x6 = o.children; // http://issues.apache.org/jira/browse/JDO-413 // fail(ASSERTION_FAILED, title + "Accessed persistent HashSet field Children--should have gotten JDOUserException"); } catch (JDOUserException e) { // expected } try { InstanceCallbackClass x7 = o.nextObj; // http://issues.apache.org/jira/browse/JDO-413 // fail(ASSERTION_FAILED, title + "Accessed persistent InstanceCallbackClass reference field nextObj--should have gotten JDOUserException"); } catch (JDOUserException e) { // expected } } } tck/src/java/org/apache/jdo/tck/api/instancecallbacks/TestParts.java100664 15022 12500110374 25757 0ustarmbouschenstaff 0 0 /* * 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.api.instancecallbacks; import java.util.Date; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.instancecallbacks.InstanceCallbackClass; public abstract class TestParts extends JDO_Test { /** */ public TestParts() { } /** */ void checkInstances(String assertion, String label, int intValue, String capturedNextObjName, int numberOfChildren, int sumOfChildrenIntValue) { if (InstanceCallbackClass.processedIndex[intValue] != true) { fail(assertion, label + "Callback never made on object with intValue = " + intValue); } if (capturedNextObjName != null && InstanceCallbackClass.capturedNextObjName[intValue] == null) { fail(assertion, label + "nextObj attribute for object with intValue = " + intValue + " should not have been null."); } else if (capturedNextObjName == null && InstanceCallbackClass.capturedNextObjName[intValue] != null) { fail(assertion, label + "nextObj attribute for object with intValue = " + intValue + " should have been null."); } else if(capturedNextObjName != null && !InstanceCallbackClass.capturedNextObjName[intValue].equals(capturedNextObjName)) { fail(assertion, label + "nextObj.name attribute for object with intValue = " + intValue + " should have been \"" + capturedNextObjName + "\". It was \"" + InstanceCallbackClass.capturedNextObjName[intValue] + "\" instead."); } if(InstanceCallbackClass.numberOfChildren[intValue] != numberOfChildren) { fail(assertion, label + "Number of instances in attribute children for object with intValue = " + intValue + " should have been " + numberOfChildren + ". It was " + InstanceCallbackClass.numberOfChildren[intValue] + " instead."); } if(InstanceCallbackClass.sumOfChildrenIntValue[intValue] != sumOfChildrenIntValue) { fail(assertion, label + "Sum of intValue of instances in attribute children for object with intValue = " + intValue + " should have been " + sumOfChildrenIntValue + ". It was " + InstanceCallbackClass.sumOfChildrenIntValue[intValue] + " instead."); } } /** */ void checkPMAccess(String assertion, String label, int intValue, boolean transactionActive) { if (InstanceCallbackClass.processedIndex[intValue] != true) { fail(assertion, label + "Callback never made on object with intValue = " + intValue); return; } // Only verify isActive() returned true for the object if transactionActive is true if (transactionActive && InstanceCallbackClass.transactionActive[intValue] != true) { fail(assertion, label + "PersistenceManager.currentTransaction.isAcive() returned false"); } } /** * The attributes are: label, name, date, intValue, doubleValue, * childToDelete, charValue */ void checkFieldValues(String assertion, String label, int intValue, String name, Date timeStamp, double doubleValue, short childToDelete, char charValue) { if (InstanceCallbackClass.processedIndex[intValue] != true) { fail(assertion, label + "Callback never made on object with intValue = " + intValue); return; } if (!InstanceCallbackClass.capturedName[intValue].equals(name)) { fail(assertion, label + "name attribute for object with intValue = " + intValue + " should be \"" + name + "\". It was \"" + InstanceCallbackClass.capturedName[intValue] + "\" instead."); } if (!InstanceCallbackClass.capturedTimeStamp[intValue].equals(timeStamp)) { fail(assertion, label + "timeStamp attribute for object with intValue = " + intValue + " should be " + timeStamp + ". It was " + InstanceCallbackClass.capturedTimeStamp[intValue] + " instead."); } if (InstanceCallbackClass.capturedDoubleValue[intValue] != doubleValue) { fail (assertion, label + "doubleValue attribute for object with intValue = " + intValue + " should be " + doubleValue + ". It was " + InstanceCallbackClass.capturedDoubleValue[intValue] + " instead."); } if (InstanceCallbackClass.capturedCharValue[intValue] != charValue) { fail(assertion, label + "charValue attribute for object with intValue = " + intValue + " should be " + charValue + ". It was " + InstanceCallbackClass.capturedCharValue[intValue] + " instead."); } if (InstanceCallbackClass.capturedChildToDelete[intValue] != childToDelete) { fail(assertion, label + "childToDelete attribute for object with intValue = " + intValue + " should be " + childToDelete + ". It was " + InstanceCallbackClass.capturedChildToDelete[intValue] + " instead."); } } /** Touch fields to guarantee that they are loaded into the instance */ double touchFields (InstanceCallbackClass o) { // make a checksum from the fields and return it; this cannot be optimized out... double rc = o.doubleValue; rc += o.intValue; rc += o.charValue; rc += o.childToDelete; rc += o.name.length(); rc += o.timeStamp.getTime(); return rc; } } tck/src/java/org/apache/jdo/tck/api/jdohelper/GetObjectId.java100664 5460 12500110373 24445 0ustarmbouschenstaff 0 0 /* * 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.api.jdohelper; import javax.jdo.JDOHelper; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Get Objectid *
*Keywords: jdohelper *
*Assertion ID: A8.3-1 *
*Assertion Description: * The jdohelper.getObjectId method returns an ObjectId instance that represents * the object identity of the specified JDO Instance. Test: The method * getObjectById returns the exact same object, evaluating to true when == is used . */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 9/26/01 1.0 */ public class GetObjectId extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A8.3-1 (GetObjectId) failed: "; /** * The main 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(GetObjectId.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint.class); } /* test JDOHelper.getObjectId(Object pc) * */ public void testGetObjectId() { pm = getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); PCPoint p1 = new PCPoint(1,3); pm.makePersistent(p1); Object oid = JDOHelper.getObjectId(p1); if (oid == null) fail(ASSERTION_FAILED, "JDOHelper.getObjectId called for a P_NEW instance returned null ObjectId"); Object p2 = pm.getObjectById(oid, false); if (p2 != p1) fail(ASSERTION_FAILED, "JDOHelper.getObjectBy returned different instance " + p2 + " expected " + p1); tx.commit(); pm.close(); pm = null; } } tck/src/java/org/apache/jdo/tck/api/jdohelper/GetObjectIdForNull.java100664 4443 12500110373 25747 0ustarmbouschenstaff 0 0 /* * 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.api.jdohelper; import javax.jdo.JDOHelper; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Get Object Id For Null *
*Keywords: jdohelper *
*Assertion ID: A8.3-4. *
*Assertion Description: The jdohelper.getObjectId method returns null if Object is null. Evaluating to true when == is used. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 9/26/01 1.0 */ public class GetObjectIdForNull extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A8.3-4 (GetObjectIdForNull) failed: "; /** * The main 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(GetObjectIdForNull.class); } /* test jdohelper.getObjectId(Object pc) */ public void testGetObjectIdForNull() { pm = getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); Object p1 = null; Object oid = JDOHelper.getObjectId(p1); tx.commit(); if (oid != null) fail(ASSERTION_FAILED, "JDOHelper.getObjectId called for null instance returned non-null ObjectId"); pm.close(); pm = null; } } tck/src/java/org/apache/jdo/tck/api/jdohelper/GetObjectIdForTransient.java100664 4613 12500110373 27003 0ustarmbouschenstaff 0 0 /* * 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.api.jdohelper; import javax.jdo.JDOHelper; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Get Object Id For Transient *
*Keywords: jdohelper *
*Assertion ID: A8.3-2. *
*Assertion Description: The jdohelper.getObjectId method returns null if Object is a transient. Evaluating to true when == is used. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 9/27/01 1.0 */ public class GetObjectIdForTransient extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A8.3-2 (GetObjectIdForTransient) failed: "; /** * The main 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(GetObjectIdForTransient.class); } /* test JDOHelper.getObjectId(Object pc) * */ public void testGetObjectIdForTransient() { pm = getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); PCPoint p1 = new PCPoint(1,3); Object oid = JDOHelper.getObjectId(p1); tx.commit(); if (oid != null) fail(ASSERTION_FAILED, "JDOHelper.getObjectId called for transient instance returned non-null ObjectId " + oid); pm.close(); pm = null; } } tck/src/java/org/apache/jdo/tck/api/jdohelper/GetObjectIdNotPersistenceCapable.java100664 4642 12500110373 30604 0ustarmbouschenstaff 0 0 /* * 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.api.jdohelper; import javax.jdo.JDOHelper; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.Point; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Get Object Id Not Persistence Capable *
*Keywords: jdohelper *
*Assertion ID: A8.3-3. *
*Assertion Description: The jdohelper.getObjectId method returns null if Object is not persistence capable */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 9/26/01 1.0 */ public class GetObjectIdNotPersistenceCapable extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A8.3-3 (GetObjectIdNotPersistenceCapable) failed: "; /** * The main 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(GetObjectIdNotPersistenceCapable.class); } /* test JDOHelper.getObjectId(Object pc) * */ public void testGetObjectIdNotPersistenceCapable() { pm = getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); Point p1 = new Point(1,3); Object oid = JDOHelper.getObjectId(p1); tx.commit(); if (oid != null) fail(ASSERTION_FAILED, "JDOHelper.getObjectId called for instance of non-pc class returned non-null ObjectId " + oid); pm.close(); pm = null; } } tck/src/java/org/apache/jdo/tck/api/jdohelper/GetObjectIds.java100664 21573 12500110373 24653 0ustarmbouschenstaff 0 0 /* * 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.api.jdohelper; import java.util.List; import java.util.Arrays; import java.util.Collection; import java.util.Date; import java.util.Iterator; import javax.jdo.JDOHelper; import javax.jdo.PersistenceManager; import javax.jdo.identity.SingleFieldIdentity; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.pc.singlefieldidentity.PCPointSingleFieldInteger; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Test GetObjectIds *
*Keywords: getObjectIds getObjectId *
*Assertion IDs: A8.3-11 *
*Assertion Description: * These methods return the JDO identities of the parameter instances. * For each instance in the parameter, the getObjectId method is called. * They return one identity instance for each persistence-capable instance * in the parameter. The order of iteration of the returned Collection * exactly matches the order of iteration of the parameter Collection.] */ public class GetObjectIds extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A8.3-11 (GetObjectIds) failed: "; /** * The main 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(GetObjectIds.class); } /** The parameter objects */ Object obj0; Object obj1; Object obj2; Object obj3; Object obj4; Object[] objs; /** The object ids */ Object oid0; Object oid1; Object oid2; Object oid3; Object oid4; Object[] oids; /** Typed objects */ PCPointSingleFieldInteger singleFieldIdentityObj0; PCPointSingleFieldInteger singleFieldIdentityObj1; PCPointSingleFieldInteger[] singleFieldIdentityObjs; /** Typed object ids */ SingleFieldIdentity singleFieldIdentityOid0; SingleFieldIdentity singleFieldIdentityOid1; SingleFieldIdentity[] singleFieldIdentityOids; /** The second persistence manager. */ PersistenceManager pm2; /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint.class); objs = new Object[] { obj0 = null, obj1 = new Date(), obj2 = new PCPoint(23,45), // persistent in pm1 obj3 = new PCPoint(26,47), // persistent in pm2 obj4 = new PCPoint(23,45) // not persistent }; singleFieldIdentityObjs = new PCPointSingleFieldInteger[] { singleFieldIdentityObj0 = new PCPointSingleFieldInteger(0, 1), // persistent in pm1 singleFieldIdentityObj1 = new PCPointSingleFieldInteger(1, 1) // persistent in pm1 }; getPM(); pm.currentTransaction().begin(); pm.makePersistent(obj2); if (runsWithApplicationIdentity()) { pm.makePersistent(singleFieldIdentityObj0); pm.makePersistent(singleFieldIdentityObj1); } pm.currentTransaction().commit(); pm2 = getPMF().getPersistenceManager(); pm2.currentTransaction().begin(); pm2.makePersistent(obj3); pm2.currentTransaction().commit(); oids = new Object[] { oid0 = JDOHelper.getObjectId(obj0), oid1 = JDOHelper.getObjectId(obj1), oid2 = JDOHelper.getObjectId(obj2), oid3 = JDOHelper.getObjectId(obj3), oid4 = JDOHelper.getObjectId(obj4), }; singleFieldIdentityOids = new SingleFieldIdentity[] { singleFieldIdentityOid0 = (SingleFieldIdentity)JDOHelper.getObjectId(singleFieldIdentityObj0), singleFieldIdentityOid1 = (SingleFieldIdentity)JDOHelper.getObjectId(singleFieldIdentityObj1) }; } /** * @see JDO_Test#localTearDown() */ protected void localTearDown() { pm2.close(); } /** */ public void testGetObjectIdsArray() { StringBuffer messages = new StringBuffer(); Object[] expectedArray = oids; Object[] actualArray = JDOHelper.getObjectIds(objs); for (int i = 0; i < objs.length; ++i) { Object expected = expectedArray[i]; Object actual = actualArray[i]; if (expected == null? actual != null: !expected.equals(actual)) { messages.append( "\nComparison failed for object ids at position " + i + "\nexpected: " + expected + "\nactual: " + actual); } } if (messages.length() != 0) { fail(ASSERTION_FAILED + "getObjectIds(Object[] pcs) " + messages.toString()); } } /** */ public void testGetObjectIdsCollection() { StringBuffer messages = new StringBuffer(); List paramList = Arrays.asList(objs); List expectedList = Arrays.asList(oids); Collection actualCollection = JDOHelper.getObjectIds(paramList); Iterator expectedIterator = expectedList.iterator(); Iterator actualIterator = actualCollection.iterator(); for (int i = 0; i < objs.length; ++i) { Object expected = expectedIterator.next(); Object actual = actualIterator.next(); if (expected == null? actual != null: !expected.equals(actual)) { messages.append( "\nComparison failed for object ids at position " + i + "\nexpected: " + expected + "\nactual: " + actual); } } if (messages.length() != 0) { fail(ASSERTION_FAILED + "getObjectIds(Collection pcs) " + messages.toString()); } } /** */ public void testTypedGetObjectIdsArray() { if (!runsWithApplicationIdentity()) return; StringBuffer messages = new StringBuffer(); Object[] expectedArray = singleFieldIdentityOids; Object[] actualArray = JDOHelper.getObjectIds(singleFieldIdentityObjs); for (int i = 0; i < singleFieldIdentityObjs.length; ++i) { Object expected = expectedArray[i]; Object actual = actualArray[i]; if (expected == null? actual != null: !expected.equals(actual)) { messages.append( "\nComparison failed for object ids at position " + i + "\nexpected: " + expected + "\nactual: " + actual); } } if (messages.length() != 0) { fail(ASSERTION_FAILED + "getObjectIds(Object[] pcs) " + messages.toString()); } } /** */ public void testTypedGetObjectIdsCollection() { if (!runsWithApplicationIdentity()) return; StringBuffer messages = new StringBuffer(); List paramList = Arrays.asList(singleFieldIdentityObjs); List expectedList = Arrays.asList(singleFieldIdentityOids); Collection actualCollection = JDOHelper.getObjectIds(paramList); Iterator expectedIterator = expectedList.iterator(); Iterator actualIterator = actualCollection.iterator(); for (int i = 0; i < singleFieldIdentityObjs.length; ++i) { Object expected = expectedIterator.next(); Object actual = actualIterator.next(); if (expected == null? actual != null: !expected.equals(actual)) { messages.append( "\nComparison failed for object ids at position " + i + "\nexpected: " + expected + "\nactual: " + actual); } } if (messages.length() != 0) { fail(ASSERTION_FAILED + "getObjectIds(Collection pcs) " + messages.toString()); } } } tck/src/java/org/apache/jdo/tck/api/jdohelper/GetPersistenceManager.java100664 5540 12500110373 26540 0ustarmbouschenstaff 0 0 /* * 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.api.jdohelper; import javax.jdo.JDOHelper; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Get Persistence Manager *
*Keywords: jdohelper *
*Assertion ID: A8.1-1. *
*Assertion Description: The jdohelper.getPersistenceManager method returns associated persistence manager if the object parameter is not null and implements persistenceCapable. evaluating to true when == is used. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 9/26/01 1.0 */ public class GetPersistenceManager extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A8.1-1 (GetPersistenceManager) failed: "; /** * The main 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(GetPersistenceManager.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint.class); } /* test jdohelper.getPersistenceManager(Object pc) * */ public void testGetPersistenceManager() { pm = getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); PCPoint p1 = new PCPoint(1,3); pm.makePersistent(p1); PersistenceManager pm1= JDOHelper.getPersistenceManager(p1); tx.commit(); if (pm1 == null) fail(ASSERTION_FAILED, "JDOHelper.getPersistenceManager returns null for persistent instance"); if (pm1 != pm) fail(ASSERTION_FAILED, "JDOHelper.getPersistenceManager returns wrong pm " + pm1 + ", expected " + pm); pm.close(); pm = null; } } tck/src/java/org/apache/jdo/tck/api/jdohelper/GetPersistenceManagerForNull.java100664 4564 12500110373 30047 0ustarmbouschenstaff 0 0 /* * 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.api.jdohelper; import javax.jdo.JDOHelper; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Get Persistence Manager For Null *
*Keywords: jdohelper *
*Assertion ID: A8.1-4. *
*Assertion Description: The jdohelper.getPersistenceManager method returns null if Object is null. Evaluating to true when == is used. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 9/27/01 1.0 */ public class GetPersistenceManagerForNull extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A8.1-4 (GetPersistenceManagerForNull) failed: "; /** * The main 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(GetPersistenceManagerForNull.class); } /** */ public void testGetPersistenceManagerForNull() { pm = getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); Object p1 = null; PersistenceManager pm1 = JDOHelper.getPersistenceManager(p1); tx.commit(); if (pm1 != null) fail(ASSERTION_FAILED, "JDOHelper.getPersistenceManager with argument null returned non-null pm " + pm1); pm.close(); pm = null; } } tck/src/java/org/apache/jdo/tck/api/jdohelper/GetPersistenceManagerForTransient.java100664 4764 12500110373 31106 0ustarmbouschenstaff 0 0 /* * 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.api.jdohelper; import javax.jdo.JDOHelper; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Get Persistence Manager For Transien *
*Keywords: jdohelper *
*Assertion ID: A8.1-2. *
*Assertion Description: The jdohelper.getPersistenceManager method returns null if object is transient evaluating to true when == is used. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 9/28/01 1.0 */ public class GetPersistenceManagerForTransient extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A8.1-2 (GetPersistenceManagerForTransient) failed: "; /** * The main 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(GetPersistenceManagerForTransient.class); } /* test jdohelper.getPersistenceManager(Object transient) */ public void testGetPersistenceManagerForTransient() { pm = getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); PCPoint p1 = new PCPoint(1,3); tx.commit(); PersistenceManager pm1 = JDOHelper.getPersistenceManager(p1); if (pm1 != null) fail(ASSERTION_FAILED, "JDOHelper.getPersistenceManager called for transient instance returned non-null pm " + pm1); } } tck/src/java/org/apache/jdo/tck/api/jdohelper/GetPersistenceManagerNotPersistenceCapable.java100664 5114 12500110373 32673 0ustarmbouschenstaff 0 0 /* * 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.api.jdohelper; import javax.jdo.JDOHelper; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.Point; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Get Persistence Manager Not Persistence Capable *
*Keywords: jdohelper *
*Assertion ID: A8.1-3. *
*Assertion Description: The jdohelper.getPersistenceManager method returns null if object is not persistence capable evaluating to true when == is used. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 9/28/01 1.0 */ public class GetPersistenceManagerNotPersistenceCapable extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A8.1-3 (GetPersistenceManagerNotPersistenceCapable) failed: "; /** * The main 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(GetPersistenceManagerNotPersistenceCapable.class); } /* test jdohelper.getPersistenceManager(Object pc) * */ public void testGetPersistenceManagerNotPersistenceCapable() { pm = getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); Point p1 = new Point(1,3); tx.commit(); PersistenceManager pm1 = JDOHelper.getPersistenceManager(p1); if (pm1 != null) fail(ASSERTION_FAILED, "JDOHelper.getPersistenceManager called for instance of non-pc class returned non-null pm " + pm1); pm.close(); pm = null; } } tck/src/java/org/apache/jdo/tck/api/jdohelper/GetTransactionalObjectId.java100664 5201 12500110373 27161 0ustarmbouschenstaff 0 0 /* * 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.api.jdohelper; import javax.jdo.JDOHelper; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Get Transactional Object Id *
*Keywords: jdohelper *
*Assertion ID: A8.3-5 *
*Assertion Description: If the object parameter implements PersistenceCapable, JDOHelper.getTransactionalObjectId delegates to the parameter instance and returns the JDO identity of the instance. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 9/26/01 1.0 */ public class GetTransactionalObjectId extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A8.3-5 (GetTransactionalObjectId) failed: "; /** * The main 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(GetTransactionalObjectId.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint.class); } /* test JDOHelper.getTransactionalObjectId(Object pc) * */ public void testGetTransactionalObjectId() { pm = getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); PCPoint p1 = new PCPoint(1,3); pm.makePersistent(p1); Object oid = JDOHelper.getTransactionalObjectId(p1); tx.commit(); if (oid == null) fail(ASSERTION_FAILED, "JDOHelper.getTransactionalObjectId returned null oid."); pm.close(); pm = null; } } tck/src/java/org/apache/jdo/tck/api/jdohelper/GetTransactionalObjectIdForNull.java100664 4650 12500110373 30472 0ustarmbouschenstaff 0 0 /* * 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.api.jdohelper; import javax.jdo.JDOHelper; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Get Transactional Object Id For Null *
*Keywords: jdohelper *
*Assertion ID: A8.3-8 *
*Assertion Description: The jdohelper.getTransactionalObjectIdForNull method returns null if Object is null.Evaluating to true when == is used. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 10/1/01 1.0 */ public class GetTransactionalObjectIdForNull extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A8.3-8 (GetTransactionalObjectIdForNull) failed: "; /** * The main 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(GetTransactionalObjectIdForNull.class); } /* test jdohelper.getTransactionalObjectId(Object pc) * */ public void testGetTransactionalObjectIdForNull() { pm = getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); Object p1 = null; Object oid = JDOHelper.getTransactionalObjectId(p1); tx.commit(); if (oid != null) fail(ASSERTION_FAILED, "JDOHelper.getTransactionalObjectId with argument null returned non-null oid " + oid); pm.close(); pm = null; } } tck/src/java/org/apache/jdo/tck/api/jdohelper/GetTransactionalObjectIdForTransient.java100664 4772 12500110373 31534 0ustarmbouschenstaff 0 0 /* * 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.api.jdohelper; import javax.jdo.JDOHelper; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Get Transactional Object Id For Transient *
*Keywords: jdohelper *
*Assertion ID: A8.3-6 *
*Assertion Description: The jdohelper.getTransactionalObjectIdForTransient method returns null if Object is a transient.Evaluating to true when == is used. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 10/1/01 1.0 */ public class GetTransactionalObjectIdForTransient extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A8.3-6 (GetTransactionalObjectIdForTransient) failed: "; /** * The main 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(GetTransactionalObjectIdForTransient.class); } /* test JDOHelper.getTransactionalObjectId(Object pc) * */ public void testGetTransactionalObjectIdForTransient() { pm = getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); PCPoint p1 = new PCPoint(1,3); Object oid = JDOHelper.getTransactionalObjectId(p1); tx.commit(); if (oid != null) fail(ASSERTION_FAILED, "JDOHelper.getTransactionalObjectId called for transiewt instance returned non-null oid " + oid); pm.close(); pm = null; } } tck/src/java/org/apache/jdo/tck/api/jdohelper/GetTransactionalObjectIdNotPersistenceCapable.java100664 4770 12500110373 33331 0ustarmbouschenstaff 0 0 /* * 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.api.jdohelper; import javax.jdo.JDOHelper; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.Point; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Get Object Id Not Persistence Capable *
*Keywords: jdohelper *
*Assertion ID: A8.3-7 *
*Assertion Description: The jdohelper.getTransactionalObjectId method returns null if Object is not PC.Evaluating to true when == is used. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 10/1/01 1.0 */ public class GetTransactionalObjectIdNotPersistenceCapable extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A8.3-7 (GetTransactionalObjectIdNotPersistenceCapable) failed: "; /** * The main 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(GetTransactionalObjectIdNotPersistenceCapable.class); } /* test JDOHelper.getTransactionalObjectId(Object pc) * */ public void testGetTransactionalObjectIdNotPersistenceCapable() { pm = getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); Point p1 = new Point(1,3); Object oid = JDOHelper.getTransactionalObjectId(p1); tx.commit(); if (oid != null) fail(ASSERTION_FAILED, "JDOHelper.getTransactionalObjectId called for instance of non-pc class returned non-null ObjectId " + oid); } } tck/src/java/org/apache/jdo/tck/api/jdohelper/IsDeleted.java100664 5056 12500110373 24165 0ustarmbouschenstaff 0 0 /* * 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.api.jdohelper; import javax.jdo.JDOHelper; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Is Deleted *
*Keywords: jdohelper *
*Assertion ID: A8.4.5-1 *
*Assertion Description: The jdohelper.isDeleted method returns true if the instance of persistence capable have been deleted in the current transaction evaluating to true when == is used. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 9/26/01 1.0 */ public class IsDeleted extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A8.4.5-1 (IsDeleted) failed: "; /** * The main 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(IsDeleted.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint.class); } /* test jdohelper.isDeleted(Object pc) * */ public void testIsDeleted() { pm = getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); PCPoint p1 = new PCPoint(1,3); pm.makePersistent(p1); pm.deletePersistent(p1); boolean deleted = JDOHelper.isDeleted(p1); tx.commit(); if (!deleted) fail(ASSERTION_FAILED, "JDOHelper.isDeleted returns false for deleted instance"); pm.close(); pm = null; } } tck/src/java/org/apache/jdo/tck/api/jdohelper/IsDeletedFalse.java100664 5221 12500110373 25132 0ustarmbouschenstaff 0 0 /* * 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.api.jdohelper; import javax.jdo.JDOHelper; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Is Deleted False *
*Keywords: jdohelper *
*Assertion ID: A8.4.5-2 *
*Assertion Description: The object parameter that implements PersistenceCapable, JDOHelper.isDeleted delegates to the parameter instance and instances that have not been deleted in the current transaction return false. evaluating to true when == is used. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 9/29/01 1.0 */ public class IsDeletedFalse extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A8.4.5-2 (IsDeletedFalse) failed: "; /** * The main 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(IsDeletedFalse.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint.class); } /* test JDOHelper.isDeleted(Object pc) * */ public void testIsDeletedFalse() { pm = getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); PCPoint p1 = new PCPoint(1,3); pm.makePersistent(p1); //pm.deletePersistent(p1); boolean deleted = JDOHelper.isDeleted(p1); tx.commit(); if (deleted) fail(ASSERTION_FAILED, "JDOHelper.isDeleted returns true for non-deleted instance"); pm.close(); pm = null; } } tck/src/java/org/apache/jdo/tck/api/jdohelper/IsDeletedForNull.java100664 4465 12500110373 25472 0ustarmbouschenstaff 0 0 /* * 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.api.jdohelper; import javax.jdo.JDOHelper; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Is Deleted For Null *
*Keywords: jdohelper *
*Assertion ID: A8.4.5-5 *
*Assertion Description: The jdohelper.isDeleted method returns false for the instance of null, evaluating to true when == is used. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 9/28/01 1.0 */ public class IsDeletedForNull extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A8.4.5-5 (IsDeletedForNull) failed: "; /** * The main 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(IsDeletedForNull.class); } /* test JDOHelper.IsDeleted(object PC) * */ public void testIsDeletedForNull() { pm = getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); Object p1 = null; //pm.deletePersistent(p1); boolean deleted = JDOHelper.isDeleted(p1); tx.commit(); if (deleted) fail(ASSERTION_FAILED, "JDOHelper.isDeleted with argumnet null returns true."); pm.close(); pm = null; } } tck/src/java/org/apache/jdo/tck/api/jdohelper/IsDeletedForTransient.java100664 4544 12500110373 26525 0ustarmbouschenstaff 0 0 /* * 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.api.jdohelper; import javax.jdo.JDOHelper; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Is Deleted For Transient *
*Keywords: jdohelper *
*Assertion ID: A8.4.5-3 *
*Assertion Description: The JDOHelper.IsDeleted method returns false if the instance is a transient, evaluating to true when == is used. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 9/26/01 1.0 */ public class IsDeletedForTransient extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A8.4.5-3 (IsDeletedForTransient) failed: "; /** * The main 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(IsDeletedForTransient.class); } /* test JDOHelper.IsDeleted(Object pc) * */ public void testIsDeletedForTransient() { pm = getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); PCPoint p1 = new PCPoint(1,3); boolean deleted = JDOHelper.isDeleted(p1); tx.commit(); if (deleted) fail(ASSERTION_FAILED, "JDOHelper.isDeleted called for transient instance returns true."); pm.close(); pm = null; } } tck/src/java/org/apache/jdo/tck/api/jdohelper/IsDeletedNotPersistenceCapable.java100664 4631 12500110373 30321 0ustarmbouschenstaff 0 0 /* * 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.api.jdohelper; import javax.jdo.JDOHelper; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.Point; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Is Deleted Not Persistence Capable *
*Keywords: jdohelper *
*Assertion ID: A8.4.5-4 *
*Assertion Description: The JDOHelper.IsDeleted method returns false if the instance is not persistence capable , evaluating to true when == is used. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 9/26/01 1.0 */ public class IsDeletedNotPersistenceCapable extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A8.4.5-4 (IsDeletedNotPersistenceCapable) failed: "; /** * The main 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(IsDeletedNotPersistenceCapable.class); } /* test JDOHelper.isDeleted(Object pc) * */ public void testIsDeletedNotPersistenceCapable() { pm = getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); Point p1 = new Point(1,3); boolean deleted = JDOHelper.isDeleted(p1); tx.commit(); if (deleted) fail(ASSERTION_FAILED, "JDOHelper.isDeleted called for instance of non-pc class returns true."); pm.close(); pm = null; } } tck/src/java/org/apache/jdo/tck/api/jdohelper/IsDetached.java100664 5615 12500110373 24321 0ustarmbouschenstaff 0 0 /* * 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.api.jdohelper; import org.apache.jdo.tck.api.persistencemanager.detach.DetachTest; import org.apache.jdo.tck.pc.shoppingcart.Cart; import org.apache.jdo.tck.pc.shoppingcart.Undetachable; import org.apache.jdo.tck.util.BatchTestRunner; import javax.jdo.JDOHelper; import javax.jdo.Transaction; /** * Title: Test IsDetached *
* Keywords: *
* Assertion IDs: A8.5.6-1 *
* Assertion Description: * Instances that have been detached return true. * The method returns false if the instance is transient or null or if its class is not detachable. */ public class IsDetached extends DetachTest { private static final String ASSERTION_FAILED = "Assertion A8.5.6-1 JDOHelper.isDetached(Object) failed: "; /** * The main 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(IsDetached.class); } public void testNullTransientAndUndetachableIsDetachedFalse() { pm = getPM(); pm.currentTransaction().begin(); assertFalse(ASSERTION_FAILED + "null object is detached", JDOHelper.isDetached(null)); assertFalse(ASSERTION_FAILED + "transient object is detached", JDOHelper.isDetached(new Cart("bob"))); assertFalse(ASSERTION_FAILED + "object of class marked not detachabled is detached", JDOHelper.isDetached(new Undetachable())); pm.currentTransaction().commit(); } public void testDetachableIsDetachedTrue() { pm = getPM(); Transaction txn = pm.currentTransaction(); Cart c, detached; Object oid; txn.begin(); { c = new Cart("bob"); pm.makePersistent(c); oid = pm.getObjectId(c); } txn.commit(); txn.begin(); { c = (Cart) pm.getObjectById(oid); detached = (Cart) pm.detachCopy(c); assertTrue(JDOHelper.isDetached(detached)); } txn.commit(); } } tck/src/java/org/apache/jdo/tck/api/jdohelper/IsDirty.java100664 4764 12500110373 23717 0ustarmbouschenstaff 0 0 /* * 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.api.jdohelper; import javax.jdo.JDOHelper; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Is Dirty *
*Keywords: jdohelper *
*Assertion ID: A8.4.1-1 *
*Assertion Description: The jdohelper.isDirty method returns true if the instance of persistence capable have changed the state in the current transaction evaluating to true when == is used. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 9/30/01 1.0 */ public class IsDirty extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A8.4.1-1 (IsDirty) failed: "; /** * The main 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(IsDirty.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint.class); } /* test JDOHelper.isDeleted(Object pc) * */ public void testIsDirty() { pm = getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); PCPoint p1 = new PCPoint(1,3); pm.makePersistent(p1); boolean dirty = JDOHelper.isDirty(p1); tx.commit(); if (!dirty) fail(ASSERTION_FAILED, "JDOHelper.isDirty returns false for P-NEW instance"); pm.close(); pm = null; } } tck/src/java/org/apache/jdo/tck/api/jdohelper/IsDirtyFalse.java100664 5210 12500110373 24655 0ustarmbouschenstaff 0 0 /* * 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.api.jdohelper; import javax.jdo.JDOHelper; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Is Dirty False *
*Keywords: jdohelper *
*Assertion ID: A8.4.1-2 *
*Assertion Description: The jdohelper.isDirty method returns false if the instance of persistence capable have not changed the state in the current transaction evaluating to true when == is used. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 9/25/01 1.0 */ public class IsDirtyFalse extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A8.4.1-2 (IsDirtyFalse) failed: "; /** * The main 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(IsDirtyFalse.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint.class); } /* test JDOHelper.isDirty(Object pc) * */ public void testIsDirtyFalse() { pm = getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); PCPoint p1 = new PCPoint(1,3); pm.makePersistent(p1); tx.commit(); tx.begin(); // access p1 field to make sure the instance is loaded in new tx p1.getX(); boolean dirty = JDOHelper.isDirty(p1); tx.commit(); if (dirty) fail(ASSERTION_FAILED, "JDOHelper.isDirty returns true for P-CLEAN instance"); pm.close(); pm = null; } } tck/src/java/org/apache/jdo/tck/api/jdohelper/IsDirtyForNull.java100664 4374 12500110373 25216 0ustarmbouschenstaff 0 0 /* * 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.api.jdohelper; import javax.jdo.JDOHelper; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Is Dirty For Null *
*Keywords: jdohelper *
*Assertion ID: A8.4.1-5 *
*Assertion Description: The jdohelper.isDirty method returns false if the instance is null, evaluating to true when == is used. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 9/27/01 1.0 */ public class IsDirtyForNull extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A8.4.1-5 (IsDirtyForNull) failed: "; /** * The main 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(IsDirtyForNull.class); } /* test JDOHelper.isDirthy(Object pc) * */ public void testIsDirtyForNull() { pm = getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); Object p1 = null; boolean dirty = JDOHelper.isDirty(p1); tx.commit(); if (dirty) fail(ASSERTION_FAILED, "JDOHelper.isDirty with argument null returns true."); pm.close(); pm = null; } } tck/src/java/org/apache/jdo/tck/api/jdohelper/IsDirtyForTransient.java100664 4517 12500110373 26252 0ustarmbouschenstaff 0 0 /* * 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.api.jdohelper; import javax.jdo.JDOHelper; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Is Dirty For Transient *
*Keywords: jdohelper *
*Assertion ID: A8.4.1-3 *
*Assertion Description: The jdohelper.isDirty method returns false If the instance is transient, evaluating to true when == is used. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 9/28/01 1.0 */ public class IsDirtyForTransient extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A8.4.1-3 (IsDirtyForTransient) failed: "; /** * The main 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(IsDirtyForTransient.class); } /* test JDOHelper.isDeleted(Object pc) * */ public void testIsDirtyForTransient() { pm = getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); PCPoint p1 = new PCPoint(1,3); boolean dirty = JDOHelper.isDirty(p1); tx.commit(); if (dirty) fail(ASSERTION_FAILED, "JDOHelper.isDirty returns true for transient instance"); pm.close(); pm = null; } } tck/src/java/org/apache/jdo/tck/api/jdohelper/IsDirtyNotPersistenceCapable.java100664 4622 12500110373 30046 0ustarmbouschenstaff 0 0 /* * 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.api.jdohelper; import javax.jdo.JDOHelper; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.Point; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Is Dirty Not Persistence Capable *
*Keywords: jdohelper *
*Assertion ID: A8.4.1-4 *
*Assertion Description: The jdohelper.isDirty method returns false If the instance does not implement PersistenceCapable evaluating to true when == is used. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 9/26/01 1.0 */ public class IsDirtyNotPersistenceCapable extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A8.4.1-4 (IsDirtyNotPersistenceCapable) failed: "; /** * The main 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(IsDirtyNotPersistenceCapable.class); } /* test JDOHelper.isDeleted(Object pc) * */ public void testIsDirtyNotPersistenceCapable() { pm = getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); Point p1 = new Point(1,3); boolean dirty = JDOHelper.isDirty(p1); tx.commit(); if (dirty) fail(ASSERTION_FAILED, "JDOHelper.isDirty returns true for instance of non-pc class."); pm.close(); pm = null; } } tck/src/java/org/apache/jdo/tck/api/jdohelper/IsNew.java100664 4727 12500110373 23354 0ustarmbouschenstaff 0 0 /* * 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.api.jdohelper; import javax.jdo.JDOHelper; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Is New *
*Keywords: jdohelper *
*Assertion ID: A8.4.4-1 *
*Assertion Description: The jdohelper.isNew method returns true for instances that have been made persistent in the current transactionthe evaluating to true when == is used. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 10/2/01 1.0 */ public class IsNew extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A8.4.4-1 (IsNew) failed: "; /** * The main 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(IsNew.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint.class); } /* test JDOHelper.isNew(Object pc) * */ public void testIsNew() { pm = getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); PCPoint p1 = new PCPoint(1,3); pm.makePersistent(p1); boolean isNew = JDOHelper.isNew(p1); tx.commit(); if (!isNew) fail(ASSERTION_FAILED, "JDOHelper.isNew returns false for P-NEW instance"); pm.close(); pm = null; } } tck/src/java/org/apache/jdo/tck/api/jdohelper/IsNewFalse.java100664 4661 12500110373 24324 0ustarmbouschenstaff 0 0 /* * 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.api.jdohelper; import javax.jdo.JDOHelper; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Is New False *
*Keywords: jdohelper *
*Assertion ID: A8.4.4-2 *
*Assertion Description: The jdohelper.isnew method returns false for the instances that have not been made persistent in the current transaction evaluating to true when == is used. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 10/2/01 1.0 */ public class IsNewFalse extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A8.4.4-2 (IsNewFalse) failed: "; /** * The main 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(IsNewFalse.class); } /* test JDOHelper.isNew(Object pc) * */ public void testIsNewFalse() { pm = getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); PCPoint p1 = new PCPoint(1,3); tx.commit(); tx.begin(); // access p1 field to make sure the instance is loaded in new tx p1.getX(); boolean isNew = JDOHelper.isNew(p1); tx.commit(); if (isNew) fail(ASSERTION_FAILED, "JDOHelper.isNew returns true for P-CLEAN instance"); pm.close(); pm = null; } } tck/src/java/org/apache/jdo/tck/api/jdohelper/IsNewForNull.java100664 4314 12500110373 24646 0ustarmbouschenstaff 0 0 /* * 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.api.jdohelper; import javax.jdo.JDOHelper; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Is New For Null *
*Keywords: jdohelper *
*Assertion ID: A8.4.4-5 *
*Assertion Description: The jdohelper.isNew method returns false for the instance which is null, evaluating to true when == is used. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 10/2/01 1.0 */ public class IsNewForNull extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A8.4.4-5 (IsNewForNull) failed: "; /** * The main 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(IsNewForNull.class); } /* test JDOHelper.isNew(Object pc) * */ public void testIsNewForNull() { pm = getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); Object p1 = null; boolean isNew = JDOHelper.isNew(p1); tx.commit(); if (isNew) fail(ASSERTION_FAILED, "JDOHelper.isNew with argument null returns true"); pm.close(); pm = null; } } tck/src/java/org/apache/jdo/tck/api/jdohelper/IsNewForTransient.java100664 4447 12500110373 25712 0ustarmbouschenstaff 0 0 /* * 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.api.jdohelper; import javax.jdo.JDOHelper; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Is New For Transient *
*Keywords: jdohelper *
*Assertion ID: A8.4.4-3 *
*Assertion Description: The jdohelper.isNew method returns false If the instance is transient, evaluating to true when == is used. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 10/2/01 1.0 */ public class IsNewForTransient extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A8.4.4-3 (IsNewForTransient) failed: "; /** * The main 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(IsNewForTransient.class); } /* test JDOHelper.isNew(Object pc) * */ public void testIsNewForTransient() { pm = getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); PCPoint p1 = new PCPoint(1,3); boolean isNew = JDOHelper.isNew(p1); tx.commit(); if (isNew) fail(ASSERTION_FAILED, "JDOHelper.isNew returns true for transient instance"); pm.close(); pm = null; } } tck/src/java/org/apache/jdo/tck/api/jdohelper/IsNewNotPersistenceCapable.java100664 4610 12500110373 27501 0ustarmbouschenstaff 0 0 /* * 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.api.jdohelper; import javax.jdo.JDOHelper; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.Point; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Is New Not Persistence Capable *
*Keywords: jdohelper *
*Assertion ID: A8.4.4-4 *
*Assertion Description: The jdohelper.isNew method returns false If the instance does not implement PersistenceCapable evaluating to true when == is used. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 10/2/01 1.0 */ public class IsNewNotPersistenceCapable extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A8.4.4-4 (IsNewNotPersistenceCapable) failed: "; /** * The main 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(IsNewNotPersistenceCapable.class); } /* test JDOHelper.isNew(Object pc) * */ public void testIsNewNotPersistenceCapable() { pm = getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); Point p1 = new Point(1,3); boolean isNew = JDOHelper.isNew(p1); tx.commit(); if (isNew) fail(ASSERTION_FAILED, "JDOHelper.isNew returns true for instance of non-pc class."); pm.close(); pm = null; } } tck/src/java/org/apache/jdo/tck/api/jdohelper/IsPersistent.java100664 5000 12500110373 24744 0ustarmbouschenstaff 0 0 /* * 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.api.jdohelper; import javax.jdo.JDOHelper; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Is Persistent *
*Keywords: jdohelper *
*Assertion ID: A8.4.3-1 *
*Assertion Description: The JDOHelper.isPersistent method returns true if instances represent persistent objects in the data store true when == is used. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 10/2/01 1.0 */ public class IsPersistent extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A8.4.3-1 (IsPersistent) failed: "; /** * The main 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(IsPersistent.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint.class); } /* test JDOHelper.isPersistent(Object pc) * */ public void testIsPersistent() { pm = getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); PCPoint p1 = new PCPoint(1,3); pm.makePersistent(p1); boolean persistent = JDOHelper.isPersistent(p1); tx.commit(); if (!persistent) fail(ASSERTION_FAILED, "JDOHelper.isPersistent returns false for P-NEW instance."); pm.close(); pm = null; } } tck/src/java/org/apache/jdo/tck/api/jdohelper/IsPersistentFalse.java100664 4616 12500110373 25733 0ustarmbouschenstaff 0 0 /* * 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.api.jdohelper; import javax.jdo.JDOHelper; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Is Persistent False *
*Keywords: jdohelper *
*Assertion ID: A8.4.3-2 *
*Assertion Description: The jdohelper.isPersistent method returns false for instances which do not represent persistent objects in the data store . evaluating to true when == is used. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 10/2/01 1.0 */ public class IsPersistentFalse extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A8.4.3-2 (IsPersistentFalse) failed: "; /** * The main 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(IsPersistentFalse.class); } /* test JDOHelper.isPersistent(Object pc) * */ public void testIsPersistentFalse() { pm = getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); PCPoint p1 = new PCPoint(1,3); boolean persistent = JDOHelper.isPersistent(p1); tx.commit(); if (persistent) fail(ASSERTION_FAILED, "JDOHelper.isPersistent returns true for transient instance."); pm.close(); pm = null; } } tck/src/java/org/apache/jdo/tck/api/jdohelper/IsPersistentForNull.java100664 4435 12500110373 26261 0ustarmbouschenstaff 0 0 /* * 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.api.jdohelper; import javax.jdo.JDOHelper; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Is Persistent For Null *
*Keywords: jdohelper *
*Assertion ID: A8.4.3-5 *
*Assertion Description: The jdohelper.isPersistent method returns false for the instance which is null, evaluating to true when == is used. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 10/2/01 1.0 */ public class IsPersistentForNull extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A8.4.3-5 (IsPersistentForNull) failed: "; /** * The main 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(IsPersistentForNull.class); } /* test JDOHelper.isPersistent(Object pc) * */ public void testIsPersistentForNull() { pm = getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); Object p1 = null; boolean persistent = JDOHelper.isPersistent(p1); tx.commit(); if (persistent) fail(ASSERTION_FAILED, "JDOHelper.isPersistent with argumnet null returns true."); pm.close(); pm = null; } } tck/src/java/org/apache/jdo/tck/api/jdohelper/IsPersistentForTransient.java100664 4572 12500110373 27320 0ustarmbouschenstaff 0 0 /* * 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.api.jdohelper; import javax.jdo.JDOHelper; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Is Persistent For Transient *
*Keywords: jdohelper *
*Assertion ID: A8.4.3-3 *
*Assertion Description: The jdohelper.isPersistent method returns false If the instance is transient, evaluating to true when == is used. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 10/2/01 1.0 */ public class IsPersistentForTransient extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A8.4.3-3 (IsPersistentForTransient) failed: "; /** * The main 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(IsPersistentForTransient.class); } /* test JDOHelper.isPersistent(Object pc) * */ public void testIsPersistentForTransient() { pm = getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); PCPoint p1 = new PCPoint(1,3); boolean persistent = JDOHelper.isPersistent(p1); tx.commit(); if (persistent) fail(ASSERTION_FAILED, "JDOHelper.isPersistent returns true for transient instance."); pm.close(); pm = null; } } tck/src/java/org/apache/jdo/tck/api/jdohelper/IsPersistentNotPersistenceCapable.java100664 4671 12500110373 31117 0ustarmbouschenstaff 0 0 /* * 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.api.jdohelper; import javax.jdo.JDOHelper; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.Point; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Is Persistent Not Persistence Capable *
*Keywords: jdohelper *
*Assertion ID: A8.4.3-4 *
*Assertion Description: The jdohelper.isPersistent method returns false If the instance does not implement PersistenceCapable evaluating to true when == is used. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 10/2/01 1.0 */ public class IsPersistentNotPersistenceCapable extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A8.4.3-4 (IsPersistentNotPersistenceCapable) failed: "; /** * The main 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(IsPersistentNotPersistenceCapable.class); } /* test JDOHelper.isPersistent(Object pc) * */ public void testIsPersistentNotPersistenceCapable() { pm = getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); Point p1 = new Point(1,3); boolean persistent = JDOHelper.isPersistent(p1); tx.commit(); if (persistent) fail(ASSERTION_FAILED, "JDOHelper.isPersistent returns false for instance of non-pc class."); pm.close(); pm = null; } } tck/src/java/org/apache/jdo/tck/api/jdohelper/IsTransactional.java100664 5577 12500110373 25431 0ustarmbouschenstaff 0 0 /* * 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.api.jdohelper; import javax.jdo.JDOHelper; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Is Transactional *
*Keywords: jdohelper *
*Assertion ID: A8.4.2-1 *
*Assertion Description: The jdohelper.isTransactional method returns true and delegates to the parameter instance and instances whose state is associated with the current transaction . evaluating to true when == is used. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 10/4/01 1.0 */ public class IsTransactional extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A8.4.2-1 (IsTransactional) failed: "; /** * The main 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(IsTransactional.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint.class); } /* test JDOHelper.IsTransactional(Object pc) * */ public void testIsTransactional() { pm = getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); PCPoint p1 = new PCPoint(1,3); pm.makePersistent(p1); boolean transactional = JDOHelper.isTransactional(p1); tx.commit(); if (!transactional) fail(ASSERTION_FAILED, "JDOHelper.isTransactional returns false for P-NEW instance"); tx.begin(); // check transactional flag in new tx transactional = JDOHelper.isTransactional(p1); tx.commit(); if (transactional) fail(ASSERTION_FAILED, "JDOHelper.isTransactional returns true for P-HOLLOW/P-NONTX instance"); pm.close(); pm = null; } } tck/src/java/org/apache/jdo/tck/api/jdohelper/IsTransactionalFalse.java100664 5731 12500110373 26374 0ustarmbouschenstaff 0 0 /* * 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.api.jdohelper; import javax.jdo.JDOHelper; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Is Transactional False *
*Keywords: jdohelper *
*Assertion ID: A8.4.2-2 *
*Assertion Description: The jdohelper.isTransactional method returns false and delegates to the parameter instance and instances whose state is not associated with the current transaction return false. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 10/4/01 1.0 */ public class IsTransactionalFalse extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A8.4.2-2 (IsTransactionalFalse) failed: "; /** * The main 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(IsTransactionalFalse.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint.class); } /* test JDOHelper.IsTransactionalFalse(Object pc) * */ public void testIsTransactionalFalse() { pm = getPM(); Transaction tx = pm.currentTransaction(); tx.setOptimistic(false); tx.begin(); PCPoint p1 = new PCPoint(1,3); pm.makePersistent(p1); tx.commit(); tx.begin(); boolean transactional = JDOHelper.isTransactional(p1); tx.commit(); if (transactional) fail(ASSERTION_FAILED, "JDOHelper.isTransactional returns true for P-HOLLOW/P-NONTX instance"); tx.begin(); // access field to make sure the instance is P-CLEAN p1.getX(); transactional = JDOHelper.isTransactional(p1); tx.commit(); if (!transactional) fail(ASSERTION_FAILED, "JDOHelper.isTransactional returns false for P-CLEAN instance"); pm.close(); pm = null; } } tck/src/java/org/apache/jdo/tck/api/jdohelper/IsTransactionalForNull.java100664 4446 12500110373 26725 0ustarmbouschenstaff 0 0 /* * 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.api.jdohelper; import javax.jdo.JDOHelper; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Is Transactional For Null *
*Keywords: jdohelper *
*Assertion ID: A8.4.2-5 *
*Assertion Description: The jdohelper.isTransactional method returns false, if the instance is null. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 10/4/01 1.0 */ public class IsTransactionalForNull extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A8.4.2-5 (IsTransactionalForNull) failed: "; /** * The main 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(IsTransactionalForNull.class); } /* test JDOHelper.IsTransactionalForNull(Object pc) * */ public void testIsTransactionalForNull() { pm = getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); Object p1 = null; boolean transactional = JDOHelper.isTransactional(p1); tx.commit(); if (transactional) fail(ASSERTION_FAILED, "JDOHelper.isTransactional with argument null returns true."); pm.close(); pm = null; } } tck/src/java/org/apache/jdo/tck/api/jdohelper/IsTransactionalForTransient.java100664 4631 12500110373 27756 0ustarmbouschenstaff 0 0 /* * 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.api.jdohelper; import javax.jdo.JDOHelper; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Is Transactional For Transient *
*Keywords: jdohelper *
*Assertion ID: A8.4.2-3 *
*Assertion Description: The jdohelper.isTransactional method returns false if the instance is transien . evaluating to true when == is used. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 10/4/01 1.0 */ public class IsTransactionalForTransient extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A8.4.2-3 (IsTransactionalForTransient) failed: "; /** * The main 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(IsTransactionalForTransient.class); } /* test JDOHelper.IsTransactionalForTransient(Object pc) * */ public void testIsTransactionalForTransient() { pm = getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); PCPoint p1 = new PCPoint(1,3); boolean transactional = JDOHelper.isTransactional(p1); tx.commit(); if (transactional) fail(ASSERTION_FAILED, "JDOHelper.isTransactional returns true for transient instance."); pm.close(); pm = null; } } tck/src/java/org/apache/jdo/tck/api/jdohelper/IsTransactionalNotPersistenceCapable.java100664 5000 12500110373 31544 0ustarmbouschenstaff 0 0 /* * 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.api.jdohelper; import javax.jdo.JDOHelper; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.Point; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Is Transactional Not Persistence Capable *
*Keywords: jdohelper *
*Assertion ID: A8.4.2-4 *
*Assertion Description: The jdohelper.isTransactional method returns false If the instance does not implement PersistenceCapable . evaluating to true when == is used. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 10/4/01 1.0 */ public class IsTransactionalNotPersistenceCapable extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A8.4.2-4 (IsTransactionalNotPersistenceCapable) failed: "; /** * The main 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(IsTransactionalNotPersistenceCapable.class); } /* test JDOHelper.IsTransactionalNotPersistenceCapable(Object pc) * */ public void testIsTransactionalNotPersistenceCapable() { pm = getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); Point p1 = new Point(1,3); boolean transactional = JDOHelper.isTransactional(p1); tx.commit(); if (transactional) fail(ASSERTION_FAILED, "JDOHelper.isTransactional returns true for instance of non-pc class."); pm.close(); pm = null; } } tck/src/java/org/apache/jdo/tck/api/jdohelper/MakeDirty.java100664 5500 12500110373 24206 0ustarmbouschenstaff 0 0 /* * 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.api.jdohelper; import javax.jdo.JDOHelper; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Make Dirty *
*Keywords: jdohelper *
*Assertion ID: A8.2-1 *
*Assertion Description: The jdohelper.makeDirty method delegates to the parameter instance and marks the specified field dirty if parameter is instance of Persistence capable . evaluating to true when == is used. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 10/2/01 1.0 */ public class MakeDirty extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A8.2-1 (MakeDirty) failed: "; /** * The main 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(MakeDirty.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint.class); } /* test JDOHelper.MakeDirty(Object pc) * */ public void testMakeDirty() { pm = getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); PCPoint p1 = new PCPoint(1,3); pm.makePersistent(p1); if (debug) logger.debug(" isDirty1:"+ JDOHelper.isDirty(p1)); tx.commit(); if (debug) logger.debug(" isDirty2:" + JDOHelper.isDirty(p1)); tx.begin(); JDOHelper.makeDirty(p1,"x"); boolean dirty = JDOHelper.isDirty(p1); tx.commit(); if (debug) logger.debug(" isDirty3:" + dirty); if (!dirty) fail(ASSERTION_FAILED, "Instance is not dirty after calling JDOHelper.makeDirty"); pm.close(); pm = null; } } tck/src/java/org/apache/jdo/tck/api/jdohelper/MakeDirtyForNull.java100664 4470 12500110373 25515 0ustarmbouschenstaff 0 0 /* * 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.api.jdohelper; import javax.jdo.JDOHelper; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Make Dirty For Null *
*Keywords: jdohelper *
*Assertion ID: A8.2-3 *
*Assertion Description: The JDOHelper.makeDirty method has no affect if the instance is null, evaluating to true when == is used. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 9/27/01 1.0 */ public class MakeDirtyForNull extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A8.2-3 (MakeDirtyForNull) failed: "; /** * The main 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(MakeDirtyForNull.class); } /* test JDOHelper.makeDirthy(Object pc) * */ public void testMakeDirtyForNull() { pm = getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); Object p1 = null; JDOHelper.makeDirty(p1,"x"); boolean dirty = JDOHelper.isDirty(p1); tx.commit(); if (dirty) fail(ASSERTION_FAILED, "null instance is dirty after calling JDOHelper.makeDirty."); pm.close(); pm = null; } } tck/src/java/org/apache/jdo/tck/api/jdohelper/MakeDirtyForTransient.java100664 5037 12500110373 26552 0ustarmbouschenstaff 0 0 /* * 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.api.jdohelper; import javax.jdo.JDOHelper; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Make Dirty For Transient *
*Keywords: jdohelper *
*Assertion ID: A8.2-2 *
*Assertion Description: The JDOHelper.makeDirty method has no affect if the instance is transient, evaluating to true when == is used. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 10/3/01 1.0 */ public class MakeDirtyForTransient extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A8.2-2 (MakeDirtyForTransient) failed: "; /** * The main 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(MakeDirtyForTransient.class); } /* test JDOHelper.makeDirthy(Object pc) * */ public void testMakeDirtyForTransient() { pm = getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); PCPoint p1 = new PCPoint(1,2); if (debug) logger.debug(" isDirty1:"+ JDOHelper.isDirty(p1)); JDOHelper.makeDirty(p1,"x"); if (debug) logger.debug(" isDirty2:"+ JDOHelper.isDirty(p1)); boolean dirty = JDOHelper.isDirty(p1); tx.commit(); if (dirty) fail(ASSERTION_FAILED, "transient instance is dirty after calling JDOHelper.makeDirty."); pm.close(); pm = null; } } tck/src/java/org/apache/jdo/tck/api/jdohelper/MakeDirtyNotPersistenceCapable.java100664 4715 12500110373 30353 0ustarmbouschenstaff 0 0 /* * 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.api.jdohelper; import javax.jdo.JDOHelper; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.Point; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Make Dirty Not Persistence Capable *
*Keywords: jdohelper *
*Assertion ID: A8.2-4 *
*Assertion Description: The JDOHelper.makeDirty method has no affect if the instance is not persistence capable evaluating to true when == is used. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 10/3/01 1.0 */ public class MakeDirtyNotPersistenceCapable extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A8.2-4 (MakeDirtyNotPersistenceCapable) failed: "; /** * The main 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(MakeDirtyNotPersistenceCapable.class); } /* test JDOHelper.makeDirthy(Object pc) * */ public void testMakeDirtyNotPersistenceCapable() { pm = getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); Point p1 = new Point(1,2); JDOHelper.makeDirty(p1,"x"); boolean dirty = JDOHelper.isDirty(p1); tx.commit(); if (dirty) fail(ASSERTION_FAILED, "instance of non-pc class is dirty after calling JDOHelper.makeDirty."); pm.close(); pm = null; } } tck/src/java/org/apache/jdo/tck/api/persistencecapable/AbstractPersistenceCapableTest.java100664 5067 12500110373 32265 0ustarmbouschenstaff 0 0 /* * 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.api.persistencecapable; import javax.jdo.JDOHelper; import javax.jdo.PersistenceManager; import javax.jdo.spi.PersistenceCapable; import org.apache.jdo.tck.JDO_Test; /** * This class is the super class for all persistence-capable tests. * @author Michael Watzek */ abstract class AbstractPersistenceCapableTest extends JDO_Test { /** * Makes the given object persistent, * adds it as tear down instance, * and returns its object id. * @param pc the transient instance to be made persistent * @return the object id of the persistent instance */ protected Object makePersistent(Object pc) { addTearDownClass(pc.getClass()); PersistenceManager pm = getPM(); pm.currentTransaction().begin(); pm.makePersistent(pc); Object result = JDOHelper.getObjectId(pc); pm.currentTransaction().commit(); return result; } protected boolean isTestToBePerformed() { String testName = getClass().getName(); if (!isBinaryCompatibilitySupported()) { printUnsupportedOptionalFeatureNotTested( testName, "javax.jdo.option.BinaryCompatibility"); } else if (!isApplicationIdentitySupported()) { printUnsupportedOptionalFeatureNotTested( testName, "javax.jdo.option.ApplicationIdentity"); } return isBinaryCompatibilitySupported() && isApplicationIdentitySupported() && runsWithApplicationIdentity(); } protected void assertPersistenceCapable(Object o) { if (!(o instanceof PersistenceCapable)) { throw new IllegalArgumentException ("Argument o must be instance of PersistenceCapable."); } } } tck/src/java/org/apache/jdo/tck/api/persistencecapable/CopyKeyFieldsFromObjectId.java100664 26101 12500110373 31157 0ustarmbouschenstaff 0 0 /* * 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.api.persistencecapable; import javax.jdo.identity.ByteIdentity; import javax.jdo.identity.CharIdentity; import javax.jdo.identity.IntIdentity; import javax.jdo.identity.LongIdentity; import javax.jdo.identity.ObjectIdentity; import javax.jdo.identity.ShortIdentity; import javax.jdo.identity.SingleFieldIdentity; import javax.jdo.identity.StringIdentity; import javax.jdo.spi.PersistenceCapable; import org.apache.jdo.tck.pc.singlefieldidentity.AbstractPCPointSingleField; import org.apache.jdo.tck.pc.singlefieldidentity.PCPointSingleFieldByte; import org.apache.jdo.tck.pc.singlefieldidentity.PCPointSingleFieldCharacter; import org.apache.jdo.tck.pc.singlefieldidentity.PCPointSingleFieldDate; import org.apache.jdo.tck.pc.singlefieldidentity.PCPointSingleFieldInteger; import org.apache.jdo.tck.pc.singlefieldidentity.PCPointSingleFieldLong; import org.apache.jdo.tck.pc.singlefieldidentity.PCPointSingleFieldPrimitivebyte; import org.apache.jdo.tck.pc.singlefieldidentity.PCPointSingleFieldPrimitivechar; import org.apache.jdo.tck.pc.singlefieldidentity.PCPointSingleFieldPrimitiveint; import org.apache.jdo.tck.pc.singlefieldidentity.PCPointSingleFieldPrimitivelong; import org.apache.jdo.tck.pc.singlefieldidentity.PCPointSingleFieldPrimitiveshort; import org.apache.jdo.tck.pc.singlefieldidentity.PCPointSingleFieldShort; import org.apache.jdo.tck.pc.singlefieldidentity.PCPointSingleFieldString; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title:CopyKeyFieldsFromObjectId of PersistenceCapable *
*Keywords: persistencecapable *
*Assertion IDs: A7.12-25 *
*Assertion Description: *

* A7.12-25
* public void jdoCopyKeyFieldsFromObjectId(ObjectIdFieldConsumer fc, Object oid); * This method copies fields to the field manager instance * from the second parameter instance. * * @author Michael Watzek */ public class CopyKeyFieldsFromObjectId extends AbstractPersistenceCapableTest { /** */ private static final String ASSERTION_FAILED = "Assertion A7.12-25 (jdoCopyKeyFieldsFromObjectId) failed: "; /** * The main 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(CopyKeyFieldsFromObjectId .class); } public void testSingleFieldIdentitybyte() { if (isTestToBePerformed()) { singleFieldIdentity(new PCPointSingleFieldPrimitivebyte(1, 2)); } } public void testSingleFieldIdentityByte() { if (isTestToBePerformed()) { singleFieldIdentity(new PCPointSingleFieldByte(1, 2)); } } public void testSingleFieldIdentitychar() { if (isTestToBePerformed()) { singleFieldIdentity(new PCPointSingleFieldPrimitivechar(1, 2)); } } public void testSingleFieldIdentityCharacter() { if (isTestToBePerformed()) { singleFieldIdentity(new PCPointSingleFieldCharacter(1, 2)); } } public void testSingleFieldIdentityint() { if (isTestToBePerformed()) { singleFieldIdentity(new PCPointSingleFieldPrimitiveint(1, 2)); } } public void testSingleFieldIdentityInteger() { if (isTestToBePerformed()) { singleFieldIdentity(new PCPointSingleFieldInteger(1, 2)); } } public void testSingleFieldIdentitylong() { if (isTestToBePerformed()) { singleFieldIdentity(new PCPointSingleFieldPrimitivelong(1, 2)); } } public void testSingleFieldIdentityLong() { if (isTestToBePerformed()) { singleFieldIdentity(new PCPointSingleFieldLong(1, 2)); } } public void testSingleFieldIdentityshort() { if (isTestToBePerformed()) { singleFieldIdentity(new PCPointSingleFieldPrimitiveshort(1, 2)); } } public void testSingleFieldIdentityShort() { if (isTestToBePerformed()) { singleFieldIdentity(new PCPointSingleFieldShort(1, 2)); } } public void testSingleFieldIdentityString() { if (isTestToBePerformed()) { singleFieldIdentity(new PCPointSingleFieldString(1, 2)); } } public void testSingleFieldIdentityDate() { if (isTestToBePerformed()) { singleFieldIdentity(new PCPointSingleFieldDate(1, 2)); } } /** * The common method for test cases checking for assertion A7.12-25:
* public void jdoCopyKeyFieldsFromObjectId(ObjectIdFieldConsumer fc, Object oid); * This method copies fields to the field manager instance * from the second parameter instance. * @param o the object to check */ private void singleFieldIdentity(AbstractPCPointSingleField o) { assertPersistenceCapable(o); SingleFieldIdentity sfi = (SingleFieldIdentity) makePersistent(o); PersistenceCapable pc = (PersistenceCapable) o; ObjectIdFieldConsumer objectIdFieldConsumer = new ObjectIdFieldConsumer(); pc.jdoCopyKeyFieldsFromObjectId(objectIdFieldConsumer, sfi); if (!objectIdFieldConsumer.equals(sfi)) { fail(ASSERTION_FAILED + "pc.jdoCopyKeyFieldsFromObjectId copies unexpected " + "fields into an object id field consumer using a " + "single field indentity object id."); } } private static class ObjectIdFieldConsumer implements PersistenceCapable.ObjectIdFieldConsumer { private boolean booleanField; private byte byteField; private char charField; private double doubleField; private float floatField; private int intField; private long longField; private short shortField; private String stringField; private Object objectField; /* * @see PersistenceCapable.ObjectIdFieldConsumer#storeBooleanField(int, boolean) */ public void storeBooleanField(int fieldNumber, boolean value) { this.booleanField = value; } /* * @see PersistenceCapable.ObjectIdFieldConsumer#storeCharField(int, char) */ public void storeCharField(int fieldNumber, char value) { this.charField = value; } /* * @see PersistenceCapable.ObjectIdFieldConsumer#storeByteField(int, byte) */ public void storeByteField(int fieldNumber, byte value) { this.byteField = value; } /* * @see PersistenceCapable.ObjectIdFieldConsumer#storeShortField(int, short) */ public void storeShortField(int fieldNumber, short value) { this.shortField = value; } /* * @see PersistenceCapable.ObjectIdFieldConsumer#storeIntField(int, int) */ public void storeIntField(int fieldNumber, int value) { this.intField = value; } /* * @see PersistenceCapable.ObjectIdFieldConsumer#storeLongField(int, long) */ public void storeLongField(int fieldNumber, long value) { this.longField = value; } /* * @see PersistenceCapable.ObjectIdFieldConsumer#storeFloatField(int, float) */ public void storeFloatField(int fieldNumber, float value) { this.floatField = value; } /* * @see PersistenceCapable.ObjectIdFieldConsumer#storeDoubleField(int, double) */ public void storeDoubleField(int fieldNumber, double value) { this.doubleField = value; } /* * @see PersistenceCapable.ObjectIdFieldConsumer#storeStringField(int, java.lang.String) */ public void storeStringField(int fieldNumber, String value) { this.stringField = value; } /* * @see PersistenceCapable.ObjectIdFieldConsumer#storeObjectField(int, java.lang.Object) */ public void storeObjectField(int fieldNumber, Object value) { if (value instanceof Boolean) this.booleanField = ((Boolean)value).booleanValue(); else if (value instanceof Boolean) this.booleanField = ((Boolean)value).booleanValue(); else if (value instanceof Byte) this.byteField = ((Byte)value).byteValue(); else if (value instanceof Character) this.charField = ((Character)value).charValue(); else if (value instanceof Double) this.doubleField = ((Double)value).doubleValue(); else if (value instanceof Float) this.floatField = ((Float)value).floatValue(); else if (value instanceof Integer) this.intField = ((Integer)value).intValue(); else if (value instanceof Long) this.longField = ((Long)value).longValue(); else if (value instanceof Short) this.shortField = ((Short)value).shortValue(); else if (value instanceof String) this.stringField = (String)value; else this.objectField = value; } public boolean equals(SingleFieldIdentity sfi) { if (sfi==null) throw new IllegalArgumentException ("Argument sfi must not be null"); boolean result = false; if (sfi instanceof ByteIdentity) result = ((ByteIdentity)sfi).getKey()==this.byteField; else if (sfi instanceof CharIdentity) result = ((CharIdentity)sfi).getKey()==this.charField; else if (sfi instanceof IntIdentity) result = ((IntIdentity)sfi).getKey()==this.intField; else if (sfi instanceof LongIdentity) result = ((LongIdentity)sfi).getKey()==this.longField; else if (sfi instanceof ShortIdentity) result = ((ShortIdentity)sfi).getKey()==this.shortField; else if (sfi instanceof StringIdentity) result = ((StringIdentity)sfi).getKey().equals(this.stringField); else result = ((ObjectIdentity)sfi).getKey().equals(this.objectField); return result; } } } tck/src/java/org/apache/jdo/tck/api/persistencecapable/NewObjectIdInstance.java100664 21430 12500110373 30037 0ustarmbouschenstaff 0 0 /* * 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.api.persistencecapable; import javax.jdo.JDONullIdentityException; import javax.jdo.identity.SingleFieldIdentity; import javax.jdo.spi.PersistenceCapable; import org.apache.jdo.tck.pc.singlefieldidentity.AbstractPCPointSingleField; import org.apache.jdo.tck.pc.singlefieldidentity.PCPointSingleFieldByte; import org.apache.jdo.tck.pc.singlefieldidentity.PCPointSingleFieldCharacter; import org.apache.jdo.tck.pc.singlefieldidentity.PCPointSingleFieldDate; import org.apache.jdo.tck.pc.singlefieldidentity.PCPointSingleFieldInteger; import org.apache.jdo.tck.pc.singlefieldidentity.PCPointSingleFieldLong; import org.apache.jdo.tck.pc.singlefieldidentity.PCPointSingleFieldPrimitivebyte; import org.apache.jdo.tck.pc.singlefieldidentity.PCPointSingleFieldPrimitivechar; import org.apache.jdo.tck.pc.singlefieldidentity.PCPointSingleFieldPrimitiveint; import org.apache.jdo.tck.pc.singlefieldidentity.PCPointSingleFieldPrimitivelong; import org.apache.jdo.tck.pc.singlefieldidentity.PCPointSingleFieldPrimitiveshort; import org.apache.jdo.tck.pc.singlefieldidentity.PCPointSingleFieldShort; import org.apache.jdo.tck.pc.singlefieldidentity.PCPointSingleFieldString; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title:NewObjectIdInstance of PersistenceCapable *
*Keywords: persistencecapable *
*Assertion IDs: A7.12-38, A7.12-39 *
*Assertion Description: *

* A7.12-38:
* For classes using single field identity method * PersistenceCapable.newObjectIdInstance() must be called * on a persistent instance with its primary key field initialized, * or a JDONullIdentityException is thrown.

* * A7.12-39:
* The instance returned is initialized with the value of the primary key * field of the instance on which the method is called. * * @author Michael Watzek */ public class NewObjectIdInstance extends AbstractPersistenceCapableTest { /** */ private static final String FAILED = " (jdoNewObjectIdInstance) failed: "; /** */ private static final String ASSERTION_A7_12_38_FAILED = "Assertion A7.12-38" + FAILED; /** */ private static final String ASSERTION_A7_12_39_FAILED = "Assertion A7.12-39" + FAILED; /** * The main 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(NewObjectIdInstance.class); } public void testSingleFieldIdentityNotInitializedByte() { if (isTestToBePerformed()) { singleFieldIdentityNotInitialized(new PCPointSingleFieldByte()); } } public void testSingleFieldIdentityNotInitializedCharacter() { if (isTestToBePerformed()) { singleFieldIdentityNotInitialized(new PCPointSingleFieldCharacter()); } } public void testSingleFieldIdentityNotInitializedInteger() { if (isTestToBePerformed()) { singleFieldIdentityNotInitialized(new PCPointSingleFieldInteger()); } } public void testSingleFieldIdentityNotInitializedLong() { if (isTestToBePerformed()) { singleFieldIdentityNotInitialized(new PCPointSingleFieldLong()); } } public void testSingleFieldIdentityNotInitializedShort() { if (isTestToBePerformed()) { singleFieldIdentityNotInitialized(new PCPointSingleFieldShort()); } } public void testSingleFieldIdentityNotInitializedString() { if (isTestToBePerformed()) { singleFieldIdentityNotInitialized(new PCPointSingleFieldString()); } } public void testSingleFieldIdentityNotInitializedDate() { if (isTestToBePerformed()) { singleFieldIdentityNotInitialized(new PCPointSingleFieldDate()); } } public void testSingleFieldIdentityInitializedbyte() { if (isTestToBePerformed()) { singleFieldIdentityInitialized(new PCPointSingleFieldPrimitivebyte(1, 2)); } } public void testSingleFieldIdentityInitializedByte() { if (isTestToBePerformed()) { singleFieldIdentityInitialized(new PCPointSingleFieldByte(1, 2)); } } public void testSingleFieldIdentityInitializedchar() { if (isTestToBePerformed()) { singleFieldIdentityInitialized(new PCPointSingleFieldPrimitivechar(1, 2)); } } public void testSingleFieldIdentityInitializedCharacter() { if (isTestToBePerformed()) { singleFieldIdentityInitialized(new PCPointSingleFieldCharacter(1, 2)); } } public void testSingleFieldIdentityInitializedint() { if (isTestToBePerformed()) { singleFieldIdentityInitialized(new PCPointSingleFieldPrimitiveint(1, 2)); } } public void testSingleFieldIdentityInitializedInteger() { if (isTestToBePerformed()) { singleFieldIdentityInitialized(new PCPointSingleFieldInteger(1, 2)); } } public void testSingleFieldIdentityInitializedlong() { if (isTestToBePerformed()) { singleFieldIdentityInitialized(new PCPointSingleFieldPrimitivelong(1, 2)); } } public void testSingleFieldIdentityInitializedLong() { if (isTestToBePerformed()) { singleFieldIdentityInitialized(new PCPointSingleFieldLong(1, 2)); } } public void testSingleFieldIdentityInitializedshort() { if (isTestToBePerformed()) { singleFieldIdentityInitialized(new PCPointSingleFieldPrimitiveshort(1, 2)); } } public void testSingleFieldIdentityInitializedShort() { if (isTestToBePerformed()) { singleFieldIdentityInitialized(new PCPointSingleFieldShort(1, 2)); } } public void testSingleFieldIdentityInitializedString() { if (isTestToBePerformed()) { singleFieldIdentityInitialized(new PCPointSingleFieldString(1, 2)); } } public void testSingleFieldIdentityInitializedDate() { if (isTestToBePerformed()) { singleFieldIdentityInitialized(new PCPointSingleFieldDate(1, 2)); } } /** * The common method for test cases checking for assertion A7.12-38:
* For classes using single field identity method * PersistenceCapable.newObjectIdInstance() must be called * on a persistent instance with its primary key field initialized, * @param o the object to check */ private void singleFieldIdentityNotInitialized(AbstractPCPointSingleField o) { assertPersistenceCapable(o); PersistenceCapable pc = (PersistenceCapable) o; try { Object sfi = pc.jdoNewObjectIdInstance(); String message = ASSERTION_A7_12_38_FAILED + "pc.jdoNewObjectIdInstance should throw " + "JDONullIdentityException if PK field is null, but it returned "+sfi; fail(message); } catch (JDONullIdentityException e) { // expected exception if (debug) logger.debug("caught expected exception " + e.toString()); } } /** * The common method for test cases checking for assertion A7.12-39:
* The instance returned is initialized with the value of the primary key * field of the instance on which the method is called. * @param o the persistent instance to check */ private void singleFieldIdentityInitialized(AbstractPCPointSingleField o) { assertPersistenceCapable(o); makePersistent(o); PersistenceCapable pc = (PersistenceCapable) o; SingleFieldIdentity sfi = (SingleFieldIdentity) pc.jdoNewObjectIdInstance(); if (!o.equalsPKField(sfi)) { fail(ASSERTION_A7_12_39_FAILED + "pc.jdoNewObjectIdInstance() returned unexpected " + "single field identity object id."); } } } ././@LongLink100644 0 0 157 12500111677 10256 Lustar 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanager/cache/CallingEvictAllWithCollectionContainingNulls.javatck/src/java/org/apache/jdo/tck/api/persistencemanager/cache/CallingEvictAllWithCollectionContaining100664 10175 12500110374 34247 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.cache; import java.util.Collection; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Calling EvictAll With Collection Containing Nulls *
*Keywords: cache *
*Assertion IDs: A12.5-11 *
*Assertion Description: Passing a non-null Object[] or Collection arguments to evictAll that contain null elements will have the documented behavior for non-null elements, and the null elements will be ignored. */ public class CallingEvictAllWithCollectionContainingNulls extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5-11 (CallingEvictAllWithCollectionContainingNulls) failed: "; /** * The main 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(CallingEvictAllWithCollectionContainingNulls.class); } private PCPoint p1; private PCPoint p2; private PCPoint p3; private PCPoint p4; private PCPoint p5; /** */ public void testCallingEvictAllWithCollectionContainingNulls() { pm = getPM(); createObjects(pm); runTestEvictAll1(pm); runTestEvictAll2(pm); pm.close(); pm = null; } /** */ private void createObjects(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); p1 = new PCPoint (1,3); p2 = new PCPoint (4,3); p3 = new PCPoint (4,2); p4 = new PCPoint (3,3); pm.makePersistent(p1); pm.makePersistent(p2); pm.makePersistent(p3); pm.makePersistent(p4); tx.commit(); } finally { if (tx.isActive()) tx.rollback(); } } /* test evictAll (Collection col1) */ private void runTestEvictAll1(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); PCPoint p5 = null; Collection col1 = new java.util.HashSet(); col1.add (p1); col1.add (p5); col1.add (p2); pm.evictAll(col1); if (debug) logger.debug(" \nPASSED in testEvictAll1()"); } finally { if (tx.isActive()) tx.rollback(); } } /** test evictAll (Object[] objArray) */ private void runTestEvictAll2(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); PCPoint p5 = null; Collection col1 = new java.util.HashSet(); col1.add (p3); col1.add (p4); col1.add (p5); pm.evictAll(col1.toArray()); if (debug) logger.debug(" \nPASSED in testEvictAll2()"); } finally { if (tx.isActive()) tx.rollback(); } } } ././@LongLink100644 0 0 161 12500111677 10251 Lustar 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanager/cache/CallingRefreshAllWithCollectionContainingNulls.javatck/src/java/org/apache/jdo/tck/api/persistencemanager/cache/CallingRefreshAllWithCollectionContaini100664 10050 12500110374 34236 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.cache; import java.util.Collection; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Calling RefreshAll With Collection Containing Nulls *
*Keywords: cache *
*Assertion IDs: A12.5-12 *
*Assertion Description: Passing a non-null Object[] or Collection arguments to refreshAll that contain null elements will have the documented behavior for non-null elements, and the null elements will be ignored. */ public class CallingRefreshAllWithCollectionContainingNulls extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5-12 (CallingRefreshAllWithCollectionContainingNulls) failed: "; /** * The main 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(CallingRefreshAllWithCollectionContainingNulls.class); } private PCPoint p1; private PCPoint p2; private PCPoint p3; private PCPoint p4; private PCPoint p5; /** */ public void testCallingRefreshAllWithCollectionContainingNulls() { pm = getPM(); createObjects(pm); runTestRefreshAll1(pm); runTestRefreshAll2(pm); pm.close(); pm = null; } /** */ private void createObjects(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); p1 = new PCPoint (1,3); p2 = new PCPoint (2,3); p3 = new PCPoint (4,2); p4 = new PCPoint (3,3); pm.makePersistent(p1); pm.makePersistent(p2); pm.makePersistent(p3); pm.makePersistent(p4); tx.commit(); } finally { if (tx.isActive()) tx.rollback(); } } /** test refreshAll (Collection col1) */ private void runTestRefreshAll1(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); PCPoint p5 = null; Collection col1 = new java.util.HashSet(); col1.add (p1); col1.add (p5); col1.add (p2); pm.refreshAll(col1); if (debug) logger.debug(" \nPASSED in testRefreshAll1()"); tx.rollback(); } finally { if (tx.isActive()) tx.rollback(); } } /* test refreshAll (Object[] objArray) */ private void runTestRefreshAll2(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); PCPoint p5 = null; Collection col1 = new java.util.HashSet(); col1.add (p3); col1.add (p4); col1.add (p5); pm.refreshAll(col1.toArray()); if (debug) logger.debug(" \nPASSED in testRefreshAll2()"); tx.rollback(); } finally { if (tx.isActive()) tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/cache/EvictAllWithNoParameters.java100664 11257 12500110374 32172 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.cache; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; import org.apache.jdo.tck.pc.mylib.PCPoint2; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: EvictAllWithNoParameters *
*Keywords: cache *
*Assertion IDs: A12.5.1-2 *
*Assertion Description: If PersistenceManager.evict is called with no parameter, then all referenced instances are evicted. For each instance evicted, it: *

    *
  • calls the jdoPreClearmethod on each instance, if the class of the instance implements InstanceCallbacks
  • *
  • clears persistent fields on each instance after the call to jdoPreClear()
  • *
  • changes the state of instances to hollow or persistent-nontransactional (cannot distinguish between these two states) this is not directly testable.
  • *
*/ public class EvictAllWithNoParameters extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.1-2 (EvictAllWithNoParameters) failed: "; /** * The main 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(EvictAllWithNoParameters.class); } private PCPoint2 pnt1 = null; private PCPoint2 p1 = null; /** */ public void testEvictAllWithNoParameters() { pm = getPM(); createObjects(pm); runTestEvictAll(pm); pm.close(); pm = null; } /** */ private void createObjects(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); pnt1 = new PCPoint2(1,3); p1 = new PCPoint2 (3,5); pm.makePersistent(pnt1); pm.makePersistent(p1); tx.commit(); // P-nontransactional instance // Check whether pmf supported optimitic tx tx.setOptimistic(isOptimisticSupported()); tx.begin(); pnt1.getX(); tx.commit(); // P-clean instance tx.setOptimistic(false); tx.begin(); p1.getX(); tx.commit(); } finally { if (tx.isActive()) tx.rollback(); } } /** */ private void runTestEvictAll(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); pm.evictAll(); if ( !p1.wasClearCalled()) { fail(ASSERTION_FAILED, "missing call of p1.jdoPreClear during pm.evictAll"); } if ( !pnt1.wasClearCalled()) { fail(ASSERTION_FAILED, "missing call of pnt1.jdoPreClear during pm.evictAll"); } if ( testState(p1, HOLLOW, "hollow") || testState(p1, PERSISTENT_NONTRANSACTIONAL, "persistent_nontransaction")) { ; // expected result } else { fail(ASSERTION_FAILED, "p1 should be HOLLOW or P-NONTX after pm.evictAll."); } if ( testState(pnt1, HOLLOW, "hollow") || testState(pnt1, PERSISTENT_NONTRANSACTIONAL, "persistent_nontransaction")) { ; // expected result } else { fail(ASSERTION_FAILED, "pnt1 should be HOLLOW or P-NONTX after pm.evictAll."); } tx.commit(); if (debug) logger.debug(" \nPASSED in testEvictAll()"); } finally { if (tx.isActive()) tx.rollback(); } } } ././@LongLink100644 0 0 153 12500111677 10252 Lustar 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanager/cache/EvictingCollectionOfInstancesSideEffects.javatck/src/java/org/apache/jdo/tck/api/persistencemanager/cache/EvictingCollectionOfInstancesSideEffect100664 15530 12500110374 34233 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.cache; import java.util.Collection; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; import org.apache.jdo.tck.pc.mylib.PCPoint2; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: EvictingCollectionOfInstancesSideEffects *
*Keywords: cache *
*Assertion IDs: A12.5.1-4 *
*Assertion Description: If PersistenceManager.evict is called with no parameter, then all referenced instances are evicted. For each instance evicted, it: *
    *
  • calls the jdoPreClearmethod on each instance, if the class of the instance implements InstanceCallbacks
  • *
  • clears persistent fields on each instance after the call to jdoPreClear()
  • *
  • changes the state of instances to hollow or persistent-nontransactional (cannot distinguish between these two states) this is not directly testable.
  • *
*/ public class EvictingCollectionOfInstancesSideEffects extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.1-4 (EvictingCollectionOfInstancesSideEffects) failed: "; /** * The main 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(EvictingCollectionOfInstancesSideEffects.class); } private PCPoint2 pnt1 = null; private PCPoint2 pnt2 = null; private PCPoint2 p1 = null; private PCPoint2 p2 = null; /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint2.class); super.localSetUp(); } /** */ public void testEvictingCollectionOfInstancesSideEffects() { pm = getPM(); createObjects(pm); runTestEvictAllCollection(pm); runTestEvictAllArray(pm); pm.close(); pm = null; } /** */ private void createObjects(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); pnt1 = new PCPoint2(1,2); pnt2 = new PCPoint2(2,3); p1 = new PCPoint2 (3,1); p2 = new PCPoint2 (4,2); pm.makePersistent(pnt1); pm.makePersistent(pnt2); pm.makePersistent(p1); pm.makePersistent(p2); tx.commit(); // P-nontransactional instance // Check whether pmf supported optimitic tx tx.setOptimistic(isOptimisticSupported()); tx.begin(); pnt1.getX(); pnt2.getX(); tx.commit(); /* P-clean instance */ tx.setOptimistic(false); tx.begin(); p1.getX(); p2.getX(); tx.commit(); } finally { if (tx.isActive()) tx.rollback(); } } /** */ private void runTestEvictAllCollection(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); Collection col1 = new java.util.HashSet(); col1.add(pnt1); col1.add(p1); pm.evictAll(col1); if ( !p1.wasClearCalled()) { fail(ASSERTION_FAILED, "missing call of p1.jdoPreClear during pm.evictAll(Collection)"); } if ( !pnt1.wasClearCalled()) { fail(ASSERTION_FAILED, "missing call of pnt1.jdoPreClear during pm.evictAll(Collection)"); } if ( testState(p1, HOLLOW, "hollow") || testState(p1, PERSISTENT_NONTRANSACTIONAL, "persistent_nontransactional")) { ; // expected result } else { fail(ASSERTION_FAILED, "p1 should be HOLLOW or P-NONTX after pm.evictAll(Collection)."); } if ( testState(pnt1, HOLLOW, "hollow") || testState(pnt1, PERSISTENT_NONTRANSACTIONAL, "persistent_nontransactional")) { ; // expected result } else { fail(ASSERTION_FAILED, "pnt1 should be HOLLOW or P-NONTX after pm.evictAll(Collection)."); } tx.commit(); } finally { if (tx.isActive()) tx.rollback(); } } /** */ private void runTestEvictAllArray(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); Collection col1 = new java.util.HashSet(); col1.add(pnt2); col1.add(p2); pm.evictAll(col1.toArray()); if ( !p2.wasClearCalled()) { fail(ASSERTION_FAILED, "missing call of p2.jdoPreClear during pm.evictAll(Object[])"); } if ( !pnt2.wasClearCalled()) { fail(ASSERTION_FAILED, "missing call of pnt2.jdoPreClear during pm.evictAll(Object[])"); } if ( testState(p2, HOLLOW, "hollow") || testState(p2, PERSISTENT_NONTRANSACTIONAL, "persistent_nontransactional")) { ; // expected result } else { fail(ASSERTION_FAILED, "p2 should be HOLLOW or P-NONTX after pm.evictAll(Object[])."); } if ( testState(pnt2, HOLLOW, "hollow") || testState(pnt2, PERSISTENT_NONTRANSACTIONAL, "persistent_nontransactional")) { ; // expected result } else { fail(ASSERTION_FAILED, "pnt2 should be HOLLOW or P-NONTX after pm.evictAll(Object[])."); } tx.commit(); } finally { if (tx.isActive()) tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/cache/EvictingWithRestoreValuesFalse.java100664 11056 12500110374 33412 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.cache; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; import org.apache.jdo.tck.pc.mylib.PCPoint2; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Evicting With RestoreValues False *
*Keywords: cache *
*Assertion ID: A12.6.1-1. *
*Assertion Description: If users wish to automatically evict transactional instances at transaction rollback time, then they should set RestoreValues to false. For each persistent-clean instance that the JDO PersistenceManager evicts, it:
  • calls the jdoPreClear method on each instance, if the class of the instance implements InstanceCallbacks
  • clears persistent fields on each instance (sets the value of the field to its Java default value)
  • changes the state of instances to hollow
*/ public class EvictingWithRestoreValuesFalse extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.6.1-1 (EvictingWithRestoreValuesFalse) failed: "; /** * The main 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(EvictingWithRestoreValuesFalse.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint2.class); super.localSetUp(); } /** */ public void test() { pm = getPM(); PCPoint2 pt = getHollowInstance(); Transaction tx = pm.currentTransaction(); tx.setRestoreValues(false); //This should cause eviction of transactional instances when transaction is later rolled back. //Test tx.begin(); makePersistentClean(pt); tx.rollback(); // This should evict pt verify(pt); } /** */ private PCPoint2 getHollowInstance() { Transaction tx = pm.currentTransaction(); tx.begin(); PCPoint2 pt = new PCPoint2(1,2); pm.makePersistent(pt); tx.commit(); int curr = currentState(pt); if (curr != HOLLOW){ fail(ASSERTION_FAILED, "Unable to create HOLLOW instance, state is " + states[curr]); } return pt; } /** */ private void makePersistentClean(PCPoint2 pt) { pm.makeTransactional(pt); int curr = currentState(pt); if (curr != PERSISTENT_CLEAN){ fail(ASSERTION_FAILED, "Unable to create PERSISTENT_CLEAN instance, state is " + states[curr]); } } /** */ private void verify(PCPoint2 pt) { // When PersistenceManager evicts instances, it: calls the jdoPreClear method on each instance if ( !pt.wasClearCalled()) { fail(ASSERTION_FAILED, "missing call of jdoPreClear"); } // When PersistenceManager evicts instances, it: changes the state of the instances to hollow int curr = currentState(pt); if ( (curr != HOLLOW) && (curr != PERSISTENT_NONTRANSACTIONAL) ) { fail(ASSERTION_FAILED, "Instance should be HOLLOW after tx.rollback(), state is " + states[curr]); } pm.makeTransient(pt); // When PersistenceManager evicts instances, it: clears persistent fields on each instance (sets the value of the field to its Java default value) int x=pt.getX(); Integer y=pt.getY(); if ((x != 0) || (y != null)) { fail(ASSERTION_FAILED, "persistent fields not cleared, pt.getX()=="+x+" and pt.getY()=="+y); } } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/cache/EvictingWithRetainValuesFalse.java100664 11343 12500110374 33210 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.cache; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; import org.apache.jdo.tck.pc.mylib.PCPoint2; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Evicting With RetainValues False *
*Keywords: cache *
*Assertion ID: A12.5.1-3. *
*Assertion Description: If users wish to automatically evict transactional instances at transaction commit time, then they should set RetainValues to false. For each persistent-clean instance that the JDO PersistenceManager evicts, it:
  • calls the jdoPreClear method on each instance, if the class of the instance implements InstanceCallbacks
  • clears persistent fields on each instance (sets the value of the field to its Java default value)
  • changes the state of instances to hollow
*/ public class EvictingWithRetainValuesFalse extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.1-3 (EvictingWithRetainValuesFalse) failed: "; /** * The main 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(EvictingWithRetainValuesFalse.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint2.class); super.localSetUp(); } /** */ public void test() { if (!isRetainValuesSupported()) { printUnsupportedOptionalFeatureNotTested( getClass().getName(), "javax.jdo.option.RetainValues"); } else { pm = getPM(); PCPoint2 pt = getHollowInstance(); Transaction tx = pm.currentTransaction(); tx.setRetainValues(false); //This should cause eviction of transactional instances when transaction is later commited. //Test tx.begin(); makePersistentClean(pt); tx.commit(); // This should evict pt verify(pt); } } /** */ private PCPoint2 getHollowInstance() { Transaction tx = pm.currentTransaction(); tx.begin(); PCPoint2 pt = new PCPoint2(1,2); pm.makePersistent(pt); tx.commit(); int curr = currentState(pt); if (curr != HOLLOW){ fail(ASSERTION_FAILED, "Unable to create HOLLOW instance, state is " + states[curr]); } return pt; } /** */ private void makePersistentClean(PCPoint2 pt) { pm.makeTransactional(pt); int curr = currentState(pt); if (curr != PERSISTENT_CLEAN){ fail(ASSERTION_FAILED, "Unable to create PERSISTENT_CLEAN instance, state is " + states[curr]); } } /** */ private void verify(PCPoint2 pt) { // When PersistenceManager evicts instances, it: calls the jdoPreClear method on each instance if ( !pt.wasClearCalled()) { fail(ASSERTION_FAILED, "missing call of jdoPreClear"); } // When PersistenceManager evicts instances, it: changes the state of the instances to hollow int curr = currentState(pt); if ( (curr != HOLLOW) && (curr != PERSISTENT_NONTRANSACTIONAL) ) { fail(ASSERTION_FAILED, "Instance should be HOLLOW after tx.commit(), state is " + states[curr]); } pm.makeTransient(pt); // When PersistenceManager evicts instances, it: clears persistent fields on each instance (sets the value of the field to its Java default value) int x=pt.getX(); Integer y=pt.getY(); if ((x != 0) || (y != null)) { fail(ASSERTION_FAILED, "persistent fields not cleared, pt.getX()=="+x+" and pt.getY()=="+y); } } } ././@LongLink100644 0 0 147 12500111677 10255 Lustar 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanager/cache/PassingNullToEvictAllThrowsException.javatck/src/java/org/apache/jdo/tck/api/persistencemanager/cache/PassingNullToEvictAllThrowsException.ja100664 7037 12500110374 34220 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.cache; import java.util.Collection; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: PassingNullToEvictAllThrowsException *
*Keywords: *
*Assertion IDs: A12.5-9 *
*Assertion Description: Passing a null valued argument to evictAll will throw a NullPointerException. */ public class PassingNullToEvictAllThrowsException extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5-9 (PassingNullToEvictAllThrowsException) failed: "; /** * The main 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(PassingNullToEvictAllThrowsException.class); } /** */ public void testPassingNullToEvictAllThrowsException() { pm = getPM(); runTestEvictAll1(pm); runTestEvictAll2(pm); pm.close(); pm = null; } /* test evictAll (Collection pcs) */ private void runTestEvictAll1(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); if (debug) logger.debug ("** in runTestEvictAll1() "); try { tx.begin(); Collection col1 = null; try { pm.evictAll(col1); fail(ASSERTION_FAILED, "pm.evictAll should throw NullPointerException when called with argument null"); } catch (NullPointerException ex) { // expected exception } tx .rollback(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /* test evictAll (Object[] objArray) */ private void runTestEvictAll2(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); if (debug) logger.debug ("** in runTestEvictAll1() "); try { tx.begin(); Object[] arr = null; try { pm.evictAll(arr); fail(ASSERTION_FAILED, "pm.evictAll should throw NullPointerException when called with argument null"); } catch (NullPointerException ex) { // expected exception } tx .rollback(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/cache/PassingNullToEvictHasNoEffect.java100664 4733 12500110374 33076 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.cache; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: PassingNullToEvictHasNoEffect *
*Keywords: *
*Assertion IDs: A12.5-7 *
*Assertion Description: Passing a null value to PersistenceManager.evict will have no effect. A NullPointerException should NOT be thrown. */ public class PassingNullToEvictHasNoEffect extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5-7 (PassingNullToEvictHasNoEffect) failed: "; /** * The main 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(PassingNullToEvictHasNoEffect.class); } /** */ public void test() { pm = getPM(); runTestPassingNullToEvictHasNoEffect(pm); pm.close(); pm = null; } /* test evict (object pc) */ public void runTestPassingNullToEvictHasNoEffect(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); pm.evict(null); if (debug) logger.debug (" \nPASSED in testPassingNullToEvictHasNoEffect()"); tx.rollback(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } ././@LongLink100644 0 0 151 12500111677 10250 Lustar 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanager/cache/PassingNullToRefreshAllThrowsException.javatck/src/java/org/apache/jdo/tck/api/persistencemanager/cache/PassingNullToRefreshAllThrowsException.100664 7175 12500110374 34234 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.cache; import java.util.Collection; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Passing Null to RefreshAll Throws Exception *
*Keywords: cache *
*Assertion IDs: A12.5-10. *
*Assertion Description: Passing a null valued argument to refreshAll will throw a NullPointerException. */ public class PassingNullToRefreshAllThrowsException extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5-10 (PassingNullToRefreshAllThrowsException) failed: "; /** * The main 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(PassingNullToRefreshAllThrowsException.class); } /** */ public void testPassingNullToRefreshAllThrowsException() { pm = getPM(); runTestRefreshAll1(pm); runTestRefreshAll2(pm); pm.close(); pm = null; } /* test refreshAll (Collection pcs) */ public void runTestRefreshAll1(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); if (debug) logger.debug("** in runTestRefreshAll1() "); try { tx.begin(); Collection col1 = null; try { pm.refreshAll(col1); fail(ASSERTION_FAILED, "pm.refreshAll should throw NullPointerException when called with argument null"); } catch (NullPointerException ex) { // expected exception } tx .rollback(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /* test refreshAll (Object[] objArray) */ public void runTestRefreshAll2(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); if (debug) logger.debug ("** in runTestRefreshAll1() "); try { tx = pm.currentTransaction(); tx.begin(); Object[] arr = null; try { pm.refreshAll(arr); fail(ASSERTION_FAILED, "pm.refreshAll should throw NullPointerException when called with argument null"); } catch (NullPointerException ex) { // expected exception } tx .rollback(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/cache/PassingNullToRefreshHasNoEffect.java100664 5071 12500110374 33416 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.cache; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Passing Null to Refresh has no Effect *
*Keywords: *
*Assertion IDs: A12.5-8 *
*Assertion Description: Passing a null value to PersistenceManager.refresh will have no effect. A NullPointerException should NOT be thrown. */ public class PassingNullToRefreshHasNoEffect extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5-8 (PassingNullToRefreshHasNoEffect) failed: "; /** * The main 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(PassingNullToRefreshHasNoEffect.class); } /** */ public void test() { pm = getPM(); runTestPassingNullToRefreshHasNoEffect(pm); pm.close(); pm = null; } /* test evict (object pc) */ private void runTestPassingNullToRefreshHasNoEffect(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); PCPoint p1 = null; pm.refresh(p1); if (debug) logger.debug (" \nPASSED in testPassingNullToRefreshHasNoEffect()"); tx.rollback(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/cache/RefreshAllNoParameterSideEffects.java100664 13602 12500110374 33600 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.cache; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; import org.apache.jdo.tck.pc.mylib.VersionedPCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Refresh All No Parameters Side Effects *
*Keywords: cache *
*Assertion ID: A12.5.1-5B *
*Assertion Description: The refreshAll() updates the values in the parameter instance[s] from the data in the data store. ((The intended use is for optimistic transactions where the state of the JDO Instance is not guaranteed to reflect the state in the data store. This method can be used to minimize the occurrence of commit failures due to mismatch between the state of cached instances and the state of data in the data store.)) This can be tested by using 2 PersistenceManagers, independently change an object, then refresh. */ /** */ public class RefreshAllNoParameterSideEffects extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.1-5B (RefreshAllNoParameterSideEffects) failed: "; Object oid = null; PersistenceManager pm1; PersistenceManager pm2; PersistenceManager pmVerify; /** */ /** * The main 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(RefreshAllNoParameterSideEffects.class); } /** */ public void localSetUp () { addTearDownClass(VersionedPCPoint.class); pm = getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); VersionedPCPoint pnt = new VersionedPCPoint (0,0); pm.makePersistent(pnt); oid = pm.getObjectId((Object)pnt); tx.commit(); } /** */ public void test() throws Exception { if (!isOptimisticSupported()) { printUnsupportedOptionalFeatureNotTested( "RefreshAllNoParameterSideEffect", "javax.jdo.option.Optimistic"); return; } pm1 = pmf.getPersistenceManager(); pm2 = pmf.getPersistenceManager(); pmVerify = pmf.getPersistenceManager(); try { // don't refresh cache runTestRefreshAllNoParameterSideEffects(false); // refresh cache runTestRefreshAllNoParameterSideEffects(true); } finally { cleanupPM(pmVerify); pmVerify = null; cleanupPM(pm1); pm1 = null; cleanupPM(pm1); pm2 = null; } failOnError(); } /** */ private void runTestRefreshAllNoParameterSideEffects(boolean doRefresh) throws Exception { if (debug) logger.debug ("\nSTART RefreshAllNoParameterSideEffects"); Transaction tx1 = pm1.currentTransaction(); tx1.setOptimistic(true); tx1.begin(); VersionedPCPoint pnt1 = (VersionedPCPoint)pm1.getObjectById(oid, true); pnt1.setX(11); // make transactional Transaction tx2 = pm2.currentTransaction(); tx2.begin(); VersionedPCPoint pnt2 = (VersionedPCPoint)pm2.getObjectById(oid); pnt2.setX(22); pnt2.setY(Integer.valueOf("22")); tx2.commit(); if (doRefresh) pm1.refreshAll(); pnt1.setX(33); pnt1.setY(Integer.valueOf("33")); try { tx1.commit(); } catch (javax.jdo.JDOOptimisticVerificationException ove) { if (doRefresh) { appendMessage("Expected no exception on commit with doRefresh " + "true, but got " + ove.toString()); } // else expect exception } catch (Exception e) { appendMessage("Unexpected exception on commit. doRefresh is " + doRefresh + ". Exception is: " + e.toString()); } // verify that correct value was committed VersionedPCPoint pntExpected = new VersionedPCPoint(33, 33); if (!doRefresh) { pntExpected.setX(22); pntExpected.setY(Integer.valueOf("22")); } Transaction txVerify = pmVerify.currentTransaction(); txVerify.begin(); VersionedPCPoint pntVerify = (VersionedPCPoint)pmVerify.getObjectById(oid, true); if (pntVerify.getX() != pntExpected.getX() || pntVerify.getY().intValue() != pntExpected.getY().intValue()) { appendMessage("After commit with doRefresh " + doRefresh + " expected (" + pntExpected.getX() + ", " + pntExpected.getY() + ") but actual is (" + pntVerify.getX() + ", " + pntVerify.getY() + ")."); } txVerify.commit(); if (debug) logger.debug ("END RefreshAllNoParameterSideEffects" + "doRefresh is " + doRefresh); } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/cache/RefreshAllSideEffects.java100664 16205 12500110374 31444 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.cache; import java.util.Collection; import java.util.ArrayList; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; import org.apache.jdo.tck.pc.mylib.VersionedPCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Refresh All Side Effects *
*Keywords: cache *
*Assertion ID: A12.5.1-5D *
*Assertion Description: The refreshAll(Object[] pcs) updates the values in the parameter instance[s] from the data in the data store. ((The intended use is for optimistic transactions where the state of the JDO Instance is not guaranteed to reflect the state in the data store. This method can be used to minimize the occurrence of commit failures due to mismatch between the state of cached instances and the state of data in the data store.)) This can be tested by using 2 PersistenceManagers, independently change an object, then refresh. */ /** */ public class RefreshAllSideEffects extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.1-5D (RefreshAllSideEffects) failed: "; ArrayList oids = new ArrayList(); PersistenceManager pm1; PersistenceManager pm2; PersistenceManager pmVerify; Collection coll = new ArrayList(); // Collection of persistent instances boolean useCollection = true; /** */ /** * The main 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(RefreshAllSideEffects.class); } /** */ public void localSetUp () { addTearDownClass(VersionedPCPoint.class); pm = getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); VersionedPCPoint pnt1 = new VersionedPCPoint(0,0); VersionedPCPoint pnt2 = new VersionedPCPoint (-1,-1); coll.add(pnt1); coll.add(pnt2); pm.makePersistentAll(coll); oids.add(0, pm.getObjectId((Object)pnt1)); oids.add(1, pm.getObjectId((Object)pnt2)); tx.commit(); } /** */ public void testRefreshAllWithCollection() throws Exception { useCollection = true; runtest(); } /** */ public void testRefreshAllWithArray() throws Exception { useCollection = false; runtest(); } /** */ private void runtest() throws Exception { if (!isOptimisticSupported()) { printUnsupportedOptionalFeatureNotTested( "RefreshAllSideEffects", "javax.jdo.option.Optimistic"); return; } pm1 = pmf.getPersistenceManager(); pm2 = pmf.getPersistenceManager(); pmVerify = pmf.getPersistenceManager(); try { // don't refresh cache runTestRefreshAllSideEffects(false); // refresh cache runTestRefreshAllSideEffects(true); } finally { cleanupPM(pmVerify); pmVerify = null; cleanupPM(pm1); pm1 = null; cleanupPM(pm1); pm2 = null; } failOnError(); } /** */ private void runTestRefreshAllSideEffects(boolean doRefresh) throws Exception { if (debug) logger.debug ("\nSTART RefreshAllSideEffects"); Transaction tx1 = pm1.currentTransaction(); tx1.setOptimistic(true); tx1.begin(); Collection points1 = pm1.getObjectsById(oids, true); ((VersionedPCPoint)points1.toArray()[0]).setX(11); // make transactional Transaction tx2 = pm2.currentTransaction(); tx2.begin(); Collection points2 = pm2.getObjectsById(oids); ((VersionedPCPoint)points2.toArray()[0]).setX(22); ((VersionedPCPoint)points2.toArray()[1]).setX(22); ((VersionedPCPoint)points2.toArray()[0]).setY(Integer.valueOf("22")); ((VersionedPCPoint)points2.toArray()[1]).setY(Integer.valueOf("22")); tx2.commit(); if (doRefresh) { if (useCollection) pm1.refreshAll(points1); else pm1.refreshAll(points1.toArray()); } ((VersionedPCPoint)points1.toArray()[0]).setX(33); ((VersionedPCPoint)points1.toArray()[1]).setX(33); ((VersionedPCPoint)points1.toArray()[0]).setY(Integer.valueOf("33")); ((VersionedPCPoint)points1.toArray()[1]).setY(Integer.valueOf("33")); try { tx1.commit(); } catch (javax.jdo.JDOOptimisticVerificationException ove) { if (doRefresh) { appendMessage("Expected no exception on commit with doRefresh " + "true, but got " + ove.toString()); } // else expect exception } catch (Exception e) { appendMessage("Unexpected exception on commit. doRefresh is " + doRefresh + ". Exception is: " + e.toString()); } // verify that correct value was committed VersionedPCPoint pntExpected = new VersionedPCPoint(33, 33); if (!doRefresh) { pntExpected.setX(22); pntExpected.setY(Integer.valueOf("22")); } Transaction txVerify = pmVerify.currentTransaction(); txVerify.begin(); Collection pointsVerify = pmVerify.getObjectsById(oids, true); if (((VersionedPCPoint)pointsVerify.toArray()[0]).getX() != pntExpected.getX() || ((VersionedPCPoint)pointsVerify.toArray()[0]).getY().intValue() != pntExpected.getY().intValue()) { appendMessage("After commit with doRefresh " + doRefresh + " expected (" + pntExpected.getX() + ", " + pntExpected.getY() + ") but actual is (" + ((VersionedPCPoint)pointsVerify.toArray()[0]).getX() + ", " + ((VersionedPCPoint)pointsVerify.toArray()[0]).getY().intValue() + ")."); } txVerify.commit(); if (debug) logger.debug ("END RefreshAllSideEffects" + "doRefresh is " + doRefresh); } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/cache/RefreshAllWithNoParameters.java100664 6602 12500110374 32474 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.cache; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Refresh All With No Parameters *
*Keywords: cache *
*Assertion ID: A12.5.1-6. *
*Assertion Description: The PersistenceManager.refreshAll method with no parameters causes all transactional instances to be refreshed. Note that this method will cause loss of changes made to affected instances by the application due to refreshing the contents from the data store. The JDO PersistenceManager:
  • loads persistent values from the data store;
  • loads persistent fields into the instance;
  • calls the jdoPostLoad method on each persistent instance, if the class of the instance implements InstanceCallbacks; and
  • changes the state of persistent-dirty instances to persistent-clean.
*/ public class RefreshAllWithNoParameters extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.1-6 (RefreshAllWithNoParameters) failed: "; /** * The main 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(RefreshAllWithNoParameters.class); } /** */ public void test() { pm = getPM(); runTestRefreshAll(pm); pm.close(); pm = null; } /** */ private void runTestRefreshAll(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); PCPoint p = new PCPoint (100, 200); pm.makePersistent(p); tx.commit(); tx.begin(); p.setX(500); p.setY(new Integer(800)); pm.refreshAll(); int currentX = p.getX(); Integer currentY = p.getY(); if ((currentX != 100) || !currentY.equals(new Integer(200))) { fail(ASSERTION_FAILED, "RefreshAll expected 100, 200; got " + currentX + ", " + currentY); } tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/cache/RefreshSideEffects.java100664 17046 12500110374 31017 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.cache; import javax.jdo.JDOFatalException; import javax.jdo.PersistenceManager; import javax.jdo.PersistenceManagerFactory; import javax.jdo.Transaction; import junit.framework.AssertionFailedError; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.util.ThreadExceptionHandler; /** *Title: Refresh Side Effects *
*Keywords: cache *
*Assertion ID: A12.5.1-5A *
*Assertion Description: The refresh method updates the values in the parameter instance[s] from the data in the data store. ((The intended use is for optimistic transactions where the state of the JDO Instance is not guaranteed to reflect the state in the data store. This method can be used to minimize the occurrence of commit failures due to mismatch between the state of cached instances and the state of data in the data store.)) This can be tested by using 2 PersistenceManagers, independently change an object, then refresh. */ /** */ public class RefreshSideEffects extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.1-5A (RefreshSideEffects) failed: "; /** */ static final int DELAY = 100; /** * The main 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(RefreshSideEffects.class); } /** */ public void test () throws Exception { PersistenceManagerFactory pmf = getPMF(); PersistenceManager pm1 = pmf.getPersistenceManager(); PersistenceManager pm2 = pmf.getPersistenceManager(); try { runTestRefreshSideEffects(pm1, pm2); } finally { cleanupPM(pm2); pm2 = null; cleanupPM(pm1); pm1 = null; } } /** */ private void runTestRefreshSideEffects(PersistenceManager pm1, PersistenceManager pm2) throws Exception { if (debug) logger.debug ("\nSTART RefreshSideEffects"); ThreadExceptionHandler group = new ThreadExceptionHandler(); RefreshThreadT1 thread1 = new RefreshThreadT1(pm1); Thread T1 = new Thread(group, thread1, "T1"); RefreshThreadT2 thread2 = new RefreshThreadT2(pm2); Thread T2 = new Thread(group, thread2, "T2"); thread1.setOther(thread2); thread2.setOther(thread1); T1.start(); T2.start(); T1.join(); T2.join(); Throwable t1Problem = group.getUncaughtException(T1); if (t1Problem != null) { if (t1Problem instanceof AssertionFailedError) throw (AssertionFailedError)t1Problem; else throw new JDOFatalException( "Thread "+T1.getName()+" results in exception ", t1Problem ); } Throwable t2Problem = group.getUncaughtException(T2); if (t2Problem != null) { if (t2Problem instanceof AssertionFailedError) throw (AssertionFailedError)t2Problem; else throw new JDOFatalException( "Thread "+T2.getName()+" results in exception ", t2Problem ); } if (debug) logger.debug ("END RefreshSideEffects"); } /** */ class RefreshThreadT1 implements Runnable { PersistenceManager pm; RefreshThreadT2 other; boolean commitDone; /** */ RefreshThreadT1(PersistenceManager pm) { this.pm = pm; this.other = null; this.commitDone = false; } /** */ void setOther(RefreshThreadT2 other) { this.other = other; } /** */ boolean isCommitDone() { return commitDone; } /** */ synchronized public void run() { PCPoint n1 = new PCPoint (5,1); Transaction tx = pm.currentTransaction(); try { RefreshSideEffects.this.logger.debug(" ThreadT1: START"); tx.begin(); n1.setX(500); pm.makePersistent(n1); pm.refresh(n1); RefreshSideEffects.this.logger.debug( " ThreadT1: waiting for ThreadT2.done"); while (!other.isDone()) { try { Thread.sleep(DELAY); } catch (InterruptedException ex) { // ignore } } tx.commit(); tx = null; commitDone = true; RefreshSideEffects.this.logger.debug( " ThreadT1: commit finished."); } finally { commitDone = true; if ((tx != null) && tx.isActive()) tx.rollback(); } } } /** */ class RefreshThreadT2 implements Runnable { PersistenceManager pm; RefreshThreadT1 other; boolean done; /** */ RefreshThreadT2(PersistenceManager pm) { this.pm = pm; this.other = null; this.done = false; } /** */ boolean isDone() { return done; } /** */ void setOther(RefreshThreadT1 other) { this.other = other; } /* test refresh() */ synchronized public void run() { PCPoint p1 = new PCPoint (5,1); Transaction tx = pm.currentTransaction(); try { RefreshSideEffects.this.logger.debug(" ThreadT2: START"); tx.begin(); p1.setX(201); pm.makePersistent(p1); pm.refresh(p1); done = true; RefreshSideEffects.this.logger.debug( " ThreadT2: waiting for commit of ThreadT1"); while (!other.isCommitDone()) { try { Thread.sleep(DELAY); } catch (InterruptedException ex) { // ignore } } tx.commit(); tx = null; RefreshSideEffects.this.logger.debug( " ThreadT2: commit finished."); } finally { done = true; if ((tx != null) && tx.isActive()) tx.rollback(); } } } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/cache/Retrieve.java100664 24221 12500110374 27072 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.cache; import java.util.ArrayList; import java.util.Collection; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.pc.mylib.PCPoint2; import org.apache.jdo.tck.pc.mylib.PCRect; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Retrieve *
*Keywords: cache *
*Assertion IDs: A12.6.1-2, A12.6.1-5 *
*Assertion Description: These methods request the PersistenceManager to load all persistent fields into the parameter instances. Subsequent to this call, the application might call makeTransient on the parameter instances, and the fields can no longer be touched by the PersistenceManager. The PersistenceManager might also retrieve related instances according to a pre-read policy (not specified by JDO). The JDO PersistenceManager loads persistent values from the datastore into the instance and if the class of the instance implements InstanceCallbacks calls jdoPostLoad. */ public class Retrieve extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertions A12.6.1-2, A12.6.1-5 (Retrieve) failed: "; /** * The main 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(Retrieve.class); } private PCPoint p1 = null; private String p1print = null; private PCPoint p2 = null; private PCPoint2 p3 = null; private PCRect rect = null; private static final Integer one = new Integer(1); private static final Integer three = new Integer(3); /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint2.class); addTearDownClass(PCRect.class); addTearDownClass(PCPoint.class); } /** */ public void test () { pm = getPM(); runTestRetrieve(pm); runTestRetrieveAllWithCollection(pm); runTestRetrieveAllWithArray(pm); runTestRetrieveAllWithCollectionDFGtrue(pm); runTestRetrieveAllWithArrayDFGtrue(pm); runTestRetrieveAllWithCollectionDFGfalse(pm); runTestRetrieveAllWithArrayDFGfalse(pm); pm.close(); pm = null; } /** */ private void runTestRetrieve(PersistenceManager pm) { createObjects(pm); Transaction tx = pm.currentTransaction(); try { tx.begin(); pm.retrieve(p1); pm.retrieve(p3); pm.retrieve(rect); pm.makeTransient(p1); pm.makeTransient(p3); pm.makeTransient(rect); tx.commit(); tx = null; checkP1(); checkP3(); checkRectP1(); checkRectId(); } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ private void runTestRetrieveAllWithCollection(PersistenceManager pm) { createObjects(pm); Transaction tx = pm.currentTransaction(); try { tx.begin(); Collection coll = new ArrayList(); coll.add(p1); coll.add(p3); coll.add(rect); pm.retrieveAll(coll); pm.makeTransientAll(coll); tx.commit(); tx = null; checkP1(); checkP3(); checkRectP1(); checkRectId(); } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ private void runTestRetrieveAllWithCollectionDFGtrue(PersistenceManager pm) { createObjects(pm); Transaction tx = pm.currentTransaction(); try { tx.begin(); Collection coll = new ArrayList(); coll.add(p1); coll.add(p3); coll.add(rect); pm.retrieveAll(coll, true); pm.makeTransientAll(coll); tx.commit(); tx = null; checkP1(); checkP3(); // checkRectP1(); p1 is not in the default fetch group by default checkRectId(); } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ private void runTestRetrieveAllWithCollectionDFGfalse(PersistenceManager pm) { createObjects(pm); Transaction tx = pm.currentTransaction(); try { tx.begin(); Collection coll = new ArrayList(); coll.add(p1); coll.add(p3); coll.add(rect); pm.retrieveAll(coll, false); pm.makeTransientAll(coll); tx.commit(); tx = null; checkP1(); checkP3(); checkRectP1(); checkRectId(); } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ private void runTestRetrieveAllWithArray(PersistenceManager pm) { createObjects(pm); Transaction tx = pm.currentTransaction(); try { tx.begin(); Object[] objs = new Object[3]; objs[0] = p1; objs[1] = p3; objs[2] = rect; pm.retrieveAll(objs); pm.makeTransientAll(objs); tx.commit(); tx = null; checkP1(); checkP3(); checkRectP1(); checkRectId(); } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ private void runTestRetrieveAllWithArrayDFGtrue(PersistenceManager pm) { createObjects(pm); Transaction tx = pm.currentTransaction(); try { tx.begin(); Object[] objs = new Object[3]; objs[0] = p1; objs[1] = p3; objs[2] = rect; pm.retrieveAll(objs, true); pm.makeTransientAll(objs); tx.commit(); tx = null; checkP1(); checkP3(); // checkRectP1(); p1 is not in the default fetch group by default checkRectId(); } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ private void runTestRetrieveAllWithArrayDFGfalse(PersistenceManager pm) { createObjects(pm); Transaction tx = pm.currentTransaction(); try { tx.begin(); Object[] objs = new Object[3]; objs[0] = p1; objs[1] = p3; objs[2] = rect; pm.retrieveAll(objs, false); pm.makeTransientAll(objs); tx.commit(); tx = null; checkP1(); checkP3(); checkRectP1(); checkRectId(); } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ private void createObjects(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.setRetainValues(false); tx.begin(); p1 = new PCPoint(1,1); p1print = p1.toString(); p2 = new PCPoint(2,2); p3 = new PCPoint2(3,3); rect = new PCRect(100, p1, p2); pm.makePersistent(p1); pm.makePersistent(p2); pm.makePersistent(p3); pm.makePersistent(rect); if (debug) { logger.debug("p1: " + p1.name()); logger.debug("p2: " + p2.name()); logger.debug("p3: " + p3.name()); logger.debug("rect id: " + rect.getId() + ", upperLeft: " + rect.getUpperLeft().name() + ", lowerRight: " + rect.getLowerRight().name()); } tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ private void checkP1() { if (((p1.getX() != 1) || (!one.equals(p1.getY())))) { fail(ASSERTION_FAILED, "Error in p1 fields. Expected x:1, y:1; got x:" + p1.getX() + ", y:" + p1.getY()); } } /** */ private void checkP3() { if ((p3.getX() != 3) || (!three.equals(p3.getY()))) { fail(ASSERTION_FAILED, "Error in p3 fields. Expected x:3, y:3; got x:" + p3.getX() + ", y:" + p3.getY()); } if (!p3.wasPostLoadCalled()) { fail(ASSERTION_FAILED, "missing call of jdoPostLoad for p3"); } } /** */ private void checkRectId() { if (rect.getId() == 0) { fail(ASSERTION_FAILED, "Error in rect field id. Expected id!= 0; got id:0"); } } /** */ private void checkRectP1() { if (rect.getUpperLeft()!= p1) { fail(ASSERTION_FAILED, "Error in rect field upperLeft. Expected:" + p1print + ", got:" + rect.getUpperLeft()); } } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/ChangingObjectIdHasNoEffectOnInstance.java100664 4713 12500110374 33400 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Changing ObjectId Has No Effect On Instance *
*Keywords: identity *
*Assertion ID: A12.5.6-13. *
*Assertion Description: If the application makes a change to the ObjectId instance returned by PersistenceManager.getObjectId, there is no effect on the instance from which the ObjectId was obtained. */ public class ChangingObjectIdHasNoEffectOnInstance extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.6-13 (ChangingObjectIdHasNoEffectOnInstance) failed: "; /** * The main 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(ChangingObjectIdHasNoEffectOnInstance.class); } /** */ public void testChangingObjectIdHasNoEffectOnInstance() throws Exception { pm = getPM(); Object oid = createPCPointInstance(pm); Object p1 = pm.getObjectById(oid, false); Object oid2 = pm.getObjectId(p1); mangleObject(oid); // now oid3 should equal oid2 even though we mangled oid Object oid3 = getPM().getObjectId(p1); if (!oid2.equals(oid3)) fail(ASSERTION_FAILED, "Changing the ObjectId returned by getObjectId has an effect on ObjectId's returned by subsequent calls of getObjectId"); pm.close(); pm = null; } } ././@LongLink100644 0 0 145 12500111677 10253 Lustar 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanager/close/AfterCloseAllMethodsThrowException.javatck/src/java/org/apache/jdo/tck/api/persistencemanager/close/AfterCloseAllMethodsThrowException.java100664 6015 12500110374 34237 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.close; import javax.jdo.JDOFatalUserException; import javax.jdo.PersistenceManager; import javax.jdo.PersistenceManagerFactory; import javax.jdo.Transaction; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: AfterCloseAllMethodsThrowException *
*Keywords: exception *
*Assertion IDs: A12.5-6 *
*Assertion Description: After the PersistenceManager.close method completes, all methods on PersistenceManager except isClosed throw a JDOFatalUserException. */ public class AfterCloseAllMethodsThrowException extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5-6 (AfterCloseAllMethodsThrowException) failed: "; /** * The main 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(AfterCloseAllMethodsThrowException.class); } private PersistenceManagerFactory pmf; private PersistenceManager pm; private Transaction tx; /** */ public void testAfterCloseAllMethodsThrowException() { pm = getPM(); pm.close(); runTestEvict(); runTestRefresh(); runTestIsClosed(); pm = null; } /** */ private void runTestEvict() { try { pm.evictAll(); fail(ASSERTION_FAILED, "pm.evictAll does not throw exception if pm is closed."); } catch (JDOFatalUserException ex) { // caught expected exception } } /** */ private void runTestRefresh() { try { pm.refreshAll(); fail(ASSERTION_FAILED, "pm.refreshAll does not throw exception if pm is closed."); } catch (JDOFatalUserException ex) { // caught expected exception } } /** */ private void runTestIsClosed() { if (!pm.isClosed()) fail(ASSERTION_FAILED, "pm.isClosed returns false for closed pm."); } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/close/CloseThrowsExceptionWhenActiveTx.java100664 4335 12500110374 33760 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.close; import javax.jdo.JDOUserException; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Close Throws Exception *
*Keywords: exception *
*Assertion IDs: A12.6-2. *
*Assertion Description: In a non-managed environment, if the current transaction is active, close throws JDOUserException. */ public class CloseThrowsExceptionWhenActiveTx extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.6-2 (CloseThrowsExceptionWhenActiveTx) failed: "; /** * The main 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(CloseThrowsExceptionWhenActiveTx.class); } /** */ public void test() { pm = getPM(); pm.currentTransaction().begin(); try { pm.close(); fail(ASSERTION_FAILED, "JDOUserException was not thrown when closing PersistenceManager while transaction was open"); } catch (JDOUserException juex) { // expected this exception } finally { pm.currentTransaction().rollback(); } } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/close/IsClosedIsFalseUponConstruction.java100664 3702 12500110374 33561 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.close; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; /** *Title: Is Closed returns false Upon Construction *
*Keywords: *
*Assertion IDs: A12.5-3 *
*Assertion Description: The PersistenceManager.isClosed method returns false upon construction of the PersistenceManager instance. */ public class IsClosedIsFalseUponConstruction extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5-3 (IsClosedIsFalseUponConstruction) failed: "; /** * The main 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(IsClosedIsFalseUponConstruction.class); } /** */ public void test() { pm = getPM(); if (pm.isClosed()) { fail(ASSERTION_FAILED, "pm is closed after creation"); } } } ././@LongLink100644 0 0 147 12500111677 10255 Lustar 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanager/close/IsClosedIsFalseUponRetrievalFromPool.javatck/src/java/org/apache/jdo/tck/api/persistencemanager/close/IsClosedIsFalseUponRetrievalFromPool.ja100664 4106 12500110374 34152 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.close; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; /** *Title: Is Closed Is False Upon Retrieval From a Pool *
*Keywords: *
*Assertion IDs: A12.5-4 *
*Assertion Description: The PersistenceManager.isClosed method returns false upon retrieval of a PersistenceManager from a pool. */ public class IsClosedIsFalseUponRetrievalFromPool extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5-4 (IsClosedIsFalseUponRetrievalFromPool) failed: "; /** * The main 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(IsClosedIsFalseUponRetrievalFromPool.class); } /** */ public void testIsClosed() { String sname="Jojo"; String spswd="mypswd"; pmf = getPMF(); pm = pmf.getPersistenceManager(sname,spswd); if (pm.isClosed()) { fail(ASSERTION_FAILED, "pm is closed after creation"); } } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/close/IsClosedIsTrueAfterClose.java100664 4163 12500110374 32143 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.close; import javax.jdo.PersistenceManagerFactory; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; /** *Title: Is Closed Is True After Close *
*Keywords: *
*Assertion IDs: A12.5-5 *
*Assertion Description: The PersistenceManager.isClosed method returns true only after the closemethod completes successfully, meaning the PersistenceManager has been closed. (same as A35-01). */ public class IsClosedIsTrueAfterClose extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5-5 (IsClosedIsTrueAfterClose) failed: "; /** * The main 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(IsClosedIsTrueAfterClose.class); } /** */ public void test() { PersistenceManagerFactory pmf = getPMF(); pm = pmf.getPersistenceManager(); pm.close(); if (!pm.isClosed()) { fail(ASSERTION_FAILED, "pm.isClosed returns false after pm.close"); } } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/ConcurrentPersistenceManagers.java100664 5753 12500110374 32240 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager; import java.util.Properties; import javax.jdo.JDOHelper; import javax.jdo.PersistenceManager; import javax.jdo.PersistenceManagerFactory; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Concurrent Persistence Managers *
*Keywords: concurrency multipleJDOimpls *
*Assertion ID: A5.2-1. *
*Assertion Description: An implementation should support its own PersistenceManager concurrently with another PersistenceManager. A non-reference implementation will be tested concurrently with the Reference Implementation. */ public class ConcurrentPersistenceManagers extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A5.2-1 (ConcurrentPersistenceManagers) failed: "; /** * The main 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(ConcurrentPersistenceManagers.class); } /** */ public void test() { Properties pmfProperties = loadPMF2Properties(); PersistenceManagerFactory pmf2 = JDOHelper.getPersistenceManagerFactory(pmfProperties); PersistenceManager pm2 = pmf2.getPersistenceManager(); Transaction tx2 = pm2.currentTransaction(); pm = getPM(); Transaction tx = pm.currentTransaction(); try { tx.begin(); tx2.begin(); tx.commit(); tx = null; tx2.commit(); tx2 = null; } finally { cleanupPM(pm); pm = null; cleanupPM(pm2); pm2 = null; closePMF(pmf2); } } private Properties loadPMF2Properties() { String PMF2 = System.getProperty ("PMF2Properties", "jdori2.properties"); if (debug) logger.debug("Got PMF2Properties file name:" + PMF2); Properties ret = loadProperties (PMF2); if (debug) logger.debug("Got PMF2Properties: " + ret); return ret; } } ././@LongLink100644 0 0 145 12500111677 10253 Lustar 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanager/ConcurrentPersistenceManagersSameClasses.javatck/src/java/org/apache/jdo/tck/api/persistencemanager/ConcurrentPersistenceManagersSameClasses.java100664 12613 12500110374 34375 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager; import java.util.Collection; import java.util.Iterator; import java.util.Properties; import javax.jdo.JDOHelper; import javax.jdo.PersistenceManager; import javax.jdo.PersistenceManagerFactory; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.pc.mylib.PCRect; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Same Classes with Concurrent Persistence Managers *
*Keywords: concurrency multipleJDOimpls *
*Assertion ID: A5.2-2. *
*Assertion Description: The same classes must be supported concurrently by multiple PersistenceManagers from different implementations. */ public class ConcurrentPersistenceManagersSameClasses extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A5.2-2 (ConcurrentPersistenceManagersSameClasses) failed: "; /** * The main 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(ConcurrentPersistenceManagersSameClasses.class); } /** */ public void test() { if (!isBinaryCompatibilitySupported()) { printUnsupportedOptionalFeatureNotTested( "org.apache.jdo.tck.api.persistencemanager.ConcurrentPersistenceManagersSameClasses", "javax.jdo.option.BinaryCompatibility"); return; } Properties pmfProperties = loadPMF2Properties(); PersistenceManagerFactory pmf2 = JDOHelper.getPersistenceManagerFactory(pmfProperties); PersistenceManager pm2 = pmf2.getPersistenceManager(); Transaction tx2 = pm2.currentTransaction(); PCPoint p21 = null; PCPoint p22 = null; PCRect rect2 = null; pm = getPM(); Transaction tx = pm.currentTransaction(); try { tx.begin(); tx2.begin(); PCPoint p11 = new PCPoint(110, 120); PCPoint p12 = new PCPoint(120, 140); PCRect rect1 = new PCRect (0, p11, p12); pm.makePersistent (rect1); p21 = new PCPoint(210, 220); p22 = new PCPoint(220, 240); rect2 = new PCRect (0, p21, p22); pm2.makePersistent (rect2); tx.commit(); tx2.commit(); tx.begin(); tx2.begin(); PCPoint p11a = findPoint (pm, 110, 120); if (p11a != p11) { fail(ASSERTION_FAILED, "unexpected PCPoint instance, expected: 110, 120, found: " + p11a.getX() + ", " + p11a.getY()); } PCPoint p21a = findPoint (pm2, 210, 220); if (p21a != p21) { fail(ASSERTION_FAILED, "unexpected PCPoint instance, expected: 210, 220, found: " + p21a.getX() + ", " + p21a.getY()); } tx.commit(); tx = null; tx2.commit(); tx2 = null; } finally { cleanupPM(pm); pm = null; try { // delete pm2 instances if (pm2.currentTransaction().isActive()) { pm2.currentTransaction().rollback(); } pm2.currentTransaction().begin(); pm2.deletePersistent(rect2); pm2.deletePersistent(p21); pm2.deletePersistent(p22); pm2.currentTransaction().commit(); } finally { cleanupPM(pm2); pm2 = null; closePMF(pmf2); } } } /** */ private Properties loadPMF2Properties() { String PMF2 = System.getProperty ("PMF2Properties", "jdori2.properties"); if (debug) logger.debug("Got PMF2Properties file name:" + PMF2); Properties ret = loadProperties (PMF2); if (debug) logger.debug("Got PMF2Properties: " + ret); return ret; } /** */ private PCPoint findPoint (PersistenceManager pm, int x, int y) { Query q = pm.newQuery (PCPoint.class); q.declareParameters ("int px, int py"); q.setFilter ("x == px & y == py"); Collection results = (Collection)q.execute (new Integer(x), new Integer(y)); Iterator it = results.iterator(); PCPoint ret = (PCPoint)it.next(); return ret; } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/CurrentTransaction.java100664 3746 12500110374 30063 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: CurrentTransaction *
*Keywords: *
*Assertion ID: A12.5.2-1 *
*Assertion Description: The PersistenceManager.currentTransaction method returns the Transaction instance associated with the PersistenceManager. */ public class CurrentTransaction extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.2-1 (CurrentTransaction) failed: "; /** * The main 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(CurrentTransaction.class); } /** */ public void testCurrentTransaction() { pm = getPM(); PCPoint p1 = new PCPoint(); Transaction tx = pm.currentTransaction(); tx.begin(); pm.makePersistent(p1); tx.commit(); pm.close(); pm = null; } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/DataStoreCacheTest.java100664 6670 12500110374 27704 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager; import java.util.Collection; import java.util.HashSet; import javax.jdo.datastore.DataStoreCache; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** * Title: DataStoreCacheTest *
* Keywords: DataStoreCache cache pin unpin evict *
* Assertion ID: A11.8 *
* Assertion Description: Most JDO implementations allow instances to be cached in a second-level cache, and allow direct management of the cache by knowledgeable applications. The second-level cache is typically a single VM cache and is used for persistent instances associated with a single PersistenceManagerFactory. For the purpose of standardizing this behavior, the DataStoreCache interface is used. */ public class DataStoreCacheTest extends PersistenceManagerTest { Object pointoid; Collection pointoidCollection; Object[] pointoidArray; /** */ private static final String ASSERTION_FAILED = "Assertion A11.8 (DataStoreCacheTest) failed: "; /** * The main 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(DataStoreCacheTest.class); } /** * In setup, create a persistent instance and get its oid. * The oid is a valid parameter to the cache APIs. */ protected void localSetUp() { addTearDownClass(PCPoint.class); PCPoint point = new PCPoint(50, 100); getPM().currentTransaction().begin(); pm.makePersistent(point); pointoid = pm.getObjectId(point); pointoidCollection = new HashSet(); pointoidCollection.add(pointoid); pointoidArray = new Object[] {pointoid}; pm.currentTransaction().commit(); } /** * There is no mandated behavior of the DataStoreCache * methods. This test makes sure that the instance * returned does not throw exceptions on any method. */ public void testDataStoreCache() { DataStoreCache ds = getPMF().getDataStoreCache(); ds.evict(pointoid); ds.evictAll(); ds.evictAll(pointoidCollection); ds.evictAll(pointoidArray); ds.evictAll(PCPoint.class, true); ds.pin(pointoid); ds.unpin(pointoid); ds.pinAll(pointoidCollection); ds.unpinAll(pointoidCollection); ds.pinAll(pointoidArray); ds.unpinAll(pointoidArray); ds.pinAll(PCPoint.class, true); ds.unpinAll(PCPoint.class, true); } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/DataStoreConnection.java100664 12416 12500110374 30153 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.util.Collection; import java.util.HashSet; import javax.jdo.datastore.JDOConnection; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: DataStoreConnection *
*Keywords: *
*Assertion ID: A12.5.2-1 *
*Assertion Description: In order for the application to perform some datastore-specific functions, such as to execute a query that is not directly supported by JDO, applications might need access to the datastore connection used by the JDO implementation. This method returns a wrapped connection that can be cast to the appropriate datastore connection and used by the application. The capability to get the datastore connection is indicated by the optional feature string javax.jdo.option.GetDataStoreConnection. */ public class DataStoreConnection extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.2-1 (DataStoreConnection) failed: "; protected PCPoint goldenPoint; /** * The main 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(DataStoreConnection.class); } /** */ protected void localSetUp() { addTearDownClass(PCPoint.class); PCPoint point = new PCPoint(50, 100); goldenPoint = new PCPoint(point.getX(), point.getY()); getPM().currentTransaction().begin(); pm.makePersistent(point); pm.currentTransaction().commit(); } /** */ public void testDataStoreConnection() { if (!(isDataStoreConnectionSupported() && isSQLSupported())) { printUnsupportedOptionalFeatureNotTested( this.getClass().getName(), "getDataStoreConnection AND SQLSupported."); return; } getPM().currentTransaction().setOptimistic(false); executeSQLWithDataStoreConnection(); if (!isOptimisticSupported()) { printUnsupportedOptionalFeatureNotTested( this.getClass().getName(), "getDataStoreConnection AND SQLSupported AND Optimistic."); return; } getPM().currentTransaction().setOptimistic(true); executeSQLWithDataStoreConnection(); } private void executeSQLWithDataStoreConnection() { String schema = getPMFProperty("javax.jdo.mapping.Schema"); String sql = "SELECT X, Y FROM " + schema + ".PCPoint"; JDOConnection jconn = null; try { getPM().currentTransaction().begin(); jconn = pm.getDataStoreConnection(); Connection conn = (Connection)jconn; if (conn.getAutoCommit()) { appendMessage(ASSERTION_FAILED + "Autocommit must not be true in JDO connection."); }; PreparedStatement ps = conn.prepareStatement(sql); ResultSet rs = ps.executeQuery(); Collection actuals = new HashSet(); while (rs.next()) { PCPoint p = new PCPoint(rs.getInt(1), rs.getInt(2)); actuals.add(p); } if (actuals.size() != 1) { appendMessage(ASSERTION_FAILED + "Wrong size of result of " + sql + NL + "expected: 1, actual: " + actuals.size()); } else { PCPoint actual = (PCPoint)actuals.iterator().next(); if (goldenPoint.getX() != actual.getX() || !goldenPoint.getY().equals(actual.getY())) { appendMessage(ASSERTION_FAILED + "Wrong values of PCPoint from SQL" + "expected x: " + goldenPoint.getX() + ", y: " + goldenPoint.getX() + NL + "actual x: " + actual.getX() + ", y: " + actual.getX() ); } } } catch (Exception ex) { appendMessage(ASSERTION_FAILED + " caught exception:" + ex); } finally { jconn.close(); getPM().currentTransaction().commit(); failOnError(); } } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/DataStoreConnectionThrows.java100664 14514 12500110374 31363 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.Collection; import java.util.HashMap; import java.util.HashSet; import javax.jdo.datastore.JDOConnection; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: DataStoreConnectionThrows *
*Keywords: *
*Assertion ID: A12.16-2 *
*Assertion Description: For portability, a JDBC-based JDO implementation will return an instance that implements java.sql.Connection. The instance will throw an exception for any of the following method calls: commit, getMetaData, releaseSavepoint, rollback, setAutoCommit, setCatalog, setHoldability, setReadOnly, setSavepoint, setTransactionIsolation, and setTypeMap. */ public class DataStoreConnectionThrows extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.16-2 (DataStoreConnectionThrows) failed: "; protected PCPoint goldenPoint; /** * The main 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(DataStoreConnectionThrows.class); } /** */ protected void checkThrow(Connection conn, Call call) { try { call.execute(conn); appendMessage(ASSERTION_FAILED + "Failed to throw an exception for " + call.getName()); } catch (SQLException ex) { appendMessage(ASSERTION_FAILED + "Threw a SQLException for " + call.getName() + NL + ex); return; } catch (Exception ex) { return; } } /** */ interface Call { String getName(); void execute(Connection conn) throws SQLException; } /** */ public void testDataStoreConnectionThrows() { if (!(isDataStoreConnectionSupported() && isSQLSupported())) { printUnsupportedOptionalFeatureNotTested( this.getClass().getName(), "getDataStoreConnection AND SQLSupported."); return; } JDOConnection jconn = getPM().getDataStoreConnection(); Connection conn = (Connection)jconn; check13Methods(conn); if (isJRE14orBetter()) { check14Methods(conn); } jconn.close(); failOnError(); } /** * These methods are defined in Java 1.3 Connection. */ protected void check13Methods(Connection conn) { checkThrow(conn, new Call() { public String getName() {return "commit";} public void execute(Connection conn) throws SQLException {conn.commit();} } ); checkThrow(conn, new Call() { public String getName() {return "rollback";} public void execute(Connection conn) throws SQLException {conn.rollback();} } ); checkThrow(conn, new Call() { public String getName() {return "setTransactionIsolation";} public void execute(Connection conn) throws SQLException { conn.setTransactionIsolation( Connection.TRANSACTION_READ_COMMITTED);} } ); checkThrow(conn, new Call() { public String getName() {return "setAutoCommit";} public void execute(Connection conn) throws SQLException {conn.setAutoCommit(true);} } ); checkThrow(conn, new Call() { public String getName() {return "setCatalog";} public void execute(Connection conn) throws SQLException {conn.setCatalog("NONE");} } ); } /** * These methods are defined in Java 1.4 Connection. */ protected void check14Methods(Connection conn) { checkThrow(conn, new Call() { public String getName() {return "setSavepoint";} public void execute(Connection conn) throws SQLException {conn.setSavepoint();} } ); checkThrow(conn, new Call() { public String getName() {return "releaseSavepoint";} public void execute(Connection conn) throws SQLException {conn.releaseSavepoint(null);} } ); checkThrow(conn, new Call() { public String getName() {return "setHoldability";} public void execute(Connection conn) throws SQLException { conn.setHoldability( ResultSet.CLOSE_CURSORS_AT_COMMIT);} } ); checkThrow(conn, new Call() { public String getName() {return "setTypeMap";} public void execute(Connection conn) throws SQLException {conn.setTypeMap(new HashMap());} } ); } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/DatastoreTimeout.java100664 50415 12500110374 27543 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager; import java.util.List; import junit.framework.AssertionFailedError; import javax.jdo.JDOFatalException; import javax.jdo.JDODataStoreException; import javax.jdo.JDOUnsupportedOptionException; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.pc.mylib.PCRect; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.util.ThreadExceptionHandler; /** *Title: DatastoreTimeout *
*Keywords: datastore timeout *
*Assertion ID: A12.6.9-1, A14.6.1-7 *
*Assertion Description: */ public class DatastoreTimeout extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A12.6.9-1, A14.6.1-7 (DatastoreTimeout) failed: "; /** Timeout value for datastore read */ private static Integer READ_TIMEOUT = new Integer(100); /** Timeout value for datastore write */ private static Integer WRITE_TIMEOUT = new Integer(100); /** Zero Timeout value */ private static Integer ZERO_TIMEOUT = new Integer(0); /** Time for the main thread to sleep after starting a parallel thread. */ private static int MAIN_SLEEP_MILLIS = 1000; /** Time for the parallel threads to sleep before commit. */ private static int THREAD_SLEEP_MILLIS_SHORT = 2500; /** Time for the parallel threads to sleep before commit. */ private static int THREAD_SLEEP_MILLIS_LONG = 7500; /** Oid of the PCRect instance created by localSetUp */ private Object rectOid; /** Oid of the first PCPOint instance created by localSetUp */ private Object point1Oid; /** Oid of the second PCPoint instance created by localSetUp */ private Object point2Oid; /** * The main 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(DatastoreTimeout.class); } /** Method testing DatastoreReadTimeout. */ public void testDatastoreReadTimeout() throws Exception { if (debug) logger.debug("isDatastoreTimeoutSupported:" + isDatastoreTimeoutSupported()); // Parallel thread writing the instances and causing them to be locked ThreadExceptionHandler group = new ThreadExceptionHandler(); ParallelWriter runnable = new ParallelWriter(THREAD_SLEEP_MILLIS_LONG); Thread t = new Thread(group, runnable, "Parallel Writer"); t.start(); // Wait for a second such that the other thread can lock the instances Thread.sleep(MAIN_SLEEP_MILLIS); try { runQueryReadingPCPointInstances(READ_TIMEOUT); runGetObjectByIdReadingPCPointInstance(READ_TIMEOUT); runNavigationalReadPCPointInstance(READ_TIMEOUT); } finally { t.join(); Throwable problem = group.getUncaughtException(t); if (problem != null) { if (problem instanceof AssertionFailedError) throw (AssertionFailedError)problem; else throw new JDOFatalException( "Thread " + t.getName()+ " results in exception ", problem); } } } /** Method testing DatastoreWriteTimeout. */ public void testDatastoreWriteTimeout() throws Exception { if (debug) logger.debug("isDatastoreTimeoutSupported:" + isDatastoreTimeoutSupported()); // Parallel thread reading the instances and causing them to be locked ThreadExceptionHandler group = new ThreadExceptionHandler(); ParallelReader runnable = new ParallelReader(THREAD_SLEEP_MILLIS_LONG); Thread t = new Thread(group, runnable, "Parallel Reader"); t.start(); // Wait for a second such that the other thread can lock the instances Thread.sleep(MAIN_SLEEP_MILLIS); try { runUpdatePCointInstance(WRITE_TIMEOUT); runDeletePCPointInstance(WRITE_TIMEOUT); runDeletePCPointInstancesByQuery(WRITE_TIMEOUT); } finally { t.join(); Throwable problem = group.getUncaughtException(t); if (problem != null) { if (problem instanceof AssertionFailedError) throw (AssertionFailedError)problem; else throw new JDOFatalException( "Thread " + t.getName()+ " results in exception ", problem); } } } /** Method testing zero DatastoreReadTimeout. */ public void testZeroDatastoreReadTimeout() throws Exception { // Parallel thread writing the instances and causing them to be locked ThreadExceptionHandler group = new ThreadExceptionHandler(); ParallelWriter runnable = new ParallelWriter(THREAD_SLEEP_MILLIS_SHORT); Thread t = new Thread(group, runnable, "Parallel Writer"); t.start(); // Wait for a second such that the other thread can lock the instances Thread.sleep(MAIN_SLEEP_MILLIS); try { runQueryReadingPCPointInstances(ZERO_TIMEOUT); } finally { t.join(); Throwable problem = group.getUncaughtException(t); if (problem != null) { if (problem instanceof AssertionFailedError) throw (AssertionFailedError)problem; else throw new JDOFatalException( "Thread " + t.getName()+ " results in exception ", problem); } } } /** Method testing zero DatastoreWriteTimeout. */ public void testZeroDatastoreWriteTimeout() throws Exception { // Parallel thread reading the instances and causing them to be locked ThreadExceptionHandler group = new ThreadExceptionHandler(); ParallelReader runnable = new ParallelReader(THREAD_SLEEP_MILLIS_SHORT); Thread t = new Thread(group, runnable, "Parallel Reader"); t.start(); // Wait for a second such that the other thread can lock the instances Thread.sleep(MAIN_SLEEP_MILLIS); try { runUpdatePCointInstance(ZERO_TIMEOUT); } finally { t.join(); Throwable problem = group.getUncaughtException(t); if (problem != null) { if (problem instanceof AssertionFailedError) throw (AssertionFailedError)problem; else throw new JDOFatalException( "Thread " + t.getName()+ " results in exception ", problem); } } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCRect.class); addTearDownClass(PCPoint.class); getPM(); try { Transaction tx = pm.currentTransaction(); tx.begin(); PCPoint p1 = new PCPoint(110, 120); PCPoint p2 = new PCPoint(130, 140); PCRect rect = new PCRect (0, p1, p2); pm.makePersistent (rect); tx.commit(); rectOid = pm.getObjectId(rect); point1Oid = pm.getObjectId(p1); point2Oid = pm.getObjectId(p2); } finally { cleanupPM(); } } // ----------------- Helper methods --------------------------- /** DatastoreReadTimeout helper method: query reading PCPoint instance. */ private void runQueryReadingPCPointInstances(Integer timeout) { getPM(); try { pm.currentTransaction().begin(); Query q = pm.newQuery(PCPoint.class); q.setDatastoreReadTimeoutMillis(timeout); @SuppressWarnings("unused") List result = (List)q.execute(); pm.currentTransaction().commit(); if (!isDatastoreTimeoutSupported()) { fail(ASSERTION_FAILED, "Query.setDatastoreReadTimeoutMillis should throw a " + "JDOUnsupportedOptionException, if datastore timeout is not supported "); } } catch (JDOUnsupportedOptionException ex) { if (isDatastoreTimeoutSupported()) { fail(ASSERTION_FAILED, "Query.setDatastoreReadTimeoutMillis should not result " + "in a JDOUnsupportedOptionException, if datastore timeout is supported "); } } catch (JDODataStoreException ex) { if (!isDatastoreTimeoutSupported()) { fail(ASSERTION_FAILED, "Query.execute should not result in a " + "JDODataStoreException, if datastore timeout is not supported."); } else if (timeout == ZERO_TIMEOUT) { fail(ASSERTION_FAILED, "Query.execute should not result in a " + "JDODataStoreException, if zero timeout is specified (meaning no timeout)."); } } finally { cleanupPM(); } } /** DatastoreReadTimeout helper method: getObjectById reading PCPoint instance. */ private void runGetObjectByIdReadingPCPointInstance(Integer timeout) { getPM(); try { pm.currentTransaction().begin(); pm.setDatastoreReadTimeoutMillis(timeout); @SuppressWarnings("unused") PCPoint point1 = (PCPoint)pm.getObjectById(point1Oid, true); pm.currentTransaction().commit(); if (!isDatastoreTimeoutSupported()) { fail(ASSERTION_FAILED, "PM.setDatastoreReadTimeoutMillis should throw a " + "JDOUnsupportedOptionException, if datastore timeout is not supported "); } } catch (JDOUnsupportedOptionException ex) { if (isDatastoreTimeoutSupported()) { fail(ASSERTION_FAILED, "PM.setDatastoreReadTimeoutMillis should not result " + "in a JDOUnsupportedOptionException, if datastore timeout is supported "); } } catch (JDODataStoreException ex) { if (!isDatastoreTimeoutSupported()) { fail(ASSERTION_FAILED, "PM.getObjectById should not result in a " + "JDODataStoreException, if datastore timeout is not supported."); } else if (timeout == ZERO_TIMEOUT) { fail(ASSERTION_FAILED, "PM.getObjectById should not result in a " + "JDODataStoreException, if zero timeout is specified (meaning no timeout)."); } } finally { cleanupPM(); } } /** DatastoreReadTimeout helper method: navigation reading PCPoint instance. */ private void runNavigationalReadPCPointInstance(Integer timeout) { getPM(); try { pm.currentTransaction().begin(); pm.setDatastoreReadTimeoutMillis(timeout); PCRect rect = (PCRect)pm.getObjectById(rectOid, true); PCPoint p1 = rect.getUpperLeft(); p1.name(); pm.currentTransaction().commit(); if (!isDatastoreTimeoutSupported()) { fail(ASSERTION_FAILED, "PM.setDatastoreReadTimeoutMillis should throw a " + "JDOUnsupportedOptionException, if datastore timeout is not supported "); } } catch (JDOUnsupportedOptionException ex) { if (isDatastoreTimeoutSupported()) { fail(ASSERTION_FAILED, "PM.setDatastoreReadTimeoutMillis should not result " + "in a JDOUnsupportedOptionException, if datastore timeout is supported "); } } catch (JDODataStoreException ex) { if (!isDatastoreTimeoutSupported()) { fail(ASSERTION_FAILED, "Navigational access should not result in a " + "JDODataStoreException, if datastore timeout is not supported."); } else if (timeout == ZERO_TIMEOUT) { fail(ASSERTION_FAILED, "Navigational access should not result in a " + "JDODataStoreException, if zero timeout is specified (meaning no timeout)."); } } finally { cleanupPM(); } } /** DatastoreWriteTimeout helper method: update PCPoint instance. */ private void runUpdatePCointInstance(Integer timeout) { getPM(); try { pm.currentTransaction().begin(); pm.setDatastoreWriteTimeoutMillis(timeout); PCPoint point1 = (PCPoint)pm.getObjectById(point1Oid, true); point1.setX(500); pm.currentTransaction().commit(); if (!isDatastoreTimeoutSupported()) { fail(ASSERTION_FAILED, "PM.setDatastoreWriteTimeoutMillis should throw a " + "JDOUnsupportedOptionException, if datastore timeout is not supported "); } } catch (JDOUnsupportedOptionException ex) { if (isDatastoreTimeoutSupported()) { fail(ASSERTION_FAILED, "PM.setDatastoreWriteTimeoutMillis should not result " + "in a JDOUnsupportedOptionException, if datastore timeout is supported "); } } catch (JDODataStoreException ex) { if (!isDatastoreTimeoutSupported()) { fail(ASSERTION_FAILED, "PM.getObjectById should not result in a " + "JDODataStoreException, if datastore timeout is not supported."); } else if (timeout == ZERO_TIMEOUT) { fail(ASSERTION_FAILED, "PM.getObjectById should not result in a " + "JDODataStoreException, if zero timeout is specified (meaning no timeout)."); } } finally { cleanupPM(); } } /** DatastoreWriteTimeout helper method: delete PCPoint instance. */ private void runDeletePCPointInstance(Integer timeout) { getPM(); try { pm.currentTransaction().begin(); pm.setDatastoreWriteTimeoutMillis(timeout); PCPoint point1 = (PCPoint)pm.getObjectById(point1Oid, true); pm.deletePersistent(point1); pm.currentTransaction().commit(); if (!isDatastoreTimeoutSupported()) { fail(ASSERTION_FAILED, "PM.setDatastoreWriteTimeoutMillis should throw a " + "JDOUnsupportedOptionException, if datastore timeout is not supported "); } } catch (JDOUnsupportedOptionException ex) { if (isDatastoreTimeoutSupported()) { fail(ASSERTION_FAILED, "PM.setDatastoreWriteTimeoutMillis should not result " + "in a JDOUnsupportedOptionException, if datastore timeout is supported "); } } catch (JDODataStoreException ex) { if (!isDatastoreTimeoutSupported()) { fail(ASSERTION_FAILED, "PM.getObjectById should not result in a " + "JDODataStoreException, if datastore timeout is not supported."); } else if (timeout == ZERO_TIMEOUT) { fail(ASSERTION_FAILED, "PM.getObjectById should not result in a " + "JDODataStoreException, if zero timeout is specified (meaning no timeout)."); } } finally { cleanupPM(); } } /** DatastoreWriteTimeout helper method: delete by query. */ private void runDeletePCPointInstancesByQuery(Integer timeout) { getPM(); try { pm.currentTransaction().begin(); Query q = pm.newQuery(PCPoint.class); q.setDatastoreWriteTimeoutMillis(timeout); q.deletePersistentAll(); pm.currentTransaction().commit(); if (!isDatastoreTimeoutSupported()) { fail(ASSERTION_FAILED, "Query.setDatastoreWriteTimeoutMillis should throw a " + "JDOUnsupportedOptionException, if datastore timeout is not supported "); } } catch (JDOUnsupportedOptionException ex) { if (isDatastoreTimeoutSupported()) { fail(ASSERTION_FAILED, "Query.setDatastoreWriteTimeoutMillis should not result " + "in a JDOUnsupportedOptionException, if datastore timeout is supported "); } } catch (JDODataStoreException ex) { if (!isDatastoreTimeoutSupported()) { fail(ASSERTION_FAILED, "Query.deletePersistentAll should not result in a " + "JDODataStoreException, if datastore timeout is not supported."); } else if (timeout == ZERO_TIMEOUT) { fail(ASSERTION_FAILED, "Query.deletePersistentAll should not result in a " + "JDODataStoreException, if zero timeout is specified (meaning no timeout)."); } } finally { cleanupPM(); } } // ------------- Helper classes ------------------------------- /** Runnable class updating instances and causing them to be read locked. */ class ParallelReader implements Runnable { private final int sleepMillis; ParallelReader(int sleepMillis) { this.sleepMillis = sleepMillis; } public void run() { PersistenceManager parallelPM = getPMF().getPersistenceManager(); Transaction tx = parallelPM.currentTransaction(); // Run datastore transaction tx.setOptimistic(false); try { tx.begin(); // read PCPoint instances PCPoint p1 = (PCPoint)parallelPM.getObjectById(point1Oid, true); p1.name(); PCPoint p2 = (PCPoint)parallelPM.getObjectById(point2Oid, true); p2.name(); // Give the main thread a chance to try to write the instances Thread.sleep(sleepMillis); tx.commit(); } catch (InterruptedException ex) { throw new RuntimeException(ex); } finally { cleanupPM(parallelPM); } } } /** Runnable class updating instances and causing them to be write locked. */ class ParallelWriter implements Runnable { private final int sleepMillis; ParallelWriter(int sleepMillis) { this.sleepMillis = sleepMillis; } public void run() { PersistenceManager parallelPM = getPMF().getPersistenceManager(); Transaction tx = parallelPM.currentTransaction(); // Run datastore transaction tx.setOptimistic(false); try { tx.begin(); PCPoint p1 = (PCPoint)parallelPM.getObjectById(point1Oid); p1.setX(210); p1.setY(220); PCPoint p2 = (PCPoint)parallelPM.getObjectById(point2Oid); p2.setX(230); p2.setY(240); // Flush will set a write lock on the instances parallelPM.flush(); // Give the main thread a chance to try to read the instances Thread.sleep(sleepMillis); tx.commit(); } catch (InterruptedException ex) { throw new RuntimeException(ex); } finally { cleanupPM(parallelPM); } } } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/DeletePersistent.java100664 17133 12500110374 27531 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager; import java.util.Collection; import java.util.HashSet; import javax.jdo.JDOUserException; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Delete Persistent *
*Keywords: *
*Assertion IDs: A12.5.7-9 *
*Assertion Description: PersistenceManager.deletePersistent and deletePersistentAll delete a persistent instance(s) from the data store. It must be called in the context of an active transaction, or a JDOUserExceptionis thrown. The representation in the data store will be deleted when this instance is flushed to the data store (via commit, or evict). */ public class DeletePersistent extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.7-9 (DeletePersistent) failed: "; /** * The main 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(DeletePersistent.class); } private PCPoint p1 = null; private PCPoint p2 = null; private PCPoint p3 = null; private PCPoint p4 = null; private PCPoint p5 = null; /** */ public void testDeletePersistent() { pm = getPM(); createObjects(pm); /* positive tests */ /* method called in the context of an active transaction */ runTestDeletePersistent1(pm); runTestDeletePersistent2(pm); runTestDeletePersistent3(pm); /* negative tests */ /* method called in the context of an non-active transaction */ runTestDeletePersistent4(pm); runTestDeletePersistent5(pm); runTestDeletePersistent6(pm); pm.close(); pm = null; } /** */ private void createObjects(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); p1 = new PCPoint(1,3); p2 = new PCPoint(2,4); p3 = new PCPoint(3,5); p4 = new PCPoint(4,6); p5 = new PCPoint(5,7); pm.makePersistent(p1); pm.makePersistent(p2); pm.makePersistent(p3); pm.makePersistent(p4); pm.makePersistent(p5); tx.commit(); } finally { if (tx.isActive()) tx.rollback(); } } /** test deletePersistent (Object pc) */ private void runTestDeletePersistent1(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx = pm.currentTransaction(); tx.begin(); pm.deletePersistent(p1); tx.commit(); if (debug) logger.debug(" \nPASSED in testDeletePersistent1()"); } finally { if (tx.isActive()) tx.rollback(); } } /* test deletePersistentAll (Collection pcs) */ private void runTestDeletePersistent2(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); Collection col1 = new java.util.HashSet(); col1.add(p2); col1.add(p3); pm.deletePersistentAll(col1); tx.commit(); if (debug) logger.debug(" \nPASSED in testDeletePersistent2()"); } finally { if (tx.isActive()) tx.rollback(); } } /* test deletePersistentAll (Object[] o) */ private void runTestDeletePersistent3(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); Collection col1 = new HashSet(); col1.add(p4); col1.add(p5); Object[] obj1= col1.toArray(); pm.deletePersistentAll(obj1); tx.commit(); if (debug) logger.debug(" \nPASSED in testDeletePersistent3()"); } finally { if (tx.isActive()) tx.rollback(); } } /* test deletePersistent (Object pc) */ public void runTestDeletePersistent4(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); PCPoint np1 = new PCPoint(1,3); pm.makePersistent(np1); tx.commit(); try { pm.deletePersistent(np1); fail(ASSERTION_FAILED, "pm.deletePersistent(Object) outside of tx should throw an exception"); } catch (JDOUserException ex) { // expected exception } } finally { if (tx.isActive()) tx.rollback(); } } /* test deletePersistentAll (Collection pcs) */ public void runTestDeletePersistent5(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); PCPoint np1 = new PCPoint (3,3); PCPoint np2 = new PCPoint (4,4); pm.makePersistent(np1); pm.makePersistent(np2); tx.commit(); Collection col1 = new java.util.HashSet(); col1.add(np1); col1.add(np2); try { pm.deletePersistentAll(col1); fail(ASSERTION_FAILED, "pm.deletePersistentAll(Collection) outside of tx should throw an exception"); } catch (JDOUserException ex) { // expected exception } } finally { if (tx.isActive()) tx.rollback(); } } /* test deletePersistentAll (Object[] o) */ public void runTestDeletePersistent6(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); PCPoint np1 = new PCPoint (3,3); PCPoint np2 = new PCPoint (4,4); pm.makePersistent(np1); pm.makePersistent(np2); tx.commit(); Collection col1 = new java.util.HashSet(); col1.add(np1); col1.add(np2); Object[] obj1=col1.toArray(); try { pm.deletePersistentAll(obj1); fail(ASSERTION_FAILED, "pm.deletePersistentAll(Object[]) outside of tx should throw an exception"); } catch (JDOUserException ex) { // expected exception } } finally { if (tx.isActive()) tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/DeletePersistentAllFails.java100664 12000 12500110374 31125 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager; import java.util.Collection; import javax.jdo.JDOUserException; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.pc.mylib.Point; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: DeletePersistentAll Fails *
*Keywords: exception *
*Assertion IDs: A12.5.7-2. *
*Assertion Description: If a collection or array of instances is passed to PersistenceManager.deletePersistentAll, and one or more of the instances fail to complete the required operation, then all instances will be attempted, and a JDOUserException will be thrown which contains nested exceptions, each of which contains one of the failing instances. The succeeding instances will transition to the specified life cycle state, and the failing instances will remain in their current state. */ public class DeletePersistentAllFails extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.7-2 (DeletePersistentAllFails) failed: "; /** * The main 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(DeletePersistentAllFails.class); } private PCPoint p1 = null; private PCPoint p2 = null; private PCPoint p3 = null; private PCPoint p4 = null; private PCPoint p5 = null; /** */ public void testDeletePersistentAllFails() { pm = getPM(); createObjects(pm); runTestDeletePersistentAllFails1(pm); runTestDeletePersistentAllFails2(pm); pm.close(); pm = null; } private void createObjects(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); p1 = new PCPoint(1,3); p2 = new PCPoint(2,4); p3 = new PCPoint(3,5); p4 = new PCPoint(4,6); p5 = new PCPoint(5,7); pm.makePersistent(p1); pm.makePersistent(p2); pm.makePersistent(p3); pm.makePersistent(p4); pm.makePersistent(p5); tx.commit(); } finally { if (tx.isActive()) tx.rollback(); } } /* test deletePersistentAll (Collection pcs) */ private void runTestDeletePersistentAllFails1(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); Point np3 = new Point (5,5); Collection col1 = new java.util.HashSet(); col1.add(p1); col1.add(p2); col1.add(np3); try { pm.deletePersistentAll(col1); fail(ASSERTION_FAILED, "pm.deletePersistentAll(Collection) with non persistent instances should throw an exception"); } catch (JDOUserException ex) { // expected exception } tx.rollback(); } finally { if (tx.isActive()) tx.rollback(); } } /* test deletePersistentAll (Object[] o) */ private void runTestDeletePersistentAllFails2(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); Point np3 = new Point (5,5); Collection col1 = new java.util.HashSet(); col1.add(p3); col1.add(p4); col1.add(np3); Object[] obj1=col1.toArray(); try { pm.deletePersistentAll(obj1); fail(ASSERTION_FAILED, "pm.deletePersistentAll(Object[]) with non persistent instances should throw an exception"); } catch (JDOUserException ex) { // expected exception } tx.rollback(); } finally { if (tx.isActive()) tx.rollback(); } } } ././@LongLink100644 0 0 147 12500111677 10255 Lustar 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanager/DeletePersistentFailsIfInstanceIsTransient.javatck/src/java/org/apache/jdo/tck/api/persistencemanager/DeletePersistentFailsIfInstanceIsTransient.ja100664 10754 12500110374 34313 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager; import java.util.Collection; import javax.jdo.JDOUserException; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: DeletePersistent Fails If Instance Is Transient *
*Keywords: exception *
*Assertion IDs: A12.5.7-12. *
*Assertion Description: PersistenceManager.deletePersistent and deletePersistentAll will throw a JDOUserException if the parameter instance is transient. */ public class DeletePersistentFailsIfInstanceIsTransient extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.7-12 (DeletePersistentFailsIfInstanceIsTransient) failed: "; /** * The main 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(DeletePersistentFailsIfInstanceIsTransient.class); } /** */ public void testDeletePersistentFailsIfInstanceIsTransient() { pm = getPM(); runTestDeletePersistent(); runTestDeletePersistentAll1(); runTestDeletePersistentAll2(); pm.close(); pm = null; } /* test deletePersistent (Object pc) */ private void runTestDeletePersistent() { Transaction tx = pm.currentTransaction(); try { tx = pm.currentTransaction(); tx.begin(); PCPoint p1 = new PCPoint (3,3); try { pm.deletePersistent(p1); fail(ASSERTION_FAILED, "pm.deletePersistent(Object) with transient instance should throw exception"); } catch (JDOUserException ex) { // expected exception } tx.rollback(); } finally { if (tx.isActive()) tx.rollback(); } } /* test deletePersistentAll (Collection pcs) */ private void runTestDeletePersistentAll1() { Transaction tx = pm.currentTransaction(); try { tx.begin(); PCPoint p1 = new PCPoint (3,3); PCPoint p2 = new PCPoint (4,4); Collection col1 = new java.util.HashSet(); col1.add(p1); col1.add(p2); try { pm.deletePersistentAll(col1); fail(ASSERTION_FAILED, "pm.deletePersistent(Collection) with transient instance(s) should throw exception"); } catch (JDOUserException ex) { // expected exception } tx.rollback(); } finally { if (tx.isActive()) tx.rollback(); } } /* test deletePersistentAll (Object[] o) */ private void runTestDeletePersistentAll2() { Transaction tx = pm.currentTransaction(); try { tx.begin(); PCPoint p1 = new PCPoint (3,3); PCPoint p2 = new PCPoint (4,4); Collection col1 = new java.util.HashSet(); col1.add(p1); col1.add(p2); try { pm.deletePersistentAll(col1.toArray()); fail(ASSERTION_FAILED, "pm.deletePersistent(Object[]) with transient instance(s) should throw exception"); } catch (JDOUserException ex) { // expected exception } tx.rollback(); } finally { if (tx.isActive()) tx.rollback(); } } } ././@LongLink100644 0 0 176 12500111677 10257 Lustar 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanager/DeletePersistentFailsIfInstanceManagedByAnotherPersistenceManager.javatck/src/java/org/apache/jdo/tck/api/persistencemanager/DeletePersistentFailsIfInstanceManagedByAnoth100664 13167 12500110374 34301 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager; import java.util.Collection; import java.util.HashSet; import javax.jdo.JDOUserException; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: DeletePersistent Fails If Instance Managed By Another PersistenceManager *
*Keywords: exception *
*Assertion IDs: A12.5.7-11. *
*Assertion Description: PersistenceManager.deletePersistent and deletePersistentAll will throw a JDOUserException if the parameter instance is managed by a different PersistenceManager. */ public class DeletePersistentFailsIfInstanceManagedByAnotherPersistenceManager extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.7-11 (DeletePersistentFailsIfInstanceManagedByAnotherPersistenceManager) failed: "; /** * The main 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(DeletePersistentFailsIfInstanceManagedByAnotherPersistenceManager.class); } private PCPoint p1 = null; private PCPoint p2 = null; private PCPoint p3 = null; private PCPoint p4 = null; private PCPoint p5 = null; /** */ public void testDeletePersistentFailsIfInstanceManagedByAnotherPersistenceManager() { pm = getPM(); PersistenceManager pm2 = getPMF().getPersistenceManager(); try { createObjects(pm2); /* positive tests */ runTestDeletePersistent(pm); runTestDeletePersistentAll1(pm); runTestDeletePersistentAll2(pm); } finally { cleanupPM(pm2); pm2 = null; cleanupPM(pm); pm = null; } } /** */ private void createObjects(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); p1 = new PCPoint(1,3); p2 = new PCPoint(2,4); p3 = new PCPoint(3,5); p4 = new PCPoint(4,6); p5 = new PCPoint(5,7); pm.makePersistent(p1); pm.makePersistent(p2); pm.makePersistent(p3); pm.makePersistent(p4); pm.makePersistent(p5); tx.commit(); } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /* test deletePersistent (Object pc) */ private void runTestDeletePersistent(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); try { pm.deletePersistent(p1); fail(ASSERTION_FAILED, "pm.deletePersistent(Object) with pc instance managed by another pm should throw exception"); } catch (JDOUserException ex) { // expected exception } tx.rollback(); } finally { if (tx.isActive()) tx.rollback(); } } /* test deletePersistentAll (Collection pcs) */ private void runTestDeletePersistentAll1(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); Collection col1 = new HashSet(); col1.add(p2); col1.add(p3); try { pm.deletePersistentAll(col1); fail(ASSERTION_FAILED, "pm.deletePersistent(Collection) with pc instance(s) managed by another pm should throw exception"); } catch (JDOUserException ex) { // expected exception } tx.rollback(); } finally { if (tx.isActive()) tx.rollback(); } } /* test deletePersistentAll (Object[] o) */ private void runTestDeletePersistentAll2(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); Collection col1 = new HashSet(); col1.add(p4); col1.add(p5); Object[] obj1= col1.toArray(); try { pm.deletePersistentAll(obj1); fail(ASSERTION_FAILED, "pm.deletePersistent(Object[]) with pc instance(s) managed by another pm should throw exception"); } catch (JDOUserException ex) { // expected exception } tx.rollback(); } finally { if (tx.isActive()) tx.rollback(); } } } ././@LongLink100644 0 0 152 12500111677 10251 Lustar 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanager/DeletePersistentHasNoEffectOnDeletedInstances.javatck/src/java/org/apache/jdo/tck/api/persistencemanager/DeletePersistentHasNoEffectOnDeletedInstances100664 11735 12500110374 34315 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager; import java.util.Collection; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: DeletePersistent Has No Effect On Deleted Instances *
*Keywords: *
*Assertion IDs: A12.5.7-10. *
*Assertion Description: PersistenceManager.deletePersistent and deletePersistentAll have no effect on parameter instances already deleted in the transaction. */ public class DeletePersistentHasNoEffectOnDeletedInstances extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.7-10 (DeletePersistentHasNoEffectOnDeletedInstances) failed: "; /** * The main 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(DeletePersistentHasNoEffectOnDeletedInstances.class); } private PCPoint p1 = null; private PCPoint p2 = null; private PCPoint p3 = null; private PCPoint p4 = null; private PCPoint p5 = null; /** */ public void testDeletePersistentHasNoEffectOnDeletedInstances() { pm = getPM(); createObjects(pm); runTestDeletePersistent(pm); runTestDeletePersistentAll1(pm); runTestDeletePersistentAll2(pm); pm.close(); pm = null; } /** */ private void createObjects(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); p1 = new PCPoint(1,3); p2 = new PCPoint(2,4); p3 = new PCPoint(3,5); p4 = new PCPoint(4,6); p5 = new PCPoint(5,7); pm.makePersistent(p1); pm.makePersistent(p2); pm.makePersistent(p3); pm.makePersistent(p4); pm.makePersistent(p5); tx.commit(); } finally { if (tx.isActive()) tx.rollback(); } } /* test makePersistent (Object pc) */ private void runTestDeletePersistent(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); pm.deletePersistent(p1); pm.deletePersistent(p1); pm.deletePersistent(p1); pm.deletePersistent(p1); tx.commit(); if (debug) logger.debug(" \nPASSED in testDeletePersistent()"); } finally { if (tx.isActive()) tx.rollback(); } } /* test makePersistentAll (Collection pcs) */ private void runTestDeletePersistentAll1(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx = pm.currentTransaction(); Collection col1 = new java.util.HashSet(); col1.add(p2); col1.add(p3); tx.begin(); pm.deletePersistentAll(col1); pm.deletePersistentAll(col1); pm.deletePersistentAll(col1); pm.deletePersistentAll(col1); tx.commit(); if (debug) logger.debug(" \nPASSED in testDeletePersistentAll1()"); } finally { if (tx.isActive()) tx.rollback(); } } /* test makePersistentAll (Object[] o) */ private void runTestDeletePersistentAll2(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { Collection col1 = new java.util.HashSet(); col1.add(p4); col1.add(p5); Object[] obj1= col1.toArray(); tx.begin(); pm.deletePersistentAll(obj1); pm.deletePersistentAll(obj1); pm.deletePersistentAll(obj1); pm.deletePersistentAll(obj1); tx.commit(); if (debug) logger.debug(" \nPASSED in testDeletePersistentAll2()"); } finally { if (tx.isActive()) tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/detach/CopyOnAttachFalse.java100664 6715 12500110374 30771 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.detach; import javax.jdo.JDOUserException; import org.apache.jdo.tck.pc.shoppingcart.Cart; import org.apache.jdo.tck.util.BatchTestRunner; /** * Title: Test DetachAttach *
* Keywords: makePersistent detach *
* Assertion IDs: *
* Assertion Description: * A12.6.8-29 [If the CopyOnAttach property is false, then the instance itself is transitioned to persistent-clean for datastore transactions or persistent-nontransactional for optimistic transactions. If there already is an instance in the cache with the same identity, JDOUserException is thrown.] */ public class CopyOnAttachFalse extends DetachTest { private static final String ASSERTION_FAILED = "Assertion A12.6.8 (CopyOnAttachFalse) failed: "; /** * The main 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(CopyOnAttachFalse.class); } /** */ /** */ public void testAttachClean() { Cart detachedCart = createDetachedInstance(ASSERTION_FAILED); pm.setCopyOnAttach(false); pm.currentTransaction().begin(); Cart attachedCart = (Cart)pm.makePersistent(detachedCart); assertTrue("Expected attached object to == detached object.", attachedCart == detachedCart); pm.currentTransaction().commit(); } /** */ public void testAttachDirty() { Cart detachedCart = createDetachedInstance(ASSERTION_FAILED); pm.setCopyOnAttach(false); pm.currentTransaction().begin(); cartEntry1.setQuantity(500); goldenCartEntry.setQuantity(500); Cart attachedCart = (Cart)pm.makePersistent(detachedCart); assertTrue("Expected attached object to == detached object.", attachedCart == detachedCart); pm.currentTransaction().commit(); } /** */ public void testNegativeAttachClean() { Cart detachedCart = createDetachedInstance(ASSERTION_FAILED); pm.setCopyOnAttach(false); pm.currentTransaction().begin(); // Obtain new instance of cart1 pm.getObjectById(cart1oid, false); try { Cart attachedCart = (Cart)pm.makePersistent(detachedCart); fail("Expected JDOUserException. Object with same identity as " + "attached object is already in the cache."); } catch (JDOUserException jdoe) { // expected exception } pm.currentTransaction().commit(); } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/detach/DetachAccessUnloadedField.java100664 12474 12500110374 32433 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.detach; import javax.jdo.FetchPlan; import javax.jdo.JDODetachedFieldAccessException; import org.apache.jdo.tck.pc.shoppingcart.CartEntry; import org.apache.jdo.tck.pc.shoppingcart.Product; import org.apache.jdo.tck.util.BatchTestRunner; /** * Title: Test DetachCopy *
* Keywords: detachCopy detach *
* Assertion IDs: A12.6.8-21 *
* Assertion Description: * While detached, any field access to a field that was not loaded throws JDODetachedFieldAccessException. */ public class DetachAccessUnloadedField extends DetachTest { private static final String ASSERTION_FAILED = "Assertion A12.6.8-21 (DetachCopy) failed: "; /** * The main 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(DetachAccessUnloadedField.class); } /** * Positive test for field access of detached instance * Field is in fetch group, * loaded at detachment with DETACH_LOAD_FIELDS true */ public void testDetachCopyFieldAccessOk() { // datastore transaction, retainValues=false getPM().currentTransaction().begin(); // sets fetch group cart, entries, product setCartFetchGroups(); // DETACH_LOAD_FIELDS true by default CartEntry cartEntryDetached = (CartEntry)pm.detachCopy(cartEntry1); try { Product prod = cartEntryDetached.getProduct(); } catch (JDODetachedFieldAccessException jdoex) { fail("Unexpected exception caught: " + jdoex.getMessage()); } pm.currentTransaction().commit(); } /** * Positive test for access of loaded field of detached instance * All fields are in the fetch plan * detachment options = 0, fields loaded by access of an instance */ public void testDetachCopyAccessLoadedField() { // datastore transaction, retainValues=false getPM().currentTransaction().begin(); // sets fetch group cart, entries, product setCartFetchGroups(); // loads Product field int quantity = cartEntry1.getQuantity(); pm.getFetchPlan().setDetachmentOptions(0); CartEntry cartEntryDetached = (CartEntry)pm.detachCopy(cartEntry1); try { Product prodDetached = cartEntryDetached.getProduct(); } catch (JDODetachedFieldAccessException jdoex) { fail("Unexpected exception caught: " + jdoex.getMessage()); } finally { pm.currentTransaction().commit(); } } /** * Negative test for access of unloaded field of detached instance * with DETACH_UNLOAD_FIELDS set */ public void testDetachCopyAccessUnloadedField() { // datastore transaction, retainValues=false getPM().currentTransaction().begin(); // sets fetch group cart, entries, product setCartFetchGroups(); Product prod = cartEntry1.getProduct(); pm.getFetchPlan().removeGroup(CARTENTRY_PRODUCT); pm.getFetchPlan().setDetachmentOptions(FetchPlan.DETACH_UNLOAD_FIELDS); CartEntry cartEntryDetached = (CartEntry)pm.detachCopy(cartEntry1); try { Product prodDetached = cartEntryDetached.getProduct(); fail("Expected exception on access of unloaded field, " + "but none thrown."); } catch (JDODetachedFieldAccessException jdoex) { // expect exception } finally { pm.currentTransaction().commit(); } } /** * Negative test for access of field of detached instance * where field was not loaded */ public void testDetachCopyAccessFieldNotInFetchPlan() { // datastore transaction, retainValues=false getPM().currentTransaction().begin(); FetchPlan fp = pm.getFetchPlan(); // Product field not in Fetch Plan fp.addGroup(CART_ENTRIES); fp.addGroup(CARTENTRY_CART); CartEntry cartEntryDetached = (CartEntry)pm.detachCopy(cartEntry1); try { Product prod = cartEntryDetached.getProduct(); fail("Expected exception on access of field not in fetch plan" + " and not loaded, but none thrown."); } catch (JDODetachedFieldAccessException jdoex) { // expect exception } finally { pm.currentTransaction().commit(); } } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/detach/DetachAllOnCommit.java100664 5517 12500110374 30750 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.detach; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.util.Collection; import java.util.HashSet; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.shoppingcart.Cart; import org.apache.jdo.tck.util.BatchTestRunner; /** * Title: Test DetachAllOnCommit *
* Keywords: DetachAllOnCommit detach *
* Assertion IDs: A12.6.8-3 *
* Assertion Description: With this flag set to true, during beforeCompletion all cached instances are prepared for detachment according to the fetch plan in effect at commit. Loading fields and unload- ing fields required by the fetch plan is done after calling the user's beforeCompletion callback. During afterCompletion, before calling the user's afterCompletion callback, all detachable persistent instances in the cache transition to detached; non-detachable persistent instances transition to transient; and detachable instances can be serialized as detached instances. Transient transactional instances are unaffected by this flag. */ public class DetachAllOnCommit extends DetachTest { private static final String ASSERTION_FAILED = "Assertion A12.6.8-3 (DetachAllOnCommit) failed: "; /** * The main 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(DetachAllOnCommit.class); } /** */ public void testDetachAllOnCommit() { getPM().currentTransaction().begin(); setCartFetchGroups(); pm.retrieveAll(cartClosure); pm.setDetachAllOnCommit(true); pm.currentTransaction().commit(); checkCartValues(ASSERTION_FAILED + "after commit with DetachAllOnCommit," + NL, cart1); failOnError(); } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/detach/DetachAttach.java100664 4476 12500110374 30001 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.detach; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.util.Collection; import java.util.HashSet; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.shoppingcart.Cart; import org.apache.jdo.tck.util.BatchTestRunner; /** * Title: Test DetachAttach *
* Keywords: makePersistent detach *
* Assertion IDs: *
* Assertion Description: For a detached instance, they locate or create a persistent instance with the same JDO identity as the detached instance */ public class DetachAttach extends DetachTest { private static final String ASSERTION_FAILED = "Assertion A12.6.8 (DetachAttach) failed: "; /** * The main 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(DetachAttach.class); } /** */ public void testAttachClean() { Cart detachedCart = createDetachedInstance(ASSERTION_FAILED); pm.currentTransaction().begin(); Cart attachedCart = (Cart)pm.makePersistent(detachedCart); checkCartValues(ASSERTION_FAILED + "after attach," + NL, attachedCart, true); pm.currentTransaction().commit(); failOnError(); } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/detach/DetachAttachDirty.java100664 5455 12500110374 31013 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.detach; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.util.Collection; import java.util.HashSet; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.shoppingcart.Cart; import org.apache.jdo.tck.util.BatchTestRunner; /** * Title: Test DetachAttach *
* Keywords: makePersistent detach dirty *
* Assertion IDs: A12.6.8-26 *
* Assertion Description: For a detached instance, they locate or create a persistent instance with the same JDO identity as the detached instance, and merge the persistent state of the detached instance into the persistent instance. */ public class DetachAttachDirty extends DetachTest { private static final String ASSERTION_FAILED = "Assertion A12.6.8-26 (DetachAttachDirty) failed: "; /** * The main 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(DetachAttach.class); } /** */ public void testAttachDirty() { Cart detachedCart = createDetachedInstance(ASSERTION_FAILED); pm.currentTransaction().begin(); cartEntry1.setQuantity(500); goldenCartEntry.setQuantity(500); Cart attachedCart = (Cart)pm.makePersistent(detachedCart); checkCartValues(ASSERTION_FAILED + "after attach," + NL, attachedCart, true); pm.currentTransaction().commit(); pm.currentTransaction().begin(); Cart persistentCart = (Cart)pm.getObjectById(cart1oid); checkCartValues(ASSERTION_FAILED + "after attach, commit, begin, getObjectById," + NL, persistentCart, true); pm.currentTransaction().commit(); failOnError(); } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/detach/DetachCopy.java100664 7264 12500110374 27505 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.detach; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.util.Collection; import java.util.HashSet; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.shoppingcart.Cart; import org.apache.jdo.tck.util.BatchTestRunner; /** * Title: Test DetachCopy *
* Keywords: detachCopy detach *
* Assertion IDs: A12.6.8-13, A12.6.8-18, A12.6.8-19, A12.6.8-20 *
* Assertion Description: For each instance in the parameter Collection, a corresponding detached copy is returned. Each field in the persistent instance is handled based on its type and whether the field is contained in the fetch group for the persistence-capable class. If there are duplicates in the parameter Collection, the corresponding detached copy is used for each such duplicate. */ public class DetachCopy extends DetachTest { private static final String ASSERTION_FAILED = "Assertion A12.6.8-13, A12.6.8-18, A12.6.8-19, A12.6.8-20" + " (DetachCopy) failed: "; /** * The main 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(DetachCopy.class); } /** */ public void testDetachCopy() { getPM().currentTransaction().begin(); setCartFetchGroups(); //pm.retrieveAll(cartClosure); Cart cartDetached = (Cart)pm.detachCopy(cart1); checkCartValues(ASSERTION_FAILED + "after detachCopy," + NL, cartDetached); pm.currentTransaction().commit(); failOnError(); } /** */ public void testDetachCopyAllCollection() { getPM().currentTransaction().begin(); setCartFetchGroups(); //pm.retrieveAll(cartClosure); Collection instances = new HashSet(); instances.add(cart1); Collection detached = pm.detachCopyAll(instances); Cart cartDetached = (Cart)detached.iterator().next(); checkCartValues(ASSERTION_FAILED + "after detachCopyAll(Collection)," + NL, cartDetached); pm.currentTransaction().commit(); failOnError(); } /** */ public void testDetachCopyAllArray() { getPM().currentTransaction().begin(); setCartFetchGroups(); //pm.retrieveAll(cartClosure); Object[] instances = new Object[]{cart1}; Object[] detached = pm.detachCopyAll(instances); Cart cartDetached = (Cart)detached[0]; checkCartValues(ASSERTION_FAILED + "after detachCopyAll(Object[])," + NL, cartDetached); pm.currentTransaction().commit(); failOnError(); } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/detach/DetachSerialize.java100664 7340 12500110374 30515 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.detach; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.shoppingcart.Cart; import org.apache.jdo.tck.util.BatchTestRunner; /** * Title: Test DetachSerialize *
* Keywords: serialize detach *
* Assertion IDs: A12.6.8-4, A12.6.8-5 *
* Assertion Description: The JDO 1.0 specification requires that serialized instances be made ready for serialization by instantiating all serializable persistent fields before calling writeObject. For binary- compatible implementations, this is done by the enhancer adding a call to the StateManager prior to invoking the user's writeObject method. The behavior is the same in JDO 2.0, with the additional requirement that restored detachable serialized instances are treated as detached instances. */ public class DetachSerialize extends DetachTest { private static final String ASSERTION_FAILED = "Assertion A12.6.8-4, A12.6.8-5 (DetachSerialize) failed: "; /** * The main 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(DetachSerialize.class); } /** */ public void testDetachSerialize() { getPM().currentTransaction().begin(); setCartFetchGroups(); //pm.retrieveAll(cartClosure); Cart cartDetached = (Cart)detachClosure(cart1); checkCartValues(ASSERTION_FAILED + "after deserializing cart," + NL, cartDetached); pm.currentTransaction().commit(); failOnError(); } /** Detach the parameter instance. */ protected Object detachClosure(Object pc) { byte[] cartStream = serialize(pc); return deserialize(cartStream); } /** */ private byte[] serialize(Object root) { try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(baos); oos.writeObject(root); return baos.toByteArray(); } catch (Exception ex) { fail(ASSERTION_FAILED + "serializing cart:" + ex.toString()); return null; // will not be reached } } private Object deserialize(byte[] stream) { try { ByteArrayInputStream bais = new ByteArrayInputStream(stream); ObjectInputStream ois = new ObjectInputStream(bais); return ois.readObject(); } catch (Exception ex) { fail(ASSERTION_FAILED + "deserializing cart:" + ex.toString()); return null; // will not be reached } } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/detach/DetachTest.java100664 15105 12500110374 27523 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.detach; import java.util.Iterator; import javax.jdo.FetchPlan; import javax.jdo.JDOHelper; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.shoppingcart.CartEntry; import org.apache.jdo.tck.pc.shoppingcart.Cart; import org.apache.jdo.tck.pc.shoppingcart.Product; import org.apache.jdo.tck.pc.shoppingcart.Undetachable; import javax.jdo.PersistenceManager; /** * */ public abstract class DetachTest extends JDO_Test { protected Cart cart1; protected CartEntry cartEntry1; protected Product product1; protected Object cart1oid; protected Cart goldenCart; protected CartEntry goldenCartEntry; protected Object[] cartClosure; protected final static String CART_ENTRIES = "Cart.entries"; protected final static String CARTENTRY_CART = "CartEntry.cart"; protected final static String CARTENTRY_PRODUCT = "CartEntry.product"; protected final static String[] CART_FETCH_GROUPS = new String[] {FetchPlan.DEFAULT, CART_ENTRIES, CARTENTRY_CART, CARTENTRY_PRODUCT}; /** Creates a new instance of DetachTest */ public DetachTest() { } /** */ protected void localSetUp() { addTearDownClass(CartEntry.class); addTearDownClass(Cart.class); addTearDownClass(Product.class); addTearDownClass(Undetachable.class); Product goldenProduct = new Product("PRODUCT1", "Product 1"); goldenCart = new Cart("142857"); goldenCartEntry = goldenCart.newCartEntry(goldenProduct, 100); product1 = new Product("PRODUCT1", "Product 1"); cart1 = new Cart("142857"); cartEntry1 = new CartEntry( cart1, goldenCartEntry.getId(), product1, 100); cartClosure = new Object[] {cart1, cartEntry1, product1}; getPM().currentTransaction().begin(); pm.makePersistent(cart1); cart1oid = pm.getObjectId(cart1); pm.currentTransaction().commit(); } /** */ protected void setCartFetchGroups() { FetchPlan fp = getPM().getFetchPlan(); fp.setGroups(CART_FETCH_GROUPS); fp.setMaxFetchDepth(2); } /** */ protected void checkState(String location, Object obj, boolean persistent) { if(persistent) { if (JDOHelper.isPersistent(obj)) return; } else if (JDOHelper.isDetached(obj)) return; appendMessage(location + " should be " + (persistent?"persistent":"detached") + " but is not. The object state is: " + states[currentState(obj)] + " " + getStateOfInstance(obj)); } /** */ protected void reportDifference(String location, long expected, long actual) { appendMessage(location + NL + "expected: " + expected + NL + "actual: " + actual); } /** */ protected void reportDifference(String location, Object expected, Object actual) { appendMessage(location + NL + "expected: " + expected + NL + " actual: " + actual); } /** */ protected void checkCartValues(String location, Cart cart) { checkCartValues(location, cart, false); } /** */ protected void checkCartValues(String location, Cart cart, boolean persistent) { checkState(location + "Cart instance", cart, persistent); if (!goldenCart.getCustomerId().equals(cart.getCustomerId())) reportDifference(location + " differences in cart.customerId", goldenCart.getCustomerId(), cart.getCustomerId()); Iterator goldenCartEntries = goldenCart.getEntries(); Iterator cartEntries = cart.getEntries(); while (cartEntries.hasNext()) { CartEntry goldenCartEntry = (CartEntry)goldenCartEntries.next(); CartEntry cartEntry = (CartEntry)cartEntries.next(); checkState(location + "CartEntry instance", cartEntry, persistent); Cart cartEntryCart = cartEntry.getCart(); if (cartEntryCart != cart) { reportDifference(location + " incorrect value for cartEntry.cart", cart, cartEntryCart); } if (goldenCartEntry.getId() != cartEntry.getId()) reportDifference(location + " differences in cartEntry.id", goldenCartEntry.getId(), cartEntry.getId()); if (goldenCartEntry.getQuantity() != cartEntry.getQuantity()) reportDifference(location + " differences in cartEntry.quantity", goldenCartEntry.getQuantity(), cartEntry.getQuantity()); Product goldenProduct = goldenCartEntry.getProduct(); Product product = cartEntry.getProduct(); checkState(location + "Product instance", product, persistent); if (!goldenProduct.getDescription() .equals(product.getDescription())) reportDifference(location + " differences in product.description", goldenProduct.getDescription(), product.getDescription()); } } /** */ protected Cart createDetachedInstance(String ASSERTION_FAILED) { getPM().currentTransaction().begin(); setCartFetchGroups(); pm.retrieveAll(cartClosure); pm.setDetachAllOnCommit(true); pm.currentTransaction().commit(); checkCartValues(ASSERTION_FAILED + "after commit with DetachAllOnCommit,", cart1); failOnError(); pm.setDetachAllOnCommit(false); return cart1; } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/detach/DetachUndetachable.java100664 5022 12500110374 31140 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.detach; import javax.jdo.JDOHelper; import org.apache.jdo.tck.pc.shoppingcart.Undetachable; import org.apache.jdo.tck.util.BatchTestRunner; /** * Title: Test DetachUndetachable *
* Keywords: detachCopy detach detachable *
* Assertion IDs: A12.6.8-32 *
* Assertion Description: Instances to be detached that are not of a Detachable class are detached as transient instances. */ public class DetachUndetachable extends DetachTest { private static final String ASSERTION_FAILED = "Assertion A12.6.8-32 (DetachUndetachable) failed: "; protected Undetachable un1; /** * The main 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(DetachUndetachable.class); } /** */ public void testDetachUndetachable() { setupUndetachable(); getPM().currentTransaction().begin(); Undetachable instance = (Undetachable)pm.detachCopy(un1); if (JDOHelper.isPersistent((Object)instance)) { appendMessage("testDetachUndetachable: should be transient" + " but is not. The object state is: " + states[currentState((Object)instance)] + " " + getStateOfInstance((Object)instance)); } pm.currentTransaction().commit(); failOnError(); } protected void setupUndetachable() { un1 = new Undetachable(); getPM().currentTransaction().begin(); pm.makePersistent(un1); pm.currentTransaction().commit(); } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/detach/SetDetachAllOnCommit.java100664 5143 12500110374 31417 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.detach; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** * Title: Test SetDetachAllOnCommit *
* Keywords: DetachAllOnCommit commit detach *
* Assertion IDs: A12.6.8-1, A12.6.8-2 *
* Assertion Description: * We define a new property called DetachAllOnCommit * PersistenceManager.setDetachAllOnCommit(boolean detachAllOnCommit) * sets the DetachAllOnCommit property * PersistenceManager.getDetachAllOnCommit() * The value of the DetachAllOnCommit flag is returned. */ public class SetDetachAllOnCommit extends DetachTest { private static final String ASSERTION_FAILED = "Assertion A12.6.8-1 (pm.setDetachAllOnCommit) failed: "; /** * The main 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(SetDetachAllOnCommit.class); } /** */ public void test() { pm = getPM(); runTestSetDetachAllOnCommit(pm); pm.close(); pm = null; } /** */ protected void runTestSetDetachAllOnCommit(PersistenceManager pm) { pm.setDetachAllOnCommit(false); if (pm.getDetachAllOnCommit()) { fail(ASSERTION_FAILED, "pm.getDetachAllOnCommit() should return false after setting the flag to false."); } pm.setDetachAllOnCommit(true); if (!pm.getDetachAllOnCommit()) { fail(ASSERTION_FAILED, "pm.getDetachAllOnCommit() should return true after setting the flag to true."); } } } ././@LongLink100644 0 0 167 12500111677 10257 Lustar 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanager/extent/GetExtentWithInstancesMadePersistentViaReachability.javatck/src/java/org/apache/jdo/tck/api/persistencemanager/extent/GetExtentWithInstancesMadePersistentVi100664 10131 12500110374 34406 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.extent; import java.util.Iterator; import java.util.Date; import javax.jdo.Extent; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; import org.apache.jdo.tck.pc.company.Company; import org.apache.jdo.tck.pc.company.Department; import org.apache.jdo.tck.pc.company.Address; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: GetExtentWithInstancesMadePersistentViaReachability *
*Keywords: inheritance extent *
*Assertion ID: A12.5.4-1. *
*Assertion Description: If an instance of a class or interface that has a managed extent is made persistent via reachability, the instance is put into the extent implicitly. */ public class GetExtentWithInstancesMadePersistentViaReachability extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.4-3 (GetExtentWithInstancesMadePersistentViaReachability) failed: "; /** * The main 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(GetExtentWithInstancesMadePersistentViaReachability.class); } /** */ public void test() { pm = getPM(); createObjects(pm); runTest(pm); } /** */ private void createObjects(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); tx.begin(); Company comp = new Company(1L, "Sun Microsystems", new Date(), new Address(0,"","","","","")); pm.makePersistent(comp); //Add transient departments comp.addDepartment(new Department(1L, "Department 1")); comp.addDepartment(new Department(2L, "Department 2")); comp.addDepartment(new Department(3L, "Department 3")); tx.commit(); //Now the transient departments should be made persistent via reachability } /** */ private void runTest(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); tx.begin(); Extent e = pm.getExtent(Department.class, false); boolean foundDep1 = false; boolean foundDep2 = false; boolean foundDep3 = false; for (Iterator i = e.iterator(); i.hasNext();) { Department dep = (Department) i.next(); if (dep.getName().equals("Department 1")) foundDep1=true; else if (dep.getName().equals("Department 2")) foundDep2=true; else if (dep.getName().equals("Department 3")) foundDep3=true; } if (!foundDep1) { fail(ASSERTION_FAILED, "Extent of class " + Department.class.getName() + " does not include instance with deptid 1L"); } if (!foundDep2) { fail(ASSERTION_FAILED, "Extent of class " + Department.class.getName() + " does not include instance with deptid 2L"); } if (!foundDep3) { fail(ASSERTION_FAILED, "Extent of class " + Department.class.getName() + " does not include instance with deptid 3L"); } tx.commit(); } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/extent/GetExtentWithNoSubclasses.java100664 7062 12500110374 32625 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.extent; import java.util.Iterator; import javax.jdo.Extent; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; /** *Title: GetExtentWithNoSubclasses *
*Keywords: inheritance extent *
*Assertion ID: A12.5.4-2. *
*Assertion Description: The getExtent method returns an Extent that contains all of the instances in the parameter class. With the subclasses parameter false, only instances of the specified class are returned. */ public class GetExtentWithNoSubclasses extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.4-2 (GetExtentWithNoSubclasses) failed: "; /** * The main 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(GetExtentWithNoSubclasses.class); } private PCPoint p1 = null; private PCPoint p2 = null; /** */ public void testGetExtentWithNoSubclasses() { pm = getPM(); createObjects(pm); runTestGetExtent(pm); pm.close(); pm = null; } /** */ private void createObjects(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); PCPoint p1 = new PCPoint (1,3); PCPoint p2 = new PCPoint (3,5); pm.makePersistent(p1); pm.makePersistent(p2); tx.commit(); } finally { if (tx.isActive()) tx.rollback(); } } /** */ private void runTestGetExtent(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); Extent e = pm.getExtent(PCPoint.class, false); int c = 0; for (Iterator i = e.iterator(); i.hasNext();) { PCPoint p = (PCPoint) i.next(); if (debug) logger.debug("p.getX() = " + p.getX()); if ((p.getX() == 1) || (p.getX() == 3)) { // OK } else { fail(ASSERTION_FAILED, "Extent of class " + PCPoint.class.getName() + " includes unexpected instance, p.getX():" + p.getX()); } } tx.commit(); } finally { if (tx.isActive()) tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/extent/GetExtentWithSubclasses.java100664 12262 12500110374 32346 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.extent; import java.util.Date; import java.util.Iterator; import javax.jdo.Extent; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.pc.company.FullTimeEmployee; import org.apache.jdo.tck.pc.company.PartTimeEmployee; import org.apache.jdo.tck.pc.company.Person; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: GetExtentWithSubclasses *
*Keywords: inheritance extent *
*Assertion ID: A12.5.4-3. *
*Assertion Description: The getExtent method returns an Extent that contains all of the instances in the parameter class or interface, and if the subclasses flag is true, all of the instances of the parameter class and its subclasses. */ public class GetExtentWithSubclasses extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.4-3 (GetExtentWithSubclasses) failed: "; /** * The main 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(GetExtentWithSubclasses.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(FullTimeEmployee.class); addTearDownClass(PartTimeEmployee.class); addTearDownClass(Person.class); super.localSetUp(); } /** */ public void test() { pm = getPM(); createObjects(pm); runTest(pm); } /** */ private void createObjects(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); tx.begin(); Date date = new Date(); Person p1 = new Person(1L, "Craig", "Russell", null, date, null); Employee p2 = new FullTimeEmployee(2L, "Michael", "Bouschen", null, date, null, date, 0.0); Employee p3 = new PartTimeEmployee(3L, "Michelle", "Caisse", null, date, null, date, 0.0); Employee p4 = new FullTimeEmployee(4L, "Victor", "Kirkebo", null, date, null, date, 0.0); pm.makePersistent(p1); pm.makePersistent(p2); pm.makePersistent(p3); pm.makePersistent(p4); tx.commit(); } /** */ private void runTest(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); tx.begin(); Extent e = pm.getExtent(Person.class, true); boolean foundCraig = false; boolean foundMichael = false; boolean foundMichelle = false; boolean foundVictor = false; for (Iterator i = e.iterator(); i.hasNext();) { Person p = (Person) i.next(); if ((p.getFirstname().equals("Craig")) && (p.getLastname().equals("Russell"))) foundCraig=true; else if ((p.getFirstname().equals("Michael")) && (p.getLastname().equals("Bouschen"))) foundMichael=true; else if ((p.getFirstname().equals("Michelle")) && (p.getLastname().equals("Caisse"))) foundMichelle=true; else if ((p.getFirstname().equals("Victor")) && (p.getLastname().equals("Kirkebo"))) foundVictor=true; } if (!foundCraig) { fail(ASSERTION_FAILED, "Extent of class " + Person.class.getName() + " does not include instance of class " + Person.class.getName() + " with personid 1L"); } if (!foundMichael) { fail(ASSERTION_FAILED, "Extent of class " + Person.class.getName() + " does not include instance of class " + Employee.class.getName() + " with personid 2L"); } if (!foundMichelle) { fail(ASSERTION_FAILED, "Extent of class " + Person.class.getName() + " does not include instance of class " + PartTimeEmployee.class.getName() + " with personid 3L"); } if (!foundVictor) { fail(ASSERTION_FAILED, "Extent of class " + Person.class.getName() + " does not include instance of class " + FullTimeEmployee.class.getName() + " with personid 4L"); } tx.commit(); } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/fetchplan/AbstractFetchPlanTest.java100664 11566 12500110374 32406 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.fetchplan; import java.util.Collection; import java.util.HashSet; import javax.jdo.FetchPlan; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.pc.mylib.PCRect; import org.apache.jdo.tck.util.BatchTestRunner; /** * This class is an abstract superclass for the fetch plan tests. * It contains methods useful for testing the behavior of the * fetch plan. */ public class AbstractFetchPlanTest extends JDO_Test { /** * The main method is not defined in this abstract class. */ /** The persistent instances used in the test. */ protected PCPoint upperLeft; protected PCPoint lowerRight; protected PCRect pcrect; /** The oids of the persistent instances used in the test. */ protected Object upperLeftoid; protected Object lowerRightoid; protected Object pcrectoid; /** The String arrays used for setting fetch groups. */ protected String[] defaultGroup = new String[] {"default"}; protected String[] upperLeftGroup = new String[] {"default", "PCRect.upperLeft"}; protected String[] lowerRightGroup = new String[] {"default", "PCRect.lowerRight"}; protected String[] bothGroup = new String[]{ "default", "PCRect.upperLeft", "PCRect.lowerRight"}; /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCRect.class); addTearDownClass(PCPoint.class); upperLeft = new PCPoint(0,10); lowerRight = new PCPoint(10,0); pcrect = new PCRect(upperLeft, lowerRight); getPM().currentTransaction().begin(); pm.makePersistent(pcrect); // makes all three persistent upperLeftoid = pm.getObjectId(upperLeft); lowerRightoid = pm.getObjectId(lowerRight); pcrectoid = pm.getObjectId(pcrect); pm.currentTransaction().commit(); } /** Set the default plus upper left field as the fetch group. */ protected void setDefaultGroup() { FetchPlan fp = getPM().getFetchPlan(); fp.setGroups(defaultGroup); } /** Set the default plus upper left field as the fetch group. */ protected void setUpperLeftGroup() { FetchPlan fp = getPM().getFetchPlan(); fp.setGroups(upperLeftGroup); } /** Set the default plus lower right field as the fetch group. */ protected void setLowerRightGroup() { FetchPlan fp = getPM().getFetchPlan(); fp.setGroups(upperLeftGroup); } /** Set the default plus both fields as the fetch group. */ protected void setBothGroup() { FetchPlan fp = getPM().getFetchPlan(); fp.setGroups(bothGroup); } /** */ protected void checkBothLoaded(String location, PCRect pcrect) { checkUpperLeftLoaded(location, pcrect); checkLowerRightLoaded(location, pcrect); } /** */ protected void checkUpperLeftLoaded(String location, PCRect pcrect) { if (pcrect.upperLeft == null) { appendMessage(location + NL + "Upper Left was null." + NL + "The fetch plan includes PCRect.upperLeft and this field" + " should have been loaded."); } } /** */ protected void checkLowerRightLoaded(String location, PCRect pcrect) { if (pcrect.lowerRight == null) { appendMessage(location + NL + "Lower Right was null." + NL + "The fetch plan includes PCRect.lowerRight and this field" + " should have been loaded."); } } protected void checkGroups(String location, FetchPlan fetchPlan, String[] groups) { Collection expected = new HashSet(); Collection actual = fetchPlan.getGroups(); for (int i = 0; i < groups.length; ++i) { expected.add(groups[i]); } if (!expected.equals(actual)) { appendMessage(location + NL + "Fetch groups differ." + NL + "expected: " + expected + NL + "actual: " + actual + NL); } } }tck/src/java/org/apache/jdo/tck/api/persistencemanager/fetchplan/FetchPlanInterface.java100664 30767 12500110374 31707 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.fetchplan; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; import java.util.Set; import javax.jdo.FetchPlan; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.pc.mylib.PCRect; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Test TITLE *
*Keywords: fetch plan *
*Assertion IDs: 12.7.1-1 *
*Assertion Description: public interface FetchPlan { String DEFAULT = "default"; String ALL = "all"; int FETCH_SIZE_GREEDY = -1; int FETCH_SIZE_OPTIMAL = 0; int DETACH_LOAD_FIELDS = 1; int DETACH_UNLOAD_FIELDS = 2; A12.7.1-1 [/** Add the fetchgroup to the set of active fetch groups. Duplicate names will be removed. FetchPlan addGroup(String fetchGroupName); /** Remove the fetch group from the set active fetch groups. FetchPlan removeGroup(String fetchGroupName); /** Remove all active groups, including the default fetch group. FetchPlan clearGroups(); /** Return an immutable Set of the names of all active fetch groups. Set getGroups(); /** Set a Collection of group names to replace the current groups. Duplicate names will be removed. FetchPlan setGroups(Collection fetchGroupNames); /** Set an array of group names to replace the current groups. Duplicate names will be removed. FetchPlan setGroups(String[] fetchGroupNames); /** Set a single group to replace the current groups. FetchPlan setGroup(String fetchGroupName);] /** Set the roots for DetachAllOnCommit FetchPlan setDetachmentRoots(Collection roots); /** Get the roots for DetachAllOnCommit Collection getDetachmentRoots(); /** Set the roots for DetachAllOnCommit FetchPlan setDetachmentRootClasses(Class[] rootClasses); /** Get the roots for DetachAllOnCommit Class[] getDetachmentRootClasses(); /** Set the maximum fetch depth. FetchPlan setMaxFetchDepth(int fetchDepth); /** Get the maximum fetch depth. int getMaxFetchDepth(); A12.7.1-2 [/** Set the fetch size for large result set support. FetchPlan setFetchSize(int fetchSize); /** Return the fetch size; 0 if not set; -1 for greedy fetching. int getFetchSize();] A12.7.1-3 [/** Set detachment options FetchPlan setDetachmentOptions(int options); /** Return the detachment options int getDetachmentOptions();] */ public class FetchPlanInterface extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion 12.7.1-1 (FetchPlanTest) failed: "; /** * The main 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(FetchPlanInterface.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCRect.class); addTearDownClass(PCPoint.class); } /** */ protected boolean setEquals (Collection expected, Collection actual) { if (expected == actual) return true; if (expected == null || actual == null) return false; Set expectedSet = new HashSet(expected); Set actualSet = new HashSet(actual); return expectedSet.equals(actualSet); } /** */ protected void failCompare(String message, Object expected, Object actual) { appendMessage(ASSERTION_FAILED + message); appendMessage("expected: " + expected); appendMessage("actual: " + actual); } /** */ protected void failCompare(String message, int expected, int actual) { appendMessage(ASSERTION_FAILED + message); appendMessage("expected: " + expected); appendMessage("actual: " + actual); } /** */ public void testGroups() { checkDefaultGroups(); checkClearGroups(); checkSetGroup(); checkAddGroup(); checkRemoveGroup(); checkClearGroups(); checkSetGroupsCollection(); checkSetGroupsArray(); failOnError(); } /** */ public void testDetachmentRoots() { checkGetDetachmentRoots(); checkSetDetachmentRoots(); checkSetDetachmentRootClasses(); failOnError(); } /** */ public void testDetachmentOptions() { int expectedOptions = FetchPlan.DETACH_LOAD_FIELDS + FetchPlan.DETACH_UNLOAD_FIELDS; FetchPlan fp = getPM().getFetchPlan(); int initialOptions = fp.getDetachmentOptions(); if (FetchPlan.DETACH_LOAD_FIELDS != initialOptions) { failCompare( "testDetachmentOptions(): wrong getDetachmentOptions() " + "after getPersistenceManager().", FetchPlan.DETACH_LOAD_FIELDS, initialOptions); } fp.setDetachmentOptions(expectedOptions); int actualOptions = fp.getDetachmentOptions(); if (expectedOptions != actualOptions) { failCompare( "testDetachmentOptions(): wrong getDetachmentOptions() " + "after setDetachmentOptions().", expectedOptions, actualOptions); } cleanupPM(); failOnError(); } /** */ public void testMaxFetchDepth() { int expectedMaxFetchDepth = 12; FetchPlan fp = getPM().getFetchPlan(); fp.setMaxFetchDepth(expectedMaxFetchDepth); int actualMaxFetchDepth = fp.getMaxFetchDepth(); if (expectedMaxFetchDepth != actualMaxFetchDepth) { failCompare( "testMaxFetchDepth(): wrong getMaxFetchDepth() " + "after setMaxFetchDepth().", expectedMaxFetchDepth, actualMaxFetchDepth); } cleanupPM(); failOnError(); } /** */ public void testFetchSize() { int expectedFetchSize = 12; FetchPlan fp = getPM().getFetchPlan(); fp.setFetchSize(expectedFetchSize); int actualFetchSize = fp.getFetchSize(); if (expectedFetchSize != actualFetchSize) { failCompare( "testFetchSize(): wrong getFetchSize() " + "after setFetchSize().", expectedFetchSize, actualFetchSize); } cleanupPM(); failOnError(); } /** */ public void checkDefaultGroups() { Set expectedGroups = new HashSet(); expectedGroups.add("default"); FetchPlan fp = getPM().getFetchPlan(); Collection groups = fp.getGroups(); if (!setEquals(expectedGroups, groups)) { failCompare( "checkDefaultGroups(): wrong getGroups() " + "after getPersistenceManager().", expectedGroups, groups); } cleanupPM(); } /** */ public void checkClearGroups() { Set expectedGroups = new HashSet(); FetchPlan fp = getPM().getFetchPlan(); fp.clearGroups(); Collection groups = fp.getGroups(); if (!setEquals(expectedGroups, groups)) { failCompare( "checkClearGroups(): wrong getGroups() " + "after clearGroups.", expectedGroups, groups); } cleanupPM(); } /** */ public void checkSetGroup() { Set expectedGroups = new HashSet(); expectedGroups.add("group1"); FetchPlan fp = getPM().getFetchPlan(); fp.setGroup("group1"); Collection groups = fp.getGroups(); if (!setEquals(expectedGroups, groups)) { failCompare( "checkSetGroup(): wrong getGroups() " + "after setGroup.", expectedGroups, groups); } cleanupPM(); } /** */ public void checkAddGroup() { Set expectedGroups = new HashSet(); expectedGroups.add("default"); expectedGroups.add("group1"); FetchPlan fp = getPM().getFetchPlan(); fp.addGroup("group1"); Collection groups = fp.getGroups(); if (!setEquals(expectedGroups, groups)) { failCompare( "checkAddGroup(): wrong getGroups() " + "after addGroup.", expectedGroups, groups); } cleanupPM(); } /** */ public void checkRemoveGroup() { Set expectedGroups = new HashSet(); FetchPlan fp = getPM().getFetchPlan(); fp.removeGroup("default"); Collection groups = fp.getGroups(); if (!setEquals(expectedGroups, groups)) { failCompare( "checkRemoveGroup(): wrong getGroups() " + "after removeGroup.", expectedGroups, groups); } cleanupPM(); } /** */ public void checkSetGroupsCollection() { Set expectedGroups = new HashSet(); expectedGroups.add("default"); expectedGroups.add("group1"); expectedGroups.add("group2"); FetchPlan fp = getPM().getFetchPlan(); fp.setGroups(expectedGroups); Collection groups = fp.getGroups(); if (!setEquals(expectedGroups, groups)) { failCompare( "checkSetGroupsCollection(): wrong getGroups() " + "after SetGroups(Collection).", expectedGroups, groups); } cleanupPM(); } /** */ public void checkSetGroupsArray() { Set expectedGroups = new HashSet(); expectedGroups.add("default"); expectedGroups.add("group1"); expectedGroups.add("group2"); FetchPlan fp = getPM().getFetchPlan(); fp.setGroups(new String[] {"default", "group1", "group2"}); Collection groups = fp.getGroups(); if (!setEquals(expectedGroups, groups)) { failCompare( "checkSetGroupsArray(): wrong getGroups() " + "after setGroups(String[]).", expectedGroups, groups); } cleanupPM(); } /** */ protected void checkGetDetachmentRoots() { Set expectedRoots = new HashSet(); FetchPlan fp = getPM().getFetchPlan(); Collection roots = fp.getDetachmentRoots(); if (!setEquals(expectedRoots, roots)) { failCompare( "checkGetDetachmentRoots(): wrong getDetachmentRoots() " + "after getPersistenceManager().", expectedRoots, roots); } cleanupPM(); } /** */ protected void checkSetDetachmentRoots() { PCPoint p = new PCPoint(10, 20); Set expectedRoots = new HashSet(); expectedRoots.add(p); FetchPlan fp = getPM().getFetchPlan(); fp.setDetachmentRoots(expectedRoots); Collection roots = fp.getDetachmentRoots(); if (!setEquals(expectedRoots, roots)) { failCompare( "checkGetDetachmentRoots(): wrong getDetachmentRoots() " + "after setDetachmentRoots().", expectedRoots, roots); } cleanupPM(); } /** */ private void checkSetDetachmentRootClasses() { Class[] expectedRootClasses = new Class[] {PCPoint.class}; FetchPlan fp = getPM().getFetchPlan(); fp.setDetachmentRootClasses( expectedRootClasses); Class[] rootClasses = fp.getDetachmentRootClasses(); if (!Arrays.equals(expectedRootClasses, rootClasses)) { failCompare( "checkGetDetachmentRootClasses(): " + "wrong getDetachmentRootClasses() " + "after setDetachmentRootClasses().", expectedRootClasses, rootClasses); } cleanupPM(); } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/fetchplan/FetchPlanIsCopy.java100664 11247 12500110374 31205 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.fetchplan; import java.util.Arrays; import javax.jdo.Extent; import javax.jdo.FetchPlan; import javax.jdo.Query; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.pc.mylib.PCRect; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Test TITLE *
*Keywords: fetch plan *
*Assertion IDs: 12.7.5-1 *
*Assertion Description: Subsequent modifications of the Query FetchPlan are not reflected in the FetchPlan of the PersistenceManager. */ public class FetchPlanIsCopy extends AbstractFetchPlanTest { /** */ private static final String ASSERTION_FAILED = "Assertion 12.7.5-1 (FetchPlanIsCopy) failed: "; Query query = null; Extent extent = null; /** * The main 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(FetchPlanIsCopy.class); } /** * @see JDO_Test#localSetUp() protected void localSetUp() { addTearDownClass(PCRect.class); addTearDownClass(PCPoint.class); } */ /** */ public void testRemoveGroup() { beginFPTest(); query.getFetchPlan().removeGroup("PCRect.upperLeft"); // check that query fetch plan is changed checkGroups(ASSERTION_FAILED + " testRemoveGroup()", query.getFetchPlan(), defaultGroup); closeFPTest("testRemoveGroup()"); } /** */ public void testAddGroup() { beginFPTest(); query.getFetchPlan().addGroup("PCRect.lowerRight"); // check that query fetch plan is changed checkGroups(ASSERTION_FAILED + " testAddGroup()", query.getFetchPlan(), bothGroup); closeFPTest("testAddGroup()"); } /** */ public void testClearGroups() { beginFPTest(); query.getFetchPlan().clearGroups(); // check that query fetch plan is changed checkGroups(ASSERTION_FAILED + " testClearGroups()", query.getFetchPlan(), new String[]{}); closeFPTest("testClearGroup()"); } /** */ public void testSetGroup() { beginFPTest(); query.getFetchPlan().setGroup("default"); // check that query fetch plan is changed checkGroups(ASSERTION_FAILED + " testSetGroup()", query.getFetchPlan(), defaultGroup); closeFPTest("testSetGroup()"); } /** */ public void testSetGroupsCollection() { beginFPTest(); query.getFetchPlan().setGroups(Arrays.asList(bothGroup)); // check that query fetch plan is changed checkGroups(ASSERTION_FAILED + " testSetGroupsCollection()", query.getFetchPlan(), bothGroup); closeFPTest("testSetGroupsCollection()"); } /** */ public void testSetGroupsArray() { beginFPTest(); query.getFetchPlan().setGroups(bothGroup); // check that query fetch plan is changed checkGroups(ASSERTION_FAILED + " testSetGroupsArray()", query.getFetchPlan(), bothGroup); closeFPTest("testSetGroupsArray()"); } /** */ public void beginFPTest() { setUpperLeftGroup(); pm.currentTransaction().begin(); query = pm.newQuery(PCRect.class); extent = pm.getExtent(PCRect.class); } /** */ public void closeFPTest(String location) { // check that pm fetch plan is unchanged checkGroups(ASSERTION_FAILED + " " + location, pm.getFetchPlan(), upperLeftGroup); // check that extent fetch plan is unchanged checkGroups(ASSERTION_FAILED + " " + location, extent.getFetchPlan(), upperLeftGroup); pm.currentTransaction().rollback(); failOnError(); } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/fetchplan/FetchPlanMakeTransient.java100664 6555 12500110374 32532 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.fetchplan; import java.util.Collection; import java.util.HashSet; import org.apache.jdo.tck.api.persistencemanager.fetchplan.AbstractFetchPlanTest; import org.apache.jdo.tck.pc.mylib.PCRect; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Test FetchPlanMakeTransient *
*Keywords: FetchPlan makeTransient *
*Assertion IDs: Assertion 12.7.1 *
*Assertion Description: If the useFetchPlan parameter is true, the current FetchPlan, including MaxFetchDepth, DETACH_LOAD_FIELDS, and DETACH_UNLOAD_FIELDS, is applied to the pc or pcs parameter instance(s) to load fields and instances from the datastore. The DetachmentRoots is not affected. After the fetch plan is used to load instances, the entire graph of instances reachable via loaded fields of the parameter instances is made transient. Transient fields are not modified by the method. */ public class FetchPlanMakeTransient extends AbstractFetchPlanTest { /** */ private static final String ASSERTION_FAILED = "Assertion 12.7.1 (FetchPlanMakeTransient) failed: "; /** * The main 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(FetchPlanMakeTransient.class); } /** */ public void testMakeTransientAllCollection() { setBothGroup(); pm.currentTransaction().begin(); PCRect instance = (PCRect)pm.getObjectById(pcrectoid, false); Collection instances = new HashSet(); instances.add(instance); pm.makeTransientAll(instances, true); checkBothLoaded(ASSERTION_FAILED, instance); pm.currentTransaction().commit(); failOnError(); } /** */ public void testMakeTransientAllArray() { setBothGroup(); pm.currentTransaction().begin(); PCRect instance = (PCRect)pm.getObjectById(pcrectoid, false); pm.makeTransientAll(new Object[]{instance}, true); checkBothLoaded(ASSERTION_FAILED, instance); pm.currentTransaction().commit(); failOnError(); } /** */ public void testMakeTransient() { setBothGroup(); pm.currentTransaction().begin(); PCRect instance = (PCRect)pm.getObjectById(pcrectoid, false); pm.makeTransient(instance, true); checkBothLoaded(ASSERTION_FAILED, instance); pm.currentTransaction().commit(); failOnError(); } }tck/src/java/org/apache/jdo/tck/api/persistencemanager/fetchplan/FetchPlanQuery.java100664 4537 12500110374 31070 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.fetchplan; import javax.jdo.FetchPlan; import javax.jdo.Query; import org.apache.jdo.tck.api.persistencemanager.fetchplan.AbstractFetchPlanTest; import org.apache.jdo.tck.pc.mylib.PCRect; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Test FetchPlanQuery *
*Keywords: FetchPlan Query *
*Assertion IDs: Assertion 12.7.1 *
*Assertion Description: 12.7.1 When executing a query the JDO implementation loads the fields as specified in the fetch plan associated with the Query instance. */ public class FetchPlanQuery extends AbstractFetchPlanTest { /** */ private static final String ASSERTION_FAILED = "Assertion 12.7.1 (FetchPlanQuery) failed: "; /** * The main 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(FetchPlanQuery.class); } /** */ public void testQuery() { setBothGroup(); pm.currentTransaction().begin(); Query query = pm.newQuery(PCRect.class); checkGroups(ASSERTION_FAILED + " after newQuery().getFetchPlan()", query.getFetchPlan(), bothGroup); query.setUnique(true); PCRect instance = (PCRect)query.execute(); checkBothLoaded(ASSERTION_FAILED + " after query.execute()", instance); pm.currentTransaction().commit(); failOnError(); } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/fetchplan/FetchPlanRefresh.java100664 6021 12500110374 31347 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.fetchplan; import java.util.Collection; import java.util.HashSet; import org.apache.jdo.tck.api.persistencemanager.fetchplan.AbstractFetchPlanTest; import org.apache.jdo.tck.pc.mylib.PCRect; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Test FetchPlanRefresh *
*Keywords: FetchPlan getObjectById *
*Assertion IDs: Assertion 12.7.1 *
*Assertion Description: 12.7.1 For refresh, after clearing fields in the instances, the JDO implementation uses the fetch plan to determine which fields to load from the datastore. */ public class FetchPlanRefresh extends AbstractFetchPlanTest { /** */ private static final String ASSERTION_FAILED = "Assertion 12.7.1 (FetchPlanRefresh) failed: "; /** * The main 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(FetchPlanRefresh.class); } /** */ public void testRefresh() { setBothGroup(); pm.currentTransaction().begin(); PCRect instance = (PCRect)pm.getObjectById(pcrectoid, false); pm.refresh(instance); checkBothLoaded(ASSERTION_FAILED, instance); pm.currentTransaction().commit(); failOnError(); } /** */ public void testRefreshAllCollection() { setBothGroup(); pm.currentTransaction().begin(); PCRect instance = (PCRect)pm.getObjectById(pcrectoid, false); Collection instances = new HashSet(); instances.add(instance); pm.refreshAll(instances); checkBothLoaded(ASSERTION_FAILED, instance); pm.currentTransaction().commit(); failOnError(); } /** */ public void testRefreshAllArray() { setBothGroup(); pm.currentTransaction().begin(); PCRect instance = (PCRect)pm.getObjectById(pcrectoid, false); Object[] instances = new Object[]{instance}; pm.refreshAll(instances); checkBothLoaded(ASSERTION_FAILED, instance); pm.currentTransaction().commit(); failOnError(); } }tck/src/java/org/apache/jdo/tck/api/persistencemanager/fetchplan/FetchPlanRetrieve.java100664 6246 12500110374 31547 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.fetchplan; import java.util.Collection; import java.util.HashSet; import org.apache.jdo.tck.api.persistencemanager.fetchplan.AbstractFetchPlanTest; import org.apache.jdo.tck.pc.mylib.PCRect; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Test FetchPlanRetrieve *
*Keywords: FetchPlan getObjectById *
*Assertion IDs: Assertion 12.7.1 *
*Assertion Description: 12.7.1 For retrieve with FGonly true, the implementation uses the fetch plan to determine which fields are loaded from the datastore. With FGonly false, the implementation reverts to JDO 1 behavior, which loads all fields from the datastore; in this case, no related instances are loaded. */ public class FetchPlanRetrieve extends AbstractFetchPlanTest { /** */ private static final String ASSERTION_FAILED = "Assertion 12.7.1 (FetchPlanRetrieve) failed: "; /** * The main 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(FetchPlanRetrieve.class); } /** */ public void testRetrieve() { setBothGroup(); pm.currentTransaction().begin(); PCRect instance = (PCRect)pm.getObjectById(pcrectoid, false); pm.retrieve(instance, true); checkBothLoaded(ASSERTION_FAILED, instance); pm.currentTransaction().commit(); failOnError(); } /** */ public void testRetrieveAllCollection() { setBothGroup(); pm.currentTransaction().begin(); PCRect instance = (PCRect)pm.getObjectById(pcrectoid, false); Collection instances = new HashSet(); instances.add(instance); pm.retrieveAll(instances, true); checkBothLoaded(ASSERTION_FAILED, instance); pm.currentTransaction().commit(); failOnError(); } /** */ public void testRetrieveAllArray() { setBothGroup(); pm.currentTransaction().begin(); PCRect instance = (PCRect)pm.getObjectById(pcrectoid, false); Object[] instances = new Object[]{instance}; pm.retrieveAll(instances, true); checkBothLoaded(ASSERTION_FAILED, instance); pm.currentTransaction().commit(); failOnError(); } }tck/src/java/org/apache/jdo/tck/api/persistencemanager/flags/GetIgnoreCache.java100664 4606 12500110374 30132 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.flags; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; /** *Title: Get IgnoreCache Value from PersistenceManager *
*Keywords: *
*Assertion ID: A12.5.3-1. *
*Assertion Description: The PersistenceManager.getIgnoreCache method returns the current value of the IgnoreCache option. */ public class GetIgnoreCache extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.3-1 (GetIgnoreCache) failed: "; /** * The main 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(GetIgnoreCache.class); } /** */ public void testGetIgnoreCache() { pm = getPM(); Transaction tx = pm.currentTransaction(); try { PCPoint p1 = new PCPoint(); tx.begin(); pm.setIgnoreCache(true); boolean returnValue = pm.getIgnoreCache(); if (!returnValue) fail(ASSERTION_FAILED, "pm.getIgnoreCache() returns false after setting the falg to true"); tx.commit(); } finally { if (tx.isActive()) tx.rollback(); } pm.close(); pm = null; } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/flags/SetIgnoreCacheToFalse.java100664 5232 12500110374 31420 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.flags; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; /** *Title: Set IgnoreCache To False *
*Keywords:cache *
*Assertion ID: A12.5.3-3. *
*Assertion Description: The PersistenceManager.setIgnoreCache method called with a value of false instructs the query engine that the user expects queries to return results that reflect changed values in the cache. */ public class SetIgnoreCacheToFalse extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.3-3 (SetIgnoreCacheToFalse) failed: "; /** * The main 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(SetIgnoreCacheToFalse.class); } /** */ public void test() { pm = getPM(); runTestSetIgnoreCacheToFalse(pm); pm.close(); pm = null; } /** */ private void runTestSetIgnoreCacheToFalse(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { PCPoint p1 = new PCPoint(); tx.begin(); pm.setIgnoreCache(false); if (pm.getIgnoreCache()) { fail(ASSERTION_FAILED, "pm.getIgnoreCache() should return false after setting the flag to false."); } tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/flags/SetIgnoreCacheToTrue.java100664 5355 12500110374 31313 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.flags; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; /** *Title: Set IgnoreCache To True *
*Keywords:cache *
*Assertion ID: A12.5.3-2. *
*Assertion Description: The PersistenceManager.setIgnoreCache method called with a value of true is a hint to the query engine that the user expects queries to be optimized to return approximate results by ignoring changed values in the cache. This is not testable, except to see whether the get/set works. */ public class SetIgnoreCacheToTrue extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.3-2 (SetIgnoreCacheToTrue) failed: "; /** * The main 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(SetIgnoreCacheToTrue.class); } /** */ public void test() { pm = getPM(); runTestSetIgnoreCacheToTrue(pm); pm.close(); pm = null; } /** */ public void runTestSetIgnoreCacheToTrue(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { PCPoint p1 = new PCPoint(); tx.begin(); pm.setIgnoreCache(true); if (!pm.getIgnoreCache()) { fail(ASSERTION_FAILED, "pm.getIgnoreCache() should return true after setting the flag to true."); } tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/flags/SetMultithreadedFalse.java100664 5170 12500110374 31542 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.flags; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; /** *Title: Set Multithreaded False *
*Keywords: multithreaded *
*Assertion ID: A12.7-2. *
*Assertion Description: If PersistenceManager.setMultithreaded is called with a value of false, a value of false will be returned when getMultithreaded is called. */ public class SetMultithreadedFalse extends PersistenceManagerTest{ /** */ private static final String ASSERTION_FAILED = "Assertion A12.7-2 (SetMultithreadedFalse) failed: "; /** * The main 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(SetMultithreadedFalse.class); } /** */ public void test() { pm = getPM(); runTestSetMultithreadedFalse(pm); pm.close(); pm = null; } /** */ private void runTestSetMultithreadedFalse(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { PCPoint p1 = new PCPoint(); tx.begin(); pm.setMultithreaded(false); if (pm.getMultithreaded()) { fail(ASSERTION_FAILED, "pm.getMultithreaded() should false true after setting the flag to false."); } tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/flags/SetMultithreadedTrue.java100664 5332 12500110374 31427 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.flags; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; /** *Title: Set Multithreaded True *
*Keywords: multithreaded *
*Assertion ID: A12.7-1. *
*Assertion Description: If PersistenceManager.setMultithreaded is called with a value of true, then the JDO implementation must perform synchronizations to support multiple application threads. A value of true will be returned when getMultithreaded is called. In testing, multi-threading should be turned on and then multi-threading tests should be run. */ public class SetMultithreadedTrue extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.7-1 (SetMultithreadedTrue) failed: "; /** * The main 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(SetMultithreadedTrue.class); } /** */ public void test() { pm = getPM(); runTestSetMultithreadedTrue(pm); pm.close(); pm = null; } /** */ public void runTestSetMultithreadedTrue(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); pm.setMultithreaded(true); if (!pm.getMultithreaded()) { fail(ASSERTION_FAILED, "pm.getMultithreaded() should true true after setting the flag to true."); } tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } ././@LongLink100644 0 0 146 12500111677 10254 Lustar 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanager/flags/SettingFlagsWithTransactionInstance.javatck/src/java/org/apache/jdo/tck/api/persistencemanager/flags/SettingFlagsWithTransactionInstance.jav100664 4622 12500110374 34301 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.flags; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; /** *Title: Setting Flags With Transaction instance *
*Keywords: *
*Assertion ID: A12.5.2-3. *
*Assertion Description: Even if the Transaction instance returned by PersistenceManager.currentTransaction cannot be used for transaction completion (due to external transaction management), it still can be used to set flags. */ public class SettingFlagsWithTransactionInstance extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.2-3 (SettingFlagsWithTransactionInstance) failed: "; /** * The main 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(SettingFlagsWithTransactionInstance.class); } /** */ public void test() { pm = getPM(); runTestSettingFlagsWithTransactionInstance(pm); pm.close(); pm = null; } /** */ private void runTestSettingFlagsWithTransactionInstance(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); tx.setNontransactionalRead(false); tx.setNontransactionalWrite(false); tx.setRetainValues(false); tx.setOptimistic(false); } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/getobject/GetObjectById.java100664 12414 12500110374 30627 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.getobject; import javax.jdo.Transaction; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; /** *Title: Get Object By Id *
*Keywords: identity cache *
*Assertion ID: A12.5.6-9. *
*Assertion Description: If PersistenceManager.getObjectById is called with a value of true for the second parameter named validate, and there is not an instance already in the cache with the same JDO identity as the oid parameter, then this method creates an instance with the specified JDO identity, verifies that it exists in the data store, and returns it.
  1. If there is no transaction in progress, the returned instance will be hollow or persistent-nontransactional, at the choice of the implementation.
  2. If there is a data store transaction in progress, the returned instance will be persistent-clean.
  3. If there is an optimistic transaction in progress, the returned instance will be persistent-nontransactional.
*/ public class GetObjectById extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.6-9 (GetObjectById) failed: "; /** * The main 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(GetObjectById.class); } /** */ public void testGetObjectById() { if (debug) logger.debug ("\nSTART GetObjectById"); Transaction tx = null; try { pm = getPM(); Object oid = createPCPointInstance(pm); if (pm != null) { pm.close(); pm = null; // make sure to get a different pm so obj is not in cache } Object obj = null; int state = 0; // nontransactional access if (isNontransactionalReadSupported()) { if (debug) logger.debug("nontransactional"); pm = getPM(); tx = pm.currentTransaction(); tx.setNontransactionalRead(true); obj = pm.getObjectById(oid, true); state = currentState (obj); if (state != PERSISTENT_NONTRANSACTIONAL && state != HOLLOW) { fail(ASSERTION_FAILED, "Expected persistent-nontransactional or hollow; got " + getStateOfInstance(obj)); } tx = null; pm.close(); pm = null; // make sure to get a different pm so obj is not in cache } // pessimistic transactional access if (debug) logger.debug("pessimistic"); pm = getPM(); tx = pm.currentTransaction(); tx.setOptimistic(false); tx.begin(); obj = pm.getObjectById(oid, true); state = currentState (obj); tx.commit(); tx = null; if (state != PERSISTENT_CLEAN) { fail(ASSERTION_FAILED, "Expected persistent-clean; got " + getStateOfInstance(obj)); } pm.close(); pm = null; // make sure to get a different pm so obj is not in cache // optimistic transactional access if (isOptimisticSupported()) { if (debug) logger.debug("optimistic"); pm = getPM(); tx = pm.currentTransaction(); tx.setOptimistic(true); tx.begin(); obj = pm.getObjectById(oid, true); state = currentState (obj); tx.commit(); if (state != PERSISTENT_NONTRANSACTIONAL & state != HOLLOW) { fail(ASSERTION_FAILED, "Expected persistent-nontransactional; got " + getStateOfInstance(obj)); } tx = null; pm.close(); pm = null; // make sure to get a different pm so obj is not in cache } } finally { if (debug) logger.debug ("END GetObjectById"); if ((tx != null) && tx.isActive()) tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/getobject/GetObjectByIdExactClass.java100664 23620 12500110374 32603 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.getobject; import java.util.Date; import javax.jdo.Transaction; import javax.jdo.JDOException; import javax.jdo.identity.LongIdentity; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; import org.apache.jdo.tck.pc.singlefieldidentity.Person; import org.apache.jdo.tck.pc.singlefieldidentity.Employee; import org.apache.jdo.tck.pc.singlefieldidentity.PartTimeEmployee; import org.apache.jdo.tck.pc.singlefieldidentity.FullTimeEmployee; /** *Title: Get Object By Id *
*Keywords: identity cache *
*Assertion ID: A12.5.6-2. *
*Assertion Description: * If the validate flag is false, the user asserts that the instance exists * and the object id represents the exact class of the persistent instance * (specifically not a subclass or an interface). * If the class is abstract, throw JDOUserException (we cannot construct * a hollow instance of an abstract class). * If the class is actually not correct, an exception with an * error message will be thrown later if any field other than the identity * field id accessed. */ public class GetObjectByIdExactClass extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.6-2 (GetObjectById) failed: "; /** */ private LongIdentity oid; /** */ private long id; /** * The main 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(GetObjectByIdExactClass.class); } @Override public void localSetUp() { if (!runsWithApplicationIdentity()) { printNonApplicableIdentityType( "GetObjectIdExactClass", APPLICATION_IDENTITY); return; } pm = getPM(); pm.currentTransaction().begin(); // create an instance of FullTimeEmployee. FullTimeEmployee instance = new FullTimeEmployee(); instance.setPersonid(1000000L); instance.setFirstname("Full"); instance.setLastname("Timer"); instance.setBirthdate(new Date()); pm.makePersistent(instance); pm.currentTransaction().commit(); oid = (LongIdentity)pm.getObjectId(instance); id = oid.getKey(); pm.close(); pm = null; addTearDownClass(FullTimeEmployee.class); } /** */ public void testAbstractSuperclassExact() { if (!runsWithApplicationIdentity()) return; Transaction tx = null; try { pm = getPM(); pm.currentTransaction().begin(); // create the oid Object abstractOid = new LongIdentity(Employee.class, id); pm.getObjectById(abstractOid, false); appendMessage(ASSERTION_FAILED + "getObjectById exact " + "for abstract superclass must fail."); } catch (JDOException ex) { // good catch } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } failOnError(); } /** */ public void testAbstractSuperclassNotExact() { if (!runsWithApplicationIdentity()) return; Transaction tx = null; try { pm = getPM(); pm.currentTransaction().begin(); // create the oid Object abstractOid = new LongIdentity(Employee.class, id); Object abstractInstance = pm.getObjectById(abstractOid, true); if (abstractInstance.getClass() != FullTimeEmployee.class) { appendMessage(ASSERTION_FAILED + "getObjectById not exact " + "for abstract superclass returned wrong type " + abstractInstance.getClass().getName()); } } catch (JDOException ex) { appendMessage(ASSERTION_FAILED + "getObjectById not exact " + "for abstract superclass threw exception " + ex.getMessage()); } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } failOnError(); } /** */ public void testConcreteSuperclassExact() { if (!runsWithApplicationIdentity()) return; Transaction tx = null; Person instance = null; try { pm = getPM(); pm.currentTransaction().begin(); // create the oid Object superclassOid = new LongIdentity(Person.class, id); instance = (Person)pm.getObjectById(superclassOid, false); if (instance.getClass() != Person.class) { appendMessage(ASSERTION_FAILED + "getObjectById exact for " + "concrete superclass should return " + "Person.class but returned wrong type " + instance.getClass().getName()); } } catch (Exception ex) { appendMessage(ASSERTION_FAILED + "getObjectById exact for " + "concrete superclass must succeed before accessing database."); } try { instance.toString(); // accesses non-key fields appendMessage(ASSERTION_FAILED + "getObjectById exact for " + "concrete superclass must fail when accessing database."); } catch (JDOException ex) { // good catch } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } failOnError(); } /** */ public void testConcreteSuperclassNotExact() { if (!runsWithApplicationIdentity()) return; Transaction tx = null; try { pm = getPM(); pm.currentTransaction().begin(); // create the oid Object superclassOid = new LongIdentity(Person.class, id); Object instance = pm.getObjectById(superclassOid, true); if (instance.getClass() != FullTimeEmployee.class) { appendMessage(ASSERTION_FAILED + "getObjectById not exact for " + "concrete superclass should return FullTimeEmployee " + "but returned wrong type " + instance.getClass().getName()); } } catch (JDOException ex) { appendMessage(ASSERTION_FAILED + " getObjectById not exact for " + "concrete superclass must succeed but threw " + ex.getMessage()); } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } failOnError(); } /** */ public void testWrongClass() { if (!runsWithApplicationIdentity()) return; Transaction tx = null; try { pm = getPM(); pm.currentTransaction().begin(); // create the oid Object wrongOid = new LongIdentity(PartTimeEmployee.class, id); PartTimeEmployee wrongInstance = (PartTimeEmployee)pm.getObjectById(wrongOid, false); wrongInstance.toString(); appendMessage(ASSERTION_FAILED + " getObjectById exact " + "for wrong class must throw JDOUserException."); } catch (JDOException ex) { // good catch } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } failOnError(); } /** */ public void testRightClassNotExact() { if (!runsWithApplicationIdentity()) return; Transaction tx = null; try { pm = getPM(); pm.currentTransaction().begin(); // create the oid Object rightOid = new LongIdentity(FullTimeEmployee.class, id); FullTimeEmployee rightInstance = (FullTimeEmployee)pm.getObjectById(rightOid, true); rightInstance.toString(); } catch (JDOException ex) { appendMessage(ASSERTION_FAILED + " getObjectById not exact " + "for right class must succeed."); } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } failOnError(); } /** */ public void testRightClassExact() { if (!runsWithApplicationIdentity()) return; Transaction tx = null; try { pm = getPM(); pm.currentTransaction().begin(); // create the oid Object rightOid = new LongIdentity(FullTimeEmployee.class, id); FullTimeEmployee rightInstance = (FullTimeEmployee)pm.getObjectById(rightOid, false); rightInstance.toString(); } catch (JDOException ex) { appendMessage(ASSERTION_FAILED + " getObjectById exact " + "for right class must succeed."); } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } failOnError(); } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/getobject/GetObjectByIdNotResolved.java100664 5752 12500110374 33003 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.getobject; import javax.jdo.JDOObjectNotFoundException; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; /** *Title: Get ObjectId For Null Or Not Persistent *
*Keywords: identity *
*Assertion IDs: A12.5.6-1 *
*Assertion Description: In a call to PersistenceManager.getObjectById, if the PersistenceManager is unable to resolve the oid parameter to an ObjectId instance, then it throws a JDOUserException. */ public class GetObjectByIdNotResolved extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.6-1 (GetObjectByIdNotResolved) failed: "; /** * The main 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(GetObjectByIdNotResolved.class); } /* passing null paramameter to getObjectId */ public void testGetObjectByIdNotResolved() { pm = getPM(); if (debug) logger.debug(" *** testObjectByIdNotResolved *** "); Transaction tx = pm.currentTransaction(); try { tx.begin(); PCPoint p1 = new PCPoint (1,3); pm.makePersistent(p1); Object oid = pm.getObjectId(p1); pm.deletePersistent(p1); tx.commit(); tx.begin(); try { PCPoint p2 = (PCPoint) pm.getObjectById(oid, true); fail(ASSERTION_FAILED, "pm.getObjectById(oid, true) should throw JDOObjectNotFoundException, if oid refers to an non existing object"); } catch (JDOObjectNotFoundException e) { // expected exception } tx.rollback(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } pm.close(); pm = null; } } ././@LongLink100644 0 0 157 12500111677 10256 Lustar 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanager/getobject/GetObjectByIdNoValidationInstanceInCache.javatck/src/java/org/apache/jdo/tck/api/persistencemanager/getobject/GetObjectByIdNoValidationInstanceIn100664 5501 12500110374 34152 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.getobject; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; /** *Title: Get Object By Id No Validation, Instance In Cache *
*Keywords: identity cache *
*Assertion IDs: A12.5.6-2 *
*Assertion Description: If PersistenceManager.getObjectById is called with a value of false for the second parameter named validate, and there is already an instance in the cache with the same JDO identity as the oid parameter, then this method returns it. */ public class GetObjectByIdNoValidationInstanceInCache extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.6-2 (GetObjectByIdNoValidationInstanceInCache) failed: "; /** * The main 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(GetObjectByIdNoValidationInstanceInCache.class); } /** */ public void testGetObjectByIdNoValidationInstanceInCache() { pm = getPM(); Transaction tx = pm.currentTransaction(); try { tx.begin(); PCPoint p1 = new PCPoint (1,3); pm.makePersistent(p1); int curr = currentState(p1); Object oid = pm.getObjectId(p1); tx.commit(); tx.begin(); Object obj = pm.getObjectById(oid, false); if (p1 != obj) fail(ASSERTION_FAILED, "pm.getObjectById(oid, false) should find existing instance in pm cache"); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } pm.close(); pm = null; } } ././@LongLink100644 0 0 174 12500111677 10255 Lustar 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanager/getobject/GetObjectByIdNoValidationInstanceInCacheNoStateChange.javatck/src/java/org/apache/jdo/tck/api/persistencemanager/getobject/GetObjectByIdNoValidationInstanceIn100664 6043 12500110374 34154 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.getobject; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; /** *Title: Get Object By Id No Validation, Instance In Cache, No State Change *
*Keywords: identity cache lifecycle *
*Assertion IDs: A12.5.6-3 *
*Assertion Description: If PersistenceManager.getObjectById is called with a value of false for the second parameter named validate, and there is already an instance in the cache with the same JDO identity as the oid parameter, there is no change made to the state of the returned instance. */ public class GetObjectByIdNoValidationInstanceInCacheNoStateChange extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.6-3 (GetObjectByIdNoValidationInstanceInCacheNoStateChange) failed: "; /** * The main 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(GetObjectByIdNoValidationInstanceInCacheNoStateChange.class); } /** */ public void testGetObjectByIdNoValidationInstanceInCacheNoStateChange() { pm = getPM(); Transaction tx = pm.currentTransaction(); try { tx.begin(); PCPoint p1 = new PCPoint (1,3); pm.makePersistent(p1); Object oid = pm.getObjectId(p1); tx.commit(); int curr = currentState(p1); tx.begin(); Object obj = pm.getObjectById (oid, false); int actualState = currentState(obj); if (actualState != curr) { fail(ASSERTION_FAILED, "State mismatched - Expected state: " + curr + " Actual state: " + actualState); } tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } pm.close(); pm = null; } } ././@LongLink100644 0 0 162 12500111677 10252 Lustar 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanager/getobject/GetObjectByIdNoValidationInstanceNotInCache.javatck/src/java/org/apache/jdo/tck/api/persistencemanager/getobject/GetObjectByIdNoValidationInstanceNo100664 6403 12500110374 34162 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.getobject; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; /** *Title: Get Object By Id No Validation Instance Not In Cache *
*Keywords: identity cache *
*Assertion IDs: A12.5.6-5 *
*Assertion Description: If PersistenceManager.getObjectById is called with a value of false for the second parameter named validate, and there is not an instance already in the cache with the same JDO identity as the oid parameter, and there is a transaction in progress, then this method creates an instance with the specified JDO identity and returns it with a state of hollow, persistent-nontransactional, or persistent-clean, at the choice of the implementation. */ public class GetObjectByIdNoValidationInstanceNotInCache extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.6-5 (GetObjectByIdNoValidationInstanceNotInCache) failed: "; /** * The main 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(GetObjectByIdNoValidationInstanceNotInCache.class); } /** */ public void testGetObjectByIdNoValidationInstanceNotInCache() { pm = getPM(); Transaction tx = pm.currentTransaction(); try { tx.begin(); PCPoint p1 = new PCPoint (1,3); pm.makePersistent(p1); Object oid = pm.getObjectId(p1); pm.evict(p1); tx.commit(); tx.begin(); Object obj = pm.getObjectById (oid, false); int curr = currentState(obj); if ( curr == HOLLOW || curr == PERSISTENT_NONTRANSACTIONAL || curr == PERSISTENT_CLEAN ) { ; // expected result } else { fail(ASSERTION_FAILED, "returned state mismatched - " + " Actual state " + curr); } tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } pm.close(); pm = null; } } ././@LongLink100644 0 0 166 12500111677 10256 Lustar 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanager/getobject/GetObjectByIdNoValidationInstanceNotInCacheNoTx.javatck/src/java/org/apache/jdo/tck/api/persistencemanager/getobject/GetObjectByIdNoValidationInstanceNo100664 6417 12500110374 34167 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.getobject; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; /** *Title: Get Object By Id No Validation Instance Not In Cache, No Tx *
*Keywords: identity cache *
*Assertion IDs: A12.5.6-4 *
*Assertion Description: If PersistenceManager.getObjectById is called with a value of false for the second parameter named validate, and there is not an instance already in the cache with the same JDO identity as the oid parameter, and there is no transaction in progress, then this method creates an instance with the specified JDO identity and returns it with a state of hollow or persistent-nontransactional, at the choice of the implementation. */ public class GetObjectByIdNoValidationInstanceNotInCacheNoTx extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.6-4 (GetObjectByIdNoValidationInstanceNotInCacheNoTx) failed: "; /** * The main 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(GetObjectByIdNoValidationInstanceNotInCacheNoTx.class); } /** */ public void testGetObjectByIdNoValidationInstanceNotInCacheNoTx() { pm = getPM(); Transaction tx = pm.currentTransaction(); try { tx.begin(); PCPoint p1 = new PCPoint (1,3); pm.makePersistent(p1); Object oid = pm.getObjectId(p1); pm.evict(p1); tx.commit(); /* get oid for p1, no transaction in progress */ Object obj = pm.getObjectById (oid, false); int curr = currentState(p1); if (curr == HOLLOW || curr == PERSISTENT_NONTRANSACTIONAL || curr == PERSISTENT_CLEAN ) { // expected result } else { fail(ASSERTION_FAILED, "returned state mismatched - " + " Actual state " + curr); } tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } pm.close(); pm = null; } } ././@LongLink100644 0 0 166 12500111677 10256 Lustar 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanager/getobject/GetObjectByIdNoValidationInstanceNotInDatastore.javatck/src/java/org/apache/jdo/tck/api/persistencemanager/getobject/GetObjectByIdNoValidationInstanceNo100664 6260 12500110374 34163 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.getobject; import javax.jdo.JDOObjectNotFoundException; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; /** *Title: Get Object By Id No Validation Instance Not In Datastore *
*Keywords: identity exception *
*Assertion ID: A12.5.6-6. *
*Assertion Description: If PersistenceManager.getObjectById is called with a value of false for the second parameter named validate, and the instance does not exist in the data store, a subsequent access of the fields of the instance will throw a JDODatastoreException if the instance does not exist at that time. */ public class GetObjectByIdNoValidationInstanceNotInDatastore extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.6-6 (GetIgnoreCGetObjectByIdNoValidationInstanceNotInDatastore) failed: "; /** * The main 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(GetObjectByIdNoValidationInstanceNotInDatastore.class); } /** */ public void testGetObjectByIdNoValidationInstanceNotInDatastore() { if (debug) logger.debug ("\nSTART GetObjectByIdNoValidationInstanceNotInDatastore"); Object oid = null; pm = getPM(); oid = createPCPointInstance(pm); deletePCPointInstance(pm, oid); try { pm.currentTransaction().begin(); PCPoint p1 = (PCPoint)pm.getObjectById(oid, false); // might throw exception here if (debug) logger.debug ("Got object in cache, even though not in datastore."); p1.getX(); // if not thrown above, throws exception here pm.currentTransaction().commit(); fail(ASSERTION_FAILED, "accessing unknown instance should throw JDOObjectNotFoundException"); } catch (JDOObjectNotFoundException ex) { // expected exception } if (debug) logger.debug ("END GetObjectByIdNoValidationInstanceNotInDatastore"); } } ././@LongLink100644 0 0 161 12500111677 10251 Lustar 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanager/getobject/GetObjectByIdWithValidationInstanceInCache.javatck/src/java/org/apache/jdo/tck/api/persistencemanager/getobject/GetObjectByIdWithValidationInstance100664 6274 12500110374 34232 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.getobject; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; /** *Title: Get Object By Id With Validation Instance in Cache *
*Keywords: identity cache *
*Assertion IDs: A12.5.6-7 *
*Assertion Description: If PersistenceManager.getObjectById is called with a value of true for the second parameter named validate, and there is already a transactional instance in the cache with the same JDO identity as the oid parameter, then this method returns it. There is no change made to the state of the returned instance. */ public class GetObjectByIdWithValidationInstanceInCache extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.6-7 (GetObjectByIdWithValidationInstanceInCache) failed: "; /** * The main 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(GetObjectByIdWithValidationInstanceInCache.class); } /** */ public void testGetObjectByIdWithValidationInstanceInCache() { pm = getPM(); Transaction tx = pm.currentTransaction(); try { tx.begin(); PCPoint p1 = new PCPoint (1,3); pm.makePersistent(p1); Object oid = pm.getObjectId(p1); tx.commit(); int curr = currentState(p1); tx.begin(); Object obj = pm.getObjectById(oid, false); int curr2 = currentState(obj); if (obj != p1) { fail(ASSERTION_FAILED, "pm.getObjectById(oid, false) should find existing instance in pm cache"); } if (curr2 != curr) { fail(ASSERTION_FAILED, "State changed in the returned instance, expected state: " + curr + " Actual state: " + curr2); } tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } pm.close(); pm = null; } } ././@LongLink100644 0 0 177 12500111677 10260 Lustar 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanager/getobject/GetObjectByIdWithValidationInstanceInCacheNotInDatastore.javatck/src/java/org/apache/jdo/tck/api/persistencemanager/getobject/GetObjectByIdWithValidationInstance100664 6362 12500110374 34230 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.getobject; import javax.jdo.JDOObjectNotFoundException; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; /** *Title: Get Object By Id With Validation, Instance in Cache, Not in Datastore *
*Keywords: identity cache *
*Assertion IDs: A12.5.6-8. *
*Assertion Description: If PersistenceManager.getObjectById is called with a value of true for the second parameter named validate, and there is an instance already in the cache with the same JDO identity as the oid parameter, and the instance is not transactional, and the instance does not exist in the datastore, then a JDODatastoreException is thrown. */ public class GetObjectByIdWithValidationInstanceInCacheNotInDatastore extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.6-8 (GetObjectByIdWithValidationInstanceInCacheNotInDatastore) failed: "; /** * The main 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(GetObjectByIdWithValidationInstanceInCacheNotInDatastore.class); } /* passing null paramameter to getObjectId */ public void testGetObjectByIdWithValidationInstanceInCacheNotInDatastore() { pm = getPM(); Transaction tx = pm.currentTransaction(); try { tx.begin(); PCPoint p1 = new PCPoint (1,3); pm.makePersistent(p1); Object oid = pm.getObjectId(p1); pm.deletePersistent(p1); tx.commit(); tx.begin(); try { PCPoint p2 = (PCPoint) pm.getObjectById(oid, true); fail(ASSERTION_FAILED, "pm.getObjectById(oid, true) should throw JDOObjectNotFoundException, if oid refers to an non existing object"); } catch (JDOObjectNotFoundException ex) { // expected exception } tx.rollback(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } pm.close(); pm = null; } } ././@LongLink100644 0 0 202 12500111677 10245 Lustar 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanager/getobject/GetObjectByIdWithValidationInstanceNotInCacheNotInDatastore.javatck/src/java/org/apache/jdo/tck/api/persistencemanager/getobject/GetObjectByIdWithValidationInstance100664 5533 12500110374 34227 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.getobject; import javax.jdo.JDOObjectNotFoundException; import javax.jdo.Transaction; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Get Object By Id With Validation, Instance Not in Cache, Not in Datastore *
*Keywords: exception *
*Assertion IDs: A12.6.5-2. *
*Assertion Description: Object getObjectById (Object oid, boolean validate) with validate==true. If the instance does not exist in the datastore, then a JDOObjectNotFoundException is thrown. */ public class GetObjectByIdWithValidationInstanceNotInCacheNotInDatastore extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.6.5-2 (GetObjectByIdWithValidationInstanceNotInCacheNotInDatastore) failed: "; /** * The main 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(GetObjectByIdWithValidationInstanceNotInCacheNotInDatastore.class); } /** */ public void test() { pm = getPM(); Transaction tx = pm.currentTransaction(); tx.setRestoreValues(false); //This should cause eviction of transactional instances when transaction is later rolled back. tx.begin(); PCPoint p1 = new PCPoint (1,3); pm.makePersistent(p1); Object oid = pm.getObjectId(p1); tx.rollback(); tx.begin(); try { PCPoint p2 = (PCPoint) pm.getObjectById(oid, true); fail(ASSERTION_FAILED, "pm.getObjectById(oid, true) should throw JDOObjectNotFoundException, if oid refers to an non existing object"); } catch (JDOObjectNotFoundException ex) { // expected exception } finally { tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/getobject/GetObjectId.java100664 5274 12500110374 30322 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.getobject; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; /** *Title: Get Objectid *
*Keywords: identity *
*Assertion ID: A12.5.6-10 *
*Assertion Description: The PersistenceManager.getObjectId method returns an ObjectId instance that re presents the object identity of the specified JDO Instance. Test: The method g etObjectById returns the exact same object, evaluating to true when == is used . */ public class GetObjectId extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.6-10 (GetObjectId) failed: "; /** * The main 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(GetObjectId.class); } /** */ public void testGetObjectId() { pm = getPM(); Transaction tx = pm.currentTransaction(); try { PCPoint p1 = new PCPoint(8,8); tx = pm.currentTransaction(); tx.begin(); pm.makePersistent(p1); Object oid = pm.getObjectId(p1); tx.commit(); tx.begin(); Object obj = pm.getObjectById(oid, false); if (obj != p1) { fail(ASSERTION_FAILED, "m.getObjectById(oid, false) should find existing instance in pm cache."); } tx.rollback(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } pm.close(); pm = null; } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/getobject/GetObjectIdClass.java100664 7077 12500110374 31313 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.getobject; import javax.jdo.PersistenceManager; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; /** *Title: Get ObjectId Class *
*Keywords: identity *
*Assertion IDs: A12.10-1 *
*Assertion Description: The method PersistenceManager.getObjectIdClass returns the class of the object id for the given class. If the parameter class is not persistence-capable, or the parameter is null, null is returned. If the object-id class defined in the metadata for the parameter class is abstract then null is returned. If the implementation does not support application identity, and the class is defined in the jdo metadata to use application identity, then null is returned. */ public class GetObjectIdClass extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.10-1 (GetObjectIdClass) failed: "; /** * The main 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(GetObjectIdClass.class); } /** */ public void test() { pm = getPM(); runTestGetObjectIdClassForNull(pm); runTestGetObjectIdClassForNonPCClass(pm); runTestGetObjectIdClassForAbstractClass(pm); runTestGetObjectIdClass(pm); pm.close(); pm = null; } /** */ private void runTestGetObjectIdClass(PersistenceManager pm) { if (pm.getObjectIdClass(PCPoint.class) == null) { fail(ASSERTION_FAILED, "pm.getObjectIdClass(PCPoint.class) returned null"); } } /** */ private void runTestGetObjectIdClassForNull(PersistenceManager pm) { Class cl = pm.getObjectIdClass(null); if (cl != null) { fail(ASSERTION_FAILED, "pm.getObjectIdClass for null returned non-null class: " + cl.getName()); } } /** */ private void runTestGetObjectIdClassForNonPCClass(PersistenceManager pm) { Class cl = pm.getObjectIdClass(java.lang.Throwable.class); if (cl != null) { fail(ASSERTION_FAILED, "pm.getObjectIdClass for non-PC class returned non-null class: " + cl.getName()); } } private void runTestGetObjectIdClassForAbstractClass(PersistenceManager pm) { // not implemented; the tck contains no classes with which to test this. // we need an abstract class whose object-id class is itself abstract. } } ././@LongLink100644 0 0 176 12500111677 10257 Lustar 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanager/getobject/GetObjectIdClassForAbstractOrNonPersistenceCapableClass.javatck/src/java/org/apache/jdo/tck/api/persistencemanager/getobject/GetObjectIdClassForAbstractOrNonPer100664 5420 12500110374 34137 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.getobject; import javax.jdo.PersistenceManager; import org.apache.jdo.tck.pc.mylib.Point; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; /** *Title: Get ObjectId Class For Abstract or Non-PersistenceCapable Class *
*Keywords: identity *
*Assertion IDs: A12.10-2 *
*Assertion Description: A call to PersistenceManager.getObjectIdClass returns null if the class is abstract or not persistence-capable, or the parameter is null. */ public class GetObjectIdClassForAbstractOrNonPersistenceCapableClass extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.10-2 (GetObjectIdClassForAbstractOrNonPersistenceCapableClass) failed: "; /** * The main 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(GetObjectIdClassForAbstractOrNonPersistenceCapableClass.class); } /** */ public void testGetObjectIdClassForAbstractOrNonPersistenceCapableClass() { pm = getPM(); runTestNonPcClass(pm); runTestNullParam(pm); pm.close(); pm = null; } /** */ private void runTestNonPcClass(PersistenceManager pm) { Class c1 = pm.getObjectIdClass(Point.class); if ( c1 != null) { fail(ASSERTION_FAILED, "pm.getObjectIdClass returns non-null ObjectId class for non pc class"); } } /** */ private void runTestNullParam(PersistenceManager pm) { Class c1 = pm.getObjectIdClass(null); if (c1 != null) { fail(ASSERTION_FAILED, "pm.getObjectIdClass for null returned non-null class: " + c1.getName()); } } } ././@LongLink100644 0 0 150 12500111677 10247 Lustar 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanager/getobject/GetObjectIdForNullOrNotPersistent.javatck/src/java/org/apache/jdo/tck/api/persistencemanager/getobject/GetObjectIdForNullOrNotPersistent.j100664 5246 12500110374 34176 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.getobject; import javax.jdo.PersistenceManager; import org.apache.jdo.tck.pc.mylib.Point; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; /** *Title: GetObjectIdForNullOrNotPersistent *
*Keywords: identity *
*Assertion IDs: A12.5.6-14. *
*Assertion Description: If a call is made to PersistenceManager.getObjectId and the parameter pc is not persistent, or is null, then null is returned. */ public class GetObjectIdForNullOrNotPersistent extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.6-14 (GetObjectIdForNullOrNotPersistent) failed: "; /** * The main 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(GetObjectIdForNullOrNotPersistent.class); } /** */ public void testGetObjectIdForNullOrNotPersistent() { pm = getPM(); runTestNonPcClass(pm); runTestNullParam(pm); pm.close(); pm = null; } /** */ private void runTestNonPcClass(PersistenceManager pm) { Point p = new Point(1,3); Object oid = pm.getObjectId(p); if (oid != null) { fail(ASSERTION_FAILED, "pm.getObjectId returned non null ObjectId: " + oid + " for instance of non-pc class"); } } /** */ private void runTestNullParam(PersistenceManager pm) { Object oid = pm.getObjectId(null); if (oid != null) { fail(ASSERTION_FAILED, "pm.getObjectId(null) returned non null ObjectId: " + oid); } } } ././@LongLink100644 0 0 150 12500111677 10247 Lustar 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanager/getobject/GetObjectIdForPersistentInterface.javatck/src/java/org/apache/jdo/tck/api/persistencemanager/getobject/GetObjectIdForPersistentInterface.j100664 6426 12500110374 34203 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.getobject; import java.util.Date; import javax.jdo.Transaction; import javax.jdo.identity.LongIdentity; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; import org.apache.jdo.tck.pc.company.Company; import org.apache.jdo.tck.pc.company.ICompany; import org.apache.jdo.tck.pc.company.PICompany; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Get ObjectidForPersistentInterface *
*Keywords: identity *
*Assertion ID: A12.6.6-1 *
*Assertion Description: * For interfaces and classes that use a SingleFieldIdentity as * the object-id class, if the returned instance is subsequently * made persistent, the target class stored in the object-id * instance is the parameter of the newInstance method that created it. */ public class GetObjectIdForPersistentInterface extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.6.6-1 (GetObjectId) failed: "; /** * The main 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(GetObjectIdForPersistentInterface.class); } public void localSetUp() { addTearDownClass(PICompany.class); } /** */ public void testGetObjectId() { if (!runsWithApplicationIdentity()) { printNonApplicableIdentityType( "GetObjectIdForPersistentInterface", APPLICATION_IDENTITY); return; } pm = getPM(); Transaction tx = pm.currentTransaction(); ICompany icompany = (ICompany)pm.newInstance(PICompany.class); icompany.setCompanyid(1001); icompany.setName("GooTube"); icompany.setFounded(new Date()); tx.begin(); pm.makePersistent(icompany); LongIdentity ioid = (LongIdentity)pm.getObjectId(icompany); tx.commit(); Class pICompanyOidTargetClass = ioid.getTargetClass(); if (pICompanyOidTargetClass != PICompany.class) appendMessage(ASSERTION_FAILED + " getObjectId(icompany) should return interface class.\n" + "expected: " + icompany.getClass().getName() + "\n" + "actual: " + pICompanyOidTargetClass.getName()); failOnError(); } } ././@LongLink100644 0 0 162 12500111677 10252 Lustar 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanager/getobject/GetObjectIdWithApplicationModifyingIdentity.javatck/src/java/org/apache/jdo/tck/api/persistencemanager/getobject/GetObjectIdWithApplicationModifying100664 7155 12500110374 34270 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.getobject; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; /** *Title: Get ObjectId With Application Modifying Identity *
*Keywords: identity applicationidentity *
*Assertion ID: A12.5.6-11. *
*Assertion Description: If the object identity is being changed in the transaction, by the application modifying one or more of the application key fields, then the method PersistenceManager.getObjectId returns the identity as of the beginning of the transaction. The value returned by getObjectId will be different following afterCompletion processing for successful transactions. */ public class GetObjectIdWithApplicationModifyingIdentity extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.6-11 (GetObjectIdWithApplicationModifyingIdentity) failed: "; /** * The main 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(GetObjectIdWithApplicationModifyingIdentity.class); } /** */ public void testGetObjectByIdWithApplicationModifyingIdentity() { if (!isChangeApplicationIdentitySupported()) { if (debug) logger.debug("Implementation does not support chaning application identity"); return; } if (debug) logger.debug("\nSTART GetObjectIdWithApplicationModifyingIdentity"); pm = getPM(); Object oid = createPCPointInstance(pm); PCPoint p1 = (PCPoint) pm.getObjectById(oid, false); Transaction tx = pm.currentTransaction(); try { tx.begin(); p1.setX(10000); // this is the primary key Object oid2 = pm.getObjectId (p1); // should be the same tx.commit(); Object oid3 = pm.getObjectId (p1); // should be same as oid3 if (!oid.equals(oid2)) { fail(ASSERTION_FAILED, "Oid before is different from oid after modifying pk"); } if (oid.equals(oid3)) { fail(ASSERTION_FAILED, "Oid before is the same as oid after modifying pk"); } } finally { if (debug) logger.debug("END GetObjectIdWithApplicationModifyingIdentity"); if ((tx != null) && tx.isActive()) tx.rollback(); } pm.close(); pm = null; } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/getobject/GetObjectsById.java100664 17137 12500110374 31021 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.getobject; import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Test GetObjectsById *
*Keywords: getObjectsById getObjectById *
*Assertion IDs: 12.5.6-17 *
*Assertion Description: * 12.5.6-17 [Collection getObjectsById (Collection oids); * Object[] getObjectsById (Object[] oids); * Collection getObjectsById (Collection oids, boolean validate); * Object[] getObjectsById (Object[] oids, boolean validate); * The getObjectsById method attempts to find instances in the cache * with the specified JDO identities. The elements of the oids parameter * object might have been returned by earlier calls to getObjectId * or getTransactionalObjectId, or might have been constructed by * the application. If a method with no validate parameter is used, * the method behaves exactly as the correspond ing method with * the validate flag set to true. If the Object[] form of the method * is used, the returned objects correspond by position with * the object ids in the oids parameter. If the Collection form * of the method is used, the iterator over the returned Collection * returns instances in the same order as the oids returned by * an iterator over the parameter Collection. The cardinality of * the return value is the same as the cardinality of * the oids parameter. ] */ public class GetObjectsById extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion 12.5.6-17 (GetObjectsById) failed: "; /** Number of persistent instances */ private static final int NUMBER_OF_INSTANCES = 50; /** Persistent instances */ private final Collection instanceCollection = new ArrayList(NUMBER_OF_INSTANCES); /** Object ids */ private final Collection oidCollection = new ArrayList(NUMBER_OF_INSTANCES); /** Persistent instances */ private final Object[] instanceArray = new Object[NUMBER_OF_INSTANCES]; /** Object ids */ private final Object[] oidArray = new Object[NUMBER_OF_INSTANCES]; /** * The main 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(GetObjectsById.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint.class); getPM().currentTransaction().begin(); Object instance; Object oid; instanceCollection.clear(); oidCollection.clear(); for (int i = 0; i < NUMBER_OF_INSTANCES; ++i) { instance = new PCPoint(i, 1000 + i); pm.makePersistent(instance); instanceCollection.add(instance); instanceArray[i] = instance; oid = pm.getObjectId(instance); oidCollection.add(oid); oidArray[i] = oid; } pm.currentTransaction().commit(); } /** */ public void testCollection() { getPM().currentTransaction().begin(); Collection result = pm.getObjectsById(oidCollection); pm.currentTransaction().commit(); checkResultCollection("after getObjectsById(Collection)", result); failOnError(); } /** */ public void testCollectionTrue() { getPM().currentTransaction().begin(); Collection result = pm.getObjectsById(oidCollection, true); pm.currentTransaction().commit(); checkResultCollection( "after getObjectsById(Collection, true)", result); failOnError(); } /** */ public void testCollectionFalse() { getPM().currentTransaction().begin(); Collection result = pm.getObjectsById(oidCollection, false); pm.currentTransaction().commit(); checkResultCollection( "after getObjectsById(Collection, false)", result); failOnError(); } /** */ public void testArray() { getPM().currentTransaction().begin(); Object[] result = pm.getObjectsById(oidArray); pm.currentTransaction().commit(); checkResultArray("after getObjectsById(Object[], false)", result); failOnError(); } /** */ public void testArrayTrue() { getPM().currentTransaction().begin(); Object[] result = pm.getObjectsById(oidArray, true); pm.currentTransaction().commit(); checkResultArray("after getObjectsById(Object[], false)", result); failOnError(); } /** */ public void testArrayFalse() { getPM().currentTransaction().begin(); Object[] result = pm.getObjectsById(oidArray, false); pm.currentTransaction().commit(); checkResultArray("after getObjectsById(Object[], false)", result); failOnError(); } /** Check the results of getObjectsById */ private void checkResultCollection(String location, Collection instances) { Iterator expected = instanceCollection.iterator(); Iterator actual = instances.iterator(); for (int i = 0; i < NUMBER_OF_INSTANCES; ++i) { checkIdentity(ASSERTION_FAILED + location + ", position " + i, expected.next(), actual.next()); } checkIteratorComplete(ASSERTION_FAILED, actual); } /** Check the results of getObjectsById */ private void checkResultArray(String location, Object[] actual) { int length = actual.length; if (length != NUMBER_OF_INSTANCES) { appendMessage(location + "incorrect length of result. " + "expected: " + NUMBER_OF_INSTANCES + " actual: " + length); } Object[] expected = instanceArray; for (int i = 0; i < NUMBER_OF_INSTANCES; ++i) { checkIdentity(ASSERTION_FAILED + location + ", position " + i, expected[i], actual[i]); } } /** Check the identity of the instances */ private void checkIdentity(String location, Object expected, Object actual) { if (expected != actual) { appendMessage(location + "failed to compare \n" + "expected: " + expected + " actual: " + actual); } } /** Check that the iterator has no more elements */ private void checkIteratorComplete (String location, Iterator iterator) { if (iterator.hasNext()) { appendMessage(location + "result iterator has more elements than expected."); } } }tck/src/java/org/apache/jdo/tck/api/persistencemanager/GetPersistenceManagerFactory.java100664 4355 12500110374 31777 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager; import javax.jdo.PersistenceManager; import javax.jdo.PersistenceManagerFactory; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Get PersistenceManagerFactory *
*Keywords: *
*Assertion ID: A12.9-1. *
*Assertion Description: The PersistenceManagerFactory that created a PersistenceManager is returned by the method getPersistenceManagerFactory. */ public class GetPersistenceManagerFactory extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.9-1 (GetPersistenceManagerFactory) failed: "; /** * The main 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(GetPersistenceManagerFactory.class); } /** */ public void testGetPersistenceManagerFactory() { PersistenceManagerFactory pmf = getPMF(); // Note, getPM uses the pmf returned by getPMF PersistenceManager pm = getPM(); PersistenceManagerFactory pmf2 = pm.getPersistenceManagerFactory(); pm.close(); if (pmf2 != pmf) { fail(ASSERTION_FAILED, "pm.getPMF() returned different pmf, expected " + pmf + ", got " + pmf2); } } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/GetProperties.java100664 41366 12500110374 27047 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager; import java.util.Collection; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; import javax.jdo.PersistenceManager; import javax.jdo.Constants; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Test GetProperties *
*Keywords: getProperties getSupportedProperties setProperty *
*Assertion IDs: *
*Assertion Description: */ public class GetProperties extends JDO_Test implements Constants { /** */ private static final String ASSERTION_FAILED_12_19_1 = "Assertion 12.19-1 setProperty() " + "If a vendor-specific property is not recognized, it is silently ignored.\n"; private static final String ASSERTION_FAILED_12_19_2 = "Assertion 12.19-2 setProperty() If the value for the property is not supported by the implementation, " + "a JDOUserException is thrown.\n"; private static final String ASSERTION_FAILED_12_19_3 = "Assertion 12.19-3 setProperty() " + "Property names might exactly match the names of the properties in javax.jdo.Constants " + "or might differ in case only.\n"; private static final String ASSERTION_FAILED_12_19_4 = "Assertion 12.19-4 setProperty() " + "Properties of the transaction associated with a persistence manager " + "can be accessed via the named property in javax.jdo.Constants.\n"; private static final String ASSERTION_FAILED_12_19_5 = "Assertion 12.19-5 getProperties() " + "getProperties() Return a map of String, " + "Object with the properties and values currently in effect.\n"; private static final String ASSERTION_FAILED_12_19_6 = "Assertion 12.19-6 Changing the values in the map will not affect the properties in the PersistenceManager. "; private static final String ASSERTION_FAILED_12_19_7 = "Assertion 12.19-7 getSupportedProperties() Return the set of properties " + "supported by this PersistenceManager.\n"; /** * The main 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(GetProperties.class); } public void localSetUp() { getPM(); } public void localTearDown() { // the PM is left in an unknown state due to setting properties so it must be cleaned up cleanupPM(); } private Collection supportedOptions; private Set supportedProperties; private static Set testRequiredProperties = new HashSet(); private static Map> testOptionalProperties = new HashMap>(); private interface TestProperty { void test(PersistenceManager pm, Set supportedProperties); Object get(PersistenceManager pm); void set(PersistenceManager pm, Object value); void setMessageForNullResult(String messageForNullResult); void setMessageForWrongResultAfterSet(String messageForWrongResultAfterSet); } abstract class AbstractTestProperty implements TestProperty { String propertyName; Object testValue1; Object testValue2; protected String messageForNullResult = ASSERTION_FAILED_12_19_5; protected String messageForWrongResultAfterSet = ASSERTION_FAILED_12_19_5; AbstractTestProperty(String propertyName, Object testValue1, Object testValue2) { this.propertyName = propertyName; this.testValue1 = testValue1; this.testValue2 = testValue2; } public void setMessageForNullResult(String messageForNullResult) { this.messageForNullResult = messageForNullResult; } public void setMessageForWrongResultAfterSet(String messageForWrongResultAfterSet) { this.messageForWrongResultAfterSet = messageForWrongResultAfterSet; } } /** For each non-api supported property, * getProperty(XXX) should return a value * setProperty(XXX, value1) should succeed * getProperties() should return value1 * setProperty(XXX, value2) should succeed * getProperties() should return value2 */ abstract class AbstractNonAPITestProperty extends AbstractTestProperty { AbstractNonAPITestProperty(String propertyName, Object testValue1, Object testValue2) { super(propertyName, testValue1, testValue2); } public Object get(PersistenceManager pm) {throw new RuntimeException("not implemented");}; public void set(PersistenceManager pm, Object value) {throw new RuntimeException("not implemented");}; public void test(PersistenceManager pm, Set supportedProperties) { Object result0 = pm.getProperties().get(propertyName); errorIfEqual(this.messageForNullResult + "getProperties().get(" + propertyName + ")", null, result0); pm.setProperty(propertyName, testValue1); Object result1 = pm.getProperties().get(propertyName); errorIfNotEqual(this.messageForWrongResultAfterSet + "after pm.setProperty(" + propertyName + ", " + testValue1 + "), getProperties().get(" + propertyName + ")", testValue1, result1); pm.setProperty(propertyName, testValue2); Object result2 = pm.getProperties().get(propertyName); errorIfNotEqual(this.messageForWrongResultAfterSet + "after pm.setProperty(" + propertyName + ", " + testValue2 + "), getProperties().get(" + propertyName + ")", testValue2, result2); } } /** For each api supported property, and for each of two values * getProperty(XXX) should return a value * setProperty(XXX, value1) should succeed * getXXX() should return value1 * setXXX(value2) should succeed * getProperties() should return value2 */ abstract class AbstractAPITestProperty extends AbstractTestProperty { AbstractAPITestProperty(String propertyName, Object testValue1, Object testValue2) { super(propertyName, testValue1, testValue2); } public void test(PersistenceManager pm, Set supportedProperties) { Object result0 = pm.getProperties().get(propertyName); errorIfEqual(this.messageForNullResult + "getProperties().get(" + propertyName + ")", null, result0); pm.setProperty(propertyName, testValue1); Object result1 = get(pm); errorIfNotEqual(this.messageForWrongResultAfterSet + "after pm.setProperty(" + propertyName + ", " + testValue1 + "), getXXX for " + propertyName, testValue1, result1); set(pm, testValue2); Object result2 = pm.getProperties().get(propertyName); errorIfNotEqual(this.messageForWrongResultAfterSet + "after pm.setXXX(), getProperties.get(" + propertyName + ")", testValue2, result2); } }; private TestProperty testCopyOnAttach = new AbstractAPITestProperty(PROPERTY_COPY_ON_ATTACH, true, false) { public Object get(PersistenceManager pm) {return pm.getCopyOnAttach();} public void set(PersistenceManager pm, Object value) {pm.setCopyOnAttach((Boolean) value);} }; private TestProperty testDatastoreReadTimeoutMillis = new AbstractAPITestProperty(PROPERTY_DATASTORE_READ_TIMEOUT_MILLIS, 20, 40) { public Object get(PersistenceManager pm) {return pm.getDatastoreReadTimeoutMillis();} public void set(PersistenceManager pm, Object value) {pm.setDatastoreReadTimeoutMillis((Integer) value);} }; private TestProperty testDatastoreWriteTimeoutMillis = new AbstractAPITestProperty(PROPERTY_DATASTORE_WRITE_TIMEOUT_MILLIS, 60, 80) { public Object get(PersistenceManager pm) {return pm.getDatastoreWriteTimeoutMillis();} public void set(PersistenceManager pm, Object value) {pm.setDatastoreWriteTimeoutMillis((Integer) value);} }; private TestProperty testMultithreaded = new AbstractAPITestProperty(PROPERTY_MULTITHREADED, true, false) { public Object get(PersistenceManager pm) {return pm.getMultithreaded();} public void set(PersistenceManager pm, Object value) {pm.setMultithreaded((Boolean) value);} }; private TestProperty testLowerCaseMultithreaded = new AbstractAPITestProperty(PROPERTY_MULTITHREADED, true, false) { public Object get(PersistenceManager pm) {return pm.getMultithreaded();} public void set(PersistenceManager pm, Object value) {pm.setProperty("javax.jdo.option.multithreaded", (Boolean) value);} }; private TestProperty testUpperCaseMultithreaded = new AbstractAPITestProperty(PROPERTY_MULTITHREADED, true, false) { public Object get(PersistenceManager pm) {return pm.getMultithreaded();} public void set(PersistenceManager pm, Object value) {pm.setProperty("javax.jdo.option.MULTITHREADED", (Boolean) value);} }; private TestProperty testDetachAllOnCommit = new AbstractAPITestProperty(PROPERTY_DETACH_ALL_ON_COMMIT, true, false) { public Object get(PersistenceManager pm) {return pm.getDetachAllOnCommit();} public void set(PersistenceManager pm, Object value) {pm.setDetachAllOnCommit((Boolean) value);} }; private TestProperty testIgnoreCache = new AbstractAPITestProperty(PROPERTY_IGNORE_CACHE, true, false) { public Object get(PersistenceManager pm) {return pm.getIgnoreCache();} public void set(PersistenceManager pm, Object value) {pm.setIgnoreCache((Boolean) value);} }; private TestProperty testOptimistic = new AbstractAPITestProperty(PROPERTY_OPTIMISTIC, true, false) { public Object get(PersistenceManager pm) {return pm.currentTransaction().getOptimistic();} public void set(PersistenceManager pm, Object value) {pm.currentTransaction().setOptimistic((Boolean) value);} }; private TestProperty testRetainValues = new AbstractAPITestProperty(PROPERTY_RETAIN_VALUES, true, false) { public Object get(PersistenceManager pm) {return pm.currentTransaction().getRetainValues();} public void set(PersistenceManager pm, Object value) {pm.currentTransaction().setRetainValues((Boolean) value);} }; private TestProperty testRestoreValues = new AbstractAPITestProperty(PROPERTY_RESTORE_VALUES, true, false) { public Object get(PersistenceManager pm) {return pm.currentTransaction().getRestoreValues();} public void set(PersistenceManager pm, Object value) {pm.currentTransaction().setRestoreValues((Boolean) value);} }; private TestProperty testNontransactionalRead = new AbstractAPITestProperty(PROPERTY_NONTRANSACTIONAL_READ, true, false) { public Object get(PersistenceManager pm) {return pm.currentTransaction().getNontransactionalRead();} public void set(PersistenceManager pm, Object value) {pm.currentTransaction().setNontransactionalRead((Boolean) value);} }; private TestProperty testNontransactionalWrite = new AbstractAPITestProperty(PROPERTY_NONTRANSACTIONAL_WRITE, true, false) { public Object get(PersistenceManager pm) {return pm.currentTransaction().getNontransactionalWrite();} public void set(PersistenceManager pm, Object value) {pm.currentTransaction().setNontransactionalWrite((Boolean) value);} }; private TestProperty testIllegalArgument = new AbstractNonAPITestProperty(PROPERTY_IGNORE_CACHE, 1, false) { }; private Set setOf(TestProperty... testPropertys) { Set result = new HashSet(); for (TestProperty testProperty: testPropertys) { result.add(testProperty); } return result; } /** * For each option supported by the PMF, test that * the corresponding pm property is supported. */ public void testGetSupportedProperties() { testRequiredProperties.add(testCopyOnAttach); testRequiredProperties.add(testDetachAllOnCommit); testRequiredProperties.add(testIgnoreCache); testRestoreValues.setMessageForWrongResultAfterSet(ASSERTION_FAILED_12_19_4); testRequiredProperties.add(testRestoreValues); testLowerCaseMultithreaded.setMessageForWrongResultAfterSet(ASSERTION_FAILED_12_19_3); testUpperCaseMultithreaded.setMessageForWrongResultAfterSet(ASSERTION_FAILED_12_19_3); testOptionalProperties.put(PROPERTY_MULTITHREADED, setOf(testMultithreaded, testLowerCaseMultithreaded, testUpperCaseMultithreaded)); testOptionalProperties.put(OPTION_DATASTORE_TIMEOUT, setOf(testDatastoreReadTimeoutMillis, testDatastoreWriteTimeoutMillis)); testOptimistic.setMessageForWrongResultAfterSet(ASSERTION_FAILED_12_19_4); testOptionalProperties.put(PROPERTY_OPTIMISTIC, setOf(testOptimistic)); testRetainValues.setMessageForWrongResultAfterSet(ASSERTION_FAILED_12_19_4); testOptionalProperties.put(PROPERTY_RETAIN_VALUES, setOf(testRetainValues)); testNontransactionalRead.setMessageForWrongResultAfterSet(ASSERTION_FAILED_12_19_4); testOptionalProperties.put(PROPERTY_NONTRANSACTIONAL_READ, setOf(testNontransactionalRead)); testNontransactionalWrite.setMessageForWrongResultAfterSet(ASSERTION_FAILED_12_19_4); testOptionalProperties.put(PROPERTY_NONTRANSACTIONAL_WRITE, setOf(testNontransactionalWrite)); supportedOptions = pmf.supportedOptions(); for (String supportedOption: supportedOptions) { System.out.println("supportedOptions returned: " + supportedOption); } supportedProperties = pm.getSupportedProperties(); errorIfEqual(ASSERTION_FAILED_12_19_7, null, supportedProperties); for (String supportedProperty: supportedProperties) { System.out.println("supportedProperties returned: " + supportedProperty); } // test required properties for (TestProperty testProperty: testRequiredProperties) { testProperty.test(pm, supportedProperties); } Set> properties = pm.getProperties().entrySet(); for (Map.Entry entry: properties) { System.out.println("getProperties returned: " + entry.getKey() + ": " + entry.getValue()); } // for each supported option, test the corresponding supported property for (String supportedOption: supportedOptions) { Set supportedOptionTestList = testOptionalProperties.get(supportedOption); if (supportedOptionTestList != null) { System.out.println("testing " + supportedOption); for (TestProperty supportedOptionTest: supportedOptionTestList) { supportedOptionTest.test(pm, supportedProperties); } } } try { testIllegalArgument.test(pm, supportedProperties); appendMessage(ASSERTION_FAILED_12_19_2 + "setProperty(PROPERTY_IGNORE_CACHE, 1) failed: " + "Illegal argument PROPERTY_IGNORE_CACHE failed to throw an exception."); } catch (Throwable t) { // good catch } try { // unknown property should be ignored pm.setProperty("com.mystery.property", true); } catch (Throwable t) { appendMessage(ASSERTION_FAILED_12_19_1 + "Property com.mystery.property threw an exception."); } // changing a property of the returned set of property values must not change the underlying property value pm.setProperty(PROPERTY_COPY_ON_ATTACH, true); Map props = pm.getProperties(); props.put(PROPERTY_COPY_ON_ATTACH, false); errorIfNotEqual(ASSERTION_FAILED_12_19_6, true, pm.getCopyOnAttach()); failOnError(); } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/GetPutRemoveUserObject.java100664 14210 12500110374 30613 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Test GetPutRemoveUserObject *
*Keywords: getUserObject putUserObject removeUserObject *
*Assertion IDs: A12.11-1 *
*Assertion Description: * Object putUserObject(Object key, Object value); This method models * the put method of Map. The current value associated with the key * is returned and replaced by the parameter value. * If the parameter value is null, the implementation may remove * the entry from the table of managed key/value pairs * Object removeUserObject(Object key); This method models * the remove method of Map. The current value associated with the key * is returned and removed. * Object getUserObject(Object key); This method models * the get method of Map. The current value associated with the key * is returned. If the key is not found in the table, null is returned.]..] */ public class GetPutRemoveUserObject extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A12.11-1 (GetPutRemoveUserObject) failed: "; /** First key */ private static final String KEY1 = "jdo.tck.key1"; /** Second key */ private static final String KEY2 = "jdo.tck.key2"; /** Non-existent key */ private static final String KEY_DOES_NOT_EXIST = "jdo.tck.keyDoesNotExist"; /** * The main 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(GetPutRemoveUserObject.class); } /** */ public void testGetNonexistentKey() { getPM(); assertNull(ASSERTION_FAILED + "Non-null value returned from key that does not exist.", pm.getUserObject(KEY_DOES_NOT_EXIST)); } public void testPutKey() { getPM(); UserObject obj1p = new UserObject(); UserObject obj2p = new UserObject(); UserObject obj3p = new UserObject(); UserObject obj4p = new UserObject(); Object obj1pv = pm.putUserObject(KEY1, obj1p); Object obj2pv = pm.putUserObject(KEY2, obj2p); Object obj1rv = pm.putUserObject(KEY1, obj3p); Object obj2rv = pm.putUserObject(KEY2, obj4p); assertNull(ASSERTION_FAILED + "putUserObject expected null on first put" + "; actual: " + obj1pv, obj1pv); assertSame(ASSERTION_FAILED + "putUserObject expected replaced object returned: " + obj1p + "; actual: " + obj1rv, obj1p, obj1rv); assertNull(ASSERTION_FAILED + "putUserObject expected null on first put" + "; actual: " + obj2pv, obj2pv); assertSame(ASSERTION_FAILED + "putUserObject expected replaced object returned: " + obj2p + "; actual: " + obj2rv, obj2p, obj2rv); } public void testGetKey() { getPM(); UserObject obj1p = new UserObject(); UserObject obj2p = new UserObject(); Object obj1pv = pm.putUserObject(KEY1, obj1p); Object obj2pv = pm.putUserObject(KEY2, obj2p); Object obj1g = pm.getUserObject(KEY1); Object obj2g = pm.getUserObject(KEY2); pm.putUserObject(KEY1, null); pm.putUserObject(KEY2, null); assertNull(ASSERTION_FAILED + "putUserObject expected null" + "; actual: " + obj1pv, obj1pv); assertSame(ASSERTION_FAILED + "getUserObject expected: " + obj1p + "; actual: " + obj1g, obj1p, obj1g); assertNull(ASSERTION_FAILED + "putUserObject expected null" + "; actual: " + obj2pv, obj2pv); assertSame(ASSERTION_FAILED + "getUserObject expected: " + obj2p + "; actual: " + obj2g, obj2p, obj2g); } public void testRemoveKey() { getPM(); UserObject obj1p = new UserObject(); UserObject obj2p = new UserObject(); pm.putUserObject(KEY1, obj1p); pm.putUserObject(KEY2, obj2p); Object obj1r = pm.removeUserObject(KEY1); Object obj1rr = pm.removeUserObject(KEY1); Object obj2r = pm.removeUserObject(KEY2); Object obj2rr = pm.removeUserObject(KEY2); assertSame(ASSERTION_FAILED + "removeUserObject(KEY1) expected: " + obj1p + "; actual: " + obj1r, obj1p, obj1r); assertNull(ASSERTION_FAILED + "getUserObject(KEY1) expected null: " + "; actual: " + obj1rr, obj1rr); assertSame(ASSERTION_FAILED + "removeUserObject(KEY2) returned: " + obj2p + "; actual: " + obj2r, obj2p, obj2r); assertNull(ASSERTION_FAILED + "getUserObject(KEY2) expected null: " + "; actual: " + obj2rr, obj2rr); } private class UserObject { /** No implementation needed for this class. It is only used * with == comparisons. */ } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/GetSetUserObject.java100664 4707 12500110374 27412 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.Point; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Get/Set User Object *
*Keywords: *
*Assertion ID: A12.8-1. *
*Assertion Description: The PersistenceManager.setUserObject method is used to store an object associated with the PersistenceManager. One uses the method getUserObject to later retrieve the object. */ public class GetSetUserObject extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.8-1 (GetSetUserObject) failed: "; /** * The main 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(GetSetUserObject.class); } /** */ public void testGetSetUserObject() { pm = getPM(); Transaction tx = pm.currentTransaction(); try { tx.begin(); Point p = new Point(10,10); pm.setUserObject(p); tx.commit(); tx.begin(); Object obj = pm.getUserObject(); if (obj != p) { fail(ASSERTION_FAILED, "Unexpected pm user object, expected " + p + ", got " + obj); } tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } pm.close(); pm = null; } } ././@LongLink100644 0 0 155 12500111677 10254 Lustar 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanager/GetTransactionalObjectIdWhenObjectIdBeingChanged.javatck/src/java/org/apache/jdo/tck/api/persistencemanager/GetTransactionalObjectIdWhenObjectIdBeingChan100664 6642 12500110374 34144 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Get Transactional ObjectId When ObjectId Being Changed *
*Keywords: identity applicationidentity *
*Assertion ID: A12.5.6-15. *
*Assertion Description: If the object identity is being changed in the transaction, by the application modifying one or more of the application key fields, then PersistenceManager.getTransactionalObjectId returns the current identity in the transaction. */ public class GetTransactionalObjectIdWhenObjectIdBeingChanged extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.6-15 (GetTransactionalObjectIdWhenObjectIdBeingChanged) failed: "; /** * The main 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(GetTransactionalObjectIdWhenObjectIdBeingChanged.class); } /** */ public void testGetObjectByIdWhenObjectIdBeingChanged() { if (!isChangeApplicationIdentitySupported()) { if (debug) logger.debug("Implementation does not support chaning application identity"); return; } if (debug) logger.debug("\nSTART GetTransactionalObjectIdWhenObjectIdBeingChanged"); pm = getPM(); Object oid = createPCPointInstance(pm); PCPoint p1 = (PCPoint) pm.getObjectById (oid, false); Transaction tx = pm.currentTransaction(); try { tx.begin(); p1.setX(10000); // this is the primary key Object oid2 = pm.getTransactionalObjectId (p1); // should be different tx.commit(); Object oid3 = pm.getObjectId (p1); // should be same as oid2 if (oid.equals(oid2)) { fail(ASSERTION_FAILED, "Oid before is the same as transactional oid after modifying pk"); } if (!oid2.equals(oid3)) { fail(ASSERTION_FAILED, "Oid after is different from transactional oid after modifying pk"); } } finally { if (debug) logger.debug("END GetTransactionalObjectIdWhenObjectIdBeingChanged"); if ((tx != null) && tx.isActive()) tx.rollback(); } pm.close(); pm = null; } } ././@LongLink100644 0 0 146 12500111677 10254 Lustar 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanager/GetTransactionalObjectIdWithNoTransaction.javatck/src/java/org/apache/jdo/tck/api/persistencemanager/GetTransactionalObjectIdWithNoTransaction.jav100664 5220 12500110374 34264 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Get Transactional ObjectId With No Transaction *
*Keywords: identity *
*Assertion ID: A12.5.6-16 *
*Assertion Description: If there is no transaction in progress, or if none of the key fields is being modified, then PersistenceManager.getTransactionalObjectId has the same behavior as getObjectId. */ public class GetTransactionalObjectIdWithNoTransaction extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.6-16 (GetTransactionalObjectIdWithNoTransaction) failed: "; /** * The main 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(GetTransactionalObjectIdWithNoTransaction.class); } /** */ public void testGetTransactionalObjectIdWithNoTransaction() { pm = getPM(); Transaction tx = pm.currentTransaction(); try { PCPoint p1 = new PCPoint(); tx.begin(); pm.makePersistent(p1); Object oid = pm.getObjectId(p1); tx.commit(); Object toid = pm.getTransactionalObjectId(p1); if (!toid.equals(oid)) { fail(ASSERTION_FAILED, "pm.getTransactionalObjectId(p1) returned unexpected ObjectId, expected " + oid + ", got " + toid); } } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } pm.close(); pm = null; } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/lifecycle/MakeNontransactionalAllFails.java100664 13434 12500110374 33730 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.lifecycle; import java.util.Collection; import javax.jdo.JDOUserException; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.pc.mylib.Point; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; /** *Title: MakeNontransactionalAllFails *
*Keywords: exception *
*Assertion ID: A12.5.7-5 *
*Assertion Description: If a collection or array of instances is passed to PersistenceManager.makeNontransactionalAll, and one or more of the instances fail to complete the required operation, then all instances will be attempted, and a JDOUserException will be thrown which contains a nested exception array, each exception of which contains one of the failing instances. The succeeding instances will transition to the specified life cycle state, and the failing instances will remain in their current state. */ public class MakeNontransactionalAllFails extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.7-5 (MakeNontransactionalAllFails) failed: "; /** * The main 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(MakeNontransactionalAllFails.class); } private PCPoint p1 = null; private PCPoint p2 = null; private PCPoint p3 = null; private PCPoint p4 = null; private Point p5 = null; /** */ public void testTransactionalInst() { pm = getPM(); createObjects(pm); runTestMakeNontransactional1(pm); runTestMakeNontransactionalAll1(pm); pm.close(); pm = null; } /** */ private void createObjects(PersistenceManager pm) { p1 = new PCPoint(1,3); p2 = new PCPoint(2,4); p3 = new PCPoint(3,5); p4 = new PCPoint(4,6); } /* test makeNontransactional (Object pc) */ private void runTestMakeNontransactional1(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); pm.makePersistent(p1); try { pm.makeNontransactional(p1); fail(ASSERTION_FAILED, "pm.makeNontransactional should throw a JDOUserException when called for a P-NEW instance."); } catch (JDOUserException ex) { // expected exception } tx.rollback(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /* test makeNontransactionalAll (Collection pcs) */ private void runTestMakeNontransactionalAll1(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); pm.makePersistent(p2); tx.commit(); tx.begin(); pm.makePersistent(p3); pm.makePersistent(p4); Collection col1 = new java.util.HashSet(); col1.add(p2); col1.add(p3); col1.add(p4); try { pm.makeNontransactionalAll(col1); fail(ASSERTION_FAILED, "pm.makeNontransactionalAll(Collection) should throw a JDOUserException when called for collection including P-NEW instances."); } catch (JDOUserException ex) { // expected exception } tx.rollback(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /* test makeNontransactionalAll (Object[] pcs) */ private void testMakeNontransactionalAll2(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx = pm.currentTransaction(); tx.begin(); pm.makePersistent(p2); tx.commit(); tx.begin(); pm.makePersistent(p3); pm.makePersistent(p4); Collection col1 = new java.util.HashSet(); col1.add(p2); col1.add(p3); col1.add(p4); try { pm.makeNontransactionalAll(col1.toArray()); fail(ASSERTION_FAILED, "pm.makeNontransactionalAll(Object []) should throw a JDOUserException when called for an array including P-NEW instances."); } catch (JDOUserException ex) { // expected exception } tx.rollback(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } ././@LongLink100644 0 0 150 12500111677 10247 Lustar 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanager/lifecycle/MakeNontransactionalDirtyInstance.javatck/src/java/org/apache/jdo/tck/api/persistencemanager/lifecycle/MakeNontransactionalDirtyInstance.j100664 23726 12500110374 34336 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.lifecycle; import java.util.Collection; import java.util.HashSet; import java.util.Iterator; import javax.jdo.JDOUserException; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; /** *Title: Make Nontransactional a Dirty Instance *
*Keywords: exception *
*Assertion IDs: A12.5.7-28 *
*Assertion Description: If PersistenceManager.makeNontransactional or makeNontransactionalAll is called with an explicit dirty parameter instance, a JDOUserException is thrown. */ public class MakeNontransactionalDirtyInstance extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.7-28 (MakeNontransactionalDirtyInstance) failed: "; /** * The main 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(MakeNontransactionalDirtyInstance.class); } private PCPoint p1 = null; private PCPoint p2 = null; private PCPoint p3 = null; private PCPoint p4 = null; private PCPoint p5 = null; private PCPoint p6 = null; private PCPoint p7 = null; private PCPoint c1 = null; private PCPoint c2 = null; private PCPoint c3 = null; private PCPoint c4 = null; private PCPoint c5 = null; private PCPoint c6 = null; private PCPoint c7 = null; private Collection pcol1 = new HashSet(); private Collection pcol2 = new HashSet(); private Collection ccol1 = new HashSet(); private Collection ccol2 = new HashSet(); /** */ public void testMakeNontransactional() { pm = getPM(); /* call with an explicit persistent dirty parameter instance */ String pstate="persistent"; createPersistentObjects(pm); if (debug) logger.debug(" -- testing with persistent dirty instance -- "); runTestMakeNontransactionalDirtyInstance(pm, p1,pstate); runTestMakeNontransactionalDirtyInstanceAll1(pm, pcol1, pstate); runTestMakeNontransactionalDirtyInstanceAll2(pm, pcol2, pstate); /* call with an explicit transient dirty parameter instance */ pstate="transient"; createTcleanObjects(pm); if (debug) logger.debug (" -- testing with transient dirty instance -- "); runTestMakeNontransactionalDirtyInstance(pm, c1,pstate); runTestMakeNontransactionalDirtyInstanceAll1(pm, ccol1, pstate); runTestMakeNontransactionalDirtyInstanceAll2(pm, ccol2, pstate); pm.close(); pm = null; } /** */ private void createTcleanObjects(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); c1 = new PCPoint(1,3); c2 = new PCPoint(2,4); c3 = new PCPoint(3,5); c4 = new PCPoint(4,6); c5 = new PCPoint (5,7); c6 = new PCPoint (6,8); c7 = new PCPoint (7,9); ccol1.add(c2); ccol1.add(c3); ccol1.add(c4); ccol2.add(c5); ccol2.add(c6); ccol2.add(c7); pm.makeTransactional(c1); pm.makeTransactional(c2); pm.makeTransactional(c3); pm.makeTransactional(c4); pm.makeTransactional(c5); pm.makeTransactional(c6); pm.makeTransactional(c7); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ private void createPersistentObjects(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); p1 = new PCPoint(1,3); p2 = new PCPoint(2,4); p3 = new PCPoint(3,5); p4 = new PCPoint(4,6); p5 = new PCPoint (5,7); p6 = new PCPoint (6,8); p7 = new PCPoint (7,9); pm.makePersistent(p1); pm.makePersistent(p2); pm.makePersistent(p3); pm.makePersistent(p4); pm.makePersistent(p5); pm.makePersistent(p6); pm.makePersistent(p7); pcol1.add(p2); pcol1.add(p3); pcol1.add(p4); pcol2.add(p5); pcol2.add(p6); pcol2.add(p7); tx.commit(); } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ private void runTestMakeNontransactionalDirtyInstance(PersistenceManager pm, PCPoint obj, String state) { Transaction tx = pm.currentTransaction(); try { if (debug) logger.debug(" ** in testMakeNontransactionalDirtyInstance()"); int curr; tx.begin(); if (makeAndTestDirtyInstance(obj,state)) { try { pm.makeNontransactional(obj); fail (ASSERTION_FAILED, "pm.makeNontransactional should throw a JDOUserException when called for P-DIRTY instance."); } catch (JDOUserException ex) { // expected exception } } tx.rollback(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ private void runTestMakeNontransactionalDirtyInstanceAll1(PersistenceManager pm, Collection tcol, String state) { Transaction tx = pm.currentTransaction(); boolean stopFlag = false; try { if (debug) logger.debug(" ** in testMakeNontransactionalDirtyInstanceAll1()"); int curr; tx.begin(); Iterator iter = tcol.iterator(); while (iter.hasNext()) { PCPoint p = (PCPoint) iter.next(); if (makeAndTestDirtyInstance(p,state)) stopFlag = true; } if (! stopFlag) { try { pm.makeNontransactionalAll(tcol); fail (ASSERTION_FAILED, "pm.makeNontransactionalAll(Collection) should throw a JDOUserException when called for a collection including P-DIRTY instances."); } catch (JDOUserException ex) { // expected exception } } tx.rollback(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ private void runTestMakeNontransactionalDirtyInstanceAll2(PersistenceManager pm, Collection tcol, String state) { Transaction tx = pm.currentTransaction(); boolean stopFlag = false; try { if (debug) logger.debug(" ** in testMakeNontransactionalDirtyInstanceAll2()"); tx.begin(); Iterator iter = tcol.iterator(); while (iter.hasNext()) { PCPoint p = (PCPoint) iter.next(); if (makeAndTestDirtyInstance(p,state)) stopFlag = true; } Object[] objArray = tcol.toArray(); if (! stopFlag) { try { pm.makeNontransactionalAll(objArray); fail (ASSERTION_FAILED, "pm.makeNontransactionalAll(Object []) should throw a JDOUserException when called for an arry including P-DIRTY instances."); } catch (JDOUserException ex) { // expected exception } } tx.rollback(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ private boolean makeAndTestDirtyInstance (PCPoint obj, String state) { int i = obj.getX(); i = i*10; obj.setX(i); int curr = currentState(obj); if (state.equals("persistent")) { if ( curr != PERSISTENT_DIRTY ) { fail(ASSERTION_FAILED, " Object not in persistent dirty state " + " for " + obj.getX() + " current state: " + curr); return false; } } else if (state.equals("transient")) { if ( curr != TRANSIENT_DIRTY ) { fail(ASSERTION_FAILED, " Object not in transient dirty state " + " for " + obj.getX() + " current state: " + curr); return false; } } return true; } } ././@LongLink100644 0 0 146 12500111677 10254 Lustar 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanager/lifecycle/MakeNontransactionalIsImmediate.javatck/src/java/org/apache/jdo/tck/api/persistencemanager/lifecycle/MakeNontransactionalIsImmediate.jav100664 17714 12500110374 34277 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.lifecycle; import java.util.Collection; import java.util.HashSet; import java.util.Iterator; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; /** *Title: Make Nontransactional is immediate *
*Keywords: *
*Assertion IDs: A12.5.7-29 *
*Assertion Description: The effect of PersistenceManager.makeNontransactional or makeNontransactionalAll is immediate and not subject to rollback. */ public class MakeNontransactionalIsImmediate extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.7-29 (MakeNontransactionalIsImmediate) failed: "; /** * The main 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(MakeNontransactionalIsImmediate.class); } private PCPoint p1 = null; private PCPoint p2 = null; private PCPoint p3 = null; private PCPoint p4 = null; private PCPoint p5 = null; private PCPoint p6 = null; private PCPoint p7 = null; private Collection col1 = new HashSet(); private Collection col2 = new HashSet(); /** */ public void testTransactionalInst() { pm = getPM(); createTcleanObjects(); runTestMakeNontransactionalIsImmediate(pm); runTestMakeNontransactionalIsImmediateAll1(pm); runTestMakeNontransactionalIsImmediateAll2(pm); pm.close(); pm = null; } /** */ private void createTcleanObjects() { Transaction tx = pm.currentTransaction(); try { tx.begin(); p1 = new PCPoint(1,3); p2 = new PCPoint(2,4); p3 = new PCPoint(3,5); p4 = new PCPoint(4,6); p5 = new PCPoint (5,7); p6 = new PCPoint (6,8); p7 = new PCPoint (7,9); col1.add(p2); col1.add(p3); col1.add(p4); col2.add(p5); col2.add(p6); col2.add(p7); pm.makeTransactional(p1); pm.makeTransactional(p2); pm.makeTransactional(p3); pm.makeTransactional(p4); pm.makeTransactional(p5); pm.makeTransactional(p6); pm.makeTransactional(p7); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ private void runTestMakeNontransactionalIsImmediate(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { if (debug) logger.debug (" ** in runTestMakeNontransactionalIsImmediate()"); int curr; tx.begin(); if (testState(p1, TRANSIENT_CLEAN, "transient clean")) { pm.makeNontransactional(p1); if (! testState(p1, TRANSIENT, "transient")) { fail(ASSERTION_FAILED, "transient clean instance shoud become transient immediately after pm.makeNontransactional"); } } tx.rollback(); tx = null; if (! testState(p1, TRANSIENT, "transient")) { fail(ASSERTION_FAILED, "tx.rollback should rollback effect of pm.makeNontransactional"); } } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ private void runTestMakeNontransactionalIsImmediateAll1(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { if (debug) logger.debug(" ** in runTestMakeNontransactionalIsImmediateAll1()"); int curr; tx.begin(); if (testState (p2, TRANSIENT_CLEAN, "transient clean") && testState (p3, TRANSIENT_CLEAN, "transient clean") && testState (p4, TRANSIENT_CLEAN, "transient clean")) { pm.makeNontransactionalAll(col1); if (! navigateAndTestTransientCol(col1)) { fail(ASSERTION_FAILED, "transient clean instances shoud become transient immediately after pm.makeNontransactionalAll(Collection)"); } } tx.rollback(); tx.begin(); if (! navigateAndTestTransientCol(col1)) { fail(ASSERTION_FAILED, "tx.rollback should rollback effect of pm.makeNontransactionalAll(Collection)"); } tx.rollback(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ private void runTestMakeNontransactionalIsImmediateAll2(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { if (debug) logger.debug(" ** in runTestMakeNontransactionalIsImmediateAll2()"); int curr; tx.begin(); Object[] objArray = col2.toArray(); if (testState (p5, TRANSIENT_CLEAN, "transient clean") && testState (p6, TRANSIENT_CLEAN, "transient clean") && testState (p7, TRANSIENT_CLEAN, "transient clean")) { pm.makeNontransactionalAll(objArray); if (! navigateAndTestTransientArray(objArray)) { fail(ASSERTION_FAILED, "transient clean instances shoud become transient immediately after pm.makeNontransactionalAll(Object[])"); } } tx.rollback(); tx.begin(); if (! navigateAndTestTransientArray(objArray)) { fail(ASSERTION_FAILED, "tx.rollback should rollback effect of pm.makeNontransactionalAll(Object[])"); } tx.rollback(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ private boolean navigateAndTestTransientCol (Collection col) { boolean noError = true; Iterator iter = col1.iterator(); while (iter.hasNext() ) { PCPoint p = (PCPoint) iter.next(); if (! testState(p, TRANSIENT, "transient")) { noError = false; } } return noError; } /** */ private boolean navigateAndTestTransientArray (Object[] objArray) { boolean noError = true; for (int i=0; i < objArray.length; i++) { PCPoint p = (PCPoint) objArray[i]; if (! testState(p, TRANSIENT, "transient")) { noError = false; } } return noError; } } ././@LongLink100644 0 0 162 12500111677 10252 Lustar 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanager/lifecycle/MakeNontransactionalPersistentCleanInstance.javatck/src/java/org/apache/jdo/tck/api/persistencemanager/lifecycle/MakeNontransactionalPersistentClean100664 17303 12500110374 34423 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.lifecycle; import java.util.Collection; import java.util.Iterator; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; /** *Title: Make Nontransactional a Persistent-Clean Instance *
*Keywords: lifecycle *
*Assertion IDs: A12.5.7-27 *
*Assertion Description: PersistenceManager.makeNontransactional and makeNontransactionalAll makes a *persistent-clean instance nontransactional and causes a state transition to *persistent-nontransactional. */ public class MakeNontransactionalPersistentCleanInstance extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.7-27 (MakeNontransactionalPersistentCleanInstance) failed: "; /** * The main 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(MakeNontransactionalPersistentCleanInstance.class); } private PCPoint p1 = null; private PCPoint p2 = null; private PCPoint p3 = null; private PCPoint p4 = null; private PCPoint p5 = null; private PCPoint p6 = null; private PCPoint p7 = null; private Collection col1 = new java.util.HashSet(); private Collection col2 = new java.util.HashSet(); /** */ public void testTransactionalInstance() { pm = getPM(); createObjects(pm); runTestMakeNontransactionalPersistentCleanInstance(pm); runTestMakeNontransactionalPersistentCleanInstanceAll1(pm); runTestMakeNontransactionalPersistentCleanInstanceAll2(pm); pm.close(); pm = null; } /** */ private void createObjects(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.setOptimistic(false); tx.begin(); p1 = new PCPoint(1,3); p2 = new PCPoint(2,4); p3 = new PCPoint(3,5); p4 = new PCPoint(4,6); p5 = new PCPoint (5,7); p6 = new PCPoint (6,8); p7 = new PCPoint (7,9); col1.add(p2); col1.add(p3); col1.add(p4); col2.add(p5); col2.add(p6); col2.add(p7); pm.makePersistent(p1); pm.makePersistent(p2); pm.makePersistent(p3); pm.makePersistent(p4); pm.makePersistent(p5); pm.makePersistent(p6); pm.makePersistent(p7); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ private void runTestMakeNontransactionalPersistentCleanInstance( PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { if (debug) logger.debug(" ** in testMakeNontransactionalPersistentCleanInstance()"); int curr; tx.setOptimistic(false); tx.begin(); if (makePersistentCleanInstance(p1)) { pm.makeNontransactional(p1); curr = currentState(p1); if (curr == HOLLOW || curr == PERSISTENT_NONTRANSACTIONAL) { } else { fail(ASSERTION_FAILED, "Excpected P-HOLLOW or P-NONTX instance, instance is " + getStateOfInstance(p1)); } } tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ private void runTestMakeNontransactionalPersistentCleanInstanceAll1( PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { if (debug) logger.debug(" ** in testMakeNontransactionalPersistentCleanInstanceAll1()"); int curr; tx.setOptimistic(false); tx.begin(); if ( makePersistentCleanInstance(p2) && makePersistentCleanInstance(p3) && makePersistentCleanInstance(p4)) { pm.makeNontransactionalAll(col1); Iterator iter = col1.iterator(); while (iter.hasNext() ) { PCPoint p = (PCPoint) iter.next(); curr = currentState(p); if (curr == HOLLOW || curr == PERSISTENT_NONTRANSACTIONAL) { } else { fail(ASSERTION_FAILED, "Expected persistent-nontransactional or hollow; got " + getStateOfInstance(p)); } } } tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ private void runTestMakeNontransactionalPersistentCleanInstanceAll2(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { if (debug) logger.debug(" ** in testMakeNontransactionalPersistentCleanInstanceAll2()"); int curr; if (tx.getOptimistic()) if (debug) logger.debug (" opt flag set to true"); tx.begin(); Object[] objArray = col2.toArray(); if ( makePersistentCleanInstance(p5) && makePersistentCleanInstance(p6) && makePersistentCleanInstance(p7)) { pm.makeNontransactionalAll(objArray); for (int i=0; i < objArray.length; i++) { PCPoint p = (PCPoint) objArray[i]; curr = currentState(p); if (curr == HOLLOW || curr == PERSISTENT_NONTRANSACTIONAL) { } else { fail(ASSERTION_FAILED, "Expected persistent-nontransactional or hollow; got " + getStateOfInstance(p)); } } } tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ private boolean makePersistentCleanInstance (PCPoint obj) { int val = obj.getX(); return (testState(obj, PERSISTENT_CLEAN, "persistent clean")); } } ././@LongLink100644 0 0 161 12500111677 10251 Lustar 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanager/lifecycle/MakeNontransactionalTransientCleanInstance.javatck/src/java/org/apache/jdo/tck/api/persistencemanager/lifecycle/MakeNontransactionalTransientCleanI100664 16703 12500110374 34346 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.lifecycle; import java.util.Collection; import java.util.Iterator; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; /** *Title: MakeNontransactionalTransientCleanInstance *
*Keywords: lifecycle *
*Assertion IDs: A12.5.7-26 *
*Assertion Description: PersistenceManager.makeNontransactional and makeNontransactionalAll makes a transient-clean instance nontransactional and causes a state transition to transient. After the method completes, the instance does not observe transaction boundaries. */ public class MakeNontransactionalTransientCleanInstance extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.7-26 (MakeNontransactionalTransientCleanInstance) failed: "; /** * The main 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(MakeNontransactionalTransientCleanInstance.class); } private PCPoint p1 = null; private PCPoint p2 = null; private PCPoint p3 = null; private PCPoint p4 = null; private PCPoint p5 = null; private PCPoint p6 = null; private PCPoint p7 = null; private Collection col1 = new java.util.HashSet(); private Collection col2 = new java.util.HashSet(); /** */ public void testTransactionalInst() { pm = getPM(); createTcleanObjects(pm); runTestMakeNontransactionalTransientCleanInstance(pm); runTestMakeNontransactionalTransientCleanInstanceAll1(pm); runTestMakeNontransactionalTransientCleanInstanceAll2(pm); pm.close(); pm = null; } /** */ private void createTcleanObjects(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx = pm.currentTransaction(); tx.begin(); p1 = new PCPoint(1,3); p2 = new PCPoint(2,4); p3 = new PCPoint(3,5); p4 = new PCPoint(4,6); p5 = new PCPoint (5,7); p6 = new PCPoint (6,8); p7 = new PCPoint (7,9); col1.add(p2); col1.add(p3); col1.add(p4); col2.add(p5); col2.add(p6); col2.add(p7); pm.makeTransactional(p1); pm.makeTransactional(p2); pm.makeTransactional(p3); pm.makeTransactional(p4); pm.makeTransactional(p5); pm.makeTransactional(p6); pm.makeTransactional(p7); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ private void runTestMakeNontransactionalTransientCleanInstance(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { if (debug) logger.debug(" ** in testMakeNontransactionalTransientCleanInstance()"); int curr; tx.begin(); if (testState(p1, TRANSIENT_CLEAN, "transient clean")) { pm.makeNontransactional(p1); if (testState(p1, TRANSIENT, "transient")) { // expected result } else { fail(ASSERTION_FAILED, "expected transient instance after pm.makeNontransactional, instance is " + getStateOfInstance(p1)); } } tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ private void runTestMakeNontransactionalTransientCleanInstanceAll1(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { if (debug) logger.debug(" ** in testMakeNontransactionalTransientCleanInstanceAll1()"); int curr; tx.begin(); if (testState(p2, TRANSIENT_CLEAN, "transient clean") && testState(p3, TRANSIENT_CLEAN, "transient clean") && testState(p4, TRANSIENT_CLEAN, "transient clean")) { pm.makeNontransactionalAll(col1); Iterator iter = col1.iterator(); while (iter.hasNext() ) { PCPoint p = (PCPoint) iter.next(); if (testState(p, TRANSIENT, "transient")) { // expected result } else { fail(ASSERTION_FAILED, "expected transient instance after pm.makeNontransactionalAll, instance is " + getStateOfInstance(p)); } } } tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ private void runTestMakeNontransactionalTransientCleanInstanceAll2(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { if (debug) logger.debug (" ** in testMakeNontransactionalTransientCleanInstanceAll2()"); int curr; tx.begin(); Object[] objArray = col2.toArray(); if (testState(p5, TRANSIENT_CLEAN, "transient clean") && testState(p6, TRANSIENT_CLEAN, "transient clean") && testState(p7, TRANSIENT_CLEAN, "transient clean")) { pm.makeNontransactionalAll(objArray); for (int i=0; i < objArray.length; i++) { PCPoint p = (PCPoint) objArray[i]; if (testState(p, TRANSIENT, "transient")) { // expected result } else { fail(ASSERTION_FAILED, "expected transient instance after pm.makeNontransactionalAll, instance is " + getStateOfInstance(p)); } } } tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/lifecycle/MakePersistent.java100664 15320 12500110374 31137 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.lifecycle; import java.util.Collection; import java.util.HashSet; import javax.jdo.JDOUserException; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; /** *Title: make instance persistent *
*Keywords: persistencemanager *
*Assertion IDs: A12.5.7-6A *
*Assertion Description: The method PersistenceManager.makePersistent and makePersistentAll makes a transient instance(s) persistent directly. It must be called in the context of an active transaction, or a JDOUserException is thrown. */ public class MakePersistent extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.7-6A (MakePersistent) failed: "; /** * The main 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(MakePersistent.class); } private PCPoint p1 = null; private PCPoint p2 = null; private PCPoint p3 = null; private PCPoint p4 = null; private PCPoint p5 = null; /** * Overrides parent method to avoid querying for classes * that may not exist in the schema */ protected void localSetUp() { addTearDownClass(PCPoint.class); } /** */ public void testMakePersistent() { pm = getPM(); createObjects(); /* positive tests */ runTestMakePersistent1(pm); runTestMakePersistent2(pm); runTestMakePersistent3(pm); /* negative tests */ runTestMakePersistent4(pm); runTestMakePersistent5(pm); runTestMakePersistent6(pm); pm.close(); pm = null; } /** */ private void createObjects() { p1 = new PCPoint(1,3); p2 = new PCPoint(2,4); p3 = new PCPoint(3,5); p4 = new PCPoint(4,6); p5 = new PCPoint(5,7); } /* test makePersistent (Object pc) */ private void runTestMakePersistent1(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); pm.makePersistent(p1); tx.commit(); tx = null; if (debug) logger.debug(" \nPASSED in runTestMakePersistent1()"); } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /* test makePersistentAll (Collection pcs) */ private void runTestMakePersistent2(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); Collection col1 = new HashSet(); col1.add(p2); col1.add(p3); pm.makePersistentAll(col1); tx.commit(); tx = null; if (debug) logger.debug(" \nPASSED in runTestMakePersistent2()"); } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /* test makePersistentAll (Object[] o) */ private void runTestMakePersistent3(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx = pm.currentTransaction(); tx.begin(); Collection col1 = new HashSet(); col1.add(p1); col1.add(p2); Object[] obj1= col1.toArray(); pm.makePersistentAll(obj1); tx.commit(); tx = null; if (debug) logger.debug (" \nPASSED in runTestMakePersistent3()"); } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /* test makePersistent (Object pc) */ private void runTestMakePersistent4(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); if (tx.isActive()) tx.rollback(); PCPoint np1 = new PCPoint(1,3); try { pm.makePersistent(np1); fail(ASSERTION_FAILED, "pm.makePersistent outside of a tx should throw a JDOUserException"); } catch (JDOUserException ex) { // expected expected } } /* test makePersistentAll (Collection pcs) */ private void runTestMakePersistent5(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); if (tx.isActive()) tx.rollback(); PCPoint np1 = new PCPoint (3,3); PCPoint np2 = new PCPoint (4,4); Collection col1 = new HashSet(); col1.add(np1); col1.add(np2); try { pm.makePersistentAll(col1); fail(ASSERTION_FAILED, "pm.makePersistentAll(Collection) outside of a tx should throw a JDOUserException"); } catch (JDOUserException ex) { // expected expected } } /* test makePersistentAll (Object[] o) */ private void runTestMakePersistent6(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); if (tx.isActive()) tx.rollback(); PCPoint np1 = new PCPoint (3,3); PCPoint np2 = new PCPoint (4,4); Collection col1 = new HashSet(); col1.add(np1); col1.add(np2); Object[] obj1=col1.toArray(); try { pm.makePersistentAll(obj1); fail(ASSERTION_FAILED, "pm.makePersistentAll(Object[]) outside of a tx should throw a JDOUserException"); } catch (JDOUserException ex) { // expected expected } } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/lifecycle/MakePersistentAllFails.java100664 11076 12500110374 32553 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.lifecycle; import java.util.Collection; import javax.jdo.JDOUserException; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.pc.mylib.Point; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; /** *Title: MakePersistentAll Fails *
*Keywords: exception *
*Assertion IDs: A12.5.7-1. *
*Assertion Description: If a collection or array of instances is passed to PersistenceManager.makePersistentAll, and one or more of the instances fail to complete the operation, then all instances will be attempted, and a JDOUserException will be thrown which contains a nested exception array, each exception of which contains one of the failing instances. The succeeding instances will transition to the specified life cycle state, and the failing instances will remain in their current state. */ public class MakePersistentAllFails extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.7-1 (MakePersistentAllFails) failed: "; /** * The main 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(MakePersistentAllFails.class); } /** */ public void testMakePersistentAllFails() { pm = getPM(); runTestMakePersistentAllFails1(pm); runTestMakePersistentAllFails2(pm); pm.close(); pm = null; } /* test makePersistentAll (Collection pcs) */ private void runTestMakePersistentAllFails1(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); PCPoint np1 = new PCPoint (3,3); PCPoint np2 = new PCPoint (4,4); Point np3 = new Point (5,5); Collection col1 = new java.util.HashSet(); col1.add(np1); col1.add(np2); col1.add(np3); try { pm.makePersistentAll(col1); fail(ASSERTION_FAILED, "pm.makePersistentAll(Collection) should thro JDOUserException when called for collection including instance of non-pc class."); } catch (JDOUserException ex) { // expected exception } tx.rollback(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /* test makePersistentAll (Object[] o) */ private void runTestMakePersistentAllFails2(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); PCPoint np1 = new PCPoint (3,3); PCPoint np2 = new PCPoint (4,4); Point np3 = new Point (5,5); Collection col1 = new java.util.HashSet(); col1.add(np1); col1.add(np2); col1.add(np3); Object[] obj1=col1.toArray(); try { pm.makePersistentAll(obj1); fail(ASSERTION_FAILED, "pm.makePersistentAll(Object[]) should thro JDOUserException when called for array including instance of non-pc class "); } catch (JDOUserException ex) { // expected exception } tx.rollback(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } ././@LongLink100644 0 0 155 12500111677 10254 Lustar 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanager/lifecycle/MakePersistentAndInstancesNotReachable.javatck/src/java/org/apache/jdo/tck/api/persistencemanager/lifecycle/MakePersistentAndInstancesNotReacha100664 11117 12500110374 34277 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.lifecycle; import java.util.Date; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; import org.apache.jdo.tck.pc.company.Address; import org.apache.jdo.tck.pc.company.Company; import org.apache.jdo.tck.pc.company.Department; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: MakePersistent And Instances Not Reachable *
*Keywords: *
*Assertion ID: A12.5.7-6C. *
*Assertion Description: When calling PersistenceManager.makePersistent or makePersistentAll, transient instances will become persistent and any transient instances reachable via persistent fields will become provisionally persistent. That is, they behave as persistent-new instances (return true to isPersistent, isNew, and isDirty). But at commit time, the reachability algorithm is run again, and instances made provisionally persistent that are not currently reachable from persistent instances will revert to transient. */ public class MakePersistentAndInstancesNotReachable extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.7-6C (MakePersistentAndInstancesNotReachable) failed: "; private Department dep1 = null; private Department dep2 = null; private Department dep3 = null; /** * The main 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(MakePersistentAndInstancesNotReachable.class); } /** */ public void test() { pm = getPM(); createObjects(pm); runTest(pm); } /** */ private void createObjects(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); tx.begin(); Company comp = new Company(1L, "Sun Microsystems", new Date(), new Address(0,"","","","","")); //Add transient departments dep1 = new Department(1L, "Department 1"); dep2 = new Department(2L, "Department 1"); dep3 = new Department(3L, "Department 1"); comp.addDepartment(dep1); comp.addDepartment(dep2); comp.addDepartment(dep3); pm.makePersistent(comp); //Now the transient departments should be made provisionally persistent via reachability int curr = currentState(dep1); if( curr != PERSISTENT_NEW ){ fail(ASSERTION_FAILED, "dep1 should be persistent-new, state is " + states[curr]); } curr = currentState(dep2); if( curr != PERSISTENT_NEW ){ fail(ASSERTION_FAILED, "dep2 should be persistent-new, state is " + states[curr]); } curr = currentState(dep3); if( curr != PERSISTENT_NEW ){ fail(ASSERTION_FAILED, "dep3 should be persistent-new, state is " + states[curr]); } //Remove departments comp.removeDepartment(dep1); comp.removeDepartment(dep2); comp.removeDepartment(dep3); tx.commit(); //Now the removed departments should be made transient again } /** */ void runTest(PersistenceManager pm) { int curr = currentState(dep1); if( curr != TRANSIENT ){ fail(ASSERTION_FAILED, "dep1 should be transient, state is " + states[curr]); } curr = currentState(dep2); if( curr != TRANSIENT ){ fail(ASSERTION_FAILED, "dep2 should be transient, state is " + states[curr]); } curr = currentState(dep3); if( curr != TRANSIENT ){ fail(ASSERTION_FAILED, "dep3 should be transient, state is " + states[curr]); } } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/lifecycle/MakePersistentAssignsObjectId.java100664 13327 12500110374 34100 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.lifecycle; import java.util.Collection; import java.util.HashSet; import java.util.Iterator; import javax.jdo.Transaction; import javax.jdo.PersistenceManager; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; /** *Title: make instance persistent *
*Keywords: identity *
*Assertion IDs: A12.5.7-6B *
*Assertion Description: The method PersistenceManager.makePersistent and makePersistentAll will assign an object identity to the instance and transitions it to persistent-new. */ public class MakePersistentAssignsObjectId extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.7-6B (MakePersistentAssignsObjectId) failed: "; /** * The main 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(MakePersistentAssignsObjectId.class); } private PCPoint p1 = null; private PCPoint p2 = null; private PCPoint p3 = null; private PCPoint p4 = null; private PCPoint p5 = null; /** */ public void testMakePersistentAssignsObjectId() { pm = getPM(); createObjects(); /* positive tests */ runTestMakePersistentAssignsObjectId1(pm); runTestMakePersistentAssignsObjectId2(pm); runTestMakePersistentAssignsObjectId3(pm); pm.close(); pm = null; } /** */ private void createObjects() { p1 = new PCPoint(1,3); p2 = new PCPoint(2,4); p3 = new PCPoint(3,5); p4 = new PCPoint(4,6); p5 = new PCPoint(5,7); } /* test makePersistent (Object pc) */ private void runTestMakePersistentAssignsObjectId1(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); pm.makePersistent(p1); if (!testState(p1, PERSISTENT_NEW, "persistent_new")) { fail(ASSERTION_FAILED, "expected P-NEW instance, instance is " + getStateOfInstance(p1) + "."); } if (pm.getObjectId(p1) == null) { fail(ASSERTION_FAILED, "pm.makePersistent should assign non-null oid."); } tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /* test makePersistentAll (Collection pcs) */ private void runTestMakePersistentAssignsObjectId2(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); Collection col1 = new HashSet(); col1.add(p2); col1.add(p3); pm.makePersistentAll(col1); for (Iterator i = col1.iterator(); i.hasNext();) { PCPoint p = (PCPoint)i.next(); if (!testState(p, PERSISTENT_NEW, "persistent_new")) { fail(ASSERTION_FAILED, "expected P-NEW instance, instance is " + getStateOfInstance(p) + "."); } if (pm.getObjectId(p) == null) { fail(ASSERTION_FAILED, "pm.makePersistentAll should assign non-null oid."); } } tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /* test makePersistentAll (Object[] o) */ private void runTestMakePersistentAssignsObjectId3(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { int NUM_OBJS = 2; tx.begin(); Collection col1 = new HashSet(); col1.add(p4); col1.add(p5); Object[] obj1= col1.toArray(); pm.makePersistentAll(obj1); for (int i = 0; i < NUM_OBJS; i++) { PCPoint p = (PCPoint)obj1[i]; if (!testState(p, PERSISTENT_NEW, "persistent_new")) { fail(ASSERTION_FAILED, "expected P-NEW instance, instance is " + getStateOfInstance(p) + "."); } if (pm.getObjectId(p) == null) { fail(ASSERTION_FAILED, "pm.makePersistentAll should assign non-null oid."); } } tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } ././@LongLink100644 0 0 206 12500111677 10251 Lustar 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanager/lifecycle/MakePersistentFailsIfInstanceManagedByAnotherPersistenceManager.javatck/src/java/org/apache/jdo/tck/api/persistencemanager/lifecycle/MakePersistentFailsIfInstanceManage100664 13550 12500110374 34256 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.lifecycle; import java.util.Collection; import javax.jdo.JDOUserException; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; /** *Title: MakePersistent Fails If Instance Managed By Another PersistenceManager *
*Keywords: exception *
*Assertion IDs: A12.5.7-8. *
*Assertion Description: PersistenceManager.makePersistent and makePersistentAll will throw a JDOUserException if the parameter instance is managed by a different PersistenceManager. */ public class MakePersistentFailsIfInstanceManagedByAnotherPersistenceManager extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.7-8 (MakePersistentFailsIfInstanceManagedByAnotherPersistenceManager) failed: "; /** * The main 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(MakePersistentFailsIfInstanceManagedByAnotherPersistenceManager.class); } private PCPoint p1 = null; private PCPoint p2 = null; private PCPoint p3 = null; private PCPoint p4 = null; private PCPoint p5 = null; /** */ public void testMakePersistentFailsIfInstanceManagedByAnotherPersistenceManager() { pm = getPM(); PersistenceManager pm2 = getPMF().getPersistenceManager(); try { createObjects(pm2); /* positive tests */ runTestMakePersistent(pm); runTestMakePersistentAll1(pm); runTestMakePersistentAll2(pm); } finally { cleanupPM(pm2); pm2 = null; cleanupPM(pm); pm = null; } } /** */ private void createObjects(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); p1 = new PCPoint(1,3); p2 = new PCPoint(2,4); p3 = new PCPoint(3,5); p4 = new PCPoint(4,6); p5 = new PCPoint(5,7); pm.makePersistent(p1); pm.makePersistent(p2); pm.makePersistent(p3); pm.makePersistent(p4); pm.makePersistent(p5); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /* test makePersistent (Object pc) */ private void runTestMakePersistent(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); try { pm.makePersistent(p1); fail(ASSERTION_FAILED, "pm.makePersistent should throw JDOUserException if instance is already made persistence by different pm."); } catch (JDOUserException ex) { // expected exception } tx.rollback(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /* test makePersistentAll (Collection pcs) */ private void runTestMakePersistentAll1(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); Collection col1 = new java.util.HashSet(); col1.add(p2); col1.add(p3); try { pm.makePersistentAll(col1); fail(ASSERTION_FAILED, "pm.makePersistentAll(Collection) should throw JDOUserException if instance is already made persistence by different pm."); } catch (JDOUserException ex) { // expected exception } tx.rollback(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /* test makePersistentAll (Object[] o) */ private void runTestMakePersistentAll2(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); Collection col1 = new java.util.HashSet(); col1.add(p4); col1.add(p5); Object[] obj1= col1.toArray(); try { pm.makePersistentAll(obj1); fail(ASSERTION_FAILED, "pm.makePersistentAll(Object[]) should throw JDOUserException if instance is already made persistence by different pm."); } catch (JDOUserException ex) { // expected exception } tx.rollback(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } ././@LongLink100644 0 0 165 12500111677 10255 Lustar 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanager/lifecycle/MakePersistentHasNoEffectOnPersistentInstances.javatck/src/java/org/apache/jdo/tck/api/persistencemanager/lifecycle/MakePersistentHasNoEffectOnPersiste100664 12027 12500110374 34302 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.lifecycle; import java.util.Collection; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; /** *Title: MakePersistent Has No Effect On Persistent Instances *
*Keywords: *
*Assertion IDs: A12.5.7-7. *
*Assertion Description: PersistenceManager.makePersistent and makePersistentAll have no effect on *parameter persistent instances already managed by the same PersistenceManager. */ public class MakePersistentHasNoEffectOnPersistentInstances extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.7-7 (MakePersistentHasNoEffectOnPersistentInstances) failed: "; /** * The main 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(MakePersistentHasNoEffectOnPersistentInstances.class); } private PCPoint p1 = null; private PCPoint p2 = null; private PCPoint p3 = null; private PCPoint p4 = null; private PCPoint p5 = null; /** */ public void testMakePersistentHasNoEffectOnPersistentInstances() { pm = getPM(); createObjects(pm); runTestMakePersistent(pm); runTestMakePersistentAll1(pm); runTestMakePersistentAll2(pm); pm.close(); pm = null; } /** */ private void createObjects(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); p1 = new PCPoint(1,3); p2 = new PCPoint(2,4); p3 = new PCPoint(3,5); p4 = new PCPoint(4,6); p5 = new PCPoint(5,7); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /* test makePersistent (Object pc) */ private void runTestMakePersistent(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx = pm.currentTransaction(); tx.begin(); pm.makePersistent(p1); pm.makePersistent(p1); pm.makePersistent(p1); pm.makePersistent(p1); tx.commit(); tx = null; if (debug) logger.debug (" \nPASSED in runTestMakePersistent()"); } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /* test makePersistentAll (Collection pcs) */ private void runTestMakePersistentAll1(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); Collection col1 = new java.util.HashSet(); col1.add(p2); col1.add(p3); pm.makePersistentAll(col1); pm.makePersistentAll(col1); pm.makePersistentAll(col1); pm.makePersistentAll(col1); tx.commit(); tx = null; if (debug) logger.debug (" \nPASSED in runTestMakePersistentAll1()"); } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /* test makePersistentAll (Object[] o) */ private void runTestMakePersistentAll2(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); Collection col1 = new java.util.HashSet(); col1.add(p1); col1.add(p2); Object[] obj1= col1.toArray(); pm.makePersistentAll(obj1); pm.makePersistentAll(obj1); pm.makePersistentAll(obj1); pm.makePersistentAll(obj1); tx.commit(); tx = null; if (debug) logger.debug (" \nPASSED in runTestMakePersistentAll2()"); } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/lifecycle/MakeTransactional.java100664 11711 12500110374 31601 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.lifecycle; import java.util.Collection; import java.util.Iterator; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; /** *Title: MakeTransactional *
*Keywords: transienttransactional lifecycle *
*Assertion IDs: A12.5.7-20 *
*Assertion Description: PersistenceManager.makeTransactional and makeTransactionalAll makes a transient instance transactional and causes a state transition to transient-clean. After the method completes, the instance observes transaction boundaries. */ public class MakeTransactional extends PersistenceManagerTest{ /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.7-20 (MakeTransactional) failed: "; /** * The main 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(MakeTransactional.class); } private PCPoint p = null; private PCPoint p1 = null; private PCPoint p2 = null; private PCPoint p3 = null; private PCPoint p4 = null; /** */ public void testTransactionalInst() { pm = getPM(); createObjects(); testMakeTransactional(pm); testMakeTransactionalAll1(pm); testMakeTransactionalAll2(pm); pm.close(); pm = null; } /** */ private void createObjects() { p1 = new PCPoint(1,3); p2 = new PCPoint(2,4); p3 = new PCPoint(3,5); p4 = new PCPoint(4,6); } /** */ public void testMakeTransactional(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); pm.makeTransactional(p1); if (currentState(p1) != TRANSIENT_CLEAN) { fail(ASSERTION_FAILED, "Expected T-CLEAN instance, instance is " + getStateOfInstance(p1) + "."); } tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ public void testMakeTransactionalAll1(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); Collection col1 = new java.util.HashSet(); col1.add(p1); col1.add(p2); col1.add(p3); col1.add(p4); pm.makeTransactionalAll(col1); Iterator iter = col1.iterator(); while (iter.hasNext() ) { PCPoint p = (PCPoint) iter.next(); if (currentState(p) != TRANSIENT_CLEAN) { fail(ASSERTION_FAILED, "Expected T-CLEAN instance, instance " + p + " is " + getStateOfInstance(p1) + "."); } } tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ private void testMakeTransactionalAll2(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); Object[] objArray = {p1,p2,p3,p4}; pm.makeTransactionalAll(objArray); for ( int i=0; i < objArray.length; i++) { p = (PCPoint) objArray[i]; if (currentState(p) != TRANSIENT_CLEAN) { fail(ASSERTION_FAILED, "Expected T-CLEAN instance, instance " + p + " is " + getStateOfInstance(p1) + "."); } } tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/lifecycle/MakeTransactionalAllFails.java100664 10763 12500110374 33217 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.lifecycle; import java.util.Collection; import javax.jdo.JDOUserException; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.pc.mylib.Point; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; /** *Title: MakeTransactionalAllFails *
*Keywords: exception *
*Assertion ID: A12.5.7-4 *
*Assertion Description: If a collection or array of instances is passed to *PersistenceManager.makeTransactionalAll, and one or more of the instances *fail to complete the required o peration, then all instances will be *attempted, and a JDOUserException will be thrown which contains a nested *exception array, each exception of which conta ins one of the failing *instances. The succeeding instances will transition to the specified life *cycle state, and the failing instances will remain in their current state. */ public class MakeTransactionalAllFails extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.7-4 (MakeTransactionalAllFails) failed: "; /** * The main 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(MakeTransactionalAllFails.class); } private PCPoint p1 = null; private Point p2 = null; private Collection col1 = new java.util.HashSet(); /** */ public void testTransactionalInst() { pm = getPM(); createObjects(); runTestMakeTransactionalAll1(pm); runTestMakeTransactionalAll2(pm); pm.close(); pm = null; } /** */ private void createObjects() { p1 = new PCPoint(1,3); p2 = new Point(2,4); col1 = new java.util.HashSet(); col1.add(p1); col1.add(p2); } /* test makeTransactional (Collection pcs) */ private void runTestMakeTransactionalAll1(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); if (debug) logger.debug(" in runTestMakeTransactionalAll2() "); try { tx.begin(); col1.add(p1); col1.add(p2); try { pm.makeTransactionalAll(col1); fail(ASSERTION_FAILED, "pm.makeTransactionalAll(Collection) should throw JDOUserException when called for collection icnluding instance of non-pc class"); } catch (JDOUserException ex) { // expected exception } tx.rollback(); } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /* test makeTransactionalAll (Object[] pcs) */ private void runTestMakeTransactionalAll2(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); if (debug) logger.debug(" in runTestMakeTransactionalAll2() "); try { tx.begin(); try { pm.makeTransactionalAll(col1.toArray()); fail(ASSERTION_FAILED, "pm.makeTransactionalAll(Object[]) should throw JDOUserException when called for collection icnluding instance of non-pc class"); } catch (JDOUserException ex) { // expected exception } tx.rollback(); } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } ././@LongLink100644 0 0 173 12500111677 10254 Lustar 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanager/lifecycle/MakeTransactionalANontransactionalPersistentInstance.javatck/src/java/org/apache/jdo/tck/api/persistencemanager/lifecycle/MakeTransactionalANontransactionalP100664 23254 12500110374 34345 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.lifecycle; import java.util.Collection; import javax.jdo.JDOUserException; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; /** *Title: Make Transactional A Persistent Nontransactional Instance *
*Keywords: persistentnontransactional *
*Assertion IDs: A12.5.7-24 *
*Assertion Description: PersistenceManager.makeTransactional and makeTransactionalAll can be used to mark a nontransactional persistent instance as being part of the read-consistency set of the transaction. In this case, the call must be made in the context of an active transaction, or a JDOUserException is thrown. To test this, get an instance in the persistence-nontransactional state, make it transactional, then in a different transaction commit a change to the instance. An exception should then be thrown when the first transaction commits. */ public class MakeTransactionalANontransactionalPersistentInstance extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.7-24 (MakeTransactionalANontransactionalPersistentInstance) failed: "; /** * The main 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(MakeTransactionalANontransactionalPersistentInstance.class); } private PCPoint p1 = null; private PCPoint p2 = null; private PCPoint p3 = null; private PCPoint p4 = null; private PCPoint p5 = null; private PCPoint p6 = null; private PCPoint p7 = null; private Collection col1 = new java.util.HashSet(); private Collection col2 = new java.util.HashSet(); /** */ public void testTransactionalInstance() { if (isOptimisticSupported()) { pm = getPM(); createPNonTranObjects(); /* Positive cases */ runTestMakeTransactional(); runTestMakeTransactionalAll1(); runTestMakeTransactionalAll2(); /* Negative cases */ runTestMakeTransactionalNeg(); runTestMakeTransactionalAll1Neg(); runTestMakeTransactionalAll2Neg(); pm.close(); pm = null; } } /** */ private void createPNonTranObjects() { Transaction tx = pm.currentTransaction(); try { tx.setOptimistic(false); tx.begin(); p1 = new PCPoint(1,3); p2 = new PCPoint(2,4); p3 = new PCPoint(3,5); p4 = new PCPoint(4,6); p5 = new PCPoint (5,7); p6 = new PCPoint (6,8); p7 = new PCPoint (7,9); col1.add(p2); col1.add(p3); col1.add(p4); col2.add(p5); col2.add(p6); col2.add(p7); pm.makePersistent(p1); pm.makePersistent(p2); pm.makePersistent(p3); pm.makePersistent(p4); pm.makePersistent(p5); pm.makePersistent(p6); pm.makePersistent(p7); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ public void runTestMakeTransactional() { Transaction tx = pm.currentTransaction(); try { if (debug) logger.debug(" ** in runTestMakeTransactional()"); int curr; tx.setOptimistic(true); tx.begin(); if (makePersistentNonTranInstance(p1)) { pm.makeTransactional(p1); } tx.commit(); tx = null; if (debug) logger.debug(" \nPASSED in runTestMakeTransactional()"); } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ public void runTestMakeTransactionalNeg() { Transaction tx = pm.currentTransaction(); try { if (debug) logger.debug(" ** in runTestMakeTransactionalNeg()"); int curr; tx.setOptimistic(true); tx.begin(); if (makePersistentNonTranInstance(p1)) { ; // expected result } tx.commit(); tx = null; try { pm.makeTransactional(p1); fail(ASSERTION_FAILED, "pm.makeTransactional should throw JDOUserException outside of tx"); } catch (JDOUserException ex) { // expected exception } } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ public void runTestMakeTransactionalAll1() { Transaction tx = pm.currentTransaction(); try { if (debug) logger.debug(" ** in runTestMakeTransactionalAll1()"); int curr; tx.setOptimistic(true); tx.begin(); if ( makePersistentNonTranInstance(p2) && makePersistentNonTranInstance(p3) && makePersistentNonTranInstance(p4)) { pm.makeTransactionalAll(col1); } tx.commit(); tx = null; if (debug) logger.debug(" \nPASSED in runTestMakeTransactionalAll1()"); } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ public void runTestMakeTransactionalAll1Neg() { Transaction tx = pm.currentTransaction(); try { if (debug) logger.debug(" ** in runTestMakeTransactionalAll1Neg()"); int curr; tx.setOptimistic(true); tx.begin(); if ( makePersistentNonTranInstance(p2) && makePersistentNonTranInstance(p3) && makePersistentNonTranInstance(p4)) { ; // expected result } tx.commit(); try { pm.makeTransactionalAll(col1); fail(ASSERTION_FAILED, "pm.makeTransactionalAll(Collection) should throw JDOUserException outside of tx"); } catch (JDOUserException ex) { // expected exception } } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ public void runTestMakeTransactionalAll2() { Transaction tx = pm.currentTransaction(); try { if (debug) logger.debug(" ** in runTestMakeTransactionalAll2()"); int curr; tx.setOptimistic(true); tx.begin(); Object[] objArray = col2.toArray(); if ( makePersistentNonTranInstance(p5) && makePersistentNonTranInstance(p6) && makePersistentNonTranInstance(p7)) { pm.makeTransactionalAll(objArray); } tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ public void runTestMakeTransactionalAll2Neg() { Transaction tx = pm.currentTransaction(); try { if (debug) logger.debug(" ** in runTestMakeTransactionalAll2Neg()"); int curr; tx = pm.currentTransaction(); tx.setOptimistic(true); tx.begin(); Object[] objArray = col2.toArray(); if ( makePersistentNonTranInstance(p5) && makePersistentNonTranInstance(p6) && makePersistentNonTranInstance(p7)) { ; // expected result } tx.commit(); try { pm.makeTransactionalAll(objArray); fail(ASSERTION_FAILED, "pm.makeTransactionalAll(Object[]) should throw JDOUserException outside of tx"); } catch (JDOUserException ex) { // expected exception } } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ public boolean makePersistentNonTranInstance (PCPoint obj) { int val = obj.getX(); int curr = currentState(obj); if ( curr != PERSISTENT_NONTRANSACTIONAL && curr != HOLLOW) { fail(ASSERTION_FAILED, "expected P-HOLLOW or P-NONTX instance, instance " + obj + " is " + getStateOfInstance(obj) + "."); return false; } return true; } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/lifecycle/MakeTransactionalIsImmediate.java100664 13510 12500110374 33713 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.lifecycle; import java.util.Collection; import java.util.HashSet; import java.util.Iterator; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; /** *Title: Make Nontransactional is immediate *
*Keywords: *
*Assertion IDs: A12.5.7-25 *
*Assertion Description: The effect of PersistenceManager.makeTransactional or makeTransactionalAll is immediate and not subject to rollback. */ public class MakeTransactionalIsImmediate extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.7-25 (MakeTransactionalIsImmediate) failed: "; /** * The main 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(MakeTransactionalIsImmediate.class); } private PCPoint p1 = null; private PCPoint p2 = null; private PCPoint p3 = null; private PCPoint p4 = null; private PCPoint p5 = null; private PCPoint p6 = null; private PCPoint p7 = null; private Collection col1 = new HashSet(); private Collection col2 = new HashSet(); /** */ public void testTransactionalInst() { pm = getPM(); createTcleanObjects(pm); runTestMakeTransactionalIsImmediate(pm); runTestMakeTransactionalIsImmediateAll1(pm); runTestMakeTransactionalIsImmediateAll2(pm); pm.close(); pm = null; } /** */ private void createTcleanObjects(PersistenceManager pm) { p1 = new PCPoint(1,3); p2 = new PCPoint(2,4); p3 = new PCPoint(3,5); p4 = new PCPoint(4,6); p5 = new PCPoint (5,7); p6 = new PCPoint (6,8); p7 = new PCPoint (7,9); col1.add(p2); col1.add(p3); col1.add(p4); col2.add(p5); col2.add(p6); col2.add(p7); pm.makeTransactional(p1); pm.makeTransactional(p2); pm.makeTransactional(p3); pm.makeTransactional(p4); pm.makeTransactional(p5); pm.makeTransactional(p6); pm.makeTransactional(p7); } /** */ private void runTestMakeTransactionalIsImmediate(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { if (debug) logger.debug(" ** in runTestMakeTransactionalIsImmediate()"); tx.begin(); pm.makeTransactional(p1); tx.rollback(); if (!testState (p1, TRANSIENT_CLEAN, "transient_clean")) { fail(ASSERTION_FAILED, "expected T-CLEAN instance, instance " + p1 + " is " + getStateOfInstance(p1)); } tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ private void runTestMakeTransactionalIsImmediateAll1(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { if (debug) logger.debug(" ** in runTestMakeTransactionalIsImmediateAll1()"); tx = pm.currentTransaction(); tx.begin(); pm.makeTransactionalAll(col1); tx.rollback(); for (Iterator iter = col1.iterator(); iter.hasNext();) { PCPoint p = (PCPoint) iter.next(); if (!testState(p, TRANSIENT_CLEAN, "transient_clean")) { fail(ASSERTION_FAILED, "expected T-CLEAN instance, instance " + p1 + " is " + getStateOfInstance(p)); } } tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ private void runTestMakeTransactionalIsImmediateAll2(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { if (debug) logger.debug(" ** in runTestMakeTransactionalIsImmediateAll2()"); tx.begin(); Object[] objArray = col2.toArray(); pm.makeTransactionalAll(objArray); tx.rollback(); for (int i=0; i < objArray.length; i++) { PCPoint p = (PCPoint) objArray[i]; if (!testState(p, TRANSIENT_CLEAN, "transient_clean")) { fail(ASSERTION_FAILED, "expected T-CLEAN instance, instance " + p1 + " is " + getStateOfInstance(p)); } } tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } ././@LongLink100644 0 0 164 12500111677 10254 Lustar 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanager/lifecycle/MakeTransactionalPriorToTransactionRolledback.javatck/src/java/org/apache/jdo/tck/api/persistencemanager/lifecycle/MakeTransactionalPriorToTransaction100664 15634 12500110374 34416 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.lifecycle; import java.util.Collection; import java.util.HashSet; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; /** *Title: MakeTransactional Prior To a Transaction Rolledback *
*Keywords: *
*Assertion IDs: A12.5.7-23 *
*Assertion Description: If the transaction in which an instance is made transactional (by calling PersistenceManager.makeTransactional or makeTransactionalAll) is rolled back, then the transient instance takes its values as of the beginning of the transaction, if the call to makeTransactional was made prior to the beginning of the current transaction. */ public class MakeTransactionalPriorToTransactionRolledback extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.7-23 (MakeTransactionalPriorToTransactionRolledback) failed: "; /** * The main 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(MakeTransactionalPriorToTransactionRolledback.class); } private PCPoint p1 = null; private PCPoint p2 = null; private PCPoint p3 = null; private PCPoint p4 = null; private PCPoint p5 = null; private PCPoint p6 = null; private PCPoint p7 = null; private Collection col1 = new HashSet(); private Collection col2 = new HashSet(); /** */ public void testTransactionalInst() { pm = getPM(); pm.currentTransaction().setRestoreValues(true); createObjects(); runTestMakeTransactionalPriorToTransactionRolledback(pm); runTestMakeTransactionalPriorToTransactionRolledbackAll1(pm); runTestMakeTransactionalPriorToTransactionRolledbackAll2(pm); pm.close(); pm = null; } /** */ private void createObjects() { p1 = new PCPoint(1,3); p2 = new PCPoint(2,4); p3 = new PCPoint(3,5); p4 = new PCPoint(4,6); p5 = new PCPoint(5,7); col1.add(p2); col1.add(p3); col2.add(p4); col2.add(p5); } public void runTestMakeTransactionalPriorToTransactionRolledback( PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { if (debug) logger.debug(" ** in runTestMakeTransactionalPriorToTransactionRolledback()"); p1.setY(new Integer(50)); tx.begin(); p1.setY(new Integer(100)); pm.makeTransactional(p1); p1.setY(new Integer(200)); tx.rollback(); p1.setY(new Integer(300)); tx.begin(); p1.setY(new Integer(400)); tx.rollback(); if (p1.getY().intValue() != 300) { fail(ASSERTION_FAILED, "wrong value of p1.y, expected: 300, actual: " + p1.getY().intValue()); } } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ private void runTestMakeTransactionalPriorToTransactionRolledbackAll1(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { if (debug) logger.debug(" ** in runTestMakeTransactionalPriorToTransactionRolledbackAll1()"); p2.setY(new Integer(50)); p3.setY(new Integer(50)); tx.begin(); p2.setY(new Integer(100)); p3.setY(new Integer(100)); pm.makeTransactionalAll(col1); p2.setY(new Integer(200)); p3.setY(new Integer(200)); tx.rollback(); p2.setY(new Integer(300)); p3.setY(new Integer(300)); tx.begin(); p2.setY(new Integer(400)); p3.setY(new Integer(400)); tx.rollback(); if (p2.getY().intValue() != 300) { fail(ASSERTION_FAILED, "wrong value of p2.y, expected: 300, actual: " + p2.getY().intValue()); } if (p3.getY().intValue() != 300) { fail(ASSERTION_FAILED, "wrong value of p3.y, expected: 300, actual: " + p3.getY().intValue()); } } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ public void runTestMakeTransactionalPriorToTransactionRolledbackAll2( PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { if (debug) logger.debug (" ** in runTestMakeTransactionalPriorToTransactionRolledbackAll2()"); p2.setY(new Integer(50)); p3.setY(new Integer(50)); tx.begin(); p2.setY(new Integer(100)); p3.setY(new Integer(100)); Object[] objArray = col2.toArray(); pm.makeTransactionalAll(objArray); p2.setY(new Integer(200)); p3.setY(new Integer(200)); tx.rollback(); p2.setY(new Integer(300)); p3.setY(new Integer(300)); tx.begin(); p2.setY(new Integer(400)); p3.setY(new Integer(400)); tx.rollback(); if (p2.getY().intValue() != 300) { fail(ASSERTION_FAILED, "wrong value of p2.y, expected: 300, actual: " + p2.getY().intValue()); } if (p3.getY().intValue() != 300) { fail(ASSERTION_FAILED, "wrong value of p3.y, expected: 300, actual: " + p3.getY().intValue()); } } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } ././@LongLink100644 0 0 163 12500111677 10253 Lustar 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanager/lifecycle/MakeTransactionalWithinTransactionRolledback.javatck/src/java/org/apache/jdo/tck/api/persistencemanager/lifecycle/MakeTransactionalWithinTransactionR100664 14414 12500110374 34377 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.lifecycle; import java.util.Collection; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; /** *Title: MakeTransactionalWithinTransactionRolledback *
*Keywords: transienttransactional *
*Assertion IDs: A12.5.7-22 *
*Assertion Description: If the transaction in which an instance is made transactional (by calling PersistenceManager.makeTransactional or makeTransactionalAll) is rolled back, then the transient instance takes its values as of the call to makeTransactional if the call was made within the current transaction. */ public class MakeTransactionalWithinTransactionRolledback extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.7-22 (MakeTransactionalWithinTransactionRolledback) failed: "; /** * The main 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(MakeTransactionalWithinTransactionRolledback.class); } private PCPoint p1 = null; private PCPoint p2 = null; private PCPoint p3 = null; private PCPoint p4 = null; private PCPoint p5 = null; private PCPoint p6 = null; private PCPoint p7 = null; private Collection col1 = new java.util.HashSet(); private Collection col2 = new java.util.HashSet(); /** */ public void testTransactionalInst() { pm = getPM(); pm.currentTransaction().setRestoreValues(true); createObjects(); runTestMakeTransactionalWithinTransactionRolledback(pm); runTestMakeTransactionalWithinTransactionRolledbackAll1(pm); runTestMakeTransactionalWithinTransactionRolledbackAll2(pm); pm.close(); pm = null; } /** */ private void createObjects() { p1 = new PCPoint(1,3); p2 = new PCPoint(2,4); p3 = new PCPoint(3,5); p4 = new PCPoint(4,6); p5 = new PCPoint (5,7); col1.add(p2); col1.add(p3); col2.add(p4); col2.add(p5); } /** */ public void runTestMakeTransactionalWithinTransactionRolledback(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { if (debug) logger.debug(" ** in runTestMakeTransactionalWithinTransactionRolledback()"); p1.setY(new Integer(100)); tx.begin(); p1.setY(new Integer(200)); pm.makeTransactional(p1); p1.setY(new Integer(300)); tx.rollback(); if (p1.getY().intValue() != 200) { fail(ASSERTION_FAILED, "wrong value of p1.y, expected: 200, actual: " + p1.getY().intValue()); } } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ private void runTestMakeTransactionalWithinTransactionRolledbackAll1(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { if (debug) logger.debug(" ** in runTestMakeTransactionalWithinTransactionRolledbackAll1()"); p2.setY(new Integer(100)); p3.setY(new Integer(100)); tx.begin(); p2.setY(new Integer(200)); p3.setY(new Integer(200)); pm.makeTransactionalAll(col1); p2.setY(new Integer(300)); p3.setY(new Integer(300)); tx.rollback(); if (p2.getY().intValue() != 200) { fail(ASSERTION_FAILED, "wrong value of p2.y expected: 200, actual: " + p2.getY().intValue()); } if (p3.getY().intValue() != 200) { fail(ASSERTION_FAILED, "wrong value of p3.y, expected: 200, actual: " + p3.getY().intValue()); } } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ private void runTestMakeTransactionalWithinTransactionRolledbackAll2(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { if (debug) logger.debug(" ** in runTestMakeTransactionalWithinTransactionRolledbackAll2()"); p4.setY(new Integer(100)); p5.setY(new Integer(100)); tx.begin(); p4.setY(new Integer(200)); p5.setY(new Integer(200)); Object[] objArray = col2.toArray(); pm.makeTransactionalAll(objArray); p4.setY(new Integer(300)); p5.setY(new Integer(300)); tx.rollback(); if (p4.getY().intValue() != 200) { fail(ASSERTION_FAILED, "wrong value of p4, expected: 200, actual: " + p4.getY().intValue()); } if (p5.getY().intValue() != 200) { fail(ASSERTION_FAILED, "wrong value of p5.y, expected: 200, actual: " + p5.getY().intValue()); } } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/lifecycle/MakeTransient.java100664 12652 12500110374 30753 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.lifecycle; import java.util.Collection; import java.util.Iterator; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; /** *Title: MakeTransient *
*Keywords: transient *
*Assertion IDs: A12.5.7-13 *
*Assertion Description: PersistenceManager.makeTransient and makeTransientAll make a persistent instance transient, so it is not associated with the PersistenceManager instance. It does not affect the persistent state in the data store. */ public class MakeTransient extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.7-13 (MakeTransient) failed: "; /** * The main 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(MakeTransient.class); } private PCPoint p1 = null; private PCPoint p2 = null; private PCPoint p3 = null; private PCPoint p4 = null; private PCPoint p5 = null; /** */ public void testMakeTransient() { pm = getPM(); createPersistentObjects(pm); runTestMakeTransient1(pm); runTestMakeTransientAll1(pm); runTestMakeTransientAll2(pm); pm.close(); pm = null; } /** */ private void createPersistentObjects(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); p1 = new PCPoint(1,3); p2 = new PCPoint(2,4); p3 = new PCPoint(3,5); p4 = new PCPoint(4,6); p5 = new PCPoint(5,7); pm.makePersistent(p1); pm.makePersistent(p2); pm.makePersistent(p3); pm.makePersistent(p4); pm.makePersistent(p5); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /* test makeTransient (Object pc) */ private void runTestMakeTransient1(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); pm.makeTransient(p1); tx.commit(); tx = null; if (!testState(p1, TRANSIENT, "transient")) { fail("expected TRANSIENT instance, instance " + p1 + " is " + getStateOfInstance(p1)); } } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /* test makeTransientAll (Collection pcs) */ private void runTestMakeTransientAll1(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); Collection col1 = new java.util.HashSet(); col1.add(p2); col1.add(p3); pm.makeTransientAll(col1); tx.commit(); tx = null; for (Iterator iter = col1.iterator(); iter.hasNext();) { PCPoint p = (PCPoint) iter.next(); if (!testState(p, TRANSIENT, "transient")) { fail("expected TRANSIENT instance, instance " + p1 + " is " + getStateOfInstance(p)); } } } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /* test makeTransientAll (Object[] o) */ private void runTestMakeTransientAll2(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { int NUM_OBJS = 2; tx.begin(); Collection col1 = new java.util.HashSet(); col1.add(p4); col1.add(p5); Object[] obj1= col1.toArray(); pm.makeTransientAll(obj1); tx.commit(); tx = null; for (int i=0; i < NUM_OBJS; ++i ) { PCPoint p = (PCPoint) obj1[i]; if (!testState(p, TRANSIENT, "transient")) { fail("expected TRANSIENT instance, instance " + p1 + " is " + getStateOfInstance(p)); } } } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/lifecycle/MakeTransientAllFails.java100664 11054 12500110374 32356 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.lifecycle; import java.util.Collection; import java.util.HashSet; import javax.jdo.JDOUserException; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.pc.mylib.Point; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; /** *Title:MakeTransientAll Fail *
*Keywords: exception *
*Assertion IDs: A12.5.7-3 *
*Assertion Description: If a collection or array of instances is passed to PersistenceManager.makeTransientAll, and one or more of the instances fail to complete the required operation, then all instances will be attempted, and a JDOUserException will be thrown which contains a nested exception array, each exception of which contains one of the failing instances. The succeeding instances will transition to the specified life cycle state, and the failing instances will remain in their current state. */ public class MakeTransientAllFails extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.7-3 (MakeTransientAllFails) failed: "; /** * The main 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(MakeTransientAllFails.class); } /** */ public void testMakeTransientAllFails() { pm = getPM(); runTestMakeTransientAllFails1(pm); runTestMakeTransientAllFails2(pm); pm.close(); pm = null; } /* test makeTansientAll (Collection pcs) */ private void runTestMakeTransientAllFails1(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); PCPoint np1 = new PCPoint (3,3); PCPoint np2 = new PCPoint (4,4); Point np3 = new Point (5,5); Collection col1 = new HashSet(); col1.add(np1); col1.add(np2); col1.add(np3); try { pm.makeTransientAll(col1); fail(ASSERTION_FAILED, "pm.makeTransientAll(Collection) should throw JDOUserException when called for a collection including an instance of a non-pc class"); } catch (JDOUserException ex) { // expected exception } tx.rollback(); } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /* test makeTransientAll (Object[] o) */ private void runTestMakeTransientAllFails2(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); PCPoint np1 = new PCPoint (3,3); PCPoint np2 = new PCPoint (4,4); Point np3 = new Point (5,5); Collection col1 = new java.util.HashSet(); col1.add(np1); col1.add(np2); col1.add(np3); Object[] obj1=col1.toArray(); try { pm.makeTransientAll(obj1); fail(ASSERTION_FAILED, "pm.makeTransientAll(Object[]) should throw JDOUserException when called for an array including an instance of a non-pc class"); } catch (JDOUserException ex) { // expected exception } tx.rollback(); } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } ././@LongLink100644 0 0 150 12500111677 10247 Lustar 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanager/lifecycle/MakeTransientCausesLossOfIdentity.javatck/src/java/org/apache/jdo/tck/api/persistencemanager/lifecycle/MakeTransientCausesLossOfIdentity.j100664 13522 12500110374 34264 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.lifecycle; import java.util.Collection; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; /** *Title: MakeTransientCausesLossOfIdentity *
*Keywords: transient identity *
*Assertion IDs: A12.5.7-14 *
*Assertion Description: PersistenceManager.makeTransient and makeTransientAll transition an instance to transient, causing it to lose its JDO identity. */ public class MakeTransientCausesLossOfIdentity extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.7-14 (MakeTransientCausesLossOfIdentity) failed: "; /** * The main 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(MakeTransientCausesLossOfIdentity.class); } private PCPoint p1 = null; private PCPoint p2 = null; private PCPoint p3 = null; private PCPoint p4 = null; private PCPoint p5 = null; /** */ public void testMakeTransientCausesLossOfIdentity() { pm = getPM(); createPersistentObjects(pm); runTestMakeTransientCausesLossOfIdentity1(pm); runTestMakeTransientCausesLossOfIdentityAll1(pm); runTestMakeTransientCausesLossOfIdentityAll2(pm); pm.close(); pm = null; } /** */ private void createPersistentObjects(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); p1 = new PCPoint(1,3); p2 = new PCPoint(2,4); p3 = new PCPoint(3,5); p4 = new PCPoint(4,6); p5 = new PCPoint(5,7); pm.makePersistent(p1); pm.makePersistent(p2); pm.makePersistent(p3); pm.makePersistent(p4); pm.makePersistent(p5); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /* test makeTransient (Object pc) */ private void runTestMakeTransientCausesLossOfIdentity1(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx = pm.currentTransaction(); tx.begin(); pm.makeTransient(p1); tx.commit(); Object oid = pm.getObjectId(p1); if (oid != null) { fail(ASSERTION_FAILED, "pm.getObjectId(p1) returned non null ObjectId " + oid + " for transient instance"); } } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /* test makeTransientAll (Collection pcs) */ private void runTestMakeTransientCausesLossOfIdentityAll1(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx = pm.currentTransaction(); tx.begin(); Collection col1 = new java.util.HashSet(); col1.add(p2); col1.add(p3); pm.makeTransientAll(col1); tx.commit(); Object oid1 = pm.getObjectId(p2); if (oid1 != null) { fail(ASSERTION_FAILED, "pm.getObjectId(p2) returned non null ObjectId " + oid1 + " for transient instance"); } Object oid2 = pm.getObjectId(p3); if (oid2 != null) { fail(ASSERTION_FAILED, "pm.getObjectId(p3) returned non null ObjectId " + oid2 + " for transient instance"); } } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /* test makeTransientAll (Object[] o) */ private void runTestMakeTransientCausesLossOfIdentityAll2(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx = pm.currentTransaction(); tx.begin(); Collection col1 = new java.util.HashSet(); col1.add(p4); col1.add(p5); Object[] obj1= col1.toArray(); pm.makeTransientAll(obj1); tx.commit(); Object oid1 = pm.getObjectId(p4); if (oid1 != null) { fail(ASSERTION_FAILED, "pm.getObjectId(p4) returned non null ObjectId " + oid1 + " for transient instance"); } Object oid2 = pm.getObjectId(p5); if (oid2 != null) { fail(ASSERTION_FAILED, "pm.getObjectId(p5) returned non null ObjectId " + oid2 + " for transient instance"); } } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } ././@LongLink100644 0 0 152 12500111677 10251 Lustar 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanager/lifecycle/MakeTransientFailsWithDirtyInstance.javatck/src/java/org/apache/jdo/tck/api/persistencemanager/lifecycle/MakeTransientFailsWithDirtyInstance100664 13243 12500110374 34344 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.lifecycle; import java.util.Collection; import java.util.HashSet; import javax.jdo.JDOUserException; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; /** *Title:MakeTransientFailsWithDirtyInstance *
*Keywords: exception *
*Assertion IDs: A12.5.7-16 *
*Assertion Description: If the instance passed to PersistenceManager.makeTransient or makeTransientAll is dirty, a JDOUserException is thrown. */ public class MakeTransientFailsWithDirtyInstance extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.7-16 (MakeTransientFailsWithDirtyInstance) failed: "; /** * The main 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(MakeTransientFailsWithDirtyInstance.class); } private PCPoint p1 = null; private PCPoint p2 = null; private PCPoint p3 = null; private PCPoint p4 = null; private PCPoint p5 = null; /** */ public void testMakeTransientFailsWithDirtyInstance() { pm = getPM(); createObjects(pm); runTestMakeTransient(pm); runTestMakeTransientAll1(pm); runTestMakeTransientAll2(pm); pm.close(); pm = null; } /** */ private void createObjects(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx = pm.currentTransaction(); tx.begin(); p1 = new PCPoint(1,3); p2 = new PCPoint(2,4); p3 = new PCPoint(3,5); p4 = new PCPoint(4,6); p5 = new PCPoint(5,7); pm.makePersistent(p1); pm.makePersistent(p2); pm.makePersistent(p3); pm.makePersistent(p4); pm.makePersistent(p5); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /* test makeTansient (Object pc) */ private void runTestMakeTransient(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); // make instance dirty p1.setX(100); try { pm.makeTransient(p1); fail(ASSERTION_FAILED, "pm.makeTransient should throw JDOUserException when called for P-DIRTY instance."); } catch (JDOUserException ex) { // expected exception } tx.rollback(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /* test makeTansientAll (Collection pcs) */ private void runTestMakeTransientAll1(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx = pm.currentTransaction(); tx.begin(); Collection col1 = new HashSet(); col1.add(p2); col1.add(p3); p2.setX(200); p3.setX(201); try { pm.makeTransientAll(col1); fail(ASSERTION_FAILED, "pm.makeTransientAll(Collection) should throw JDOUserException when called for a collection including P-DIRTY instances."); } catch (JDOUserException ex) { // expected exception } tx.rollback(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /* test makeTransientAll (Object[] o) */ private void runTestMakeTransientAll2(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); Collection col1 = new HashSet(); col1.add(p4); col1.add(p5); p4.setX(300); p5.setX(301); Object[] obj1=col1.toArray(); try { pm.makeTransientAll(obj1); fail(ASSERTION_FAILED, "pm.makeTransientAll(Object[]) should throw JDOUserException when called for an array including P-DIRTY instances."); } catch (JDOUserException ex) { // expected exception } tx.rollback(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } ././@LongLink100644 0 0 154 12500111677 10253 Lustar 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanager/lifecycle/MakeTransientFieldsPreservedUnchanged.javatck/src/java/org/apache/jdo/tck/api/persistencemanager/lifecycle/MakeTransientFieldsPreservedUnchang100664 17062 12500110374 34346 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.lifecycle; import java.util.Collection; import java.util.HashSet; import java.util.Iterator; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; /** *Title: MakeTransient Fields Preserved Unchanged *
*Keywords: transient *
*Assertion IDs: A12.5.7-15, A12.5.7-18 *
*Assertion Description: If the instance passed to PersistenceManager.makeTransient or makeTransientAll has field values (persistent-nontransactional or persistent-clean), the fields in the cache are preserved unchanged. The instance(s) are not modified in any way. */ public class MakeTransientFieldsPreservedUnchanged extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.7-15, A12.5.7-18 (MakeTransientFieldsPreservedUnchanged) failed: "; /** * The main 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(MakeTransientFieldsPreservedUnchanged.class); } private PCPoint p1 = null; private PCPoint p2 = null; private PCPoint p3 = null; private PCPoint p4 = null; private PCPoint p5 = null; private PCPoint np1 = null; private PCPoint np2 = null; private PCPoint np3 = null; private PCPoint np4 = null; private PCPoint np5 = null; /** */ public void testMakeTransientFieldsPreservedUnchanged() { pm = getPM(); createObjects(pm); runTestMakeTransientFieldsPreservedUnchanged1(pm); runTestMakeTransientFieldsPreservedUnchangedAll1(pm); runTestMakeTransientFieldsPreservedUnchangedAll2(pm); pm.close(); pm = null; } /** */ private void createObjects(PersistenceManager pm) { createPCleanObjects(pm); createPNonTransactionalObjects(pm); } /** */ private void createPCleanObjects(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { // create P-clean instances tx.setOptimistic(false); tx.begin(); p1 = new PCPoint(1,3); p2 = new PCPoint(2,4); p3 = new PCPoint(3,5); p4 = new PCPoint(4,6); p5 = new PCPoint(5,7); pm.makePersistent(p1); pm.makePersistent(p2); pm.makePersistent(p3); pm.makePersistent(p4); pm.makePersistent(p5); tx.commit(); tx.begin(); p1.getX(); p2.getX(); p3.getX(); p4.getX(); p5.getX(); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ private void createPNonTransactionalObjects(PersistenceManager pm) { if (isOptimisticSupported()) { Transaction tx = pm.currentTransaction(); try { tx.setOptimistic(true); tx.begin(); np1 = new PCPoint(1,3); np2 = new PCPoint(2,4); np3 = new PCPoint(3,5); np4 = new PCPoint(4,6); np5 = new PCPoint(5,7); pm.makePersistent(np1); pm.makePersistent(np2); pm.makePersistent(np3); pm.makePersistent(np4); pm.makePersistent(np5); tx.commit(); tx.begin(); np1.getX(); np2.getX(); np3.getX(); np4.getX(); np5.getX(); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } /* test makeTransient (Object pc) * instance passed has field values and is P-nontransactional * */ private void runTestMakeTransientFieldsPreservedUnchanged1(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); pm.makeTransient(p1); tx.commit(); tx = null; if (!testState(p1, TRANSIENT, "transient")) { fail(ASSERTION_FAILED, "expected TRANSIENT instance, instance " + p1 + " is " + getStateOfInstance(p1)); } } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /* test makeTransientAll (Collection pcs) */ private void runTestMakeTransientFieldsPreservedUnchangedAll1(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); Collection col1 = new HashSet(); col1.add(p2); col1.add(p3); pm.makeTransientAll(col1); tx.commit(); tx = null; for (Iterator iter = col1.iterator(); iter.hasNext();) { PCPoint p = (PCPoint) iter.next(); if (!testState(p, TRANSIENT, "transient")) { fail(ASSERTION_FAILED, "expected TRANSIENT instance, instance " + p + " is " + getStateOfInstance(p)); } } } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /* test makeTransientAll (Object[] o) */ private void runTestMakeTransientFieldsPreservedUnchangedAll2(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { int NUM_OBJS = 2; tx.begin(); Collection col1 = new HashSet(); col1.add(p4); col1.add(p5); Object[] obj1= col1.toArray(); pm.makeTransientAll(obj1); tx.commit(); tx = null; for (int i=0; i < NUM_OBJS; ++i ) { PCPoint p = (PCPoint) obj1[i]; if (!testState(p, TRANSIENT, "transient")) { fail(ASSERTION_FAILED, "expected TRANSIENT instance, instance " + p + " is " + getStateOfInstance(p)); } } } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } ././@LongLink100644 0 0 163 12500111677 10253 Lustar 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanager/lifecycle/MakeTransientHasNoEffectOnTransientInstances.javatck/src/java/org/apache/jdo/tck/api/persistencemanager/lifecycle/MakeTransientHasNoEffectOnTransient100664 11212 12500110374 34255 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.lifecycle; import java.util.Collection; import java.util.HashSet; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; /** *Title: MakeTransientHasNoEffectOnTransientInstances *
*Keywords: transient *
*Assertion IDs: A12.5.7-19 *
*Assertion Description: PersistenceManager.makeTransient and makeTransientAll have no effect if the parameter instance is transient. */ public class MakeTransientHasNoEffectOnTransientInstances extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.7-19 (MakeTransientHasNoEffectOnTransientInstances) failed: "; /** * The main 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(MakeTransientHasNoEffectOnTransientInstances.class); } private PCPoint p1 = null; private PCPoint p2 = null; private PCPoint p3 = null; private PCPoint p4 = null; private PCPoint p5 = null; /** */ public void testMakeTransientHasNoEffectOnTransientInstances() { pm = getPM(); createTransientObjects(); runTestMakeTransientHasNoEffectOnTransientInstances1(pm); runTestMakeTransientHasNoEffectOnTransientInstancesAll1(pm); runTestMakeTransientHasNoEffectOnTransientInstancesAll2(pm); pm.close(); pm = null; } /** */ private void createTransientObjects() { p1 = new PCPoint(1,3); p2 = new PCPoint(2,4); p3 = new PCPoint(3,5); p4 = new PCPoint(4,6); p5 = new PCPoint(5,7); } /* test makeTransient (Object pc) */ private void runTestMakeTransientHasNoEffectOnTransientInstances1( PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); pm.makeTransient(p1); tx.commit(); tx = null; if (debug) logger.debug (" \nPASSED in runTestMakeTransientHasNoEffectOnTransientInstances()"); } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /* test makeTransientAll (Collection pcs) */ private void runTestMakeTransientHasNoEffectOnTransientInstancesAll1(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); Collection col1 = new HashSet(); col1.add(p2); col1.add(p3); pm.makeTransientAll(col1); tx.commit(); tx = null; if (debug) logger.debug(" \nPASSED in runTestMakeTransientHasNoEffectOnTransientInstancesAll1()"); } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /* test makeTransientAll (Object[] o) */ private void runTestMakeTransientHasNoEffectOnTransientInstancesAll2( PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); Collection col1 = new HashSet(); col1.add(p4); col1.add(p5); Object[] obj1= col1.toArray(); pm.makeTransientAll(obj1); tx.commit(); tx = null; if (debug) logger.debug (" \nPASSED in runTestMakeTransientHasNoEffectOnTransientInstancesAll2()"); } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } ././@LongLink100644 0 0 150 12500111677 10247 Lustar 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanager/lifecycle/MakeTransientNotSubjectToRollback.javatck/src/java/org/apache/jdo/tck/api/persistencemanager/lifecycle/MakeTransientNotSubjectToRollback.j100664 13516 12500110374 34241 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.lifecycle; import java.util.Collection; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.api.persistencemanager.PersistenceManagerTest; /** *Title: MakeTransientNotSubjectToRollback *
*Keywords: *
*Assertion IDs: A12.5.7-17 *
*Assertion Description: The effect of PersistenceManager.makeTransient or makeTransientAll is immediate and not subject to rollback. */ public class MakeTransientNotSubjectToRollback extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.7-17 (MakeTransientNotSubjectToRollback) failed: "; /** * The main 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(MakeTransientNotSubjectToRollback.class); } private PCPoint p1 = null; private PCPoint p2 = null; private PCPoint p3 = null; private PCPoint p4 = null; private PCPoint p5 = null; /** */ public void testMakeTransientNotSubjectToRollback() { pm = getPM(); createPersistentObjects(pm); runTestMakeTransientNotSubjectToRollback1(pm); runTestMakeTransientNotSubjectToRollbackAll1(pm); runTestMakeTransientNotSubjectToRollbackAll2(pm); pm.close(); pm = null; } /** */ private void createPersistentObjects(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); p1 = new PCPoint(1,3); p2 = new PCPoint(2,4); p3 = new PCPoint(3,5); p4 = new PCPoint(4,6); p5 = new PCPoint(5,7); pm.makePersistent(p1); pm.makePersistent(p2); pm.makePersistent(p3); pm.makePersistent(p4); pm.makePersistent(p5); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /* test makeTransient (Object pc) */ private void runTestMakeTransientNotSubjectToRollback1(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); pm.makeTransient(p1); int curr1 = currentState(p1); tx.rollback(); if (curr1 != currentState(p1)) { fail(ASSERTION_FAILED, "expected TRANSIENT instancew, instance " + p1 + " is " + getStateOfInstance(p1)); } } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /* test makeTransientAll (Collection pcs) */ private void runTestMakeTransientNotSubjectToRollbackAll1(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); Collection col1 = new java.util.HashSet(); col1.add(p2); col1.add(p3); pm.makeTransientAll(col1); int p2_curr = currentState(p2); int p3_curr = currentState(p3); tx.rollback(); if (p2_curr != currentState(p2)) { fail(ASSERTION_FAILED, "expected TRANSIENT instancew, instance " + p2 + " is " + getStateOfInstance(p2)); } if (p3_curr != currentState(p3)) { fail(ASSERTION_FAILED, "expected TRANSIENT instancew, instance " + p3 + " is " + getStateOfInstance(p3)); } } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /* test makeTransientAll (Object[] o) */ private void runTestMakeTransientNotSubjectToRollbackAll2(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); Collection col1 = new java.util.HashSet(); col1.add(p4); col1.add(p5); Object[] obj1= col1.toArray(); pm.makeTransientAll(obj1); int p4_curr = currentState(p4); int p5_curr = currentState(p5); tx.rollback(); if (p4_curr != currentState(p4)) { fail(ASSERTION_FAILED, "expected TRANSIENT instancew, instance " + p4 + " is " + getStateOfInstance(p2)); } if (p5_curr != currentState(p5)) { fail(ASSERTION_FAILED, "expected TRANSIENT instancew, instance " + p5 + " is " + getStateOfInstance(p5)); } } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/NewInstance.java100664 10755 12500110374 26467 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.newInstance.AAddress; import org.apache.jdo.tck.pc.newInstance.Address; import org.apache.jdo.tck.pc.newInstance.IAddress; import org.apache.jdo.tck.pc.newInstance.AAddress_bad; import org.apache.jdo.tck.pc.newInstance.Address_bad; import org.apache.jdo.tck.pc.newInstance.IAddress_bad; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Delete Persistent *
*Keywords: *
*Assertion IDs: A12.6.6-2 *
*Assertion Description: * Persistent properties declared in the interface are defined as those that have both a get and a set method * or both an is and a set method, named according to the JavaBeans naming conventions, and * of a type supported as a persistent type. * The implementing class will provide a suitable implementation for all property access methods and * will throw JDOUserException for all other methods of the interface. */ public class NewInstance extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.6.6-2 (NewInstance) failed: "; /** * The main 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(NewInstance.class); } /** test newInstance (Class pcInterface) */ public void testNewInstanceInterface() { pm = getPM(); IAddress instance = pm.newInstance(IAddress.class); } /** test newInstance (Class pcAbstractClass) */ public void testNewInstanceAbstractClass() { pm = getPM(); AAddress instance = pm.newInstance(AAddress.class); } /** test newInstance (Class pcClass) */ public void testNewInstanceClass() { pm = getPM(); Address instance = pm.newInstance(Address.class); } /** test newInstance (Class pcInterface) */ public void testNewInstanceInterfaceBad() { pm = getPM(); try { pm.newInstance(IAddress_bad.class); fail("Expected JDOUserException but no exception thrown. " + "Interface contains a method that is not property."); } catch (javax.jdo.JDOUserException jdoe) { // Expected exception } catch (Exception e) { fail("Expected JDOUserException but " + e.getMessage() + " thrown instead."); } } /** test newInstance (Class pcAbstractClass) */ public void testNewInstanceAbstractClassBad() { pm = getPM(); try { pm.newInstance(AAddress_bad.class); fail("Expected JDOUserException but no exception thrown. " + "Abstract class contains a method that is not property."); } catch (javax.jdo.JDOUserException jdoe) { // Expected exception } catch (Exception e) { fail("Expected JDOUserException but " + e.getMessage() + "t hrown instead."); } } /** test newInstance (Class pcClass) */ public void testNewInstanceClassBad() { pm = getPM(); try { pm.newInstance(Address_bad.class); fail("Expected JDOUserException but no exception thrown. " + "Class contains non-public no-args constructor."); } catch (javax.jdo.JDOUserException jdoe) { // Expected exception } catch (Exception e) { fail("Expected JDOUserException but " + e.getMessage() + " thrown instead."); } } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/NoPersistenceManagerIfTransient.java100664 3663 12500110374 32454 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: No PersistenceManager If Transient *
*Keywords: transient *
*Assertion ID: A12.5-1. *
*Assertion Description: A JDO Instance is associated with no PersistenceManager if and only if the instance is in the transient state. This is a duplicate of A8.1-2. */ public class NoPersistenceManagerIfTransient extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5-1 (NoPersistenceManagerIfTransient) failed: "; /** * The main 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(NoPersistenceManagerIfTransient.class); } /** */ public void test() { if (debug) logger.debug("org.apache.jdo.tck.api.persistencemanager.NoPersistenceManagerIfTransient duplicate of A8.1-2."); } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/nullargs/DeletePersistentNullArgs.java100664 7703 12500110374 33012 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.nullargs; import java.util.Collection; import javax.jdo.JDOUserException; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: deletePersistent with Null Arguments *
*Keywords: *
*Assertion IDs: A12.6-3, A12.6-4, A12.6-5 *
*Assertion Description: A12.6-3 [Null arguments to APIs that take an Object parameter cause the API to have no effect.] A12.6-4 [Null arguments to APIs that take Object[] or Collection will cause the API to throw NullPointerException.] A12.6-5 [Non-null Object[] or Collection arguments that contain null elements will have the documented behavior for non-null elements, and the null elements will be ignored.] */ public class DeletePersistentNullArgs extends PersistenceManagerNullsTest { /** * The main 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(DeletePersistentNullArgs.class); } static MethodUnderTest deletePersistent = new MethodUnderTestDeletePersistent(); static class MethodUnderTestDeletePersistent extends MethodUnderTest { public void pmApi(PersistenceManager pm, Object pc) { pm.deletePersistent(pc); } public void pmApi(PersistenceManager pm, Collection pcs) { pm.deletePersistentAll(pcs); } public void pmApi(PersistenceManager pm, Object[] pcs) { pm.deletePersistentAll(pcs); } }; /** * Test that deletePersistent() with null valued argument does nothing. */ public void testDeletePersistentNullObject() { executeNullObjectParameter(deletePersistent, "deletePersistent(null)"); } /** * Test that deletePersistentAll() with null valued Collection argument * throws NullPointerException. */ public void testDeletePersistentNullCollection() { executeNullCollectionParameter(deletePersistent, "deletePersistentAll((Collection)null)"); } /** * Test that deletePersistentAll() with null valued array argument * throws NullPointerException. */ public void testDeletePersistentNullArray() { executeNullArrayParameter(deletePersistent, "deletePersistentAll((Object[])null)"); } /** * Test that deletePersistentAll() with a null element of a * Collection argument throws NullPointerException. */ public void testDeletePersistentCollectionNullElement() { executeCollectionNullElement(collNullElem, deletePersistent, "deletePersistentAll(Collection)"); } /** * Test that deletePersistentAll() with a null element of a * array argument throws NullPointerException. */ public void testDeletePersistentArrayNullElement() { executeArrayNullElement(arrayNullElem, deletePersistent, "deletePersistentAll(Object[])"); } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/nullargs/DetachCopyNullArgs.java100664 7524 12500110374 31553 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.nullargs; import java.util.Collection; import javax.jdo.JDOUserException; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: detachCopy with Null Arguments *
*Keywords: *
*Assertion IDs: A12.6-3, A12.6-4, A12.6-5 *
*Assertion Description: A12.6-3 [Null arguments to APIs that take an Object parameter cause the API to have no effect.] A12.6-4 [Null arguments to APIs that take Object[] or Collection will cause the API to throw NullPointerException.] A12.6-5 [Non-null Object[] or Collection arguments that contain null elements will have the documented behavior for non-null elements, and the null elements will be ignored.] */ public class DetachCopyNullArgs extends PersistenceManagerNullsTest { /** * The main 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(DetachCopyNullArgs.class); } static MethodUnderTest detachCopy = new MethodUnderTestDetachCopy(); static class MethodUnderTestDetachCopy extends MethodUnderTest { public Object pmApiReturn(PersistenceManager pm, Object pc) { return pm.detachCopy(pc); } public Collection pmApiReturn(PersistenceManager pm, Collection pcs) { return pm.detachCopyAll(pcs); } public Object[] pmApiReturn(PersistenceManager pm, Object[] pcs) { return pm.detachCopyAll(pcs); } }; /** * Test that detachCopy() with null valued argument does nothing. */ public void testDetachCopyNullObject() { executeNullObjectParameterReturn(detachCopy, "detachCopy(null)"); } /** * Test that detachCopyAll() with null valued Collection argument * throws NullPointerException. */ public void testDetachCopyNullCollection() { executeNullCollectionParameterReturn(detachCopy, "detachCopyAll((Collection)null)"); } /** * Test that detachCopyAll() with null valued array argument * throws NullPointerException. */ public void testDetachCopyNullArray() { executeNullArrayParameterReturn(detachCopy, "detachCopyAll((Array)null)"); } /** * Test that detachCopyAll() with a null element of a * Collection argument throws NullPointerException. */ public void testDetachCopyCollectionNullElement() { executeCollectionNullElementReturn(collNullElem, detachCopy, "detachCopyAll(Collection)"); } /** * Test that detachCopyAll() with a null element of a * array argument throws NullPointerException. */ public void testDetachCopyArrayNullElement() { executeArrayNullElementReturn(arrayNullElem, detachCopy, "detachCopyAll(Array)"); } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/nullargs/EvictNullArgs.java100664 7204 12500110374 30575 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.nullargs; import java.util.Collection; import javax.jdo.JDOUserException; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: evict with Null Arguments *
*Keywords: *
*Assertion IDs: A12.6-3, A12.6-4, A12.6-5 *
*Assertion Description: A12.6-3 [Null arguments to APIs that take an Object parameter cause the API to have no effect.] A12.6-4 [Null arguments to APIs that take Object[] or Collection will cause the API to throw NullPointerException.] A12.6-5 [Non-null Object[] or Collection arguments that contain null elements will have the documented behavior for non-null elements, and the null elements will be ignored.] */ public class EvictNullArgs extends PersistenceManagerNullsTest { /** * The main 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(EvictNullArgs.class); } static MethodUnderTest evict = new MethodUnderTestEvict(); static class MethodUnderTestEvict extends MethodUnderTest { public void pmApi(PersistenceManager pm, Object pc) { pm.evict(pc); } public void pmApi(PersistenceManager pm, Collection pcs) { pm.evictAll(pcs); } public void pmApi(PersistenceManager pm, Object[] pcs) { pm.evictAll(pcs); } }; /** * Test that evict() with null valued argument does nothing. */ public void testEvictNullObject() { executeNullObjectParameter(evict, "evict(null)"); } /** * Test that evictAll() with null valued Collection argument * throws NullPointerException. */ public void testEvictNullCollection() { executeNullCollectionParameter(evict, "evictAll((Collection)null)"); } /** * Test that evictAll() with null valued array argument * throws NullPointerException. */ public void testEvictNullArray() { executeNullArrayParameter(evict, "evictAll((Object[])null)"); } /** * Test that evictAll() with a null element of a * Collection argument throws NullPointerException. */ public void testEvictCollectionNullElement() { executeCollectionNullElement(collNullElem, evict, "evictAll(Collection)"); } /** * Test that evictAll() with a null element of a * array argument throws NullPointerException. */ public void testEvictArrayNullElement() { executeArrayNullElement(arrayNullElem, evict, "evictAll(Object[])"); } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/nullargs/MakeNontransactionalNullArgs.java100664 10067 12500110374 33657 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.nullargs; import java.util.Collection; import javax.jdo.JDOUserException; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: makeNontransactional with Null Arguments *
*Keywords: *
*Assertion IDs: A12.6-3, A12.6-4, A12.6-5 *
*Assertion Description: A12.6-3 [Null arguments to APIs that take an Object parameter cause the API to have no effect.] A12.6-4 [Null arguments to APIs that take Object[] or Collection will cause the API to throw NullPointerException.] A12.6-5 [Non-null Object[] or Collection arguments that contain null elements will have the documented behavior for non-null elements, and the null elements will be ignored.] */ public class MakeNontransactionalNullArgs extends PersistenceManagerNullsTest { /** * The main 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(MakeNontransactionalNullArgs.class); } static MethodUnderTest makeNontransactional = new MethodUnderTestMakeNontransactional(); static class MethodUnderTestMakeNontransactional extends MethodUnderTest { public void pmApi(PersistenceManager pm, Object pc) { pm.makeNontransactional(pc); } public void pmApi(PersistenceManager pm, Collection pcs) { pm.makeNontransactionalAll(pcs); } public void pmApi(PersistenceManager pm, Object[] pcs) { pm.makeNontransactionalAll(pcs); } }; /** * Test that makeNontransactional() with null valued argument does nothing. */ public void testMakeNontransactionalNullObject() { executeNullObjectParameter(makeNontransactional, "makeNontransactional(null)"); } /** * Test that makeNontransactionalAll() with null valued Collection argument * throws NullPointerException. */ public void testMakeNontransactionalNullCollection() { executeNullCollectionParameter(makeNontransactional, "makeNontransactionalAll((Collection)null)"); } /** * Test that makeNontransactionalAll() with null valued array argument * throws NullPointerException. */ public void testMakeNontransactionalNullArray() { executeNullArrayParameter(makeNontransactional, "makeNontransactionalAll((Object[])null)"); } /** * Test that makeNontransactionalAll() with a null element of a * Collection argument throws NullPointerException. */ public void testMakeNontransactionalCollectionNullElement() { executeCollectionNullElement(collNullElem, makeNontransactional, "makeNontransactionalAll(Collection)"); } /** * Test that makeNontransactionalAll() with a null element of a * array argument throws NullPointerException. */ public void testMakeNontransactionalArrayNullElement() { executeArrayNullElement(arrayNullElem, makeNontransactional, "makeNontransactionalAll(Object[])"); } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/nullargs/MakePersistentNullArgs.java100664 7710 12500110374 32463 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.nullargs; import java.util.Collection; import javax.jdo.JDOUserException; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: makePersistent with Null Arguments *
*Keywords: *
*Assertion IDs: A12.6-3, A12.6-4, A12.6-5 *
*Assertion Description: A12.6-3 [Null arguments to APIs that take an Object parameter cause the API to have no effect.] A12.6-4 [Null arguments to APIs that take Object[] or Collection will cause the API to throw NullPointerException.] A12.6-5 [Non-null Object[] or Collection arguments that contain null elements will have the documented behavior for non-null elements, and the null elements will be ignored.] */ public class MakePersistentNullArgs extends PersistenceManagerNullsTest { /** * The main 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(MakePersistentNullArgs.class); } static MethodUnderTest makePersistent = new MethodUnderTestMakePersistent(); static class MethodUnderTestMakePersistent extends MethodUnderTest { public Object pmApiReturn(PersistenceManager pm, Object pc) { return pm.makePersistent(pc); } public Collection pmApiReturn(PersistenceManager pm, Collection pcs) { return pm.makePersistentAll(pcs); } public Object[] pmApiReturn(PersistenceManager pm, Object[] pcs) { return pm.makePersistentAll(pcs); } }; /** * Test that makePersistent() with null valued argument does nothing. */ public void testMakePersistentNullObject() { executeNullObjectParameterReturn(makePersistent, "makePersistent(null)"); } /** * Test that makePersistentAll() with null valued Collection argument * throws NullPointerException. */ public void testMakePersistentNullCollection() { executeNullCollectionParameterReturn(makePersistent, "makePersistentAll((Collection)null)"); } /** * Test that makePersistentAll() with null valued array argument * throws NullPointerException. */ public void testMakePersistentNullArray() { executeNullArrayParameterReturn(makePersistent, "makePersistentAll((Array)null)"); } /** * Test that makePersistentAll() with a null element of a * Collection argument throws NullPointerException. */ public void testMakePersistentCollectionNullElement() { executeCollectionNullElementReturn(collNullElem, makePersistent, "makePersistentAll(Collection)"); } /** * Test that makePersistentAll() with a null element of a * array argument throws NullPointerException. */ public void testMakePersistentArrayNullElement() { executeArrayNullElementReturn(arrayNullElem, makePersistent, "makePersistentAll(Array)"); } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/nullargs/MakeTransactionalNullArgs.java100664 7740 12500110374 33130 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.nullargs; import java.util.Collection; import javax.jdo.JDOUserException; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: makeTransactional with Null Arguments *
*Keywords: *
*Assertion IDs: A12.6-3, A12.6-4, A12.6-5 *
*Assertion Description: A12.6-3 [Null arguments to APIs that take an Object parameter cause the API to have no effect.] A12.6-4 [Null arguments to APIs that take Object[] or Collection will cause the API to throw NullPointerException.] A12.6-5 [Non-null Object[] or Collection arguments that contain null elements will have the documented behavior for non-null elements, and the null elements will be ignored.] */ public class MakeTransactionalNullArgs extends PersistenceManagerNullsTest { /** * The main 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(MakeTransactionalNullArgs.class); } static MethodUnderTest makeTransactional = new MethodUnderTestMakeTransactional(); static class MethodUnderTestMakeTransactional extends MethodUnderTest { public void pmApi(PersistenceManager pm, Object pc) { pm.makeTransactional(pc); } public void pmApi(PersistenceManager pm, Collection pcs) { pm.makeTransactionalAll(pcs); } public void pmApi(PersistenceManager pm, Object[] pcs) { pm.makeTransactionalAll(pcs); } }; /** * Test that makeTransactional() with null valued argument does nothing. */ public void testMakeTransactionalNullObject() { executeNullObjectParameter(makeTransactional, "makeTransactional(null)"); } /** * Test that makeTransactionalAll() with null valued Collection argument * throws NullPointerException. */ public void testMakeTransactionalNullCollection() { executeNullCollectionParameter(makeTransactional, "makeTransactionalAll((Collection)null)"); } /** * Test that makeTransactionalAll() with null valued array argument * throws NullPointerException. */ public void testMakeTransactionalNullArray() { executeNullArrayParameter(makeTransactional, "makeTransactionalAll((Object[])null)"); } /** * Test that makeTransactionalAll() with a null element of a * Collection argument throws NullPointerException. */ public void testMakeTransactionalCollectionNullElement() { executeCollectionNullElement(collNullElem, makeTransactional, "makeTransactionalAll(Collection)"); } /** * Test that makeTransactionalAll() with a null element of a * array argument throws NullPointerException. */ public void testMakeTransactionalArrayNullElement() { executeArrayNullElement(arrayNullElem, makeTransactional, "makeTransactionalAll(Object[])"); } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/nullargs/MakeTransientNullArgs.java100664 7554 12500110374 32300 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.nullargs; import java.util.Collection; import javax.jdo.JDOUserException; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: makeTransient with Null Arguments *
*Keywords: *
*Assertion IDs: A12.6-3, A12.6-4, A12.6-5 *
*Assertion Description: A12.6-3 [Null arguments to APIs that take an Object parameter cause the API to have no effect.] A12.6-4 [Null arguments to APIs that take Object[] or Collection will cause the API to throw NullPointerException.] A12.6-5 [Non-null Object[] or Collection arguments that contain null elements will have the documented behavior for non-null elements, and the null elements will be ignored.] */ public class MakeTransientNullArgs extends PersistenceManagerNullsTest { /** * The main 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(MakeTransientNullArgs.class); } static MethodUnderTest makeTransient = new MethodUnderTestMakeTransient(); static class MethodUnderTestMakeTransient extends MethodUnderTest { public void pmApi(PersistenceManager pm, Object pc) { pm.makeTransient(pc); } public void pmApi(PersistenceManager pm, Collection pcs) { pm.makeTransientAll(pcs); } public void pmApi(PersistenceManager pm, Object[] pcs) { pm.makeTransientAll(pcs); } }; /** * Test that makeTransient() with null valued argument does nothing. */ public void testMakeTransientNullObject() { executeNullObjectParameter(makeTransient, "makeTransient(null)"); } /** * Test that makeTransientAll() with null valued Collection argument * throws NullPointerException. */ public void testMakeTransientNullCollection() { executeNullCollectionParameter(makeTransient, "makeTransientAll((Collection)null)"); } /** * Test that makeTransientAll() with null valued array argument * throws NullPointerException. */ public void testMakeTransientNullArray() { executeNullArrayParameter(makeTransient, "makeTransientAll((Object[])null)"); } /** * Test that makeTransientAll() with a null element of a * Collection argument throws NullPointerException. */ public void testMakeTransientCollectionNullElement() { executeCollectionNullElement(collNullElem, makeTransient, "makeTransientAll(Collection)"); } /** * Test that makeTransientAll() with a null element of a * array argument throws NullPointerException. */ public void testMakeTransientArrayNullElement() { executeArrayNullElement(arrayNullElem, makeTransient, "makeTransientAll(Object[])"); } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/nullargs/PersistenceManagerNullsTest.java100664 42660 12500110374 33535 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.nullargs; import java.util.Arrays; import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import javax.jdo.JDOHelper; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; /** * The superclass for the tests of null arguments to pm methods. * * Null arguments to APIs that take an Object parameter cause the API * to have no effect. Null arguments to APIs that take Object[] or Collection * will cause the API to throw NullPointerException. Non-null Object[] or * Collection arguments that contain null elements will have the documented * behavior for non-null elements, and the null elements will be ignored. * */ public class PersistenceManagerNullsTest extends JDO_Test { /** public static interface MethodUnderTest { public void pmApi(PersistenceManager pm, Object obj); public void pmApi(PersistenceManager pm, Collection coll); public void pmApi(PersistenceManager pm, Object[] objs); public Object pmApiReturn(PersistenceManager pm, Object obj); public Collection pmApiReturn(PersistenceManager pm, Collection coll); public Object[] pmApiReturn(PersistenceManager pm, Object [ ] objs); } */ /** */ public static class MethodUnderTest { public void pmApi(PersistenceManager pm, Object obj) { throw new UnsupportedOperationException("Test must implement this method"); } public void pmApi(PersistenceManager pm, Collection coll) { throw new UnsupportedOperationException("Test must implement this method"); } public void pmApi(PersistenceManager pm, Object[] objs) { throw new UnsupportedOperationException("Test must implement this method"); } public Object pmApiReturn(PersistenceManager pm, Object obj) { throw new UnsupportedOperationException("Test must implement this method"); } public Collection pmApiReturn(PersistenceManager pm, Collection coll) { throw new UnsupportedOperationException("Test must implement this method"); } public Object[] pmApiReturn(PersistenceManager pm, Object[] objs) { throw new UnsupportedOperationException("Test must implement this method"); } } private static final String ASSERTION3_FAILED = "Assertion A12.6-3 failed: "; private static final String ASSERTION4_FAILED = "Assertion A12.6-4 failed: "; private static final String ASSERTION5_FAILED = "Assertion A12.6-5 failed: "; protected PCPoint pNotNull = null; protected Collection collNullElem = null; protected Collection expectedCollection = null; protected Object[] arrayNullElem = new Object[] {null, null}; protected Object[] expectedArray = new Object[] {null, null}; protected Collection testInstances = null; /** */ protected PersistenceManagerNullsTest() { } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { // The order of addTearDownClass calls is significant // as it takes into account database FKs. addTearDownClass(PCPoint.class); // Initialize test objects and expected values pNotNull = new PCPoint(3, 5); arrayNullElem[1] = pNotNull; expectedArray[1] = pNotNull; collNullElem = Arrays.asList(arrayNullElem); pm = getPM(); Transaction tx = pm.currentTransaction(); try { tx = pm.currentTransaction(); tx.begin(); try { pm.makePersistent(pNotNull); } catch (Exception e) { e.printStackTrace(); } tx.commit(); logger.debug(" \nSetup committed in DeletePersistentNullArgs()"); } finally { if (tx.isActive()) { tx.rollback(); } } expectedCollection = Arrays.asList(arrayNullElem); } protected static String toString(Object[] objs) { StringBuffer out = new StringBuffer(); for (int i=0; i < objs.length; i++) { out.append("[" + i + "]: "); if (objs[i] == null) out.append("null"); else out.append(objs[i].toString()); out.append(", "); } return out.toString(); } protected static String toString(Collection objs) { return toString(objs.toArray()); } /** * Checks if expected and actual arguments match for null/non-null value * @return true if arguments match * @param expected Collection * @param actual Collection */ protected boolean checkReturn(Collection expected, Collection actual) { Object eElem = null; Object aElem = null; if (expected.size() != actual.size()) return false; Iterator eIt = expected.iterator(); Iterator aIt = actual.iterator(); while (eIt.hasNext()) { eElem = eIt.next(); aElem = aIt.next(); if ( (eElem == null && aElem != null) || (aElem == null && eElem != null) ) return false; } return true; } /** * Checks if expected and actual arguments match for null/non-null value * @return true if arguments match * @param expected Object[] * @param actual Object[] */ protected boolean checkReturn(Object[] expected, Object[] actual) { Object eElem = null; Object aElem = null; if (expected.length != actual.length) return false; for (int i=0; i < expected.length; i++) { eElem = expected[i]; aElem = actual[i]; if ( (eElem == null && aElem != null) || (aElem == null && eElem != null) ) return false; } return true; } /** * Test that method under test with null valued argument does nothing. */ public void executeNullObjectParameter(MethodUnderTest mut, String method) { Transaction tx = pm.currentTransaction(); Object obj = null; try { tx = pm.currentTransaction(); tx.begin(); try { mut.pmApi(pm, obj); } catch (Exception e) { fail(ASSERTION3_FAILED, method + " on a null object should do nothing." + " Instead we get: " + e.toString()); } tx.commit(); logger.debug(" \nPASSED in executeNullObjectParameter() on " + method); } finally { if (tx.isActive()) tx.rollback(); } } /** * Test that the method under test with null valued Collection argument * throws NullPointerException. */ public void executeNullCollectionParameter(MethodUnderTest mut, String method) { Collection coll = null; Transaction tx = pm.currentTransaction(); try { tx.begin(); try { mut.pmApi(pm, coll); fail(ASSERTION4_FAILED, method + " with null Collection argument should throw NPE."); } catch (NullPointerException npe) { // this is what we want } catch (Exception e) { fail(ASSERTION4_FAILED, method + " with null Collection argument should throw NPE." + " Instead we get: " + e.toString()); e.printStackTrace(); } tx.commit(); logger.debug(" \nPASSED in executeNullCollectionParameter()"); } finally { if (tx.isActive()) tx.rollback(); } } /** * Test that the method under test with null valued array argument * throws NullPointerException. */ public void executeNullArrayParameter(MethodUnderTest mut, String method) { Object[] array = null; Transaction tx = pm.currentTransaction(); try { tx.begin(); try { mut.pmApi(pm, array); fail(ASSERTION4_FAILED, method + " with null array argument should throw NPE."); } catch (NullPointerException npe) { // this is what we want } catch (Exception e) { fail(ASSERTION4_FAILED, method + " with null array argument should throw NPE." + " Instead we get: " + e.toString()); e.printStackTrace(); } tx.commit(); logger.debug(" \nPASSED in executeNullArrayParameter()"); } finally { if (tx.isActive()) tx.rollback(); } } /** * Test that the method under test with a null element of a * Collection argument ignores the null element. */ public void executeCollectionNullElement(Collection coll, MethodUnderTest mut, String method) { Transaction tx = pm.currentTransaction(); try { tx = pm.currentTransaction(); tx.begin(); try { mut.pmApi(pm, coll); } catch (Exception e) { fail(ASSERTION5_FAILED, method + " on a null Collection element should" + " do nothing. Instead we get: " + e.toString()); e.printStackTrace(); } tx.commit(); } finally { if (tx.isActive()) tx.rollback(); } } /** * Test that the method under test with a null element of a * array argument ignores the null element. */ public void executeArrayNullElement(Object[] array, MethodUnderTest mut, String method) { Transaction tx = pm.currentTransaction(); try { tx = pm.currentTransaction(); tx.begin(); try { mut.pmApi(pm, array); } catch (Exception e) { fail(ASSERTION5_FAILED, method + " on a null array element should " + "do nothing. Instead we get: " + e.toString()); e.printStackTrace(); } tx.commit(); } finally { if (tx.isActive()) tx.rollback(); } } /** * Test that method under test with null valued argument does nothing. */ public void executeNullObjectParameterReturn(MethodUnderTest mut, String method) { Object returnVal = null; Object obj = null; Transaction tx = pm.currentTransaction(); try { tx = pm.currentTransaction(); tx.begin(); try { returnVal = mut.pmApiReturn(pm, obj); } catch (Exception e) { fail(ASSERTION3_FAILED, method + " on a null object should do nothing." + " Instead we get: " + e.toString()); e.printStackTrace(); } if (returnVal != null) fail(ASSERTION3_FAILED, method + " returns non-null Object; expected null."); tx.commit(); logger.debug(" \nPASSED in executeNullObjectParameter() on " + method); } finally { if (tx.isActive()) tx.rollback(); } } /** * Test that the method under test with null valued Collection argument * throws NullPointerException. */ public void executeNullCollectionParameterReturn( MethodUnderTest mut, String method) { Collection returnVal = null; Collection coll = null; Transaction tx = pm.currentTransaction(); try { tx.begin(); try { returnVal = mut.pmApiReturn(pm, coll); fail(ASSERTION4_FAILED, method + " with null Collection argument should throw NPE."); } catch (NullPointerException npe) { // this is what we want } catch (Exception e) { fail(ASSERTION4_FAILED, method + " with null Collection argument should throw NPE." + " Instead we get: " + e.toString()); e.printStackTrace(); } if (returnVal != null) fail(ASSERTION4_FAILED, method + " returns non-null Object. "); tx.commit(); logger.debug(" \nPASSED in executeNullCollectionParameter()"); } finally { if (tx.isActive()) tx.rollback(); } } /** * Test that the method under test with null valued array argument * throws NullPointerException. */ public void executeNullArrayParameterReturn(MethodUnderTest mut, String method) { Object[] returnVal = null; Object[] array = null; Transaction tx = pm.currentTransaction(); try { tx.begin(); try { returnVal = mut.pmApiReturn(pm, array); fail(ASSERTION4_FAILED, method + " with null array argument should throw NPE."); } catch (NullPointerException npe) { // this is what we want } catch (Exception e) { fail(ASSERTION4_FAILED, method + " with null array argument should throw NPE." + " Instead we get: " + e.toString()); e.printStackTrace(); } if (returnVal != null) fail(ASSERTION4_FAILED, method + " returns non-null Object."); tx.commit(); logger.debug(" \nPASSED in executeNullArrayParameter()"); } finally { if (tx.isActive()) tx.rollback(); } } /** * Test that the method under test with a null element of a * Collection argument ignores the null element. */ public void executeCollectionNullElementReturn(Collection coll, MethodUnderTest mut, String method) { Collection returnVal = null; Transaction tx = pm.currentTransaction(); try { tx = pm.currentTransaction(); tx.begin(); try { returnVal = mut.pmApiReturn(pm, coll); } catch (Exception e) { fail(ASSERTION5_FAILED, method + " on a null Collection element should" + " do nothing. Instead we get: " + e.toString()); e.printStackTrace(); } if (!checkReturn(expectedCollection, returnVal)) fail(ASSERTION5_FAILED, method + " returns incorrect Object. Expected " + expectedCollection.toString() + " actual was " + returnVal.toString()); tx.commit(); } finally { if (tx.isActive()) tx.rollback(); } } /** * Test that the method under test with a null element of a * array argument ignores the null element. */ public void executeArrayNullElementReturn(Object[] obj, MethodUnderTest mut, String method) { Object[] returnVal = null; Transaction tx = pm.currentTransaction(); try { tx = pm.currentTransaction(); tx.begin(); try { returnVal = mut.pmApiReturn(pm, obj); } catch (Exception e) { fail(ASSERTION5_FAILED, method + " on a null array element should " + "do nothing. Instead we get: " + e.toString()); e.printStackTrace(); } if (!checkReturn(expectedArray, returnVal)) fail(ASSERTION5_FAILED, method + " returns incorrect Object. Expected " + Arrays.asList(expectedArray).toString() + " actual was " + Arrays.asList(returnVal).toString()); tx.commit(); } finally { if (tx.isActive()) tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/nullargs/RefreshNullArgs.java100664 7276 12500110374 31132 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.nullargs; import java.util.Collection; import javax.jdo.JDOUserException; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: refresh with Null Arguments *
*Keywords: *
*Assertion IDs: A12.6-3, A12.6-4, A12.6-5 *
*Assertion Description: A12.6-3 [Null arguments to APIs that take an Object parameter cause the API to have no effect.] A12.6-4 [Null arguments to APIs that take Object[] or Collection will cause the API to throw NullPointerException.] A12.6-5 [Non-null Object[] or Collection arguments that contain null elements will have the documented behavior for non-null elements, and the null elements will be ignored.] */ public class RefreshNullArgs extends PersistenceManagerNullsTest { /** * The main 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(RefreshNullArgs.class); } static MethodUnderTest refresh = new MethodUnderTestRefresh(); static class MethodUnderTestRefresh extends MethodUnderTest { public void pmApi(PersistenceManager pm, Object pc) { pm.refresh(pc); } public void pmApi(PersistenceManager pm, Collection pcs) { pm.refreshAll(pcs); } public void pmApi(PersistenceManager pm, Object[] pcs) { pm.refreshAll(pcs); } }; /** * Test that refresh() with null valued argument does nothing. */ public void testRefreshNullObject() { executeNullObjectParameter(refresh, "refresh(null)"); } /** * Test that refreshAll() with null valued Collection argument * throws NullPointerException. */ public void testRefreshNullCollection() { executeNullCollectionParameter(refresh, "refreshAll((Collection)null)"); } /** * Test that refreshAll() with null valued array argument * throws NullPointerException. */ public void testRefreshNullArray() { executeNullArrayParameter(refresh, "refreshAll((Object[])null)"); } /** * Test that refreshAll() with a null element of a * Collection argument throws NullPointerException. */ public void testRefreshCollectionNullElement() { executeCollectionNullElement(collNullElem, refresh, "refreshAll(Collection)"); } /** * Test that refreshAll() with a null element of a * array argument throws NullPointerException. */ public void testRefreshArrayNullElement() { executeArrayNullElement(arrayNullElem, refresh, "refreshAll(Object[])"); } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/nullargs/RetrieveNullArgs.java100664 7333 12500110374 31313 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.nullargs; import java.util.Collection; import javax.jdo.JDOUserException; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: retrieve with Null Arguments *
*Keywords: *
*Assertion IDs: A12.6-3, A12.6-4, A12.6-5 *
*Assertion Description: A12.6-3 [Null arguments to APIs that take an Object parameter cause the API to have no effect.] A12.6-4 [Null arguments to APIs that take Object[] or Collection will cause the API to throw NullPointerException.] A12.6-5 [Non-null Object[] or Collection arguments that contain null elements will have the documented behavior for non-null elements, and the null elements will be ignored.] */ public class RetrieveNullArgs extends PersistenceManagerNullsTest { /** * The main 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(RetrieveNullArgs.class); } static MethodUnderTest retrieve = new MethodUnderTestRetrieve(); static class MethodUnderTestRetrieve extends MethodUnderTest { public void pmApi(PersistenceManager pm, Object pc) { pm.retrieve(pc); } public void pmApi(PersistenceManager pm, Collection pcs) { pm.retrieveAll(pcs); } public void pmApi(PersistenceManager pm, Object[] pcs) { pm.retrieveAll(pcs); } }; /** * Test that retrieve() with null valued argument does nothing. */ public void testRetrieveNullObject() { executeNullObjectParameter(retrieve, "retrieve(null)"); } /** * Test that retrieveAll() with null valued Collection argument * throws NullPointerException. */ public void testRetrieveNullCollection() { executeNullCollectionParameter(retrieve, "retrieveAll((Collection)null)"); } /** * Test that retrieveAll() with null valued array argument * throws NullPointerException. */ public void testRetrieveNullArray() { executeNullArrayParameter(retrieve, "retrieveAll((Object[])null)"); } /** * Test that retrieveAll() with a null element of a * Collection argument throws NullPointerException. */ public void testRetrieveCollectionNullElement() { executeCollectionNullElement(collNullElem, retrieve, "retrieveAll(Collection)"); } /** * Test that retrieveAll() with a null element of a * array argument throws NullPointerException. */ public void testRetrieveArrayNullElement() { executeArrayNullElement(arrayNullElem, retrieve, "retrieveAll(Object[])"); } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/nullargs/RetrieveWithFetchPlanNullArgs.java100664 10102 12500110374 33740 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager.nullargs; import java.util.Collection; import javax.jdo.JDOUserException; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: retrieveWithFetchPlan with Null Arguments *
*Keywords: *
*Assertion IDs: A12.6-3, A12.6-4, A12.6-5 *
*Assertion Description: A12.6-3 [Null arguments to APIs that take an Object parameter cause the API to have no effect.] A12.6-4 [Null arguments to APIs that take Object[] or Collection will cause the API to throw NullPointerException.] A12.6-5 [Non-null Object[] or Collection arguments that contain null elements will have the documented behavior for non-null elements, and the null elements will be ignored.] */ public class RetrieveWithFetchPlanNullArgs extends PersistenceManagerNullsTest { /** * The main 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(RetrieveWithFetchPlanNullArgs.class); } static MethodUnderTest retrieveWithFetchPlan = new MethodUnderTestRetrieveWithFetchPlan(); static class MethodUnderTestRetrieveWithFetchPlan extends MethodUnderTest { public void pmApi(PersistenceManager pm, Object pc) { pm.retrieve(pc, false); } public void pmApi(PersistenceManager pm, Collection pcs) { pm.retrieveAll(pcs, false); } public void pmApi(PersistenceManager pm, Object[] pcs) { pm.retrieveAll(pcs, false); } }; /** * Test that retrieveWithFetchPlan() with null valued argument does nothing. */ public void testRetrieveWithFetchPlanNullObject() { executeNullObjectParameter(retrieveWithFetchPlan, "retrieveWithFetchPlan(null)"); } /** * Test that retrieveWithFetchPlanAll() with null valued Collection argument * throws NullPointerException. */ public void testRetrieveWithFetchPlanNullCollection() { executeNullCollectionParameter(retrieveWithFetchPlan, "retrieveWithFetchPlanAll((Collection)null)"); } /** * Test that retrieveWithFetchPlanAll() with null valued array argument * throws NullPointerException. */ public void testRetrieveWithFetchPlanNullArray() { executeNullArrayParameter(retrieveWithFetchPlan, "retrieveWithFetchPlanAll((Object[])null)"); } /** * Test that retrieveWithFetchPlanAll() with a null element of a * Collection argument throws NullPointerException. */ public void testRetrieveWithFetchPlanCollectionNullElement() { executeCollectionNullElement(collNullElem, retrieveWithFetchPlan, "retrieveWithFetchPlanAll(Collection)"); } /** * Test that retrieveWithFetchPlanAll() with a null element of a * array argument throws NullPointerException. */ public void testRetrieveWithFetchPlanArrayNullElement() { executeArrayNullElement(arrayNullElem, retrieveWithFetchPlan, "retrieveWithFetchPlanAll(Object[])"); } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/ObjectIdUniqueAmongInstances.java100664 6337 12500110374 31736 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager; import java.util.HashSet; import java.util.Iterator; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: ObjectId Unique Among Instances *
*Keywords: identity *
*Assertion ID: A12.5.6-12. *
*Assertion Description: Within a transaction, the ObjectId returned will compare equal to the ObjectId returned by only one among all JDO instances associated with the PersistenceManager regardless of the type of ObjectId. */ public class ObjectIdUniqueAmongInstances extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.6-12 (ObjectIdUniqueAmongInstances) failed: "; /** * The main 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(ObjectIdUniqueAmongInstances.class); } /** */ public void test() { final int count = 1000; HashSet instances = new HashSet(count); HashSet oids = new HashSet(count); pm = getPM(); Transaction tx = pm.currentTransaction(); try { tx.begin(); // Construct "count" persistent instances, and save them in a // hashset. for (int i = 0; i < count; ++i) { PCPoint p = new PCPoint (i, count-i); pm.makePersistent(p); instances.add(p); } // For all new persistent instances, get the object ids and // save them in another hashset. There should be the same // number if the ids are all unique. for (Iterator it = instances.iterator(); it.hasNext();) { oids.add(pm.getObjectId(it.next())); } tx.commit(); tx = null; if (oids.size() != instances.size()) { fail(ASSERTION_FAILED, "Oids has size: " + oids.size() + "; expected: " + instances.size()); } } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } pm.close(); pm = null; } } ././@LongLink100644 0 0 145 12500111677 10253 Lustar 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanager/OneInstanceOfObjectPerPersistenceManager.javatck/src/java/org/apache/jdo/tck/api/persistencemanager/OneInstanceOfObjectPerPersistenceManager.java100664 13204 12500110374 34232 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager; import java.util.Collection; import java.util.Iterator; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.pc.mylib.PCRect; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Only one instance of persistent object in cache per PersistenceManager *
*Keywords: cache *
*Assertion ID: A5.4-10. *
*Assertion Description: JDO implementations must manage the cache of JDO instances such that there is only one JDO instance, associated with each PersistenceManager representing the persistent state of each corresponding data store object. */ public class OneInstanceOfObjectPerPersistenceManager extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A5.4-10 (OneInstanceOfObjectPerPersistenceManager) " + "failed: "; /** * The main 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(OneInstanceOfObjectPerPersistenceManager.class); } /** * This test creates objects in one transaction and commits. * The important object is p1. * Then, in a second transaction, it gets an object p1a by id, * gets another object p1b by navigation, and a third object p1c by * query. All of these represent the same datastore object and * therefore must be identical in the same PersistenceManager. */ public void test() { /** The getPM method is declared in a superclass. * This is the standard way to get a PersistenceManager. * The method automatically gets a PersistenceManagerFactory, * gets a PersistenceManager, and puts the PersistenceManager into * the field pm. */ getPM(); /** This is the standard way to get a Transaction. */ Transaction tx = pm.currentTransaction(); /** Any values for these flags should be set before * beginning a transaction. */ tx.setRetainValues(false); tx.setRestoreValues(false); /** This is the standard way to begin a transaction. */ tx.begin(); /** Create new objects to be persisted. */ PCPoint p1 = new PCPoint(10, 20); PCPoint p2 = new PCPoint(20, 40); PCRect rect = new PCRect(0, p1, p2); /** This test relies on persistence by reachability. */ pm.makePersistent(rect); /** This is the standard way to commit a transaction. */ tx.commit(); /** Begin a new transaction so that the navigation * uses the object id to load the target object into the cache. * The RetainValues flag false guarantees that the object fields * are no longer loaded. */ tx.begin(); Object p1Id = pm.getObjectId(p1); /** Retrieves the field values from the datastore. */ PCPoint p1a = (PCPoint)pm.getObjectById(p1Id, true); /** Navigate to the point. */ PCPoint p1b = rect.getUpperLeft(); /** Query for the point by its values in the datastore. */ PCPoint p1c = findPoint(10, 20); tx.commit(); tx = null; /** Use a StringBuffer to collect results. */ StringBuffer results = new StringBuffer(); /** Compare the original object with the object obtained * by getObjectById. */ if (p1 != p1a) { results.append("getObjectById results differ. "); } /** Compare the original object with the object obtained * by navigating from another object. */ if (p1 != p1b) { results.append("navigation results differ. "); } /** Compare the original object with the object obtained * by query. */ if (p1 != p1c) { results.append("query results differ. "); } if (results.length() != 0) { fail(ASSERTION_FAILED + results.toString()); } /** The standard way to end each test method is to simply return. * Exceptions are caught by JUnit. * The tearDown method ends the transaction and closes * the PersistenceManager. */ } /** */ private PCPoint findPoint (int x, int y) { Query q = getPM().newQuery (PCPoint.class); q.declareParameters ("int px, int py"); q.setFilter ("x == px & y == py"); Collection results = (Collection)q.execute (new Integer(x), new Integer(y)); Iterator it = results.iterator(); PCPoint ret = (PCPoint)it.next(); return ret; } } ././@LongLink100644 0 0 155 12500111677 10254 Lustar 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanager/OnePersistenceManagerIfPersistentOrTransactional.javatck/src/java/org/apache/jdo/tck/api/persistencemanager/OnePersistenceManagerIfPersistentOrTransactio100664 3765 12500110374 34426 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: One PersistenceManager If Persistent or Transactional *
*Keywords: *
*Assertion ID: A12.5-2. *
*Assertion Description: A JDO Instance is associated with exactly one PersistenceManager if the instance is persistent or transactional. This is a duplicate test. */ public class OnePersistenceManagerIfPersistentOrTransactional extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5-2 (OnePersistenceManagerIfPersistentOrTransactional) failed: "; /** * The main 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(OnePersistenceManagerIfPersistentOrTransactional.class); } /** */ public void test() { if (debug) logger.debug("org.apache.jdo.tck.api.persistencemanager.OnePersistenceManagerIfPersistentOrTransactional.run duplicate"); } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/OptimisticFailure.java100664 22522 12500110374 27700 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager; import java.util.HashSet; import java.util.Set; import javax.jdo.JDOException; import javax.jdo.JDOHelper; import javax.jdo.JDOOptimisticVerificationException; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.VersionedPCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: OptimisticFailure *
*Keywords: optimistic *
*Assertion IDs: A13.5-1 *
*Assertion Description: * If any instance fails the verification, a JDOOptimisticVerificationException * is thrown which contains an array of JDOOptimisticVerificationException, * one for each instance that failed the verification. The optimistic * transaction is failed, and the transaction is rolled back. * The definition of "changed instance" is a JDO implementation choice, * but it is required that a field that has been changed to different * values in different transactions results in one of the transactions * failing. */ public class OptimisticFailure extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A13.5-1 (OptimisticFailure) failed: "; /** * The main 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(OptimisticFailure.class); } private VersionedPCPoint p1 = new VersionedPCPoint(1,1); // this will be updated in tx1, updated in tx2, verified in tx3 private VersionedPCPoint p2 = new VersionedPCPoint(2,2); // this will be updated in tx1, deleted in tx2, verified in tx3 private VersionedPCPoint p3 = new VersionedPCPoint(3,3); // this will be deleted in tx1, updated in tx2 private VersionedPCPoint p4 = new VersionedPCPoint(4,4); // this will be deleted in tx1, deleted in tx2 private VersionedPCPoint p5 = new VersionedPCPoint(5,5); // this will be unchanged in tx1, updated in tx2, verified in tx3 private Object p1oid = null; private Object p2oid = null; private Object p3oid = null; private Object p4oid = null; private Object p5oid = null; /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(VersionedPCPoint.class); } /** */ public void test() { pm = getPM(); PersistenceManager pm2 = pmf.getPersistenceManager(); PersistenceManager pm3 = pmf.getPersistenceManager(); try { runTestOptimistic(pm, pm2, pm3); } finally { cleanupPM(pm3); pm3 = null; cleanupPM(pm2); pm2 = null; cleanupPM(pm); pm = null; } } /** */ private void runTestOptimistic(PersistenceManager pm1, PersistenceManager pm2, PersistenceManager pm3) { if (!isOptimisticSupported()) { if (debug) logger.debug("OptimisticFailure tests not run; Optimistic not supported"); return; } Transaction tx1 = pm1.currentTransaction(); Transaction tx2 = pm2.currentTransaction(); Transaction tx3 = pm3.currentTransaction(); try { tx1.setOptimistic(true); tx2.setOptimistic(true); // create five instances to test tx1.begin(); pm1.makePersistent(p1); pm1.makePersistent(p2); pm1.makePersistent(p3); pm1.makePersistent(p4); pm1.makePersistent(p5); p1oid = pm1.getObjectId(p1); p2oid = pm1.getObjectId(p2); p3oid = pm1.getObjectId(p3); p4oid = pm1.getObjectId(p4); p5oid = pm1.getObjectId(p5); tx1.commit(); // update/delete the instances in tx1 tx1.begin(); VersionedPCPoint p1tx1 = (VersionedPCPoint)pm1.getObjectById(p1oid, true); VersionedPCPoint p2tx1 = (VersionedPCPoint)pm1.getObjectById(p2oid, true); VersionedPCPoint p3tx1 = (VersionedPCPoint)pm1.getObjectById(p3oid, true); VersionedPCPoint p4tx1 = (VersionedPCPoint)pm1.getObjectById(p4oid, true); p1tx1.setX(101); p2tx1.setX(201); pm1.deletePersistent(p3tx1); pm1.deletePersistent(p4tx1); // update/delete the instances in tx2 tx2.begin(); VersionedPCPoint p1tx2 = (VersionedPCPoint)pm2.getObjectById(p1oid, true); VersionedPCPoint p2tx2 = (VersionedPCPoint)pm2.getObjectById(p2oid, true); VersionedPCPoint p3tx2 = (VersionedPCPoint)pm2.getObjectById(p3oid, true); VersionedPCPoint p4tx2 = (VersionedPCPoint)pm2.getObjectById(p4oid, true); VersionedPCPoint p5tx2 = (VersionedPCPoint)pm2.getObjectById(p5oid, true); p1tx2.setX(102); pm2.deletePersistent(p2tx2); p3tx2.setX(202); pm2.deletePersistent(p4tx2); p5tx2.setX(502); // this change must not be committed Set expectedFailedObjects = new HashSet(); expectedFailedObjects.add(p1tx2); expectedFailedObjects.add(p2tx2); expectedFailedObjects.add(p3tx2); expectedFailedObjects.add(p4tx2); // commit tx1 (should succeed) tx1.commit(); tx1 = null; // commit tx2 (should fail) try { tx2.commit(); fail(ASSERTION_FAILED, "concurrent commit not detected"); } catch (JDOOptimisticVerificationException ex) { // verify the correct information in the exception Throwable[] ts = ex.getNestedExceptions(); int length = ts==null ? 0 : ts.length; int expectedFailures = expectedFailedObjects.size(); if (length != expectedFailures) { fail(ASSERTION_FAILED, "Nested exceptions[] wrong size: expected " + expectedFailures + ", got " + length); } for (int i = 0; i < length; ++i) { Throwable t = ts[i]; if (t instanceof JDOOptimisticVerificationException) { if (debug) logger.debug("Expected exception caught " + t.toString()); JDOException jex = (JDOException)t; Object failed = jex.getFailedObject(); if (failed == null) { fail(ASSERTION_FAILED, "Found unexpected null in failed object"); } else { if (expectedFailedObjects.remove(failed)) { if (debug) logger.debug("Found expected failed instance, oid: " + JDOHelper.getObjectId(failed)); } else { fail(ASSERTION_FAILED, "Unexpected failed instance: " + failed.toString()); } } } else { fail(ASSERTION_FAILED, "Unexpected nested exception: " + t.toString()); } } } tx2 = null; tx3.begin(); VersionedPCPoint p1tx3 = (VersionedPCPoint)pm3.getObjectById(p1oid, true); VersionedPCPoint p2tx3 = (VersionedPCPoint)pm3.getObjectById(p2oid, true); VersionedPCPoint p5tx3 = (VersionedPCPoint)pm3.getObjectById(p5oid, true); verify(p1tx3, 101); verify(p2tx3, 201); verify(p5tx3, 5); tx3.commit(); tx3 = null; } finally { if ((tx3 != null) && tx3.isActive()) tx3.rollback(); if ((tx2 != null) && tx2.isActive()) tx2.rollback(); if ((tx1 != null) && tx1.isActive()) tx1.rollback(); } } /** */ protected void verify(VersionedPCPoint p, int value) { if (p.getX() != value) { fail(ASSERTION_FAILED, "VersionedPCPoint has wrong value: expected " + value + ", got " + p.getX()); } } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/PersistenceManagerTest.java100664 6653 12500110374 30652 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.Company; import org.apache.jdo.tck.pc.company.Department; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.pc.mylib.PCPoint2; import org.apache.jdo.tck.pc.mylib.PCRect; public abstract class PersistenceManagerTest extends JDO_Test { /** */ protected PersistenceManagerTest() { } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { // The order of addTearDownClass calls is significant // as it takes into account database FKs. addTearDownClass(PCRect.class); addTearDownClass(PCPoint.class); addTearDownClass(Department.class); addTearDownClass(Company.class); } /** */ protected Object createPCPointInstance(PersistenceManager pm) { PCPoint p1 = new PCPoint(8,8); Transaction tx = pm.currentTransaction(); tx.begin(); pm.makePersistent(p1); Object oid = pm.getObjectId(p1); tx.commit(); return oid; } /** */ public void deletePCPointInstance (PersistenceManager pm, Object oid) { Transaction tx = pm.currentTransaction(); tx.begin(); Object p1 = pm.getObjectById(oid, true); pm.deletePersistent(p1); tx.commit(); } /** */ public boolean testState(PCPoint obj, int expectState, String str) { int actualState = currentState(obj); if (actualState != expectState) { if (debug) { logger.debug(" Object not in " + str + " state for X = " + obj.getX()); logger.debug(" current state: " + actualState + " expected state: " + expectState); } return false; } return true; } /** */ public boolean testState(PCPoint2 obj, int expectState, String str) { int actualState = currentState(obj); if (actualState != expectState) { if (debug) { logger.debug(" Object not in " + str + " state for X = " + obj.getX() ); logger.debug(" current state: " + actualState + " expected state: " + expectState); } return false; } return true; } /** */ public void assertGetX(PCPoint p, int value, String assertion, String label) { if (p.getX() != value) { fail(assertion, label); } } } ././@LongLink100644 0 0 163 12500111677 10253 Lustar 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanager/SameTransactionInstanceForAllCallsToCurrentTransaction.javatck/src/java/org/apache/jdo/tck/api/persistencemanager/SameTransactionInstanceForAllCallsToCurrentTr100664 5213 12500110374 34315 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Same Transaction Instance For All Calls To Current Transaction *
*Keywords: *
*Assertion ID: A12.5.2-2. *
*Assertion Description: The identical Transaction instance will be returned by all currentTransaction calls to the same PersistenceManager until close. */ public class SameTransactionInstanceForAllCallsToCurrentTransaction extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.2-2 (SameTransactionInstanceForAllCallsToCurrentTransaction) failed: "; /** * The main 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(SameTransactionInstanceForAllCallsToCurrentTransaction.class); } /** */ public void test() { pm = getPM(); Transaction tx1 = getPM().currentTransaction(); tx1.begin(); Transaction tx2 = getPM().currentTransaction(); tx1.commit(); Transaction tx3 = getPM().currentTransaction(); if (tx1 != tx2) { fail(ASSERTION_FAILED, "tx1 before begin different from tx2 after begin"); } if (tx2 != tx3) { fail(ASSERTION_FAILED, "tx2 after begin different from tx3 after commit"); } if (!pm.isClosed()) { if (pm.currentTransaction().isActive()) { pm.currentTransaction().rollback(); } pm.close(); } pm = null; } } tck/src/java/org/apache/jdo/tck/api/persistencemanager/ThreadSafe.java100664 15737 12500110374 26264 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager; import java.util.Iterator; import java.util.Map; import java.util.Set; import javax.jdo.JDOUserException; import javax.jdo.PersistenceManager; import javax.jdo.PersistenceManagerFactory; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.util.ThreadExceptionHandler; import org.apache.jdo.tck.util.RogueBarrier; /** *Title: Thread Safe *
*Keywords: multithreaded *
*Assertion ID: A12.4-1. *
*Assertion Description: It is a requirement for all JDO implementations to be thread-safe. That is, the behavior of the implementation must be predictable in the presence of multiple application threads. This assertion will generate multiple test cases to be evaluated. */ public class ThreadSafe extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.4-1 (ThreadSafe) failed: "; /** * The main 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(ThreadSafe.class); } private final int threadCount = 10; private final ThreadExceptionHandler group = new ThreadExceptionHandler(); private final RogueBarrier barrier = new RogueBarrier(threadCount); private int successCount = 0; private int exceptionCount = 0; /** */ public void testThreadSafe() throws Exception { if (debug) logger.debug("\nSTART testThreadSafe"); // test thread-safety of PMF.getPersistenceManager(): // pmf.getPM(), pm.close() final PCPoint[] nullPC = new PCPoint[threadCount]; runThreads(nullPC, "Concurrent PMF.getPersistenceManager()", threadCount); // test thread-safety of PMF.getPersistenceManager(): // pmf.getPM(), pm.makePersistent(private transient PC), pm.close() final PCPoint[] localPC = new PCPoint[threadCount]; for (int i = 0; i < threadCount; i++) { localPC[i] = new PCPoint(1,i); } runThreads(localPC, "Concurrent PMF.getPersistenceManager()" + ".makePersistent()", threadCount); // test thread-safety of PM.makePersistent(): // pmf.getPM(), pm.makePersistent(shared transient PC), pm.close() final PCPoint[] sharedPC = new PCPoint[threadCount]; final PCPoint p1 = new PCPoint(3,3); for (int i = 0; i < threadCount; i++) { sharedPC[i] = p1; } runThreads(sharedPC, "Concurrent PM.makePersistent(" + "shared transient PC)", 1); } /** */ public void runThreads(Object[] pc, String header, int toSucceed) { // start threads with their pc instance final Thread[] threads = new Thread[threadCount]; for (int i = 0; i < threadCount; i++) { Thread t = new Thread(group, new PMThread(pc[i])); t.setName("ThreadSafeID-" + i); threads[i] = t; t.start(); } // wait for all threads to finish for (int i = 0; i < threadCount; i++) { while (true) { try { threads[i].join(); break; } catch (InterruptedException e) { // swallow } } } checkResults(header, toSucceed); } /** */ protected synchronized void checkResults(String header, int toSucceed) { // check unhandled exceptions final Set uncaught = group.getAllUncaughtExceptions(); if ((uncaught != null) && !uncaught.isEmpty()) { StringBuffer report = new StringBuffer("Uncaught exceptions:\n"); for (Iterator i = uncaught.iterator(); i.hasNext();) { Map.Entry next = (Map.Entry)i.next(); Thread thread = (Thread)next.getKey(); Throwable problem = (Throwable)next.getValue(); report.append(header + ": Uncaught exception " + problem + " in thread " + thread + "\n"); } fail(ASSERTION_FAILED, report.toString()); group.clear(); } // check success count if (successCount != toSucceed) { fail(ASSERTION_FAILED, header + ": Incorrect number of " + "\"succeeding\" threads; expected=" + toSucceed + " found=" + successCount); } successCount = 0; // check exception count final int toExcept = threadCount - toSucceed; if (exceptionCount != toExcept) { fail(ASSERTION_FAILED, header + ": Incorrect number of " + "\"failing\" threads; expected=" + toExcept + " found=" + exceptionCount); } exceptionCount = 0; } /** */ protected synchronized void markSuccess() { logger.debug("[" + Thread.currentThread().getName() + "]: success"); successCount++; } /** */ protected synchronized void markExpectedException() { logger.debug("[" + Thread.currentThread().getName() + "]: expected exception"); exceptionCount++; } /** */ class PMThread implements Runnable { private final Object pc; /** */ PMThread(Object pc) { this.pc = pc; } /** */ public void run() { ThreadSafe.this.logger.debug("[" + Thread.currentThread().getName() + "]: running"); final PersistenceManager pm = pmf.getPersistenceManager(); try { Transaction tx = pm.currentTransaction(); tx.begin(); if (pc != null) { pm.makePersistent(pc); } tx.commit(); markSuccess(); } catch (JDOUserException ex) { markExpectedException(); } finally { barrier.await(); cleanupPM(pm); } } } } ././@LongLink100644 0 0 160 12500111677 10250 Lustar 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanager/TransientTransactionalInstanceRetainsValuesAtCommit.javatck/src/java/org/apache/jdo/tck/api/persistencemanager/TransientTransactionalInstanceRetainsValuesAt100664 12155 12500110374 34477 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanager; import java.util.Collection; import java.util.HashSet; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Transient Transactional Instance Retains Values At Commit *
*Keywords: transienttransactional *
*Assertion ID: A12.5.7-21 *
*Assertion Description: If the transaction in which an instance is made transactional (by calling PersistenceManager.makeTransactional or makeTransactionalAll) commits, then the transient instance retains its values. */ public class TransientTransactionalInstanceRetainsValuesAtCommit extends PersistenceManagerTest { /** */ private static final String ASSERTION_FAILED = "Assertion A12.5.7-21 (TransientTransactionalInstanceRetainsValuesAtCommit) failed: "; /** * The main 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(TransientTransactionalInstanceRetainsValuesAtCommit.class); } private PCPoint p1 = null; private PCPoint p2 = null; private PCPoint p3 = null; private PCPoint p4 = null; private PCPoint p5 = null; private Collection col1 = new HashSet(); private Collection col2 = new HashSet(); /** */ public void testTransientTransactionalInstanceRetainsValuesAtCommit() { pm = getPM(); createObjects(pm); runTestTransientTransactional1(pm); runTestTransientTransactional2(pm); runTestTransientTransactional3(pm); pm.close(); pm = null; } /** */ private void createObjects(PersistenceManager pm) { p1 = new PCPoint(1,3); p2 = new PCPoint(2,4); p3 = new PCPoint(3,5); p4 = new PCPoint(4,6); p5 = new PCPoint (5,7); col1.add(p2); col1.add(p3); col2.add(p4); col2.add(p5); } /** */ private void runTestTransientTransactional1(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); if (debug) logger.debug(" ** in runTestTransientTransactional1() "); try { PCPoint p1 = new PCPoint(8,8); p1.setX(100); tx.begin(); p1.setX(200); pm.makeTransactional(p1); p1.setX(300); tx.commit(); tx = null; assertGetX (p1, 300, ASSERTION_FAILED, "runTestTransientTransactional1"); } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ private void runTestTransientTransactional2(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); if (debug) logger.debug(" ** in runTestTransientTransactional2() "); try { p2.setX(100); p3.setX(100); tx.begin(); p2.setX(201); p3.setX(201); pm.makeTransactionalAll(col1); p2.setX(301); p3.setX(301); tx.commit(); tx = null; assertGetX (p2, 301, ASSERTION_FAILED, "runTestTransientTransactional2"); assertGetX (p3, 301, ASSERTION_FAILED, "runTestTransientTransactional2"); } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ private void runTestTransientTransactional3(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); if (debug) logger.debug(" ** in runTestTransientTransactional3() "); try { p4.setX(100); p5.setX(100); tx.begin(); p4.setX(201); p5.setX(201); pm.makeTransactionalAll(col2.toArray()); p4.setX(301); p5.setX(301); tx.commit(); tx = null; assertGetX (p4, 301, ASSERTION_FAILED, "runTestTransientTransactional2"); assertGetX (p5, 301, ASSERTION_FAILED, "runTestTransientTransactional2"); } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/api/persistencemanagerfactory/AbstractGetPMF.java100664 16434 12500110374 30407 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanagerfactory; import java.lang.reflect.Method; import java.io.File; import java.util.Iterator; import java.util.Map.Entry; import java.util.Properties; import java.util.Set; import javax.jdo.JDOFatalUserException; import javax.jdo.PersistenceManagerFactory; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; /** * The abstract super class for all GetPMF test cases. * @author Michael Watzek */ abstract class AbstractGetPMF extends JDO_Test { /** * Used as the PMF name in positive tests. * The variable is set to test/conf/jdori.properties. * This file contains valid JDO properties. */ protected static final String validPropertiesFile = PMFProperties; /** * Used as the PMF name in negative tests. * The variable is set to test/conf/logging.properties. * This file does not contain valid JDO properties. */ /* protected static final String invalidPropertiesFile = validPropertiesFile.substring(0, validPropertiesFile.lastIndexOf(File.separatorChar)+1) + "logging.properties"; */ protected static String invalidPropertiesFile; static { if (validPropertiesFile==null) System.out.println ("******************************"); invalidPropertiesFile = validPropertiesFile.substring(0, validPropertiesFile.lastIndexOf(File.separatorChar)+1) + "logging.properties"; } /** * Used as the PMF name in positive JNDI tests. * The variable is set to jdori.properties. * This resource contains valid JDO properties. */ protected static final String jndiName = validPropertiesFile.substring(0, validPropertiesFile.lastIndexOf(File.separatorChar)+1) + "pmf.ser"; /** * Removing the path prefix from argument name. * @return argument name removed by the path prefix. */ protected String removePathPrefix(String name) { int index = name.lastIndexOf(File.separatorChar); if (index!=-1) { name = name.substring(index+1); } return name; } protected void makePersistent() { addTearDownClass(PCPoint.class); pm = pmf.getPersistenceManager(); Transaction tx = pm.currentTransaction(); tx.begin(); PCPoint comp = new PCPoint(1, 2); pm.makePersistent(comp); tx.commit(); } /** * Returns pmf instance for the given name. * Subclasses may use argument name as file name, * resource name etc. * @param name the name * @return the pmf instance */ protected abstract PersistenceManagerFactory getPMF(String name); /** * This method creates a PMF calling * method AbstractGetPMF#getPMF(name). * It passes an name of an invalid properties file as parameter. * The method expects the PMF creation to fail. * @param assertionMessage the assertion message if the test fails. */ protected void checkGetPMFWithInvalidProperties(String assertionMessage) { try { pmf = getPMF(invalidPropertiesFile); fail(assertionMessage); } catch (JDOFatalUserException e) { // expected exception if (debug) logger.debug("caught expected exception " + e.toString()); } } /** * This method creates a PMF calling * method AbstractGetPMF#getPMF(name). * It passes an name of a valid properties file as parameter. * The method expects the PMF creation to succeed. */ protected void checkGetPMFWithValidProperties() { pmf = getPMF(validPropertiesFile); verifyProperties(pmf, loadProperties(validPropertiesFile)); makePersistent(); } /** * Verify that the Properties are correctly set in the PMF. */ protected void verifyProperties(PersistenceManagerFactory pmf, Properties props) { Object[] noArgs = new Object[]{}; String javaxjdooption = "javax.jdo.option."; Class pmfclass = pmf.getClass(); Set entries = props.entrySet(); StringBuffer buffer = new StringBuffer(); for (Iterator it = entries.iterator(); it.hasNext();) { Entry entry = (Entry)it.next(); String key = (String)entry.getKey(); if (key.equals("javax.jdo.option.ConnectionPassword")) { continue; } if (key.equals("javax.jdo.option.ConnectionUserName")) { continue; } String expected = (String)entry.getValue(); if (key.startsWith(javaxjdooption)) { String optionName = key.substring(javaxjdooption.length()); Method getMethod = getGetMethod(pmfclass, optionName); Object actual = getValue(getMethod, pmf, noArgs); if (actual == null) { buffer.append("\n"); buffer.append("Key "); buffer.append(key); buffer.append(" was null."); continue; } String actualString = actual.toString(); if (!expected.equals(actualString)) { buffer.append("\n"); buffer.append("Key "); buffer.append(key); buffer.append(" expected: \""); buffer.append(expected); buffer.append("\" actual: \""); buffer.append(actual); buffer.append("\"."); } } } if (buffer.length() != 0) { fail(buffer.toString()); } } /** Get the "get" method corresponding to the option name. */ Method getGetMethod(Class cls, String optionName) { try { return cls.getMethod("get" + optionName, new Class[]{}); } catch (Exception ex) { fail("Unexpected exception thrown from getMethod on PMF class with option name" + optionName); return null; } } /** * Get the result of executing the Method. */ Object getValue(Method method, Object obj, Object[] args) { try { return method.invoke(obj, args); } catch (Exception ex) { fail("Unexpected exception executing method " + method.getName() + "."); return null; } } } tck/src/java/org/apache/jdo/tck/api/persistencemanagerfactory/AfterCloseGetPMThrowsException.java100664 5453 12500110374 33632 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanagerfactory; import javax.jdo.JDOFatalUserException; import javax.jdo.JDOUserException; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title:AfterCloseGetPMThrowsException of PersistenceManagerFactory *
*Keywords: persistencemanagerfactory *
*Assertion IDs: A11.4-9B. *
*Assertion Description: * PersistenceManagerFactory.getPersistenceManager() throws * JDOUserException after the PersistenceManagerFactory is closed. */ /* * Revision History * ================ * Author : Craig Russell * Date : 05/16/03 * */ public class AfterCloseGetPMThrowsException extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A11.4-9B (AfterCloseGetPMThrowsException) failed: "; /** * The main 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(AfterCloseGetPMThrowsException.class); } /** */ public void test() { try { pmf = getPMF(); closePMF(pmf); // don't use closePMF() because that sets pmf to null pm = pmf.getPersistenceManager(); fail(ASSERTION_FAILED, "pmf.getPersistenceManager should throw JDOUserException if pmf is closed."); } catch (JDOUserException ex) { // expected exception if (debug) logger.debug("caught expected exception " + ex.toString()); } catch (JDOFatalUserException ex) { // unexpected exception fail(ASSERTION_FAILED, "Wrong exception thrown from getPersistenceManager after close.\n" + "Expected JDOUserException, got JDOFatalUserException."); } finally { if (pm != null) pm.close(); } } } ././@LongLink100644 0 0 146 12500111677 10254 Lustar 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanagerfactory/AfterCloseSetMethodsThrowException.javatck/src/java/org/apache/jdo/tck/api/persistencemanagerfactory/AfterCloseSetMethodsThrowException.jav100664 23167 12500110374 34433 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanagerfactory; import java.util.Arrays; import java.util.Collection; import java.util.Iterator; import javax.jdo.JDOFatalInternalException; import javax.jdo.JDOUserException; import javax.jdo.PersistenceManagerFactory; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title:AfterCloseSetMethodsThrowException *
*Keywords: persistencemanagerfactory *
*Assertion IDs: A11.4-9A. *
*Assertion Description: * If a set method is called after close, then JDOUserException is thrown. */ /* * Revision History * ================ * Author : Craig Russell * Date : 05/16/03 * */ public class AfterCloseSetMethodsThrowException extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A11.4-9A (AfterCloseSetMethodsThrowException) failed: "; /** * The main 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(AfterCloseSetMethodsThrowException.class); } /** */ public void test() { Class[] stringParameters = new Class[]{String.class}; Class[] booleanParameters = new Class[]{boolean.class}; Class[] objectParameters = new Class[]{Object.class}; Class[] integerParameters = new Class[]{Integer.class}; Object[] stringParameter = new Object[]{"Nobody knows the trouble"}; Object[] booleanParameter = new Object[]{new Boolean(false)}; Object[] objectParameter = new Object[]{null}; Object[] integerParameter = new Object[]{new Integer(0)}; SetProperty[] setMethods = new SetProperty[] { new SetProperty("setConnectionDriverName", stringParameters, stringParameter), new SetProperty("setConnectionFactory", objectParameters, objectParameter), new SetProperty("setConnectionFactory2", objectParameters, objectParameter), new SetProperty("setConnectionFactoryName", stringParameters, stringParameter), new SetProperty("setConnectionFactory2Name", stringParameters, stringParameter), new SetProperty("setConnectionPassword", stringParameters, stringParameter), new SetProperty("setConnectionURL", stringParameters, stringParameter), new SetProperty("setConnectionUserName", stringParameters, stringParameter), new SetProperty("setCopyOnAttach", booleanParameters, booleanParameter), new SetProperty("setDetachAllOnCommit", booleanParameters, booleanParameter), new SetProperty("setIgnoreCache", booleanParameters, booleanParameter), new SetProperty("setMapping", stringParameters, stringParameter), new SetProperty("setMultithreaded", booleanParameters, booleanParameter), new SetProperty("setName", stringParameters, stringParameter), new SetProperty("setNontransactionalRead", booleanParameters, booleanParameter), new SetProperty("setNontransactionalWrite", booleanParameters, booleanParameter), new SetProperty("setOptimistic", booleanParameters, booleanParameter), new SetProperty("setPersistenceUnitName", stringParameters, stringParameter), new SetProperty("setReadOnly", booleanParameters, booleanParameter), new SetProperty("setRestoreValues", booleanParameters, booleanParameter), new SetProperty("setRetainValues", booleanParameters, booleanParameter), new SetProperty("setServerTimeZoneID", stringParameters, stringParameter), new SetProperty("setTransactionIsolationLevel", stringParameters, stringParameter), new SetProperty("setTransactionType", stringParameters, stringParameter) }; GetProperty[] getMethods = new GetProperty[] { new GetProperty("getConnectionDriverName"), new GetProperty("getConnectionFactory"), new GetProperty("getConnectionFactory2"), new GetProperty("getConnectionFactoryName"), new GetProperty("getConnectionFactory2Name"), new GetProperty("getConnectionURL"), new GetProperty("getConnectionUserName"), new GetProperty("getCopyOnAttach"), new GetProperty("getDataStoreCache"), new GetProperty("getDetachAllOnCommit"), new GetProperty("getFetchGroups"), new GetProperty("getIgnoreCache"), new GetProperty("getMapping"), new GetProperty("getMultithreaded"), new GetProperty("getName"), new GetProperty("getNontransactionalRead"), new GetProperty("getNontransactionalWrite"), new GetProperty("getOptimistic"), new GetProperty("getPersistenceUnitName"), new GetProperty("getProperties"), new GetProperty("getReadOnly"), new GetProperty("getRestoreValues"), new GetProperty("getRetainValues"), new GetProperty("getServerTimeZoneID"), new GetProperty("getTransactionIsolationLevel"), new GetProperty("getTransactionType") }; pmf = getPMF(); closePMF(pmf); // don't use closePMF() because that sets pmf to null // each set method should throw an exception Collection setCollection = Arrays.asList(setMethods); for (Iterator it = setCollection.iterator(); it.hasNext();) { SetProperty sp = (SetProperty)it.next(); String where = sp.getMethodName(); try { sp.execute(pmf); fail(ASSERTION_FAILED, "pmf method " + where + " should throw JDOUserException when called for closed pmf"); } catch (JDOUserException ex) { if (debug) logger.debug("Caught expected exception " + ex.toString() + " from " + where); } catch (Exception ex) { fail(ASSERTION_FAILED, "Caught unexpected exception " + ex.toString() + " from " + where); } } // each get method should succeed Collection getCollection = Arrays.asList(getMethods); for (Iterator it = getCollection.iterator(); it.hasNext();) { GetProperty gp = (GetProperty)it.next(); String where = gp.getMethodName(); try { gp.execute(pmf); } catch (Exception ex) { fail(ASSERTION_FAILED, "Caught unexpected exception " + ex.toString() + " from " + where); } } } /** */ class SetProperty { java.lang.reflect.Method method; String methodName; Class[] parameters; Object[] parameter; SetProperty(String methodName, Class[] parameters, Object[] parameter) { this.methodName = methodName; this.parameters = parameters; this.parameter = parameter; try { method = PersistenceManagerFactory.class.getMethod(methodName, parameters); } catch (NoSuchMethodException ex) { throw new JDOFatalInternalException("Method not defined: " + methodName); } } void execute(PersistenceManagerFactory pmf) { try { method.invoke(pmf, parameter); } catch (IllegalAccessException ex) { throw new JDOFatalInternalException("IllegalAccessException", ex); } catch (java.lang.reflect.InvocationTargetException ex) { throw (RuntimeException)ex.getTargetException(); } } String getMethodName() { return methodName; } } /** */ class GetProperty { java.lang.reflect.Method method; String methodName; GetProperty(String methodName) { this.methodName = methodName; try { method = PersistenceManagerFactory.class.getMethod(methodName, (Class[])null); } catch (NoSuchMethodException ex) { throw new JDOFatalInternalException("Method not defined: " + methodName); } } void execute(PersistenceManagerFactory pmf) { try { method.invoke(pmf, (Object[])null); } catch (IllegalAccessException ex) { throw new JDOFatalInternalException("IllegalAccessException", ex); } catch (java.lang.reflect.InvocationTargetException ex) { throw (RuntimeException)ex.getTargetException(); } } String getMethodName() { return methodName; } } } ././@LongLink100644 0 0 161 12500111677 10251 Lustar 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanagerfactory/AfterGetPersistenceManagerNoSetMethodsSucceed.javatck/src/java/org/apache/jdo/tck/api/persistencemanagerfactory/AfterGetPersistenceManagerNoSetMethods100664 21103 12500110374 34404 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanagerfactory; import java.util.Arrays; import java.util.Collection; import java.util.Iterator; import java.util.Properties; import javax.jdo.JDOException; import javax.jdo.JDOFatalInternalException; import javax.jdo.JDOUserException; import javax.jdo.PersistenceManagerFactory; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: After GetPersistenceManager No Set Methods Succeed *
*Keywords: *
*Assertion ID: A11.3-3. *
*Assertion Description: * After the first use of * PersistenceManagerFactory.getPersistenceManager(), * none of the set methods will succeed. */ public class AfterGetPersistenceManagerNoSetMethodsSucceed extends JDO_Test { private String username; private String password; private Class[] stringParameters = null; private Class[] booleanParameters = null; private Object[] stringParameter = null; private Object[] booleanParameter = null; private SetProperty[] setMethods = null; private GetProperty[] getMethods = null; /** */ private static final String ASSERTION_FAILED = "Assertion A11.3-3 (AfterGetPersistenceManagerNoSetMethodsSucceed) failed: "; /** * The main 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(AfterGetPersistenceManagerNoSetMethodsSucceed.class); } /** */ public AfterGetPersistenceManagerNoSetMethodsSucceed() { super(); initVariables(); } /** */ public void initVariables() { stringParameters = new Class[]{String.class}; booleanParameters = new Class[]{boolean.class}; stringParameter = new Object[]{"Nobody knows the trouble"}; booleanParameter = new Object[]{Boolean.FALSE}; setMethods = new SetProperty[] { new SetProperty("setConnectionDriverName", stringParameters, stringParameter), new SetProperty("setConnectionFactoryName", stringParameters, stringParameter), new SetProperty("setConnectionFactory2Name", stringParameters, stringParameter), new SetProperty("setConnectionURL", stringParameters, stringParameter), new SetProperty("setConnectionUserName", stringParameters, stringParameter), new SetProperty("setConnectionPassword", stringParameters, stringParameter), new SetProperty("setIgnoreCache", booleanParameters, booleanParameter), new SetProperty("setMultithreaded", booleanParameters, booleanParameter), new SetProperty("setNontransactionalRead", booleanParameters, booleanParameter), new SetProperty("setNontransactionalWrite", booleanParameters, booleanParameter), new SetProperty("setOptimistic", booleanParameters, booleanParameter), new SetProperty("setRestoreValues", booleanParameters, booleanParameter), new SetProperty("setRetainValues", booleanParameters, booleanParameter) }; getMethods = new GetProperty[] { new GetProperty("getConnectionDriverName"), new GetProperty("getConnectionFactoryName"), new GetProperty("getConnectionFactory2Name"), new GetProperty("getConnectionURL"), new GetProperty("getConnectionUserName"), new GetProperty("getIgnoreCache"), new GetProperty("getMultithreaded"), new GetProperty("getNontransactionalRead"), new GetProperty("getNontransactionalWrite"), new GetProperty("getOptimistic"), new GetProperty("getRestoreValues"), new GetProperty("getRetainValues") }; } /** */ public void testGetPersistenceManagerWithNoParametes() { runTest(false); } /** */ public void testGetPersistenceManagerWithParameters() { Properties props = loadProperties(PMFProperties); username = props.getProperty(CONNECTION_USERNAME_PROP); password = props.getProperty(CONNECTION_PASSWORD_PROP); runTest(true); } /** */ public void runTest(boolean bUserAndPasswd) { pmf = getPMF(); if (!bUserAndPasswd) pm = getPM(); else pm = getPMF().getPersistenceManager(username,password); // each set method should throw an exception Collection setCollection = Arrays.asList(setMethods); for (Iterator it = setCollection.iterator(); it.hasNext();) { SetProperty sp = (SetProperty)it.next(); String where = sp.getMethodName(); try { sp.execute(pmf); fail(ASSERTION_FAILED, "pmf method " + where + " should throw JDOUserException when called after getPersistenceManager"); } catch (JDOUserException ex) { if (debug) logger.debug("Caught expected exception " + ex.toString() + " from " + where); } } // each get method should succeed Collection getCollection = Arrays.asList(getMethods); for (Iterator it = getCollection.iterator(); it.hasNext();) { GetProperty gp = (GetProperty)it.next(); String where = gp.getMethodName(); try { gp.execute(pmf); } catch (JDOUserException ex) { fail(ASSERTION_FAILED, "Caught unexpected exception " + ex.toString() + " from " + where); } } } /** */ static class SetProperty { java.lang.reflect.Method method; String methodName; Class[] parameters; Object[] parameter; SetProperty(String methodName, Class[] parameters, Object[] parameter) { this.methodName = methodName; this.parameters = parameters; this.parameter = parameter; try { method = PersistenceManagerFactory.class.getMethod(methodName, parameters); } catch (NoSuchMethodException ex) { throw new JDOFatalInternalException("Method not defined: " + methodName); } } void execute(PersistenceManagerFactory pmf) { try { method.invoke(pmf, parameter); } catch (IllegalAccessException ex) { throw new JDOFatalInternalException("IllegalAccessException", ex); } catch (java.lang.reflect.InvocationTargetException ex) { throw (JDOException)ex.getTargetException(); } } String getMethodName() { return methodName; } } /** */ static class GetProperty { java.lang.reflect.Method method; String methodName; GetProperty(String methodName) { this.methodName = methodName; try { method = PersistenceManagerFactory.class.getMethod(methodName, (Class[])null); } catch (NoSuchMethodException ex) { throw new JDOFatalInternalException( "Method not defined: " + methodName); } } void execute(PersistenceManagerFactory pmf) { try { method.invoke(pmf, (Object[])null); } catch (IllegalAccessException ex) { throw new JDOFatalInternalException("IllegalAccessException", ex); } catch (java.lang.reflect.InvocationTargetException ex) { throw (JDOException)ex.getTargetException(); } } String getMethodName() { return methodName; } } } tck/src/java/org/apache/jdo/tck/api/persistencemanagerfactory/Close.java100664 10770 12500110374 26703 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanagerfactory; import java.security.AccessController; import java.security.PrivilegedAction; import javax.jdo.JDOFatalUserException; import javax.jdo.JDOUserException; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title:Close of PersistenceManagerFactory *
*Keywords: persistencemanagerfactory *
*Assertion IDs: A11.4-2, A11.4-10 *
*Assertion Description: * PersistenceManagerFactory.close() closes this PersistenceManagerFactory. *Assertion Description: * PersistenceManagerFactory.isClosed(); Return true if this PersistenceManagerFactory is closed; and false otherwise. */ public class Close extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertions A11.4-2 (Close), A11.4-10 (isClosed) failed: "; /** * The main 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(Close.class); } /** */ public void test() { pmf = getPMF(); // check pmf.isClosed() before and after pmf.close() try { if (pmf.isClosed()) { fail(ASSERTION_FAILED, "PMF.isClosed() returned true on an open pmf"); } closePMF(pmf); // don't use closePMF() because that sets pmf to null if (!pmf.isClosed()) { fail(ASSERTION_FAILED, "PMF.isClosed() returned false on a closed pmf"); } } catch (JDOUserException ex) { // unexpected exception fail(ASSERTION_FAILED, "Unexpected exception at pmf.close()/isClosed(): " + ex); } catch (JDOFatalUserException ex) { // unexpected exception fail(ASSERTION_FAILED, "Unexpected exception at pmf.close()/isClosed(): " + ex); } // pmf.close() on already-closed pmf should not throw an exception try { // don't use closePMF methods because they check isClosed before calling AccessController.doPrivileged( new PrivilegedAction () { public Object run () { pmf.close(); return null; } } ); } catch (JDOUserException ex) { // unexpected exception fail(ASSERTION_FAILED, "Unexpected exception at repeated pmf.close(): " + ex); } catch (JDOFatalUserException ex) { // unexpected exception fail(ASSERTION_FAILED, "Unexpected exception at repeated pmf.close(): " + ex); } // trying to get a getPersistenceManager should result in a exception try { pm = pmf.getPersistenceManager(); fail(ASSERTION_FAILED, "JDOUserException was not thrown when calling pmf.getPersistenceManager() after pmf was closed"); } catch (JDOUserException ex) { // expected exception if (debug) { logger.debug("caught expected exception " + ex.toString()); } } catch (JDOFatalUserException ex) { // unexpected exception fail(ASSERTION_FAILED, "Wrong exception thrown from getPersistenceManager after close.\n" + "Expected JDOUserException, got JDOFatalUserException."); } // have next invocation of getPMF() get a new pmf pmf = null; } } tck/src/java/org/apache/jdo/tck/api/persistencemanagerfactory/CloseFailsIfTransactionActive.java100664 16651 12500110374 33507 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanagerfactory; import javax.jdo.JDOException; import javax.jdo.JDOUserException; import javax.jdo.PersistenceManager; import javax.jdo.PersistenceManagerFactory; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title:CloseFailsIfTransactionActive of PersistenceManagerFactory *
*Keywords: persistencemanagerfactory *
*Assertion IDs: A11.4-4. *
*Assertion Description: * PersistenceManagerFactory.getPersistenceManager() throws * JDOUserException after the PersistenceManagerFactory is closed. * The exception contains an array of nested exceptions; each nested * exception contains as its failed object the PersistenceManager whose * Transaction is still active. * During close of the PersistenceManagerFactory, all PersistenceManager * instances obtained from this PersistenceManagerFactory are * themselves closed. */ /* * Revision History * ================ * Author : Craig Russell * Date : 05/16/03 * */ public class CloseFailsIfTransactionActive extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A11.4-4 (CloseFailsIfTransactionActive) failed: "; /** * The main 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(CloseFailsIfTransactionActive.class); } protected boolean aborted = false; /** */ public void test() { PersistenceManager pm1 = null; PersistenceManager pm2 = null; cleanupPMF(getPMF()); pmf = null; try { pm1 = getPM(); pm2 = getPM(); pm1.currentTransaction().begin(); pm1.currentTransaction().commit(); pm2.currentTransaction().begin(); closePMF(pmf); // don't use closePMF() because that sets pmf to null setAborted(); fail(ASSERTION_FAILED, "Close incorrectly succeeded with active transaction"); } catch (JDOUserException ex) { try { if (debug) logger.debug("Caught expected exception " + ex.getMessage()); PersistenceManager[] pms = getFailedPersistenceManagers(ex); if (pms.length != 1) { setAborted(); fail(ASSERTION_FAILED, "Unexpected number of nested exceptions: " + pms.length); } else { Object failed = pms[0]; if (pm2.equals(failed)) { if (debug) logger.debug("Found expected failed object " + failed.toString()); } else { setAborted(); fail(ASSERTION_FAILED, "Found unexpected failed object " + failed.toString()); } } if (pm1.isClosed()){ fail(ASSERTION_FAILED, "Unexpected pm1 is closed."); } if (pm2.isClosed()){ fail(ASSERTION_FAILED, "Unexpected pm2 is closed."); } } catch (Exception uex) { setAborted(); fail(ASSERTION_FAILED, "Caught 1 unexpected exception " + uex.toString()); } } catch (Exception ex) { setAborted(); fail(ASSERTION_FAILED, "Caught 2 unexpected exception " + ex.toString()); } if (!isAborted()) { try { pm2.currentTransaction().commit(); closePMF(pmf); // don't use closePMF() because that sets pmf to null if (!pm1.isClosed()){ fail(ASSERTION_FAILED, "Unexpected pm1 is not closed."); } if (!pm2.isClosed()) { fail(ASSERTION_FAILED, "Unexpected pm2 is not closed."); } } catch (Exception ex) { fail(ASSERTION_FAILED, "Caught 3 unexpected exception " + ex.toString()); } } } /** */ protected void cleanupPMF(PersistenceManagerFactory pmf) { try { closePMF(pmf); // don't use closePMF() because that sets pmf to null } catch (JDOException ex) { PersistenceManager[] pms = getFailedPersistenceManagers(ex); int numberOfPersistenceManagers = pms.length; for (int i = 0; i < numberOfPersistenceManagers; ++i) { PersistenceManager pm = pms[i]; if (pm == null) { fail(ASSERTION_FAILED, "Found unexpected null PersistenceManager"); } else { Transaction tx = pm.currentTransaction(); if (tx.isActive()) { if (debug) logger.debug("Found active transaction; rolling back."); tx.rollback(); } else { fail(ASSERTION_FAILED, "Unexpectedly, this transaction is not active: " + tx); } } } } } /** */ protected void setAborted() { aborted = true; } /** */ protected boolean isAborted() { return aborted; } /** */ protected PersistenceManager[] getFailedPersistenceManagers(JDOException ex) { Throwable[] nesteds = ex.getNestedExceptions(); int numberOfExceptions = nesteds==null ? 0 : nesteds.length; PersistenceManager[] result = new PersistenceManager[numberOfExceptions]; for (int i = 0; i < numberOfExceptions; ++i) { JDOException exc = (JDOException)nesteds[i]; Object failedObject = exc.getFailedObject(); if (exc.getFailedObject() instanceof PersistenceManager) { result[i] = (PersistenceManager)failedObject; } else { fail(ASSERTION_FAILED, "Unexpected failed object of type: " + failedObject.getClass().getName()); } } return result; } } ././@LongLink100644 0 0 161 12500111677 10251 Lustar 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanagerfactory/CloseWithoutPermissionThrowsSecurityException.javatck/src/java/org/apache/jdo/tck/api/persistencemanagerfactory/CloseWithoutPermissionThrowsSecurityEx100664 7127 12500110374 34636 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanagerfactory; import java.security.Permission; import javax.jdo.JDOException; import javax.jdo.PersistenceManagerFactory; import javax.jdo.spi.JDOPermission; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title:Close of PersistenceManagerFactory Throws SecurityException if * JDOPermission("closePersistenceManagerFactory") Is Not Set *
*Keywords: persistencemanagerfactory SecurityException *
*Assertion IDs: A11.4-3 *
*Assertion Description: * PersistenceManagerFactory.close() closes this PersistenceManagerFactory. * If JDOPermission("closePersistenceManagerFactory") is not set, then * SecurityException in thrown. */ public class CloseWithoutPermissionThrowsSecurityException extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertions A11.4-3 (CloseWithoutPermissionThrowsSecurityException) failed: "; /** * The main 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(CloseWithoutPermissionThrowsSecurityException.class); } /** */ public void test() { pmf = getPMF(); closeWithMySecurityManager(pmf); closePMF(pmf); closeWithMySecurityManager(pmf); } private void closeWithMySecurityManager(PersistenceManagerFactory pmf) { SecurityManager oldSecMgr = System.getSecurityManager(); try { System.setSecurityManager(new MySecurityManager()); } catch (SecurityException se) { // running with the TCK SecurityManager; don't run this test return; } try { pmf.close(); fail(ASSERTION_FAILED, "SecurityException was not thrown when calling pmf.close() " + "without JDOPermission.CLOSE_PERSISTENCE_MANAGER_FACTORY"); } catch (SecurityException ex) { // expected exception if JDOPermission("closePersistenceManagerFactory") is not set if (debug) logger.debug("caught expected exception " + ex.toString()); } catch (JDOException e) { fail(ASSERTION_FAILED, "Unexpected exception at pmf.close(): " + e); } finally { System.setSecurityManager(oldSecMgr); } } public class MySecurityManager extends SecurityManager { public void checkPermission(Permission perm) { if (perm==JDOPermission.CLOSE_PERSISTENCE_MANAGER_FACTORY) throw new SecurityException( "JDOPermission.CLOSE_PERSISTENCE_MANAGER_FACTORY not set"); } } } tck/src/java/org/apache/jdo/tck/api/persistencemanagerfactory/config/Jdoconfig.java100664 14531 12500110374 31004 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanagerfactory.config; import java.util.HashMap; import javax.jdo.JDOHelper; import javax.jdo.PersistenceManager; import javax.jdo.PersistenceManagerFactory; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title:Close of PersistenceManagerFactory *
*Keywords: persistencemanagerfactory, jdoconfig.xml *
*Assertion IDs: A11.1.2-1 *
*Assertion Description: * Users can access a PersistenceManagerFactory by creating a jdoconfig.xml file * and making it available on the class path as META-INF/jdoconfig.xml. */ public class Jdoconfig extends JDO_Test { /** Creates a new instance of Jdoconfig */ public Jdoconfig() { } /** */ private static final String ASSERTION_FAILED = "Assertion A11.1.2-1 failed: "; private static final String ANONYMOUS_PMF_NAME = ""; // Do not use superclass pmf, pm private PersistenceManagerFactory privatePmf = null; private PersistenceManager privatePm = null; private HashMap overrides = new HashMap(); /** * The main 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(Jdoconfig.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { /* Instance can be persisted ONLY if javax.jdo.mapping.Schema * is overriden with * JDOHelper.getPersistenceManagerFactory(Map overrides, ...). * The value depends on identity type so can only be known at runtime. */ if (isTestToBePerformed()) { overrides.put("javax.jdo.mapping.Schema", schemaname); } } /** */ public void testGetPMFNoArgs() { privatePmf = JDOHelper.getPersistenceManagerFactory(); checkIsOpen(ANONYMOUS_PMF_NAME); } /** */ public void testGetPMFEmptyString() { String name = ""; privatePmf = JDOHelper.getPersistenceManagerFactory(name); checkIsOpen(ANONYMOUS_PMF_NAME); } /** */ public void testGetPMFNull() { String name = null; privatePmf = JDOHelper.getPersistenceManagerFactory(name); checkIsOpen(ANONYMOUS_PMF_NAME); } /** */ public void testGetPMFStringSpace() { String name = " "; privatePmf = JDOHelper.getPersistenceManagerFactory(name); checkIsOpen(ANONYMOUS_PMF_NAME); } /** */ public void testGetPMFNamed() { String name = "namedPMF0"; privatePmf = JDOHelper.getPersistenceManagerFactory(name); assertEquals("Incorrect value for RestoreValues", privatePmf.getRestoreValues(), false); checkIsOpen(name); } /** */ public void testGetPMFEmptyStringOverrides() { String name = ""; privatePmf = JDOHelper.getPersistenceManagerFactory(overrides, name); checkPersistent(ANONYMOUS_PMF_NAME); } /** */ public void testGetPMFNullOverrides() { String name = null; privatePmf = JDOHelper.getPersistenceManagerFactory(overrides, name); checkPersistent(ANONYMOUS_PMF_NAME); } /** */ public void testGetPMFStringSpaceOverrides() { String name = " "; privatePmf = JDOHelper.getPersistenceManagerFactory(overrides, name); checkPersistent(ANONYMOUS_PMF_NAME); } /** */ public void testGetPMFNamedOverrides() { String name = "namedPMF0"; privatePmf = JDOHelper.getPersistenceManagerFactory(overrides, name); assertEquals("Incorrect value for RestoreValues", privatePmf.getRestoreValues(), false); checkPersistent(name); } /** */ public void testGetPMFNamedSpacesOverrides() { String name = "namedPMF1"; privatePmf = JDOHelper.getPersistenceManagerFactory(overrides, " \t" + name + " \n"); assertEquals("Incorrect value for RestoreValues", privatePmf.getRestoreValues(), true); checkPersistent(name); } /** */ public void checkIsOpen(String name) { assertEquals("Incorrect PMF name", name, privatePmf.getName()); if (privatePmf.isClosed()) { fail(ASSERTION_FAILED, "PMF.isClosed() returned true on an open pmf"); } closePMF(privatePmf); // have next invocation of getPMF() get a new pmf privatePmf = null; } /** * Checks if instance can be persisted. Can be used if * javax.jdo.mapping.Schema is overriden with the correct value * with JDOHelper.getPersistenceManagerFactory(Map overrides, ...). */ public void checkPersistent(String name) { assertEquals("Incorrect PMF name", name, privatePmf.getName()); makePersistent(); closePMF(privatePmf); if (!privatePmf.isClosed()) { fail(ASSERTION_FAILED, "PMF.isClosed() returned false on a closed pmf"); } // have next invocation of getPMF() get a new pmf privatePmf = null; } protected void makePersistent() { addTearDownClass(PCPoint.class); privatePm = privatePmf.getPersistenceManager(); Transaction tx = privatePm.currentTransaction(); tx.begin(); PCPoint comp = new PCPoint(1, 2); privatePm.makePersistent(comp); tx.commit(); } } tck/src/java/org/apache/jdo/tck/api/persistencemanagerfactory/config/JDOConfigListener.java100664 14410 12500110374 32346 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanagerfactory.config; import java.util.HashMap; import javax.jdo.JDOHelper; import javax.jdo.PersistenceManager; import javax.jdo.PersistenceManagerFactory; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title:JDOConfigListener *
*Keywords: persistencemanagerfactory, jdoconfig.xml *
*Assertion IDs: A11.1-40 *
*Assertion Description: Properties whose key begins with the prefix * "javax.jdo.listener.InstanceLifecycleListener." have special treatment. * The part of the key following the prefix is used as the class name of a class * that implements javax.jdo.listener.InstanceLifecycleListener. * The implementation first attempts to get an instance via the static method * getInstance() that returns an instance that implements the * javax.jdo.listener.InstanceLifecycleListener. If this is unsuccessful, * an instance of this class is constructed via a no-args constructor. * The value of the key is a comma-separated list of classes to which * the instantiated listener is registered to listen. */ public class JDOConfigListener extends JDO_Test { /** Creates a new instance of JDOConfigListener */ public JDOConfigListener() { } /** */ private static final String ASSERTION_FAILED = "Assertions 11.1-40 failed: "; private static final String ANONYMOUS_PMF_NAME = ""; // Do not use superclass pmf, pm private PersistenceManagerFactory pmf = null; private PersistenceManager pm = null; private HashMap overrides = new HashMap(); /** * The main 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(JDOConfigListener.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { /* Instance can be persisted ONLY if javax.jdo.mapping.Schema * is overriden with * JDOHelper.getPersistenceManagerFactory(Map overrides, ...). * The value depends on identity type so can only be known at runtime. */ if (isTestToBePerformed()) { overrides.put("javax.jdo.mapping.Schema", schemaname); } } /** * Test instantiation of InstanceLifecycleListener where listener class * and target classes are specified in jdoconfig.xml where listener * class provides only a public no-args constructor. */ public void testPCPointListener() { String pmfname = "testInstanceLifecycleListenerStore"; pmf = JDOHelper.getPersistenceManagerFactory(overrides, pmfname); makePersistent(); assertTrue("Expected preStore() to have been invoked.", StoreListener.isPreStore()); assertTrue("Expected postStore() to have been invoked.", StoreListener.isPostStore()); } /** * Test instantiation of InstanceLifecycleListener where listener class * and target classes are specified in jdoconfig.xml where listener * class provides a static method getInstance(). */ public void testPCPointListenerGetInstance() { String pmfname = "testInstanceLifecycleListenerStoreGetInstance"; pmf = JDOHelper.getPersistenceManagerFactory(overrides, pmfname); makePersistent(); assertTrue("Expected preStore() to have been invoked.", StoreListenerGetInstance.isPreStore()); assertTrue("Expected postStore() to have been invoked.", StoreListenerGetInstance.isPostStore()); } /** * Test instantiation of Instance LifeCycleListener specified via * property overrides. */ public void testPCPointListenerOverrides() { overrides.put("javax.jdo.listener.InstanceLifecycleListener.org.apache.jdo.tck.api.persistencemanagerfactory.config.StoreListener", "org.apache.jdo.tck.pc.mylib.PCPoint"); String pmfname = "testInstanceLifecycleListenerStoreOverrides"; pmf = JDOHelper.getPersistenceManagerFactory(overrides, pmfname); makePersistent(); assertTrue("Expected preStore() to have been invoked.", StoreListener.isPreStore()); assertTrue("Expected postStore() to have been invoked.", StoreListener.isPostStore()); } /** * Test instantiation of InstanceLifecycleListener where class value * is null */ public void testPCPointListenerNullClasses() { String pmfname = "testInstanceLifecycleListenerClassesNull"; pmf = JDOHelper.getPersistenceManagerFactory(overrides, pmfname); makePersistent(); assertTrue("Expected preStore() to have been invoked.", StoreListener.isPreStore()); assertTrue("Expected postStore() to have been invoked.", StoreListener.isPostStore()); } protected void makePersistent() { addTearDownClass(PCPoint.class); pm = pmf.getPersistenceManager(); Transaction tx = pm.currentTransaction(); tx.begin(); PCPoint comp = new PCPoint(1, 2); pm.makePersistent(comp); tx.commit(); } protected void localTearDown() { super.localTearDown(); StoreListener.resetValues(); StoreListenerGetInstance.resetValues(); closePMF(); } } tck/src/java/org/apache/jdo/tck/api/persistencemanagerfactory/config/Persistence.java100664 11742 12500110374 31367 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanagerfactory.config; import java.util.HashMap; import java.util.Map; import java.util.Properties; import javax.jdo.Constants; import javax.jdo.JDOHelper; import javax.jdo.PersistenceManager; import javax.jdo.PersistenceManagerFactory; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title:Close of PersistenceManagerFactory *
*Keywords: persistencemanagerfactory, jdoconfig.xml *
*Assertion IDs: A8.7-1 *
*Assertion Description: * The application provides a resource named META-INF/persistence.xml and * optionally META-INF/services/javax.persistence.EntityManagerFactory which * contain configuration information */ public class Persistence extends JDO_Test { /** Creates a new instance of Jdoconfig */ public Persistence() { } /** */ private static final String ASSERTION_FAILED = "Assertion A11.1.2-1 failed: "; // Do not use superclass pmf, pm private PersistenceManagerFactory pmf = null; private PersistenceManager pm = null; /** * The main 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(Persistence.class); } /** */ public void testGetPMFfromNamedPU() { String name = "PUNamed_" + identitytype + "0"; pmf = JDOHelper.getPersistenceManagerFactory(name); assertEquals("Incorrect value for RestoreValues", false, pmf.getRestoreValues()); runTest(name); } /** */ public void testGetPMFfromNamedPUWithNullOverrides() { String name = "PUNamed_" + identitytype + "0"; pmf = JDOHelper.getPersistenceManagerFactory(null, name); assertEquals("Incorrect value for RestoreValues", false, pmf.getRestoreValues()); runTest(name); } /** */ public void testGetPMFfromNamedPUWithEmptyOverrides() { String name = "PUNamed_" + identitytype + "0"; Map overrides = new HashMap(); pmf = JDOHelper.getPersistenceManagerFactory(overrides, name); assertEquals("Incorrect value for RestoreValues", false, pmf.getRestoreValues()); runTest(name); } /** */ public void testGetPMFfromNamedPUWithOverrides() { String name = "PUNamed_" + identitytype + "0"; Properties overrides = new Properties(); overrides.setProperty(Constants.PROPERTY_RESTORE_VALUES, "true"); pmf = JDOHelper.getPersistenceManagerFactory(overrides, name); assertEquals("Incorrect value for RestoreValues", true, pmf.getRestoreValues()); runTest(name); } /** */ public void testGetPMFfromNamedPUWithWhiteSpace() { String name = "PUNamed_" + identitytype + "0"; pmf = JDOHelper.getPersistenceManagerFactory(" \t" + name + " \n"); assertEquals("Incorrect value for RestoreValues", false, pmf.getRestoreValues()); runTest(name); } /** */ public void runTest(String name) { String actualPUName = pmf.getPersistenceUnitName(); assertEquals("Incorrect PersistenceUnitName", name, actualPUName); // check pmf.isClosed() before and after pmf.close() if (pmf.isClosed()) { fail(ASSERTION_FAILED, "PMF.isClosed() returned true on an open pmf"); } makePersistent(); closePMF(pmf); // don't use closePMF() because that sets pmf to null if (!pmf.isClosed()) { fail(ASSERTION_FAILED, "PMF.isClosed() returned false on a closed pmf"); } // have next invocation of getPMF() get a new pmf pmf = null; } protected void makePersistent() { addTearDownClass(PCPoint.class); pm = pmf.getPersistenceManager(); Transaction tx = pm.currentTransaction(); tx.begin(); PCPoint comp = new PCPoint(1, 2); pm.makePersistent(comp); tx.commit(); } } tck/src/java/org/apache/jdo/tck/api/persistencemanagerfactory/config/StoreListener.java100664 3652 12500110374 31666 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanagerfactory.config; import javax.jdo.listener.InstanceLifecycleEvent; import javax.jdo.listener.StoreLifecycleListener; /** * A StoreLivecycleListener implementation that provides a public no-args * constructor that may be invoked by a JDO implementation, * but NO getInstance() method. */ public class StoreListener implements StoreLifecycleListener { private static boolean preStore = false; private static boolean postStore = false; private static int instanceCount = 0; public StoreListener() { instanceCount++; } public static boolean isPreStore() { return preStore; } public static boolean isPostStore() { return postStore; } public static void resetValues() { preStore = false; postStore = false; } public void preStore(InstanceLifecycleEvent event) { // System.out.println("preStore: event is " + event); preStore = true; } public void postStore(InstanceLifecycleEvent event) { // System.out.println("postStore: event is " + event); postStore = true; } } tck/src/java/org/apache/jdo/tck/api/persistencemanagerfactory/config/StoreListenerGetInstance.java100664 4133 12500110374 34006 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanagerfactory.config; import javax.jdo.listener.InstanceLifecycleEvent; import javax.jdo.listener.StoreLifecycleListener; /** * A StoreLifecycleListener implementation that provides a getInstance() method * that may be invoked by a JDO implementation. */ public class StoreListenerGetInstance implements StoreLifecycleListener { private static boolean preStore = false; private static boolean postStore = false; private static int instanceCount = 0; private static StoreListenerGetInstance slInstance = new StoreListenerGetInstance(); private StoreListenerGetInstance() { instanceCount++; } public static StoreListenerGetInstance getInstance() { return slInstance; } public static boolean isPreStore() { return preStore; } public static boolean isPostStore() { return postStore; } public static void resetValues() { preStore = false; postStore = false; } public void preStore(InstanceLifecycleEvent event) { // System.out.println("preStore: event is " + event); preStore = true; } public void postStore(InstanceLifecycleEvent event) { // System.out.println("postStore: event is " + event); postStore = true; } } ././@LongLink100644 0 0 153 12500111677 10252 Lustar 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanagerfactory/config/ThrowOnUnknownStandardProperties.javatck/src/java/org/apache/jdo/tck/api/persistencemanagerfactory/config/ThrowOnUnknownStandardPropertie100664 12042 12500110374 34510 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanagerfactory.config; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.util.Map; import java.util.Properties; import javax.jdo.JDOException; import javax.jdo.JDOUserException; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; public class ThrowOnUnknownStandardProperties extends JDO_Test { /** * The main 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(ThrowOnUnknownStandardProperties.class); } protected boolean preSetUp() { return false; } protected boolean preTearDown() { return false; } protected Method getStaticGetPMFMethod() { Class pmfClass = getPMFClass(); try { Method m = pmfClass.getDeclaredMethod( "getPersistenceManagerFactory", new Class[] {Map.class}); if ((m.getModifiers() & Modifier.STATIC) != Modifier.STATIC) { throw new JDOException( "PMF class " + pmfClass.getName() + " method 'getPersistenceManagerFactory' is not static"); } return m; } catch (SecurityException e) { throw new JDOException( "Cannot get method 'getPersistenceManagerFactory' from PMF class " + pmfClass.getName(), e); } catch (NoSuchMethodException e) { throw new JDOException( "No method 'getPersistenceManagerFactory' from PMF class " + pmfClass.getName(), e); } } protected void invokeGetPMF(Object... args) throws Exception { Method getPMF = getStaticGetPMFMethod(); getPMF.invoke(null, args); } public void testUnknownStandardProperty() { Properties p = new Properties(); p.setProperty("javax.jdo.unknown.standard.property", "value"); try { invokeGetPMF(p); fail("testUnknownStandardProperty should result in JDOUserException. " + "No exception was thrown."); } catch (InvocationTargetException ite) { Throwable cause = ite.getCause(); if (cause != null && cause instanceof JDOUserException) { // :) } else { throw new JDOException("PMF threw " + cause + " instead of JDOException"); } } catch (Exception e) { throw new JDOException( "failed to invoke static getPersistenceManagerFactory(Map) method on PMF class", e); } } public void testUnknownStandardProperties() { Properties p = new Properties(); p.setProperty("javax.jdo.unknown.standard.property.1", "value"); p.setProperty("javax.jdo.unknown.standard.property.2", "value"); JDOUserException x = null; try { invokeGetPMF(p); fail("testUnknownStandardProperties should result in JDOUserException. " + "No exception was thrown."); } catch (InvocationTargetException ite) { Throwable cause = ite.getCause(); if (cause != null && cause instanceof JDOUserException) { x = (JDOUserException) cause; } else { throw new JDOException("PMF threw " + cause + " instead of JDOException"); } } catch (Exception e) { throw new JDOException( "failed to invoke static getPersistenceManagerFactory(Map) method on PMF class", e); } Throwable[] nesteds = x.getNestedExceptions(); assertNotNull(nesteds); assertEquals("should have been 2 nested exceptions", 2, nesteds.length); for (int i = 0; i < nesteds.length; i++) { Throwable t = nesteds[i]; assertTrue("nested exception " + i + " should have been JDOUserException", t instanceof JDOUserException); } } } tck/src/java/org/apache/jdo/tck/api/persistencemanagerfactory/FlushThrowsIfReadOnly.java100664 13535 12500110374 32045 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanagerfactory; import java.util.Date; import java.util.Properties; import javax.jdo.Constants; import javax.jdo.JDOHelper; import javax.jdo.JDOReadOnlyException; import javax.jdo.PersistenceManagerFactory; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.Address; import org.apache.jdo.tck.pc.company.Company; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title:ReadOnly property of PersistenceManagerFactory *
*Keywords: persistencemanagerfactory *
*Assertion IDs: A11.1-28 *
*Assertion Description: * if an attempt is made to write (via flush) then JDOReadOnlyException * is thrown. */ public class FlushThrowsIfReadOnly extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A11.1-28 FlushThrowsIfReadOnly failed: "; /** Second PMF that is read-only */ PersistenceManagerFactory pmf2; /** The company oid */ Object oid; /** * The main 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(FlushThrowsIfReadOnly.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(Company.class); Properties properties = loadProperties(PMFProperties); properties.put(Constants.PROPERTY_READONLY, "true"); pmf2 = JDOHelper.getPersistenceManagerFactory(properties); // insert an instance to find getPM(); pm.currentTransaction().begin(); Company comp = new Company(1L, "Sun Microsystems", new Date(), new Address(0,"","","","","")); pm.makePersistent(comp); oid = pm.getObjectId(comp); pm.currentTransaction().commit(); pm.close(); } /** */ public void testMakePersistent() { //Try to makePersistent and flush the transaction pm = pmf2.getPersistenceManager(); Transaction tx = pm.currentTransaction(); tx.begin(); Company comp = new Company(2L, "Sun Microsystems2", new Date(), new Address(0,"","","","","")); try { pm.makePersistent(comp); pm.flush(); fail("When the PersistenceManagerFactory is read only, " + "flush of a persistent-new instance must throw " + "JDOReadOnlyException."); } catch (JDOReadOnlyException jDOReadOnlyException) { // good catch } catch (Throwable t) { fail("When the PersistenceManagerFactory is read only, " + "flush of a persistent-deleted instance must throw " + "JDOReadOnlyException. Flush threw " + t); } tx.rollback(); pm.close(); pm = null; closePMF(pmf2); } /** */ public void testUpdate() { //Try to update and flush the transaction pm = pmf2.getPersistenceManager(); pm.getExtent(Company.class); // make sure that oid class is loaded Transaction tx = pm.currentTransaction(); tx.begin(); Company comp = (Company)pm.getObjectById(oid); try { comp.setName("new name"); pm.flush(); fail("When the PersistenceManagerFactory is read only, " + "flush of an updated instance must throw " + "JDOReadOnlyException."); } catch (JDOReadOnlyException jDOReadOnlyException) { // good catch } catch (Throwable t) { fail("When the PersistenceManagerFactory is read only, " + "flush of a persistent-deleted instance must throw " + "JDOReadOnlyException. Flush threw " + t); } tx.rollback(); pm.close(); pm = null; closePMF(pmf2); } /** */ public void testDeletePersistent() { //Try to deletePersistent and flush the transaction pm = pmf2.getPersistenceManager(); pm.getExtent(Company.class); // make sure that oid class is loaded Transaction tx = pm.currentTransaction(); tx.begin(); Company comp = (Company)pm.getObjectById(oid); try { pm.deletePersistent(comp); pm.flush(); fail("When the PersistenceManagerFactory is read only, " + "flush of a persistent-deleted instance must throw " + "JDOReadOnlyException."); } catch (JDOReadOnlyException jDOReadOnlyException) { // good catch } catch (Throwable t) { fail("When the PersistenceManagerFactory is read only, " + "flush of a persistent-deleted instance must throw " + "JDOReadOnlyException. Flush threw " + t); } tx.rollback(); pm.close(); pm = null; closePMF(pmf2); } } tck/src/java/org/apache/jdo/tck/api/persistencemanagerfactory/GetManagedClasses.java100664 5277 12500110374 31136 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanagerfactory; import java.util.Collection; import javax.jdo.Query; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.pc.mylib.PCRect; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title:GetManagedClasses of PersistenceManagerFactory *
*Keywords: persistencemanagerfactory *
*Assertion IDs: *
*Assertion Description: * Test output from PersistenceManagerFactory.getManagedClasses(). */ public class GetManagedClasses extends JDO_Test { /** * The main 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(GetManagedClasses.class); } /** */ public void test() { try { // Get PMF and a PM, and do an Extent on some classes pmf = getPMF(); pm = pmf.getPersistenceManager(); try { pm.currentTransaction().begin(); pm.getExtent(PCPoint.class); Query q = pm.newQuery(PCRect.class); q.execute(); pm.currentTransaction().rollback(); } catch (Exception e) { fail("Exception failed accessing Extents"); } finally { if (pm.currentTransaction().isActive()) { pm.currentTransaction().rollback(); } } // Check that the classes are now managed Collection managedClasses = pmf.getManagedClasses(); assertTrue("PCPoint ought to be managed but isnt", managedClasses.contains(PCPoint.class)); assertTrue("PCRect ought to be managed but isnt", managedClasses.contains(PCRect.class)); } finally { pm.close(); } } } tck/src/java/org/apache/jdo/tck/api/persistencemanagerfactory/GetPersistenceManager.java100664 4420 12500110374 32030 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanagerfactory; import javax.jdo.PersistenceManager; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title:GetPersistenceManager of PersistenceManagerFactory *
*Keywords: persistencemanagerfactory *
*Assertion IDs: A11.3-1. *
*Assertion Description: * PersistenceManagerFactory.getPersistenceManager() returns a * PersistenceManager instance with the configured properties and the * default values for option settings. */ public class GetPersistenceManager extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A11.3-1 (GetPersistenceManager) failed: "; /** * The main 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(GetPersistenceManager.class); } /** */ public void test() { PersistenceManager pm = null; try { pm = pmf.getPersistenceManager(); if (pm == null) { fail(ASSERTION_FAILED, "pmf.getPersistenceManager should " + "return a non-null value."); } } finally { if ((pm != null) && !pm.isClosed()) { pm.close(); } closePMF(); } } } ././@LongLink100644 0 0 164 12500111677 10254 Lustar 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanagerfactory/GetPersistenceManagerFactoryByPropertiesInstance.javatck/src/java/org/apache/jdo/tck/api/persistencemanagerfactory/GetPersistenceManagerFactoryByProperti100664 5401 12500110374 34460 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanagerfactory; import java.util.Date; import javax.jdo.JDOHelper; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.Address; import org.apache.jdo.tck.pc.company.Company; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title:Close of PersistenceManagerFactory *
*Keywords: persistencemanagerfactory *
*Assertion IDs: A11.1-32 *
*Assertion Description: * An implementation must provide a method to construct a * PersistenceManagerFactory by a Properties instance. This static method is * called by the JDOHelper method getPersistenceManagerFactory (Properties * props). */ public class GetPersistenceManagerFactoryByPropertiesInstance extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertions A11.1-32 (GetPersistenceManagerFactoryByPropertiesInstance) failed: "; /** * The main 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(GetPersistenceManagerFactoryByPropertiesInstance.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(Company.class); PMFPropertiesObject = loadProperties(PMFProperties); pmf = JDOHelper.getPersistenceManagerFactory(PMFPropertiesObject); } /** */ public void test() { //Try to get a PersistenceManager and begin and commit a transaction pm = getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); Company comp = new Company(1L, "Sun Microsystems", new Date(), new Address(0,"","","","","")); pm.makePersistent(comp); tx.commit(); pm.close(); pm = null; } } tck/src/java/org/apache/jdo/tck/api/persistencemanagerfactory/GetPersistenceManagerForUser.java100664 5636 12500110374 33350 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanagerfactory; import java.util.Properties; import javax.jdo.JDOHelper; import javax.jdo.PersistenceManager; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title:GetPersistenceManagerForUser of PersistenceManagerFactory *
*Keywords: persistencemanagerfactory *
*Assertion IDs: A11.3-2. *
*Assertion Description: * PersistenceManagerFactory.getPersistenceManager(String userid, * String password) returns a PersistenceManager instance with the * configured properties and the default values for option settings. */ public class GetPersistenceManagerForUser extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A11.3-2 (GetPersistenceManagerForUser) failed: "; /** The value of the ConnectionUserName property. */ private String username; /** The value of the ConnectionPassword property. */ private String password; /** * The main 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(GetPersistenceManagerForUser.class); } /** */ protected void localSetUp() { Properties props = loadProperties(PMFProperties); username = (String)props.remove(CONNECTION_USERNAME_PROP); password = (String)props.remove(CONNECTION_PASSWORD_PROP); pmf = JDOHelper.getPersistenceManagerFactory(props); } /** */ public void test() { PersistenceManager pm = null; try { pm = pmf.getPersistenceManager(username, password); if (pm == null) { fail(ASSERTION_FAILED, "pmf.getPersistenceManager(user, password) should " + "return a non-null value."); } } finally { if ((pm != null) && !pm.isClosed()) { pm.close(); } closePMF(); } } } tck/src/java/org/apache/jdo/tck/api/persistencemanagerfactory/GetPMFByFile.java100664 5150 12500110374 27767 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanagerfactory; import java.io.File; import javax.jdo.JDOHelper; import javax.jdo.PersistenceManagerFactory; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title:GetPMFByFile of PersistenceManagerFactory *
*Keywords: persistencemanagerfactory *
*Assertion IDs: A8.6-13. *
*Assertion Description: * Uses the parameter(s) passed as arguments to construct a Properties * instance, and then delegates to the static method * getPersistenceManagerFactory in the class named in the property * javax.jdo.PersistenceManagerFactoryClass. * If there are any exceptions while trying to construct the Properties * instance or to call the static method, * then either A8.6-4 [JDOFatalUserException] or * A8.6-5 [JDOFatalInternalException is thrown], * depending on whether the exception is due to the user * or the implementation. * The nested exception indicates the cause of the exception. * * @author Michael Watzek */ public class GetPMFByFile extends AbstractGetPMF { /** */ private static final String ASSERTION_FAILED = "Assertion A8.6-13 (GetPMFByFile) failed: "; /** * The main 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(GetPMFByFile.class); } /** */ public void testInvalidGetPMF() { checkGetPMFWithInvalidProperties(ASSERTION_FAILED); } /** */ public void testValidGetPMF() { checkGetPMFWithValidProperties(); } /** */ protected PersistenceManagerFactory getPMF(String name) { return JDOHelper.getPersistenceManagerFactory(new File(name)); } } tck/src/java/org/apache/jdo/tck/api/persistencemanagerfactory/GetPMFByFileAndClassLoader.java100664 5660 12500110374 32535 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanagerfactory; import java.io.File; import javax.jdo.JDOHelper; import javax.jdo.PersistenceManagerFactory; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title:GetPMFByFileAndClassLoader of PersistenceManagerFactory *
*Keywords: persistencemanagerfactory *
*Assertion IDs: A8.6-14. *
*Assertion Description: * Uses the parameter(s) passed as arguments to construct a Properties * instance, and then delegates to the static method * getPersistenceManagerFactory in the class named in the property * javax.jdo.PersistenceManagerFactoryClass. * If there are any exceptions while trying to construct the Properties * instance or to call the static method, * then either A8.6-4 [JDOFatalUserException] or * A8.6-5 [JDOFatalInternalException is thrown], * depending on whether the exception is due to the user * or the implementation. * The nested exception indicates the cause of the exception. * * @author Michael Watzek */ public class GetPMFByFileAndClassLoader extends AbstractGetPMF { /** */ private static final String ASSERTION_FAILED = "Assertion A8.6-14 (GetPMFByFileAndClassLoader) failed: "; private static final String propertiesFileDoesNotExist = "FileDoesNotExist.properties"; private static final String propertiesFileExists = System.getProperty("PMFProperties"); /** * The main 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(GetPMFByFileAndClassLoader.class); } /** */ public void testInvalidGetPMF() { checkGetPMFWithInvalidProperties(ASSERTION_FAILED); } /** */ public void testValidGetPMF() { checkGetPMFWithValidProperties(); } /** */ protected PersistenceManagerFactory getPMF(String name) { return JDOHelper.getPersistenceManagerFactory(new File(name), Thread.currentThread().getContextClassLoader()); } } tck/src/java/org/apache/jdo/tck/api/persistencemanagerfactory/GetPMFByJNDILocation.java100664 7643 12500110374 31336 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanagerfactory; import java.io.File; import javax.jdo.JDOFatalException; import javax.jdo.JDOHelper; import javax.jdo.PersistenceManagerFactory; import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title:GetPMFByJNDILocation of PersistenceManagerFactory *
*Keywords: persistencemanagerfactory *
*Assertion IDs: A8.6-19. *
*Assertion Description: * Uses the parameter(s) passed as arguments to construct a Properties * instance, and then delegates to the static method * getPersistenceManagerFactory in the class named in the property * javax.jdo.PersistenceManagerFactoryClass. * If there are any exceptions while trying to construct the Properties * instance or to call the static method, * then either A8.6-4 [JDOFatalUserException] or * A8.6-5 [JDOFatalInternalException is thrown], * depending on whether the exception is due to the user * or the implementation. * The nested exception indicates the cause of the exception. * * @author Michael Watzek */ public class GetPMFByJNDILocation extends AbstractGetPMF { /** */ private static final String ASSERTION_FAILED = "Assertion A8.6-19 (GetPMFByJNDILocation) failed: "; /** * The main 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(GetPMFByJNDILocation.class); } /** */ public void testInvalidGetPMF() { checkGetPMFWithInvalidProperties(ASSERTION_FAILED); } /** */ public void testValidGetPMF() { checkGetPMFWithValidProperties(); } /** */ protected PersistenceManagerFactory getPMF(String name) { Context context = null; try { //We need a JNDI context which contains a PMF instance. //For this reason, we create a JNDI context, //create a PMF instance and bind that to the context. context = new InitialContext(); if (name.equals(validPropertiesFile)) { PersistenceManagerFactory pmf = JDOHelper.getPersistenceManagerFactory(new File(name)); verifyProperties(pmf, loadProperties(validPropertiesFile)); context.bind(jndiName, pmf); } return JDOHelper.getPersistenceManagerFactory(jndiName, context); } catch (NamingException e) { throw new JDOFatalException("Caught NamingException trying to bind " + e.getMessage(), e); } finally { if (context != null) { try { context.unbind(jndiName); context.close(); } catch (NamingException e) { fail("Caught NamingException trying to unbind or close." + e.getMessage()); // stay quiet } } } } } ././@LongLink100644 0 0 146 12500111677 10254 Lustar 0 0 tck/src/java/org/apache/jdo/tck/api/persistencemanagerfactory/GetPMFByJNDILocationAndClassLoader.javatck/src/java/org/apache/jdo/tck/api/persistencemanagerfactory/GetPMFByJNDILocationAndClassLoader.jav100664 7414 12500110374 33731 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanagerfactory; import java.io.File; import javax.jdo.JDOFatalException; import javax.jdo.JDOHelper; import javax.jdo.PersistenceManagerFactory; import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title:GetPMFByJNDILocationAndClassLoader of PersistenceManagerFactory *
*Keywords: persistencemanagerfactory *
*Assertion IDs: A8.6-20. *
*Assertion Description: * Uses the parameter(s) passed as arguments to construct a Properties * instance, and then delegates to the static method * getPersistenceManagerFactory in the class named in the property * javax.jdo.PersistenceManagerFactoryClass. * If there are any exceptions while trying to construct the Properties * instance or to call the static method, * then either A8.6-4 [JDOFatalUserException] or * A8.6-5 [JDOFatalInternalException is thrown], * depending on whether the exception is due to the user * or the implementation. * The nested exception indicates the cause of the exception. * * @author Michael Watzek */ public class GetPMFByJNDILocationAndClassLoader extends AbstractGetPMF { /** */ private static final String ASSERTION_FAILED = "Assertion A8.6-20 (GetPMFByJNDILocationAndClassLoader) failed: "; /** * The main 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(GetPMFByJNDILocationAndClassLoader.class); } /** */ public void testInvalidGetPMF() { checkGetPMFWithInvalidProperties(ASSERTION_FAILED); } /** */ public void testValidGetPMF() { checkGetPMFWithValidProperties(); } /** */ protected PersistenceManagerFactory getPMF(String name) { Context context = null; try { //We need a JNDI context which contains a PMF instance. //For this reason, we create a JNDI context, //create a PMF instance and bind that to the context. context = new InitialContext(); if (name.equals(validPropertiesFile)) { PersistenceManagerFactory pmf = JDOHelper.getPersistenceManagerFactory(new File(name)); context.bind(jndiName, pmf); } return JDOHelper.getPersistenceManagerFactory(jndiName, context, Thread.currentThread().getContextClassLoader()); } catch (NamingException e) { throw new JDOFatalException("", e); } finally { if (context != null) { try { context.unbind(jndiName); context.close(); } catch (NamingException e) { // stay quiet } } } } } tck/src/java/org/apache/jdo/tck/api/persistencemanagerfactory/GetPMFByResource.java100664 5152 12500110374 30701 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanagerfactory; import javax.jdo.JDOHelper; import javax.jdo.PersistenceManagerFactory; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title:GetPMFByResource of PersistenceManagerFactory *
*Keywords: persistencemanagerfactory *
*Assertion IDs: A8.6-15. *
*Assertion Description: * Uses the parameter(s) passed as arguments to construct a Properties * instance, and then delegates to the static method * getPersistenceManagerFactory in the class named in the property * javax.jdo.PersistenceManagerFactoryClass. * If there are any exceptions while trying to construct the Properties * instance or to call the static method, * then either A8.6-4 [JDOFatalUserException] or * A8.6-5 [JDOFatalInternalException is thrown], * depending on whether the exception is due to the user * or the implementation. * The nested exception indicates the cause of the exception. * * @author Michael Watzek */ public class GetPMFByResource extends AbstractGetPMF { /** */ private static final String ASSERTION_FAILED = "Assertion A8.6-15 (GetPMFByResource) failed: "; /** * The main 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(GetPMFByResource.class); } /** */ public void testInvalidGetPMF() { checkGetPMFWithInvalidProperties(ASSERTION_FAILED); } /** */ public void testValidGetPMF() { checkGetPMFWithValidProperties(); } /** */ protected PersistenceManagerFactory getPMF(String name) { return JDOHelper.getPersistenceManagerFactory(removePathPrefix(name)); } } tck/src/java/org/apache/jdo/tck/api/persistencemanagerfactory/GetPMFByResourceAndClassLoader.java100664 5343 12500110374 33443 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanagerfactory; import javax.jdo.JDOHelper; import javax.jdo.PersistenceManagerFactory; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title:GetPMFByResourceAndClassLoader of PersistenceManagerFactory *
*Keywords: persistencemanagerfactory *
*Assertion IDs: A8.6-16. *
*Assertion Description: * Uses the parameter(s) passed as arguments to construct a Properties * instance, and then delegates to the static method * getPersistenceManagerFactory in the class named in the property * javax.jdo.PersistenceManagerFactoryClass. * If there are any exceptions while trying to construct the Properties * instance or to call the static method, * then either A8.6-4 [JDOFatalUserException] or * A8.6-5 [JDOFatalInternalException is thrown], * depending on whether the exception is due to the user * or the implementation. * The nested exception indicates the cause of the exception. * * @author Michael Watzek */ public class GetPMFByResourceAndClassLoader extends AbstractGetPMF { /** */ private static final String ASSERTION_FAILED = "Assertion A8.6-16 (GetPMFByResourceAndClassLoader) failed: "; /** * The main 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(GetPMFByResourceAndClassLoader.class); } /** */ public void testInvalidGetPMF() { checkGetPMFWithInvalidProperties(ASSERTION_FAILED); } /** */ public void testValidGetPMF() { checkGetPMFWithValidProperties(); } /** */ protected PersistenceManagerFactory getPMF(String name) { return JDOHelper.getPersistenceManagerFactory(removePathPrefix(name), Thread.currentThread().getContextClassLoader()); } } tck/src/java/org/apache/jdo/tck/api/persistencemanagerfactory/GetPMFByStream.java100664 6160 12500110374 30345 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanagerfactory; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import javax.jdo.JDOHelper; import javax.jdo.PersistenceManagerFactory; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title:GetPMFByStream of PersistenceManagerFactory *
*Keywords: persistencemanagerfactory *
*Assertion IDs: A8.6-17. *
*Assertion Description: * Uses the parameter(s) passed as arguments to construct a Properties * instance, and then delegates to the static method * getPersistenceManagerFactory in the class named in the property * javax.jdo.PersistenceManagerFactoryClass. * If there are any exceptions while trying to construct the Properties * instance or to call the static method, * then either A8.6-4 [JDOFatalUserException] or * A8.6-5 [JDOFatalInternalException is thrown], * depending on whether the exception is due to the user * or the implementation. * The nested exception indicates the cause of the exception. * * @author Michael Watzek */ public class GetPMFByStream extends AbstractGetPMF { /** */ private static final String ASSERTION_FAILED = "Assertion A8.6-17 (GetPMFByStream) failed: "; /** * The main 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(GetPMFByStream.class); } /** */ public void testInvalidGetPMF() { checkGetPMFWithInvalidProperties(ASSERTION_FAILED); } /** */ public void testValidGetPMF() { checkGetPMFWithValidProperties(); } /** */ protected PersistenceManagerFactory getPMF(String name) { FileInputStream stream = null; try { stream = new FileInputStream(name); return JDOHelper.getPersistenceManagerFactory(stream); } catch (FileNotFoundException e) { throw new RuntimeException("", e); } finally { if (stream != null) { try { stream.close(); } catch (IOException e) { throw new RuntimeException(e); } } } } } tck/src/java/org/apache/jdo/tck/api/persistencemanagerfactory/GetPMFByStreamAndClassLoader.java100664 6355 12500110374 33113 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanagerfactory; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import javax.jdo.JDOHelper; import javax.jdo.PersistenceManagerFactory; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title:GetPMFByStreamAndClassLoader of PersistenceManagerFactory *
*Keywords: persistencemanagerfactory *
*Assertion IDs: A8.6-18. *
*Assertion Description: * Uses the parameter(s) passed as arguments to construct a Properties * instance, and then delegates to the static method * getPersistenceManagerFactory in the class named in the property * javax.jdo.PersistenceManagerFactoryClass. * If there are any exceptions while trying to construct the Properties * instance or to call the static method, * then either A8.6-4 [JDOFatalUserException] or * A8.6-5 [JDOFatalInternalException is thrown], * depending on whether the exception is due to the user * or the implementation. * The nested exception indicates the cause of the exception. * * @author Michael Watzek */ public class GetPMFByStreamAndClassLoader extends AbstractGetPMF { /** */ private static final String ASSERTION_FAILED = "Assertion A8.6-18 (GetPMFByStreamAndClassLoader) failed: "; /** * The main 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(GetPMFByStreamAndClassLoader.class); } /** */ public void testInvalidGetPMF() { checkGetPMFWithInvalidProperties(ASSERTION_FAILED); } /** */ public void testValidGetPMF() { checkGetPMFWithValidProperties(); } /** */ protected PersistenceManagerFactory getPMF(String name) { FileInputStream stream = null; try { stream = new FileInputStream(name); return JDOHelper.getPersistenceManagerFactory(stream, Thread.currentThread().getContextClassLoader()); } catch (FileNotFoundException e) { throw new RuntimeException("", e); } finally { if (stream != null) { try { stream.close(); } catch (IOException e) { throw new RuntimeException(e); } } } } } tck/src/java/org/apache/jdo/tck/api/persistencemanagerfactory/GetProperties.java100664 5042 12500110374 30406 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanagerfactory; import java.util.Enumeration; import java.util.Properties; import javax.jdo.PersistenceManagerFactory; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title:Get properties of PersistenceManagerFactory *
*Keywords: persistencemanagerfactory *
*Assertion IDs: A11.4-1. *
*Assertion Description: PersistenceManagerFactory.getProperties() returns a Properties instance containing two standard JDO implementation properties VendorName: The name of the JDO vendor. VersionNumber: The version number string. */ public class GetProperties extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A11.4-1 (GetProperties) failed: "; /** * The main 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(GetProperties.class); } /** */ public void test() { PersistenceManagerFactory pmf = getPMF(); int foundStandardProperties = 0; Properties p = pmf.getProperties(); for (Enumeration e = p.propertyNames(); e.hasMoreElements(); ) { String s = (String) e.nextElement(); if (debug) logger.debug ("\t" + s + ": " + p.getProperty(s)); if (s.equals("VendorName") || s.equals("VersionNumber")) { foundStandardProperties++; } } if (foundStandardProperties != 2) { fail(ASSERTION_FAILED, "Standard properties not found."); } } } tck/src/java/org/apache/jdo/tck/api/persistencemanagerfactory/metadata/GetMetadataTest.java100664 12144 12500110374 32433 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanagerfactory.metadata; import javax.jdo.metadata.ColumnMetadata; import javax.jdo.metadata.MemberMetadata; import javax.jdo.metadata.Metadata; import javax.jdo.metadata.PackageMetadata; import javax.jdo.metadata.TypeMetadata; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title:Metadata Test *
*Keywords: *
*Assertion IDs: A11.10-1 *
*Assertion Description: * Method to return the metadata object for the specified class/interface, if there is * metadata defined for that class/interface. * If the parameter is null, null is returned. * If there is no metadata for the specified class/interface then null will be returned. */ public class GetMetadataTest extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A11.10-1 (getMetadata) failed: "; /** * The main 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(GetMetadataTest.class); } /** test getMetadata with null class name*/ public void testNullParameter() { pm = getPM(); String className = null; TypeMetadata metadata = pmf.getMetadata(className); assertNull(ASSERTION_FAILED + "metadata should return null if null parameter", metadata); } /** test getMetadata with concrete class name*/ public void testConcreteClassName() { pm = getPM(); String className = "org.apache.jdo.tck.pc.company.PartTimeEmployee"; TypeMetadata metadata = pmf.getMetadata(className); assertNotNull(ASSERTION_FAILED + "metadata must not be null for abstract class " + className, metadata); Metadata parent = metadata.getParent(); assertNotNull(ASSERTION_FAILED + "parent metadata must not be null for concrete class " + className, parent); String name = metadata.getName(); String packageName = ((PackageMetadata)parent).getName(); assertEquals(ASSERTION_FAILED + "metadata name and class name must match.", className, packageName + "." + name); } /** test getMetadata with abstract class name*/ public void testAbstractClassName() { pm = getPM(); String className = "org.apache.jdo.tck.pc.company.Employee"; TypeMetadata metadata = pmf.getMetadata(className); assertNotNull(ASSERTION_FAILED + "metadata must not be null for abstract class " + className, metadata); Metadata parent = metadata.getParent(); assertNotNull(ASSERTION_FAILED + "parent metadata must not be null for abstract class " + className, parent); String name = metadata.getName(); String packageName = ((PackageMetadata)parent).getName(); assertEquals(ASSERTION_FAILED + "metadata name and class name must match.", className, packageName + "." + name); } /** test getMetadata with invalid class name*/ public void testInvalidName() { pm = getPM(); String className = "org.apache.jdo.tck.pc.company.Bogus"; TypeMetadata metadata = pmf.getMetadata(className); assertNull(ASSERTION_FAILED + "metadata should return null if unknown parameter", metadata); } /** dump the contents of this metadata */ @SuppressWarnings("unused") private void dump(TypeMetadata typeMetadata) { StringBuilder buffer = new StringBuilder("Metadata for " + typeMetadata.getName()); buffer.append(" identityType: " + typeMetadata.getIdentityType()); MemberMetadata[] members = typeMetadata.getMembers(); if (members != null) { for (MemberMetadata memberMetadata: members) { buffer.append(" member: " + memberMetadata.getName()); } } ColumnMetadata[] columns = typeMetadata.getColumns(); if (columns != null) { for (ColumnMetadata columnMetadata: columns) { buffer.append("ColumnMetadata for " + columnMetadata.getName()); } } System.out.println(buffer.toString()); } } tck/src/java/org/apache/jdo/tck/api/persistencemanagerfactory/SetConnectionPassword.java100664 4313 12500110374 32110 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanagerfactory; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title:Set ConnectionPassword of persistencemanagerfactory *
*Keywords: persistencemanagerfactory *
*Assertion IDs: A11.1-15. *
*Assertion Description: * PersistenceManagerFactory.setConnectionPassword(String password) sets the * value of the ConnectionPassword property (the password for the user) */ public class SetConnectionPassword extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A11.1-15 (SetConnectionPassword) failed: "; /** The value of the ConnectionPassword property. */ private String password; /** * The main 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(SetConnectionPassword.class); } /** */ protected void localSetUp() { closePMF(); pmf = getUnconfiguredPMF(); password = getPMFProperty(CONNECTION_PASSWORD_PROP); } /** * Set ConnectionPassword. */ public void test() { try { pmf.setConnectionPassword(password); } finally { closePMF(); } } } tck/src/java/org/apache/jdo/tck/api/persistencemanagerfactory/SetConnectionURL.java100664 5352 12500110374 30754 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanagerfactory; import javax.jdo.JDOException; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title:Set ConnectionURL of PersistenceManagerFactory *
*Keywords: persistencemanagerfactory *
*Assertion IDs: A11.1-16,A11.1-17. *
*Assertion Description: * PersistenceManagerFactory.setConnectionURL(String URL) sets the value of * the ConnectionURL property (the URL for the data source). * PersistenceManagerFactory.getConnectionURL() returns the value of the * ConnectionURL property. */ public class SetConnectionURL extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A11.1-16,A11.1-17 (SetConnectionURL) failed: "; /** The value of the ConnectionURL property. */ private String url; /** * The main 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(SetConnectionURL.class); } /** */ protected void localSetUp() { closePMF(); pmf = getUnconfiguredPMF(); url = getPMFProperty(CONNECTION_URL_PROP); } /** Set ConnectionURL value and get ConnectionURL value to verify. */ public void test() { try { if (url == null) { throw new JDOException( "Missing PMF property " + CONNECTION_URL_PROP); } pmf.setConnectionURL(url); if (!url.equals(pmf.getConnectionURL())) { fail(ASSERTION_FAILED, "ConnectionURL set to '" + url + "' ," + "value returned by PMF is '" + pmf.getConnectionURL() + "'."); } } finally { closePMF(); } } } tck/src/java/org/apache/jdo/tck/api/persistencemanagerfactory/SetConnectionUserName.java100664 5732 12500110374 32033 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanagerfactory; import javax.jdo.JDOException; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title:Set ConnectionUserName of PersistenceManagerFactory *
*Keywords: persistencemanagerfactory *
*Assertion IDs: A11.1-13,A11.1-14. *
*Assertion Description: * PersistenceManagerFactory.setConnectionUserName(String name) sets the value * of the ConnectionUserName property (the name of the user establishing the * connection). */ public class SetConnectionUserName extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertions A11.1-13,A11.1-14 (SetConnectionUserName) failed: "; /** The value of the ConnectionUserName property. */ private String username; /** * The main 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(SetConnectionUserName.class); } /** */ protected void localSetUp() { closePMF(); pmf = getUnconfiguredPMF(); username = getPMFProperty(CONNECTION_USERNAME_PROP); } /** * Set ConnectionUserName value and get ConnectionUserName value to verify. */ public void test() { try { if (username == null) { throw new JDOException( "Missing PMF property " + CONNECTION_USERNAME_PROP); } pmf.setConnectionUserName(username); if (!username.equals(pmf.getConnectionUserName())) { fail(ASSERTION_FAILED, "ConnectionUserName set to '" + username + "' ," + "value returned by PMF is '" + pmf.getConnectionUserName() + "'."); } } catch (Exception ex) { fail(ASSERTION_FAILED, "Failed in setting ConnectionUserName " + ex); } if (debug) logger.debug("ConnectionUserName: " + pmf.getConnectionUserName()); } } tck/src/java/org/apache/jdo/tck/api/persistencemanagerfactory/SetIgnoreCache.java100664 5026 12500110374 30437 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanagerfactory; import javax.jdo.PersistenceManagerFactory; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title:Set IgnoreCache of persistencemanagerfactory *
*Keywords: persistencemanagerfactory *
*Assertion IDs: A11.1-5. *
*Assertion Description: * PersistenceManagerFactory.setIgnoreCache(boolean flag) sets the value of * the IgnoreCache property (the query mode that specifies whether cached * instances are considered when evaluating the filter expression). */ public class SetIgnoreCache extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A11.1-5 (SetIgnoreCache) failed: "; /** * The main 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(SetIgnoreCache.class); } /** */ protected void localSetUp() { closePMF(); pmf = getUnconfiguredPMF(); } /** * Set IgnoreCache to true or false and use getIgnoreCache value to verify. */ public void test() { try { setIgnoreCache(false); setIgnoreCache(true); } finally { closePMF(); } } /** */ private void setIgnoreCache(boolean newValue) { pmf.setIgnoreCache(newValue); boolean current = pmf.getIgnoreCache(); if (current != newValue) { fail(ASSERTION_FAILED, "IgnoreCache set to " + newValue + ", value returned by PMF is " + current); } } } tck/src/java/org/apache/jdo/tck/api/persistencemanagerfactory/SetMultithreaded.java100664 5224 12500110374 31063 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanagerfactory; import java.util.Properties; import javax.jdo.PersistenceManager; import javax.jdo.PersistenceManagerFactory; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title:Set Multithreaded of persistencemanagerfactory *
*Keywords: persistencemanagerfactory *
*Assertion IDs: A11.1-11,A11.1-12. *
*Assertion Description: * PersistenceManagerFactory.setMultithreaded(boolean flag) sets the value of * the Multithreaded flag that indicates that the application will invoke * methods or access fields of managed instances from multiple threads. */ public class SetMultithreaded extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertions A11.1-11,A11.1-12 (SetMultithreaded) failed: "; /** * The main 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(SetMultithreaded.class); } /** */ protected void localSetUp() { closePMF(); pmf = getUnconfiguredPMF(); } /** * Set Multithreaded to true or false and use getMultithreaded value to * verify. */ public void test() { try { setMultithreaded(false); setMultithreaded(true); } finally { closePMF(); } } /** */ private void setMultithreaded(boolean newValue) { pmf.setMultithreaded(newValue); boolean current = pmf.getMultithreaded(); if (current != newValue) { fail(ASSERTION_FAILED, "Multithreaded set to " + newValue + ", value returned by PMF is " + current); } } } tck/src/java/org/apache/jdo/tck/api/persistencemanagerfactory/SetNonTransactionalRead.java100664 5223 12500110374 32340 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanagerfactory; import javax.jdo.PersistenceManagerFactory; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title:Set NonTransactionalRead of persistencemanagerfactory *
*Keywords: persistencemanagerfactory *
*Assertion IDs: A11.1-7,A11.1-8. *
*Assertion Description: * PersistenceManagerFactory.setNontransactionalRead(boolean flag) sets the * value of the NontransactionalRead property (the PersistenceManager mode * that allows instances to be read outside a transaction). */ public class SetNonTransactionalRead extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertions A11.1-7,A11.1-8 (SetNonTransactionalRead) failed: "; /** * The main 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(SetNonTransactionalRead.class); } /** */ protected void localSetUp() { closePMF(); pmf = getUnconfiguredPMF(); } /** * Set NonTransactionalRead to true or false and use * getNonTransactionalRead value to verify. */ public void test() { try { setNontransactionalRead(false); setNontransactionalRead(true); } finally { closePMF(); } } /** */ private void setNontransactionalRead(boolean newValue) { pmf.setNontransactionalRead(newValue); boolean current = pmf.getNontransactionalRead(); if (current != newValue) { fail(ASSERTION_FAILED, "NonTransactionalRead set to " + newValue + ", value returned by PMF is " + current); } } } tck/src/java/org/apache/jdo/tck/api/persistencemanagerfactory/SetNonTransactionalWrite.java100664 5706 12500110374 32565 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanagerfactory; import javax.jdo.PersistenceManagerFactory; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title:Set NonTransactionalWrite of persistencemanagerfactory *
*Keywords: persistencemanagerfactory *
*Assertion IDs: A11.1-9,A11.1-10. *
*Assertion Description: * PersistenceManagerFactory.setNontransactionalWrite(boolean flag) sets the * value of the NontransactionalWrite property (the PersistenceManager mode * that allows instances to be written outside a transaction). */ public class SetNonTransactionalWrite extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertions A11.1-9,A11.1-10 (SetNonTransactionalWrite) failed: "; /** * The main 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(SetNonTransactionalWrite.class); } /** */ protected void localSetUp() { closePMF(); pmf = getUnconfiguredPMF(); } /** Set NonTransactionalWrite to true or false and use * getNonTransactionalWrite value to verify. */ public void test () { if (!isNontransactionalWriteSupported()) { printUnsupportedOptionalFeatureNotTested( "org.apache.jdo.tck.api.persistencemanagerfactory.SetNonTransactionalWrite", "javax.jdo.option.NontransactionalWrite"); return; } try { setNontransactionalWrite(false); setNontransactionalWrite(true); } finally { closePMF(); } } /** */ private void setNontransactionalWrite(boolean newValue) { pmf.setNontransactionalWrite(newValue); boolean current = pmf.getNontransactionalWrite(); if (current != newValue) { fail(ASSERTION_FAILED, "NonTransactionalWrite set to " + newValue + ", value returned by PMF is " + current); } } } tck/src/java/org/apache/jdo/tck/api/persistencemanagerfactory/SetOptimistic.java100664 5422 12500110374 30414 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanagerfactory; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title:Set optimistic of persistencemanagerfactory *
*Keywords: persistencemanagerfactory *
*Assertion IDs: A11.1-1, A11.1-2. *
*Assertion Description: * PersistenceManagerFactory.getOptimistic() returns Value of the Optimistic * property,persistenceManagerFactory.setOptimistic(boolean flag) sets the * value of the Optimistic property (the transaction mode that specifies * concurrency control. */ public class SetOptimistic extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A11.1-1, A11.1-2 (SetOptimistic) failed: "; /** * The main 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(SetOptimistic.class); } /** */ protected void localSetUp() { closePMF(); pmf = getUnconfiguredPMF(); } /** Set Optimistic to true or false and use getOptimistic value to verify. */ public void test() { if (!isOptimisticSupported()) { printUnsupportedOptionalFeatureNotTested( "org.apache.jdo.tck.api.persistencemanagerfactory.SetOptimistic", "javax.jdo.option.Optimistic"); return; } try { setOptimistic(false); setOptimistic(true); } finally { closePMF(); } } /** */ private void setOptimistic(boolean newValue) { pmf.setOptimistic(newValue); boolean optimistic = pmf.getOptimistic(); if (optimistic != newValue) { fail(ASSERTION_FAILED, "Optimistic set to " + newValue + ", value returned by PMF is " + optimistic); } } } tck/src/java/org/apache/jdo/tck/api/persistencemanagerfactory/SetReadOnly.java100664 4754 12500110374 30014 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanagerfactory; import javax.jdo.PersistenceManagerFactory; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title:Set ReadOnly property of persistencemanagerfactory *
*Keywords: persistencemanagerfactory *
*Assertion IDs: A11.1-29, A11.1-30 *
*Assertion Description: * PersistenceManagerFactory.setReadOnly(boolean) sets the value of the * ReadOnly property * PersistenceManagerFactory.getReadOnly() returns the value of the * ReadOnly property */ public class SetReadOnly extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A11.1-29, A11.1-30 (SetRetainValues) failed: "; /** * The main 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(SetReadOnly.class); } /** */ protected void localSetUp() { closePMF(); pmf = getUnconfiguredPMF(); } /** * Set ReadOnly to true or false and use getReadOnly to verify. */ public void test() { try { setReadOnly(false); setReadOnly(true); } finally { closePMF(); } } /** */ private void setReadOnly(boolean newValue) { pmf.setReadOnly(newValue); boolean current = pmf.getReadOnly(); if (current != newValue) { fail(ASSERTION_FAILED, "ReadOnly set to " + newValue + ", value returned by PMF is " + current); } } } tck/src/java/org/apache/jdo/tck/api/persistencemanagerfactory/SetRetainValues.java100664 5211 12500110374 30666 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanagerfactory; import javax.jdo.PersistenceManagerFactory; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title:Set RetainValues of persistencemanagerfactory *
*Keywords: persistencemanagerfactory *
*Assertion IDs: A11.1-3,A11.1-4. *
*Assertion Description: * PersistenceManagerFactory.setRetainValues(boolean flag) sets the value of * the RetainValues property (the transaction mode that specifies the * treatment of persistent instances after commit), * PersistenceManagerFactory.getRetainValues() returns the value of the * RetainValues property. */ public class SetRetainValues extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A11.1-3,A11.1-4 (SetRetainValues) failed: "; /** * The main 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(SetRetainValues.class); } /** */ protected void localSetUp() { closePMF(); pmf = getUnconfiguredPMF(); } /** * Set RetainValues to true or false and use getRetainValues value to * verify. */ public void test() { try { setRetainValues(false); setRetainValues(true); } finally { closePMF(); } } /** */ private void setRetainValues(boolean newValue) { pmf.setRetainValues(newValue); boolean current = pmf.getRetainValues(); if (current != newValue) { fail(ASSERTION_FAILED, "RetainValues set to " + newValue + ", value returned by PMF is " + current); } } } tck/src/java/org/apache/jdo/tck/api/persistencemanagerfactory/SetTransactionIsolationLevel.java100664 17466 12500110374 33462 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanagerfactory; import java.util.HashMap; import java.util.Map; import javax.jdo.Constants; import javax.jdo.JDOHelper; import javax.jdo.JDOUnsupportedOptionException; import javax.jdo.PersistenceManager; import javax.jdo.PersistenceManagerFactory; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title:Set transaction isolation level of persistencemanagerfactory *
*Keywords: persistencemanagerfactory *
*Assertion IDs: A11.1-xxxx, A11.1-xxxx. *
*Assertion Description: * PersistenceManagerFactory.getTransactionIsolationLevel() returns the value * of the transaction isolation level. * PersistenceManagerFactory.setTransactionIsolationLevel(String) sets the value * of the transaction isolation level. */ public class SetTransactionIsolationLevel extends JDO_Test implements Constants { /** */ private static final String ASSERTION_FAILED = "Assertion A11.1-1, A11.1-2 (setTransactionIsolationLevel) failed: "; /** All specified transaction isolation levels */ private static final String[] transactionIsolationLevels = new String[] { TX_READ_UNCOMMITTED, TX_READ_COMMITTED, TX_REPEATABLE_READ, TX_SNAPSHOT, TX_SERIALIZABLE }; private PersistenceManagerFactory pmf2; /** * The main 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(SetTransactionIsolationLevel.class); } /** */ protected void localSetUp() { // setUp gets a PMF that needs to be closed closePMF(); } /** Set TransactionIsolationLevel to all values via API. */ public void testSetTransactionIsolationLevelByAPI() { // iterate through all possible TransactionIsolationLevels for (int i = 0; i < transactionIsolationLevels.length; ++i) { String transactionIsolationLevel = transactionIsolationLevels[i]; setTransactionIsolationLevelByAPI(transactionIsolationLevel); } failOnError(); } /** Set TransactionIsolationLevel to all values from properties. */ public void testSetTransactionIsolationLevelFromProperties() { // iterate through all possible TransactionIsolationLevels for (int i = 0; i < transactionIsolationLevels.length; ++i) { String transactionIsolationLevel = transactionIsolationLevels[i]; getPMFsetTransactionIsolationLevelFromProperties(transactionIsolationLevel); } failOnError(); } /** Set TransactionIsolationLevel to all values. */ public void testTransactionIsolationLevelReadCommittedSupported() { // this test depends on setUp initializing supportedOptions String readCommitted = PROPERTY_TRANSACTION_ISOLATION_LEVEL_READ_COMMITTED; // make sure read committed is supported if (!isSupported(readCommitted)) { appendMessage(ASSERTION_FAILED + "\nSupportedOptions does not include " + readCommitted + "."); } failOnError(); } /** */ private void setTransactionIsolationLevelByAPI(String level) { pmf = getUnconfiguredPMF(); // Set datastore details so the implementation knows what is supported pmf.setConnectionURL(getPMFProperty(CONNECTION_URL_PROP)); pmf.setConnectionUserName(getPMFProperty(CONNECTION_USERNAME_PROP)); pmf.setConnectionPassword(getPMFProperty(CONNECTION_PASSWORD_PROP)); pmf.setConnectionDriverName(getPMFProperty(PROPERTY_CONNECTION_DRIVER_NAME)); String property = PROPERTY_TRANSACTION_ISOLATION_LEVEL + "." + level; try { pmf.setTransactionIsolationLevel(level); // Get first PM so the PMF is frozen pmf.getPersistenceManager(); if (!isSupported(property)) { appendMessage(ASSERTION_FAILED + "\nCreated PersistenceManager for isolation level "+ level + " yet the PMF says that this level is not supported!\n"); } } catch (JDOUnsupportedOptionException ex) { // not supported, so check with the PMF if this should be supported if (isSupported(property)) { appendMessage(ASSERTION_FAILED + "\nReceived JDOUnsupportedOptionException on creating the "+ "first PersistenceManager yet the PMF says that isolation level "+ "is supported!\n"); } } catch (Throwable t) { appendMessage(ASSERTION_FAILED + "\nThe expected JDOUnsupportedOptionException was not " + "thrown for unsupported isolation level " + level + " but unexpected exception:\n" + t); } closePMF(); return; } /** */ private void getPMFsetTransactionIsolationLevelFromProperties(String level) { String property = PROPERTY_TRANSACTION_ISOLATION_LEVEL + "." + level; Map modifiedProps = new HashMap(PMFPropertiesObject); modifiedProps.put(PROPERTY_TRANSACTION_ISOLATION_LEVEL, level); if (isSupported(property)) { pmf2 = JDOHelper.getPersistenceManagerFactory(modifiedProps); String actual = pmf2.getTransactionIsolationLevel(); if (!validLevelSubstitution(level, actual)) { appendMessage(ASSERTION_FAILED + "\nTransactionIsolationLevel set to " + level + "; value returned by PMF is " + actual); } PersistenceManager pm2 = pmf2.getPersistenceManager(); actual = pm2.currentTransaction().getIsolationLevel(); if (!validLevelSubstitution(level, actual)) { appendMessage(ASSERTION_FAILED + "\nTransactionIsolationLevel set to " + level + "; value returned by Transaction is " + actual); } } else { try { pmf2 = JDOHelper.getPersistenceManagerFactory(modifiedProps); // no exception thrown; bad appendMessage(ASSERTION_FAILED + "\nThe expected JDOUserException was not thrown for " + "JDOHelper.getPersistenceManagerFactory " + "for unsupported isolation level " + level + "."); } catch (JDOUnsupportedOptionException ex) { // good catch } catch (Throwable t) { appendMessage(ASSERTION_FAILED + "\nThe expected JDOUserException was not thrown for " + "JDOHelper.getPersistenceManagerFactory " + "for unsupported isolation level " + level + "but unexpected exception:\n" + t); } } closePMF(pmf2); return; } } tck/src/java/org/apache/jdo/tck/api/persistencemanagerfactory/SupportedOptions.java100664 4571 12500110374 31161 0ustarmbouschenstaff 0 0 /* * 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.api.persistencemanagerfactory; import java.util.Collection; import java.util.Iterator; import javax.jdo.PersistenceManagerFactory; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title:SupportedOptions of persistencemanagerfactory *
*Keywords: persistencemanagerfactory *
*Assertion IDs: A11.5-1. *
*Assertion Description: * PersistenceManagerFactory.supportedOptions() returns a Collection of String, each String instance representing an optional feature of the implementation or a supported query language. */ /* * Revision History * ================ * Author : Linga Neerathilingam * Date : 10/22/01 * */ public class SupportedOptions extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A11.5-1 (SupportedOptions) failed: "; /** * The main 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(SupportedOptions.class); } /** */ public void test() { PersistenceManagerFactory pmf = getPMF(); if (debug) logger.debug("Options supported by this implementation:"); Collection c = pmf.supportedOptions(); Iterator iter = c.iterator(); while( iter.hasNext() ){ String option = (String) iter.next(); if (debug) logger.debug(option); } } } tck/src/java/org/apache/jdo/tck/api/SignatureTest.java100664 10205 12500110374 23161 0ustarmbouschenstaff 0 0 /* * 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.api; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.util.signature.SignatureVerifier; import java.io.IOException; import java.io.PrintWriter; import java.io.StringWriter; import java.util.List; import java.util.ArrayList; import java.text.ParseException; /** *Title: SignatureTest *
*Keywords: API *
*Assertion IDs: *
*Assertion Description: * This test verifies that a set of JDO API classes and interfaces * is compliant with a "signature" description, which has been verified * against the JDO specification document. Any discrepancies between * the feature declarations in the API classes and the signature descriptor * are reported, including any public non-standard features found only in * the API classes. */ public class SignatureTest extends JDO_Test { private static String newLine = System.getProperty("line.separator"); /** */ private static final String ASSERTION_FAILED = "API Signature Test failed: "; /** * The main 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(SignatureTest.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { } /** Runs the API Signature Test. */ public void testSignatures() { // create a SignatureVerifier instance final StringWriter sw = new StringWriter(); final PrintWriter pw = new PrintWriter(sw); //auto-flushes on println final boolean quiet = false; final boolean verbose = debug; final SignatureVerifier verifier = new SignatureVerifier(pw, quiet, verbose); // run the signature test try { // fetch name of signature file final String signatureFileName = System.getProperty("jdo.tck.signaturefile"); if (signatureFileName == null) { fail(ASSERTION_FAILED, "No system property defined: jdo.tck.signaturefile"); return; } // run the test final List signatureFileNames = new ArrayList(); signatureFileNames.add(signatureFileName); int status = verifier.test(signatureFileNames); // print test's output in case of problems or debugging if (status != 0) { fail(ASSERTION_FAILED, ("Found problems or signature descrepancies." + newLine + "Test Output: " + newLine + sw.toString())); logger.debug(sw.toString()); } // print test's output in case of problems or debugging if (debug) { logger.debug(sw.toString()); } } catch (IOException ex) { fail(ASSERTION_FAILED, ("Exception caught: " + ex + newLine + "Test Output: " + newLine + sw.toString())); } catch (ParseException ex) { fail(ASSERTION_FAILED, ("Exception caught: " + ex + newLine + "Test Output: " + newLine + sw.toString())); } } } tck/src/java/org/apache/jdo/tck/enhancement/EnhancerTest.java100664 7004 12500110373 24441 0ustarmbouschenstaff 0 0 /* * 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. */ /* * EnhancerTest.java * * Created on February 17, 2002, 1:59 PM */ package org.apache.jdo.tck.enhancement; import java.io.InputStream; import java.util.ArrayList; import java.util.Enumeration; import java.util.List; import java.util.Properties; import java.util.StringTokenizer; import org.apache.jdo.tck.JDO_Test; /** * * @author Craig Russell * @version 1.0 */ public abstract class EnhancerTest extends JDO_Test { /** Creates new EnhancerTest */ public EnhancerTest() { } /** */ protected Properties getProperties(String resourceName) { Properties props = null; try { InputStream in = this.getClass().getClassLoader().getResourceAsStream(resourceName); props = new Properties(); props.load(in); } catch (Exception ex) { ex.printStackTrace(); fail("EnhancerTest:", "Error loading properties " + resourceName + " exception " + ex); } return props; } /** */ protected abstract void runTestOnePackage (String packageName, List fullyQualifiedClassNameList); /** */ protected String convertClassName (String packageName, String className) { return packageName + "." + className; } /** */ void runTestAllPackages() { /** First, get classes to test from properties file. */ Properties classesToTest = getProperties("enhancement-test.properties"); //NOI18N Enumeration enumeration = classesToTest.propertyNames(); int numberOfPackages = 0; /** Each key is a package name; the value is a list of class names to test. */ while (enumeration.hasMoreElements()) { ++numberOfPackages; String packageName = (String) enumeration.nextElement(); if (debug) logger.debug("EnhancerTest Package: " + packageName); String classNames = (String) classesToTest.get(packageName); if (debug) logger.debug("EnhancerTest Classes: " + classNames); StringTokenizer st = new StringTokenizer(classNames, " ,"); ArrayList classNameList = new ArrayList(); /** Each entry is a list of class names separated by comma or space */ while (st.hasMoreTokens()) { String className = st.nextToken(); String listEntry = convertClassName(packageName, className); classNameList.add (listEntry); if (debug) logger.debug("EnhancerTest Class: " + className); } runTestOnePackage (packageName, classNameList); } if (debug) logger.debug("EnhancerTest numberOfPackages: " + numberOfPackages); return; } } tck/src/java/org/apache/jdo/tck/extents/CloseAll.java100664 5341 12500110374 22764 0ustarmbouschenstaff 0 0 /* * 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.extents; import java.util.Iterator; import javax.jdo.Extent; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: CloseAll *
*Keywords: extent *
*Assertion ID: A15.3-12. *
*Assertion Description: After a call to Extent.closeAll(), all iterators acquired from this Extent will return false to hasNext(). */ public class CloseAll extends ExtentTest { /** */ private static final String ASSERTION_FAILED = "Assertion A15.3-12 (CloseAll) failed: "; /** * The main 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(CloseAll.class); } /** */ public void test() { try { beginTransaction(); Extent ex = getPM().getExtent (Employee.class, true); Iterator it1 = ex.iterator(); deleteEmployee((Employee)it1.next()); Iterator it2 = ex.iterator(); addEmployee(); Iterator it3 = ex.iterator(); ex.closeAll(); if (it1.hasNext()) { fail(ASSERTION_FAILED, "After extent.closeAll() iterator1.hasNext(): " + it1.hasNext()); } if (it2.hasNext()) { fail(ASSERTION_FAILED, "After extent.closeAll() iterator2.hasNext(): " + it2.hasNext()); } if (it3.hasNext()) { fail(ASSERTION_FAILED, "After extent.closeAll() iterator3.hasNext(): " + it3.hasNext()); } if (debug) logger.debug("Assertion A15.3-12 passed"); } finally { rollbackTransaction(); } } } tck/src/java/org/apache/jdo/tck/extents/CloseOfExtentIteratorIsIteratorSpecific.java100664 5226 12500110374 31200 0ustarmbouschenstaff 0 0 /* * 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.extents; import java.util.Collection; import java.util.Iterator; import javax.jdo.Extent; import javax.jdo.Query; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Close of Extent Iterator is Iterator Specific *
*Keywords: extent *
*Assertion ID: A15.3-11. *
*Assertion Description: After a call to Extent.close(Iterator i), the Extent itself can still be used to acquire other iterators and can be used as the Extent for queries. */ public class CloseOfExtentIteratorIsIteratorSpecific extends ExtentTest { /** */ private static final String ASSERTION_FAILED = "Assertion A15.3-11 (CloseOfExtentIteratorIsIteratorSpecific) failed: "; /** * The main 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(CloseOfExtentIteratorIsIteratorSpecific.class); } /** */ public void test() { Extent ex = getExtent(); beginTransaction(); Iterator it1 = ex.iterator(); ex.close(it1); int count = countIterator(ex.iterator()); if (count != 2) { fail(ASSERTION_FAILED, "iterating Employees after close of first iterator; counted " + count + " instances; should be 2"); } Query q = getPM().newQuery(ex); Collection c = (Collection)q.execute(); int count2 = countIterator(c.iterator()); commitTransaction(); if (count2 != 2) { fail(ASSERTION_FAILED, "in query after closing iterator; counted " + count2 + " instances; should be 2"); } if (debug) logger.debug("Assertion A15.3-11 passed"); } } tck/src/java/org/apache/jdo/tck/extents/ExtentTest.java100664 23247 12500110374 23422 0ustarmbouschenstaff 0 0 /* * 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.extents; import java.lang.reflect.Constructor; import java.math.BigDecimal; import java.util.Date; import java.util.GregorianCalendar; import java.util.HashSet; import java.util.Iterator; import java.util.TimeZone; import javax.jdo.Extent; import javax.jdo.JDOFatalInternalException; import javax.jdo.PersistenceManager; import javax.jdo.PersistenceManagerFactory; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.Address; import org.apache.jdo.tck.pc.company.Company; import org.apache.jdo.tck.pc.company.DentalInsurance; import org.apache.jdo.tck.pc.company.Department; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.pc.company.FullTimeEmployee; import org.apache.jdo.tck.pc.company.MedicalInsurance; import org.apache.jdo.tck.pc.company.PartTimeEmployee; import org.apache.jdo.tck.pc.company.Project; /** * * @author Craig Russell * @version 1.0 */ abstract class ExtentTest extends JDO_Test { protected Class extentClass = Employee.class; protected Company company; protected Object companyOID; /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(DentalInsurance.class); addTearDownClass(MedicalInsurance.class); addTearDownClass(Project.class); addTearDownClass(FullTimeEmployee.class); addTearDownClass(PartTimeEmployee.class); addTearDownClass(Employee.class); addTearDownClass(Department.class); addTearDownClass(Company.class); } /** Creates new ExtentTest */ public ExtentTest() { if (PMFProperties == null) { PMFProperties = System.getProperty("user.home") + "/.jdo/PMFProperties.properties"; if (PMFProperties == null) System.out.println ("Please specify PMF properties in {user.home}/.jdo/PMFProperties.properties"); } } /** */ protected void checkPM() { try { /** Don't use beginTransaction() because this calls getPM() * which calls checkPM()! */ pm.currentTransaction().begin(); Extent ex = getPM().getExtent(Company.class, false); int count = countIterator(ex.iterator()); pm.currentTransaction().commit(); if (count == 1) { if (debug) logger.debug ("Found company"); return; } } catch (Exception e) { e.printStackTrace(System.err); System.err.println ("Failed to find Company; initializing DB"); } initDB(); } /** */ protected void initDB() { HashSet h; Address addr1 = new Address (7001L, "18 Network Circle", "Santa Clara", "CA", "94455", "USA"); company = new Company (1L, "Sun Microsystems", new Date(), addr1); GregorianCalendar born = new GregorianCalendar(TimeZone.getTimeZone("America/Los_Angeles")); GregorianCalendar hired = new GregorianCalendar(TimeZone.getTimeZone("America/Los_Angeles")); born.set(1969, 7, 20); hired.set(1982, 5, 5); Address addr2 = new Address (7002L, "43 Sematery Drive", "Woodside", "CA", "94320", "USA"); Employee scott = new FullTimeEmployee(3001L, "Scott", "McNealy", "G", born.getTime(), addr2, hired.getTime(), 200000.0); born.set(1960, 4, 8); hired.set(1985, 2, 3); Address addr3 = new Address (7003L, "1298 Wanderlust Road", "Pleasanton", "CA", "95560", "USA"); Employee ed = new PartTimeEmployee(3002L, "Ed", "Zander", null, born.getTime(), addr3, hired.getTime(), 400000.0); scott.addToTeam(ed); // Set up their departments. Department board = new Department(2001L, "board", company); h = new HashSet(); h.add(scott); board.setEmployees(h); scott.setDepartment(board); company.addDepartment(board); Department emg = new Department(2002L, "emg", company); h = new HashSet(); h.add(ed); emg.setEmployees(h); ed.setDepartment(emg); company.addDepartment(emg); // Insure these guys DentalInsurance scottDentalIns = new DentalInsurance( 5001L, "Aetna", scott, new BigDecimal("12000")); MedicalInsurance scottMedicalIns = new MedicalInsurance( 5002L, "Aetna", scott, "PPO"); DentalInsurance edDentalIns = new DentalInsurance( 5003L, "BlueCross", ed, new BigDecimal("10000")); MedicalInsurance edMedicalIns = new MedicalInsurance( 5004L, "BlueCross", ed, "EPO"); scott.setDentalInsurance(scottDentalIns); scott.setMedicalInsurance(scottMedicalIns); ed.setDentalInsurance(edDentalIns); ed.setMedicalInsurance(edMedicalIns); // Give them some projects to work on. Scott works on both; Ed only // on one. Project solaris = new Project(4001L, "Solaris", new BigDecimal(100.375)); Project sparc = new Project(4002L, "Sparc", new BigDecimal(200.500)); h = new HashSet(); h.add(scott); h.add(ed); solaris.setMembers(h); // Solaris is worked on by Scott and Ed h = new HashSet(); h.add(scott); sparc.setMembers(h); // Sparc is worked on by Scott h = new HashSet(); h.add(solaris); h.add(sparc); scott.setProjects(h); // Scott works on Solaris and Sparc h = new HashSet(); h.add(solaris); ed.setProjects(h); // Ed works on Solaris /* Now put all of these into the database */ pm.currentTransaction().begin(); pm.makePersistent (company); pm.currentTransaction().commit(); // System.out.println ("Company OID: " + pm.getObjectId(company)); } /** */ protected Employee addEmployee() { Address addr1 = new Address (7004L, "456 Chelsey Lane", "Mountain View", "CA", "94040", "USA"); Employee emp1 = new FullTimeEmployee (3003L, "First3003", "Last3003", "Middle3003", new Date(), addr1, new Date(), 10000.0); getPM().makePersistent (emp1); return emp1; } /** */ protected void deleteEmployee(Employee e) { getPM().deletePersistent (e); } /** */ protected int countIterator(Iterator it) { int count = 0; for (;it.hasNext();count++, it.next()); return count; } /** */ protected int printIterator(Iterator it) { int count = 0; for (;it.hasNext();count++) { System.out.println (it.next().toString()); } return count; } /** */ protected Extent getExtent() { return getPM().getExtent(extentClass, true); } /** */ protected Object getCompanyOID () { String companyOIDString = (String) PMFPropertiesObject.get("org.apache.jdo.tck.extents.CompanyOID"); String companyOIDClassName = (String) PMFPropertiesObject.get("org.apache.jdo.tck.extents.CompanyOIDClass"); if (companyOIDClassName == null) { companyOIDClassName = "org.apache.jdo.impl.fostore.OID"; } try { Class companyOIDClass = Class.forName(companyOIDClassName); Constructor companyOIDConstructor = companyOIDClass.getConstructor(new Class[] {String.class}); Object companyOID = companyOIDConstructor.newInstance (new Object[] {companyOIDString}); return companyOID; } catch (Exception ex) { throw new JDOFatalInternalException ( "PMFProperties must be configured with the following properties\n" + "\torg.apache.jdo.tck.extents.CompanyOID = \n" + "\torg.apache.jdo.tck.extents.CompanyOIDClass = \n", ex); } } /** */ protected PersistenceManager getPM() { if (pm == null) { pm = getPMF().getPersistenceManager(); checkPM(); } return pm; } /** */ public PersistenceManagerFactory getPMF() { if (pmf == null) { pmf = super.getPMF(); } return pmf; } /** */ protected void beginTransaction() { getPM().currentTransaction().begin(); } /** */ protected void commitTransaction() { getPM().currentTransaction().commit(); } /** */ protected void rollbackTransaction() { getPM().currentTransaction().rollback(); } } tck/src/java/org/apache/jdo/tck/extents/GetCandidateClass.java100664 3605 12500110374 24571 0ustarmbouschenstaff 0 0 /* * 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.extents; import javax.jdo.Extent; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Get Candidate Class *
*Keywords: extent *
*Assertion ID: A15.3-7. *
*Assertion Description: Extent.getCandidateClass() returns the class of the instances contained in this Extent. */ public class GetCandidateClass extends ExtentTest { /** */ private static final String ASSERTION_FAILED = "Assertion A15.3-7 (GetCandidateClass) failed: "; /** * The main 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(GetCandidateClass.class); } /** */ public void test() { Extent ex = getExtent(); if (extentClass != ex.getCandidateClass()) { fail(ASSERTION_FAILED, "Candidate class in extent should be: " + extentClass.getClass().getName()); } } } tck/src/java/org/apache/jdo/tck/extents/GetPersistenceManager.java100664 4002 12500110374 25476 0ustarmbouschenstaff 0 0 /* * 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.extents; import javax.jdo.Extent; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Get PersistenceManager *
*Keywords: extent *
*Assertion ID: A15.3-8. *
*Assertion Description: Extent.getPersistenceManager() returns the PersistenceManager which created this Extent. */ public class GetPersistenceManager extends ExtentTest { /** */ private static final String ASSERTION_FAILED = "Assertion A15.3-8 (GetPersistenceManager) failed: "; /** * The main 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(GetPersistenceManager.class); } /** */ public void test() { Extent ex = getPM().getExtent (Employee.class, true); if (pm != ex.getPersistenceManager()) { fail(ASSERTION_FAILED, "unexpected pm of extent, expected " + pm + ", got " + ex.getPersistenceManager()); } } } tck/src/java/org/apache/jdo/tck/extents/HasSubclassesFalse.java100664 3721 12500110374 25004 0ustarmbouschenstaff 0 0 /* * 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.extents; import javax.jdo.Extent; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Has Subclasses is False *
*Keywords: extent inheritance *
*Assertion ID: A15.3-5. *
*Assertion Description: Extent.hasSubclasses() returns false if the extent does not include subclasses. */ public class HasSubclassesFalse extends ExtentTest { /** */ private static final String ASSERTION_FAILED = "Assertion A15.3-5 (HasSubclassesFalse) failed: "; /** * The main 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(HasSubclassesFalse.class); } /** */ public void test() { Extent ex = getPM().getExtent (Employee.class, false); if (ex.hasSubclasses()) { fail(ASSERTION_FAILED, "ex.hasSubclasses() returned true, but extent was created with subclasses=false."); } } } tck/src/java/org/apache/jdo/tck/extents/HasSubclassesTrue.java100664 3704 12500110374 24672 0ustarmbouschenstaff 0 0 /* * 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.extents; import javax.jdo.Extent; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Has Subclasses is True *
*Keywords: extent inheritance *
*Assertion ID: A15.3-6. *
*Assertion Description: Extent.hasSubclasses() returns true if the extent includes subclasses. */ public class HasSubclassesTrue extends ExtentTest { /** */ private static final String ASSERTION_FAILED = "Assertion A15.3-6 (HasSubclassesTrue) failed: "; /** * The main 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(HasSubclassesTrue.class); } /** */ public void test() { Extent ex = getPM().getExtent (Employee.class, true); if (!ex.hasSubclasses()) { fail(ASSERTION_FAILED, "ex.hasSubclasses() returned false, but extent was created with subclasses=true."); } } } tck/src/java/org/apache/jdo/tck/extents/InstancesDeletedPriorToIterationNotReturned.java100664 5403 12500110374 32073 0ustarmbouschenstaff 0 0 /* * 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.extents; import java.util.Iterator; import javax.jdo.Extent; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Instances Deleted Prior to Iteration not Returned *
*Keywords: extent *
*Assertion ID: A15.3-3. *
*Assertion Description: If instances were deleted in the transaction prior to the execution of Extent.iterator(), the returned Iterator will not contain the instances. */ public class InstancesDeletedPriorToIterationNotReturned extends ExtentTest { /** */ private static final String ASSERTION_FAILED = "Assertion A15.3-3 (InstancesDeletedPriorToIterationNotReturned) failed: "; /** * The main 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(InstancesDeletedPriorToIterationNotReturned.class); } /** */ public void test() { try { beginTransaction(); getPM().setIgnoreCache(false); Extent ex = getPM().getExtent (Employee.class, true); Iterator it1 = ex.iterator(); deleteEmployee((Employee)it1.next()); Iterator it2 = ex.iterator(); int count = countIterator(it2); rollbackTransaction(); beginTransaction(); Iterator it3 = ex.iterator(); int count3 = countIterator(it3); commitTransaction(); if (count != 1) { fail(ASSERTION_FAILED, "counted " + count + " after delete; should be 1"); } if (count3 != 2) { fail(ASSERTION_FAILED, "counted " + count3 + "after rollback; should be 2"); } } finally { } } } tck/src/java/org/apache/jdo/tck/extents/InstancesPersistedPriorToIterationReturned.java100664 5247 12500110374 32014 0ustarmbouschenstaff 0 0 /* * 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.extents; import java.util.Iterator; import javax.jdo.Extent; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Instances Persisted Prior to Iteration Returned *
*Keywords: extent *
*Assertion ID: A15.3-2. *
*Assertion Description: If instances were made persistent in the transaction prior to the execution of Extent.iterator(), the returned Iterator will contain the instances. */ public class InstancesPersistedPriorToIterationReturned extends ExtentTest { /** */ private static final String ASSERTION_FAILED = "Assertion A15.3-2 (InstancesPersistedPriorToIterationReturned) failed: "; /** * The main 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(InstancesPersistedPriorToIterationReturned.class); } /** */ public void test() { try { beginTransaction(); getPM().setIgnoreCache(false); Extent ex = getPM().getExtent (Employee.class, true); addEmployee(); Iterator it = ex.iterator(); int count = countIterator(it); rollbackTransaction(); beginTransaction(); Iterator it2 = ex.iterator(); int count2 = countIterator(it2); commitTransaction(); if (count != 3) { fail(ASSERTION_FAILED, "Iterator: " + count + " should be 3"); } if (count2 != 2) { fail(ASSERTION_FAILED, "Iterator2: " + count2 + "should be 2"); } } finally { } } } tck/src/java/org/apache/jdo/tck/extents/IteratorHasNextFalseAfterExtentClose.java100664 6201 12500110374 30461 0ustarmbouschenstaff 0 0 /* * 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.extents; import java.util.Iterator; import javax.jdo.Extent; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Iterator HasNext returns False after Extent.close *
*Keywords: extent *
*Assertion ID: A15.3-9. *
*Assertion Description: After a call to Extent.close(Iterator i), the parameter Iterator will return false to hasNext(). */ public class IteratorHasNextFalseAfterExtentClose extends ExtentTest { /** */ private static final String ASSERTION_FAILED = "Assertion A15.3-9 (IteratorHasNextFalseAfterExtentClose) failed: "; /** * The main 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(IteratorHasNextFalseAfterExtentClose.class); } /** */ public void test() { try { beginTransaction(); Extent ex = getPM().getExtent (Employee.class, true); Iterator it1 = ex.iterator(); deleteEmployee((Employee)it1.next()); Iterator it2 = ex.iterator(); addEmployee(); Iterator it3 = ex.iterator(); ex.close(it1); ex.close(it2); ex.close(it3); rollbackTransaction(); beginTransaction(); Iterator it4 = ex.iterator(); int count4 = countIterator(it4); rollbackTransaction(); if (debug) logger.debug ("Iterator4 after rollback: " + count4); if (it1.hasNext()) { fail(ASSERTION_FAILED, "iterator1.hasNext(): " + it1.hasNext()); } if (it2.hasNext()) { fail(ASSERTION_FAILED, "iterator2.hasNext(): " + it2.hasNext()); } if (it3.hasNext()) { fail(ASSERTION_FAILED, "iterator3.hasNext(): " + it3.hasNext()); } if (count4 != 2) { fail(ASSERTION_FAILED, "Iterator " + count4 + " should be 2"); } } finally { } } } tck/src/java/org/apache/jdo/tck/extents/IteratorMutatingMethods.java100664 4503 12500110374 26113 0ustarmbouschenstaff 0 0 /* * 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.extents; import java.util.Iterator; import javax.jdo.Extent; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Iterator Mutating Methods *
*Keywords: extent exception *
*Assertion ID: A15.3-4. *
*Assertion Description: If any mutating method, including the remove method, is called on the Iterator returned by Extent.iterator(), an UnsupportedOperationException is thrown. */ public class IteratorMutatingMethods extends ExtentTest { /** */ private static final String ASSERTION_FAILED = "Assertion A15.3-4 (IteratorMutatingMethods) failed: "; /** * The main 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(IteratorMutatingMethods.class); } /** */ public void test() { beginTransaction(); Extent ex = getExtent(); Iterator it = ex.iterator(); it.next(); try { it.remove(); fail(ASSERTION_FAILED, "extent.iterator().remove() should throw UnsupportedOperationException"); } catch (UnsupportedOperationException expected) { // expected exception if (debug) logger.debug("expected exception " + ex); } finally { } commitTransaction(); } } tck/src/java/org/apache/jdo/tck/extents/IteratorNextAfterExtentClose.java100664 6630 12500110374 27060 0ustarmbouschenstaff 0 0 /* * 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.extents; import java.util.Iterator; import java.util.NoSuchElementException; import javax.jdo.Extent; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Iterator Next After Extent Close *
*Keywords: extent exception *
*Assertion ID: A15.3-10. *
*Assertion Description: After a call to Extent.close(Iterator i), the parameter Iterator will throw a NoSuchElementException to next(). */ public class IteratorNextAfterExtentClose extends ExtentTest { /** */ private static final String ASSERTION_FAILED = "Assertion A15.3-10 (IteratorNextAfterExtentClose) failed: "; /** * The main 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(IteratorNextAfterExtentClose.class); } /** */ public void test() { try { beginTransaction(); Extent ex = getPM().getExtent (Employee.class, true); Iterator it1 = ex.iterator(); deleteEmployee((Employee)it1.next()); Iterator it2 = ex.iterator(); addEmployee(); Iterator it3 = ex.iterator(); ex.close(it1); ex.close(it2); ex.close(it3); try { tryNext(it1); tryNext(it2); tryNext(it3); rollbackTransaction(); beginTransaction(); Iterator it4 = ex.iterator(); int count4 = countIterator(it4); commitTransaction(); if (count4 != 2) { fail(ASSERTION_FAILED, "Iterator4 after rollback: " + count4 + "; should be 2"); } } catch (Exception unexpected) { fail(ASSERTION_FAILED, "unexpected exception " + unexpected); } } catch (Exception unexpected) { fail(ASSERTION_FAILED, "unexpected exception " + unexpected); } } /** */ void tryNext (Iterator it) throws Exception { try { it.next(); fail(ASSERTION_FAILED, "expected NoSuchElementException thrown by iterator.next()."); } catch (NoSuchElementException expected) { // expecteed exception } } } tck/src/java/org/apache/jdo/tck/extents/IteratorNextAfterExtentCloseAll.java100664 5767 12500110374 27523 0ustarmbouschenstaff 0 0 /* * 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.extents; import java.util.Iterator; import java.util.NoSuchElementException; import javax.jdo.Extent; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Iterator Next After Extent CloseAll *
*Keywords: extent *
*Assertion ID: A15.3-13. *
*Assertion Description: After a call to Extent.closeAll(), all iterators acquired from this Extent will throw a NoSuchElementException to next(). */ public class IteratorNextAfterExtentCloseAll extends ExtentTest { /** */ private static final String ASSERTION_FAILED = "Assertion A15.3-13 (IteratorNextAfterExtentCloseAll) failed: "; /** * The main 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(IteratorNextAfterExtentCloseAll.class); } /** */ public void test() { try { beginTransaction(); Extent ex = getPM().getExtent (Employee.class, true); Iterator it1 = ex.iterator(); deleteEmployee((Employee)it1.next()); Iterator it2 = ex.iterator(); addEmployee(); Iterator it3 = ex.iterator(); ex.closeAll(); if (!tryNext(it1)) { fail(ASSERTION_FAILED, "iterator1.next() does not throw NoSuchElementException."); } if (!tryNext(it2)) { fail(ASSERTION_FAILED, "iterator2.next() does not throw NoSuchElementException."); } if (!tryNext(it3)) { fail(ASSERTION_FAILED, "iterator3.next() does not throw NoSuchElementException."); } } finally { rollbackTransaction(); } } /** */ boolean tryNext (Iterator it) { try { it.next(); } catch (NoSuchElementException expected) { return true; } return false; } } tck/src/java/org/apache/jdo/tck/extents/Iterators.java100664 4124 12500110374 23240 0ustarmbouschenstaff 0 0 /* * 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.extents; import java.util.Iterator; import javax.jdo.Extent; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Iterators *
*Keywords: extent *
*Assertion ID: A15.3-1. *
*Assertion Description: Extent.iterator() returns an Iterator over all the instances in the Extent. */ public class Iterators extends ExtentTest { /** */ private static final String ASSERTION_FAILED = "Assertion A15.3-1 (Iterators) failed: "; /** * The main 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(Iterators.class); } /** */ public void test() { Extent ex = getExtent(); int count = 0; beginTransaction(); for (Iterator it = ex.iterator(); it.hasNext();++count) { Object emp = it.next(); if (debug) logger.debug(emp.toString()); } rollbackTransaction(); if (count != 2) { fail(ASSERTION_FAILED, "Emplyoee extent should have 2 instances, got " + count); } } } tck/src/java/org/apache/jdo/tck/JDO_Test.java100664 131076 12500110374 21254 0ustarmbouschenstaff 0 0 /* * 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; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintStream; import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.security.AccessController; import java.security.PrivilegedAction; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Properties; import java.util.StringTokenizer; import java.util.Vector; import javax.jdo.Constants; import javax.jdo.Extent; import javax.jdo.JDOException; import javax.jdo.JDOFatalException; import javax.jdo.JDOHelper; import javax.jdo.JDOObjectNotFoundException; import javax.jdo.PersistenceManager; import javax.jdo.PersistenceManagerFactory; import javax.jdo.Query; import junit.framework.AssertionFailedError; import junit.framework.TestCase; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.util.ClassUtils; public abstract class JDO_Test extends TestCase { public static final int TRANSIENT = 0; public static final int PERSISTENT_NEW = 1; public static final int PERSISTENT_CLEAN = 2; public static final int PERSISTENT_DIRTY = 3; public static final int HOLLOW = 4; public static final int TRANSIENT_CLEAN = 5; public static final int TRANSIENT_DIRTY = 6; public static final int PERSISTENT_NEW_DELETED = 7; public static final int PERSISTENT_DELETED = 8; public static final int PERSISTENT_NONTRANSACTIONAL = 9; public static final int PERSISTENT_NONTRANSACTIONAL_DIRTY = 10; public static final int DETACHED_CLEAN = 11; public static final int DETACHED_DIRTY = 12; public static final int NUM_STATES = 13; public static final int ILLEGAL_STATE = 13; public static final String[] states = { "transient", "persistent-new", "persistent-clean", "persistent-dirty", "hollow", "transient-clean", "transient-dirty", "persistent-new-deleted", "persistent-deleted", "persistent-nontransactional", "persistent-nontransactional-dirty", "detached-clean", "detached-dirty", "illegal" }; private static final int IS_PERSISTENT = 0; private static final int IS_TRANSACTIONAL = 1; private static final int IS_DIRTY = 2; private static final int IS_NEW = 3; private static final int IS_DELETED = 4; private static final int IS_DETACHED = 5; private static final int NUM_STATUSES = 6; /* * This table indicates the values returned by the status interrogation * methods for each state. This is used to determine the current lifecycle * state of an object. */ private static final boolean state_statuses[][] = { // IS_PERSISTENT IS_TRANSACTIONAL IS_DIRTY IS_NEW IS_DELETED IS_DETACHED // transient { false, false, false, false, false, false}, // persistent-new { true, true, true, true, false, false}, // persistent-clean { true, true, false, false, false, false}, // persistent-dirty { true, true, true, false, false, false}, // hollow { true, false, false, false, false, false}, // transient-clean { false, true, false, false, false, false}, // transient-dirty { false, true, true, false, false, false}, // persistent-new-deleted { true, true, true, true, true, false}, // persistent-deleted { true, true, true, false, true, false}, // persistent-nontransactional { true, false, false, false, false, false}, // persistent-nontransactional-dirty { true, false, true, false, false, false}, // detached_clean { false, false, false, false, false, true}, // detached_dirty { false, false, true, false, false, true} }; /** Name of the PersistenceManagerFactoryClass PMF property. */ public static final String PMF_CLASS_PROP = "javax.jdo.PersistenceManagerFactoryClass"; /** Name of the ConnectionURL PMF property. */ public static final String CONNECTION_URL_PROP = "javax.jdo.option.ConnectionURL"; /** Name of the ConnectionUserName PMF property. */ public static final String CONNECTION_USERNAME_PROP = "javax.jdo.option.ConnectionUserName"; /** Name of the ConnectionPassword PMF property. */ public static final String CONNECTION_PASSWORD_PROP = "javax.jdo.option.ConnectionPassword"; /** identitytype value for applicationidentity. */ public static final String APPLICATION_IDENTITY = "applicationidentity"; /** identitytype value for datastoreidentity. */ public static final String DATASTORE_IDENTITY = "datastoreidentity"; /** Map of transaction isolation String values to Integer */ protected final static Map levelValues = new HashMap(); static { levelValues.put(Constants.TX_READ_UNCOMMITTED, 0); levelValues.put(Constants.TX_READ_COMMITTED, 1); levelValues.put(Constants.TX_REPEATABLE_READ, 2); levelValues.put(Constants.TX_SNAPSHOT, 3); levelValues.put(Constants.TX_SERIALIZABLE, 4); } /** * String indicating the type of identity used for the current test case. * The value is either "applicationidentity" or "datastoreidentity". */ protected final String identitytype = System.getProperty("jdo.tck.identitytype"); /** * String indicating the name of the schema for the current test. */ protected final String schemaname = System.getProperty("jdo.tck.schemaname"); /** Name of the file containing the properties for the PMF. */ protected static String PMFProperties = System.getProperty("PMFProperties"); /** Flag indicating whether to clean up data after tests or not. * If false then test will not clean up data from database. * The default value is true. */ protected static boolean cleanupData = System.getProperty("jdo.tck.cleanupaftertest", "true").equalsIgnoreCase("true"); /** Flag indicating whether to close the PMF after each test or not. * It defaults to false. */ protected static final boolean closePMFAfterEachTest = System.getProperty("jdo.tck.closePMFAfterEachTest", "false").equalsIgnoreCase("true"); /** The Properties object for the PersistenceManagerFactory. */ protected static Properties PMFPropertiesObject; /** The PersistenceManagerFactory. */ protected static PersistenceManagerFactory pmf; /** The collection of supported options of the pmf. */ protected static Collection supportedOptions; /** The name of the pmf supported options summary file. */ private static final String PMF_SUPPORTED_OPTIONS_FILE_NAME = "pmf_supported_options.txt"; /** The PersistenceManager. */ protected PersistenceManager pm; // Flag indicating successful test run protected boolean testSucceeded; /** Logger */ protected Log logger = LogFactory.getFactory().getInstance("org.apache.jdo.tck"); /** true if debug logging in enabled. */ protected boolean debug = logger.isDebugEnabled(); /** * Indicates an exception thrown in method tearDown. * At the end of method tearDown this field is nullified. */ private Throwable tearDownThrowable; /** * A list of registered oid instances. * Corresponding pc instances are deleted in localTearDown. */ private Collection tearDownInstances = new LinkedList(); /** * A list of registered pc classes. * The extents of these classes are deleted in localTearDown. */ private Collection tearDownClasses = new LinkedList(); /** * Intended for subclasses so that they may skip this class's normal set up procedure. * @return true to run normal set up, false to skip normal set up */ protected boolean preSetUp() { return true; } protected final void setUp() throws Exception { if (!preSetUp()) { return; } pmf = getPMF(); localSetUp(); } /** * Subclasses may override this method to allocate any data and resources * that they need in order to successfully execute this testcase. */ protected void localSetUp() {} /** * Runs the bare test sequence. * @exception Throwable if any exception is thrown */ public final void runBare() throws Throwable { try { testSucceeded = false; setUp(); runTest(); testSucceeded = true; } catch (AssertionFailedError e) { if (logger.isInfoEnabled()) logger.info("Exception during setUp or runtest: ", e); throw e; } catch (Throwable t) { if (logger.isInfoEnabled()) logger.info("Exception during setUp or runtest: ", t); throw t; } finally { tearDown(); if (debug) { logger.debug("Free memory: " + Runtime.getRuntime().freeMemory()); } } } /** * Sets field tearDownThrowable if it is null. * Else, the given throwable is logged using fatal log level. * @param throwable the throwable */ private void setTearDownThrowable(String context, Throwable throwable) { if (logger.isInfoEnabled()) logger.info("Exception during "+context+": ", throwable); if (this.tearDownThrowable == null) { this.tearDownThrowable = throwable; } } /** * Intended for subclasses so that they may skip this class's normal tear down procedure. * @return true to run normal tear down, false to skip normal tear down */ protected boolean preTearDown() { return true; } /** * This method clears data and resources allocated by testcases. * It first closes the persistence manager of this testcase. * Then it calls method localTearDown. * Subclasses may override that method to clear any data and resources * that they have allocated in method localSetUp. * Finally, this method closes the persistence manager factory.

* * Note:These methods are called always, regardless of any exceptions. * The first caught exception is kept in field tearDownThrowable. * That exception is thrown as a nested exception of JDOFatalException * if and only if the testcase executed successful. * Otherwise that exception is logged using fatal log level. * All other exceptions are logged using fatal log level, always.

* * Note:By default, the method tearDown does not close the pmf. * This is done at the end of each configuration, unless the property * jdo.tck.closePMFAfterEachTest is set to true. */ protected final void tearDown() { if (!preTearDown()) { return; } try { cleanupPM(); } catch (Throwable t) { setTearDownThrowable("cleanupPM", t); } if ((pmf == null || pmf.isClosed()) && (this.tearDownInstances.size() > 0 || this.tearDownClasses.size() > 0)) throw new JDOFatalException ("PMF must not be nullified or closed when tear down instances and /or classes have been added."); if (pmf != null && pmf.isClosed()) pmf = null; try { if (cleanupData) { localTearDown(); } } catch (Throwable t) { setTearDownThrowable("localTearDown", t); } if (closePMFAfterEachTest) { try { closePMF(); } catch (Throwable t) { setTearDownThrowable("closePMF", t); } } if (this.tearDownThrowable != null) { Throwable t = this.tearDownThrowable; this.tearDownThrowable = null; if (testSucceeded) { // runTest succeeded, but this method threw exception => error throw new JDOFatalException("Exception during tearDown", t); } } } /** * Deletes all registered pc instances and extents of all registered pc classes. * Subclasses may override this method to clear any data and resources * that they have allocated in method localSetUp. */ protected void localTearDown() { deleteTearDownInstances(); deleteTearDownClasses(); } protected void addTearDownObjectId(Object oid) { // ensure that oid is not a PC instance if (JDOHelper.getObjectId(oid) != null || JDOHelper.isTransactional(oid)) throw new IllegalArgumentException("oid"); this.tearDownInstances.add(oid); } protected void addTearDownInstance(Object pc) { Object oid = JDOHelper.getObjectId(pc); addTearDownObjectId(oid); } protected void addTearDownClass(Class pcClass) { this.tearDownClasses.add(pcClass); } protected void addTearDownClass(Class[] pcClasses) { if (pcClasses == null) return; for (int i = 0; i < pcClasses.length; ++i) { addTearDownClass(pcClasses[i]); } } /** * Deletes and removes tear down instances. * If there are no tear down instances, * the this method is a noop. * Otherwise, tear down instances are deleted * exactly in the order they have been added. * Tear down instances are deleted in a separate transaction. */ protected void deleteTearDownInstances() { if (this.tearDownInstances.size() > 0) { getPM(); try { this.pm.currentTransaction().begin(); for (Iterator i = this.tearDownInstances.iterator(); i.hasNext(); ) { Object pc; try { pc = this.pm.getObjectById(i.next(), true); } catch (JDOObjectNotFoundException e) { pc = null; } // we only delete those persistent instances // which have not been deleted by tests already. if (pc != null) { this.pm.deletePersistent(pc); } } this.pm.currentTransaction().commit(); } finally { this.tearDownInstances.clear(); cleanupPM(); } } } /** * Deletes and removes tear down classes. * If there are no tear down classes, * the this method is a noop. * Otherwise, tear down classes are deleted * exactly in the order they have been added. * Tear down classes are deleted in a separate transaction. * Deleting a tear down class means to delete the extent. */ protected void deleteTearDownClasses() { if (this.tearDownClasses.size() > 0) { getPM(); try { this.pm.currentTransaction().begin(); for (Iterator i = this.tearDownClasses.iterator(); i.hasNext(); ) { this.pm.deletePersistentAll(getAllObjects(this.pm, (Class)i.next())); } this.pm.currentTransaction().commit(); } finally { this.tearDownClasses.clear(); cleanupPM(); } } } /** */ protected Collection getAllObjects(PersistenceManager pm, Class pcClass) { Collection col = new Vector() ; Query query = pm.newQuery(); query.setClass(pcClass); Extent candidates = null; try { candidates = pm.getExtent(pcClass, false); } catch (JDOException ex) { if (debug) logger.debug("Exception thrown for getExtent of class " + pcClass.getName()); return col; } query.setCandidates(candidates); Object result = query.execute(); return (Collection)result; } /** * Get the PersistenceManagerFactory instance * for the implementation under test. * @return field pmf if it is not null, * else sets field pmf to a new instance and returns that instance. */ protected PersistenceManagerFactory getPMF() { if (pmf == null) { PMFPropertiesObject = loadProperties(PMFProperties); // will exit here if no properties pmf = JDOHelper.getPersistenceManagerFactory(PMFPropertiesObject); if (supportedOptions == null) { supportedOptions = pmf.supportedOptions(); } } return pmf; } protected Class getPMFClass() { if (pmf != null) { return pmf.getClass(); } PMFPropertiesObject = loadProperties(PMFProperties); String name = PMFPropertiesObject.getProperty(PMF_CLASS_PROP); try { return Class.forName(name); } catch (ClassNotFoundException ex) { throw new JDOException("Cannot find PMF class '" + name + "'.", ex); } } /** * Get the PersistenceManagerFactory instance * for the implementation under test. This method does NOT use the * JDOHelper method to retrieve the PMF, instead it creates an instance of * the class specified as javax.jdo.PersistenceManagerFactoryClass * property. The returned PMF is not configured. * @return field pmf if it is not null, * else sets field pmf to a new instance and returns that instance. */ protected PersistenceManagerFactory getUnconfiguredPMF() { if (pmf == null) { String name = null; try { Class pmfClass = getPMFClass(); name = pmfClass.getName(); pmf = (PersistenceManagerFactory) pmfClass.newInstance(); if (supportedOptions == null) { supportedOptions = pmf.supportedOptions(); } } catch (InstantiationException ex) { throw new JDOException("Cannot instantiate PMF class '" + name + "'.", ex); } catch (IllegalAccessException ex) { throw new JDOException("Cannot access PMF class '" + name + "' or its no-arg constructor.", ex); } } return pmf; } /** * Get the PersistenceManager instance * for the implementation under test. */ protected PersistenceManager getPM() { if (pm == null) { pm = getPMF().getPersistenceManager(); } return pm; } /** * This method cleans up the environment: closes the * PersistenceManager. This should avoid leaving * multiple PersistenceManager instances around, in case the * PersistenceManagerFactory performs PersistenceManager pooling. */ protected void cleanupPM() { cleanupPM(pm); pm = null; } /** * This method cleans up the specified * PersistenceManager. If the pm still has an open * transaction, it will be rolled back, before closing the pm. */ protected static void cleanupPM(PersistenceManager pm) { if ((pm != null) && !pm.isClosed()) { if (pm.currentTransaction().isActive()) { pm.currentTransaction().rollback(); } pm.close(); } } /** Closes the pmf stored in this instance. */ public static void closePMF() { JDOException failure = null; while (pmf != null) { try { if (!pmf.isClosed()) { closePMF(pmf); } pmf = null; } catch (JDOException ex) { // store failure of first call pmf.close if (failure == null) failure = ex; PersistenceManager[] pms = getFailedPersistenceManagers( "closePMF", ex); for (int i = 0; i < pms.length; i++) { cleanupPM(pms[i]); } } catch (RuntimeException ex) { pmf = null; ex.printStackTrace(System.out); throw ex; } } // rethrow JDOException thrown by pmf.close if (failure != null) throw failure; } /** Closes the pmf passed as a parameter. * This must be done in a doPrivileged block. */ public static void closePMF(final PersistenceManagerFactory PMF) { if (PMF != null) { if (!PMF.isClosed()) { AccessController.doPrivileged( new PrivilegedAction () { public Object run () { PMF.close(); return null; } } ); } } } /** */ protected static PersistenceManager[] getFailedPersistenceManagers( String assertionFailure, JDOException ex) { Throwable[] nesteds = ex.getNestedExceptions(); int numberOfExceptions = nesteds==null ? 0 : nesteds.length; PersistenceManager[] result = new PersistenceManager[numberOfExceptions]; for (int i = 0; i < numberOfExceptions; ++i) { JDOException exc = (JDOException)nesteds[i]; Object failedObject = exc.getFailedObject(); if (exc.getFailedObject() instanceof PersistenceManager) { result[i] = (PersistenceManager)failedObject; } else { throw new JDOFatalException(assertionFailure, "Unexpected failed object of type: " + failedObject.getClass().getName()); } } return result; } /** * This method load Properties from a given file. */ protected Properties loadProperties(String fileName) { if (fileName == null) { fileName = System.getProperty("user.home") + "/.jdo/PMFProperties.properties"; } Properties props = new Properties(); InputStream propStream = null; try { propStream = new FileInputStream(fileName); } catch (IOException ex) { System.out.println("Could not open properties file \"" + fileName + "\""); System.out.println("Please specify a system property PMFProperties " + "with the PMF properties file name as value " + "(defaults to {user.home}/.jdo/PMFProperties.properties)"); System.exit(1); } try { props.load(propStream); } catch (IOException ex) { System.out.println("Error loading properties file \"" + fileName + "\""); ex.printStackTrace(); System.exit(1); } return props; } /** * Prints the specified msg (if debug is true), before it aborts the * test case. */ public void fail(String assertionFailure, String msg) { if (debug) logger.debug(msg); fail(assertionFailure + NL + msg); } // Helper methods to check for supported options /** * Dump the supportedOptions to the a file in the specified directory. */ public static void dumpSupportedOptions(String directory) { if (supportedOptions == null) return; File file = new File(directory, PMF_SUPPORTED_OPTIONS_FILE_NAME); if (file.exists()) // PMF supported options have been dumped before => return return; PrintStream resultStream = null; try { resultStream = new PrintStream(new FileOutputStream(file)); for (Iterator it = supportedOptions.iterator(); it.hasNext();) { resultStream.println((String)it.next()); } } catch (FileNotFoundException e) { throw new JDOFatalException( "dumpSupportedOptions: cannot create file " + file.getName(), e); } finally { if (resultStream != null) resultStream.close(); } } /** * Prints a message (if debug is true) saying the test with the * specified name is not executed, because the JDO implementation under * test does not support the specified optional feature. * @param testName the name of the test method that is skipped. * @param optionalFeature the name of the option not supported by the * JDO implementation under tets. */ protected void printUnsupportedOptionalFeatureNotTested( String testName, String optionalFeature) { if (debug) { logger.debug( "Test " + testName + " was not run, because optional feature " + optionalFeature + " is not supported by the JDO implementation under test"); } } /** Reports whether TransientTransactional is supported. */ public boolean isTransientTransactionalSupported() { return supportedOptions.contains( "javax.jdo.option.TransientTransactional"); } /** Reports whether NontransactionalRead is supported. */ public boolean isNontransactionalReadSupported(){ return supportedOptions.contains( "javax.jdo.option.NontransactionalRead"); } /** Reports whether NontransactionalWrite is supported. */ public boolean isNontransactionalWriteSupported() { return supportedOptions.contains( "javax.jdo.option.NontransactionalWrite"); } /** Reports whether RetainValues is supported. */ public boolean isRetainValuesSupported() { return supportedOptions.contains( "javax.jdo.option.RetainValues"); } /** Reports whether Optimistic is supported. */ public boolean isOptimisticSupported() { return supportedOptions.contains( "javax.jdo.option.Optimistic"); } /** Reports whether Application Identity is supported. */ public boolean isApplicationIdentitySupported() { return supportedOptions.contains( "javax.jdo.option.ApplicationIdentity"); } /** Reports whether Datastore Identity is supported. */ public boolean isDatastoreIdentitySupported() { return supportedOptions.contains( "javax.jdo.option.DatastoreIdentity"); } /** Reports whether Non-Durable Identity is supported. */ public boolean isNonDurableIdentitySupported() { return supportedOptions.contains( "javax.jdo.option.NonDurableIdentity"); } /** Reports whether an ArrayList collection is supported. */ public boolean isArrayListSupported() { return supportedOptions.contains( "javax.jdo.option.ArrayList"); } /** Reports whether a HashMap collection is supported. */ public boolean isHashMapSupported() { return supportedOptions.contains( "javax.jdo.option.HashMap"); } /** Reports whether a Hashtable collection is supported. */ public boolean isHashtableSupported() { return supportedOptions.contains( "javax.jdo.option.Hashtable"); } /** Reports whether a LinkedList collection is supported. */ public boolean isLinkedListSupported() { return supportedOptions.contains( "javax.jdo.option.LinkedList"); } /** Reports whether a TreeMap collection is supported. */ public boolean isTreeMapSupported() { return supportedOptions.contains( "javax.jdo.option.TreeMap"); } /** Reports whether a TreeSet collection is supported. */ public boolean isTreeSetSupported() { return supportedOptions.contains( "javax.jdo.option.TreeSet"); } /** Reports whether a Vector collection is supported. */ public boolean isVectorSupported() { return supportedOptions.contains( "javax.jdo.option.Vector"); } /** Reports whether a Map collection is supported. */ public boolean isMapSupported() { return supportedOptions.contains( "javax.jdo.option.Map"); } /** Reports whether a List collection is supported. */ public boolean isListSupported() { return supportedOptions.contains( "javax.jdo.option.List"); } /** Reports whether arrays are supported. */ public boolean isArraySupported() { return supportedOptions.contains( "javax.jdo.option.Array"); } /** Reports whether a null collection is supported. */ public boolean isNullCollectionSupported() { return supportedOptions.contains( "javax.jdo.option.NullCollection"); } /** Reports whether Changing Application Identity is supported. */ public boolean isChangeApplicationIdentitySupported() { return supportedOptions.contains( "javax.jdo.option.ChangeApplicationIdentity"); } /** Reports whether Binary Compatibility is supported. */ public boolean isBinaryCompatibilitySupported() { return supportedOptions.contains( "javax.jdo.option.BinaryCompatibility"); } /** Reports whether UnconstrainedVariables is supported. */ public boolean isUnconstrainedVariablesSupported() { return supportedOptions.contains( "javax.jdo.option.UnconstrainedVariables"); } /** Reports whether SQL queries are supported. */ public boolean isSQLSupported() { return supportedOptions.contains( "javax.jdo.query.SQL"); } /** Reports whether getting the DataStoreConnection is supported. */ public boolean isDataStoreConnectionSupported() { return supportedOptions.contains( "javax.jdo.option.GetDataStoreConnection"); } /** Reports whether canceling a running query is supported. */ public boolean isQueryCancelSupported() { return supportedOptions.contains( "javax.jdo.option.QueryCancel"); } /** Reports whether setting a Datastore timout is supported. */ public boolean isDatastoreTimeoutSupported() { return supportedOptions.contains( Constants.OPTION_DATASTORE_TIMEOUT); } /** Reports whether a feature is supported */ public boolean isSupported(String option) { return supportedOptions.contains(option); } /** * Determine if a class is loadable in the current environment. */ public static boolean isClassLoadable(String className) { try { Class.forName(className); return true; } catch (ClassNotFoundException ex) { return false; } } /** * Determine if the environment is 1.4 version of JRE or better. */ public static boolean isJRE14orBetter() { return isClassLoadable("java.util.Currency"); } /** * This utility method returns a String that indicates the * current state of an instance. * @param o The object. * @return The current state of the instance, by using the * JDOHelper state interrogation methods. */ public static String getStateOfInstance(Object o) { boolean existingEntries = false; StringBuffer buff = new StringBuffer("{"); if( JDOHelper.isPersistent(o) ){ buff.append("persistent"); existingEntries = true; } if( JDOHelper.isTransactional(o) ){ if( existingEntries ) buff.append(", "); buff.append("transactional"); existingEntries = true; } if( JDOHelper.isDirty(o) ){ if( existingEntries ) buff.append(", "); buff.append("dirty"); existingEntries = true; } if( JDOHelper.isNew(o) ){ if( existingEntries ) buff.append(", "); buff.append("new"); existingEntries = true; } if( JDOHelper.isDeleted(o) ){ if( existingEntries ) buff.append(", "); buff.append("deleted"); } if( JDOHelper.isDetached(o) ){ if( existingEntries ) buff.append(", "); buff.append("detached"); } buff.append("}"); return buff.toString(); } /** * This method will return the current lifecycle state of an instance. */ public static int currentState(Object o) { boolean[] status = new boolean[NUM_STATUSES]; status[IS_PERSISTENT] = JDOHelper.isPersistent(o); status[IS_TRANSACTIONAL] = JDOHelper.isTransactional(o); status[IS_DIRTY] = JDOHelper.isDirty(o); status[IS_NEW] = JDOHelper.isNew(o); status[IS_DELETED] = JDOHelper.isDeleted(o); status[IS_DETACHED] = JDOHelper.isDetached(o); int i, j; outerloop: for( i = 0; i < NUM_STATES; ++i ){ for( j = 0; j < NUM_STATUSES; ++j ){ if( status[j] != state_statuses[i][j] ) continue outerloop; } return i; } return NUM_STATES; } /** * Tests if a found state matches an expected state. */ public static boolean compareStates(int found_state, int expected_state) { // status interrogation gives same values for PERSISTENT_NONTRANSACTIONAL and HOLLOW return (expected_state < 0 || found_state == expected_state || (found_state == HOLLOW && expected_state == PERSISTENT_NONTRANSACTIONAL) || (found_state == PERSISTENT_NONTRANSACTIONAL && expected_state == HOLLOW)); } /** This method mangles an object by changing all its non-static, * non-final fields. * It returns true if the object was mangled, and false if there * are no fields to mangle. */ protected boolean mangleObject (Object oid) throws Exception { Field[] fields = getModifiableFields(oid); if (fields.length == 0) return false; for (int i = 0; i < fields.length; ++i) { Field field = fields[i]; Class fieldType = field.getType(); if (fieldType == long.class) { field.setLong(oid, 10000L + field.getLong(oid)); } else if (fieldType == int.class) { field.setInt(oid, 10000 + field.getInt(oid)); } else if (fieldType == short.class) { field.setShort(oid, (short)(10000 + field.getShort(oid))); } else if (fieldType == byte.class) { field.setByte(oid, (byte)(100 + field.getByte(oid))); } else if (fieldType == char.class) { field.setChar(oid, (char)(10 + field.getChar(oid))); } else if (fieldType == String.class) { field.set(oid, "This is certainly a challenge" + (String)field.get(oid)); } else if (fieldType == Integer.class) { field.set(oid, new Integer(10000 + ((Integer)field.get(oid)).intValue())); } else if (fieldType == Long.class) { field.set(oid, new Long(10000L + ((Long)field.get(oid)).longValue())); } else if (fieldType == Short.class) { field.set(oid, new Short((short)(10000 + ((Short)field.get(oid)).shortValue()))); } else if (fieldType == Byte.class) { field.set(oid, new Byte((byte)(100 + ((Byte)field.get(oid)).byteValue()))); } else if (fieldType == Character.class) { field.set(oid, new Character((char)(10 + ((Character)(field.get(oid))).charValue()))); } } return true; } /** Returns modifiable Fields of the class of the parameter. * Fields are considered modifiable if they are not static or final. * This method requires several permissions in order to run with * a SecurityManager, hence the doPrivileged block: *

    *
  • ReflectPermission("suppressAccessChecks")
  • *
  • RuntimePermission("accessDeclaredMembers")
  • *
*/ protected Field[] getModifiableFields(final Object obj) { return (Field[])AccessController.doPrivileged( new PrivilegedAction () { public Object run () { Class cls = obj.getClass(); List result = new ArrayList(); Field[] fields = cls.getFields(); for (int i = 0; i < fields.length; ++i) { Field field = fields[i]; int modifiers = field.getModifiers(); if (Modifier.isFinal(modifiers) || Modifier.isStatic(modifiers)) continue; field.setAccessible(true); result.add(field); } return result.toArray(new Field[result.size()]); } } ); } /** * Returns true if the current test runs with application * identity. This means the system property jdo.tck.identitytype has the * value applicationidentity. * @return true if current test runs with application * identity; false otherwise: */ public boolean runsWithApplicationIdentity() { return APPLICATION_IDENTITY.equals(identitytype); } /** * Prints a message (if debug is true) saying the test with the * specified name is not executed, because the JDO implementation under * test is run for an inapplicable identity type. * @param testName the name of the test method that is skipped. * @param requiredIdentityType the name of the required identity type. */ protected void printNonApplicableIdentityType( String testName, String requiredIdentityType) { if (debug) { logger.debug( "Test " + testName + " was not run, because it is only applicable for identity type " + requiredIdentityType + ". The identity type of the current configuration is " + identitytype); } } /** * Returns the value of the PMF property * given by argument key. * @param key the key * @return the value */ protected String getPMFProperty(String key) { return PMFPropertiesObject.getProperty(key); } /** * Returns true if the implementation under test * supports all JDO options contained in system property * jdo.tck.requiredOptions. * @return true if the implementation under test * supports all JDO options contained in system property * jdo.tck.requiredOptions */ protected boolean isTestToBePerformed() { boolean isTestToBePerformed = true; String requiredOptions = System.getProperty("jdo.tck.requiredOptions"); // Collection supportedOptions = supportedOptions; StringTokenizer tokenizer = new StringTokenizer( requiredOptions, " ,;\n\r\t"); while (tokenizer.hasMoreTokens()) { String requiredOption = tokenizer.nextToken(); logger.debug("Required option: " + requiredOption); if (!requiredOption.equals("") && !supportedOptions.contains(requiredOption)) { isTestToBePerformed = false; printUnsupportedOptionalFeatureNotTested( getClass().getName(), requiredOption); } } return isTestToBePerformed; } /** New line. */ public static final String NL = System.getProperty("line.separator"); /** A buffer of of error messages. */ protected static StringBuffer messages; /** Appends to error messages. */ protected static synchronized void appendMessage(String message) { if (messages == null) { messages = new StringBuffer(NL); } messages.append(message); messages.append(NL); } /** Appends to error messages. */ protected static synchronized void deferredAssertTrue(boolean test, String context, String message) { if (!test) { appendMessage(context + ": " +message); } } /** Appends an error if the actual value does not equal the expected value. * Primitive values are autoboxed. Null values are ok for both expected and actual. */ protected void errorIfNotEqual(String message, Object expected, Object actual) { if (expected == null) { if (actual != null) { appendMessage(message + " failed. expected: null; actual: " + actual); } } else { if (!expected.equals(actual)) { appendMessage(message + " failed. expected: " + expected + "; actual: " + actual); } } } /** Appends an error if the actual value equals the unexpected value. * Primitive values are autoboxed. Null values are ok for both unexpected and actual. */ protected void errorIfEqual(String message, Object unexpected, Object actual) { if (unexpected == null) { if (actual == null) { appendMessage(message + " failed. unexpected: null"); } } else { if (unexpected.equals(actual)) { appendMessage(message + " failed. unexpected: " + unexpected); } } } /** * Returns collected error messages, or null if there * are none, and clears the buffer. */ protected static synchronized String retrieveMessages() { if (messages == null) { return null; } final String msg = messages.toString(); messages = null; return msg; } /** * Fail the test if there are any error messages. */ protected void failOnError() { String errors = retrieveMessages(); if (errors != null) { fail (errors); } } /** Validate an actual isolation level against the requested level. */ protected boolean validLevelSubstitution(String requested, String actual) { int requestedLevel = ((Integer)levelValues.get(requested)).intValue(); int actualLevel = ((Integer)levelValues.get(actual)).intValue(); return actualLevel >= requestedLevel; } } tck/src/java/org/apache/jdo/tck/lifecycle/HollowInstanceMaintainsPK.java100664 7323 12500110374 26565 0ustarmbouschenstaff 0 0 /* * 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.lifecycle; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.pc.mylib.PCRect; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Test that Hollow Instances maintains PK *
*Keywords: lifecycle hollow instance PK *
*Assertion IDs: A5.5.4-3 *
*Assertion Description: If the instance is of a class using application identity, the hollow instance maintains its primary key fields. */ public class HollowInstanceMaintainsPK extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A5.5.4-3 (HollowInstanceMaintainsPK) failed: "; /** * The main 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(HollowInstanceMaintainsPK.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCRect.class); addTearDownClass(PCPoint.class); } /** */ public void test() { if (!isApplicationIdentitySupported()) { printUnsupportedOptionalFeatureNotTested( getClass().getName(), "javax.jdo.option.ApplicationIdentity"); } else if (!runsWithApplicationIdentity()) { printNonApplicableIdentityType( getClass().getName(), "javax.jdo.option.ApplicationIdentity"); } else { pm = getPM(); pm.currentTransaction().begin(); PCRect obj = getPersistentNewInstance(); long beforeValue=obj.getId(); pm.currentTransaction().commit(); // obj should transition to HOLLOW //The next call obj.getId() is a primary key access. //The method must not be called inside a transaction, //because a JDO implementation must allow primary key accesses //outside of transactions. long afterValue=obj.getId(); if (beforeValue!=afterValue) { fail(ASSERTION_FAILED, "Key field value incorrect after commit. Expected: " + beforeValue + " Found: " + afterValue); } } } /** */ private PCRect getPersistentNewInstance() { PCRect obj = new PCRect(0, new PCPoint(1,5), new PCPoint(7,3)); pm.makePersistent(obj); // obj should transition to persistent-new int curr = currentState(obj); if( curr != PERSISTENT_NEW ){ fail(ASSERTION_FAILED, "StateTransitions: Unable to create persistent-new instance " + "from transient instance via makePersistent(), state is " + states[curr]); } return obj; } } tck/src/java/org/apache/jdo/tck/lifecycle/MultiplePMsReturnInstancesRepresentingSamePC.java100664 11334 12500110374 32454 0ustarmbouschenstaff 0 0 /* * 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.lifecycle; import java.util.Iterator; import javax.jdo.Extent; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.lifecycle.StateTransitionObj; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Test that Multiple PMs return different instances representing same PC object *
*Keywords: lifecycle Multiple PMs getObjectById equal *
*Assertion IDs: A5.4-7 *
*Assertion Description: The instance returned by a call to getObjectById(Object) of different PersistenceManager instances returned by the same PersistenceManagerFactory represent the same persistent object, but with different Java object identity (specifically, all instances returned by getObjectId from the instances must return true to equals comparisons with all others). */ public class MultiplePMsReturnInstancesRepresentingSamePC extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A5.4-7 (MultiplePMsReturnInstancesRepresentingSamePC) failed: "; private static final int NUM_OBJECTS = 50; /** The persistent instances of this test. */ private Object[] obj; /** * The main 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(MultiplePMsReturnInstancesRepresentingSamePC.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { pm = getPM(); addTearDownClass(StateTransitionObj.class); obj = generatePersistentInstances(); } public void test() { PersistenceManager pm2 = null; PersistenceManager pm3 = null; try { // Get two more PMs pm2 = pmf.getPersistenceManager(); pm3 = pmf.getPersistenceManager(); pm.currentTransaction().begin(); Extent extent = pm.getExtent(StateTransitionObj.class, false); Iterator iter = extent.iterator(); if( !iter.hasNext() ){ fail(ASSERTION_FAILED, "Extent for StateTransitionObj should not be empty"); } extent.close(iter); for (int i=0; iTitle:
Test NontransactionalWriteDatastoreCommit *
*Keywords: NontransactionalWrite datastore commit *
*Assertion ID: A5.6.2-4, A5.6.2-6, A5.6.2-8, A5.6.2-10. *
*Assertion Description: A5.6.2-4 [If a datastore transaction is begun, commit will write the changes to the datastore with no checking as to the current state of the instances in the datastore. That is, the changes made outside the transaction together with any changes made inside the transaction will overwrite the current state of the datastore.] A5.6.2-6 [If a datastore transaction is begun, rollback will not write any changes to the datastore.] A5.6.2-8 [If an optimistic transaction is begun, commit will write the changes to the datastore after checking as to the current state of the instances in the datastore. The changes made outside the transaction together with any changes made inside the transaction will update the current state of the datastore if the version checking is successful.] A5.6.2-10 [If an optimistic transaction is begun, rollback will not write any changes to the datastore. The persistent-nontransactional-dirty instances will transition according to the RestoreValues flag. ] */ public class NontransactionalWriteDatastoreCommit extends NontransactionalWriteTest { /** */ protected static final String ASSERTION_FAILED = "Assertion A5.6.2-4 (NontransactionalWriteDatastoreCommit) failed: "; /** * The main 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(NontransactionalWriteDatastoreCommit.class); } /** * Create a nontransactional dirty instance, begin and commit * a datastore transaction, and check that the instance in * the datastore has the value as changed by the transaction. */ public void testDatastoreCommit() { if (!checkNontransactionalFeaturesSupported(false)) return; createAndModifyVersionedPCPoint(); beginAndCommitTransaction(false); checkXValue(ASSERTION_FAILED + "after datastore commit", newXValue); failOnError(); } } tck/src/java/org/apache/jdo/tck/lifecycle/NontransactionalWriteDatastoreCommitConflict.java100664 6756 12500110374 32600 0ustarmbouschenstaff 0 0 /* * 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.lifecycle; import javax.jdo.JDOUnsupportedOptionException; import javax.jdo.PersistenceManager; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.VersionedPCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Test NontransactionalWriteDatastoreCommitConflict *
*Keywords: NontransactionalWrite datastore commit *
*Assertion ID: A5.6.2-4, A5.6.2-6, A5.6.2-8, A5.6.2-10. *
*Assertion Description: A5.6.2-4 [If a datastore transaction is begun, commit will write the changes to the datastore with no checking as to the current state of the instances in the datastore. That is, the changes made outside the transaction together with any changes made inside the transaction will overwrite the current state of the datastore.] A5.6.2-6 [If a datastore transaction is begun, rollback will not write any changes to the datastore.] A5.6.2-8 [If an optimistic transaction is begun, commit will write the changes to the datastore after checking as to the current state of the instances in the datastore. The changes made outside the transaction together with any changes made inside the transaction will update the current state of the datastore if the version checking is successful.] A5.6.2-10 [If an optimistic transaction is begun, rollback will not write any changes to the datastore. The persistent-nontransactional-dirty instances will transition according to the RestoreValues flag. ] */ public class NontransactionalWriteDatastoreCommitConflict extends NontransactionalWriteTest { /** */ protected static final String ASSERTION_FAILED = "Assertion A5.6.2-4 " + "(NontransactionalWriteDatastoreCommitConflict) failed: "; /** * The main 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(NontransactionalWriteDatastoreCommitConflict.class); } /** * Create a nontransactional dirty instance, begin and commit * a conflicting transaction, begin and commit a datastore * transaction, and check that the instance in the datastore * was overwritten by this datastore transaction. */ public void testDatastoreCommitConflict() { if (!checkNontransactionalFeaturesSupported(false)) return; createAndModifyVersionedPCPoint(); conflictingUpdate(); beginAndCommitTransaction(false); checkXValue(ASSERTION_FAILED + "after datastore commit with conflict", newXValue); failOnError(); } }tck/src/java/org/apache/jdo/tck/lifecycle/NontransactionalWriteDatastoreRollback.java100664 6527 12500110374 31413 0ustarmbouschenstaff 0 0 /* * 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.lifecycle; import javax.jdo.JDOUnsupportedOptionException; import javax.jdo.PersistenceManager; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.VersionedPCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Test NontransactionalWriteDatastoreRollback *
*Keywords: NontransactionalWrite datastore rollback *
*Assertion ID: A5.6.2-4, A5.6.2-6, A5.6.2-8, A5.6.2-10. *
*Assertion Description: A5.6.2-4 [If a datastore transaction is begun, commit will write the changes to the datastore with no checking as to the current state of the instances in the datastore. That is, the changes made outside the transaction together with any changes made inside the transaction will overwrite the current state of the datastore.] A5.6.2-6 [If a datastore transaction is begun, rollback will not write any changes to the datastore.] A5.6.2-8 [If an optimistic transaction is begun, commit will write the changes to the datastore after checking as to the current state of the instances in the datastore. The changes made outside the transaction together with any changes made inside the transaction will update the current state of the datastore if the version checking is successful.] A5.6.2-10 [If an optimistic transaction is begun, rollback will not write any changes to the datastore. The persistent-nontransactional-dirty instances will transition according to the RestoreValues flag. ] */ public class NontransactionalWriteDatastoreRollback extends NontransactionalWriteTest { /** */ protected static final String ASSERTION_FAILED = "Assertion A5.6.2-6 (NontransactionalWriteDatastoreRollback) failed: "; /** * The main 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(NontransactionalWriteDatastoreRollback.class); } /** * Create a nontransactional dirty instance, begin and rollback * a datastore transaction, and check that the instance in * the datastore has the original value. */ public void testDatastoreRollback() { if (!checkNontransactionalFeaturesSupported(false)) return; createAndModifyVersionedPCPoint(); beginAndRollbackTransaction(false); checkXValue(ASSERTION_FAILED + "after datastore rollback", originalXValue); failOnError(); } }tck/src/java/org/apache/jdo/tck/lifecycle/NontransactionalWriteOptimisticCommit.java100664 6535 12500110374 31307 0ustarmbouschenstaff 0 0 /* * 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.lifecycle; import javax.jdo.JDOUnsupportedOptionException; import javax.jdo.PersistenceManager; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.VersionedPCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: TestNontransactionalWriteOptimisticCommit *
*Keywords: NontransactionalWrite optimistic commit *
*Assertion ID: A5.6.2-4, A5.6.2-6, A5.6.2-8, A5.6.2-10. *
*Assertion Description: A5.6.2-4 [If a datastore transaction is begun, commit will write the changes to the datastore with no checking as to the current state of the instances in the datastore. That is, the changes made outside the transaction together with any changes made inside the transaction will overwrite the current state of the datastore.] A5.6.2-6 [If a datastore transaction is begun, rollback will not write any changes to the datastore.] A5.6.2-8 [If an optimistic transaction is begun, commit will write the changes to the datastore after checking as to the current state of the instances in the datastore. The changes made outside the transaction together with any changes made inside the transaction will update the current state of the datastore if the version checking is successful.] A5.6.2-10 [If an optimistic transaction is begun, rollback will not write any changes to the datastore. The persistent-nontransactional-dirty instances will transition according to the RestoreValues flag. ] */ public class NontransactionalWriteOptimisticCommit extends NontransactionalWriteTest { /** */ protected static final String ASSERTION_FAILED = "Assertion A5.6.2-8 (NontransactionalWriteOptimisticCommit) failed: "; /** * The main 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(NontransactionalWriteOptimisticCommit.class); } /** * Create a nontransactional dirty instance, begin and commit * an optimistic transaction, and check that the instance in * the datastore has the value as changed by the transaction. */ public void testOptimisticCommit() { if (!checkNontransactionalFeaturesSupported(true)) return; createAndModifyVersionedPCPoint(); beginAndCommitTransaction(true); checkXValue(ASSERTION_FAILED + "after optimistic commit", newXValue); failOnError(); } }tck/src/java/org/apache/jdo/tck/lifecycle/NontransactionalWriteOptimisticCommitConflict.java100664 7101 12500110374 32757 0ustarmbouschenstaff 0 0 /* * 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.lifecycle; import javax.jdo.JDOUnsupportedOptionException; import javax.jdo.PersistenceManager; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.VersionedPCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Test NontransactionalWriteOptimisticCommitConflict *
*Keywords: NontransactionalWrite optimistic *
*Assertion ID: A5.6.2-4, A5.6.2-6, A5.6.2-8, A5.6.2-10. *
*Assertion Description: A5.6.2-4 [If a datastore transaction is begun, commit will write the changes to the datastore with no checking as to the current state of the instances in the datastore. That is, the changes made outside the transaction together with any changes made inside the transaction will overwrite the current state of the datastore.] A5.6.2-6 [If a datastore transaction is begun, rollback will not write any changes to the datastore.] A5.6.2-8 [If an optimistic transaction is begun, commit will write the changes to the datastore after checking as to the current state of the instances in the datastore. The changes made outside the transaction together with any changes made inside the transaction will update the current state of the datastore if the version checking is successful.] A5.6.2-10 [If an optimistic transaction is begun, rollback will not write any changes to the datastore. The persistent-nontransactional-dirty instances will transition according to the RestoreValues flag. ] */ public class NontransactionalWriteOptimisticCommitConflict extends NontransactionalWriteTest { /** */ protected static final String ASSERTION_FAILED = "Assertion A5.6.2-8 " + "(NontransactionalWriteOptimisticCommitConflict) failed: "; /** * The main 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 (NontransactionalWriteOptimisticCommitConflict.class); } /** * Create a nontransactional dirty instance, begin and commit * a conflicting transaction, begin and commit an optimistic * transaction and check that the instance in the datastore * has the value as changed by the conflicting transaction. */ public void testOptimisticCommitConflict() { if (!checkNontransactionalFeaturesSupported(true)) return; String location = ASSERTION_FAILED + "after optimistic commit with conflict"; createAndModifyVersionedPCPoint(); conflictingUpdate(); beginAndCommitTransactionFails(location, true); checkXValue(location, conflictXValue); failOnError(); } }tck/src/java/org/apache/jdo/tck/lifecycle/NontransactionalWriteOptimisticRollback.java100664 6521 12500110374 31603 0ustarmbouschenstaff 0 0 /* * 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.lifecycle; import javax.jdo.JDOUnsupportedOptionException; import javax.jdo.PersistenceManager; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.VersionedPCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Test NontransactionalWriteOptimisticRollback *
*Keywords: NontransactionalWrite optimistic rollback *
*Assertion ID: A5.6.2-4, A5.6.2-6, A5.6.2-8, A5.6.2-10. *
*Assertion Description: A5.6.2-4 [If a datastore transaction is begun, commit will write the changes to the datastore with no checking as to the current state of the instances in the datastore. That is, the changes made outside the transaction together with any changes made inside the transaction will overwrite the current state of the datastore.] A5.6.2-6 [If a datastore transaction is begun, rollback will not write any changes to the datastore.] A5.6.2-8 [If an optimistic transaction is begun, commit will write the changes to the datastore after checking as to the current state of the instances in the datastore. The changes made outside the transaction together with any changes made inside the transaction will update the current state of the datastore if the version checking is successful.] A5.6.2-10 [If an optimistic transaction is begun, rollback will not write any changes to the datastore. The persistent-nontransactional-dirty instances will transition according to the RestoreValues flag. ] */ public class NontransactionalWriteOptimisticRollback extends NontransactionalWriteTest { /** */ protected static final String ASSERTION_FAILED = "Assertion A5.6.2-10 (NontransactionalWriteOptimisticRollback) failed: "; /** * The main 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(NontransactionalWriteOptimisticRollback.class); } /** * Create a nontransactional dirty instance, begin and rollback * a transaction, and check that the instance in the datastore * has not been changed. */ public void testOptimisticRollback() { if (!checkNontransactionalFeaturesSupported(true)) return; createAndModifyVersionedPCPoint(); beginAndRollbackTransaction(true); checkXValue(ASSERTION_FAILED + "after optimistic rollback", originalXValue); failOnError(); } }tck/src/java/org/apache/jdo/tck/lifecycle/NontransactionalWriteTest.java100664 20416 12500110374 26743 0ustarmbouschenstaff 0 0 /* * 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.lifecycle; import javax.jdo.JDOOptimisticVerificationException; import javax.jdo.JDOUnsupportedOptionException; import javax.jdo.PersistenceManager; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.VersionedPCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Test NontransactionalWrite abstract base class *
*Keywords: NontransactionalWrite *
*Assertion ID: *
*Assertion Description: */ abstract public class NontransactionalWriteTest extends JDO_Test { /** * The ObjectId of the pc instance, set by method * createAndModifyInstance. */ protected Object oid; /** * The original value of the X field of the pc instance, * set by method createAndModifyInstance. */ protected int originalXValue = 100; protected int newXValue = 999; protected int conflictXValue = 555; /** * Create a new VersionedPCPoint instance,modify its X value, * and store its oid in the test class oid. The persistence manager * referenced by the pm field (in the superclass) manages the * nontransactional dirty instance. * This method is only executed if the * JDO implementation supports the required features, otherwise * this method would be localSetUp. */ protected VersionedPCPoint createAndModifyVersionedPCPoint() { addTearDownClass(VersionedPCPoint.class); getPM().currentTransaction().begin(); pm.currentTransaction().setNontransactionalWrite(true); pm.currentTransaction().setNontransactionalRead(true); pm.currentTransaction().setRetainValues(true); VersionedPCPoint instance = new VersionedPCPoint(originalXValue, 200); pm.makePersistent(instance); oid = pm.getObjectId(instance); pm.currentTransaction().commit(); instance.setX(newXValue); return instance; } /** * Begin and rollback a transaction using the persistence manager * that manages the nontransactional dirty instance. * @param optimistic use optimistic transaction */ protected void beginAndRollbackTransaction(boolean optimistic) { getPM().currentTransaction().setOptimistic(optimistic); pm.currentTransaction().begin(); pm.currentTransaction().rollback(); } /** * Begin and commit a transaction using the persistence manager * that manages the nontransactional dirty instance. * @param optimistic use optimistic transaction */ protected void beginAndCommitTransaction(boolean optimistic) { getPM().currentTransaction().setOptimistic(optimistic); pm.currentTransaction().begin(); pm.currentTransaction().commit(); } /** * Begin and commit a transaction using the persistence manager * that manages the nontransactional dirty instance. This * transaction must fail due to a conflicting update. * @param optimistic use optimistic transaction */ protected void beginAndCommitTransactionFails(String location, boolean optimistic) { getPM().currentTransaction().setOptimistic(optimistic); pm.currentTransaction().begin(); try { pm.currentTransaction().commit(); } catch (JDOOptimisticVerificationException ex) { // good catch; return return; } appendMessage(location + "transaction succeeded but" + " should not succeed."); } /** * Check the x value of the persistent instance referenced * by the oid. Use a new persistence manager and check the * value in a new transaction so there is no interference * with the persistence manager that managed the nontransactional * dirty instance. */ protected void checkXValue(String location, int expectedXValue) { PersistenceManager pmCheck = pmf.getPersistenceManager(); try { pmCheck.currentTransaction().begin(); VersionedPCPoint instance = (VersionedPCPoint)pmCheck.getObjectById(oid, true); int actualXValue = instance.getX(); pmCheck.currentTransaction().commit(); if (expectedXValue != actualXValue) { appendMessage(location + NL + "expected: " + expectedXValue + NL + " actual: " + actualXValue); } } finally { cleanupPM(pmCheck); } } /** * Perform a conflicting transaction that updates the same field * as the nontransactional dirty instance. The field value is * conflictXValue. This conflicting transaction uses a new * persistence manager. */ protected void conflictingUpdate() { PersistenceManager pmConflict = pmf.getPersistenceManager(); try { pmConflict.currentTransaction().setOptimistic(false); pmConflict.currentTransaction().begin(); VersionedPCPoint instance = (VersionedPCPoint)pmConflict.getObjectById(oid); instance.setX(conflictXValue); pmConflict.currentTransaction().commit(); } finally { cleanupPM(pmConflict); } } /** * Check that all Nontransactional features are supported. * @param optimistic check for whether Optimistic is supported as well. */ protected boolean checkNontransactionalFeaturesSupported (boolean optimistic) { if (!checkNontransactionalWriteSupported() || !checkNontransactionalReadSupported() || !checkRetainValuesSupported()) return false; if (optimistic) { if (!checkOptimisticSupported()) { return false; } } return true; } /** * Check if NontransactionalWrite is supported, and log a debug * message if it is not. */ protected boolean checkNontransactionalWriteSupported() { if (!isNontransactionalWriteSupported()) { printUnsupportedOptionalFeatureNotTested( getClass().getName(), "javax.jdo.option.NontransactionalWrite"); return false; } return true; } /** * Check if NontransactionalRead is supported, and log a debug * message if it is not. */ protected boolean checkNontransactionalReadSupported() { if (!isNontransactionalReadSupported()) { printUnsupportedOptionalFeatureNotTested( getClass().getName(), "javax.jdo.option.NontransactionalRead"); return false; } return true; } /** * Check if Optimistic is supported, and log a debug * message if it is not. */ protected boolean checkOptimisticSupported() { if (!isOptimisticSupported()) { printUnsupportedOptionalFeatureNotTested( getClass().getName(), "javax.jdo.option.Optimistic"); return false; } return true; } /** * Check if RetainValues is supported, and log a debug * message if it is not. */ protected boolean checkRetainValuesSupported() { if (!isRetainValuesSupported()) { printUnsupportedOptionalFeatureNotTested( getClass().getName(), "javax.jdo.option.RetainValues"); return false; } return true; } } tck/src/java/org/apache/jdo/tck/lifecycle/NontransactionalWriteThrows.java100664 5240 12500110374 27270 0ustarmbouschenstaff 0 0 /* * 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.lifecycle; import javax.jdo.JDOUnsupportedOptionException; import javax.jdo.PersistenceManager; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.VersionedPCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Test NontransactionalWriteThrows *
*Keywords: NontransactionalWrite *
*Assertion ID: A13.4.2-6 *
*Assertion Description: If an implementation does not support the [NontranasctionalWrite] option, then an attempt to set the flag to an unsupported value will throw JDOUnsupportedOptionException. */ public class NontransactionalWriteThrows extends NontransactionalWriteTest { /** */ protected static final String ASSERTION_FAILED = "Assertion A13.4.2-6 (NontransactionalWriteThrows) failed: "; /** * The main 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(NontransactionalWriteThrows.class); } /** * Make sure that if NontransactionalWrite is not supported, * an exception is thrown when setting NontransactionalWrite. */ public void testNontransactionalWriteThrows() { if (!checkNontransactionalWriteSupported()) { try { getPM().currentTransaction().setNontransactionalWrite(true); } catch (JDOUnsupportedOptionException ex) { return; // good catch } catch (Exception ex) { // threw wrong exception appendMessage (ASSERTION_FAILED + "threw wrong exception " + ex); } appendMessage (ASSERTION_FAILED + "failed to throw " + "JDOUnsupportedOptionException"); } failOnError(); } }tck/src/java/org/apache/jdo/tck/lifecycle/ObjectIdNotModifiedWhenObjectIdInstanceModified.java100664 12351 12500110374 32733 0ustarmbouschenstaff 0 0 /* * 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.lifecycle; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import javax.jdo.Extent; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.lifecycle.StateTransitionObj; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Test that ObjectId is not modified even if ObjectId returned by GetObjectId() is modified *
*Keywords: lifecycle GetObjectId *
*Assertion IDs: A5.4-6 *
*Assertion Description: The object returned by any call to getObjectId might be modified by the user, but that modification does not affect the identity of the object that was originally referred. */ public class ObjectIdNotModifiedWhenObjectIdInstanceModified extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A5.4-6 (ObjectIdNotModifiedWhenObjectIdInstanceModified) failed: "; private static final int NUM_OBJECTS = 50; /** The persistent instances of this test. */ private Object[] obj; /** * The main 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(ObjectIdNotModifiedWhenObjectIdInstanceModified.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { pm = getPM(); addTearDownClass(StateTransitionObj.class); obj = generatePersistentInstances(); } public void test() throws Exception { pm.currentTransaction().begin(); try { Extent extent = pm.getExtent(StateTransitionObj.class, false); Iterator iter = extent.iterator(); if( !iter.hasNext() ){ fail(ASSERTION_FAILED, "Extent for StateTransitionObj should not be empty"); } extent.close(iter); int failures = 0; StringBuffer report = new StringBuffer("Failures comparing oids.\n"); for (int i=0; iTitle:
Test that a PM returns the same JDO instance if getObjectById(ObjectId) is called multiple times with the same objectId instance *
*Keywords: lifecycle getObjectById *
*Assertion IDs: A5.4-2, A5.4-8 *
*Assertion Description: Any instances returned by any calls to getObjectById(Object) with the same object id instance to the same PersistenceManager instance must be identical (assuming the instances were not garbage collected between calls). */ public class PMReturnsIdenticalInstancesForEqualObjIds extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertions A5.4-2, A5.4-8 (PMReturnsIdenticalInstancesForEqualObjIds) failed: "; private static final int NUM_OBJECTS = 50; /** The persistent instances of this test. */ private Object[] obj; /** * The main 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(PMReturnsIdenticalInstancesForEqualObjIds.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { pm = getPM(); addTearDownClass(StateTransitionObj.class); obj = generatePersistentInstances(); } public void test() { pm.currentTransaction().begin(); try { Extent extent = pm.getExtent(StateTransitionObj.class, false); Iterator iter = extent.iterator(); if( !iter.hasNext() ){ fail(ASSERTION_FAILED, "Extent for StateTransitionObj should not be empty"); } extent.close(iter); for (int i=0; iTitle: Test PM ability to share PC classes but not PC instances *
*Keywords: PM share PC class *
*Assertion IDs: A5.2-1,A5.2-2,A5.2-3 *
*Assertion Description: Several JDO PersistenceManagers might be coresident and might share the same persistence capable classes] (although a JDO instance can be associated with only one PersistenceManager at a time) */ public class PMsCanSharePCClassesButNotPCInstances extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertions A5.2-1,A5.2-2,A5.2-3 (PMsCanSharePCClassesButNotPCInstances) failed: "; /** The number of active threads. Each thread has its own PM. */ private int threads = 0; /** The total number of attempts to insert PC instances */ private int attempts = 0; /** The number of inserters. Each inserter runs in its own thread. */ private int inserters = 5; /** The number of objects inserted. */ protected int insertedCount = 0; /** The number of objects that is expected to have been inserted. */ protected int insertedCountExpected = 0; /** * The main 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(PMsCanSharePCClassesButNotPCInstances.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(StateTransitionObj.class); } public void testSharedPC() { // test shared PC - only one PM should succeed to insert the shared PC threads = 0; attempts = 0; insertedCount = 0; insertedCountExpected = 1; insertObjects(true); } public void testNonSharedPC() { // test non-shared PCs - each PM should succeed to insert its own non-shared PC threads = 0; attempts = 0; //insertedCount = 0; //Don't reset this value since we have not deleted the inserted object from the shared PC test above insertedCountExpected += inserters; insertObjects(false); } protected void insertObjects(boolean sharedPC) { Object pc = null; ThreadExceptionHandler threadGroup = new ThreadExceptionHandler(); for (int i = 0; i < inserters; i++) { if (sharedPC) { // each thread shares one PC if (pc==null) pc = new StateTransitionObj(i); } else { // each thread has its own PC pc = new StateTransitionObj(i); } threads++; Thread t = new Thread(threadGroup, new Inserter(pmf, pc, sharedPC)); t.setName("Inserter-" + i); t.start(); } Thread.yield(); while (! attemptsComplete()) { try { Thread.sleep(100); } catch (InterruptedException ex) { logger.debug("interrupted while waiting for threads to insert"); } } while (threads > 0) { try { Thread.sleep(100); } catch (InterruptedException ex) { logger.debug("interrupted while waiting for threads to finish"); } } Collection exceptions = threadGroup.getAllUncaughtExceptions(); for (Iterator i = exceptions.iterator(); i.hasNext(); ) { Map.Entry entry = (Map.Entry) i.next(); Thread thread = (Thread)entry.getKey(); Throwable throwable = (Throwable)entry.getValue(); String message = "Uncaught exception " + throwable + " in thread " + thread; if( throwable instanceof AssertionFailedError ) fail(ASSERTION_FAILED, message); else throw new JDOFatalException(message, throwable); } } synchronized void signal() { threads--; } protected synchronized void incrAttempts() { attempts++; } protected synchronized boolean attemptsComplete() { return attempts == inserters; } class Inserter implements Runnable { private final PersistenceManager pm; private final Object pc; private final Class instanceClass; private final boolean sharedPC; Inserter(PersistenceManagerFactory pmf, Object pc, boolean sharedPC) { this.pm = pmf.getPersistenceManager(); this.pc = pc; this.instanceClass = pc.getClass(); this.sharedPC = sharedPC; } protected synchronized void announce(String msg, Object pc) { insertedCount++; Object oid = JDOHelper.getObjectId(pc); if (debug) logger.debug(msg + this.getClass().getName() + ": " + oid + ", " + pc); } public void run() { Transaction tx = null; try { if (debug) logger.debug("running"); tx = pm.currentTransaction(); tx.begin(); try { pm.makePersistent(pc); announce("inserted ", pc); tx.commit(); } catch (JDOException ex) { if (!sharedPC) //we expect an exception for all but one of the inserters in the case of a shared PC throw ex; } finally { incrAttempts(); if (tx != null && tx.isActive()) tx.rollback(); } while (!attemptsComplete()) { try { Thread.sleep(100); } catch (InterruptedException ex) { if (debug) logger.debug(" interrupted"); } } //Verify that the number of inserted objects matches the expected number if (insertedCount!=insertedCountExpected) { fail(ASSERTION_FAILED, "Wrong number of objects in extent. Inserted=" + insertedCount + " Expected=" + insertedCountExpected); } if (debug) logger.debug("getting Extent"); int objCount = 0; if (debug) logger.debug("getting Extent of " + instanceClass.getName()); tx.begin(); Extent e = pm.getExtent(instanceClass, false); for (Iterator i = e.iterator(); i.hasNext();) { Object instance = (Object)i.next(); objCount++; } tx.commit(); //Verify that the number of inserted objects matches the number of objects in the extent if (insertedCount!=objCount) { fail(ASSERTION_FAILED, "Wrong number of objects in extent. Inserted="+insertedCount+" Found="+objCount); } } finally { if (tx != null && tx.isActive()) tx.rollback(); if (pm != null && !pm.isClosed()) pm.close(); PMsCanSharePCClassesButNotPCInstances.this.signal(); } } public String toString() { String rc = "Inserter "; if (debug) { rc += Thread.currentThread().toString(); } return rc; } } } tck/src/java/org/apache/jdo/tck/lifecycle/StateTransitions.java100664 133274 12500110374 25120 0ustarmbouschenstaff 0 0 /* * 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.lifecycle; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.ObjectOutputStream; import java.util.Iterator; import javax.jdo.Extent; import javax.jdo.JDOFatalException; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.lifecycle.StateTransitionObj; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Test State Transitions *
*Keywords: lifecycle *
*Assertion IDs: A5.9-1 through A5.9-190 *Assertion Description: All possible state transistions are being tested in this test. */ public class StateTransitions extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertions A5.9-1 through A5.9-190 (StateTransitions) failed: "; /** * The main 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(StateTransitions.class); } private Transaction transaction; private int scenario; private int operation; private int current_state; private int expected_state; private int new_state; /** * Operations that cause state changes */ private static final int MAKEPERSISTENT = 0; private static final int DELETEPERSISTENT = 1; private static final int MAKETRANSACTIONAL = 2; private static final int MAKENONTRANSACTIONAL = 3; private static final int MAKETRANSIENT = 4; private static final int COMMITNORETAINVALUES = 5; private static final int COMMITRETAINVALUES = 6; private static final int ROLLBACKNORESTOREVALUES = 7; private static final int ROLLBACKRESTOREVALUES = 8; private static final int REFRESHDATASTORE = 9; private static final int REFRESHOPTIMISTIC = 10; private static final int EVICT = 11; private static final int READOUTSIDETX = 12; private static final int READOPTIMISTIC = 13; private static final int READDATASTORE = 14; private static final int WRITEOUTSIDETX = 15; private static final int WRITEINSIDETX = 16; private static final int RETRIEVEOUTSIDETX = 17; private static final int RETRIEVEINSIDETX = 18; private static final int DETACHALLONCOMMIT = 19; private static final int DETACHCOPYOUTSIDETXNTRTRU = 20; private static final int DETACHCOPYOUTSIDETXNTRFLS = 21; private static final int DETACHCOPYINSIDEDATASTORETX = 22; private static final int DETACHCOPYINSIDEOPTIMISTICTX = 23; private static final int SERIALIZEOUTSIDETX = 24; private static final int SERIALIZEDATASTORE = 25; private static final int SERIALIZEOPTIMISTIC = 26; private static final int NUM_OPERATIONS = 27; private static final String[] operations = { "makePersistent", "deletePersistent", "makeTransactional", "makeNontransactional", "makeTransient", "commit, retainValues=false", "commit, retainValues=true", "rollback, restoreValues=false", "rollback, restoreValues=true", "refresh with active datastore tx", "refresh with active optimistic tx", "evict", "read field outside tx", "read field with active optimistic tx", "read field with active datastore tx", "write field outside tx", "write field with active tx", "retrieve outside tx", "retrieve with active tx", "commit, detachAllOnCommit=true", "detachCopy outside tx with NontransactionalRead=true", "detachCopy outside tx with NontransactionalRead=false", "detachCopy with active datastore tx", "detachCopy with active optimistic tx", "serialize outside tx", "serialize with active datastore tx", "serialize with active optimistic tx" }; /** * Illegal state transitions */ private static final int UNCHANGED = -1; private static final int ERROR = -2; private static final int IMPOSSIBLE = -3; private static final int NOT_APPLICABLE = -4; private static final int UNSPECIFIED = -5; /** * State transitions */ public static final int[][] transitions = { // [operation] [current state] = new state // TRANSIENT, PERSISTENT_NEW, PERSISTENT_CLEAN, // PERSISTENT_DIRTY, HOLLOW, TRANSIENT_CLEAN, // TRANSIENT_DIRTY, PERSISTENT_NEW_DELETED, PERSISTENT_DELETED, // PERSISTENT_NONTRANSACTIONAL, PERSISTENT_NONTRANSACTIONAL_DIRTY, DETACHED_CLEAN, // DETACHED_DIRTY // makePersistent { PERSISTENT_NEW, UNCHANGED, UNCHANGED, UNCHANGED, UNCHANGED, PERSISTENT_NEW, PERSISTENT_NEW, UNCHANGED, UNCHANGED, UNCHANGED, UNCHANGED, DETACHED_CLEAN, DETACHED_DIRTY}, // deletePersistent { ERROR, PERSISTENT_NEW_DELETED, PERSISTENT_DELETED, PERSISTENT_DELETED, PERSISTENT_DELETED, ERROR, ERROR, UNCHANGED, UNCHANGED, PERSISTENT_DELETED, PERSISTENT_DELETED, ERROR, ERROR}, // makeTransactional { TRANSIENT_CLEAN, UNCHANGED, UNCHANGED, UNCHANGED, PERSISTENT_CLEAN, UNCHANGED, UNCHANGED, UNCHANGED, UNCHANGED, PERSISTENT_CLEAN, PERSISTENT_DIRTY, ERROR, ERROR}, // makeNontransactional { ERROR, ERROR, PERSISTENT_NONTRANSACTIONAL, ERROR, UNCHANGED, TRANSIENT, ERROR, ERROR, ERROR, UNCHANGED, UNCHANGED, ERROR, ERROR}, // makeTransient { UNCHANGED, ERROR, TRANSIENT, ERROR, TRANSIENT, UNCHANGED, UNCHANGED, ERROR, ERROR, TRANSIENT, ERROR, ERROR, ERROR}, // commit, retainValues = false { UNCHANGED, HOLLOW, HOLLOW, HOLLOW, UNCHANGED, UNCHANGED, TRANSIENT_CLEAN, TRANSIENT, TRANSIENT, UNCHANGED, HOLLOW, UNCHANGED, UNCHANGED}, // commit, retainValues = true { UNCHANGED, PERSISTENT_NONTRANSACTIONAL, PERSISTENT_NONTRANSACTIONAL, PERSISTENT_NONTRANSACTIONAL, UNCHANGED, UNCHANGED, TRANSIENT_CLEAN, TRANSIENT, TRANSIENT, UNCHANGED, PERSISTENT_NONTRANSACTIONAL, UNCHANGED, UNCHANGED}, // TRANSIENT, PERSISTENT_NEW, PERSISTENT_CLEAN, // PERSISTENT_DIRTY, HOLLOW, TRANSIENT_CLEAN, // TRANSIENT_DIRTY, PERSISTENT_NEW_DELETED, PERSISTENT_DELETED, // PERSISTENT_NONTRANSACTIONAL, PERSISTENT_NONTRANSACTIONAL_DIRTY, DETACHED_CLEAN, // DETACHED_DIRTY // rollback, restoreValues = false { UNCHANGED, TRANSIENT, HOLLOW, HOLLOW, UNCHANGED, UNCHANGED, TRANSIENT_CLEAN, TRANSIENT, HOLLOW, UNCHANGED, HOLLOW, UNCHANGED, UNCHANGED}, // rollback, restoreValues = true { UNCHANGED, TRANSIENT, PERSISTENT_NONTRANSACTIONAL, PERSISTENT_NONTRANSACTIONAL, UNCHANGED, UNCHANGED, TRANSIENT_CLEAN, TRANSIENT, PERSISTENT_NONTRANSACTIONAL, UNCHANGED, UNCHANGED, UNCHANGED, UNCHANGED}, // refresh with active datastore transaction { UNCHANGED, UNCHANGED, UNCHANGED, PERSISTENT_CLEAN, UNCHANGED, UNCHANGED, UNCHANGED, UNCHANGED, UNCHANGED, UNCHANGED, PERSISTENT_NONTRANSACTIONAL, UNCHANGED, UNCHANGED}, // refresh with active optimistic transaction { UNCHANGED, UNCHANGED, UNCHANGED, PERSISTENT_NONTRANSACTIONAL, UNCHANGED, UNCHANGED, UNCHANGED, UNCHANGED, UNCHANGED, UNCHANGED, PERSISTENT_NONTRANSACTIONAL, UNCHANGED, UNCHANGED}, // evict { NOT_APPLICABLE, UNCHANGED, HOLLOW, UNCHANGED, UNCHANGED, UNCHANGED, UNCHANGED, UNCHANGED, UNCHANGED, HOLLOW, HOLLOW, UNCHANGED, UNCHANGED}, // read field outside transaction { UNCHANGED, IMPOSSIBLE, IMPOSSIBLE, IMPOSSIBLE, PERSISTENT_NONTRANSACTIONAL, IMPOSSIBLE, IMPOSSIBLE, IMPOSSIBLE, IMPOSSIBLE, UNCHANGED, UNCHANGED, UNCHANGED, UNCHANGED}, // read field with active optimistic transaction { UNCHANGED, UNCHANGED, UNCHANGED, UNCHANGED, PERSISTENT_NONTRANSACTIONAL, UNCHANGED, UNCHANGED, UNSPECIFIED, UNSPECIFIED, UNCHANGED, UNCHANGED, UNCHANGED, UNCHANGED}, // TRANSIENT, PERSISTENT_NEW, PERSISTENT_CLEAN, // PERSISTENT_DIRTY, HOLLOW, TRANSIENT_CLEAN, // TRANSIENT_DIRTY, PERSISTENT_NEW_DELETED, PERSISTENT_DELETED, // PERSISTENT_NONTRANSACTIONAL, PERSISTENT_NONTRANSACTIONAL_DIRTY, DETACHED_CLEAN, // DETACHED_DIRTY // read field with active datastore transaction { UNCHANGED, UNCHANGED, UNCHANGED, UNCHANGED, PERSISTENT_CLEAN, UNCHANGED, UNCHANGED, UNSPECIFIED, UNSPECIFIED, PERSISTENT_CLEAN, UNCHANGED, UNCHANGED, UNCHANGED}, // write field outside transaction { UNCHANGED, IMPOSSIBLE, IMPOSSIBLE, IMPOSSIBLE, PERSISTENT_NONTRANSACTIONAL, IMPOSSIBLE, IMPOSSIBLE, IMPOSSIBLE, IMPOSSIBLE, PERSISTENT_NONTRANSACTIONAL_DIRTY, UNCHANGED, DETACHED_DIRTY, UNCHANGED}, // write field with active transaction { UNCHANGED, UNCHANGED, PERSISTENT_DIRTY, UNCHANGED, PERSISTENT_DIRTY, TRANSIENT_DIRTY, UNCHANGED, ERROR, ERROR, PERSISTENT_DIRTY, UNCHANGED, DETACHED_DIRTY, UNCHANGED}, // retrieve outside transaction { UNCHANGED, IMPOSSIBLE, IMPOSSIBLE, IMPOSSIBLE, PERSISTENT_NONTRANSACTIONAL, IMPOSSIBLE, IMPOSSIBLE, IMPOSSIBLE, IMPOSSIBLE, UNCHANGED, UNCHANGED, UNCHANGED, UNCHANGED}, // retrieve with active transaction { UNCHANGED, UNCHANGED, UNCHANGED, UNCHANGED, PERSISTENT_CLEAN, UNCHANGED, UNCHANGED, UNCHANGED, UNCHANGED, PERSISTENT_CLEAN, UNCHANGED, UNCHANGED, UNCHANGED}, // commit, detachAllOnCommit = true { UNCHANGED, DETACHED_CLEAN, DETACHED_CLEAN, DETACHED_CLEAN, DETACHED_CLEAN, UNCHANGED, TRANSIENT_CLEAN, TRANSIENT, TRANSIENT, DETACHED_CLEAN, DETACHED_CLEAN, UNCHANGED, UNCHANGED}, // TRANSIENT, PERSISTENT_NEW, PERSISTENT_CLEAN, // PERSISTENT_DIRTY, HOLLOW, TRANSIENT_CLEAN, // TRANSIENT_DIRTY, PERSISTENT_NEW_DELETED, PERSISTENT_DELETED, // PERSISTENT_NONTRANSACTIONAL, PERSISTENT_NONTRANSACTIONAL_DIRTY, DETACHED_CLEAN, // DETACHED_DIRTY // detachCopy outside tx with NontransactionalRead=true { ERROR, IMPOSSIBLE, IMPOSSIBLE, IMPOSSIBLE, PERSISTENT_NONTRANSACTIONAL, ERROR, IMPOSSIBLE, IMPOSSIBLE, IMPOSSIBLE, UNCHANGED, UNCHANGED, UNCHANGED, UNCHANGED}, // detachCopy outside tx with NontransactionalRead=false { ERROR, IMPOSSIBLE, IMPOSSIBLE, IMPOSSIBLE, ERROR, ERROR, IMPOSSIBLE, IMPOSSIBLE, IMPOSSIBLE, ERROR, ERROR, ERROR, ERROR}, // detachCopy with active datastore tx { PERSISTENT_NEW, UNCHANGED, UNCHANGED, UNCHANGED, PERSISTENT_CLEAN, PERSISTENT_NEW, PERSISTENT_NEW, ERROR, ERROR, PERSISTENT_CLEAN, IMPOSSIBLE, UNCHANGED, UNCHANGED}, // detachCopy with active optimistic tx { PERSISTENT_NEW, UNCHANGED, UNCHANGED, UNCHANGED, PERSISTENT_NONTRANSACTIONAL, PERSISTENT_NEW, PERSISTENT_NEW, ERROR, ERROR, UNCHANGED, IMPOSSIBLE, UNCHANGED, UNCHANGED}, // serialize outside tx { UNCHANGED, IMPOSSIBLE, IMPOSSIBLE, IMPOSSIBLE, UNCHANGED, IMPOSSIBLE, IMPOSSIBLE, IMPOSSIBLE, IMPOSSIBLE, UNCHANGED, UNCHANGED, UNCHANGED, UNCHANGED}, // serialize with active datastore tx { UNCHANGED, UNCHANGED, UNCHANGED, UNCHANGED, PERSISTENT_CLEAN, UNCHANGED, UNCHANGED, UNCHANGED, UNCHANGED, PERSISTENT_CLEAN, UNCHANGED, UNCHANGED, UNCHANGED}, // serialize with active optimistic tx { UNCHANGED, UNCHANGED, UNCHANGED, UNCHANGED, UNCHANGED, UNCHANGED, UNCHANGED, UNCHANGED, UNCHANGED, UNCHANGED, UNCHANGED, UNCHANGED, UNCHANGED}, }; private static final int DATASTORE_TX = 0; private static final int OPTIMISTIC_TX = 1; private static final int NO_TX = 2; private static final String[] scenario_string = { "datastore transaction", "optimistic transaction", "no transaction" }; private static final boolean[][] applies_to_scenario = { // Datastore Optimistic No tx { true, true, false }, // makePersistent { true, true, false }, // deletePersistent { true, true, false }, // makeTransactional { true, true, false }, // makeNontransactional { true, true, false }, // makeTransient { true, true, false }, // commit RetainValues = false { true, true, false }, // commit RetainValues = true { true, true, false }, // rollback RestoreValues = false { true, true, false }, // rollback RestoreValues = true { true, false, false }, // refresh with active datastore transaction { false, true, false }, // refresh with active optimistic transaction { true, true, false }, // evict { false, false, true }, // read field outside of a transaction { false, true, false }, // read field with active optimistic transaction { true, false, false }, // read field with active datastore transaction { false, false, true }, // write field or makeDirty outside of a transaction { true, true, false }, // write field or makeDirty with active transaction { false, true, true }, // retrieve outside of a transaction or with active optimistic transaction { true, false, false }, // retrieve with active datastore transaction { true, true, false }, // commit, DetachAllOnCommit = true { false, false, true }, // detachCopy outside tx with NonTransactionaRead=true { false, false, true }, // detachCopy outside tx with NonTransactionaRead=false { true, false, false }, // detachCopy with active datastore tx { false, true, false }, // detachCopy with active optimistic tx { false, false, true }, // serialize outside tx { true, false, false }, // serialize with active datastore tx { false, true, false } // serialize with active optimistic tx }; /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { pm = getPM(); addTearDownClass(StateTransitionObj.class); generatePersistentInstances(); } public void test() { scenario = DATASTORE_TX; checkTransitions(); if( isOptimisticSupported() ){ scenario = OPTIMISTIC_TX; checkTransitions(); } scenario = NO_TX; checkTransitions(); failOnError(); } /** */ private void generatePersistentInstances() { if( doPersistentInstancesExist() ) return; int i; Transaction t = pm.currentTransaction(); t.begin(); for( i = 0; i < 50; ++i ){ StateTransitionObj sto = new StateTransitionObj(i); sto.writeField(i); pm.makePersistent(sto); } t.commit(); if( !doPersistentInstancesExist() ) if (debug) logger.debug("StateTransitions unable to create instances of StateTransitionsObj"); } /** */ private boolean doPersistentInstancesExist() { boolean ret; Transaction t = pm.currentTransaction(); t.begin(); Extent e = pm.getExtent(StateTransitionObj.class, false); Iterator iter = e.iterator(); ret = iter.hasNext(); t.rollback(); return ret; } /** */ public void prepareTransactionAndJDOSettings(Transaction transaction) { transaction.setNontransactionalRead(false); transaction.setNontransactionalWrite(false); if( scenario != NO_TX ) { if( operation == COMMITNORETAINVALUES ) transaction.setRetainValues(false); if( operation == COMMITRETAINVALUES ) transaction.setRetainValues(true); if( operation == ROLLBACKNORESTOREVALUES ) transaction.setRestoreValues(false); if( operation == ROLLBACKRESTOREVALUES ) transaction.setRestoreValues(true); if( operation == DETACHALLONCOMMIT ) pm.setDetachAllOnCommit(true); else pm.setDetachAllOnCommit(false); transaction.setOptimistic(scenario == OPTIMISTIC_TX); transaction.begin(); if( !transaction.isActive() ) if (debug) logger.debug("StateTransitions: Transaction should be active, but it is not"); } else { if( operation == READOUTSIDETX || operation == RETRIEVEOUTSIDETX || operation == DETACHCOPYOUTSIDETXNTRTRU || operation == SERIALIZEOUTSIDETX ) { transaction.setNontransactionalRead(true); } if( operation == WRITEOUTSIDETX || current_state == PERSISTENT_NONTRANSACTIONAL_DIRTY) { transaction.setNontransactionalWrite(true); } } } /** */ void checkTransitions() { for( operation = 0; operation < NUM_OPERATIONS; ++operation ){ // rule out situations that do not apply if( !applies_to_scenario[operation][scenario] ) continue; if( (operation == READOUTSIDETX || operation == RETRIEVEOUTSIDETX || operation == DETACHCOPYOUTSIDETXNTRTRU || operation == SERIALIZEOUTSIDETX) && !isNontransactionalReadSupported() ) continue; if( operation == WRITEOUTSIDETX && !isNontransactionalWriteSupported() ) continue; if( operation == COMMITRETAINVALUES && !isRetainValuesSupported() ) continue; if( operation == MAKENONTRANSACTIONAL && !(isNontransactionalReadSupported() || isNontransactionalWriteSupported()) ) continue; int NUM_JDO1_STATES = NUM_STATES - 2; // JDO1 is tested so far here. for( current_state = 0; current_state < NUM_JDO1_STATES; ++current_state){ if( scenario == OPTIMISTIC_TX && current_state == PERSISTENT_CLEAN ) continue; if( (current_state == TRANSIENT_CLEAN || current_state == TRANSIENT_DIRTY) && !isTransientTransactionalSupported() ) continue; // this state is not supported by implementation if( current_state == PERSISTENT_NONTRANSACTIONAL && !(isNontransactionalReadSupported() || isNontransactionalWriteSupported()) ) continue; // this state is not supported by implementation if( current_state == PERSISTENT_NONTRANSACTIONAL_DIRTY && !isNontransactionalWriteSupported() ) continue; expected_state = transitions[operation][current_state]; if( expected_state == IMPOSSIBLE ) continue; if( expected_state == NOT_APPLICABLE ) continue; if( expected_state == UNSPECIFIED ) continue; if( expected_state == UNCHANGED ) expected_state = current_state; try { transaction = pm.currentTransaction(); if( transaction.isActive()){ if (debug) logger.debug("Transaction is active (but should not be), rolling back"); transaction.rollback(); } prepareTransactionAndJDOSettings(transaction); printSituation(); StateTransitionObj obj = getInstanceInState(current_state); if( obj == null ){ // could not get object in state if( transaction.isActive() ) transaction.rollback(); continue; } // Apply operation, catching possible exception Exception e = null; try { applyOperation(operation, obj); } catch( Exception excep ){ if( excep instanceof javax.jdo.JDOUserException ){ e = excep; } else { appendMessage(ASSERTION_FAILED + NL + "StateTransitions: " + scenario_string[scenario] + "; current state " + states[current_state] + NL + operations[operation] + "; unexpected exception:" + excep); continue; } } // Get new state, verify correct transition and exceptions occurred new_state = currentState(obj); if( expected_state == ERROR ){ if( e == null ){ appendMessage(ASSERTION_FAILED + NL + "StateTransitions: " + scenario_string[scenario] + "; current state " + states[current_state] + NL + operations[operation] + "; JDOUserException should have been thrown"); } else { if( !compareStates(new_state, current_state) ) { appendMessage(ASSERTION_FAILED + NL + "StateTransitions: " + scenario_string[scenario] + "; current state " + states[current_state] + NL + operations[operation] + "; JDOUserException properly thrown, but instance should remain in current state," + "instance changed state to " + states[new_state]); } } } if( !compareStates(new_state, expected_state) ) { appendMessage(ASSERTION_FAILED + NL + "StateTransitions: " + scenario_string[scenario] + "; current state " + states[current_state] + NL + operations[operation] + " transitioned instance to invalid state " + states[new_state] + "; expected state " + states[expected_state]); } if( transaction.isActive() ) transaction.rollback(); } catch(Exception unexpected_exception) { if (debug) { unexpected_exception.printStackTrace(); } if (transaction.isActive()) transaction.rollback(); appendMessage(ASSERTION_FAILED + NL + "StateTransitions: " + scenario_string[scenario] + "; current state " + states[current_state] + NL + operations[operation] + "; unexpected exception caught: " + unexpected_exception); } } } } /** */ void printSituation() { if (debug) { logger.debug(" (" + scenario_string[scenario] + ", initial state=" + states[current_state] + ", operation=" + operations[operation] + ")"); } } /** */ void applyOperation(int operation, StateTransitionObj stobj) { StateTransitionObj obj = (StateTransitionObj) stobj; switch( operation ){ case MAKEPERSISTENT: { pm.makePersistent(obj); break; } case DELETEPERSISTENT: { pm.deletePersistent(obj); break; } case MAKETRANSACTIONAL: { pm.makeTransactional(obj); break; } case MAKENONTRANSACTIONAL: { pm.makeNontransactional(obj); break; } case MAKETRANSIENT: { pm.makeTransient(obj); break; } case COMMITNORETAINVALUES: { pm.currentTransaction().commit(); break; } case COMMITRETAINVALUES: { pm.currentTransaction().commit(); break; } case ROLLBACKNORESTOREVALUES: { pm.currentTransaction().rollback(); break; } case ROLLBACKRESTOREVALUES: { pm.currentTransaction().rollback(); break; } case REFRESHDATASTORE: { pm.refresh(obj); break; } case REFRESHOPTIMISTIC: { pm.refresh(obj); break; } case EVICT: { pm.evict(obj); break; } case READOUTSIDETX: { obj.readField(); break; } case READOPTIMISTIC: { obj.readField(); break; } case READDATASTORE: { obj.readField(); break; } case WRITEOUTSIDETX: { obj.writeField(42); break; } case WRITEINSIDETX: { obj.writeField(42); break; } case RETRIEVEOUTSIDETX: { pm.retrieve(obj); break; } case RETRIEVEINSIDETX: { pm.retrieve(obj); break; } case DETACHALLONCOMMIT: { pm.currentTransaction().commit(); break; } case DETACHCOPYOUTSIDETXNTRTRU: { pm.detachCopy(obj); break; } case DETACHCOPYOUTSIDETXNTRFLS: { pm.detachCopy(obj); break; } case DETACHCOPYINSIDEDATASTORETX: { pm.detachCopy(obj); break; } case DETACHCOPYINSIDEOPTIMISTICTX: { pm.detachCopy(obj); break; } case SERIALIZEOUTSIDETX: { ObjectOutputStream oos = null; try { oos = new ObjectOutputStream(new ByteArrayOutputStream()); oos.writeObject(obj); } catch (IOException e) { throw new JDOFatalException(e.getMessage(), e); } finally { if (oos != null) { try { oos.close(); } catch (IOException e) { throw new JDOFatalException(e.getMessage(), e); } } } break; } case SERIALIZEDATASTORE: case SERIALIZEOPTIMISTIC: { ObjectOutputStream oos = null; try { oos = new ObjectOutputStream(new ByteArrayOutputStream()); oos.writeObject(obj); } catch (IOException e) { throw new JDOFatalException(e.getMessage(), e); } finally { if (oos != null) { try { oos.close(); } catch (IOException e) { throw new JDOFatalException(e.getMessage(), e); } } } break; } default: { appendMessage(ASSERTION_FAILED + NL + "StateTransitions: " + scenario_string[scenario] + "; internal error, illegal operation: " + operation); } } } /** * Get an instance in the specified state. */ public StateTransitionObj getInstanceInState(int state) { switch(state) { case TRANSIENT: return getTransientInstance(); case PERSISTENT_NEW: return getPersistentNewInstance(); case PERSISTENT_CLEAN: return getPersistentCleanInstance(); case PERSISTENT_DIRTY: return getPersistentDirtyInstance(); case HOLLOW: return getHollowInstance(); case TRANSIENT_CLEAN: return getTransientCleanInstance(); case TRANSIENT_DIRTY: return getTransientDirtyInstance(); case PERSISTENT_NEW_DELETED: return getPersistentNewDeletedInstance(); case PERSISTENT_DELETED: return getPersistentDeletedInstance(); case PERSISTENT_NONTRANSACTIONAL: return getPersistentNontransactionalInstance(); case PERSISTENT_NONTRANSACTIONAL_DIRTY: return getPersistentNontransactionalDirtyInstance(); case DETACHED_CLEAN: return getDetachedCleanInstance(); case DETACHED_DIRTY: return getDetachedDirtyInstance(); default: return null; } } /** */ public StateTransitionObj getTransientInstance() { StateTransitionObj obj = new StateTransitionObj(23); int curr = currentState(obj); if( curr != TRANSIENT ) { if (debug) { logger.debug("StateTransitions: Unable to create transient instance, state is " + states[curr]); } return null; } return obj; } /** */ public StateTransitionObj getPersistentNewInstance() { StateTransitionObj obj = getTransientInstance(); if( obj == null ) return null; pm.makePersistent(obj); // should transition to persistent-new int curr = currentState(obj); if( curr != PERSISTENT_NEW ) { if (debug) { logger.debug("StateTransitions: Unable to create persistent-new instance" + " from transient instance via makePersistent(), state is " + states[curr]); } return null; } return obj; } /** */ public StateTransitionObj getPersistentCleanInstance() { StateTransitionObj obj = getHollowInstance(); if( obj == null ) return null; StateTransitionObj sto = (StateTransitionObj) obj; sto.readField(); int curr = currentState(sto); if( curr != PERSISTENT_CLEAN ) { if (debug) { logger.debug("StateTransition: Unable to create persistent-clean instance" + " from a hollow instance by reading a field, state is " + states[curr]); } return null; } return obj; } /** */ public StateTransitionObj getPersistentDirtyInstance() { StateTransitionObj obj = getHollowInstance(); if( obj == null ) return null; StateTransitionObj pcobj = (StateTransitionObj) obj; pcobj.writeField(23); int curr = currentState(obj); if( curr != PERSISTENT_DIRTY ) { if (debug) { logger.debug("StateTransition: Unable to create persistent-dirty instance" + " from a hollow instance by writing a field, state is " + states[curr]); } return null; } return obj; } /** */ public StateTransitionObj getHollowInstance() { if ( !transaction.isActive() ) transaction.begin(); if( !transaction.isActive() ) if (debug) logger.debug("getHollowInstance: Transaction should be active, but it is not"); Extent extent = pm.getExtent(StateTransitionObj.class, false); Iterator iter = extent.iterator(); if( !iter.hasNext() ){ if (debug) logger.debug("Extent for StateTransitionObj should not be empty"); return null; } StateTransitionObj obj = (StateTransitionObj) iter.next(); pm.makeTransactional(obj); transaction.setRetainValues(false); transaction.commit(); // This should put the instance in the HOLLOW state prepareTransactionAndJDOSettings(transaction); int curr = currentState(obj); if( curr != HOLLOW && curr != PERSISTENT_NONTRANSACTIONAL ){ if (debug) { logger.debug("getHollowInstance: Attempt to get hollow instance via accessing extent failed, state is " + states[curr]); } return null; } return obj; } /** */ public StateTransitionObj getTransientCleanInstance() { StateTransitionObj obj = getTransientInstance(); if( obj == null ) return null; pm.makeTransactional(obj); int curr = currentState(obj); if( curr != TRANSIENT_CLEAN ) { if (debug) { logger.debug("StateTransition: Unable to create transient-clean instance" + " from a transient instance via makeTransactional(), state is " + states[curr]); } return null; } return obj; } /** */ public StateTransitionObj getTransientDirtyInstance() { StateTransitionObj obj = getTransientCleanInstance(); if( obj == null ) return null; StateTransitionObj pcobj = (StateTransitionObj) obj; pcobj.writeField(23); int curr = currentState(obj); if( curr != TRANSIENT_DIRTY ) { if (debug) { logger.debug("StateTransition: Unable to create transient-dirty instance" + " from a transient-clean instance via modifying a field, state is " + states[curr]); } return null; } return obj; } /** */ public StateTransitionObj getPersistentNewDeletedInstance() { StateTransitionObj obj = getPersistentNewInstance(); if( obj == null ) return null; pm.deletePersistent(obj); // should transition to persistent-new-deleted int curr = currentState(obj); if( curr != PERSISTENT_NEW_DELETED) { if (debug) { logger.debug("StateTransition: Unable to create persistent-new-deleted instance" + " from a persistent-new instance via deletePersistent, state is " + states[curr]); } return null; } return obj; } /** */ public StateTransitionObj getPersistentDeletedInstance() { StateTransitionObj obj = getHollowInstance(); if( obj == null ) return null; pm.deletePersistent(obj); int curr = currentState(obj); if( curr != PERSISTENT_DELETED ) { if (debug) { logger.debug("StateTransition: Unable to create persistent-deleted instance" + " from a persistent instance via deletePersistent(), state is " + states[curr]); } return null; } return obj; } /** */ public StateTransitionObj getPersistentNontransactionalInstance() { StateTransitionObj obj = getHollowInstance(); if( obj == null ) return null; boolean nontransactionalRead = pm.currentTransaction().getNontransactionalRead(); pm.currentTransaction().setNontransactionalRead(true); obj.readField(); pm.makeNontransactional(obj); pm.currentTransaction().setNontransactionalRead(nontransactionalRead); int curr = currentState(obj); if( curr != PERSISTENT_NONTRANSACTIONAL && curr != HOLLOW ) { if (debug) { logger.debug("StateTransition: Unable to create persistent-nontransactional instance" + " from a persistent-clean instance via makeNontransactional(), state is " + states[curr]); } return null; } return obj; } /** */ public StateTransitionObj getPersistentNontransactionalDirtyInstance() { StateTransitionObj obj = getPersistentNontransactionalInstance(); if( obj == null ) return null; obj.writeField(10000); int curr = currentState(obj); if( curr != PERSISTENT_NONTRANSACTIONAL_DIRTY ) { if (debug) { logger.debug("StateTransition: Unable to create persistent-nontransactional-dirty instance" + " from a persistent-clean instance via makeNontransactional()/JDOHelper.makeDirty," + " state is " + states[curr]); } return null; } return obj; } /** */ public StateTransitionObj getDetachedCleanInstance() { StateTransitionObj obj = getHollowInstance(); if( obj == null ) return null; obj = (StateTransitionObj) pm.detachCopy(obj); int curr = currentState(obj); if( curr != DETACHED_CLEAN ) { if (debug) { logger.debug("StateTransition: Unable to create detached-clean instance" + " from a persistent-clean instance via detachCopy," + " state is " + states[curr]); } return null; } return obj; } /** */ public StateTransitionObj getDetachedDirtyInstance() { StateTransitionObj obj = getHollowInstance(); if( obj == null ) return null; obj = (StateTransitionObj) pm.detachCopy(obj); obj.writeField(1000); int curr = currentState(obj); if( curr != DETACHED_DIRTY ) { if (debug) { logger.debug("StateTransition: Unable to create detached-dirty instance" + " from a persistent-clean instance via detachCopy/persistent field modification," + " state is " + states[curr]); } return null; } return obj; } } tck/src/java/org/apache/jdo/tck/lifecycle/StateTransitionsReturnedObjects.java100664 74727 12500110374 30132 0ustarmbouschenstaff 0 0 /* * 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.lifecycle; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.util.Iterator; import javax.jdo.Extent; import javax.jdo.JDOFatalException; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.lifecycle.StateTransitionObj; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Test State Transitions *
*Keywords: lifecycle *
*Assertion IDs: A5.9-1 through A5.9-190 *Assertion Description: All possible state transistions are being tested in this test. */ public class StateTransitionsReturnedObjects extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertions A5.9-1 through A5.5.8 (serialization, detachment, attachment) failed: "; /** * The main 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(StateTransitionsReturnedObjects.class); } private Transaction transaction; private int scenario; private int operation; private int current_state; private int expected_state; private int new_state; /** * Operations that cause state changes */ private static final int MAKEPERSISTENTOPTIMISTIC = 0; private static final int MAKEPERSISTENTDATASTORE = 1; private static final int DETACHCOPYOUTSIDETXNTRTRU = 2; private static final int DETACHCOPYOUTSIDETXNTRFLS = 3; private static final int DETACHCOPYINSIDEDATASTORETX = 4; private static final int DETACHCOPYINSIDEOPTIMISTICTX = 5; private static final int SERIALIZEOUTSIDETX = 6; private static final int SERIALIZEINSIDETX = 7; private static final int NUM_OPERATIONS = 8; private static final String[] operations = { "makePersistent with active optimistic tx", "makePersistent with active datastore tx", "detachCopy outside tx with NontransactionalRead true", "detachCopy outside tx with NontransactionalRead false", "detachCopy with active datastore tx", "detachCopy with active optimistic tx", "serialize outside tx", "serialize with active tx" }; /** * Illegal state transitions */ private static final int UNCHANGED = -1; private static final int ERROR = -2; private static final int IMPOSSIBLE = -3; private static final int NOT_APPLICABLE = -4; private static final int UNSPECIFIED = -5; /** * State transitions */ public static final int[][] statesOfReturnedObjects = { // [operation] [current state] = new state // TRANSIENT, PERSISTENT_NEW, PERSISTENT_CLEAN, // PERSISTENT_DIRTY, HOLLOW, TRANSIENT_CLEAN, // TRANSIENT_DIRTY, PERSISTENT_NEW_DELETED, PERSISTENT_DELETED, // PERSISTENT_NONTRANSACTIONAL, PERSISTENT_NONTRANSACTIONAL_DIRTY, DETACHED_CLEAN, // DETACHED_DIRTY // makePersistent optimistic transaction { PERSISTENT_NEW, UNCHANGED, UNCHANGED, UNCHANGED, UNCHANGED, PERSISTENT_NEW, PERSISTENT_NEW, UNCHANGED, UNCHANGED, UNCHANGED, UNCHANGED, PERSISTENT_NONTRANSACTIONAL, PERSISTENT_DIRTY}, // makePersistent datastore transaction { PERSISTENT_NEW, UNCHANGED, UNCHANGED, UNCHANGED, UNCHANGED, PERSISTENT_NEW, PERSISTENT_NEW, UNCHANGED, UNCHANGED, UNCHANGED, UNCHANGED, PERSISTENT_CLEAN, PERSISTENT_DIRTY}, // detachCopy outside tx with NontransactionalRead=true { ERROR, IMPOSSIBLE, IMPOSSIBLE, IMPOSSIBLE, DETACHED_CLEAN, ERROR, IMPOSSIBLE, IMPOSSIBLE, IMPOSSIBLE, DETACHED_CLEAN, UNSPECIFIED, DETACHED_CLEAN, UNSPECIFIED}, // detachCopy outside tx with NontransactionalRead=false { ERROR, ERROR, ERROR, ERROR, ERROR, ERROR, IMPOSSIBLE, IMPOSSIBLE, IMPOSSIBLE, ERROR, ERROR, ERROR, ERROR}, // detachCopy with active datastore tx { DETACHED_CLEAN, DETACHED_CLEAN, DETACHED_CLEAN, DETACHED_CLEAN, DETACHED_CLEAN, DETACHED_CLEAN, DETACHED_CLEAN, ERROR, ERROR, DETACHED_CLEAN, IMPOSSIBLE, DETACHED_CLEAN, DETACHED_CLEAN}, // detachCopy with active optimistic tx { DETACHED_CLEAN, DETACHED_CLEAN, DETACHED_CLEAN, DETACHED_CLEAN, DETACHED_CLEAN, DETACHED_CLEAN, DETACHED_CLEAN, ERROR, ERROR, DETACHED_CLEAN, IMPOSSIBLE, DETACHED_CLEAN, DETACHED_CLEAN}, // serialize outside tx { UNCHANGED, IMPOSSIBLE, IMPOSSIBLE, IMPOSSIBLE, DETACHED_CLEAN, IMPOSSIBLE, IMPOSSIBLE, IMPOSSIBLE, IMPOSSIBLE, DETACHED_CLEAN, UNSPECIFIED, UNCHANGED, UNCHANGED}, // serialize with active tx { UNCHANGED, DETACHED_CLEAN, DETACHED_CLEAN, DETACHED_CLEAN, DETACHED_CLEAN, TRANSIENT, TRANSIENT, TRANSIENT, TRANSIENT, DETACHED_CLEAN, TRANSIENT, UNCHANGED, UNCHANGED}, }; private static final int DATASTORE_TX = 0; private static final int OPTIMISTIC_TX = 1; private static final int NO_TX = 2; private static final String[] scenario_string = { "datastore transaction", "optimistic transaction", "no transaction" }; private static final boolean[][] applies_to_scenario = { // Datastore Optimistic No tx { false, true, false }, // makePersistent active optimistic transaction { true, false, false }, // makePersistent active datastore transaction // since the spec leaves detachCopy outside tx a bit underspecified, // we decided to disable this scanario for now { false, false, true }, // detachCopy outside tx with NontransactionalRead=true { false, false, false }, // detachCopy outside tx with NontransactionalRead=false { true, true, false }, // detachCopy with active datastore tx { true, true, false }, // detachCopy with active optimistic tx { false, false, true }, // serialize outside tx { true, true, false } // serialize with active tx }; /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { pm = getPM(); addTearDownClass(StateTransitionObj.class); generatePersistentInstances(); } public void test() { scenario = DATASTORE_TX; checkTransitions(); if( isOptimisticSupported() ){ scenario = OPTIMISTIC_TX; checkTransitions(); } scenario = NO_TX; checkTransitions(); failOnError(); } /** */ private void generatePersistentInstances() { if( doPersistentInstancesExist() ) return; int i; Transaction t = pm.currentTransaction(); t.begin(); for( i = 0; i < 50; ++i ){ StateTransitionObj sto = new StateTransitionObj(i); sto.writeField(i); pm.makePersistent(sto); } t.commit(); if( !doPersistentInstancesExist() ) if (debug) logger.debug("StateTransitionsReturnedObjects unable to create instances of StateTransitionsObj"); } /** */ private boolean doPersistentInstancesExist() { boolean ret; Transaction t = pm.currentTransaction(); t.begin(); Extent e = pm.getExtent(StateTransitionObj.class, false); Iterator iter = e.iterator(); ret = iter.hasNext(); t.rollback(); return ret; } /** */ public void prepareTransactionAndJDOSettings(Transaction transaction) { if( scenario != NO_TX ) { transaction.setNontransactionalRead(false); transaction.setNontransactionalWrite(false); pm.setDetachAllOnCommit(false); transaction.setOptimistic(scenario == OPTIMISTIC_TX); transaction.begin(); if( !transaction.isActive() ) if (debug) logger.debug("StateTransitionsReturnedObjects: Transaction should be active, but it is not"); } else { if( operation == DETACHCOPYOUTSIDETXNTRTRU || operation == SERIALIZEOUTSIDETX ) { transaction.setNontransactionalRead(true); } if( current_state == PERSISTENT_NONTRANSACTIONAL_DIRTY) { transaction.setNontransactionalWrite(true); } } } /** */ void checkTransitions() { for( operation = 0; operation < NUM_OPERATIONS; ++operation ){ // rule out situations that do not apply if( !applies_to_scenario[operation][scenario] ) continue; if( (operation == DETACHCOPYOUTSIDETXNTRTRU || operation == SERIALIZEOUTSIDETX) && !isNontransactionalReadSupported() ) continue; for( current_state = 0; current_state < NUM_STATES; ++current_state){ if( scenario == OPTIMISTIC_TX && current_state == PERSISTENT_CLEAN ) continue; if( (current_state == TRANSIENT_CLEAN || current_state == TRANSIENT_DIRTY) && !isTransientTransactionalSupported() ) continue; // this state is not supported by implementation if( current_state == PERSISTENT_NONTRANSACTIONAL && !(isNontransactionalReadSupported() || isNontransactionalWriteSupported()) ) continue; // this state is not supported by implementation if( current_state == PERSISTENT_NONTRANSACTIONAL_DIRTY && !isNontransactionalWriteSupported() ) continue; expected_state = statesOfReturnedObjects[operation][current_state]; if( expected_state == IMPOSSIBLE ) continue; if( expected_state == NOT_APPLICABLE ) continue; if( expected_state == UNSPECIFIED ) continue; if( expected_state == UNCHANGED ) expected_state = current_state; try { transaction = pm.currentTransaction(); if( transaction.isActive()){ if (debug) logger.debug("Transaction is active (but should not be), rolling back"); transaction.rollback(); } prepareTransactionAndJDOSettings(transaction); printSituation(); StateTransitionObj obj = getInstanceInState(current_state); if( obj == null ){ // could not get object in state if( transaction.isActive() ) transaction.rollback(); continue; } // Apply operation, catching possible exception Exception e = null; Object returnedObject = null; try { returnedObject = applyOperation(operation, obj); } catch( Exception excep ){ if( excep instanceof javax.jdo.JDOUserException ){ e = excep; } else { appendMessage(ASSERTION_FAILED + NL + "StateTransitionsReturnedObjects: " + scenario_string[scenario] + "; current state " + states[current_state] + NL + operations[operation] + "; unexpected exception: " + excep); continue; } } if( expected_state == ERROR ){ if( e == null ){ appendMessage(ASSERTION_FAILED + NL + "StateTransitionsReturnedObjects: " + scenario_string[scenario] + "; current state " + states[current_state] + NL + operations[operation] + "; JDOUserException should have been thrown"); } else { int stateOfObj = currentState(obj); if( stateOfObj != current_state ){ appendMessage(ASSERTION_FAILED + NL + "StateTransitionsReturnedObjects: " + scenario_string[scenario] + "; current state " + states[current_state] + NL + operations[operation] + "; JDOUserException properly thrown, but instance should remain in current state," + " instance changed state to " + states[stateOfObj]); } } } else { // Get new state, verify correct transition and exceptions occurred new_state = currentState(returnedObject); if( !compareStates(new_state, expected_state) ) { appendMessage(ASSERTION_FAILED + NL + "StateTransitionsReturnedObjects: " + scenario_string[scenario] + "; current state " + states[current_state] + NL + operations[operation] + " returned instance in invalid state " + states[new_state] + "; expected state " + states[expected_state]); } } if( transaction.isActive() ) transaction.rollback(); } catch(Exception unexpected_exception) { if (transaction.isActive()) transaction.rollback(); appendMessage(ASSERTION_FAILED + NL + "StateTransitionsReturnedObjects: " + scenario_string[scenario] + "; current state " + states[current_state] + NL + operations[operation] + "; unexpected exception caught: " + unexpected_exception); } } } } /** */ void printSituation() { if (debug) { logger.debug(" (" + scenario_string[scenario] + ", initial state=" + states[current_state] + ", " + operations[operation] + ")"); } } /** */ Object applyOperation(int operation, StateTransitionObj stobj) { Object result = null; StateTransitionObj obj = (StateTransitionObj) stobj; switch( operation ){ case MAKEPERSISTENTOPTIMISTIC: case MAKEPERSISTENTDATASTORE: result = pm.makePersistent(obj); break; case DETACHCOPYOUTSIDETXNTRTRU: case DETACHCOPYOUTSIDETXNTRFLS: case DETACHCOPYINSIDEDATASTORETX: case DETACHCOPYINSIDEOPTIMISTICTX: result = pm.detachCopy(obj); break; case SERIALIZEOUTSIDETX: case SERIALIZEINSIDETX: ObjectOutputStream oos = null; ObjectInputStream ois = null; try { ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); oos = new ObjectOutputStream(byteArrayOutputStream); oos.writeObject(obj); ois = new ObjectInputStream(new ByteArrayInputStream( byteArrayOutputStream.toByteArray())); result = ois.readObject(); } catch (IOException e) { throw new JDOFatalException(e.getMessage(), e); } catch (ClassNotFoundException e) { throw new JDOFatalException(e.getMessage(), e); } finally { try { if (oos != null) { oos.close(); } if (ois != null) { ois.close(); } } catch (IOException e) { throw new JDOFatalException(e.getMessage(), e); } } break; default: appendMessage(ASSERTION_FAILED + NL + "StateTransitionsReturnedObjects: " + scenario_string[scenario] + "; internal error, illegal operation: " + operation); } return result; } /** * Get an instance in the specified state. */ public StateTransitionObj getInstanceInState(int state) { switch(state) { case TRANSIENT: return getTransientInstance(); case PERSISTENT_NEW: return getPersistentNewInstance(); case PERSISTENT_CLEAN: return getPersistentCleanInstance(); case PERSISTENT_DIRTY: return getPersistentDirtyInstance(); case HOLLOW: return getHollowInstance(); case TRANSIENT_CLEAN: return getTransientCleanInstance(); case TRANSIENT_DIRTY: return getTransientDirtyInstance(); case PERSISTENT_NEW_DELETED: return getPersistentNewDeletedInstance(); case PERSISTENT_DELETED: return getPersistentDeletedInstance(); case PERSISTENT_NONTRANSACTIONAL: return getPersistentNontransactionalInstance(); case PERSISTENT_NONTRANSACTIONAL_DIRTY: return getPersistentNontransactionalDirtyInstance(); case DETACHED_CLEAN: return getDetachedCleanInstance(); case DETACHED_DIRTY: return getDetachedDirtyInstance(); default: return null; } } /** */ public StateTransitionObj getTransientInstance() { StateTransitionObj obj = new StateTransitionObj(23); int curr = currentState(obj); if( curr != TRANSIENT ) { if (debug) { logger.debug("StateTransitionsReturnedObjects: Unable to create transient instance, state is " + states[curr]); } return null; } return obj; } /** */ public StateTransitionObj getPersistentNewInstance() { StateTransitionObj obj = getTransientInstance(); if( obj == null ) return null; pm.makePersistent(obj); // should transition to persistent-new int curr = currentState(obj); if( curr != PERSISTENT_NEW ) { if (debug) { logger.debug("StateTransitionsReturnedObjects: Unable to create persistent-new instance" + " from transient instance via makePersistent(), state is " + states[curr]); } return null; } return obj; } /** */ public StateTransitionObj getPersistentCleanInstance() { StateTransitionObj obj = getHollowInstance(); if( obj == null ) return null; StateTransitionObj sto = (StateTransitionObj) obj; sto.readField(); int curr = currentState(sto); if( curr != PERSISTENT_CLEAN ) { if (debug) { logger.debug("StateTransitionsReturnedObjects: Unable to create persistent-clean instance" + " from a hollow instance by reading a field, state is " + states[curr]); } return null; } return obj; } /** */ public StateTransitionObj getPersistentDirtyInstance() { StateTransitionObj obj = getHollowInstance(); if( obj == null ) return null; StateTransitionObj pcobj = (StateTransitionObj) obj; pcobj.writeField(23); int curr = currentState(obj); if( curr != PERSISTENT_DIRTY ) { if (debug) { logger.debug("StateTransitionsReturnedObjects: Unable to create persistent-dirty instance" + " from a hollow instance by writing a field, state is " + states[curr]); } return null; } return obj; } /** */ public StateTransitionObj getHollowInstance() { if ( !transaction.isActive() ) transaction.begin(); if( !transaction.isActive() ) if (debug) logger.debug("getHollowInstance: Transaction should be active, but it is not"); Extent extent = pm.getExtent(StateTransitionObj.class, false); Iterator iter = extent.iterator(); if( !iter.hasNext() ){ if (debug) logger.debug("Extent for StateTransitionObj should not be empty"); return null; } StateTransitionObj obj = (StateTransitionObj) iter.next(); pm.makeTransactional(obj); transaction.setRetainValues(false); transaction.commit(); // This should put the instance in the HOLLOW state prepareTransactionAndJDOSettings(transaction); int curr = currentState(obj); if( curr != HOLLOW && curr != PERSISTENT_NONTRANSACTIONAL ){ if (debug) { logger.debug("getHollowInstance: Attempt to get hollow instance via accessing extent failed, state is " + states[curr]); } return null; } return obj; } /** */ public StateTransitionObj getTransientCleanInstance() { StateTransitionObj obj = getTransientInstance(); if( obj == null ) return null; pm.makeTransactional(obj); int curr = currentState(obj); if( curr != TRANSIENT_CLEAN ) { if (debug) { logger.debug("StateTransitionsReturnedObjects: Unable to create transient-clean instance" + " from a transient instance via makeTransactional(), state is " + states[curr]); } return null; } return obj; } /** */ public StateTransitionObj getTransientDirtyInstance() { StateTransitionObj obj = getTransientCleanInstance(); if( obj == null ) return null; StateTransitionObj pcobj = (StateTransitionObj) obj; pcobj.writeField(23); int curr = currentState(obj); if( curr != TRANSIENT_DIRTY ) { if (debug) { logger.debug("StateTransitionsReturnedObjects: Unable to create transient-dirty instance" + " from a transient-clean instance via modifying a field, state is " + states[curr]); } return null; } return obj; } /** */ public StateTransitionObj getPersistentNewDeletedInstance() { StateTransitionObj obj = getPersistentNewInstance(); if( obj == null ) return null; pm.deletePersistent(obj); // should transition to persistent-new-deleted int curr = currentState(obj); if( curr != PERSISTENT_NEW_DELETED) { if (debug) { logger.debug("StateTransitionsReturnedObjects: Unable to create persistent-new-deleted instance" + " from a persistent-new instance via deletePersistent, state is " + states[curr]); } return null; } return obj; } /** */ public StateTransitionObj getPersistentDeletedInstance() { StateTransitionObj obj = getHollowInstance(); if( obj == null ) return null; pm.deletePersistent(obj); int curr = currentState(obj); if( curr != PERSISTENT_DELETED ) { if (debug) { logger.debug("StateTransitionsReturnedObjects: Unable to create persistent-deleted instance" + " from a persistent instance via deletePersistent(), state is " + states[curr]); } return null; } return obj; } /** */ public StateTransitionObj getPersistentNontransactionalInstance() { StateTransitionObj obj = getHollowInstance(); if( obj == null ) return null; boolean nontransactionalRead = pm.currentTransaction().getNontransactionalRead(); pm.currentTransaction().setNontransactionalRead(true); obj.readField(); pm.makeNontransactional(obj); pm.currentTransaction().setNontransactionalRead(nontransactionalRead); int curr = currentState(obj); if( curr != PERSISTENT_NONTRANSACTIONAL && curr != HOLLOW ) { if (debug) { logger.debug("StateTransitionsReturnedObjects: Unable to create persistent-nontransactional instance" + " from a persistent-clean instance via makeNontransactional(), state is " + states[curr]); } return null; } return obj; } /** */ public StateTransitionObj getPersistentNontransactionalDirtyInstance() { StateTransitionObj obj = getPersistentNontransactionalInstance(); if( obj == null ) return null; obj.writeField(10000); int curr = currentState(obj); if( curr != PERSISTENT_NONTRANSACTIONAL_DIRTY ) { if (debug) { logger.debug("StateTransitionsReturnedObjects: Unable to create persistent-nontransactional-dirty instance" + " from a persistent-clean instance via makeNontransactional()/JDOHelper.makeDirty," + " state is " + states[curr]); } return null; } return obj; } /** */ public StateTransitionObj getDetachedCleanInstance() { StateTransitionObj obj = getHollowInstance(); if( obj == null ) return null; obj = (StateTransitionObj) pm.detachCopy(obj); int curr = currentState(obj); if( curr != DETACHED_CLEAN ) { if (debug) { logger.debug("StateTransitionsReturnedObjects: Unable to create detached-clean instance" + " from a persistent-clean instance via detachCopy," + " state is " + states[curr]); } return null; } return obj; } /** */ public StateTransitionObj getDetachedDirtyInstance() { StateTransitionObj obj = getHollowInstance(); if( obj == null ) return null; obj = (StateTransitionObj) pm.detachCopy(obj); obj.writeField(1000); int curr = currentState(obj); if( curr != DETACHED_DIRTY ) { if (debug) { logger.debug("StateTransitionsReturnedObjects: Unable to create detached-dirty instance" + " from a persistent-clean instance via detachCopy/persistent field modification," + " state is " + states[curr]); } return null; } return obj; } } tck/src/java/org/apache/jdo/tck/lifecycle/TransientTransactionalStateCommit.java100664 7661 12500110374 30406 0ustarmbouschenstaff 0 0 /* * 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.lifecycle; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.lifecycle.StateTransitionObj; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Test Transient Transactional Commit *
*Keywords: lifecycle transienttransactional commit *
*Assertion IDs: A5.1-3 *
*Assertion Description: If TransientTransactional is supported, a transient transactional instance will have its state preserved when its associated transaction commits. */ public class TransientTransactionalStateCommit extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A5.1-3 (TransientTransactionalStateCommit) failed: "; private static final int CLEAN_VALUE = 12; private static final int DIRTY_VALUE = 123; /** * The main 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(TransientTransactionalStateCommit.class); } /** */ public void test() { if (!isTransientTransactionalSupported()) { logger.debug("Transient transactional instances are not supported"); } else { pm = getPM(); StateTransitionObj obj = getTransientInstance(); pm.currentTransaction().begin(); makeTransientDirty(obj); int beforeValue=obj.readField(); pm.currentTransaction().commit(); int afterValue=obj.readField(); if (beforeValue!=afterValue) { fail(ASSERTION_FAILED, "Field value incorrect after commit. Expected: " + beforeValue + " Found: " + afterValue); } } } protected StateTransitionObj getTransientInstance() { StateTransitionObj obj = new StateTransitionObj(CLEAN_VALUE); int curr = currentState(obj); if( curr != TRANSIENT ){ fail(ASSERTION_FAILED, "Unable to create transient instance, state is " + states[curr]); } return obj; } protected void makeTransientClean(StateTransitionObj obj) { if( obj == null ) return; pm.makeTransactional(obj); int curr = currentState(obj); if( curr != TRANSIENT_CLEAN ){ fail(ASSERTION_FAILED, "Unable to create transient-clean instance " + "from a transient instance via makeTransactional(), state is " + states[curr]); } } protected void makeTransientDirty(StateTransitionObj obj) { if( obj == null ) return; makeTransientClean(obj); obj.writeField(DIRTY_VALUE); int curr = currentState(obj); if( curr != TRANSIENT_DIRTY ){ fail(ASSERTION_FAILED, "Unable to create transient-dirty instance " + "from a transient-clean instance via modifying a field, state is " + states[curr]); } } } tck/src/java/org/apache/jdo/tck/lifecycle/TransientTransactionalStateRollback.java100664 11001 12500110374 30706 0ustarmbouschenstaff 0 0 /* * 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.lifecycle; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.lifecycle.StateTransitionObj; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Test Transient Transactional Rollback *
*Keywords: lifecycle transienttransactional rollback *
*Assertion IDs: A5.1-4 *Assertion Description: If TransientTransactional is supported, a transient transactional instance will have its state restored to its state prior to becoming transactional when its associated transaction aborts or on rollback. */ public class TransientTransactionalStateRollback extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A5.1-4 (TransientTransactionalStateRollback) failed: "; private static final int CLEAN_VALUE = 12; private static final int DIRTY_VALUE = 123; /** * The main 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(TransientTransactionalStateRollback.class); } /** */ public void test() { if (!isTransientTransactionalSupported()) { logger.debug("Transient transactional instances are not supported"); } else { pm = getPM(); // Get transient instance and read field value StateTransitionObj obj = getTransientInstance(); int beforeValue=obj.readField(); // Start transaction Transaction tx = pm.currentTransaction(); tx.begin(); // Get transient dirty instance makeTransientDirty(obj); // Rollback tx.rollback(); int curr = currentState(obj); if( curr != TRANSIENT_CLEAN ){ fail(ASSERTION_FAILED, "StateTransition: Unable to create transient-clean instance " + "from a transient-dirty instance via tx.rollback(), state is " + states[curr]); } // Check that field value has been rolled back int afterValue=obj.readField(); if (beforeValue!=afterValue) { fail(ASSERTION_FAILED, "Field value incorrect after rollback. Expected: "+beforeValue+" Found: "+afterValue); } } } protected StateTransitionObj getTransientInstance() { StateTransitionObj obj = new StateTransitionObj(CLEAN_VALUE); int curr = currentState(obj); if( curr != TRANSIENT ){ fail(ASSERTION_FAILED, "Unable to create transient instance, state is " + states[curr]); } return obj; } protected void makeTransientClean(StateTransitionObj obj) { if( obj == null ) return; pm.makeTransactional(obj); int curr = currentState(obj); if( curr != TRANSIENT_CLEAN ){ fail(ASSERTION_FAILED, "Unable to create transient-clean instance " + "from a transient instance via makeTransactional(), state is " + states[curr]); } } protected void makeTransientDirty(StateTransitionObj obj) { if( obj == null ) return; makeTransientClean(obj); obj.writeField(DIRTY_VALUE); int curr = currentState(obj); if( curr != TRANSIENT_DIRTY ){ fail(ASSERTION_FAILED, "Unable to create transient-dirty instance " + "from a transient-clean instance via modifying a field, state is " + states[curr]); } } } tck/src/java/org/apache/jdo/tck/mapping/AbstractRelationshipTest.java100664 7112 12500110374 26212 0ustarmbouschenstaff 0 0 /* * 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.mapping; import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import java.util.List; import org.apache.jdo.tck.AbstractReaderTest; import org.apache.jdo.tck.pc.company.CompanyFactoryRegistry; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.pc.company.Project; /* * Abstract class for managed relationship tests */ public class AbstractRelationshipTest extends AbstractReaderTest { protected CompanyModelReader reader = null; /** */ protected final boolean isTestToBePerformed = isTestToBePerformed(); /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { if (isTestToBePerformed()) { getPM(); CompanyFactoryRegistry.registerFactory(pm); reader = new CompanyModelReader(inputFilename); addTearDownClass(reader.getTearDownClassesFromFactory()); // persist test data pm.currentTransaction().begin(); List rootList = getRootList(reader); pm.makePersistentAll(rootList); rootOids = new ArrayList(); for (Iterator i = rootList.iterator(); i.hasNext(); ) { Object pc = i.next(); rootOids.add(pm.getObjectId(pc)); } // DO THIS // in xmlBeanFactory String[] getBeanDefinitionNames() oidMap.put("emp1", pm.getObjectId(reader.getEmployee("emp1"))); oidMap.put("emp2", pm.getObjectId(reader.getEmployee("emp2"))); oidMap.put("emp4", pm.getObjectId(reader.getEmployee("emp4"))); oidMap.put("medicalIns1", pm.getObjectId(reader.getMedicalInsurance("medicalIns1"))); oidMap.put("medicalIns2", pm.getObjectId(reader.getMedicalInsurance("medicalIns2"))); oidMap.put("dept1", pm.getObjectId(reader.getDepartment("dept1"))); oidMap.put("dept2", pm.getObjectId(reader.getDepartment("dept2"))); oidMap.put("proj1", pm.getObjectId(reader.getProject("proj1"))); oidMap.put("proj2", pm.getObjectId(reader.getProject("proj2"))); pm.currentTransaction().commit(); cleanupPM(); } } protected boolean containsEmployee(Collection employees, long empid) { for (Employee emp: employees) { if (emp.getPersonid() == empid) { return true; } } return false; } protected boolean containsProject(Collection projects, long projid) { for (Project project: projects) { if (project.getProjid() == projid) { return true; } } return false; } } tck/src/java/org/apache/jdo/tck/mapping/CompletenessTest.java100664 10634 12500110374 24551 0ustarmbouschenstaff 0 0 /* * 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.mapping; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.apache.jdo.tck.AbstractReaderTest; import org.apache.jdo.tck.pc.company.CompanyFactoryRegistry; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; //import org.springframework.beans.factory.xml.XmlBeanFactory; /** *Title:Completeness Test *
*Keywords: mapping *
*Assertion ID: A18.[not identified] *
*Assertion Description: */ public class CompletenessTest extends AbstractReaderTest { /** */ private static final String ASSERTION_FAILED = "Assertion A18-[not identified] failed: "; /** * The main 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(CompletenessTest.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { if (isTestToBePerformed()) { getPM(); CompanyFactoryRegistry.registerFactory(pm); CompanyModelReader reader = new CompanyModelReader(inputFilename); addTearDownClass(reader.getTearDownClassesFromFactory()); // persist test data pm.currentTransaction().begin(); List rootList = getRootList(reader); pm.makePersistentAll(rootList); rootOids = new ArrayList(); for (Iterator i = rootList.iterator(); i.hasNext(); ) { Object pc = i.next(); rootOids.add(pm.getObjectId(pc)); } pm.currentTransaction().commit(); cleanupPM(); } } /** */ public void test() { if (isTestToBePerformed()) { // register the default factory CompanyFactoryRegistry.registerFactory(); // get new obj graph to compare persistent graph with CompanyModelReader reader = new CompanyModelReader(inputFilename); List rootList = getRootList(reader); getPM(); pm.currentTransaction().begin(); // compare persisted and new int size = rootList.size(); StringBuffer msg = new StringBuffer(); for (int i = 0; i < size; i++) { DeepEquality expected = (DeepEquality) rootList.get(i); Object oid = rootOids.get(i); Object persisted = pm.getObjectById(oid); EqualityHelper equalityHelper = new EqualityHelper(); if (!expected.deepCompareFields(persisted, equalityHelper)) { if (msg.length() > 0) { msg.append("\n"); } msg.append("Expected this instance:\n " + expected + "\n" + "Got persistent instance:" + "\n " + persisted + "\n" + "Detailed list of differences follows...\n"); msg.append(equalityHelper.getUnequalBuffer()); } } pm.currentTransaction().commit(); // fail test if at least one of the instances is not the expected one if (msg.length() > 0) { fail("CompletenessTest failed; see list of failures below:", msg.toString()); } } } } tck/src/java/org/apache/jdo/tck/mapping/CompletenessTestJPA.java100664 11015 12500110374 25076 0ustarmbouschenstaff 0 0 /* * 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.mapping; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.apache.jdo.tck.AbstractReaderTest; import org.apache.jdo.tck.pc.company.CompanyFactoryRegistry; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; //import org.springframework.beans.factory.xml.XmlBeanFactory; /** *Title:Completeness Test JPA *
*Keywords: mapping *
*Assertion ID: A18.[not identified] *
*Assertion Description: */ public class CompletenessTestJPA extends AbstractReaderTest { /** */ private static final String ASSERTION_FAILED = "Assertion A18-[not identified] failed: "; /** */ private final boolean isTestToBePerformed = isTestToBePerformed(); /** * The main 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(CompletenessTestJPA.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { if (runsWithApplicationIdentity()) { getPM(); CompanyFactoryRegistry.registerFactory(pm); CompanyModelReader reader = new CompanyModelReader(inputFilename); addTearDownClass(reader.getTearDownClassesFromFactory()); // persist test data pm.currentTransaction().begin(); List rootList = getRootList(reader); pm.makePersistentAll(rootList); rootOids = new ArrayList(); for (Iterator i = rootList.iterator(); i.hasNext(); ) { Object pc = i.next(); rootOids.add(pm.getObjectId(pc)); } pm.currentTransaction().commit(); cleanupPM(); } } /** */ public void test() { if (runsWithApplicationIdentity()) { // register the default factory CompanyFactoryRegistry.registerFactory(); // get new obj graph to compare persistent graph with CompanyModelReader reader = new CompanyModelReader(inputFilename); List rootList = getRootList(reader); getPM(); pm.currentTransaction().begin(); // compare persisted and new int size = rootList.size(); StringBuffer msg = new StringBuffer(); for (int i = 0; i < size; i++) { DeepEquality expected = (DeepEquality) rootList.get(i); Object oid = rootOids.get(i); Object persisted = pm.getObjectById(oid); EqualityHelper equalityHelper = new EqualityHelper(); if (!expected.deepCompareFields(persisted, equalityHelper)) { if (msg.length() > 0) { msg.append("\n"); } msg.append("Expected this instance:\n " + expected + "\n" + "Got persistent instance:" + "\n " + persisted + "\n" + "Detailed list of differences follows...\n"); msg.append(equalityHelper.getUnequalBuffer()); } } pm.currentTransaction().commit(); // fail test if at least one of the instances is not the expected one if (msg.length() > 0) { fail("CompletenessTest failed; see list of failures below:", msg.toString()); } } } } tck/src/java/org/apache/jdo/tck/mapping/CompletenessTestList.java100664 11036 12500110374 25402 0ustarmbouschenstaff 0 0 /* * 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.mapping; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.apache.jdo.tck.AbstractReaderTest; import org.apache.jdo.tck.pc.companyListWithoutJoin.CompanyFactoryRegistry; import org.apache.jdo.tck.pc.companyListWithoutJoin.CompanyModelReader; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; //import org.springframework.beans.factory.xml.XmlBeanFactory; /** *Title:Completeness Test List *
*Keywords: mapping *
*Assertion ID: A18.[not identified] *
*Assertion Description: */ public class CompletenessTestList extends AbstractReaderTest { /** */ private static final String ASSERTION_FAILED = "Assertion A18-[not identified] failed: "; /** */ private final boolean isTestToBePerformed = isTestToBePerformed(); /** * The main 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(CompletenessTestList.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { if (isTestToBePerformed) { getPM(); CompanyFactoryRegistry.registerFactory(pm); CompanyModelReader reader = new CompanyModelReader(inputFilename); addTearDownClass(reader.getTearDownClassesFromFactory()); // persist test data pm.currentTransaction().begin(); List rootList = getRootList(reader); pm.makePersistentAll(rootList); rootOids = new ArrayList(); for (Iterator i = rootList.iterator(); i.hasNext(); ) { Object pc = i.next(); rootOids.add(pm.getObjectId(pc)); } pm.currentTransaction().commit(); cleanupPM(); } } /** */ public void test() { if (isTestToBePerformed) { // register the default factory CompanyFactoryRegistry.registerFactory(); // get new obj graph to compare persistent graph with CompanyModelReader reader = new CompanyModelReader(inputFilename); List rootList = getRootList(reader); getPM(); pm.currentTransaction().begin(); // compare persisted and new int size = rootList.size(); StringBuffer msg = new StringBuffer(); for (int i = 0; i < size; i++) { DeepEquality expected = (DeepEquality) rootList.get(i); Object oid = rootOids.get(i); Object persisted = pm.getObjectById(oid); EqualityHelper equalityHelper = new EqualityHelper(); if (!expected.deepCompareFields(persisted, equalityHelper)) { if (msg.length() > 0) { msg.append("\n"); } msg.append("Expected this instance:\n " + expected + "\n" + "Got persistent instance:" + "\n " + persisted + "\n" + "Detailed list of differences follows...\n"); msg.append(equalityHelper.getUnequalBuffer()); } } pm.currentTransaction().commit(); // fail test if at least one of the instances is not the expected one if (msg.length() > 0) { fail("CompletenessTestList failed; see list of failures below:", msg.toString()); } } } } tck/src/java/org/apache/jdo/tck/mapping/CompletenessTestMap.java100664 11030 12500110374 25176 0ustarmbouschenstaff 0 0 /* * 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.mapping; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.apache.jdo.tck.AbstractReaderTest; import org.apache.jdo.tck.pc.companyMapWithoutJoin.CompanyFactoryRegistry; import org.apache.jdo.tck.pc.companyMapWithoutJoin.CompanyModelReader; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; //import org.springframework.beans.factory.xml.XmlBeanFactory; /** *Title:Completeness Test Map *
*Keywords: mapping *
*Assertion ID: A18.[not identified] *
*Assertion Description: */ public class CompletenessTestMap extends AbstractReaderTest { /** */ private static final String ASSERTION_FAILED = "Assertion A18-[not identified] failed: "; /** */ private final boolean isTestToBePerformed = isTestToBePerformed(); /** * The main 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(CompletenessTestMap.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { if (isTestToBePerformed) { getPM(); CompanyFactoryRegistry.registerFactory(pm); CompanyModelReader reader = new CompanyModelReader(inputFilename); addTearDownClass(reader.getTearDownClassesFromFactory()); // persist test data pm.currentTransaction().begin(); List rootList = getRootList(reader); pm.makePersistentAll(rootList); rootOids = new ArrayList(); for (Iterator i = rootList.iterator(); i.hasNext(); ) { Object pc = i.next(); rootOids.add(pm.getObjectId(pc)); } pm.currentTransaction().commit(); cleanupPM(); } } /** */ public void test() { if (isTestToBePerformed) { // register the default factory CompanyFactoryRegistry.registerFactory(); // get new obj graph to compare persistent graph with CompanyModelReader reader = new CompanyModelReader(inputFilename); List rootList = getRootList(reader); getPM(); pm.currentTransaction().begin(); // compare persisted and new int size = rootList.size(); StringBuffer msg = new StringBuffer(); for (int i = 0; i < size; i++) { DeepEquality expected = (DeepEquality) rootList.get(i); Object oid = rootOids.get(i); Object persisted = pm.getObjectById(oid); EqualityHelper equalityHelper = new EqualityHelper(); if (!expected.deepCompareFields(persisted, equalityHelper)) { if (msg.length() > 0) { msg.append("\n"); } msg.append("Expected this instance:\n " + expected + "\n" + "Got persistent instance:" + "\n " + persisted + "\n" + "Detailed list of differences follows...\n"); msg.append(equalityHelper.getUnequalBuffer()); } } pm.currentTransaction().commit(); // fail test if at least one of the instances is not the expected one if (msg.length() > 0) { fail("CompletenessTestMap failed; see list of failures below:", msg.toString()); } } } } tck/src/java/org/apache/jdo/tck/mapping/CompletenessTestOrder.java100664 11564 12500110374 25550 0ustarmbouschenstaff 0 0 /* * 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.mapping; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.apache.jdo.tck.AbstractReaderTest; import org.apache.jdo.tck.pc.order.OrderFactoryRegistry; import org.apache.jdo.tck.pc.order.OrderModelReader; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** *Title:Completeness Test for the Order model *
*Keywords: mapping compound identity *
*Assertion ID: A5.4.1-5 *
*Assertion Description: Compound identity is a special case of application identity. References to other persistence-capable classes can be defined as key fields. In this case, the object id class contains a field that is of the type of the object id of the relationship field. */ public class CompletenessTestOrder extends AbstractReaderTest { /** */ private static final String ASSERTION_FAILED = "Assertion A5.4.1-5[Compound identity is a special case of application identity. References to other persistence-capable classes can be defined as key fields. In this case, the object id class contains a field that is of the type of the object id of the relationship field.] failed: "; /** * The main 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(CompletenessTestOrder.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { if (runsWithApplicationIdentity()) { getPM(); OrderFactoryRegistry.registerFactory(pm); OrderModelReader reader = new OrderModelReader(inputFilename); addTearDownClass(reader.getTearDownClassesFromFactory()); // persist test data pm.currentTransaction().begin(); List rootList = getRootList(reader); pm.makePersistentAll(rootList); rootOids = new ArrayList(); for (Iterator i = rootList.iterator(); i.hasNext(); ) { Object pc = i.next(); rootOids.add(pm.getObjectId(pc)); } pm.currentTransaction().commit(); cleanupPM(); } } /** */ public void test() { if (runsWithApplicationIdentity()) { // register the default factory OrderFactoryRegistry.registerFactory(); // get new obj graph to compare persistent graph with OrderModelReader reader = new OrderModelReader(inputFilename); List rootList = getRootList(reader); getPM(); pm.currentTransaction().begin(); // compare persisted and new int size = rootList.size(); StringBuffer msg = new StringBuffer(); for (int i = 0; i < size; i++) { DeepEquality expected = (DeepEquality) rootList.get(i); Object oid = rootOids.get(i); Object persisted = pm.getObjectById(oid); EqualityHelper equalityHelper = new EqualityHelper(); if (!expected.deepCompareFields(persisted, equalityHelper)) { if (msg.length() > 0) { msg.append("\n"); } msg.append("Expected this instance:\n " + expected + "\n" + "Got persistent instance:" + "\n " + persisted + "\n" + "Detailed list of differences follows...\n"); msg.append(equalityHelper.getUnequalBuffer()); } } pm.currentTransaction().commit(); //fail test if at least one of the instances is not the expected one if (msg.length() > 0) { fail("CompletenessTestOrder failed; see list of failures below:", msg.toString()); } } } } tck/src/java/org/apache/jdo/tck/mapping/Relationship1To1AllRelationships.java100664 41012 12500110374 27546 0ustarmbouschenstaff 0 0 /* * 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.mapping; import java.util.Date; import org.apache.jdo.tck.pc.company.FullTimeEmployee; import org.apache.jdo.tck.pc.company.IEmployee; import org.apache.jdo.tck.pc.company.IMedicalInsurance; import org.apache.jdo.tck.pc.company.MedicalInsurance; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title:Relationship1To1AllRelationships *
*Keywords: mapping, managed relationships *
*Assertion ID: A15.3-14 *
*Assertion Description: Regardless of which side changes the relationship, * flush (whether done as part of commit or explicitly by the user) will modify * the datastore to reflect the change and will update the memory model * for consistency... */ public class Relationship1To1AllRelationships extends AbstractRelationshipTest { String testMethod = null; protected String ASSERTION_FAILED = "Assertion A15-3.14 (Relationship1To1AllRelationships) failed: "; /** * The main 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(Relationship1To1AllRelationships.class); } Object emp1Oid = null; Object emp2Oid = null; Object medIns1Oid = null; Object medIns2Oid = null; IEmployee emp1 = null; IEmployee emp2 = null; IMedicalInsurance medIns1 = null; IMedicalInsurance medIns2 = null; /** * @see AbstractRelationshipTest#localSetUp() */ protected void localSetUp() { super.localSetUp(); if (isTestToBePerformed) { getPM(); pm.currentTransaction().begin(); emp1Oid = getOidByName("emp1"); emp2Oid = getOidByName("emp2"); medIns1Oid = getOidByName("medicalIns1"); medIns2Oid = getOidByName("medicalIns2"); emp1 = (IEmployee)pm.getObjectById(emp1Oid); emp2 = (IEmployee)pm.getObjectById(emp2Oid); medIns1 = (IMedicalInsurance)pm.getObjectById(medIns1Oid); medIns2 = (IMedicalInsurance)pm.getObjectById(medIns2Oid); // Preconditions assertTrue(ASSERTION_FAILED + testMethod + ": Test aborted, precondition is false; " + "expected emp.getMedicalInsurance()to be medicalIns1", emp1.getMedicalInsurance() == medIns1); assertTrue(ASSERTION_FAILED + testMethod + ": Test aborted, precondition is false; " + "expected ins.getEmployee() to be emp1", medIns1.getEmployee() == emp1); assertTrue(ASSERTION_FAILED + testMethod + ": Test aborted, precondition is false; " + "expected emp.getMedicalInsurance()to be medicalIns1", emp2.getMedicalInsurance() == medIns2); assertTrue(ASSERTION_FAILED + testMethod + ": Test aborted, precondition is false; " + "expected ins.getEmployee() to be emp1", medIns2.getEmployee() == emp2); } } /** */ public void testSetToExistingFromMappedSide() { testMethod = "testSetToExistingFromMappedSide"; if (isTestToBePerformed) { // Set relationship medIns1.setEmployee(emp2); pm.flush(); // Postcondition deferredAssertTrue(emp2.getMedicalInsurance() == medIns1, ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set on flush"); deferredAssertTrue(emp1.getMedicalInsurance() == null, ASSERTION_FAILED + testMethod, "Postcondition is false; " + "previous relationship (emp1) not nulled on flush"); deferredAssertTrue(medIns2.getEmployee() == null, ASSERTION_FAILED + testMethod, "Postcondition is false; " + "previous relationship (medIns2) not nulled on flush"); pm.currentTransaction().commit(); cleanupPM(); getPM(); pm.currentTransaction().begin(); emp1 = (IEmployee)pm.getObjectById(emp1Oid); emp2 = (IEmployee)pm.getObjectById(emp2Oid); medIns1 = (IMedicalInsurance)pm.getObjectById(medIns1Oid); medIns2 = (IMedicalInsurance)pm.getObjectById(medIns2Oid); deferredAssertTrue(emp2.getMedicalInsurance() == medIns1, ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set in new pm"); deferredAssertTrue(emp1.getMedicalInsurance() == null, ASSERTION_FAILED + testMethod, "Postcondition is false; " + "previous relationship (emp1) not nulled in new pm"); deferredAssertTrue(medIns2.getEmployee() == null, ASSERTION_FAILED + testMethod, "Postcondition is false; " + "previous relationship (medIns2) not nulled in new pm"); pm.currentTransaction().commit(); failOnError(); } } /** */ public void testSetToExistingFromMappedBySide() { testMethod = "testSetToExistingFromMappedBySide"; if (isTestToBePerformed) { // Set relationship emp1.setMedicalInsurance(medIns2); pm.flush(); // Postcondition deferredAssertTrue(medIns2.getEmployee() == emp1, ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set on flush."); deferredAssertTrue(medIns1.getEmployee() == null, ASSERTION_FAILED + testMethod, "Postcondition is false; " + "previous relationship (medIns1) not nulled on flush."); deferredAssertTrue(emp2.getMedicalInsurance() == null, ASSERTION_FAILED + testMethod, "Postcondition is false; " + "previous relationship (emp2) not nulled on flush"); pm.currentTransaction().commit(); cleanupPM(); getPM(); pm.currentTransaction().begin(); emp1 = (IEmployee)pm.getObjectById(emp1Oid); emp2 = (IEmployee)pm.getObjectById(emp2Oid); medIns1 = (IMedicalInsurance)pm.getObjectById(medIns1Oid); medIns2 = (IMedicalInsurance)pm.getObjectById(medIns2Oid); deferredAssertTrue(medIns2.getEmployee() == emp1, ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set in new pm."); deferredAssertTrue(medIns1.getEmployee() == null, ASSERTION_FAILED + testMethod, "Postcondition is false; " + "previous relationship (medIns1) not nulled in new pm."); deferredAssertTrue(emp2.getMedicalInsurance() == null, ASSERTION_FAILED + testMethod, "Postcondition is false; " + "previous relationship (emp2) not nulled in new pm."); pm.currentTransaction().commit(); failOnError(); } } /** */ public void testSetToNullFromMappedSide() { testMethod = "testSetToNullFromMappedSide"; if (isTestToBePerformed) { // Set relationship medIns1.setEmployee(null); pm.flush(); // Postcondition deferredAssertTrue(emp1.getMedicalInsurance() == null, ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set on flush"); pm.currentTransaction().commit(); cleanupPM(); getPM(); pm.currentTransaction().begin(); emp1 = (IEmployee)pm.getObjectById(emp1Oid); deferredAssertTrue( emp1.getMedicalInsurance() == null, ASSERTION_FAILED + testMethod, "In new transaction, postcondition is false; " + "other side of relationship is not set."); pm.currentTransaction().commit(); failOnError(); } } /** */ public void testSetToNullFromMappedBySide() { testMethod = "testSetToNullFromMappedBySide"; if (isTestToBePerformed) { // Set relationship emp1.setMedicalInsurance(null); pm.flush(); // Postcondition deferredAssertTrue(medIns1.getEmployee() == null, ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set on flush"); pm.currentTransaction().commit(); cleanupPM(); getPM(); pm.currentTransaction().begin(); //emp1 = (IEmployee)pm.getObjectById(emp1Oid); medIns1 = (IMedicalInsurance)pm.getObjectById(medIns1Oid); deferredAssertTrue( medIns1.getEmployee() == null, ASSERTION_FAILED + testMethod, "In new transaction, postcondition is false; " + "other side of relationship is not set."); pm.currentTransaction().commit(); failOnError(); } } /** */ public void testSetToNewFromMappedSide() { testMethod = "testSetToNewFromMappedSide"; if (isTestToBePerformed) { // Set relationship IEmployee empNew = new FullTimeEmployee(99, "Matthew", "", "Adams", new Date(0L), new Date(10000L), 125000); pm.makePersistent(empNew); medIns1.setEmployee(empNew); Object empNewOid = pm.getObjectId((Object)empNew); pm.flush(); assertFalse(testMethod + ": Test aborted, precondition is false; " + "expected empNewOid to be non-null", empNewOid == null); // Postcondition deferredAssertTrue(empNew.getMedicalInsurance() == medIns1, ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set on flush"); deferredAssertTrue(emp1.getMedicalInsurance() == null, ASSERTION_FAILED + testMethod, "Postcondition is false; " + "previous relationship (emp1) not nulled on flush"); pm.currentTransaction().commit(); cleanupPM(); getPM(); pm.currentTransaction().begin(); emp1 = (IEmployee)pm.getObjectById(emp1Oid); empNew = (IEmployee)pm.getObjectById(empNewOid); medIns1 = (IMedicalInsurance)pm.getObjectById(medIns1Oid); deferredAssertTrue(empNew.getMedicalInsurance() == medIns1, ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set in new pm"); deferredAssertTrue(emp1.getMedicalInsurance() == null, ASSERTION_FAILED + testMethod, "Postcondition is false; " + "previous relationship (emp1) not nulled in new pm"); pm.currentTransaction().commit(); failOnError(); } } /** */ public void testSetToNewFromMappedBySide() { testMethod = "testSetToNewFromMappedBySide"; if (isTestToBePerformed) { // Set relationship IMedicalInsurance medInsNew = new MedicalInsurance(99L, "Ameriblast", "B"); pm.makePersistent(medInsNew); emp1.setMedicalInsurance(medInsNew); Object medInsNewOid = pm.getObjectId((Object)medInsNew); pm.flush(); assertFalse(testMethod + ": Test aborted, precondition is false; " + "expected medInsNewOid to be non-null", medInsNewOid == null); // Postcondition deferredAssertTrue(medInsNew.getEmployee() == emp1, ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set on flush."); deferredAssertTrue(medIns1.getEmployee() == null, ASSERTION_FAILED + testMethod, "Postcondition is false; " + "previous relationship (medIns1) not nulled on flush."); pm.currentTransaction().commit(); cleanupPM(); getPM(); pm.currentTransaction().begin(); emp1 = (IEmployee)pm.getObjectById(emp1Oid); medInsNew = (IMedicalInsurance)pm.getObjectById(medInsNewOid); medIns1 = (IMedicalInsurance)pm.getObjectById(medIns1Oid); deferredAssertTrue(medInsNew.getEmployee() == emp1, ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set in new pm"); deferredAssertTrue(medIns1.getEmployee() == null, ASSERTION_FAILED + testMethod, "Postcondition is false; " + "previous relationship (medIns1) not nulled in new pm"); pm.currentTransaction().commit(); failOnError(); } } /** */ public void testDeleteFromMappedSide() { testMethod = "testDeleteFromMappedSide"; if (isTestToBePerformed) { // Set relationship pm.deletePersistent(medIns1); pm.flush(); // Postcondition deferredAssertTrue(emp1.getMedicalInsurance() == null, ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set on flush"); pm.currentTransaction().commit(); cleanupPM(); getPM(); pm.currentTransaction().begin(); emp1 = (IEmployee)pm.getObjectById(emp1Oid); deferredAssertTrue( emp1.getMedicalInsurance() == null, ASSERTION_FAILED + testMethod, "In new transaction, postcondition is false; " + "other side of relationship is not set."); pm.currentTransaction().commit(); failOnError(); } } /** */ public void testDeleteFromMappedBySide() { testMethod = "testDeleteFromMappedBySide"; if (isTestToBePerformed) { // Set relationship pm.deletePersistent(emp1); pm.flush(); // Postcondition deferredAssertTrue(medIns1.getEmployee() == null, ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set on flush"); pm.currentTransaction().commit(); cleanupPM(); getPM(); pm.currentTransaction().begin(); medIns1 = (IMedicalInsurance)pm.getObjectById(medIns1Oid); deferredAssertTrue( medIns1.getEmployee() == null, ASSERTION_FAILED + testMethod, "In new transaction, postcondition is false; " + "other side of relationship is not set."); pm.currentTransaction().commit(); failOnError(); } } } tck/src/java/org/apache/jdo/tck/mapping/Relationship1To1NoRelationships.java100664 20364 12500110374 27421 0ustarmbouschenstaff 0 0 /* * 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.mapping; import java.util.Date; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.pc.company.FullTimeEmployee; import org.apache.jdo.tck.pc.company.MedicalInsurance; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title:Relationship1To1NoRelationships *
*Keywords: mapping, managed relationships *
*Assertion ID: A15.3-14 *
*Assertion Description: Regardless of which side changes the relationship, * flush (whether done as part of commit or explicitly by the user) will modify * the datastore to reflect the change and will update the memory model * for consistency... */ public class Relationship1To1NoRelationships extends AbstractRelationshipTest { String testMethod = null; protected String ASSERTION_FAILED = "Assertion A15-3.14 (Relationship1To1NoRelationships) failed: "; Object emp1Oid = null; Object emp2Oid = null; Object medIns1Oid = null; Object medIns2Oid = null; Employee emp1 = null; Employee emp2 = null; MedicalInsurance medIns1 = null; MedicalInsurance medIns2 = null; /** * The main 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(Relationship1To1NoRelationships.class); } /** * @see AbstractRelationshipTest#localSetUp() */ protected void localSetUp() { super.localSetUp(); if (isTestToBePerformed) { getPM(); pm.currentTransaction().begin(); emp1Oid = getOidByName("emp1"); medIns1Oid = getOidByName("medicalIns1"); emp1 = (Employee)pm.getObjectById(emp1Oid); medIns1 = (MedicalInsurance)pm.getObjectById(medIns1Oid); // Preconditions assertTrue(ASSERTION_FAILED + ": Test aborted, precondition is false; " + "expected emp.getMedicalInsurance()to be null", emp1.getMedicalInsurance() == null); assertTrue(ASSERTION_FAILED + ": Test aborted, precondition is false; " + "expected ins.getEmployee() to be null", medIns1.getEmployee() == null); } } /** */ public void testSetToExistingFromMappedSide() { testMethod = "testSetToExistingFromMappedSide"; if (isTestToBePerformed) { // Set relationship medIns1.setEmployee(emp1); pm.flush(); // Postcondition deferredAssertTrue(emp1.getMedicalInsurance() == medIns1, ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set on flush"); pm.currentTransaction().commit(); cleanupPM(); getPM(); pm.currentTransaction().begin(); emp1 = (Employee)pm.getObjectById(emp1Oid); medIns1 = (MedicalInsurance)pm.getObjectById(medIns1Oid); deferredAssertTrue( emp1.getMedicalInsurance() == medIns1, ASSERTION_FAILED + testMethod, "In new transaction, postcondition is false; " + "other side of relationship is not set."); pm.currentTransaction().commit(); failOnError(); } } /** */ public void testSetToExistingFromMappedBySide() { testMethod = "testSetToExistingFromMappedBySide"; if (isTestToBePerformed) { // Set relationship emp1.setMedicalInsurance(medIns1); pm.flush(); // Postcondition deferredAssertTrue(medIns1.getEmployee() == emp1, ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set on flush"); pm.currentTransaction().commit(); cleanupPM(); getPM(); pm.currentTransaction().begin(); emp1 = (Employee)pm.getObjectById(emp1Oid); medIns1 = (MedicalInsurance)pm.getObjectById(medIns1Oid); deferredAssertTrue( medIns1.getEmployee() == emp1, ASSERTION_FAILED + testMethod, "In new transaction, postcondition is false; " + "other side of relationship is not set."); pm.currentTransaction().commit(); failOnError(); } } /** */ public void testSetToNewFromMappedSide() { testMethod = "testSetToNewFromMappedSide"; if (isTestToBePerformed) { // Set relationship Employee empNew = new FullTimeEmployee(99, "Matthew", "", "Adams", new Date(0L), new Date(10000L), 125000); pm.makePersistent(empNew); medIns1.setEmployee(empNew); Object empNewOid = pm.getObjectId((Object)empNew); pm.flush(); // Postcondition deferredAssertTrue(empNew.getMedicalInsurance() == medIns1, ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set on flush"); pm.currentTransaction().commit(); cleanupPM(); getPM(); pm.currentTransaction().begin(); emp1 = (Employee)pm.getObjectById(emp1Oid); empNew = (Employee)pm.getObjectById(empNewOid); medIns1 = (MedicalInsurance)pm.getObjectById(medIns1Oid); deferredAssertTrue(empNew.getMedicalInsurance() == medIns1, ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set in new pm"); pm.currentTransaction().commit(); failOnError(); } } /** */ public void testSetToNewFromMappedBySide() { testMethod = "testSetToNewFromMappedBySide"; if (isTestToBePerformed) { // Set relationship MedicalInsurance medInsNew = new MedicalInsurance(99L, "Ameriblast", "B"); pm.makePersistent(medInsNew); emp1.setMedicalInsurance(medInsNew); Object medInsNewOid = pm.getObjectId((Object)medInsNew); pm.flush(); // Postcondition deferredAssertTrue(medInsNew.getEmployee() == emp1, ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set on flush."); pm.currentTransaction().commit(); cleanupPM(); getPM(); pm.currentTransaction().begin(); emp1 = (Employee)pm.getObjectById(emp1Oid); medInsNew = (MedicalInsurance)pm.getObjectById(medInsNewOid); medIns1 = (MedicalInsurance)pm.getObjectById(medIns1Oid); deferredAssertTrue(medInsNew.getEmployee() == emp1, ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set in new pm"); pm.currentTransaction().commit(); failOnError(); } } } tck/src/java/org/apache/jdo/tck/mapping/Relationship1ToManyAllRelationships.java100664 42723 12500110374 30324 0ustarmbouschenstaff 0 0 /* * 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.mapping; import java.util.Date; import java.util.HashSet; import java.util.Iterator; import java.util.Set; import javax.jdo.JDOHelper; import org.apache.jdo.tck.pc.company.Department; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.pc.company.FullTimeEmployee; import org.apache.jdo.tck.pc.company.IDepartment; import org.apache.jdo.tck.pc.company.IEmployee; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title:Relationship1ToManyAllRelationships *
*Keywords: mapping, managed relationships *
*Assertion ID: A15.3-14 *
*Assertion Description: Regardless of which side changes the relationship, * flush (whether done as part of commit or explicitly by the user) will modify * the datastore to reflect the change and will update the memory model * for consistency... */ public class Relationship1ToManyAllRelationships extends AbstractRelationshipTest { String testMethod = null; protected String ASSERTION_FAILED = "Assertion A15-3.14 (Relationship1ToManyAllRelationships) failed: "; Object emp1Oid = null; Object dept1Oid = null; Object dept2Oid = null; Employee emp1 = null; Department dept1 = null; Department dept2 = null; /** * The main 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(Relationship1ToManyAllRelationships.class); } /** * @see AbstractRelationshipTest#localSetUp() */ protected void localSetUp() { super.localSetUp(); if (isTestToBePerformed) { getPM(); pm.currentTransaction().begin(); emp1Oid = getOidByName("emp1"); dept1Oid = getOidByName("dept1"); dept2Oid = getOidByName("dept2"); emp1 = (Employee)pm.getObjectById(emp1Oid); dept1 = (Department)pm.getObjectById(dept1Oid); dept2 = (Department)pm.getObjectById(dept2Oid); // Preconditions assertTrue(ASSERTION_FAILED + ": Test aborted, precondition is false; " + "expected emp.getDepartment()to be dept1", emp1.getDepartment() == dept1); assertTrue(ASSERTION_FAILED + ": Test aborted, precondition is false; " + "expected dept.getEmployees() to contain emp1", dept1.getEmployees().contains(emp1)); } } /** */ public void testSetToExistingFromMappedSide() { testMethod = "testSetToExistingFromMappedSide"; if (isTestToBePerformed) { // Set relationship emp1.setDepartment(dept2); pm.flush(); // Postcondition deferredAssertTrue(dept2.getEmployees().contains(emp1), ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set on flush"); deferredAssertTrue(!dept1.getEmployees().contains(emp1), ASSERTION_FAILED + testMethod, "Postcondition is false; reference emp1 not removed " + "from previous relationship (dept1.employees)"); pm.currentTransaction().commit(); cleanupPM(); getPM(); pm.currentTransaction().begin(); emp1 = (Employee)pm.getObjectById(emp1Oid); dept1 = (Department)pm.getObjectById(dept1Oid); dept2 = (Department)pm.getObjectById(dept2Oid); deferredAssertTrue(dept2.getEmployees().contains(emp1), ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set in new pm"); deferredAssertTrue(!dept1.getEmployees().contains(emp1), ASSERTION_FAILED + testMethod, "Postcondition is false; reference emp1 not removed " + "from previous relationship (dept1.employees)"); pm.currentTransaction().commit(); failOnError(); } } /** */ public void testAddExistingFromMappedbySide() { testMethod = "testAddExistingFromMappedbySide"; if (isTestToBePerformed) { // Set relationship Object emp4Oid = getOidByName("emp4"); Employee emp4 = (Employee)pm.getObjectById(emp4Oid); Object dept2Oid = getOidByName("dept2"); Department dept2 = (Department)pm.getObjectById(dept2Oid); dept1.addEmployee(emp4); pm.flush(); // Postcondition deferredAssertTrue(emp4.getDepartment() == dept1, ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set on flush"); deferredAssertTrue(!dept2.getEmployees().contains(emp4), ASSERTION_FAILED + testMethod, "Postcondition is false; " + "previous relationship not unset on flush"); pm.currentTransaction().commit(); cleanupPM(); getPM(); pm.currentTransaction().begin(); emp4 = (Employee)pm.getObjectById(emp4Oid); dept1 = (Department)pm.getObjectById(dept1Oid); dept2 = (Department)pm.getObjectById(dept2Oid); deferredAssertTrue(emp4.getDepartment() == dept1, ASSERTION_FAILED + testMethod, "In new transaction, postcondition is false; " + "other side of relationship is not set."); deferredAssertTrue(!dept2.getEmployees().contains(emp4), ASSERTION_FAILED + testMethod, "Postcondition is false; " + "previous relationship not unset on flush"); pm.currentTransaction().commit(); failOnError(); } } /** */ public void testReplaceFromMappedbySide() { testMethod = "testReplaceFromMappedbySide"; if (isTestToBePerformed) { // Set relationship Object emp4Oid = getOidByName("emp4"); Employee emp4 = (Employee)pm.getObjectById(emp4Oid); Object dept2Oid = getOidByName("dept2"); Department dept2 = (Department)pm.getObjectById(dept2Oid); Set emps = new HashSet(); emps.add(emp4); dept1.setEmployees(emps); pm.flush(); // Postcondition deferredAssertTrue(emp4.getDepartment() == dept1, ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set on flush"); deferredAssertTrue(!dept2.getEmployees().contains(emp4), ASSERTION_FAILED + testMethod, "Postcondition is false; " + "previous relationship not unset on flush"); pm.currentTransaction().commit(); cleanupPM(); getPM(); pm.currentTransaction().begin(); emp4 = (Employee)pm.getObjectById(emp4Oid); dept1 = (Department)pm.getObjectById(dept1Oid); dept2 = (Department)pm.getObjectById(dept2Oid); deferredAssertTrue(emp4.getDepartment() == dept1, ASSERTION_FAILED + testMethod, "In new transaction, postcondition is false; " + "other side of relationship is not set."); deferredAssertTrue(!dept2.getEmployees().contains(emp4), ASSERTION_FAILED + testMethod, "Postcondition is false; " + "previous relationship not unset on flush"); pm.currentTransaction().commit(); failOnError(); } } /** */ public void testAddNewFromMappedbySide() { testMethod = "testAddNewFromMappedbySide"; if (isTestToBePerformed) { // Set relationship Employee empNew = new FullTimeEmployee(101, "Jenny", "Merriwether", "White", new Date(500L), new Date(10000L), 135000); pm.makePersistent(empNew); Object empNewOid = pm.getObjectId((Object)empNew); dept1.addEmployee(empNew); pm.flush(); // Postcondition deferredAssertTrue(empNew.getDepartment() == dept1, ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set on flush"); pm.currentTransaction().commit(); cleanupPM(); getPM(); pm.currentTransaction().begin(); empNew = (Employee)pm.getObjectById(empNewOid); dept1 = (Department)pm.getObjectById(dept1Oid); deferredAssertTrue(empNew.getDepartment() == dept1, ASSERTION_FAILED + testMethod, "In new transaction, postcondition is false; " + "other side of relationship is not set."); pm.currentTransaction().commit(); failOnError(); } } /** */ public void testSetToNullFromMappedSide() { testMethod = "testSetToNullFromMappedSide"; if (isTestToBePerformed) { // Set relationship emp1.setDepartment(null); pm.flush(); // Postcondition deferredAssertTrue(!dept1.getEmployees().contains(emp1), ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set on flush"); pm.currentTransaction().commit(); cleanupPM(); getPM(); pm.currentTransaction().begin(); emp1 = (Employee)pm.getObjectById(emp1Oid); dept1 = (Department)pm.getObjectById(dept1Oid); deferredAssertTrue( !dept1.getEmployees().contains(emp1), ASSERTION_FAILED + testMethod, "In new transaction, postcondition is false; " + "other side of relationship is not set."); pm.currentTransaction().commit(); failOnError(); } } /** */ public void testSetToNullFromMappedbySide() { testMethod = "testSetToNullFromMappedbySide"; if (isTestToBePerformed) { // Set relationship dept1.setEmployees(null); pm.flush(); // Postcondition deferredAssertTrue(emp1.getDepartment() == null, ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set on flush"); pm.currentTransaction().commit(); cleanupPM(); getPM(); pm.currentTransaction().begin(); emp1 = (Employee)pm.getObjectById(emp1Oid); deferredAssertTrue( emp1.getDepartment() == null, ASSERTION_FAILED + testMethod, "In new transaction, postcondition is false; " + "other side of relationship is not set."); pm.currentTransaction().commit(); failOnError(); } } /** */ public void testSetToNewFromMappedSide() { testMethod = "testSetToNewFromMappedSide"; if (isTestToBePerformed) { // Set relationship IDepartment deptNew = new Department(99L, "The New Department"); pm.makePersistent(deptNew); emp1.setDepartment(deptNew); Object deptNewOid = pm.getObjectId((Object)deptNew); pm.flush(); assertFalse(testMethod + ": Test aborted, precondition is false; " + "expected deptNewOid to be non-null", deptNewOid == null); // Postcondition deferredAssertTrue(deptNew.getEmployees().contains(emp1), ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set on flush"); deferredAssertTrue(!dept1.getEmployees().contains(emp1), ASSERTION_FAILED + testMethod, "Postcondition is false; " + "previous relationship (dept1) not nulled on flush"); pm.currentTransaction().commit(); cleanupPM(); getPM(); pm.currentTransaction().begin(); emp1 = (Employee)pm.getObjectById(emp1Oid); deptNew = (Department)pm.getObjectById(deptNewOid); dept1 = (Department)pm.getObjectById(dept1Oid); deferredAssertTrue(deptNew.getEmployees().contains(emp1), ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set in new pm"); deferredAssertTrue(!dept1.getEmployees().contains(emp1), ASSERTION_FAILED + testMethod, "Postcondition is false; " + "previous relationship (dept1) not nulled in new pm"); pm.currentTransaction().commit(); failOnError(); } } /** */ public void testRemoveFromMappedbySide() { testMethod = "testRemoveFromMappedbySide"; if (isTestToBePerformed) { // Set relationship dept1.removeEmployee(emp1); pm.flush(); // Postcondition deferredAssertTrue(emp1.getDepartment() == null, ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set on flush"); pm.currentTransaction().commit(); cleanupPM(); getPM(); pm.currentTransaction().begin(); emp1 = (Employee)pm.getObjectById(emp1Oid); deferredAssertTrue( emp1.getDepartment() == null, ASSERTION_FAILED + testMethod, "In new transaction, postcondition is false; " + "other side of relationship is not set."); pm.currentTransaction().commit(); failOnError(); } } /** */ public void testDeleteFromMappedSide() { testMethod = "testDeleteFromMappedSide"; if (isTestToBePerformed) { // remember id long emp1Id = emp1.getPersonid(); // Set relationship pm.deletePersistent(emp1); pm.flush(); // Postcondition deferredAssertTrue(!containsEmployee(dept1.getEmployees(), emp1Id), ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set on flush"); pm.currentTransaction().commit(); cleanupPM(); getPM(); pm.currentTransaction().begin(); dept1 = (Department)pm.getObjectById(dept1Oid); deferredAssertTrue( !containsEmployee(dept1.getEmployees(), emp1Id), ASSERTION_FAILED + testMethod, "In new transaction, postcondition is false; " + "other side of relationship is not set."); pm.currentTransaction().commit(); failOnError(); } } /** */ public void testDeleteFromMappedbySide() { testMethod = "testDeleteFromMappedbySide"; if (isTestToBePerformed) { // Set relationship pm.deletePersistent(dept1); pm.flush(); // Postcondition deferredAssertTrue(emp1.getDepartment() == null, ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set on flush"); pm.currentTransaction().commit(); cleanupPM(); getPM(); pm.currentTransaction().begin(); emp1 = (Employee)pm.getObjectById(emp1Oid); deferredAssertTrue( emp1.getDepartment() == null, ASSERTION_FAILED + testMethod, "In new transaction, postcondition is false; " + "other side of relationship is not set."); pm.currentTransaction().commit(); failOnError(); } } } tck/src/java/org/apache/jdo/tck/mapping/Relationship1ToManyNoRelationships.java100664 22570 12500110374 30166 0ustarmbouschenstaff 0 0 /* * 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.mapping; import java.util.Date; import java.util.HashSet; import java.util.Set; import org.apache.jdo.tck.pc.company.Department; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.pc.company.FullTimeEmployee; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title:Relationship1ToManyNoRelationships *
*Keywords: mapping, managed relationships *
*Assertion ID: A15.3-14 *
*Assertion Description: Regardless of which side changes the relationship, * flush (whether done as part of commit or explicitly by the user) will modify * the datastore to reflect the change and will update the memory model * for consistency... */ public class Relationship1ToManyNoRelationships extends AbstractRelationshipTest { String testMethod = null; protected String ASSERTION_FAILED = "Assertion A15-3.14 (Relationship1ToManyNoRelationships) failed: "; Object emp1Oid = null; Object dept1Oid = null; Object dept2Oid = null; Employee emp1 = null; Department dept1 = null; Department dept2 = null; /** * The main 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(Relationship1ToManyNoRelationships.class); } /** * @see AbstractRelationshipTest#localSetUp() */ protected void localSetUp() { super.localSetUp(); if (isTestToBePerformed) { getPM(); pm.currentTransaction().begin(); emp1Oid = getOidByName("emp1"); dept1Oid = getOidByName("dept1"); dept2Oid = getOidByName("dept2"); emp1 = (Employee)pm.getObjectById(emp1Oid); dept1 = (Department)pm.getObjectById(dept1Oid); dept2 = (Department)pm.getObjectById(dept2Oid); // Preconditions assertTrue(ASSERTION_FAILED + ": Test aborted, precondition is false; " + "expected emp.getDepartment()to be null", emp1.getDepartment() == null); assertTrue(ASSERTION_FAILED + testMethod + ": Test aborted, precondition is false; " + "expected dept.getEmployees() to be empty", dept1.getEmployees().isEmpty()); } } /** */ public void testSetToExistingFromMappedSide() { testMethod = "testSetToExistingFromMappedSide"; if (isTestToBePerformed) { // Set relationship emp1.setDepartment(dept1); pm.flush(); // Postcondition deferredAssertTrue(dept1.getEmployees().contains(emp1), ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set on flush"); pm.currentTransaction().commit(); cleanupPM(); getPM(); pm.currentTransaction().begin(); emp1 = (Employee)pm.getObjectById(emp1Oid); dept1 = (Department)pm.getObjectById(dept1Oid); deferredAssertTrue( dept1.getEmployees().contains(emp1), ASSERTION_FAILED + testMethod, "In new transaction, postcondition is false; " + "other side of relationship is not set."); pm.currentTransaction().commit(); failOnError(); } } /** */ public void testAddExistingFromMappedbySide() { testMethod = "testSetToExistingFromMappedbySide"; if (isTestToBePerformed) { // Set relationship Set emps = new HashSet(); emps.add(emp1); dept1.setEmployees(emps); pm.flush(); // Postcondition deferredAssertTrue(emp1.getDepartment() == dept1, ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set on flush"); pm.currentTransaction().commit(); cleanupPM(); getPM(); pm.currentTransaction().begin(); emp1 = (Employee)pm.getObjectById(emp1Oid); dept1 = (Department)pm.getObjectById(dept1Oid); deferredAssertTrue( emp1.getDepartment() == dept1, ASSERTION_FAILED + testMethod, "In new transaction, postcondition is false; " + "other side of relationship is not set."); pm.currentTransaction().commit(); failOnError(); } } /** */ public void testSetToNewFromMappedSide() { testMethod = "testSetToNewFromMappedSide"; if (isTestToBePerformed) { // Set relationship Department deptNew = new Department(99L, "The New Department"); emp1.setDepartment(deptNew); pm.makePersistent(deptNew); Object deptNewOid = pm.getObjectId((Object)deptNew); pm.flush(); assertFalse(testMethod + ": Test aborted, precondition is false; " + "expected deptNewOid to be non-null", deptNewOid == null); // Postcondition deferredAssertTrue(deptNew.getEmployees().contains(emp1), ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set on flush"); deferredAssertTrue(!dept1.getEmployees().contains(emp1), ASSERTION_FAILED + testMethod, "Postcondition is false; " + "previous relationship (dept1) not nulled on flush"); pm.currentTransaction().commit(); cleanupPM(); getPM(); pm.currentTransaction().begin(); emp1 = (Employee)pm.getObjectById(emp1Oid); deptNew = (Department)pm.getObjectById(deptNewOid); dept1 = (Department)pm.getObjectById(dept1Oid); deferredAssertTrue(deptNew.getEmployees().contains(emp1), ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set in new pm"); deferredAssertTrue(!dept1.getEmployees().contains(emp1), ASSERTION_FAILED + testMethod, "Postcondition is false; " + "previous relationship (dept1) not nulled in new pm"); pm.currentTransaction().commit(); failOnError(); } } /** */ public void testSetToNewFromMappedbySide() { testMethod = "testSetToNewFromMappedbySide"; if (isTestToBePerformed) { // Set relationship Set emps = new HashSet(); Employee empNew = new FullTimeEmployee(101, "Jenny", "Merriwether", "White", new Date(500L), new Date(10000L), 135000); pm.makePersistent(empNew); emps.add(empNew); dept1.setEmployees(emps); Object empNewOid = pm.getObjectId((Object)empNew); pm.flush(); // Postcondition deferredAssertTrue(empNew.getDepartment() == dept1, ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set on flush"); deferredAssertTrue(emp1.getDepartment() == null, ASSERTION_FAILED + testMethod, "Postcondition is false; " + "previous relationship not nulled on flush"); pm.currentTransaction().commit(); cleanupPM(); getPM(); pm.currentTransaction().begin(); empNew = (Employee)pm.getObjectById(empNewOid); emp1 = (Employee)pm.getObjectById(emp1Oid); dept1 = (Department)pm.getObjectById(dept1Oid); deferredAssertTrue(empNew.getDepartment() == dept1, ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set in new pm"); deferredAssertTrue(emp1.getDepartment() == null, ASSERTION_FAILED + testMethod, "Postcondition is false; " + "previous relationship not nulled in new pm"); pm.currentTransaction().commit(); failOnError(); } } } tck/src/java/org/apache/jdo/tck/mapping/RelationshipManyToManyAllRelationships.java100664 44651 12500110374 31072 0ustarmbouschenstaff 0 0 /* * 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.mapping; import java.math.BigDecimal; import java.util.Date; import java.util.HashSet; import java.util.Set; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.pc.company.FullTimeEmployee; import org.apache.jdo.tck.pc.company.IEmployee; import org.apache.jdo.tck.pc.company.IProject; import org.apache.jdo.tck.pc.company.Project; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title:RelationshipManyToManyAllRelationships *
*Keywords: mapping, managed relationships *
*Assertion ID: A15.3-14 *
*Assertion Description: Regardless of which side changes the relationship, * flush (whether done as part of commit or explicitly by the user) will modify * the datastore to reflect the change and will update the memory model * for consistency... */ public class RelationshipManyToManyAllRelationships extends AbstractRelationshipTest { String testMethod = null; protected String ASSERTION_FAILED = "Assertion A15-3.14 (RelationshipManyToManyAllRelationships) failed: "; Object emp1Oid = null; Object proj1Oid = null; Employee emp1 = null; Project proj1 = null; /** * The main 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(RelationshipManyToManyAllRelationships.class); } /** * @see AbstractRelationshipTest#localSetUp() */ protected void localSetUp() { super.localSetUp(); if (isTestToBePerformed) { getPM(); pm.currentTransaction().begin(); emp1Oid = getOidByName("emp1"); proj1Oid = getOidByName("proj1"); emp1 = (Employee)pm.getObjectById(emp1Oid); proj1 = (Project)pm.getObjectById(proj1Oid); // Preconditions assertTrue(testMethod + ": Test aborted, precondition is false; " + "expected emp.getProjects()to be contain proj1", emp1.getProjects().contains(proj1)); assertTrue(testMethod + ": Test aborted, precondition is false; " + "expected proj.getMembers() to contain emp1", proj1.getMembers().contains(emp1)); } } /** */ public void testSetToNullFromMappedSide() { testMethod = "testSetToNullFromMappedSide"; if (isTestToBePerformed) { // Set relationship proj1.setMembers(null); pm.flush(); // Postcondition deferredAssertTrue(!emp1.getProjects().contains(proj1), ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set on flush"); pm.currentTransaction().commit(); cleanupPM(); getPM(); pm.currentTransaction().begin(); emp1 = (Employee)pm.getObjectById(emp1Oid); proj1 = (Project)pm.getObjectById(proj1Oid); deferredAssertTrue( !emp1.getProjects().contains(proj1), ASSERTION_FAILED + testMethod, "In new transaction, postcondition is false; " + "other side of relationship is not set."); pm.currentTransaction().commit(); failOnError(); } } /** */ public void testSetToNullFromMappedbySide() { testMethod = "testSetToNullFromMappedbySide"; if (isTestToBePerformed) { // Set relationship emp1.setProjects(null); pm.flush(); // Postcondition deferredAssertTrue(!proj1.getMembers().contains(emp1), ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set on flush"); pm.currentTransaction().commit(); cleanupPM(); getPM(); pm.currentTransaction().begin(); emp1 = (Employee)pm.getObjectById(emp1Oid); proj1 = (Project)pm.getObjectById(proj1Oid); deferredAssertTrue( !proj1.getMembers().contains(emp1), ASSERTION_FAILED + testMethod, "In new transaction, postcondition is false; " + "other side of relationship is not set."); pm.currentTransaction().commit(); failOnError(); } } /** */ public void testReplaceFromMappedSide() { testMethod = "testReplaceFromMappedSide"; if (isTestToBePerformed) { // Set relationship IEmployee empNew = new FullTimeEmployee(100, "Jerry", "Valentine", "Brown", new Date(500L), new Date(10000L), 125000); pm.makePersistent(empNew); Set members = new HashSet(); members.add(empNew); proj1.setMembers(members); Object empNewOid = pm.getObjectId((Object)empNew); pm.flush(); // Postcondition deferredAssertTrue(empNew.getProjects().contains(proj1), ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set on flush"); pm.currentTransaction().commit(); cleanupPM(); getPM(); pm.currentTransaction().begin(); empNew = (IEmployee)pm.getObjectById(empNewOid); emp1 = (Employee)pm.getObjectById(emp1Oid); proj1 = (Project)pm.getObjectById(proj1Oid); deferredAssertTrue(empNew.getProjects().contains(proj1), ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set in new pm"); pm.currentTransaction().commit(); failOnError(); } } /** */ public void testReplaceFromMappedbySide() { testMethod = "testReplaceFromMappedbySide"; if (isTestToBePerformed) { // Set relationship IProject projNew = new Project(99L, "Skunkworks", new BigDecimal(10000.35)); pm.makePersistent(projNew); Set projects = new HashSet(); projects.add(projNew); emp1.setProjects(projects); Object projNewOid = pm.getObjectId((Object)projNew); pm.flush(); // Postcondition deferredAssertTrue(projNew.getMembers().contains(emp1), ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set on flush"); pm.currentTransaction().commit(); cleanupPM(); getPM(); pm.currentTransaction().begin(); emp1 = (Employee)pm.getObjectById(emp1Oid); projNew = (Project)pm.getObjectById(projNewOid); proj1 = (Project)pm.getObjectById(proj1Oid); deferredAssertTrue(projNew.getMembers().contains(emp1), ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set in new pm"); pm.currentTransaction().commit(); failOnError(); } } /** */ public void testAddNewFromMappedSide() { testMethod = "testAddNewFromMappedSide"; if (isTestToBePerformed) { // Set relationship Employee empNew = new FullTimeEmployee(100, "Jerry", "Valentine", "Brown", new Date(500L), new Date(10000L), 125000); pm.makePersistent(empNew); proj1.addMember(empNew); Object empNewOid = pm.getObjectId((Object)empNew); pm.flush(); // Postcondition deferredAssertTrue(empNew.getProjects().contains(proj1), ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set on flush"); pm.currentTransaction().commit(); cleanupPM(); getPM(); pm.currentTransaction().begin(); empNew = (Employee)pm.getObjectById(empNewOid); emp1 = (Employee)pm.getObjectById(emp1Oid); proj1 = (Project)pm.getObjectById(proj1Oid); deferredAssertTrue(empNew.getProjects().contains(proj1), ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set in new pm"); pm.currentTransaction().commit(); failOnError(); } } /** */ public void testAddNewFromMappedbySide() { testMethod = "testAddNewFromMappedbySide"; if (isTestToBePerformed) { // Set relationship Project projNew = new Project(99L, "Skunkworks", new BigDecimal(10000.35)); pm.makePersistent(projNew); emp1.addProject(projNew); Object projNewOid = pm.getObjectId((Object)projNew); pm.flush(); // Postcondition deferredAssertTrue(projNew.getMembers().contains(emp1), ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set on flush"); pm.currentTransaction().commit(); cleanupPM(); getPM(); pm.currentTransaction().begin(); emp1 = (Employee)pm.getObjectById(emp1Oid); projNew = (Project)pm.getObjectById(projNewOid); proj1 = (Project)pm.getObjectById(proj1Oid); deferredAssertTrue(projNew.getMembers().contains(emp1), ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set in new pm"); pm.currentTransaction().commit(); failOnError(); } } /** */ public void testAddExistingFromMappedSide() { testMethod = "testAddExistingFromMappedSide"; if (isTestToBePerformed) { // Set relationship Object emp4Oid = getOidByName("emp4"); Employee emp4 = (Employee)pm.getObjectById(emp4Oid); proj1.addMember(emp4); pm.flush(); // Postcondition deferredAssertTrue(emp4.getProjects().contains(proj1), ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set on flush"); pm.currentTransaction().commit(); cleanupPM(); getPM(); pm.currentTransaction().begin(); emp4 = (Employee)pm.getObjectById(emp4Oid); emp1 = (Employee)pm.getObjectById(emp1Oid); proj1 = (Project)pm.getObjectById(proj1Oid); deferredAssertTrue(emp4.getProjects().contains(proj1), ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set in new pm"); pm.currentTransaction().commit(); failOnError(); } } /** */ public void testAddExistingFromMappedbySide() { testMethod = "testAddExistingFromMappedbySide"; if (isTestToBePerformed) { // Set relationship Object proj2Oid = getOidByName("proj2"); Project proj2 = (Project)pm.getObjectById(proj2Oid); emp1.addProject(proj2); pm.flush(); // Postcondition deferredAssertTrue(proj2.getMembers().contains(emp1), ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set on flush"); pm.currentTransaction().commit(); cleanupPM(); getPM(); pm.currentTransaction().begin(); emp1 = (Employee)pm.getObjectById(emp1Oid); proj2 = (Project)pm.getObjectById(proj2Oid); proj1 = (Project)pm.getObjectById(proj1Oid); deferredAssertTrue(proj2.getMembers().contains(emp1), ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set in new pm"); pm.currentTransaction().commit(); failOnError(); } } /** */ public void testRemoveFromMappedSide() { testMethod = "testRemoveFromMappedSide"; if (isTestToBePerformed) { // Set relationship proj1.removeMember(emp1); pm.flush(); // Postcondition deferredAssertTrue(!emp1.getProjects().contains(proj1), ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set on flush"); pm.currentTransaction().commit(); cleanupPM(); getPM(); pm.currentTransaction().begin(); emp1 = (Employee)pm.getObjectById(emp1Oid); proj1 = (Project)pm.getObjectById(proj1Oid); deferredAssertTrue( !emp1.getProjects().contains(proj1), ASSERTION_FAILED + testMethod, "In new transaction, postcondition is false; " + "other side of relationship is not set."); pm.currentTransaction().commit(); failOnError(); } } /** */ public void testRemoveFromMappedbySide() { testMethod = "testRemoveFromMappedbySide"; if (isTestToBePerformed) { // Set relationship emp1.removeProject(proj1); pm.flush(); // Postcondition deferredAssertTrue(!proj1.getMembers().contains(emp1), ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set on flush"); pm.currentTransaction().commit(); cleanupPM(); getPM(); pm.currentTransaction().begin(); emp1 = (Employee)pm.getObjectById(emp1Oid); proj1 = (Project)pm.getObjectById(proj1Oid); deferredAssertTrue( !proj1.getMembers().contains(emp1), ASSERTION_FAILED + testMethod, "In new transaction, postcondition is false; " + "other side of relationship is not set."); pm.currentTransaction().commit(); failOnError(); } } /** */ public void testDeleteFromMappedSide() { testMethod = "testDeleteFromMappedSide"; if (isTestToBePerformed) { // remember id long proj1Id = proj1.getProjid(); // Set relationship pm.deletePersistent(proj1); pm.flush(); // Postcondition deferredAssertTrue(!containsProject(emp1.getProjects(), proj1Id), ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set on flush"); pm.currentTransaction().commit(); cleanupPM(); getPM(); pm.currentTransaction().begin(); emp1 = (Employee)pm.getObjectById(emp1Oid); deferredAssertTrue( !containsProject(emp1.getProjects(), proj1Id), ASSERTION_FAILED + testMethod, "In new transaction, postcondition is false; " + "other side of relationship is not set."); pm.currentTransaction().commit(); failOnError(); } } /** */ public void testDeleteFromMappedbySide() { testMethod = "testDeleteFromMappedbySide"; if (isTestToBePerformed) { // remember id long emp1Id = emp1.getPersonid(); // Set relationship pm.deletePersistent(emp1); pm.flush(); // Postcondition deferredAssertTrue(!containsEmployee(proj1.getMembers(), emp1Id), ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set on flush"); pm.currentTransaction().commit(); cleanupPM(); getPM(); pm.currentTransaction().begin(); proj1 = (Project)pm.getObjectById(proj1Oid); deferredAssertTrue( !containsEmployee(proj1.getMembers(), emp1Id), ASSERTION_FAILED + testMethod, "In new transaction, postcondition is false; " + "other side of relationship is not set."); pm.currentTransaction().commit(); failOnError(); } } } tck/src/java/org/apache/jdo/tck/mapping/RelationshipManyToManyNoRelationships.java100664 21175 12500110374 30732 0ustarmbouschenstaff 0 0 /* * 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.mapping; import java.math.BigDecimal; import java.util.Date; import java.util.HashSet; import java.util.Set; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.pc.company.FullTimeEmployee; import org.apache.jdo.tck.pc.company.Project; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title:RelationshipManyToManyNoRelationships *
*Keywords: mapping, managed relationships *
*Assertion ID: A15.3-14 *
*Assertion Description: Regardless of which side changes the relationship, * flush (whether done as part of commit or explicitly by the user) will modify * the datastore to reflect the change and will update the memory model * for consistency... */ public class RelationshipManyToManyNoRelationships extends AbstractRelationshipTest { String testMethod = null; protected String ASSERTION_FAILED = "Assertion A15-3.14 (RelationshipManyToManyNoRelationships) failed: "; Object emp1Oid = null; Object proj1Oid = null; Employee emp1 = null; Project proj1 = null; /** * The main 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(RelationshipManyToManyNoRelationships.class); } /** * @see AbstractRelationshipTest#localSetUp() */ protected void localSetUp() { super.localSetUp(); if (isTestToBePerformed) { getPM(); pm.currentTransaction().begin(); emp1Oid = getOidByName("emp1"); proj1Oid = getOidByName("proj1"); emp1 = (Employee)pm.getObjectById(emp1Oid); proj1 = (Project)pm.getObjectById(proj1Oid); // Preconditions assertTrue(testMethod + ": Test aborted, precondition is false; " + "expected emp.getProjects()to be empty", emp1.getProjects().isEmpty()); assertTrue(testMethod + ": Test aborted, precondition is false; " + "expected ins.getMembers() to be empty", proj1.getMembers().isEmpty()); } } /** */ public void testAddFromMappedSide() { testMethod = "testAddFromMappedSide"; if (isTestToBePerformed) { // Set relationship Set emps = new HashSet(); emps.add(emp1); proj1.setMembers(emps); pm.flush(); // Postcondition deferredAssertTrue(emp1.getProjects().contains(proj1), ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set on flush"); pm.currentTransaction().commit(); cleanupPM(); getPM(); pm.currentTransaction().begin(); emp1 = (Employee)pm.getObjectById(emp1Oid); proj1 = (Project)pm.getObjectById(proj1Oid); deferredAssertTrue( emp1.getProjects().contains(proj1), ASSERTION_FAILED + testMethod, "In new transaction, postcondition is false; " + "other side of relationship is not set."); pm.currentTransaction().commit(); failOnError(); } } /** */ public void testAddFromMappedbySide() { testMethod = "testAddFromMappedbySide"; if (isTestToBePerformed) { // Set relationship Set projs = new HashSet(); projs.add(proj1); emp1.setProjects(projs); pm.flush(); // Postcondition deferredAssertTrue(proj1.getMembers().contains(emp1), ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set on flush"); pm.currentTransaction().commit(); cleanupPM(); getPM(); pm.currentTransaction().begin(); emp1 = (Employee)pm.getObjectById(emp1Oid); proj1 = (Project)pm.getObjectById(proj1Oid); deferredAssertTrue( proj1.getMembers().contains(emp1), ASSERTION_FAILED + testMethod, "In new transaction, postcondition is false; " + "other side of relationship is not set."); pm.currentTransaction().commit(); failOnError(); } } /** */ public void testReplaceFromMappedSide() { testMethod = "testReplaceFromMappedSide"; if (isTestToBePerformed) { // Set relationship Set members = new HashSet(); Employee empNew = new FullTimeEmployee(100, "Jerry", "Valentine", "Brown", new Date(500L), new Date(10000L), 125000); pm.makePersistent(empNew); members.add(empNew); proj1.setMembers(members); Object empNewOid = pm.getObjectId(empNew); pm.flush(); assertFalse(testMethod + ": Test aborted, precondition is false; " + "expected empNewOid to be non-null", empNewOid == null); // Postcondition deferredAssertTrue(empNew.getProjects().contains(proj1), ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set on flush"); pm.currentTransaction().commit(); cleanupPM(); getPM(); pm.currentTransaction().begin(); empNew = (Employee)pm.getObjectById(empNewOid); emp1 = (Employee)pm.getObjectById(emp1Oid); proj1 = (Project)pm.getObjectById(proj1Oid); deferredAssertTrue(empNew.getProjects().contains(proj1), ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set in new pm"); pm.currentTransaction().commit(); failOnError(); } } /** */ public void testReplaceFromMappedbySide() { testMethod = "testReplaceFromMappedbySide"; if (isTestToBePerformed) { // Set relationship Set projects = new HashSet(); Project projNew = new Project(99L, "Skunkworks", new BigDecimal(10000.35)); pm.makePersistent(projNew); projects.add(projNew); emp1.setProjects(projects); Object projNewOid = pm.getObjectId((Object)projNew); pm.flush(); assertFalse(testMethod + ": Test aborted, precondition is false; " + "expected projNewOid to be non-null", projNewOid == null); // Postcondition deferredAssertTrue(projNew.getMembers().contains(emp1), ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set on flush"); pm.currentTransaction().commit(); cleanupPM(); getPM(); pm.currentTransaction().begin(); emp1 = (Employee)pm.getObjectById(emp1Oid); projNew = (Project)pm.getObjectById(projNewOid); proj1 = (Project)pm.getObjectById(proj1Oid); deferredAssertTrue(projNew.getMembers().contains(emp1), ASSERTION_FAILED + testMethod, "Postcondition is false; " + "other side of relationship not set in new pm"); pm.currentTransaction().commit(); failOnError(); } } } tck/src/java/org/apache/jdo/tck/mapping/RelationshipNegative1To1Test.java100664 12374 12500110374 26704 0ustarmbouschenstaff 0 0 /* * 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.mapping; import java.util.Date; import javax.jdo.JDOUserException; import org.apache.jdo.tck.pc.company.FullTimeEmployee; import org.apache.jdo.tck.pc.company.IEmployee; import org.apache.jdo.tck.pc.company.IMedicalInsurance; import org.apache.jdo.tck.pc.company.MedicalInsurance; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title:RelationshipNegative1To1Test *
*Keywords: mapping, managed relationships *
*Assertion ID: A15.3-14 *
*Assertion Description: Regardless of which side changes the relationship, * flush (whether done as part of commit or explicitly by the user) will modify * the datastore to reflect the change and will update the memory model * for consistency... */ public class RelationshipNegative1To1Test extends AbstractRelationshipTest { String testMethod = null; protected String ASSERTION_FAILED = "Assertion A15-3.14 (RelationshipNegative1To1Test) failed: "; Object emp1Oid = null; Object emp2Oid = null; Object medIns1Oid = null; Object medIns2Oid = null; IEmployee emp1 = null; IEmployee emp2 = null; IMedicalInsurance medIns1 = null; IMedicalInsurance medIns2 = null; /** * The main 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(RelationshipNegative1To1Test.class); } /** * @see AbstractRelationshipTest#localSetUp() */ protected void localSetUp() { super.localSetUp(); if (isTestToBePerformed) { getPM(); pm.currentTransaction().begin(); emp1Oid = getOidByName("emp1"); emp2Oid = getOidByName("emp2"); medIns1Oid = getOidByName("medicalIns1"); medIns2Oid = getOidByName("medicalIns2"); emp1 = (IEmployee)pm.getObjectById(emp1Oid); emp2 = (IEmployee)pm.getObjectById(emp2Oid); medIns1 = (IMedicalInsurance)pm.getObjectById(medIns1Oid); medIns2 = (IMedicalInsurance)pm.getObjectById(medIns2Oid); } } /** * Test that JdoUserException is thrown if two sides of a relationship * do not refer to each other. */ public void testA2BbutNotB2AMapped() { testMethod = "testA2BbutNotB2AMapped"; if (isTestToBePerformed) { IEmployee empNew = new FullTimeEmployee(99, "Matthew", "", "Adams", new Date(0L), new Date(10000L), 125000); pm.makePersistent(empNew); emp1.setMedicalInsurance(medIns2); medIns2.setEmployee(empNew); doFlush(testMethod); } } /** * Test that JdoUserException is thrown if two sides of a relationship * do not refer to each other. */ public void testA2BbutNotB2AMappedBy() { testMethod = "testA2BbutNotB2AMappedBy"; if (isTestToBePerformed) { IMedicalInsurance medInsNew = new MedicalInsurance(99, "The American Company", "B"); pm.makePersistent(medInsNew); medIns2.setEmployee(emp1); emp1.setMedicalInsurance(medInsNew); doFlush(testMethod); } } /** * Test that JdoUserException is thrown setting mapped side * of a one-to-one relationship and setting the other side to null */ public void testSetOtherSideToNullMapped() { testMethod = "testSetOtherSideToNullMapped"; if (isTestToBePerformed) { emp1.setMedicalInsurance(medIns2); medIns2.setEmployee(null); doFlush(testMethod); } } /** * Test that JdoUserException is thrown setting mapped by side * of a one-to-one relationship and setting the other side to null */ public void testSetOtherSideToNullMappedBy() { testMethod = "testSetOtherSideToNullMappedBy"; if (isTestToBePerformed) { medIns2.setEmployee(emp1); emp1.setMedicalInsurance(null); doFlush(testMethod); } } protected void doFlush(String method) { try { pm.flush(); fail(ASSERTION_FAILED + testMethod + ": expected JDOUserException on flush!"); } catch (JDOUserException jdoe) { // expected exception } pm.currentTransaction().rollback(); } } tck/src/java/org/apache/jdo/tck/mapping/RelationshipNegative1ToManyTest.java100664 11055 12500110374 27443 0ustarmbouschenstaff 0 0 /* * 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.mapping; import java.util.Date; import javax.jdo.JDOUserException; import org.apache.jdo.tck.pc.company.Department; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.pc.company.FullTimeEmployee; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title:RelationshipNegative1ToManyTest *
*Keywords: mapping, managed relationships *
*Assertion ID: A15.3-14 *
*Assertion Description: Regardless of which side changes the relationship, * flush (whether done as part of commit or explicitly by the user) will modify * the datastore to reflect the change and will update the memory model * for consistency... */ public class RelationshipNegative1ToManyTest extends AbstractRelationshipTest { String testMethod = null; protected String ASSERTION_FAILED = "Assertion A15-3.14 (RelationshipNegative1ToManyTest) failed: "; Object emp1Oid = null; Object dept1Oid = null; Object dept2Oid = null; Employee emp1 = null; Department dept1 = null; Department dept2 = null; /** * The main 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(RelationshipNegative1ToManyTest.class); } /** * @see AbstractRelationshipTest#localSetUp() */ protected void localSetUp() { super.localSetUp(); if (isTestToBePerformed) { getPM(); pm.currentTransaction().begin(); emp1Oid = getOidByName("emp1"); dept1Oid = getOidByName("dept1"); dept2Oid = getOidByName("dept2"); emp1 = (Employee)pm.getObjectById(emp1Oid); dept1 = (Department)pm.getObjectById(dept1Oid); dept2 = (Department)pm.getObjectById(dept2Oid); } } /** * Test that JdoUserException is thrown setting one side * of a one-to-many relationship and deleting the other side */ public void testDeleteOtherSide() { testMethod = "testDeleteOtherSide"; if (isTestToBePerformed) { dept2.addEmployee(emp1); pm.deletePersistent(emp1); doFlush(testMethod); } } /** * adding a related instance (with a single-valued mapped-by relationship * field) to more than one one-to-many collection relationship */ public void testAddToMoreThanOne() { testMethod = "testAddToMoreThanOne"; if (isTestToBePerformed) { Employee empNew = new FullTimeEmployee(99, "Matthew", "", "Adams", new Date(0L), new Date(10000L), 125000); pm.makePersistent(empNew); dept1.addEmployee(empNew); dept2.addEmployee(empNew); doFlush(testMethod); } } /** * adding a related instance to a collection and setting the other side * to a different instance */ public void testAInBbutNotB2A() { testMethod = "testAInBbutNotB2A"; if (isTestToBePerformed) { Employee empNew = new FullTimeEmployee(99, "Matthew", "", "Adams", new Date(0L), new Date(10000L), 125000); pm.makePersistent(empNew); dept1.addEmployee(empNew); empNew.setDepartment(dept2); doFlush(testMethod); } } protected void doFlush(String method) { try { pm.flush(); fail(ASSERTION_FAILED + testMethod + ": expected JDOUserException on flush!"); } catch (JDOUserException jdoe) { // expected exception } pm.currentTransaction().rollback(); } } tck/src/java/org/apache/jdo/tck/models/embedded/EmbeddedInheritance.java100664 20237 12500110373 26473 0ustarmbouschenstaff 0 0 /* * 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; /** * Title: Test EmbeddedInheritance *
* Keywords: *
* Assertion IDs: *
* Assertion Description: */ public class EmbeddedInheritance extends JDO_Test { /** */ protected void localSetUp() { addTearDownClass(Kitchen.class); } /** * The main 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 kitchens = (List)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 kitchens1 = (List)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 kitchens2 = (List)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(); } } tck/src/java/org/apache/jdo/tck/models/embedded/SecondClassObjectsTrackTheirChanges.java100664 13562 12500110373 31620 0ustarmbouschenstaff 0 0 /* * 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.Date; import java.util.Set; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.Address; import org.apache.jdo.tck.pc.company.Company; import org.apache.jdo.tck.pc.company.Department; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: SecondClassObjectsTrackTheirChanges *
*Keywords: embedded lifecycle *
*Assertion ID: A14.6.9-9 *
*Assertion Description: If an SCO field is in the result, the projected field is not owned by any persistent instance, and modifying the SCO value has no effect on any persistent instance. If an FCO field is in the result, the projected field is a persistent instance, and modifications made to the instance are are reflected as changes to the datastore per transaction requirements. */ public class SecondClassObjectsTrackTheirChanges extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.9-9 (SecondClassObjectsTrackTheirChanges) failed: "; /** * The main 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(SecondClassObjectsTrackTheirChanges.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(Company.class); } /** This tests that persistence-capable instances track changes * or notify their owning instance that they are dirty */ public void testPCInstance() { pm = getPM(); pm.currentTransaction().begin(); Company comp = getPersistentNewInstance(0); pm.currentTransaction().commit(); // obj should transition to hollow testHollowInstance(comp); pm.currentTransaction().begin(); makePersistentCleanInstance(comp); Address addr = (Address)comp.getAddress(); // comp or addr should transition to persistent-dirty addr.setStreet("200 Orange Street"); int currComp = currentState(comp); int currAddr = currentState(addr); if ((currComp != PERSISTENT_DIRTY) && (currAddr != PERSISTENT_DIRTY)){ fail(ASSERTION_FAILED, "Unable to create persistent-dirty instance " + "from persistent-clean instance via changing Address instance, " + "state of Company instance is " + states[currComp] + " and state of Address instance is " + states[currAddr]); } } /** This tests that mutable system class instances track changes * or notify their owning instance that they are dirty */ public void testMutableSystemClass() { pm = getPM(); pm.currentTransaction().begin(); Company comp = getPersistentNewInstance(1); pm.currentTransaction().commit(); // obj should transition to hollow testHollowInstance(comp); pm.currentTransaction().begin(); makePersistentCleanInstance(comp); Set depts = comp.getDepartments(); // comp or depts should transition to persistent-dirty comp.addDepartment(new Department(0, "HR", comp)); int currComp = currentState(comp); int currDepts = currentState(depts); if ((currComp != PERSISTENT_DIRTY) && (currDepts != PERSISTENT_DIRTY)){ fail(ASSERTION_FAILED, "Unable to create persistent-dirty instance " + "from persistent-clean instance via changing Departments " + "instance, state of Company instance is " + states[currComp] + " and state of Departments instance is " + states[currDepts]); } } public Company getPersistentNewInstance(long companyid) { Company obj = new Company(companyid, "MyCompany", new Date(), new Address(0,"","","","","")); pm.makePersistent(obj); // obj should transition to persistent-new int curr = currentState(obj); if( curr != PERSISTENT_NEW ){ fail(ASSERTION_FAILED, "Unable to create persistent-new instance " + "from transient instance via makePersistent(), state is " + states[curr]); } return obj; } public void testHollowInstance(Company obj) { int curr = currentState(obj); if( curr != HOLLOW ){ fail(ASSERTION_FAILED, "Unable to create hollow instance " + "from persistent-new instance via commit(), state is " + states[curr]); } } public void makePersistentCleanInstance(Company obj) { pm.makeTransactional(obj); // obj should transition to persistent-clean int curr = currentState(obj); if( curr != PERSISTENT_CLEAN ){ fail(ASSERTION_FAILED, "Unable to create persistent-clean instance " + "from hollow instance via makeTransactional(obj), state is " + states[curr]); } } } tck/src/java/org/apache/jdo/tck/models/fieldtypes/TestArrayCollections.java100664 15263 12500110373 27367 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.lang.reflect.Array; import java.math.BigDecimal; import java.util.Arrays; import java.util.Collection; import java.util.Vector; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.fieldtypes.ArrayCollections; import org.apache.jdo.tck.pc.fieldtypes.SimpleClass; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Support of field type array. *
*Keywords: model *
*Assertion ID: A6.4.3-39. *
*Assertion Description: JDO implementations may optionally support fields of array types. */ public class TestArrayCollections extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion (TestArrayCollections) failed: "; /** * The main 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(TestArrayCollections.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(ArrayCollections.class); addTearDownClass(SimpleClass.class); } /** */ public void test() { pm = getPM(); runTest(pm); pm.close(); pm = null; } /** */ void runTest(PersistenceManager pm) { if (!isArraySupported()) { if (debug) logger.debug("JDO Implementation does not support" + "optional feature Array"); return; } Transaction tx = pm.currentTransaction(); ArrayCollections expectedValue = new ArrayCollections(); // turn on datastore transactions tx.setOptimistic(false); tx.begin(); ArrayCollections pi = new ArrayCollections(); pi.identifier = 1; pm.makePersistent(pi); Object oid = pm.getObjectId(pi); // Provide initial set of values setValues(pi, 1); tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); setValues(expectedValue, 1); // check if persistent fields have values set checkValues(oid, expectedValue); pi = (ArrayCollections) pm.getObjectById(oid, true); // Provide new set of values setValues(pi, 2); tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); // check new values setValues(expectedValue, 2); checkValues(oid, expectedValue); tx.commit(); } /** */ private void setValues(ArrayCollections collect, int order) { Vector value; Class vectorClass = null; int n = collect.getLength(); for (int i = 0; i < n; ++i) { String valueType = TestUtil.getFieldSpecs( ArrayCollections.fieldSpecs[i]); value = TestUtil.makeNewVectorInstance(valueType, order); try { // get the right class to instantiate vectorClass = value.get(0).getClass(); } catch (Exception e) { } Object[] valueArray = (Object[])Array.newInstance(vectorClass, value.size()); value.toArray(valueArray); collect.set(i, valueArray); if (debug) logger.debug("Set " + i + "th value to: " + valueArray.toString()); } } /** */ private void checkValues(Object oid, ArrayCollections expectedValue) { StringBuffer sbuf = new StringBuffer(); ArrayCollections pi = (ArrayCollections) pm.getObjectById(oid, true); int n = pi.getLength(); for (int i = 0; i < n; ++i) { Object obj = new Object(); Class objClass = obj.getClass(); Object[] expected = (Object[])Array.newInstance(objClass, 5); Object[] actual = (Object[])Array.newInstance(objClass, 5); expected = expectedValue.get(i); actual = pi.get(i); if (actual == null) { sbuf.append("\nFor " + ArrayCollections.fieldSpecs[i] + ", retrieved field is null."); continue; } if (expected.length != actual.length) { sbuf.append("\nFor element " + i + ", expected size = " + expected.length + ", actual size = " + actual.length + " . "); continue; } else if (!Arrays.equals(expected, actual)) { if (TestUtil.getFieldSpecs(ArrayCollections.fieldSpecs[i] ).equals("BigDecimal")) { for (int j = 0; j < actual.length; ++j) { BigDecimal expectedBD = (BigDecimal)expected[j]; BigDecimal actualBD = (BigDecimal)actual[j]; if ((expectedBD.compareTo(actualBD) != 0)) { sbuf.append("\nFor element " + i + "[" + j + "], expected = " + expectedBD + ", actual = " + actualBD + " . "); } } } else { sbuf.append("\nFor element " + i + ", expected = " + expected + ", actual = " + actual + " . "); } } } if (sbuf.length() > 0) { fail(ASSERTION_FAILED, "Expected and observed do not match!!" + sbuf.toString()); } } } tck/src/java/org/apache/jdo/tck/models/fieldtypes/TestArrayListCollections.java100664 15216 12500110373 30221 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import java.util.Collection; import java.util.Vector; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.fieldtypes.ArrayListCollections; import org.apache.jdo.tck.pc.fieldtypes.SimpleClass; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Support of field type ArrayList. *
*Keywords: model *
*Assertion ID: A6.4.3-23. *
*Assertion Description: If the ArrayList optional feature is supported, then JDO implementation must support fields of the mutable object class ArrayList, supporting them as Second Class Objects or First Class Objects. */ public class TestArrayListCollections extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A6.4.3-23 (TestArrayListCollections) failed: "; /** * The main 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(TestArrayListCollections.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(ArrayListCollections.class); addTearDownClass(SimpleClass.class); } /** */ public void test() { pm = getPM(); runTest(pm); pm.close(); pm = null; } /** */ void runTest(PersistenceManager pm) { if (!isArrayListSupported()) { if (debug) logger.debug("JDO Implementation does not support optional " + "feature ArrayList"); return; } Transaction tx = pm.currentTransaction(); ArrayListCollections expectedValue = new ArrayListCollections(); // turn on datastore transactions tx.setOptimistic(false); tx.begin(); ArrayListCollections pi = new ArrayListCollections(); pi.identifier = 1; pm.makePersistent(pi); Object oid = pm.getObjectId(pi); // Provide initial set of values setValues(pi, 1); tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); setValues(expectedValue, 1); checkValues(oid, expectedValue); pi = (ArrayListCollections) pm.getObjectById(oid, true); // Provide new set of values setValues(pi, 2); tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); // check new values setValues(expectedValue, 2); checkValues(oid, expectedValue); tx.commit(); } /** */ private void setValues(ArrayListCollections collect, int order) { Collection value; int n = collect.getLength(); for (int i = 0; i < n; ++i) { String valueType = TestUtil.getFieldSpecs( ArrayListCollections.fieldSpecs[i]); value = (Collection)TestUtil.makeNewVectorInstance( valueType, order); ArrayList arrayListValue = new ArrayList(value); collect.set(i, arrayListValue); if (debug) logger.debug("Set " + i + "th value to: " + value.toString()); } } /** */ private void checkValues(Object oid, ArrayListCollections expectedValue) { int i; StringBuffer sbuf = new StringBuffer(); ArrayListCollections pi = (ArrayListCollections) pm.getObjectById(oid, true); int n = pi.getLength(); for (i = 0; i < n; ++i) { Collection expected = expectedValue.get(i); Collection actual = pi.get(i); if (actual == null) { sbuf.append("\nFor element " + i + ", retrieved instance is null"); continue; } if (actual.size() != expected.size()) { sbuf.append("\nFor element " + i + ", expected size = " + expected.size() + ", actual size = " + actual.size() + " . "); continue; } else if (! expected.equals(actual)) { if (TestUtil.getFieldSpecs(ArrayListCollections.fieldSpecs[i] ).equals("BigDecimal")) { if (debug) { logger.debug("Field is " + i + " Class name is " + actual.getClass().getName() + " isInstance of Vector is " + actual.getClass().isInstance((Object)new Vector())); } List expectedL = (List)expected; List actualL = (List)actual; for (int j = 0; j < actualL.size(); ++j) { BigDecimal bigDecCompareWith = (BigDecimal)expectedL.get(j); BigDecimal bigDecVal = (BigDecimal)actualL.get(j); if ((bigDecCompareWith.compareTo(bigDecVal) != 0)) { sbuf.append("\nFor element " + i + "(" + j + "), expected = " + expected + ", actual = " + actualL + " . "); } } } else { sbuf.append("\nFor element " + i + ", expected = " + expected + ", actual = " + actual + " . "); } } } if (sbuf.length() > 0) { fail(ASSERTION_FAILED, "Expected and observed do not match!!" + sbuf.toString()); } } } tck/src/java/org/apache/jdo/tck/models/fieldtypes/TestCollectionCollections.java100664 14222 12500110373 30376 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.math.BigDecimal; import java.util.Collection; import java.util.List; import java.util.Vector; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.fieldtypes.CollectionCollections; import org.apache.jdo.tck.pc.fieldtypes.SimpleClass; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Support of field type Collection. *
*Keywords: model *
*Assertion ID: A6.4.3-33. *
*Assertion Description: JDO implementations must support fields of the interface type java.util.Collection, and may choose to support them as Second Class Objects or First Class Objects. */ public class TestCollectionCollections extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A6.4.3-33 (TestCollectionCollections) failed: "; /** * The main 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(TestCollectionCollections.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CollectionCollections.class); addTearDownClass(SimpleClass.class); } /** */ public void test() { pm = getPM(); runTest(pm); pm.close(); pm = null; } /** */ void runTest(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); CollectionCollections expectedValue = new CollectionCollections(); // turn on datastore transactions tx.setOptimistic(false); tx.begin(); CollectionCollections pi = new CollectionCollections(); pi.identifier = 1; pm.makePersistent(pi); Object oid = pm.getObjectId(pi); // Provide initial set of values setValues(pi, 1); tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); setValues(expectedValue, 1); // check if persistent fields have values set checkValues(oid, expectedValue); pi = (CollectionCollections) pm.getObjectById(oid, true); // Provide new set of values setValues(pi, 2); tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); // check new values setValues(expectedValue, 2); checkValues(oid, expectedValue); tx.commit(); } /** */ private void setValues(CollectionCollections colcol, int order) { Vector value; int n = colcol.getLength(); for (int i = 0; i < n; ++i) { String valueType = TestUtil.getFieldSpecs( CollectionCollections.fieldSpecs[i]); value = TestUtil.makeNewVectorInstance(valueType, order); colcol.set(i, value); if (debug) logger.debug("Set " + i + "th value to: " + value.toString()); } } /** */ private void checkValues(Object oid, CollectionCollections expectedValue) { StringBuffer sbuf = new StringBuffer(); CollectionCollections pi = (CollectionCollections) pm.getObjectById(oid, true); int n = pi.getLength(); for (int i = 0; i < n; ++i) { Collection expected = expectedValue.get(i); Collection actual = pi.get(i); if (actual.size() != expected.size()) { sbuf.append("\nFor element " + i + ", expected size = " + expected.size() + ", actual size = " + actual.size() + " . "); } else if (! expected.equals(actual)) { if (TestUtil.getFieldSpecs(CollectionCollections.fieldSpecs[i] ).equals("BigDecimal")) { if (debug) { logger.debug("Field is " + i + " Class name is " + actual.getClass().getName() + " isInstance of Vector is " + actual.getClass().isInstance((Object)new Vector())); } List expectedL = (List)expected; List actualL = (List)actual; for (int j = 0; j < actualL.size(); ++j) { BigDecimal bigDecCompareWith = (BigDecimal)expectedL.get(j); BigDecimal bigDecVal = (BigDecimal)actualL.get(j); if ((bigDecCompareWith.compareTo(bigDecVal) != 0)) { sbuf.append("\nFor element " + i + "(" + j + "), expected = " + expected + ", actual = " + actualL + " . "); } } } else { sbuf.append("\nFor element " + i + ", expected = " + expected + ", actual = " + actual + " . "); } } } if (sbuf.length() > 0) { fail(ASSERTION_FAILED, "Expected and observed do not match!!" + sbuf.toString()); } } } tck/src/java/org/apache/jdo/tck/models/fieldtypes/TestFieldsOfBigDecimal.java100664 7706 12500110373 27471 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.math.BigDecimal; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.fieldtypes.FieldsOfBigDecimal; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Support of field type BigDecimal. *
*Keywords: model *
*Assertion ID: A6.4.3-19. *
*Assertion Description: JDO implementations must support fields of the immutable object class java.math.BigDecimal, and may choose to support them as Second Class Objects or First Class Objects. */ public class TestFieldsOfBigDecimal extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A6.4.3-19 (TestFieldsOfBigDecimal) failed: "; /** * The main 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(TestFieldsOfBigDecimal.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(FieldsOfBigDecimal.class); } /** */ public void test() { pm = getPM(); runTest(pm); pm.close(); pm = null; } /** */ void runTest(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); int i, n; BigDecimal firstValue = new BigDecimal("20079.0237"); BigDecimal secondValue = new BigDecimal("8907489.658"); tx.begin(); FieldsOfBigDecimal pi = new FieldsOfBigDecimal(); pi.identifier = 1; pm.makePersistent(pi); Object oid = pm.getObjectId(pi); n = pi.getLength(); // Provide initial set of values for( i = 0; i < n; ++i){ pi.set( i, firstValue); } tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); pi = (FieldsOfBigDecimal) pm.getObjectById(oid, true); checkValues(oid, firstValue); // Provide new set of values for( i = 0; i < n; ++i){ pi.set(i, secondValue); } tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); // check new values checkValues(oid, secondValue); tx.commit(); } /** */ private void checkValues(Object oid, BigDecimal startValue){ int i; BigDecimal value; FieldsOfBigDecimal pi = (FieldsOfBigDecimal) pm.getObjectById(oid, true); int n = pi.getLength(); for( i = 0, value = startValue; i < n; ++i){ if( !FieldsOfBigDecimal.isPersistent[i] ) continue; BigDecimal val = pi.get(i); if(val.compareTo(value) != 0){ fail(ASSERTION_FAILED, "Incorrect value for " + FieldsOfBigDecimal.fieldSpecs[i] + ", expected value " + value.toString() + ", value is " + val.toString()); } } } } tck/src/java/org/apache/jdo/tck/models/fieldtypes/TestFieldsOfBigInteger.java100664 7737 12500110373 27534 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.math.BigInteger; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.fieldtypes.FieldsOfBigInteger; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Support of field type BigInteger. *
*Keywords: model *
*Assertion ID: A6.4.3-20. *
*Assertion Description: JDO implementations must support fields of the immutable object class java.math.BigInteger, and may choose to support them as Second Class Objects or First Class Objects. */ public class TestFieldsOfBigInteger extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A6.4.3-20 (TestFieldsOfBigInteger) failed: "; /** * The main 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(TestFieldsOfBigInteger.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(FieldsOfBigInteger.class); } /** */ public void test() { pm = getPM(); runTest(pm); pm.close(); pm = null; } /** */ void runTest(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); int i, n; BigInteger firstValue = new BigInteger("3958262948201938571947294821"); BigInteger secondValue = new BigInteger("896738"); tx.begin(); FieldsOfBigInteger pi = new FieldsOfBigInteger(); pi.identifier = 1; pm.makePersistent(pi); Object oid = pm.getObjectId(pi); n = pi.getLength(); // Provide initial set of values for( i = 0; i < n; ++i){ pi.set( i, firstValue); } tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); pi = (FieldsOfBigInteger) pm.getObjectById(oid, true); checkValues(oid, firstValue); // Provide new set of values for( i = 0; i < n; ++i){ pi.set(i, secondValue); } tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); // check new values checkValues(oid, secondValue); tx.commit(); } /** */ private void checkValues(Object oid, BigInteger startValue){ int i; BigInteger value = startValue; FieldsOfBigInteger pi = (FieldsOfBigInteger) pm.getObjectById(oid, true); int n = pi.getLength(); for( i = 0; i < n; ++i){ if( !FieldsOfBigInteger.isPersistent[i] ) continue; BigInteger val = pi.get(i); if(!val.equals(value) ){ fail(ASSERTION_FAILED, "Incorrect value for " + FieldsOfBigInteger.fieldSpecs[i] + ", expected value " + value.toString() + ", value is " + val.toString()); } } } } tck/src/java/org/apache/jdo/tck/models/fieldtypes/TestFieldsOfBoolean.java100664 7507 12500110373 27067 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.fieldtypes.FieldsOfBoolean; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Support of field type Boolean. *
*Keywords: model *
*Assertion ID: A6.4.3-9. *
*Assertion Description: JDO implementations must support fields of the immutable object class java.lang.Boolean, and may choose to support them as Second Class Objects or First Class Objects. */ public class TestFieldsOfBoolean extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A6.4.3-9 (TestFieldsOfBoolean) failed: "; /** * The main 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(TestFieldsOfBoolean.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(FieldsOfBoolean.class); } /** */ public void test() { pm = getPM(); runTest(pm); pm.close(); pm = null; } /** */ void runTest(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); int i, n; Boolean firstValue = new Boolean(true); Boolean secondValue = new Boolean(false); tx.begin(); FieldsOfBoolean pi = new FieldsOfBoolean(); pi.identifier = 1; pm.makePersistent(pi); Object oid = pm.getObjectId(pi); n = pi.getLength(); // Provide initial set of values for( i = 0; i < n; ++i){ pi.set( i, firstValue); } tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); pi = (FieldsOfBoolean) pm.getObjectById(oid, true); checkValues(oid, firstValue); // Provide new set of values for( i = 0; i < n; ++i){ pi.set(i, secondValue); } tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); // check new values checkValues(oid, secondValue); tx.commit(); } /** */ private void checkValues(Object oid, Boolean startValue){ int i; FieldsOfBoolean pi = (FieldsOfBoolean) pm.getObjectById(oid, true); int n = pi.getLength(); for( i = 0; i < n; ++i){ if( !FieldsOfBoolean.isPersistent[i] ) continue; Boolean val = pi.get(i); if(!val.equals(startValue) ){ fail(ASSERTION_FAILED, "Incorrect value for " + FieldsOfBoolean.fieldSpecs[i] + ", expected value " + startValue.toString() + ", value is " + val.toString()); } } } } tck/src/java/org/apache/jdo/tck/models/fieldtypes/TestFieldsOfByte.java100664 7446 12500110373 26415 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.fieldtypes.FieldsOfByte; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Support of field type Byte. *
*Keywords: model *
*Assertion ID: A6.4.3-11. *
*Assertion Description: JDO implementations must support fields of the immutable object class java.lang.Byte, and may choose to support them as Second Class Objects or First Class Objects. */ public class TestFieldsOfByte extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A6.4.3-11 (TestFieldsOfByte) failed: "; /** * The main 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(TestFieldsOfByte.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(FieldsOfByte.class); } /** */ public void test() { pm = getPM(); runTest(pm); pm.close(); pm = null; } /** */ void runTest(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); int i, n; Byte firstValue = new Byte((byte)Byte.MIN_VALUE); Byte secondValue = new Byte((byte)Byte.MAX_VALUE); tx.begin(); FieldsOfByte pi = new FieldsOfByte(); pi.identifier = 1; pm.makePersistent(pi); Object oid = pm.getObjectId(pi); n = pi.getLength(); // Provide initial set of values for( i = 0; i < n; ++i){ pi.set( i, firstValue); } tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); pi = (FieldsOfByte) pm.getObjectById(oid, true); checkValues(oid, firstValue); // Provide new set of values for( i = 0; i < n; ++i){ pi.set(i, secondValue); } tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); // check new values checkValues(oid, secondValue); tx.commit(); } /** */ private void checkValues(Object oid, Byte startValue){ int i; FieldsOfByte pi = (FieldsOfByte) pm.getObjectById(oid, true); int n = pi.getLength(); for( i = 0; i < n; ++i){ if( !FieldsOfByte.isPersistent[i] ) continue; Byte val = pi.get(i); if(!val.equals(startValue) ){ fail(ASSERTION_FAILED, "Incorrect value for " + FieldsOfByte.fieldSpecs[i] + ", expected value " + startValue.toString() + ", value is " + val.toString()); } } } } tck/src/java/org/apache/jdo/tck/models/fieldtypes/TestFieldsOfCharacter.java100664 7623 12500110373 27403 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.fieldtypes.FieldsOfCharacter; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Support of field type Character. *
*Keywords: model *
*Assertion ID: A6.4.3-10. *
*Assertion Description: JDO implementations must support fields of the immutable object class java.lang.Character, and may choose to support them as Second Class Objects or First Class Objects. */ public class TestFieldsOfCharacter extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A6.4.3-10 (TestFieldsOfCharacter) failed: "; /** * The main 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(TestFieldsOfCharacter.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(FieldsOfCharacter.class); } /** */ public void test() { pm = getPM(); runTest(pm); pm.close(); pm = null; } /** */ void runTest(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); int i, n; Character firstValue = new Character((char)Character.MIN_VALUE); Character secondValue = new Character((char)Character.MAX_VALUE); tx.begin(); FieldsOfCharacter pi = new FieldsOfCharacter(); pi.identifier = 1; pm.makePersistent(pi); Object oid = pm.getObjectId(pi); n = pi.getLength(); // Provide initial set of values for( i = 0; i < n; ++i){ pi.set( i, firstValue); } tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); pi = (FieldsOfCharacter) pm.getObjectById(oid, true); checkValues(oid, firstValue); // Provide new set of values for( i = 0; i < n; ++i){ pi.set(i, secondValue); } tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); // check new values checkValues(oid, secondValue); tx.commit(); } /** */ private void checkValues(Object oid, Character startValue){ int i; FieldsOfCharacter pi = (FieldsOfCharacter) pm.getObjectById(oid, true); int n = pi.getLength(); for( i = 0; i < n; ++i){ if( !FieldsOfCharacter.isPersistent[i] ) continue; Character val = pi.get(i); if(!val.equals(startValue) ){ fail(ASSERTION_FAILED, "Incorrect value for " + FieldsOfCharacter.fieldSpecs[i] + ", expected value " + startValue.toString() + ", value is " + val.toString()); } } } } tck/src/java/org/apache/jdo/tck/models/fieldtypes/TestFieldsOfDate.java100664 7425 12500110373 26364 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.util.Date; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.fieldtypes.FieldsOfDate; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Support of field type Date. *
*Keywords: model *
*Assertion ID: A6.4.3-21. *
*Assertion Description: JDO implementations must support fields of the mutable object class java.util.Date, and may choose to support them as Second Class Objects or First Class Objects. */ public class TestFieldsOfDate extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A6.4.3-21 (TestFieldsOfDate) failed: "; /** * The main 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(TestFieldsOfDate.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(FieldsOfDate.class); } /** */ public void test() { pm = getPM(); runTest(pm); pm.close(); pm = null; } /** */ void runTest(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); int i, n; Date firstValue = new Date(2007908); Date secondValue = new Date(890748967382l); tx.begin(); FieldsOfDate pi = new FieldsOfDate(); pi.identifier = 1; pm.makePersistent(pi); Object oid = pm.getObjectId(pi); n = pi.getLength(); // Provide initial set of values for( i = 0; i < n; ++i){ pi.set( i, firstValue); } tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); pi = (FieldsOfDate) pm.getObjectById(oid, true); checkValues(oid, firstValue); // Provide new set of values for( i = 0; i < n; ++i){ pi.set(i, secondValue); } tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); // check new values checkValues(oid, secondValue); tx.commit(); } /** */ private void checkValues(Object oid, Date startValue){ int i; FieldsOfDate pi = (FieldsOfDate) pm.getObjectById(oid, true); int n = pi.getLength(); for( i = 0; i < n; ++i){ if( !FieldsOfDate.isPersistent[i] ) continue; Date val = pi.get(i); if(!val.equals(startValue) ){ fail(ASSERTION_FAILED, "Incorrect value for " + FieldsOfDate.fieldSpecs[i] + ", expected value " + startValue.toString() + ", value is " + val.toString()); } } } } tck/src/java/org/apache/jdo/tck/models/fieldtypes/TestFieldsOfDouble.java100664 7563 12500110373 26724 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.fieldtypes.AllTypes; import org.apache.jdo.tck.pc.fieldtypes.FieldsOfDouble; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Support of field type Double. *
*Keywords: model *
*Assertion ID: A6.4.3-16. *
*Assertion Description: JDO implementations must support fields of the immutable object class java.lang.Double, and may choose to support them as Second Class Objects or First Class Objects. */ public class TestFieldsOfDouble extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A6.4.3-16 (TestFieldsOfDouble) failed: "; /** * The main 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(TestFieldsOfDouble.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(FieldsOfDouble.class); } /** */ public void test() { pm = getPM(); runTest(pm); pm.close(); pm = null; } /** */ void runTest(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); int i, n; Double firstValue = new Double(AllTypes.DOUBLE_SMALLEST); Double secondValue = new Double(AllTypes.DOUBLE_LARGEST); tx.begin(); FieldsOfDouble pi = new FieldsOfDouble(); pi.identifier = 1; pm.makePersistent(pi); Object oid = pm.getObjectId(pi); n = pi.getLength(); // Provide initial set of values for( i = 0; i < n; ++i){ pi.set( i, firstValue); } tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); pi = (FieldsOfDouble) pm.getObjectById(oid, true); checkValues(oid, firstValue); // Provide new set of values for( i = 0; i < n; ++i){ pi.set(i, secondValue); } tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); // check new values checkValues(oid, secondValue); tx.commit(); } /** */ private void checkValues(Object oid, Double startValue){ int i; FieldsOfDouble pi = (FieldsOfDouble) pm.getObjectById(oid, true); int n = pi.getLength(); for( i = 0; i < n; ++i){ if( !FieldsOfDouble.isPersistent[i] ) continue; Double val = pi.get(i); if(!val.equals(startValue) ){ fail(ASSERTION_FAILED, "Incorrect value for " + FieldsOfDouble.fieldSpecs[i] + ", expected value " + startValue.toString() + ", value is " + val.toString()); } } } } tck/src/java/org/apache/jdo/tck/models/fieldtypes/TestFieldsOfFloat.java100664 7535 12500110373 26556 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.fieldtypes.AllTypes; import org.apache.jdo.tck.pc.fieldtypes.FieldsOfFloat; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Support of field type Float. *
*Keywords: model *
*Assertion ID: A6.4.3-15. *
*Assertion Description: JDO implementations must support fields of the immutable object class java.lang.Float, and may choose to support them as Second Class Objects or First Class Objects. */ public class TestFieldsOfFloat extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A6.4.3-15 (TestFieldsOfFloat) failed: "; /** * The main 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(TestFieldsOfFloat.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(FieldsOfFloat.class); } /** */ public void test() { pm = getPM(); runTest(pm); pm.close(); pm = null; } /** */ void runTest(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); int i, n; Float firstValue = new Float(AllTypes.FLOAT_SMALLEST); Float secondValue = new Float(AllTypes.FLOAT_LARGEST); tx.begin(); FieldsOfFloat pi = new FieldsOfFloat(); pi.identifier = 1; pm.makePersistent(pi); Object oid = pm.getObjectId(pi); n = pi.getLength(); // Provide initial set of values for( i = 0; i < n; ++i){ pi.set( i, firstValue); } tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); pi = (FieldsOfFloat) pm.getObjectById(oid, true); checkValues(oid, firstValue); // Provide new set of values for( i = 0; i < n; ++i){ pi.set(i, secondValue); } tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); // check new values checkValues(oid, secondValue); tx.commit(); } /** */ private void checkValues(Object oid, Float startValue){ int i; FieldsOfFloat pi = (FieldsOfFloat) pm.getObjectById(oid, true); int n = pi.getLength(); for( i = 0; i < n; ++i){ if( !FieldsOfFloat.isPersistent[i] ) continue; Float val = pi.get(i); if(!val.equals(startValue) ){ fail(ASSERTION_FAILED, "Incorrect value for " + FieldsOfFloat.fieldSpecs[i] + ", expected value " + startValue.toString() + ", value is " + val.toString()); } } } } tck/src/java/org/apache/jdo/tck/models/fieldtypes/TestFieldsOfInteger.java100664 7453 12500110373 27105 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.fieldtypes.FieldsOfInteger; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Support of field type Integer. *
*Keywords: model *
*Assertion ID: A6.4.3-13. *
*Assertion Description: JDO implementations must support fields of the immutable object class java.lang.Integer, and may choose to support them as Second Class Objects or First Class Objects. */ public class TestFieldsOfInteger extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A6.4.3-13 (TestFieldsOfInteger) failed: "; /** * The main 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(TestFieldsOfInteger.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(FieldsOfInteger.class); } /** */ public void test() { pm = getPM(); runTest(pm); pm.close(); pm = null; } /** */ void runTest(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); int i, n; Integer firstValue = new Integer(Integer.MIN_VALUE); Integer secondValue = new Integer(Integer.MAX_VALUE); tx.begin(); FieldsOfInteger pi = new FieldsOfInteger(); pi.identifier = 1; pm.makePersistent(pi); Object oid = pm.getObjectId(pi); n = pi.getLength(); // Provide initial set of values for( i = 0; i < n; ++i){ pi.set( i, firstValue); } tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); pi = (FieldsOfInteger) pm.getObjectById(oid, true); checkValues(oid, firstValue); // Provide new set of values for( i = 0; i < n; ++i){ pi.set(i, secondValue); } tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); // check new values checkValues(oid, secondValue); tx.commit(); } /** */ private void checkValues(Object oid, Integer startValue){ int i; FieldsOfInteger pi = (FieldsOfInteger) pm.getObjectById(oid, true); int n = pi.getLength(); for( i = 0; i < n; ++i){ if( !FieldsOfInteger.isPersistent[i] ) continue; Integer val = pi.get(i); if(!val.equals(startValue) ){ fail(ASSERTION_FAILED, "Incorrect value for " + FieldsOfInteger.fieldSpecs[i] + ", expected value " + startValue.toString() + ", value is " + val.toString()); } } } } tck/src/java/org/apache/jdo/tck/models/fieldtypes/TestFieldsOfLocale.java100664 7445 12500110373 26710 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.util.Locale; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.fieldtypes.FieldsOfLocale; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Support of field type Locale. *
*Keywords: model *
*Assertion ID: A6.4.3-18. *
*Assertion Description: JDO implementations must support fields of the immutable object class java.util.Locale, and may choose to support them as Second Class Objects or First Class Objects. */ public class TestFieldsOfLocale extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A6.4.3-18 (TestFieldsOfLocale) failed: "; /** * The main 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(TestFieldsOfLocale.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(FieldsOfLocale.class); } /** */ public void test() { pm = getPM(); runTest(pm); pm.close(); pm = null; } /** */ void runTest(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); int i, n; Locale firstValue = Locale.CHINA; Locale secondValue = Locale.JAPANESE; tx.begin(); FieldsOfLocale pi = new FieldsOfLocale(); pi.identifier = 1; pm.makePersistent(pi); Object oid = pm.getObjectId(pi); n = pi.getLength(); // Provide initial set of values for( i = 0; i < n; ++i){ pi.set( i, firstValue); } tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); pi = (FieldsOfLocale) pm.getObjectById(oid, true); checkValues(oid, firstValue); // Provide new set of values for( i = 0; i < n; ++i){ pi.set(i, secondValue); } tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); // check new values checkValues(oid, secondValue); tx.commit(); } /** */ private void checkValues(Object oid, Locale startValue){ int i; Locale value; FieldsOfLocale pi = (FieldsOfLocale) pm.getObjectById(oid, true); int n = pi.getLength(); for( i = 0; i < n; ++i){ if( !FieldsOfLocale.isPersistent[i] ) continue; Locale val = pi.get(i); if(!val.equals(startValue) ){ fail(ASSERTION_FAILED, "Incorrect value for " + FieldsOfLocale.fieldSpecs[i] + ", expected value " + startValue.toString() + ", value is " + val.toString()); } } } } tck/src/java/org/apache/jdo/tck/models/fieldtypes/TestFieldsOfLong.java100664 7404 12500110373 26403 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.fieldtypes.FieldsOfLong; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Support of field type Long. *
*Keywords: model *
*Assertion ID: A6.4.3-14. *
*Assertion Description: JDO implementations must support fields of the immutable object class java.lang.Long, and may choose to support them as Second Class Objects or First Class Objects. */ public class TestFieldsOfLong extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A6.4.3-14 (TestFieldsOfLong) failed: "; /** * The main 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(TestFieldsOfLong.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(FieldsOfLong.class); } /** */ public void test() { pm = getPM(); runTest(pm); pm.close(); pm = null; } /** */ void runTest(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); int i, n; Long firstValue = new Long(Long.MIN_VALUE); Long secondValue = new Long(Long.MAX_VALUE); tx.begin(); FieldsOfLong pi = new FieldsOfLong(); pi.identifier = 1; pm.makePersistent(pi); Object oid = pm.getObjectId(pi); n = pi.getLength(); // Provide initial set of values for( i = 0; i < n; ++i){ pi.set( i, firstValue); } tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); pi = (FieldsOfLong) pm.getObjectById(oid, true); checkValues(oid, firstValue); // Provide new set of values for( i = 0; i < n; ++i){ pi.set(i, secondValue); } tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); // check new values checkValues(oid, secondValue); tx.commit(); } /** */ private void checkValues(Object oid, Long startValue){ int i; FieldsOfLong pi = (FieldsOfLong) pm.getObjectById(oid, true); int n = pi.getLength(); for( i = 0; i < n; ++i){ if( !FieldsOfLong.isPersistent[i] ) continue; Long val = pi.get(i); if(!val.equals(startValue) ){ fail(ASSERTION_FAILED, "Incorrect value for " + FieldsOfLong.fieldSpecs[i] + ", expected value " + startValue.toString() + ", value is " + val.toString()); } } } } tck/src/java/org/apache/jdo/tck/models/fieldtypes/TestFieldsOfObject.java100664 11145 12500110373 26727 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.fieldtypes.FieldsOfObject; import org.apache.jdo.tck.pc.fieldtypes.SimpleClass; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Support of field type Object. *
*Keywords: model *
*Assertion ID: A6.4.3-31. *
*Assertion Description: JDO implementations must support fields of Object class type as First Class Objects. The implementation is permitted, but is not required, to allow any class to be assigned to the field. If an implementation restricts instances to be assigned to the field, a ClassCastException must be thrown at the time of any incorrect assignment. */ public class TestFieldsOfObject extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A6.4.3-31 (TestFieldsOfObject) failed: "; /** * The main 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(TestFieldsOfObject.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(FieldsOfObject.class); } /** */ public void test() { pm = getPM(); runTest(pm); pm.close(); pm = null; } /** */ void runTest(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); int i, n; Object firstValue = new SimpleClass(1, "Hello"); Object secondValue = new SimpleClass(333, "420"); tx.begin(); FieldsOfObject pi = new FieldsOfObject(); pi.identifier = 1; pm.makePersistent(pi); Object oid = pm.getObjectId(pi); n = pi.getLength(); // Provide initial set of values for( i = 0; i < n; ++i){ pi.set( i, firstValue); } tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); pi = (FieldsOfObject) pm.getObjectById(oid, true); checkValues(oid, firstValue); // Provide new set of values for( i = 0; i < n; ++i){ pi.set(i, secondValue); } tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); // check new values checkValues(oid, secondValue); tx.commit(); } /** */ private void checkValues(Object oid, Object startValue){ int i; FieldsOfObject pi = (FieldsOfObject) pm.getObjectById(oid, true); int n = pi.getLength(); StringBuffer buffer = new StringBuffer(); for( i = 0; i < n; ++i){ if( !FieldsOfObject.isPersistent[i] ) continue; Object val = pi.get(i); if (val == null) { buffer.append("Field "); buffer.append(FieldsOfObject.fieldSpecs[i]); buffer.append(" is null. Expected "); buffer.append(startValue.toString()); buffer.append(".\n"); continue; } if(!val.equals(startValue) ){ buffer.append("Field "); buffer.append(FieldsOfObject.fieldSpecs[i]); buffer.append(" has wrong value: expected "); buffer.append(startValue.toString()); buffer.append(" actual "); buffer.append(val.toString()); buffer.append(".\n"); } } if (buffer.length() > 0) { fail(ASSERTION_FAILED, buffer.toString()); } } } tck/src/java/org/apache/jdo/tck/models/fieldtypes/TestFieldsOfPrimitiveboolean.java100664 7410 12500110373 31011 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.fieldtypes.FieldsOfPrimitiveboolean; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Support of field type boolean. *
*Keywords: model *
*Assertion ID: A6.4.3-1. *
*Assertion Description: JDO implementations must support fields of the primitive type boolean. */ public class TestFieldsOfPrimitiveboolean extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A6.4.3-1 (TestFieldsOfPrimitiveboolean) failed: "; /** * The main 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(TestFieldsOfPrimitiveboolean.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(FieldsOfPrimitiveboolean.class); } /** */ public void test() { pm = getPM(); runTest(pm); pm.close(); pm = null; } /** */ void runTest(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); int i, n; boolean value; tx.begin(); FieldsOfPrimitiveboolean pi = new FieldsOfPrimitiveboolean(); pi.identifier = 1; pm.makePersistent(pi); Object oid = pm.getObjectId(pi); n = pi.getLength(); // Provide initial set of values for( i = 0, value = true; i < n; ++i){ pi.set( i, value); } tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); pi = (FieldsOfPrimitiveboolean) pm.getObjectById(oid, true); checkValues(oid, true); // Provide new set of values for( i = 0, value = false; i < n; ++i){ pi.set(i, value); } tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); // check new values checkValues(oid, false); tx.commit(); } /** */ private void checkValues(Object oid, boolean startValue){ int i; FieldsOfPrimitiveboolean pi = (FieldsOfPrimitiveboolean) pm.getObjectById(oid, true); int n = pi.getLength(); for( i = 0; i < n; ++i){ if( !FieldsOfPrimitiveboolean.isPersistent[i] ) continue; boolean val = pi.get(i); if( val != startValue ){ fail(ASSERTION_FAILED, "Incorrect value for " + FieldsOfPrimitiveboolean.fieldSpecs[i] + ", expected value " + startValue + ", value is " + val); } } } } tck/src/java/org/apache/jdo/tck/models/fieldtypes/TestFieldsOfPrimitivebyte.java100664 7330 12500110373 30336 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.fieldtypes.FieldsOfPrimitivebyte; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Support of field type byte. *
*Keywords: model *
*Assertion ID: A6.4.3-2. *
*Assertion Description: JDO implementations must support fields of the primitive type int. */ public class TestFieldsOfPrimitivebyte extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A6.4.3-2 (TestFieldsOfPrimitivebyte) failed: "; /** * The main 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(TestFieldsOfPrimitivebyte.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(FieldsOfPrimitivebyte.class); } /** */ public void test() { pm = getPM(); runTest(pm); pm.close(); pm = null; } /** */ void runTest(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); int i, n; byte value; tx.begin(); FieldsOfPrimitivebyte pi = new FieldsOfPrimitivebyte(); pi.identifier = 1; pm.makePersistent(pi); Object oid = pm.getObjectId(pi); n = pi.getLength(); // Provide initial set of values for( i = 0, value = 10; i < n; ++i){ pi.set( i, value); } tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); pi = (FieldsOfPrimitivebyte) pm.getObjectById(oid, true); checkValues(oid, (byte)10); // Provide new set of values for( i = 0, value = 127; i < n; ++i){ pi.set(i, value); } tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); // check new values checkValues(oid, (byte)127); tx.commit(); } /** */ private void checkValues(Object oid, byte startValue){ int i; FieldsOfPrimitivebyte pi = (FieldsOfPrimitivebyte) pm.getObjectById(oid, true); int n = pi.getLength(); for( i = 0; i < n; ++i){ if( !FieldsOfPrimitivebyte.isPersistent[i] ) continue; byte val = pi.get(i); if( val != startValue ){ fail(ASSERTION_FAILED, "Incorrect value for " + FieldsOfPrimitivebyte.fieldSpecs[i] + ", expected value " + startValue + ", value is " + val); } } } } tck/src/java/org/apache/jdo/tck/models/fieldtypes/TestFieldsOfPrimitivechar.java100664 7373 12500110373 30317 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.fieldtypes.FieldsOfPrimitivechar; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Support of field type char. *
*Keywords: model *
*Assertion ID: A6.4.3-6. *
*Assertion Description: JDO implementations must support fields of the primitive type char. */ public class TestFieldsOfPrimitivechar extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A6.4.3-6 (TestFieldsOfPrimitivechar) failed: "; /** * The main 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(TestFieldsOfPrimitivechar.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(FieldsOfPrimitivechar.class); } /** */ public void test() { pm = getPM(); runTest(pm); pm.close(); pm = null; } /** */ void runTest(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); int i, n; char value; tx.begin(); FieldsOfPrimitivechar pi = new FieldsOfPrimitivechar(); pi.identifier = 1; pm.makePersistent(pi); Object oid = pm.getObjectId(pi); n = pi.getLength(); // Provide initial set of values for( i = 0, value = 'a'; i < n; ++i){ pi.set( i, value); } tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); pi = (FieldsOfPrimitivechar) pm.getObjectById(oid, true); checkValues(oid, 'a'); // check if persistent fields have values set // Provide new set of values for( i = 0, value = 'Z'; i < n; ++i){ pi.set(i, value); } tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); // check new values checkValues(oid, 'Z'); tx.commit(); } /** */ private void checkValues(Object oid, char startValue){ int i; FieldsOfPrimitivechar pi = (FieldsOfPrimitivechar) pm.getObjectById(oid, true); int n = pi.getLength(); for( i = 0; i < n; ++i){ if( !FieldsOfPrimitivechar.isPersistent[i] ) continue; char val = pi.get(i); if( val != startValue ){ fail(ASSERTION_FAILED, "Incorrect value for " + FieldsOfPrimitivechar.fieldSpecs[i] + ", expected value " + startValue + ", value is " + val); } } } } tck/src/java/org/apache/jdo/tck/models/fieldtypes/TestFieldsOfPrimitivedouble.java100664 7436 12500110373 30654 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.fieldtypes.FieldsOfPrimitivedouble; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Support of field type double. *
*Keywords: model *
*Assertion ID: A6.4.3-8. *
*Assertion Description: JDO implementations must support fields of the primitive type double. */ public class TestFieldsOfPrimitivedouble extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A6.4.3-8 (TestFieldsOfPrimitivedouble) failed: "; /** * The main 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(TestFieldsOfPrimitivedouble.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(FieldsOfPrimitivedouble.class); } /** */ public void test() { pm = getPM(); runTest(pm); pm.close(); pm = null; } /** */ void runTest(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); int i, n; double value; tx.begin(); FieldsOfPrimitivedouble pi = new FieldsOfPrimitivedouble(); pi.identifier = 1; pm.makePersistent(pi); Object oid = pm.getObjectId(pi); n = pi.getLength(); // Provide initial set of values for( i = 0, value = (double)10.15; i < n; ++i){ pi.set( i, value); } tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); pi = (FieldsOfPrimitivedouble) pm.getObjectById(oid, true); checkValues(oid, (double)10.15); // Provide new set of values for( i = 0, value = (double)68000.15; i < n; ++i){ pi.set(i, value); } tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); // check new values checkValues(oid, (double)68000.15); tx.commit(); } /** */ private void checkValues(Object oid, double startValue){ int i; FieldsOfPrimitivedouble pi = (FieldsOfPrimitivedouble) pm.getObjectById(oid, true); int n = pi.getLength(); for( i = 0; i < n; ++i){ if( !FieldsOfPrimitivedouble.isPersistent[i] ) continue; double val = pi.get(i); if( val != startValue ){ fail(ASSERTION_FAILED, "Incorrect value for " + FieldsOfPrimitivedouble.fieldSpecs[i] + ", expected value " + startValue + ", value is " + val); } } } } tck/src/java/org/apache/jdo/tck/models/fieldtypes/TestFieldsOfPrimitivefloat.java100664 7412 12500110373 30501 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.fieldtypes.FieldsOfPrimitivefloat; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Support of field type float. *
*Keywords: model *
*Assertion ID: A6.4.3-7. *
*Assertion Description: JDO implementations must support fields of the primitive type float. */ public class TestFieldsOfPrimitivefloat extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A6.4.3-7 (TestFieldsOfPrimitivefloat) failed: "; /** * The main 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(TestFieldsOfPrimitivefloat.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(FieldsOfPrimitivefloat.class); } /** */ public void test() { pm = getPM(); runTest(pm); pm.close(); pm = null; } /** */ void runTest(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); int i, n; float value; tx.begin(); FieldsOfPrimitivefloat pi = new FieldsOfPrimitivefloat(); pi.identifier = 1; pm.makePersistent(pi); Object oid = pm.getObjectId(pi); n = pi.getLength(); // Provide initial set of values for( i = 0, value = (float)10.15; i < n; ++i){ pi.set( i, value); } tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); pi = (FieldsOfPrimitivefloat) pm.getObjectById(oid, true); checkValues(oid, (float)10.15); // Provide new set of values for( i = 0, value = (float)33000.15; i < n; ++i){ pi.set(i, value); } tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); // check new values checkValues(oid, (float)33000.15); tx.commit(); } /** */ private void checkValues(Object oid, float startValue){ int i; FieldsOfPrimitivefloat pi = (FieldsOfPrimitivefloat) pm.getObjectById(oid, true); int n = pi.getLength(); for( i = 0; i < n; ++i){ if( !FieldsOfPrimitivefloat.isPersistent[i] ) continue; float val = pi.get(i); if( val != startValue ){ fail(ASSERTION_FAILED, "Incorrect value for " + FieldsOfPrimitivefloat.fieldSpecs[i] + ", expected value " + startValue + ", value is " + val); } } } } tck/src/java/org/apache/jdo/tck/models/fieldtypes/TestFieldsOfPrimitiveint.java100664 7465 12500110373 30176 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.fieldtypes.FieldsOfPrimitiveint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Support of field type int. *
*Keywords: model *
*Assertion ID: A6.4.3-4. *
*Assertion Description: JDO implementations must support fields of the primitive type int. */ public class TestFieldsOfPrimitiveint extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A6.4.3-4 (TestFieldsOfPrimitiveint) failed: "; /** * The main 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(TestFieldsOfPrimitiveint.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(FieldsOfPrimitiveint.class); } /** */ public void test() { pm = getPM(); runTest(pm); pm.close(); pm = null; } /** */ void runTest(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); int i, n, value; tx.begin(); FieldsOfPrimitiveint pi = new FieldsOfPrimitiveint(); pi.identifier = 1; pm.makePersistent(pi); Object oid = pm.getObjectId(pi); n = pi.getLength(); // Provide initial set of values for( i = 0, value = 0; i < n; ++i, ++value ){ pi.set( i, value); } tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); pi = (FieldsOfPrimitiveint) pm.getObjectById(oid, true); checkValues(oid, 0); // check if persistent fields have values set // Provide new set of values for( i = 0, value = 1000; i < n; ++i, ++value ){ pi.set(i, value); } tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); // check new values checkValues(oid, 1000); tx.commit(); } /** */ private void checkValues(Object oid, int startValue){ int i, value; FieldsOfPrimitiveint pi = (FieldsOfPrimitiveint) pm.getObjectById(oid, true); int n = pi.getLength(); for( i = 0, value = startValue; i < n; ++i, ++value){ if( !FieldsOfPrimitiveint.isPersistent[i] ) continue; int val = pi.get(i); if( val != value ){ fail(ASSERTION_FAILED, "Incorrect value for " + FieldsOfPrimitiveint.fieldSpecs[i] + ", expected value " + startValue + ", value is " + val); } } } } tck/src/java/org/apache/jdo/tck/models/fieldtypes/TestFieldsOfPrimitivelong.java100664 7423 12500110373 30335 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.fieldtypes.FieldsOfPrimitivelong; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Support of field type long. *
*Keywords: model *
*Assertion ID: A6.4.3-5. *
*Assertion Description: JDO implementations must support fields of the primitive type long. */ public class TestFieldsOfPrimitivelong extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A6.4.3-5 (TestFieldsOfPrimitivelong) failed: "; /** * The main 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(TestFieldsOfPrimitivelong.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(FieldsOfPrimitivelong.class); } /** */ public void test() { pm = getPM(); runTest(pm); pm.close(); pm = null; } /** */ void runTest(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); int i, n; long value; tx.begin(); FieldsOfPrimitivelong pi = new FieldsOfPrimitivelong(); pi.identifier = 1; pm.makePersistent(pi); Object oid = pm.getObjectId(pi); n = pi.getLength(); // Provide initial set of values for( i = 0, value = 10; i < n; ++i){ pi.set( i, value); } tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); pi = (FieldsOfPrimitivelong) pm.getObjectById(oid, true); checkValues(oid, 10); // check if persistent fields have values set // Provide new set of values for( i = 0, value = 67000; i < n; ++i){ pi.set(i, value); } tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); // check new values checkValues(oid, 67000); tx.commit(); } /** */ private void checkValues(Object oid, long startValue){ int i; long value; FieldsOfPrimitivelong pi = (FieldsOfPrimitivelong) pm.getObjectById(oid, true); int n = pi.getLength(); for( i = 0; i < n; ++i){ if( !FieldsOfPrimitivelong.isPersistent[i] ) continue; long val = pi.get(i); if( val != startValue ){ fail(ASSERTION_FAILED, "Incorrect value for " + FieldsOfPrimitivelong.fieldSpecs[i] + ", expected value " + startValue + ", value is " + val); } } } } tck/src/java/org/apache/jdo/tck/models/fieldtypes/TestFieldsOfPrimitiveshort.java100664 7356 12500110373 30542 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.fieldtypes.FieldsOfPrimitiveshort; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Support of field type short. *
*Keywords: model *
*Assertion ID: A6.4.3-3. *
*Assertion Description: JDO implementations must support fields of the primitive type short. */ public class TestFieldsOfPrimitiveshort extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A6.4.3-3 (TestFieldsOfPrimitiveshort) failed: "; /** * The main 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(TestFieldsOfPrimitiveshort.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(FieldsOfPrimitiveshort.class); } /** */ public void test() { pm = getPM(); runTest(pm); pm.close(); pm = null; } /** */ void runTest(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); int i, n; short value; tx.begin(); FieldsOfPrimitiveshort pi = new FieldsOfPrimitiveshort(); pi.identifier = 1; pm.makePersistent(pi); Object oid = pm.getObjectId(pi); n = pi.getLength(); // Provide initial set of values for( i = 0, value = 10; i < n; ++i){ pi.set( i, value); } tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); pi = (FieldsOfPrimitiveshort) pm.getObjectById(oid, true); checkValues(oid, (short)10); // Provide new set of values for( i = 0, value = 32000; i < n; ++i){ pi.set(i, value); } tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); // check new values checkValues(oid, (short)32000); tx.commit(); } /** */ private void checkValues(Object oid, short startValue){ int i; FieldsOfPrimitiveshort pi = (FieldsOfPrimitiveshort) pm.getObjectById(oid, true); int n = pi.getLength(); for( i = 0; i < n; ++i){ if( !FieldsOfPrimitiveshort.isPersistent[i] ) continue; short val = pi.get(i); if( val != startValue ){ fail(ASSERTION_FAILED, "Incorrect value for " + FieldsOfPrimitiveshort.fieldSpecs[i] + ", expected value " + startValue + ", value is " + val); } } } } tck/src/java/org/apache/jdo/tck/models/fieldtypes/TestFieldsOfShort.java100664 7515 12500110373 26606 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.fieldtypes.FieldsOfShort; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Support of field type Short. *
*Keywords: model *
*Assertion ID: A6.4.3-12. *
*Assertion Description: JDO implementations must support fields of the immutable object class java.lang.Short, and may choose to support them as Second Class Objects or First Class Objects. */ public class TestFieldsOfShort extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A6.4.3-12 (TestFieldsOfShort) failed: "; /** * The main 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(TestFieldsOfShort.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(FieldsOfShort.class); } /** */ public void test() { pm = getPM(); runTest(pm); pm.close(); pm = null; } /** */ void runTest(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); int i, n; Short firstValue = new Short(Short.MIN_VALUE); Short secondValue = new Short(Short.MAX_VALUE); tx.begin(); FieldsOfShort pi = new FieldsOfShort(); pi.identifier = 1; pm.makePersistent(pi); Object oid = pm.getObjectId(pi); n = pi.getLength(); // Provide initial set of values for( i = 0; i < n; ++i){ pi.set( i, firstValue); } tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); pi = (FieldsOfShort) pm.getObjectById(oid, true); checkValues(oid, firstValue); // Provide new set of values for( i = 0; i < n; ++i){ pi.set(i, secondValue); } tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); // check new values checkValues(oid, secondValue); tx.commit(); } /** */ private void checkValues(Object oid, Short startValue){ int i; Short value; FieldsOfShort pi = (FieldsOfShort) pm.getObjectById(oid, true); int n = pi.getLength(); for( i = 0, value = startValue; i < n; ++i){ if( !FieldsOfShort.isPersistent[i] ) continue; Short val = pi.get(i); if(!val.equals(startValue) ){ fail(ASSERTION_FAILED, "Incorrect value for " + FieldsOfShort.fieldSpecs[i] + ", expected value " + startValue.toString() + ", value is " + val.toString()); } } } } tck/src/java/org/apache/jdo/tck/models/fieldtypes/TestFieldsOfSimpleClass.java100664 7501 12500110373 27721 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.fieldtypes.FieldsOfSimpleClass; import org.apache.jdo.tck.pc.fieldtypes.SimpleClass; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Support of fields of PersistenceCapable class types *
*Keywords: model *
*Assertion ID: A6.4.3-30. *
*Assertion Description: JDO implementations must support fields of PersistenceCapable class types as First Class Objects. */ public class TestFieldsOfSimpleClass extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A6.4.3-30 (TestFieldsOfSimpleClass) failed: "; /** * The main 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(TestFieldsOfSimpleClass.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(FieldsOfSimpleClass.class); } /** */ public void test() { pm = getPM(); runTest(pm); pm.close(); pm = null; } /** */ void runTest(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); int i, n; SimpleClass firstValue = new SimpleClass(100, "Hello"); SimpleClass secondValue = new SimpleClass(2000, "Hello World"); tx.begin(); FieldsOfSimpleClass pi = new FieldsOfSimpleClass(); pi.identifier = 1; pm.makePersistent(pi); Object oid = pm.getObjectId(pi); n = pi.getLength(); // Provide initial set of values for( i = 0; i < n; ++i){ pi.set( i, firstValue); } tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); pi = (FieldsOfSimpleClass) pm.getObjectById(oid, true); checkValues(oid, firstValue); // Provide new set of values for( i = 0; i < n; ++i){ pi.set(i, secondValue); } tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); // check new values checkValues(oid, secondValue); tx.commit(); } /** */ private void checkValues(Object oid, SimpleClass startValue){ int i; FieldsOfSimpleClass pi = (FieldsOfSimpleClass) pm.getObjectById(oid, true); int n = pi.getLength(); for( i = 0; i < n; ++i){ if( !FieldsOfSimpleClass.isPersistent[i] ) continue; SimpleClass val = pi.get(i); if(!val.equals(startValue) ){ fail(ASSERTION_FAILED, "Incorrect value for " + FieldsOfSimpleClass.fieldSpecs[i]); } } } } tck/src/java/org/apache/jdo/tck/models/fieldtypes/TestFieldsOfSimpleEnum.java100664 7427 12500110373 27567 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.fieldtypes.FieldsOfSimpleEnum; import org.apache.jdo.tck.pc.fieldtypes.SimpleEnum; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Support of field type Enum. *
*Keywords: model *
*Assertion ID: A??? *
*Assertion Description: * TBD */ public class TestFieldsOfSimpleEnum extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A6.4.3-13 (TestFieldsOfEnum) failed: "; /** * The main 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(TestFieldsOfSimpleEnum.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(FieldsOfSimpleEnum.class); } /** */ public void test() { pm = getPM(); runTest(pm); pm.close(); pm = null; } /** */ void runTest(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); int i, n; SimpleEnum firstValue = SimpleEnum.AL; SimpleEnum secondValue = SimpleEnum.WY; tx.begin(); FieldsOfSimpleEnum pi = new FieldsOfSimpleEnum(); pi.identifier = 1; pm.makePersistent(pi); Object oid = pm.getObjectId(pi); n = pi.getLength(); // Provide initial set of values for( i = 0; i < n; ++i){ pi.set( i, firstValue); } tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); pi = (FieldsOfSimpleEnum) pm.getObjectById(oid, true); checkValues(oid, firstValue); // Provide new set of values for( i = 0; i < n; ++i){ pi.set(i, secondValue); } tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); // check new values checkValues(oid, secondValue); tx.commit(); failOnError(); } /** */ private void checkValues(Object oid, SimpleEnum startValue){ int i; FieldsOfSimpleEnum pi = (FieldsOfSimpleEnum)pm.getObjectById(oid, true); int n = pi.getLength(); for( i = 0; i < n; ++i){ if( !FieldsOfSimpleEnum.isPersistent[i] ) continue; SimpleEnum val = pi.get(i); if(!startValue.equals(val) ){ appendMessage(ASSERTION_FAILED + "Incorrect value for " + FieldsOfSimpleEnum.fieldSpecs[i] + ", expected value " + startValue.toString() + ", value is " + val); } } } } tck/src/java/org/apache/jdo/tck/models/fieldtypes/TestFieldsOfSimpleInterface.java100664 7707 12500110373 30564 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.fieldtypes.FieldsOfSimpleInterface; import org.apache.jdo.tck.pc.fieldtypes.SimpleClass; import org.apache.jdo.tck.pc.fieldtypes.SimpleInterface; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Support of interfaces as field type. *
*Keywords: model *
*Assertion ID: A6.4.3-32. *
*Assertion Description: JDO implementations must support fields of interface types, and may choose to support them as Second Class Objects or First Class Objects. */ public class TestFieldsOfSimpleInterface extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A6.4.3-32 (TestFieldsOfSimpleInterface) failed: "; /** * The main 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(TestFieldsOfSimpleInterface.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(FieldsOfSimpleInterface.class); } /** */ public void test() { pm = getPM(); runTest(pm); pm.close(); pm = null; } /** */ void runTest(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); int i, n; SimpleInterface firstValue = new SimpleClass(100, "Hello"); SimpleInterface secondValue = new SimpleClass(2000, "Hello World"); tx.begin(); FieldsOfSimpleInterface pi = new FieldsOfSimpleInterface(); pi.identifier = 1; pm.makePersistent(pi); Object oid = pm.getObjectId(pi); n = pi.getLength(); // Provide initial set of values for( i = 0; i < n; ++i){ pi.set( i, firstValue); } tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); pi = (FieldsOfSimpleInterface) pm.getObjectById(oid, true); checkValues(oid, firstValue); // Provide new set of values for( i = 0; i < n; ++i){ pi.set(i, secondValue); } tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); // check new values checkValues(oid, secondValue); tx.commit(); } /** */ private void checkValues(Object oid, SimpleInterface startValue){ int i; FieldsOfSimpleInterface pi = (FieldsOfSimpleInterface) pm.getObjectById(oid, true); int n = pi.getLength(); for( i = 0; i < n; ++i){ if( !FieldsOfSimpleInterface.isPersistent[i] ) continue; SimpleInterface val = pi.get(i); if(!val.equals(startValue)){ fail(ASSERTION_FAILED, "Incorrect value for " + FieldsOfSimpleInterface.fieldSpecs[i]); } } } } tck/src/java/org/apache/jdo/tck/models/fieldtypes/TestFieldsOfString.java100664 7510 12500110373 26750 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.fieldtypes.FieldsOfString; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Support of field type String. *
*Keywords: model *
*Assertion ID: A6.4.3-17. *
*Assertion Description: JDO implementations must support fields of the immutable object class java.lang.String, and may choose to support them as Second Class Objects or First Class Objects. */ public class TestFieldsOfString extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A6.4.3-17 (TestFieldsOfString) failed: "; /** * The main 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(TestFieldsOfString.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(FieldsOfString.class); } /** */ public void test() { pm = getPM(); runTest(pm); pm.close(); pm = null; } /** */ void runTest(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); int i, n; String firstValue = new String("Hello"); String secondValue = new String("Hello World"); tx.begin(); FieldsOfString pi = new FieldsOfString(); pi.identifier = 1; pm.makePersistent(pi); Object oid = pm.getObjectId(pi); n = pi.getLength(); // Provide initial set of values for( i = 0; i < n; ++i){ pi.set( i, firstValue); } tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); pi = (FieldsOfString) pm.getObjectById(oid, true); checkValues(oid, firstValue); // Provide new set of values for( i = 0; i < n; ++i){ pi.set(i, secondValue); } tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); // check new values checkValues(oid, secondValue); tx.commit(); } /** */ private void checkValues(Object oid, String startValue){ int i; String value; FieldsOfString pi = (FieldsOfString) pm.getObjectById(oid, true); int n = pi.getLength(); for( i = 0, value = startValue; i < n; ++i){ if( !FieldsOfString.isPersistent[i] ) continue; String val = pi.get(i); if(!val.equals(startValue) ){ fail(ASSERTION_FAILED, "Incorrect value for " + FieldsOfString.fieldSpecs[i] + ", expected value " + value + ", value is " + val.toString()); } } } } tck/src/java/org/apache/jdo/tck/models/fieldtypes/TestHashMapStringKeyCollections.java100664 15375 12500110373 31476 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.math.BigDecimal; import java.util.HashMap; import java.util.Hashtable; import java.util.Iterator; import java.util.Set; import java.util.Vector; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.fieldtypes.HashMapStringKeyCollections; import org.apache.jdo.tck.pc.fieldtypes.SimpleClass; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Support of field type HashMap, varying value type *
*Keywords: model *
*Assertion ID: A6.4.3-24. *
*Assertion Description: If the HashMap optional feature is supported, then JDO implementation must support fields of the mutable object class HashMap, supporting them as Second Class Objects or First Class Objects. */ public class TestHashMapStringKeyCollections extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A6.4.3-24 (TestHashMapStringKeyCollections) failed: "; /** * The main 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(TestHashMapStringKeyCollections.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(HashMapStringKeyCollections.class); addTearDownClass(SimpleClass.class); } /** */ public void test() { pm = getPM(); runTest(pm); pm.close(); pm = null; } /** */ void runTest(PersistenceManager pm) { if (!isHashMapSupported()) { if (debug) logger.debug("JDO Implementation does not support " + "the optional feature HashMap"); return; } Transaction tx = pm.currentTransaction(); HashMapStringKeyCollections expectedValue = new HashMapStringKeyCollections(); // turn on datastore transactions tx.setOptimistic(false); tx.begin(); HashMapStringKeyCollections pi = new HashMapStringKeyCollections(); pi.identifier = 1; pm.makePersistent(pi); Object oid = pm.getObjectId(pi); // Provide initial set of values setValues(pi, 1); tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); setValues(expectedValue, 1); checkValues(oid, expectedValue); pi = (HashMapStringKeyCollections) pm.getObjectById(oid, true); setValues(pi, 2); tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); // check new values setValues(expectedValue, 2); checkValues(oid, expectedValue); tx.commit(); } /** */ private void setValues(HashMapStringKeyCollections collect, int order) { int keyOrder = order; int valueOrder = (order == 1) ? 2 : 1; // why?? int n = collect.getLength(); for (int i = 0; i < n; ++i) { Vector fieldSpecs = TestUtil.getFieldSpecsForMap( HashMapStringKeyCollections.fieldSpecs[i]); Vector key = TestUtil.makeNewVectorInstance( (String)fieldSpecs.get(0), keyOrder); Vector value = TestUtil.makeNewVectorInstance( (String)fieldSpecs.get(1), valueOrder); HashMap map = new HashMap(); for (int j = 0; j< key.size(); j++) { map.put(key.get(j), value.get(j)); } collect.set(i, map); if (debug) logger.debug("Set " + i + "th value to: " + map.toString()); } } /** */ private void checkValues(Object oid, HashMapStringKeyCollections expectedValue) { StringBuffer sbuf = new StringBuffer(); HashMapStringKeyCollections pi = (HashMapStringKeyCollections) pm.getObjectById(oid, true); int n = pi.getLength(); for (int i = 0; i < n; ++i) { HashMap expected = expectedValue.get(i); HashMap actual = pi.get(i); if (actual.size() != expected.size()) { sbuf.append("\nFor element " + i + ", expected size = " + expected.size() + ", actual size = " + actual.size() + " . "); } else if (! expected.equals(actual)) { if (TestUtil.getFieldSpecsForMap( HashMapStringKeyCollections.fieldSpecs[i] ).get(1).equals("BigDecimal")) { Set keys = expected.keySet(); Iterator iter = keys.iterator(); while (iter.hasNext()) { Object nextKey = iter.next(); BigDecimal expectedMapValue = (BigDecimal)expected.get(nextKey); BigDecimal actualMapValue = (BigDecimal)actual.get(nextKey); if ((expectedMapValue.compareTo(actualMapValue) != 0)) { sbuf.append("\nFor element " + i + "(" + (String)nextKey + "), expected = " + expectedMapValue + ", actual = " + actualMapValue + " . "); } } } else { sbuf.append("\nFor element " + i + ", expected = " + expected + ", actual = " + actual + " . "); } } } if (sbuf.length() > 0) { fail(ASSERTION_FAILED, "Expected and observed do not match!!" + sbuf.toString()); } } } tck/src/java/org/apache/jdo/tck/models/fieldtypes/TestHashMapStringValueCollections.java100664 17001 12500110373 32006 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.math.BigDecimal; import java.util.HashMap; import java.util.Iterator; import java.util.Set; import java.util.Vector; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.fieldtypes.HashMapStringValueCollections; import org.apache.jdo.tck.pc.fieldtypes.SimpleClass; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Support of field type HashMap, varying key type *
*Keywords: model *
*Assertion ID: A6.4.3-24. *
*Assertion Description: If the HashMap optional feature is supported, then JDO implementation must support fields of the mutable object class HashMap, supporting them as Second Class Objects or First Class Objects. */ public class TestHashMapStringValueCollections extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A6.4.3-24 (TestHashMapStringValueCollections) failed: "; /** * The main 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(TestHashMapStringValueCollections.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(HashMapStringValueCollections.class); addTearDownClass(SimpleClass.class); } /** */ public void test() { pm = getPM(); runTest(pm); pm.close(); pm = null; } /** */ void runTest(PersistenceManager pm) { if (!isHashMapSupported()) { if (debug) logger.debug("JDO Implementation does not support " + "the optional feature HashMap"); return; } Transaction tx = pm.currentTransaction(); HashMapStringValueCollections expectedValue = new HashMapStringValueCollections(); // turn on datastore transactions tx.setOptimistic(false); tx.begin(); HashMapStringValueCollections pi = new HashMapStringValueCollections(); pi.identifier = 1; pm.makePersistent(pi); Object oid = pm.getObjectId(pi); // Provide initial set of values setValues(pi, 1); tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); setValues(expectedValue, 1); checkValues(oid, expectedValue); pi = (HashMapStringValueCollections) pm.getObjectById(oid, true); // Provide new set of values -- reverse the keys and values setValues(pi, 2); tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); // check new values setValues(expectedValue, 2); checkValues(oid, expectedValue); pi = (HashMapStringValueCollections) pm.getObjectById(oid, true); tx.commit(); } /** */ private void setValues(HashMapStringValueCollections collect, int order) { int keyOrder = order; int valueOrder = (order == 1) ? 2 : 1; // why?? int n = collect.getLength(); for (int i = 0; i < n; ++i) { Vector fieldSpecs = TestUtil.getFieldSpecsForMap( HashMapStringValueCollections.fieldSpecs[i]); Vector key = TestUtil.makeNewVectorInstance( (String)fieldSpecs.get(0), keyOrder); Vector value = TestUtil.makeNewVectorInstance( (String)fieldSpecs.get(1), valueOrder); HashMap map = new HashMap(); for (int j = 0; j< key.size(); j++) { map.put(key.get(j), value.get(j)); } collect.set(i, map); if (debug) logger.debug("Set " + i + "th value to: " + map.toString()); } } /** */ private void checkValues(Object oid, HashMapStringValueCollections expectedValue) { StringBuffer sbuf = new StringBuffer(); HashMapStringValueCollections pi = (HashMapStringValueCollections) pm.getObjectById(oid, true); int n = pi.getLength(); for (int i = 0; i < n; ++i) { HashMap expected = expectedValue.get(i); HashMap actual = pi.get(i); if (actual.size() != expected.size()) { sbuf.append("\nFor element " + i + ", expected size = " + expected.size() + ", actual size = " + actual.size() + " . "); } else if (! expected.equals(actual)) { if (TestUtil.getFieldSpecsForMap( HashMapStringValueCollections.fieldSpecs[i] ).get(0).equals("BigDecimal")) { Set expectedKeySet = expected.keySet(); Set actualKeySet = actual.keySet(); Iterator expectedIter = expectedKeySet.iterator(); while (expectedIter.hasNext()) { BigDecimal expectedKey = (BigDecimal) expectedIter.next(); // compare keys if (!TestUtil.containsBigDecimalKey(expectedKey, actualKeySet)) { sbuf.append("\nFor element " + i + " expected key = " + expectedKey + " not found in actual Map. Actual keyset is " + actualKeySet.toString()); // compare values } else { String expectedVal = (String) expected.get(expectedKey); String actualValue = (String) actual.get(TestUtil.getBigDecimalKey(expectedKey, actualKeySet)); if (!expectedVal.equals(actualValue)) { sbuf.append("\nFor element " + i + " expected value = " + expectedVal + " actual Value = " + actualValue); } } } } else { sbuf.append("\nFor element " + i + ", expected = " + expected + ", actual = " + actual + " . "); } } } if (sbuf.length() > 0) { fail(ASSERTION_FAILED, "Expected and observed do not match!!" + sbuf.toString()); } } } tck/src/java/org/apache/jdo/tck/models/fieldtypes/TestHashSetCollections.java100664 14375 12500110373 27653 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.math.BigDecimal; import java.util.Collection; import java.util.HashSet; import java.util.Iterator; import java.util.TreeSet; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.fieldtypes.HashSetCollections; import org.apache.jdo.tck.pc.fieldtypes.SimpleClass; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Support of field type HashSet *
*Keywords: model *
*Assertion ID: A6.4.3-22. *
*Assertion Description: JDO implementations must support fields of the mutable object class java.util.HashSet, and may choose to support them as Second Class Objects or First Class Objects. */ public class TestHashSetCollections extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A6.4.3-22 (TestHashSetCollections) failed: "; /** * The main 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(TestHashSetCollections.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(HashSetCollections.class); addTearDownClass(SimpleClass.class); } /** */ public void test() { pm = getPM(); runTest(pm); pm.close(); pm = null; } /** */ void runTest(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); HashSetCollections expectedValue = new HashSetCollections(); // turn on datastore transactions tx.setOptimistic(false); tx.begin(); HashSetCollections pi = new HashSetCollections(); pi.identifier = 1; pm.makePersistent(pi); Object oid = pm.getObjectId(pi); // Provide initial set of values setValues(pi, 1); tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); setValues(expectedValue, 1); checkValues(oid, expectedValue); pi = (HashSetCollections) pm.getObjectById(oid, true); // Provide new set of values setValues(pi, 2); tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); // check new values setValues(expectedValue, 2); checkValues(oid, expectedValue); pi = (HashSetCollections) pm.getObjectById(oid, true); tx.commit(); } /** */ private void setValues(HashSetCollections collect, int order) { Collection value; int n = collect.getLength(); for (int i = 0; i < n; ++i) { String valueType = TestUtil.getFieldSpecs( HashSetCollections.fieldSpecs[i]); value = (Collection)TestUtil.makeNewVectorInstance( valueType, order); HashSet lvalue = new HashSet(value); collect.set(i, lvalue); if (debug) logger.debug("Set " + i + "th value to: " + value.toString()); } } /** */ private void checkValues(Object oid, HashSetCollections expectedValue) { int i; StringBuffer sbuf = new StringBuffer(); HashSetCollections pi = (HashSetCollections) pm.getObjectById(oid, true); int n = pi.getLength(); for (i = 0; i < n; ++i) { HashSet expected = expectedValue.get(i); HashSet actual = pi.get(i); if (actual.size() != expected.size()) { sbuf.append("\nFor element " + i + ", expected size = " + expected.size() + ", actual size = " + actual.size() + " . "); } else if (! expected.equals(actual)) { if (TestUtil.getFieldSpecs(HashSetCollections.fieldSpecs[i] ).equals("BigDecimal")) { // sort values for comparison TreeSet expectedTS = new TreeSet(expected); TreeSet actualTS = new TreeSet(actual); Iterator expectedIter = expectedTS.iterator(); Iterator actualIter = actualTS.iterator(); for (int j=0; j < expectedTS.size(); j++) { BigDecimal bigDecExpected = (BigDecimal)(expectedIter.next()); BigDecimal bigDecActual = (BigDecimal)(actualIter.next()); bigDecActual.setScale(bigDecExpected.scale()); if ((bigDecExpected.compareTo(bigDecActual)) != 0) { sbuf.append("\nFor element " + i + "(" + j + "), expected = " + bigDecExpected + ", actual = " + bigDecActual); } } } else { sbuf.append("\nFor element " + i + ", expected = " + expected + ", actual = " + actual + " . "); } } } if (sbuf.length() > 0) { fail(ASSERTION_FAILED, "Expected and observed do not match!!" + sbuf.toString()); } } } tck/src/java/org/apache/jdo/tck/models/fieldtypes/TestHashtableStringKeyCollections.java100664 15577 12500110373 32054 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.math.BigDecimal; import java.util.Hashtable; import java.util.Iterator; import java.util.List; import java.util.Set; import java.util.Vector; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.fieldtypes.HashtableStringKeyCollections; import org.apache.jdo.tck.pc.fieldtypes.SimpleClass; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Support of field type Hashtable, varying value type *
*Keywords: model *
*Assertion ID: A6.4.3-25. *
*Assertion Description: If the Hashtable optional feature is supported, then JDO implementation must support fields of the mutable object class Hashtable, supporting them as Second Class Objects or First Class Objects. */ public class TestHashtableStringKeyCollections extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A6.4.3-25 (TestHashtableStringKeyCollections) failed: "; /** * The main 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(TestHashtableStringKeyCollections.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(HashtableStringKeyCollections.class); addTearDownClass(SimpleClass.class); } /** */ public void test() { pm = getPM(); runTest(pm); pm.close(); pm = null; } /** */ void runTest(PersistenceManager pm) { if (!isHashtableSupported()) { if (debug) logger.debug("JDO Implementation does not support " + "the optional feature Hashtable"); return; } Transaction tx = pm.currentTransaction(); HashtableStringKeyCollections expectedValue = new HashtableStringKeyCollections(); // turn on datastore transactions tx.setOptimistic(false); tx.begin(); HashtableStringKeyCollections pi = new HashtableStringKeyCollections(); pi.identifier = 1; pm.makePersistent(pi); Object oid = pm.getObjectId(pi); // Provide initial set of values setValues(pi, 1); tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); setValues(expectedValue, 1); checkValues(oid, expectedValue); pi = (HashtableStringKeyCollections) pm.getObjectById(oid, true); // Provide new set of values -- reverse the keys and values setValues(pi, 2); tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); setValues(expectedValue, 2); // check new values checkValues(oid, expectedValue); tx.commit(); } /** */ private void setValues(HashtableStringKeyCollections collect, int order) { int keyOrder = order; int valueOrder = (order == 1) ? 2 : 1; // why?? int n = collect.getLength(); for (int i = 0; i < n; ++i) { Vector fieldSpecs = TestUtil.getFieldSpecsForMap( HashtableStringKeyCollections.fieldSpecs[i]); Vector key = TestUtil.makeNewVectorInstance( (String)fieldSpecs.get(0), keyOrder); Vector value = TestUtil.makeNewVectorInstance( (String)fieldSpecs.get(1), valueOrder); Hashtable map = new Hashtable(); for (int j = 0; j< key.size(); j++) { map.put(key.get(j), value.get(j)); } collect.set(i, map); if (debug) logger.debug("Set " + i + "th value to: " + map.toString()); } } /** */ private void checkValues(Object oid, HashtableStringKeyCollections expectedValue) { StringBuffer sbuf = new StringBuffer(); HashtableStringKeyCollections pi = (HashtableStringKeyCollections) pm.getObjectById(oid, true); int n = pi.getLength(); for (int i = 0; i < n; ++i) { Hashtable expected = expectedValue.get(i); Hashtable actual = pi.get(i); if (actual.size() != expected.size()) { sbuf.append("\nFor element " + i + ", expected size = " + expected.size() + ", actual size = " + actual.size() + " . "); } else if (! expected.equals(actual)) { if (TestUtil.getFieldSpecsForMap( HashtableStringKeyCollections.fieldSpecs[i] ).get(1).equals("BigDecimal")) { Set keys = expected.keySet(); Iterator iter = keys.iterator(); while (iter.hasNext()) { Object nextKey = iter.next(); BigDecimal expectedMapValue = (BigDecimal)expected.get(nextKey); BigDecimal actualMapValue = (BigDecimal)actual.get(nextKey); if ((expectedMapValue.compareTo(actualMapValue) != 0)) { sbuf.append("\nFor element " + i + "(" + (String)nextKey + "), expected = " + expectedMapValue + ", actual = " + actualMapValue + " . "); } } } else { sbuf.append("\nFor element " + i + ", expected = " + expected + ", actual = " + actual + " . "); } } } if (sbuf.length() > 0) { fail(ASSERTION_FAILED, "Expected and observed do not match!!" + sbuf.toString()); } } } tck/src/java/org/apache/jdo/tck/models/fieldtypes/TestHashtableStringValueCollections.java100664 16661 12500110373 32373 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.math.BigDecimal; import java.util.Hashtable; import java.util.Iterator; import java.util.Set; import java.util.Vector; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.fieldtypes.HashtableStringValueCollections; import org.apache.jdo.tck.pc.fieldtypes.SimpleClass; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Support of field type Hashtable, varying key type *
*Keywords: model *
*Assertion ID: A6.4.3-25. *
*Assertion Description: If the Hashtable optional feature is supported, then JDO implementation must support fields of the mutable object class Hashtable, supporting them as Second Class Objects or First Class Objects. */ public class TestHashtableStringValueCollections extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A6.4.3-25 (TestHashtableStringValueCollections) failed: "; /** * The main 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(TestHashtableStringValueCollections.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(HashtableStringValueCollections.class); addTearDownClass(SimpleClass.class); } /** */ public void test() { pm = getPM(); runTest(pm); pm.close(); pm = null; } /** */ void runTest(PersistenceManager pm) { if (!isHashtableSupported()) { if (debug) logger.debug("JDO Implementation does not support " + "the optional feature Hashtable"); return; } Transaction tx = pm.currentTransaction(); HashtableStringValueCollections expectedValue = new HashtableStringValueCollections(); // turn on datastore transactions tx.setOptimistic(false); tx.begin(); HashtableStringValueCollections pi = new HashtableStringValueCollections(); pi.identifier = 1; pm.makePersistent(pi); Object oid = pm.getObjectId(pi); // Provide initial set of values setValues(pi, 1); tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); setValues(expectedValue, 1); checkValues(oid, expectedValue); pi = (HashtableStringValueCollections) pm.getObjectById(oid, true); setValues(pi, 2); tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); // check new values setValues(expectedValue, 2); checkValues(oid, expectedValue); tx.commit(); } /** */ private void setValues(HashtableStringValueCollections collect, int order) { int keyOrder = order; int valueOrder = (order == 1) ? 2 : 1; // why?? int n = collect.getLength(); for (int i = 0; i < n; ++i) { Vector fieldSpecs = TestUtil.getFieldSpecsForMap( HashtableStringValueCollections.fieldSpecs[i]); Vector key = TestUtil.makeNewVectorInstance( (String)fieldSpecs.get(0), keyOrder); Vector value = TestUtil.makeNewVectorInstance( (String)fieldSpecs.get(1), valueOrder); Hashtable map = new Hashtable(); for (int j = 0; j< key.size(); j++) { map.put(key.get(j), value.get(j)); } collect.set(i, map); if (debug) logger.debug("Set " + i + "th value to: " + map.toString()); } } /** */ private void checkValues(Object oid, HashtableStringValueCollections expectedValue) { StringBuffer sbuf = new StringBuffer(); HashtableStringValueCollections pi = (HashtableStringValueCollections) pm.getObjectById(oid, true); int n = pi.getLength(); for (int i = 0; i < n; ++i) { Hashtable expected = expectedValue.get(i); Hashtable actual = pi.get(i); if (actual.size() != expected.size()) { sbuf.append("\nFor element " + i + ", expected size = " + expected.size() + ", actual size = " + actual.size() + " . "); } else if (! expected.equals(actual)) { if (TestUtil.getFieldSpecsForMap( HashtableStringValueCollections.fieldSpecs[i] ).get(0).equals("BigDecimal")) { Set expectedKeySet = expected.keySet(); Set actualKeySet = actual.keySet(); Iterator expectedIter = expectedKeySet.iterator(); while (expectedIter.hasNext()) { BigDecimal expectedKey = (BigDecimal) expectedIter.next(); // compare keys if (!TestUtil.containsBigDecimalKey(expectedKey, actualKeySet)) { sbuf.append("\nFor element " + i + " expected key = " + expectedKey + " not found in actual Map. Actual keyset is " + actualKeySet.toString()); // compare values } else { String expectedVal = (String) expected.get(expectedKey); String actualValue = (String) actual.get(TestUtil.getBigDecimalKey(expectedKey, actualKeySet)); if (!expectedVal.equals(actualValue)) { sbuf.append("\nFor element " + i + " expected value = " + expectedVal + " actual Value = " + actualValue); } } } } else { sbuf.append("\nFor element " + i + ", expected = " + expected + ", actual = " + actual + " . "); } } } if (sbuf.length() > 0) { fail(ASSERTION_FAILED, "Expected and observed do not match!!" + sbuf.toString()); } } } tck/src/java/org/apache/jdo/tck/models/fieldtypes/TestLinkedListCollections.java100664 14545 12500110373 30355 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.math.BigDecimal; import java.util.Collection; import java.util.ListIterator; import java.util.LinkedList; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.fieldtypes.LinkedListCollections; import org.apache.jdo.tck.pc.fieldtypes.SimpleClass; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Support of field type LinkedList *
*Keywords: model *
*Assertion ID: A6.4.3-26. *
*Assertion Description: If the LinkedList optional feature is supported, then JDO implementation must support fields of the mutable object class LinkedList, supporting them as Second Class Objects or First Class Objects. */ public class TestLinkedListCollections extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A6.4.3-26 (TestLinkedListCollections) failed: "; /** * The main 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(TestLinkedListCollections.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(LinkedListCollections.class); addTearDownClass(SimpleClass.class); } /** */ public void test() { pm = getPM(); runTest(pm); pm.close(); pm = null; } /** */ void runTest(PersistenceManager pm) { if (!isLinkedListSupported()) { if (debug) logger.debug("JDO Implementation does not support " + "the optional feature LinkedList"); return; } Transaction tx = pm.currentTransaction(); LinkedListCollections expectedValue = new LinkedListCollections(); // turn on datastore transactions tx.setOptimistic(false); tx.begin(); LinkedListCollections pi = new LinkedListCollections(); pi.identifier = 1; pm.makePersistent(pi); Object oid = pm.getObjectId(pi); // Provide initial set of values setValues(pi, 1); tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); setValues(expectedValue, 1); // check if persistent fields have values set checkValues(oid, expectedValue); pi = (LinkedListCollections) pm.getObjectById(oid, true); // Provide new set of values setValues(pi, 2); tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); // check new values setValues(expectedValue, 2); checkValues(oid, expectedValue); tx.commit(); } /** */ private void setValues(LinkedListCollections collect, int order) { Collection value; int n = collect.getLength(); for (int i = 0; i < n; ++i) { String valueType = TestUtil.getFieldSpecs( LinkedListCollections.fieldSpecs[i]); value = (Collection)TestUtil.makeNewVectorInstance( valueType, order); LinkedList lvalue = new LinkedList(value); collect.set(i, lvalue); if (debug) logger.debug("Set " + i + "th value to: " + value.toString()); } } /** */ private void checkValues(Object oid, LinkedListCollections expectedValue) { int i; StringBuffer sbuf = new StringBuffer(); LinkedListCollections pi = (LinkedListCollections) pm.getObjectById(oid, true); int n = pi.getLength(); for (i = 0; i < n; ++i) { LinkedList expected = expectedValue.get(i); LinkedList actual = pi.get(i); if (actual.size() != expected.size()) { sbuf.append("\nFor element " + i + ", expected size = " + expected.size() + ", actual size = " + actual.size() + " . "); } else if (! expected.equals(actual)) { if (TestUtil.getFieldSpecs(LinkedListCollections.fieldSpecs[i] ).equals("BigDecimal")) { ListIterator expectedIT = expected.listIterator(); ListIterator actualIt = actual.listIterator(); int index = 0; while (expectedIT.hasNext()) { BigDecimal bigDecExpected = (BigDecimal)(expectedIT.next()); BigDecimal bigDecActual = (BigDecimal)(actualIt.next()); if ((bigDecExpected.compareTo(bigDecActual)) != 0) { sbuf.append("\nFor element " + i + "(" + index + "), expected = " + bigDecExpected + ", actual = " + bigDecActual); } index++; } } else { sbuf.append("\nFor element " + i + ", expected = " + expected + ", actual = " + actual + " . "); } } } if (sbuf.length() > 0) { fail(ASSERTION_FAILED, "Expected and observed do not match!!" + sbuf.toString()); } } } tck/src/java/org/apache/jdo/tck/models/fieldtypes/TestListCollections.java100664 14610 12500110373 27217 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.math.BigDecimal; import java.util.Collection; import java.util.Vector; import java.util.List; import java.util.ListIterator; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.fieldtypes.ListCollections; import org.apache.jdo.tck.pc.fieldtypes.SimpleClass; import org.apache.jdo.tck.transactions.Commit; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Support of field type List *
*Keywords: model *
*Assertion ID: A6.4.3-36. *
*Assertion Description: If the List optional feature is supported, then JDO implementations must support fields of the interface type List, supporting them as Second Class Objects or First Class Objects. */ public class TestListCollections extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A6.4.3-36 (Commit) failed: "; /** * The main 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(Commit.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(ListCollections.class); addTearDownClass(SimpleClass.class); } /** */ public void test() { pm = getPM(); runTest(pm); pm.close(); pm = null; } /** */ void runTest(PersistenceManager pm) { if (!isListSupported()) { if (debug) logger.debug("JDO Implementation does not support " + "the optional feature List"); return; } if (!isLinkedListSupported() && !isArrayListSupported()) { fail(ASSERTION_FAILED, "JDO Implementation supports List, but neither " + "ArrayList nor LinkedList."); } Transaction tx = pm.currentTransaction(); ListCollections expectedValue = new ListCollections(); // turn on datastore transactions tx.setOptimistic(false); tx.begin(); ListCollections pi = new ListCollections(); pi.identifier = 1; pm.makePersistent(pi); Object oid = pm.getObjectId(pi); // Provide initial set of values setValues(pi, 1); tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); setValues(expectedValue, 1); // check if persistent fields have values set checkValues(oid, expectedValue); pi = (ListCollections) pm.getObjectById(oid, true); // Provide new set of values setValues(pi, 2); tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); // check new values setValues(expectedValue, 2); checkValues(oid, expectedValue); tx.commit(); } /** */ private void setValues(ListCollections collect, int order) { Vector value; int n = collect.getLength(); for (int i = 0; i < n; ++i) { String valueType = TestUtil.getFieldSpecs( ListCollections.fieldSpecs[i]); value = TestUtil.makeNewVectorInstance(valueType, order); collect.set( i, value); if (debug) logger.debug("Set " + i + "th value to: " + value.toString()); } } /** */ private void checkValues(Object oid, ListCollections expectedValue) { int i; StringBuffer sbuf = new StringBuffer(); ListCollections pi = (ListCollections) pm.getObjectById(oid, true); int n = pi.getLength(); for (i = 0; i < n; ++i) { List expected = expectedValue.get(i); List actual = pi.get(i); if (actual.size() != expected.size()) { sbuf.append("\nFor element " + i + ", expected size = " + expected.size() + ", actual size = " + actual.size() + " . "); } else if (! expected.equals(actual)) { if (TestUtil.getFieldSpecs(ListCollections.fieldSpecs[i] ).equals("BigDecimal")) { ListIterator expectedIt = expected.listIterator(); ListIterator actualIt = actual.listIterator(); int index = 0; while (expectedIt.hasNext()) { BigDecimal bigDecExpected = (BigDecimal)(expectedIt.next()); BigDecimal bigDecActual = (BigDecimal)(actualIt.next()); if ((bigDecExpected.compareTo(bigDecActual)) != 0) { sbuf.append("\nFor element " + i + "(" + index + "), expected = " + bigDecExpected + ", actual = " + bigDecActual); } index++; } } else { sbuf.append("\nFor element " + i + ", expected = " + expected + ", actual = " + actual + " . "); } } } if (sbuf.length() > 0) { fail(ASSERTION_FAILED, "Expected and observed do not match!!" + sbuf.toString()); } } } tck/src/java/org/apache/jdo/tck/models/fieldtypes/TestMapStringKeyCollections.java100664 15507 12500110373 30667 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.math.BigDecimal; import java.util.HashMap; import java.util.Iterator; import java.util.Set; import java.util.Map; import java.util.Vector; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.fieldtypes.MapStringKeyCollections; import org.apache.jdo.tck.pc.fieldtypes.SimpleClass; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Support of field type Map, varying value type *
*Keywords: model *
*Assertion ID: A6.4.3-35. *
*Assertion Description: If the Map optional feature is supported, then JDO implementations must support fields of the interface type Map, supporting them as Second Class Objects or First Class Objects. */ public class TestMapStringKeyCollections extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A6.4.3-35 (TestMapStringKeyCollections) failed: "; /** * The main 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(TestMapStringKeyCollections.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(MapStringKeyCollections.class); addTearDownClass(SimpleClass.class); } /** */ public void test() { pm = getPM(); runTest(pm); pm.close(); pm = null; } /** */ void runTest(PersistenceManager pm) { if (!isMapSupported()) { if (debug) logger.debug("JDO Implementation does not support " + "the optional feature Map"); return; } if (!isMapSupported() && !isTreeMapSupported()) { fail(ASSERTION_FAILED, "JDO Implementation supports Map, but neither " + "Map nor TreeMap."); } Transaction tx = pm.currentTransaction(); MapStringKeyCollections expectedValue = new MapStringKeyCollections(); // turn on datastore transactions tx.setOptimistic(false); tx.begin(); MapStringKeyCollections pi = new MapStringKeyCollections(); pi.identifier = 1; pm.makePersistent(pi); Object oid = pm.getObjectId(pi); // Provide initial set of values setValues(pi, 1); tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); setValues(expectedValue, 1); checkValues(oid, expectedValue); pi = (MapStringKeyCollections) pm.getObjectById(oid, true); setValues(pi, 2); tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); // check new values setValues(expectedValue, 2); checkValues(oid, expectedValue); tx.commit(); } /** */ private void setValues(MapStringKeyCollections collect, int order) { int keyOrder = order; int valueOrder = (order == 1) ? 2 : 1; // why?? int n = collect.getLength(); for (int i = 0; i < n; ++i) { Vector fieldSpecs = TestUtil.getFieldSpecsForMap( MapStringKeyCollections.fieldSpecs[i]); Vector key = TestUtil.makeNewVectorInstance( (String)fieldSpecs.get(0), keyOrder); Vector value = TestUtil.makeNewVectorInstance( (String)fieldSpecs.get(1), valueOrder); HashMap map = new HashMap(); for (int j = 0; j< key.size(); j++) { map.put(key.get(j), value.get(j)); } collect.set(i, map); if (debug) logger.debug("Set " + i + "th value to: " + map.toString()); } } /** */ private void checkValues(Object oid, MapStringKeyCollections expectedValue) { StringBuffer sbuf = new StringBuffer(); MapStringKeyCollections pi = (MapStringKeyCollections) pm.getObjectById(oid, true); int n = pi.getLength(); for (int i = 0; i < n; ++i) { Map expected = expectedValue.get(i); Map actual = pi.get(i); if (actual.size() != expected.size()) { sbuf.append("\nFor element " + i + ", expected size = " + expected.size() + ", actual size = " + actual.size() + " . "); } else if (! expected.equals(actual)) { if (TestUtil.getFieldSpecsForMap( MapStringKeyCollections.fieldSpecs[i] ).get(1).equals("BigDecimal")) { Set keys = expected.keySet(); Iterator iter = keys.iterator(); while (iter.hasNext()) { Object nextKey = iter.next(); BigDecimal expectedMapValue = (BigDecimal)expected.get(nextKey); BigDecimal actualMapValue = (BigDecimal)actual.get(nextKey); if ((expectedMapValue.compareTo(actualMapValue) != 0)) { sbuf.append("\nFor element " + i + "(" + (String)nextKey + "), expected = " + expectedMapValue + ", actual = " + actualMapValue + " . "); } } } else { sbuf.append("\nFor element " + i + ", expected = " + expected + ", actual = " + actual + " . "); } } } if (sbuf.length() > 0) { fail(ASSERTION_FAILED, "Expected and observed do not match!!" + sbuf.toString()); } } } tck/src/java/org/apache/jdo/tck/models/fieldtypes/TestMapStringValueCollections.java100664 16761 12500110373 31216 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.math.BigDecimal; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.Set; import java.util.Vector; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.fieldtypes.MapStringValueCollections; import org.apache.jdo.tck.pc.fieldtypes.SimpleClass; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Support of field type Map, varying key type *
*Keywords: model *
*Assertion ID: A6.4.3-35. *
*Assertion Description: If the Map optional feature is supported, then JDO implementations must support fields of the interface type Map, supporting them as Second Class Objects or First Class Objects. */ public class TestMapStringValueCollections extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A6.4.3-35 (TestMapStringValueCollections) failed: "; /** * The main 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(TestMapStringValueCollections.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(MapStringValueCollections.class); addTearDownClass(SimpleClass.class); } /** */ public void test() { pm = getPM(); runTest(pm); pm.close(); pm = null; } /** */ void runTest(PersistenceManager pm) { if (!isMapSupported()) { if (debug) logger.debug("JDO Implementation does not support " + "the optional feature Map"); return; } if (!isMapSupported() && !isTreeMapSupported()) { fail(ASSERTION_FAILED, "JDO Implementation supports Map, but neither " + "Map nor TreeMap."); } Transaction tx = pm.currentTransaction(); MapStringValueCollections expectedValue = new MapStringValueCollections(); // turn on datastore transactions tx.setOptimistic(false); tx.begin(); MapStringValueCollections pi = new MapStringValueCollections(); pi.identifier = 1; pm.makePersistent(pi); Object oid = pm.getObjectId(pi); // Provide initial set of values setValues(pi, 1); tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); setValues(expectedValue, 1); checkValues(oid, expectedValue); pi = (MapStringValueCollections) pm.getObjectById(oid, true); setValues(pi, 2); tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); // check new values setValues(expectedValue, 2); checkValues(oid, expectedValue); tx.commit(); } /** */ private void setValues(MapStringValueCollections collect, int order) { int keyOrder = order; int valueOrder = (order == 1) ? 2 : 1; // why?? int n = collect.getLength(); for (int i = 0; i < n; ++i) { Vector fieldSpecs = TestUtil.getFieldSpecsForMap( MapStringValueCollections.fieldSpecs[i]); Vector key = TestUtil.makeNewVectorInstance( (String)fieldSpecs.get(0), keyOrder); Vector value = TestUtil.makeNewVectorInstance( (String)fieldSpecs.get(1), valueOrder); HashMap map = new HashMap(); for (int j = 0; j< key.size(); j++) { map.put(key.get(j), value.get(j)); } collect.set(i, map); if (debug) logger.debug("Set " + i + "th value to: " + map.toString()); } } /** */ private void checkValues(Object oid, MapStringValueCollections expectedValue) { StringBuffer sbuf = new StringBuffer(); MapStringValueCollections pi = (MapStringValueCollections) pm.getObjectById(oid, true); int n = pi.getLength(); for (int i = 0; i < n; ++i) { Map expected = expectedValue.get(i); Map actual = pi.get(i); if (actual.size() != expected.size()) { sbuf.append("\nFor element " + i + ", expected size = " + expected.size() + ", actual size = " + actual.size() + " . "); } else if (! expected.equals(actual)) { if (TestUtil.getFieldSpecsForMap( MapStringValueCollections.fieldSpecs[i] ).get(0).equals("BigDecimal")) { Set expectedKeySet = expected.keySet(); Set actualKeySet = actual.keySet(); Iterator expectedIter = expectedKeySet.iterator(); while (expectedIter.hasNext()) { BigDecimal expectedKey = (BigDecimal) expectedIter.next(); // compare keys if (!TestUtil.containsBigDecimalKey(expectedKey, actualKeySet)) { sbuf.append("\nFor element " + i + " expected key = " + expectedKey + " not found in actual Map. Actual keyset is " + actualKeySet.toString()); // compare values } else { String expectedVal = (String) expected.get(expectedKey); String actualValue = (String) actual.get(TestUtil.getBigDecimalKey(expectedKey, actualKeySet)); if (!expectedVal.equals(actualValue)) { sbuf.append("\nFor element " + i + " expected value = " + expectedVal + " actual Value = " + actualValue); } } } } else { sbuf.append("\nFor element " + i + ", expected = " + expected + ", actual = " + actual + " . "); } } } if (sbuf.length() > 0) { fail(ASSERTION_FAILED, "Expected and observed do not match!!" + sbuf.toString()); } } } tck/src/java/org/apache/jdo/tck/models/fieldtypes/TestSetCollections.java100664 14270 12500110373 27041 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.math.BigDecimal; import java.util.Collection; import java.util.HashSet; import java.util.Iterator; import java.util.Set; import java.util.TreeSet; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.fieldtypes.SetCollections; import org.apache.jdo.tck.pc.fieldtypes.SimpleClass; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Support of field type Set. *
*Keywords: model *
*Assertion ID: A6.4.3-34. *
*Assertion Description: JDO implementations must support fields of the interface type java.util.Set, and may choose to support them as Second Class Objects or First Class Objects. */ public class TestSetCollections extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A6.4.3-34 (TestSetCollections) failed: "; /** * The main 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(TestSetCollections.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(SetCollections.class); addTearDownClass(SimpleClass.class); } /** */ public void test() { pm = getPM(); runTest(pm); pm.close(); pm = null; } /** */ void runTest(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); SetCollections expectedValue = new SetCollections(); // turn on datastore transactions tx.setOptimistic(false); tx.begin(); SetCollections pi = new SetCollections(); pi.identifier = 1; pm.makePersistent(pi); Object oid = pm.getObjectId(pi); // Provide initial set of values setValues(pi, 1); tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); setValues(expectedValue, 1); // check if persistent fields have values set checkValues(oid, expectedValue); pi = (SetCollections) pm.getObjectById(oid, true); // Provide new set of values setValues(pi, 2); tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); // check new values setValues(expectedValue, 2); checkValues(oid, expectedValue); tx.commit(); } /** */ private void setValues(SetCollections collect, int order) { Collection value; int n = collect.getLength(); for (int i = 0; i < n; ++i) { String valueType = TestUtil.getFieldSpecs( SetCollections.fieldSpecs[i]); value = (Collection)TestUtil.makeNewVectorInstance( valueType, order); Set lvalue = new HashSet(value); collect.set(i, lvalue); if (debug) logger.debug("Set " + i + "th value to: " + value.toString()); } } /** */ private void checkValues(Object oid, SetCollections expectedValue) { int i; StringBuffer sbuf = new StringBuffer(); SetCollections pi = (SetCollections) pm.getObjectById(oid, true); int n = pi.getLength(); for (i = 0; i < n; ++i) { Set expected = expectedValue.get(i); Set actual = pi.get(i); if (actual.size() != expected.size()) { sbuf.append("\nFor element " + i + ", expected size = " + expected.size() + ", actual size = " + actual.size() + " . "); } else if (! expected.equals(actual)) { if (TestUtil.getFieldSpecs(SetCollections.fieldSpecs[i] ).equals("BigDecimal")) { // sort values for comparison TreeSet expectedTS = new TreeSet(expected); TreeSet actualTS = new TreeSet(actual); Iterator expectedIter = expectedTS.iterator(); Iterator actualIter = actualTS.iterator(); for (int j=0; j < expectedTS.size(); j++) { BigDecimal bigDecExpected = (BigDecimal)(expectedIter.next()); BigDecimal bigDecActual = (BigDecimal)(actualIter.next()); bigDecActual.setScale(bigDecExpected.scale()); if ((bigDecExpected.compareTo(bigDecActual)) != 0) { sbuf.append("\nFor element " + i + "(" + j + "), expected = " + bigDecExpected + ", actual = " + bigDecActual); } } } else { sbuf.append("\nFor element " + i + ", expected = " + expected + ", actual = " + actual + " . "); } } } if (sbuf.length() > 0) { fail(ASSERTION_FAILED, "Expected and observed do not match!!" + sbuf.toString()); } } } tck/src/java/org/apache/jdo/tck/models/fieldtypes/TestTreeMapStringKeyCollections.java100664 15347 12500110373 31511 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.math.BigDecimal; import java.util.Iterator; import java.util.List; import java.util.Set; import java.util.TreeMap; import java.util.Vector; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.fieldtypes.TreeMapStringKeyCollections; import org.apache.jdo.tck.pc.fieldtypes.SimpleClass; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Support of field type TreeMap, varying value type *
*Keywords: model *
*Assertion ID: A6.4.3-27. *
*Assertion Description: If the TreeMap optional feature is supported, then JDO implementation must support fields of the mutable object class TreeMap, supporting them as Second Class Objects or First Class Objects. */ public class TestTreeMapStringKeyCollections extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A6.4.3-27 (TestTreeMapStringKeyCollections) failed: "; /** * The main 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(TestTreeMapStringKeyCollections.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(TreeMapStringKeyCollections.class); addTearDownClass(SimpleClass.class); } /** */ public void test() { pm = getPM(); runTest(pm); pm.close(); pm = null; } /** */ void runTest(PersistenceManager pm) { if (!isTreeMapSupported()) { if (debug) logger.debug("JDO Implementation does not support " + "the optional feature TreeMap"); return; } Transaction tx = pm.currentTransaction(); TreeMapStringKeyCollections expectedValue = new TreeMapStringKeyCollections(); // turn on datastore transactions tx.setOptimistic(false); tx.begin(); TreeMapStringKeyCollections pi = new TreeMapStringKeyCollections(); pi.identifier = 1; pm.makePersistent(pi); Object oid = pm.getObjectId(pi); // Provide initial set of values setValues(pi, 1); tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); setValues(expectedValue, 1); checkValues(oid, expectedValue); pi = (TreeMapStringKeyCollections) pm.getObjectById(oid, true); setValues(pi, 2); tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); // check new values setValues(expectedValue, 2); checkValues(oid, expectedValue); tx.commit(); } /** */ private void setValues(TreeMapStringKeyCollections collect, int order) { int keyOrder = order; int valueOrder = (order == 1) ? 2 : 1; // why?? int n = collect.getLength(); for (int i = 0; i < n; ++i) { Vector fieldSpecs = TestUtil.getFieldSpecsForMap( TreeMapStringKeyCollections.fieldSpecs[i]); Vector key = TestUtil.makeNewVectorInstance( (String)fieldSpecs.get(0), keyOrder); Vector value = TestUtil.makeNewVectorInstance( (String)fieldSpecs.get(1), valueOrder); TreeMap map = new TreeMap(); for (int j = 0; j< key.size(); j++) { map.put(key.get(j), value.get(j)); } collect.set(i, map); if (debug) logger.debug("Set " + i + "th value to: " + map.toString()); } } /** */ private void checkValues(Object oid, TreeMapStringKeyCollections expectedValue) { StringBuffer sbuf = new StringBuffer(); TreeMapStringKeyCollections pi = (TreeMapStringKeyCollections) pm.getObjectById(oid, true); int n = pi.getLength(); for (int i = 0; i < n; ++i) { TreeMap expected = expectedValue.get(i); TreeMap actual = pi.get(i); if (actual.size() != expected.size()) { sbuf.append("\nFor element " + i + ", expected size = " + expected.size() + ", actual size = " + actual.size() + " . "); } else if (! expected.equals(actual)) { if (TestUtil.getFieldSpecsForMap( TreeMapStringKeyCollections.fieldSpecs[i] ).get(1).equals("BigDecimal")) { Set keys = expected.keySet(); Iterator iter = keys.iterator(); while (iter.hasNext()) { Object nextKey = iter.next(); BigDecimal expectedMapValue = (BigDecimal)expected.get(nextKey); BigDecimal actualMapValue = (BigDecimal)actual.get(nextKey); if ((expectedMapValue.compareTo(actualMapValue) != 0)) { sbuf.append("\nFor element " + i + "(" + (String)nextKey + "), expected = " + expectedMapValue + ", actual = " + actualMapValue + " . "); } } } else { sbuf.append("\nFor element " + i + ", expected = " + expected + ", actual = " + actual + " . "); } } } if (sbuf.length() > 0) { fail(ASSERTION_FAILED, "Expected and observed do not match!!" + sbuf.toString()); } } } tck/src/java/org/apache/jdo/tck/models/fieldtypes/TestTreeMapStringValueCollections.java100664 16565 12500110373 32040 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.math.BigDecimal; import java.util.Iterator; import java.util.Set; import java.util.TreeMap; import java.util.Vector; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.fieldtypes.TreeMapStringValueCollections; import org.apache.jdo.tck.pc.fieldtypes.SimpleClass; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Support of field type TreeMap, varying key type *
*Keywords: model *
*Assertion ID: A6.4.3-27. *
*Assertion Description: If the TreeMap optional feature is supported, then JDO implementation must support fields of the mutable object class TreeMap, supporting them as Second Class Objects or First Class Objects. */ public class TestTreeMapStringValueCollections extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A6.4.3-27 (TestTreeMapStringValueCollections) failed: "; /** * The main 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(TestTreeMapStringValueCollections.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(TreeMapStringValueCollections.class); addTearDownClass(SimpleClass.class); } /** */ public void test() { pm = getPM(); runTest(pm); pm.close(); pm = null; } /** */ void runTest(PersistenceManager pm) { if (!isTreeMapSupported()) { if (debug) logger.debug("JDO Implementation does not support " + "the optional feature TreeMap"); return; } Transaction tx = pm.currentTransaction(); TreeMapStringValueCollections expectedValue = new TreeMapStringValueCollections(); // turn on datastore transactions tx.setOptimistic(false); tx.begin(); TreeMapStringValueCollections pi = new TreeMapStringValueCollections(); pi.identifier = 1; pm.makePersistent(pi); Object oid = pm.getObjectId(pi); // Provide initial set of values setValues(pi, 1); tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); setValues(expectedValue, 1); checkValues(oid, expectedValue); pi = (TreeMapStringValueCollections) pm.getObjectById(oid, true); setValues(pi, 2); tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); // check new values setValues(expectedValue, 2); checkValues(oid, expectedValue); tx.commit(); } /** */ private void setValues(TreeMapStringValueCollections collect, int order) { int keyOrder = order; int valueOrder = (order == 1) ? 2 : 1; // why?? int n = collect.getLength(); for (int i = 0; i < n; ++i) { Vector fieldSpecs = TestUtil.getFieldSpecsForMap( TreeMapStringValueCollections.fieldSpecs[i]); Vector key = TestUtil.makeNewVectorInstance( (String)fieldSpecs.get(0), keyOrder); Vector value = TestUtil.makeNewVectorInstance( (String)fieldSpecs.get(1), valueOrder); TreeMap map = new TreeMap(); for (int j = 0; j< key.size(); j++) { map.put(key.get(j), value.get(j)); } collect.set(i, map); if (debug) logger.debug("Set " + i + "th value to: " + map.toString()); } } /** */ private void checkValues(Object oid, TreeMapStringValueCollections expectedValue) { StringBuffer sbuf = new StringBuffer(); TreeMapStringValueCollections pi = (TreeMapStringValueCollections) pm.getObjectById(oid, true); int n = pi.getLength(); for (int i = 0; i < n; ++i) { TreeMap expected = expectedValue.get(i); TreeMap actual = pi.get(i); if (actual.size() != expected.size()) { sbuf.append("\nFor element " + i + ", expected size = " + expected.size() + ", actual size = " + actual.size() + " . "); } else if (! expected.equals(actual)) { if (TestUtil.getFieldSpecsForMap( TreeMapStringValueCollections.fieldSpecs[i] ).get(0).equals("BigDecimal")) { Set expectedKeySet = expected.keySet(); Set actualKeySet = actual.keySet(); Iterator expectedIter = expectedKeySet.iterator(); while (expectedIter.hasNext()) { BigDecimal expectedKey = (BigDecimal) expectedIter.next(); // compare keys if (!TestUtil.containsBigDecimalKey(expectedKey, actualKeySet)) { sbuf.append("\nFor element " + i + " expected key = " + expectedKey + " not found in actual Map. Actual keyset is " + actualKeySet.toString()); // compare values } else { String expectedVal = (String) expected.get(expectedKey); String actualValue = (String) actual.get(TestUtil.getBigDecimalKey(expectedKey, actualKeySet)); if (!expectedVal.equals(actualValue)) { sbuf.append("\nFor element " + i + " expected value = " + expectedVal + " actual Value = " + actualValue); } } } } else { sbuf.append("\nFor element " + i + ", expected = " + expected + ", actual = " + actual + " . "); } } } if (sbuf.length() > 0) { fail(ASSERTION_FAILED, "Expected and observed do not match!!" + sbuf.toString()); } } } tck/src/java/org/apache/jdo/tck/models/fieldtypes/TestTreeSetCollections.java100664 12745 12500110373 27666 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.util.Collection; import java.util.TreeSet; import java.util.Vector; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.fieldtypes.TreeSetCollections; import org.apache.jdo.tck.pc.fieldtypes.SimpleClass; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Support of field type TreeSet. *
*Keywords: model *
*Assertion ID: A6.4.3-28. *
*Assertion Description: If the TreeSet optional feature is supported, then JDO implementation must support fields of the mutable object class TreeSet, supporting them as Second Class Objects or First Class Objects. */ public class TestTreeSetCollections extends JDO_Test { private PersistenceManager pm; private Transaction tx; private static String prefix = "TestTreeSetCollections: "; private TreeSet defaultValue; // do not initialize, should be 0 for int /** */ private static final String ASSERTION_FAILED = "Assertion A6.4.3-28 (TestTreeSetCollections) failed: "; /** * The main 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(TestTreeSetCollections.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(TreeSetCollections.class); addTearDownClass(SimpleClass.class); } /** */ public void test() { pm = getPM(); runTest(pm); pm.close(); pm = null; } /** */ void runTest(PersistenceManager pm) { if (!isTreeSetSupported()) { if (debug) logger.debug("JDO Implementation does not support " + "the optional feature TreeSet"); return; } Transaction tx = pm.currentTransaction(); TreeSetCollections expectedValue = new TreeSetCollections(); // turn on datastore transactions tx.setOptimistic(false); tx.begin(); TreeSetCollections pi = new TreeSetCollections(); pi.identifier = 1; pm.makePersistent(pi); Object oid = pm.getObjectId(pi); // Provide initial set of values setValues(pi, 1); tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); setValues(expectedValue, 1); // check if persistent fields have values set checkValues(oid, expectedValue); pi = (TreeSetCollections) pm.getObjectById(oid, true); // Provide new set of values setValues(pi, 2); tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); // check new values setValues(expectedValue, 2); checkValues(oid, expectedValue); tx.commit(); } /** */ private void setValues(TreeSetCollections collect, int order) { Vector value; int n = collect.getLength(); for (int i = 0; i < n; ++i) { String valueType = TestUtil.getFieldSpecs( TreeSetCollections.fieldSpecs[i]); value = TestUtil.makeNewVectorInstance(valueType, order); TreeSet treeSet = new TreeSet((Collection)value); collect.set(i, treeSet); if (debug) logger.debug("Set " + i + "th value to: " + treeSet.toString()); } } /** */ private void checkValues(Object oid, TreeSetCollections expectedValue) { StringBuffer sbuf = new StringBuffer(); TreeSetCollections pi = (TreeSetCollections) pm.getObjectById(oid, true); int n = pi.getLength(); for (int i = 0; i < n; ++i) { Collection expected = expectedValue.get(i); Collection actual = pi.get(i); if (actual.size() != expected.size()) { sbuf.append("\nFor element " + i + ", expected size = " + expected.size() + ", actual size = " + actual.size() + " . "); continue; } if (! expected.equals(actual)) { sbuf.append("\nFor element " + i + ", expected = " + expected + ", actual = " + actual + " . "); } } if (sbuf.length() > 0) { fail(ASSERTION_FAILED, "Expected and observed do not match!!" + sbuf.toString()); } } } tck/src/java/org/apache/jdo/tck/models/fieldtypes/TestUtil.java100664 40243 12500110373 25023 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.util.*; import java.math.*; import org.apache.jdo.tck.pc.fieldtypes.AllTypes; import org.apache.jdo.tck.pc.fieldtypes.SimpleClass; import org.apache.jdo.tck.pc.fieldtypes.SimpleEnum; public class TestUtil { public TestUtil() { } //gets the value type for fields of a collection class public static String getFieldSpecs(String field) { //sample field =public Collection CollectionOfObject0 //look for last space and get the String before the numbers String valueType = ""; int indexOfLastSpace = field.lastIndexOf(" "); String fieldName = field.substring(indexOfLastSpace); int indexOfValueType = fieldName.indexOf("Of") + 2; String valueTypeWithNumber = fieldName.substring(indexOfValueType); int lastIndexOfValueType = 0; for (int i=valueTypeWithNumber.length() -1; i>=0; i--) { if (Character.isDigit(valueTypeWithNumber.charAt(i))) { continue; } else { lastIndexOfValueType = i; break; } } valueType = valueTypeWithNumber.substring(0, lastIndexOfValueType+1); return valueType; } //gets the key type and value type for fields of a Map class public static Vector getFieldSpecsForMap(String field) { //sample field =public HashMap HashMapOfObject_Object0 //fieldType -- look for the last space and get the value between Of and _ //valueType -- look for last _ and get the String before the numbers String fieldType = ""; String valueType = ""; int indexOfLastSpace = field.lastIndexOf(" "); String fieldName = field.substring(indexOfLastSpace); int indexOfFieldType = fieldName.indexOf("Of") + 2; String fieldTypeWithValueType = fieldName.substring(indexOfFieldType); int indexOfUnderScore = fieldTypeWithValueType.indexOf("_"); fieldType = fieldTypeWithValueType.substring(0, indexOfUnderScore); String valueTypeWithNumber = fieldTypeWithValueType.substring(indexOfUnderScore + 1); int lastIndexOfValueType = 0; for (int i=valueTypeWithNumber.length() -1; i>=0; i--) { if (Character.isDigit(valueTypeWithNumber.charAt(i))) { continue; } else { lastIndexOfValueType = i; break; } } valueType = valueTypeWithNumber.substring(0, lastIndexOfValueType+1); Vector fieldSpecs = new Vector(); fieldSpecs.add(fieldType); fieldSpecs.add(valueType); return fieldSpecs; } public static String [] elementTypes = new String[] {"Object", "SimpleClass", "SimpleInterface", "String", "Date", "Locale", "BigDecimal", "BigInteger", "Byte", "Double", "Float", "Integer", "Long", "Short", "SimpleEnum"}; private static int getIndexOf(String type) { for (int i=0; i < elementTypes.length; i++) { if (type.equals(elementTypes[i])) return i; } return 9999; } public static Vector makeNewVectorInstance(String type, int order) { Vector vec = new Vector(); switch (order) { case(1): switch (getIndexOf(type)) { case(0): vec.add(0, new SimpleClass(1, "Hello World")); vec.add(1, new SimpleClass(2, "Java Data Objects")); vec.add(2, new SimpleClass(2, "Java")); vec.add(3, new SimpleClass(4, "Origami")); vec.add(4, new SimpleClass(5, "watch")); break; case(1): case(2): vec.add(0, new SimpleClass(1, "Welcome")); vec.add(1, new SimpleClass(2, "To")); vec.add(2, new SimpleClass(3, "The")); vec.add(3, new SimpleClass(4, "Beautiful")); vec.add(4, new SimpleClass(5, "World")); break; case(3): vec.add(0, new String("Hello")); vec.add(1, new String("Welcome")); vec.add(2, new String("To The")); vec.add(3, new String("Beautiful")); vec.add(4, new String("World")); break; case(4): vec.add(0, new Date(2007908)); vec.add(1, new Date(89067382l)); vec.add(2, new Date(890673822)); vec.add(3, new Date(890673823)); vec.add(4, new Date(890673824)); break; case(5): vec.add(0, Locale.CHINA); vec.add(1, Locale.FRANCE); vec.add(2, Locale.GERMANY); vec.add(3, Locale.JAPAN); vec.add(4, Locale.ITALY); break; case(6): vec.add(0, new BigDecimal("2007908.54548")); vec.add(1, new BigDecimal("0.544")); vec.add(2, new BigDecimal("3002323232.545454")); vec.add(3, new BigDecimal("64564645656.78657")); vec.add(4, new BigDecimal("4564565465.2342")); break; case(7): vec.add(0, new BigInteger("2007908")); vec.add(1, new BigInteger("767575")); vec.add(2, new BigInteger("3002323232")); vec.add(3, new BigInteger("64564645656")); vec.add(4, new BigInteger("456445645")); break; case(8): vec.add(0, new Byte((byte)Byte.MIN_VALUE)); vec.add(1, new Byte((byte)Byte.MAX_VALUE)); vec.add(2, new Byte((byte)(Byte.MAX_VALUE- 20))); vec.add(3, new Byte((byte)(Byte.MAX_VALUE - 50))); vec.add(4, new Byte((byte)(Byte.MAX_VALUE - 75))); break; case(9): vec.add(0, new Double(AllTypes.DOUBLE_SMALLEST)); vec.add(1, new Double(AllTypes.DOUBLE_LARGEST)); vec.add(2, new Double(AllTypes.DOUBLE_LARGEST - 20000)); vec.add(3, new Double(AllTypes.DOUBLE_LARGEST - 454545.436664)); vec.add(4, new Double(AllTypes.DOUBLE_LARGEST - 2323235.76764677)); break; case(10): vec.add(0, new Float(AllTypes.FLOAT_SMALLEST)); vec.add(1, new Float(AllTypes.FLOAT_LARGEST)); vec.add(2, new Float(AllTypes.FLOAT_LARGEST - 20000)); vec.add(3, new Float(AllTypes.FLOAT_LARGEST - 454545.434)); vec.add(4, new Float(AllTypes.FLOAT_LARGEST - 565656.43434)); break; case(11): vec.add(0, new Integer(Integer.MIN_VALUE)); vec.add(1, new Integer(Integer.MAX_VALUE)); vec.add(2, new Integer(Integer.MAX_VALUE - 20000)); vec.add(3, new Integer(Integer.MAX_VALUE - 343434343)); vec.add(4, new Integer(Integer.MAX_VALUE - 565656)); break; case(12): vec.add(0, new Long(Long.MIN_VALUE)); vec.add(1, new Long(Long.MAX_VALUE)); vec.add(2, new Long(Long.MAX_VALUE - 20000)); vec.add(3, new Long(Long.MAX_VALUE - 343434343)); vec.add(4, new Long(Long.MAX_VALUE - 565656)); break; case(13): vec.add(0, new Short(Short.MIN_VALUE)); vec.add(1, new Short(Short.MAX_VALUE)); vec.add(2, new Short((short)(Short.MAX_VALUE - 20000))); vec.add(3, new Short((short)(Short.MAX_VALUE - 343))); vec.add(4, new Short((short)(Short.MAX_VALUE - 5656))); break; case(14): vec.add(0, (SimpleEnum)SimpleEnum.AK); vec.add(1, (SimpleEnum)SimpleEnum.FM); vec.add(2, (SimpleEnum)SimpleEnum.KS); vec.add(3, (SimpleEnum)SimpleEnum.NJ); vec.add(4, (SimpleEnum)SimpleEnum.WI); break; default: throw new IndexOutOfBoundsException(); } return vec; case(2): switch (getIndexOf(type)) { case(0): vec.add(0, new SimpleClass(1, "Hi There")); vec.add(1, new SimpleClass(1, "Hi")); vec.add(2, new SimpleClass(2, "Object")); vec.add(3, new SimpleClass(0, "Relational")); vec.add(4, new SimpleClass(3, "Hi There")); break; case(1): vec.add(0, new SimpleClass(1, "Peaches")); vec.add(1, new SimpleClass(2, "Oranges")); vec.add(2, new SimpleClass(3, "Blue Berries")); vec.add(3, new SimpleClass(4, "Apples")); vec.add(4, new SimpleClass(5, "Strawberries")); break; case(2): vec.add(0, new SimpleClass(1, "Peaches")); vec.add(1, new SimpleClass(2, "Oranges")); vec.add(2, new SimpleClass(3, "Blue Berries")); vec.add(3, new SimpleClass(4, "Apples")); vec.add(4, new SimpleClass(5, "Strawberries")); break; case(3): vec.add(0, new String("Peaches")); vec.add(1, new String("Oranges")); vec.add(2, new String("Blue Berries")); vec.add(3, new String("Apples")); vec.add(4, new String("Strawberries")); break; case(4): vec.add(0, new Date(54545)); vec.add(1, new Date(8905454l)); vec.add(2, new Date(323545445)); vec.add(3, new Date(890748967382l)); vec.add(4, new Date(954545)); break; case(5): vec.add(0, Locale.ENGLISH); vec.add(1, Locale.JAPANESE); vec.add(2, Locale.CANADA_FRENCH); vec.add(3, Locale.KOREA); vec.add(4, Locale.UK); break; case(6): vec.add(0, new BigDecimal("434238.5454898989")); vec.add(1, new BigDecimal("6.544")); vec.add(2, new BigDecimal("55552323232.545454")); vec.add(3, new BigDecimal("6456456.7543543534865785")); vec.add(4, new BigDecimal("456456.4353452342")); break; case(7): vec.add(0, new BigInteger("345345345345345345345345")); vec.add(1, new BigInteger("543543543543544")); vec.add(2, new BigInteger("65323423432423423")); vec.add(3, new BigInteger("87845634534543")); vec.add(4, new BigInteger("53452567766657567")); break; case(8): vec.add(0, new Byte((byte)(Byte.MAX_VALUE-34))); vec.add(1, new Byte((byte)Byte.MIN_VALUE)); vec.add(2, new Byte((byte)(Byte.MAX_VALUE- 76))); vec.add(3, new Byte((byte)Byte.MAX_VALUE)); vec.add(4, new Byte((byte)(Byte.MAX_VALUE - 12))); break; case(9): vec.add(0, new Double(AllTypes.DOUBLE_LARGEST - 343434)); vec.add(1, new Double(AllTypes.DOUBLE_SMALLEST)); vec.add(2, new Double(AllTypes.DOUBLE_LARGEST)); vec.add(3, new Double(AllTypes.DOUBLE_LARGEST - 65423445.436664)); vec.add(4, new Double(AllTypes.DOUBLE_LARGEST - 7235.236764677)); break; case(10): vec.add(0, new Float(AllTypes.FLOAT_LARGEST - 5452)); vec.add(1, new Float(AllTypes.FLOAT_SMALLEST)); vec.add(2, new Float(AllTypes.FLOAT_LARGEST - 6564560.54)); vec.add(3, new Float(AllTypes.FLOAT_LARGEST)); vec.add(4, new Float(AllTypes.FLOAT_LARGEST - 9756.634)); break; case(11): vec.add(0, new Integer(Integer.MAX_VALUE - 54454)); vec.add(1, new Integer(Integer.MIN_VALUE)); vec.add(2, new Integer(Integer.MAX_VALUE)); vec.add(3, new Integer(Integer.MAX_VALUE - 767234)); vec.add(4, new Integer(Integer.MAX_VALUE - 23673446)); break; case(12): vec.add(0, new Long(Long.MAX_VALUE - 545345454)); vec.add(1, new Long(Long.MIN_VALUE)); vec.add(2, new Long(Long.MAX_VALUE)); vec.add(3, new Long(Long.MAX_VALUE - 3543343)); vec.add(4, new Long(Long.MAX_VALUE - 556)); break; case(13): vec.add(0, new Short((short)(Short.MAX_VALUE - 3434))); vec.add(1, new Short(Short.MIN_VALUE)); vec.add(2, new Short((short)(Short.MAX_VALUE))); vec.add(3, new Short((short)(Short.MAX_VALUE - 23344))); vec.add(4, new Short((short)(Short.MAX_VALUE - 723))); break; case(14): vec.add(0, (SimpleEnum)SimpleEnum.AZ); vec.add(1, (SimpleEnum)SimpleEnum.SD); vec.add(2, (SimpleEnum)SimpleEnum.NV); vec.add(3, (SimpleEnum)SimpleEnum.WV); vec.add(4, (SimpleEnum)SimpleEnum.PA); break; default: throw new IndexOutOfBoundsException(); } return vec; default: throw new IndexOutOfBoundsException(); } } protected static boolean containsBigDecimalKey(BigDecimal keyValue, Set bigDecimalKeySet) { Iterator iter = bigDecimalKeySet.iterator(); while (iter.hasNext()) { BigDecimal nextVal = (BigDecimal) iter.next(); if (keyValue.compareTo(nextVal) == 0) { return true; } } return false; } protected static BigDecimal getBigDecimalKey(BigDecimal keyValue, Set bigDecimalKeySet) { Iterator iter = bigDecimalKeySet.iterator(); while (iter.hasNext()) { BigDecimal nextVal = (BigDecimal) iter.next(); if (keyValue.compareTo(nextVal) == 0) { return nextVal; } } return null; } } tck/src/java/org/apache/jdo/tck/models/fieldtypes/TestVectorCollections.java100664 14304 12500110373 27546 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.math.BigDecimal; import java.util.Collection; import java.util.Vector; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.fieldtypes.VectorCollections; import org.apache.jdo.tck.pc.fieldtypes.SimpleClass; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Support of field type Vector. *
*Keywords: model *
*Assertion ID: A6.4.3-29. *
*Assertion Description: If the Vector optional feature is supported, then JDO implementation must support fields of the mutable object class Vector, supporting them as Second Class Objects or First Class Objects. */ public class TestVectorCollections extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A6.4.3-29 (TestVectorCollections) failed: "; /** * The main 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(TestVectorCollections.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(VectorCollections.class); addTearDownClass(SimpleClass.class); } /** */ public void test() { pm = getPM(); runTest(pm); pm.close(); pm = null; } /** */ void runTest(PersistenceManager pm) { if (!isVectorSupported()) { if (debug) logger.debug("JDO Implementation does not support " + "the optional feature Vector"); return; } Transaction tx = pm.currentTransaction(); VectorCollections expectedValue = new VectorCollections(); // turn on datastore transactions tx.setOptimistic(false); tx.begin(); VectorCollections pi = new VectorCollections(); pi.identifier = 1; pm.makePersistent(pi); Object oid = pm.getObjectId(pi); // Provide initial set of values setValues(pi, 1); tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); setValues(expectedValue, 1); // check if persistent fields have values set checkValues(oid, expectedValue); pi = (VectorCollections) pm.getObjectById(oid, true); // Provide new set of values setValues(pi, 2); tx.commit(); // cache will be flushed pi = null; System.gc(); tx.begin(); // check new values setValues(expectedValue, 2); checkValues(oid, expectedValue); tx.commit(); } /** */ private void setValues(VectorCollections collect, int order) { Vector value; int n = collect.getLength(); for (int i = 0; i < n; ++i) { String valueType = TestUtil.getFieldSpecs( VectorCollections.fieldSpecs[i]); value = TestUtil.makeNewVectorInstance(valueType, order); collect.set(i, value); if (debug) logger.debug("Set " + i + "th value to: " + value.toString()); } } /** */ private void checkValues(Object oid, VectorCollections expectedValue) { StringBuffer sbuf = new StringBuffer(); VectorCollections pi = (VectorCollections) pm.getObjectById(oid, true); int n = pi.getLength(); for (int i = 0; i < n; i++) { Vector expected = expectedValue.get(i); Vector actual = pi.get(i); if (actual.size() != expected.size()) { sbuf.append("\nFor element " + i + ", expected size = " + expected.size() + ", actual size = " + actual.size() + " . "); } else if (! expected.equals(actual)) { if (debug) { logger.debug("Field number is " + i); logger.debug("Persisted vector is " + actual); logger.debug("Expected vector is " + expected); } if (TestUtil.getFieldSpecs(VectorCollections.fieldSpecs[i] ).equals("BigDecimal")) { for (int j = 0; j < actual.size(); j++) { BigDecimal bigDecActual = (BigDecimal)actual.elementAt(j); BigDecimal bigDecExpected = (BigDecimal)expected.elementAt(j); if ((bigDecExpected.compareTo(bigDecActual) != 0)) { sbuf.append("\nFor element " + i + "(" + j + "), expected = " + expected + ", actual = " + actual + " . "); } } } else { sbuf.append("\nFor element " + i + ", expected = " + expected + ", actual = " + actual + " . "); } } } if (sbuf.length() > 0) { fail(ASSERTION_FAILED, "Expected and observed do not match!!" + sbuf.toString()); } } } tck/src/java/org/apache/jdo/tck/models/inheritance/FieldWithSameNameInSuperclass.java100664 26043 12500110373 31213 0ustarmbouschenstaff 0 0 /* * 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.inheritance; import java.util.Iterator; import javax.jdo.Extent; import javax.jdo.JDOException; import javax.jdo.JDOUserException; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.inheritance.Constants; import org.apache.jdo.tck.pc.inheritance.FieldSameName4; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Field With the Same Name as a Field in a Superclass *
*Keywords: inheritance *
*Assertion ID: A6.5-7. *
*Assertion Description: A class might define a new field with the same name as the field declared in the superclass, and might define it to be different (persistent or not) from the inherited field. But Java treats the declared field as a different field from the inherited field, so there is no conflict. */ public class FieldWithSameNameInSuperclass extends TestParts { /** */ private static final String ASSERTION_FAILED = "Assertion A6.5-7 (FieldWithSameNameInSuperclass) failed: "; /** * The main 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(FieldWithSameNameInSuperclass.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(FieldSameName4.class); } /** */ public void test() { pm = getPM(); runTest(pm); pm.close(); pm = null; } /** */ void runTest(PersistenceManager pm) { Transaction t = pm.currentTransaction(); try { t.setRestoreValues(true); t.begin(); FieldSameName4 refa = new FieldSameName4(Constants.intA_V[1], Constants.doubleB_V[1], Constants.intB_V[1], Constants.charC_V[1], Constants.booleanD_V[1], Constants.floatE_V[1], Constants.shortF_V[1], Constants.shortG_V[1], Constants.intH_V[1]); pm.makePersistent(refa); Object objPtrA = pm.getObjectId (refa); refa.setSecondObj(new FieldSameName4(Constants.intA_V[2], Constants.doubleB_V[2], Constants.intB_V[2], Constants.charC_V[2], Constants.booleanD_V[2], Constants.floatE_V[2], Constants.shortF_V[2], Constants.shortG_V[2], Constants.intH_V[2])); TestParts.secondObj_V[1] = refa.getSecondObj(); refa.setThirdObj(new FieldSameName4(Constants.intA_V[3], Constants.doubleB_V[3], Constants.intB_V[3], Constants.charC_V[3], Constants.booleanD_V[3], Constants.floatE_V[3], Constants.shortF_V[3], Constants.shortG_V[3], Constants.intH_V[3])); TestParts.thirdObj_V[1] = refa.getThirdObj(); pm.makePersistent(TestParts.thirdObj_V[1]); Object objPtrB = pm.getObjectId(TestParts.thirdObj_V[1]); refa.setFourthObj(new FieldSameName4(Constants.intA_V[4], Constants.doubleB_V[4], Constants.intB_V[4], Constants.charC_V[4], Constants.booleanD_V[4], Constants.floatE_V[4], Constants.shortF_V[4], Constants.shortG_V[4], Constants.intH_V[4])); TestParts.fourthObj_V[1] = refa.getFourthObj(); try { t.commit(); } catch(JDOException e) { Object o = e.getFailedObject(); String cname = o == null ? "null" : o.getClass().getName(); fail(ASSERTION_FAILED, "Exception thrown, failed object class is " + cname + " exception is " + e); } t.begin(); FieldSameName4 a = null; FieldSameName4 b = null; try { // retrieve object created in previous transaction & store in value array for later comparison TestParts.thirdObj_V[1] = (FieldSameName4) pm.getObjectById(objPtrB, true); } catch (JDOUserException e) { // could not locate persistent object created in previous // transaction fail(ASSERTION_FAILED, "JDOUserException " + e + " could not reference thirdObj."); } try { // retrieve object created in previous transaction a = (FieldSameName4) pm.getObjectById(objPtrA, true); checkPersistentAreCorrect(ASSERTION_FAILED, persistentAfterCommit, 1, a.getDoubleB(), a.getIntB(), a.getShortF(), a.getThirdObj(), a.getIntH()); // verify referenced persistent object contains correct values b = a.getThirdObj(); if(b != null) { // if previous error caused b to be null, then these tests cannot be performed. checkPersistentAreCorrect(ASSERTION_FAILED, persistentAfterCommit, 3, b.getDoubleB(), b.getIntB(), b.getShortF(), b.getThirdObj(), b.getIntH()); } } catch (JDOUserException e) { // could not locate persistent object created in previous transaction fail(ASSERTION_FAILED, "JDOUserException " + e + " could not reference previously created object."); } // set in new values a.setIntA(Constants.intA_V[5]); a.setCharC(Constants.charC_V[5]); a.setBooleanD(Constants.booleanD_V[5]); a.setShortG(Constants.shortG_V[5]); FieldSameName4 fourth = new FieldSameName4(Constants.intA_V[6], Constants.doubleB_V[6], Constants.intB_V[6], Constants.charC_V[6], Constants.booleanD_V[6], Constants.floatE_V[6], Constants.shortF_V[6], Constants.shortG_V[6], Constants.intH_V[6]); a.setFourthObj(fourth); a.setFloatE(Constants.floatE_V[5]); a.setSecondObj(null); a.setDoubleB(Constants.doubleB_V[5]); a.setIntB(Constants.intB_V[5]); a.setShortF(Constants.shortF_V[5]); a.setThirdObj(null); a.setIntH(Constants.intH_V[5]); b.setIntA(Constants.intA_V[7]); b.setCharC(Constants.charC_V[7]); b.setBooleanD(Constants.booleanD_V[7]); b.setShortG(Constants.shortG_V[7]); b.setFourthObj(null); b.setFloatE(Constants.floatE_V[7]); b.setSecondObj(null); b.setDoubleB(Constants.doubleB_V[7]); b.setIntB(Constants.intB_V[7]); b.setShortF(Constants.shortF_V[7]); b.setThirdObj(null); b.setIntH(Constants.intH_V[7]); // create new objects and make persistent FieldSameName4 c = new FieldSameName4(Constants.intA_V[8], Constants.doubleB_V[8], Constants.intB_V[8], Constants.charC_V[8], Constants.booleanD_V[8], Constants.floatE_V[8], Constants.shortF_V[8], Constants.shortG_V[8], Constants.intH_V[8]); FieldSameName4 d = new FieldSameName4(Constants.intA_V[9], Constants.doubleB_V[9], Constants.intB_V[9], Constants.charC_V[9], Constants.booleanD_V[9], Constants.floatE_V[9], Constants.shortF_V[9], Constants.shortG_V[9], Constants.intH_V[9]); c.setThirdObj(d); c.setFourthObj(d); TestParts.thirdObj_V[8] = d; TestParts.fourthObj_V[8] = d; pm.makePersistent(c); // change values of newly persistent object c.setIntA(Constants.intA_V[10]); c.setCharC(Constants.charC_V[10]); c.setBooleanD(Constants.booleanD_V[10]); c.setShortG(Constants.shortG_V[10]); c.setFourthObj(null); c.setFloatE(Constants.floatE_V[10]); c.setSecondObj(null); c.setDoubleB(Constants.doubleB_V[10]); c.setIntB(Constants.intB_V[10]); c.setShortF(Constants.shortF_V[10]); c.setThirdObj(null); c.setIntH(Constants.intH_V[10]); t.rollback(); // verify objects revert back to transient after rollback checkPersistentAreCorrect(ASSERTION_FAILED, transientAfterRollback, 8, c.getDoubleB(), c.getIntB(), c.getShortF(), c.getThirdObj(), c.getIntH()); checkTransactionalAreCorrect(ASSERTION_FAILED, transientAfterRollback, 8, c.getFloatE(), c.getSecondObj()); checkNonpersistentAreCorrect(ASSERTION_FAILED, transientAfterRollback, 10, c.getIntA(), c.getCharC(), c.getBooleanD(), c.getShortG(), c.getFourthObj()); t.begin(); // verify rollback lost all persistent changes. try { // retrieve object created in previous transaction & store in value array for later comparison TestParts.thirdObj_V[1] = (FieldSameName4) pm.getObjectById(objPtrB, true); } catch (JDOUserException e) { // could not locate persistent object created in previous transaction fail(ASSERTION_FAILED, "JDOUserException " + e + " could not reference thirdObj."); } try { // retrieve object created in previous transaction a = (FieldSameName4) pm.getObjectById(objPtrA, true); checkPersistentAreCorrect(ASSERTION_FAILED, persistentAfterRollback, 1, a.getDoubleB(), a.getIntB(), a.getShortF(), a.getThirdObj(), a.getIntH()); b = a.getThirdObj(); if(b != null) { // if previous error caused b to be null, then these tests cannot be performed. checkPersistentAreCorrect(ASSERTION_FAILED, persistentAfterRollback, 3, b.getDoubleB(), b.getIntB(), b.getShortF(), b.getThirdObj(), b.getIntH()); } } catch (JDOUserException e) { // could not locate persistent object created in previous transaction fail(ASSERTION_FAILED, "JDOUserException " + e + " could not reference previously created object."); } t.rollback(); t = null; } finally { if ((t != null) && t.isActive()) t.rollback(); } } void removeAllInstances(PersistenceManager pm) { Extent e = pm.getExtent(FieldSameName4.class, true); Iterator i = e.iterator(); while( i.hasNext() ){ pm.deletePersistent(i.next()); } } } ././@LongLink100644 0 0 150 12500111677 10247 Lustar 0 0 tck/src/java/org/apache/jdo/tck/models/inheritance/NonPersistentFieldsAreNonPersistentInSubclasses.javatck/src/java/org/apache/jdo/tck/models/inheritance/NonPersistentFieldsAreNonPersistentInSubclasses.j100664 11007 12500110373 34340 0ustarmbouschenstaff 0 0 /* * 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.inheritance; import java.util.Iterator; import javax.jdo.Extent; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.inheritance.AllPersist4; import org.apache.jdo.tck.pc.inheritance.Constants; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Non-Persistent Fields Are Non-Persistent in Subclasses *
*Keywords: inheritance *
*Assertion ID: A6.5-6. *
*Assertion Description: Fields marked as non-persistent in persistence-capable classes will be non-persistent in subclasses. */ public class NonPersistentFieldsAreNonPersistentInSubclasses extends TestParts { /** */ private static final String ASSERTION_FAILED = "Assertion A6.5-6 (NonPersistentFieldsAreNonPersistentInSubclasses) failed: "; /** * The main 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(NonPersistentFieldsAreNonPersistentInSubclasses.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(AllPersist4.class); } /** */ public void test() { pm = getPM(); runTest(pm); pm.close(); pm = null; } /** */ void runTest(PersistenceManager pm) { Transaction t = pm.currentTransaction(); try { t.setRestoreValues(true); t.begin(); // create new objects and make persistent AllPersist4 c = new AllPersist4(Constants.intA_V[8], Constants.doubleB_V[8], Constants.intB_V[8], Constants.charC_V[8], Constants.booleanD_V[8], Constants.floatE_V[8], Constants.shortF_V[8], Constants.shortG_V[8], Constants.intH_V[8]); AllPersist4 d = new AllPersist4(Constants.intA_V[9], Constants.doubleB_V[9], Constants.intB_V[9], Constants.charC_V[9], Constants.booleanD_V[9], Constants.floatE_V[9], Constants.shortF_V[9], Constants.shortG_V[9], Constants.intH_V[9]); c.thirdObj = d; c.fourthObj = d; TestParts.thirdObj_V[8] = d; TestParts.fourthObj_V[8] = d; pm.makePersistent(c); // change values of newly persistent object c.intA = Constants.intA_V[10]; c.charC = Constants.charC_V[10]; c.booleanD = Constants.booleanD_V[10]; c.shortG = Constants.shortG_V[10]; c.fourthObj = null; c.floatE = Constants.floatE_V[10]; c.secondObj = null; c.doubleB = Constants.doubleB_V[10]; c.intB = Constants.intB_V[10]; c.shortF = Constants.shortF_V[10]; c.thirdObj = null; c.intH = Constants.intH_V[10]; t.rollback(); t = null; // verify objects revert back to transient after rollback checkNonpersistentAreCorrect(ASSERTION_FAILED, transientAfterRollback, 10, c.intA, c.charC, c.booleanD, c.shortG, c.fourthObj); } finally { if ((t != null) && t.isActive()) t.rollback(); } } void removeAllInstances(PersistenceManager pm) { AllPersist4 a = new AllPersist4(0, 0.0, 0, '0', false, 0.0f, (short)0, (short)0, 0); pm.makePersistent(a); // guarantee the class is registered; this will be removed Extent e = pm.getExtent(AllPersist4.class, true); Iterator i = e.iterator(); while( i.hasNext() ){ pm.deletePersistent(i.next()); } } } tck/src/java/org/apache/jdo/tck/models/inheritance/NonpersistentSuperClass.java100664 24236 12500110373 30253 0ustarmbouschenstaff 0 0 /* * 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.inheritance; import java.util.Iterator; import javax.jdo.Extent; import javax.jdo.JDOUserException; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.inheritance.Constants; import org.apache.jdo.tck.pc.inheritance.TopNonPersistH; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Non-persistent Super Class *
*Keywords: inheritance *
*Assertion ID: A6.5-1. *
*Assertion Description: A class might be persistence-capable even if its superclass is not persistence-capable. */ public class NonpersistentSuperClass extends TestParts { /** */ private static final String ASSERTION_FAILED = "Assertion A6.5-1 (NonpersistentSuperClass) failed: "; /** * The main 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(NonpersistentSuperClass.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(TopNonPersistH.class); } /** */ public void test() { pm = getPM(); runTest(pm); pm.close(); pm = null; } /** */ void runTest(PersistenceManager pm) { Transaction t = pm.currentTransaction(); try { t.setRestoreValues(true); t.begin(); TopNonPersistH refa = new TopNonPersistH(Constants.intA_V[1], Constants.doubleB_V[1], Constants.intB_V[1], Constants.charC_V[1], Constants.booleanD_V[1], Constants.floatE_V[1], Constants.shortF_V[1], Constants.shortG_V[1], Constants.intH_V[1]); pm.makePersistent(refa); Object objPtrA = pm.getObjectId(refa); refa.secondObj = new TopNonPersistH(Constants.intA_V[2], Constants.doubleB_V[2], Constants.intB_V[2], Constants.charC_V[2], Constants.booleanD_V[2], Constants.floatE_V[2], Constants.shortF_V[2], Constants.shortG_V[2], Constants.intH_V[2]); TestParts.secondObj_V[1] = refa.secondObj; refa.thirdObj = new TopNonPersistH(Constants.intA_V[3], Constants.doubleB_V[3], Constants.intB_V[3], Constants.charC_V[3], Constants.booleanD_V[3], Constants.floatE_V[3], Constants.shortF_V[3], Constants.shortG_V[3], Constants.intH_V[3]); TestParts.thirdObj_V[1] = refa.thirdObj; pm.makePersistent(refa.thirdObj); Object objPtrB = pm.getObjectId(refa.thirdObj); refa.fourthObj = new TopNonPersistH(Constants.intA_V[4], Constants.doubleB_V[4], Constants.intB_V[4], Constants.charC_V[4], Constants.booleanD_V[4], Constants.floatE_V[4], Constants.shortF_V[4], Constants.shortG_V[4], Constants.intH_V[4]); TestParts.fourthObj_V[1] = refa.fourthObj; t.commit(); t.begin(); TopNonPersistH a = null; TopNonPersistH b = null; try { // retrieve object created in previous transaction & store in value array for later comparison TestParts.thirdObj_V[1] = (TopNonPersistH)pm.getObjectById(objPtrB, true); } catch (JDOUserException e) { // could not locate persistent object created in previous transaction fail(ASSERTION_FAILED, "JDOUserException " + e + " could not reference thirdObj."); } try { // retrieve object created in previous transaction a = (TopNonPersistH)pm.getObjectById(objPtrA, true); checkPersistentAreCorrect(ASSERTION_FAILED, persistentAfterCommit, 1, a.doubleB, a.intB, a.shortF, a.thirdObj, a.intH); // verify referenced persistent object contains correct values b = a.thirdObj; if(b != null) { // if previous error caused b to be null, then these tests cannot be performed. checkPersistentAreCorrect(ASSERTION_FAILED, persistentAfterCommit, 3, b.doubleB, b.intB, b.shortF, b.thirdObj, b.intH); } } catch (JDOUserException e) { // could not locate persistent object created in previous transaction fail(ASSERTION_FAILED, "JDOUserException " + e + " could not reference previously created object."); } // set in new values a.intA = Constants.intA_V[5]; a.charC = Constants.charC_V[5]; a.booleanD = Constants.booleanD_V[5]; a.shortG = Constants.shortG_V[5]; a.fourthObj = new TopNonPersistH(Constants.intA_V[6], Constants.doubleB_V[6], Constants.intB_V[6], Constants.charC_V[6], Constants.booleanD_V[6], Constants.floatE_V[6], Constants.shortF_V[6], Constants.shortG_V[6], Constants.intH_V[6]); TestParts.fourthObj_V[5] = a.fourthObj; a.floatE = Constants.floatE_V[5]; a.secondObj = null; a.doubleB = Constants.doubleB_V[5]; a.intB = Constants.intB_V[5]; a.shortF = Constants.shortF_V[5]; a.thirdObj = null; a.intH = Constants.intH_V[5]; b.intA = Constants.intA_V[7]; b.charC = Constants.charC_V[7]; b.booleanD = Constants.booleanD_V[7]; b.shortG = Constants.shortG_V[7]; b.fourthObj = null; b.floatE = Constants.floatE_V[7]; b.secondObj = null; b.doubleB = Constants.doubleB_V[7]; b.intB = Constants.intB_V[7]; b.shortF = Constants.shortF_V[7]; b.thirdObj = null; b.intH = Constants.intH_V[7]; // create new objects and make persistent TopNonPersistH c = new TopNonPersistH(Constants.intA_V[8], Constants.doubleB_V[8], Constants.intB_V[8], Constants.charC_V[8], Constants.booleanD_V[8], Constants.floatE_V[8], Constants.shortF_V[8], Constants.shortG_V[8], Constants.intH_V[8]); TopNonPersistH d = new TopNonPersistH(Constants.intA_V[9], Constants.doubleB_V[9], Constants.intB_V[9], Constants.charC_V[9], Constants.booleanD_V[9], Constants.floatE_V[9], Constants.shortF_V[9], Constants.shortG_V[9], Constants.intH_V[9]); c.thirdObj = d; c.fourthObj = d; TestParts.thirdObj_V[8] = d; TestParts.fourthObj_V[8] = d; pm.makePersistent(c); // change values of newly persistent object c.intA = Constants.intA_V[10]; c.charC = Constants.charC_V[10]; c.booleanD = Constants.booleanD_V[10]; c.shortG = Constants.shortG_V[10]; c.fourthObj = null; c.floatE = Constants.floatE_V[10]; c.secondObj = null; c.doubleB = Constants.doubleB_V[10]; c.intB = Constants.intB_V[10]; c.shortF = Constants.shortF_V[10]; c.thirdObj = null; c.intH = Constants.intH_V[10]; t.rollback(); // verify objects revert back to transient after rollback checkPersistentAreCorrect(ASSERTION_FAILED, transientAfterRollback, 8, c.doubleB, c.intB, c.shortF, c.thirdObj, c.intH); checkTransactionalAreCorrect(ASSERTION_FAILED, transientAfterRollback, 8, c.floatE, c.secondObj); checkNonpersistentAreCorrect(ASSERTION_FAILED, transientAfterRollback, 10, c.intA, c.charC, c.booleanD, c.shortG, c.fourthObj); t.begin(); // verify rollback lost all persistent changes. try { // retrieve object created in previous transaction & store in value array for later comparison TestParts.thirdObj_V[1] = (TopNonPersistH)pm.getObjectById(objPtrB, true); } catch (JDOUserException e) { // could not locate persistent object created in previous transaction fail(ASSERTION_FAILED, "JDOUserException " + e + " could not reference thirdObj."); } try { // retrieve object created in previous transaction a = (TopNonPersistH)pm.getObjectById(objPtrA, true); checkPersistentAreCorrect(ASSERTION_FAILED, persistentAfterRollback, 1, a.doubleB, a.intB, a.shortF, a.thirdObj, a.intH); b = a.thirdObj; if(b != null) { // if previous error caused b to be null, then these tests cannot be performed. checkPersistentAreCorrect(ASSERTION_FAILED, persistentAfterRollback, 3, b.doubleB, b.intB, b.shortF, b.thirdObj, b.intH); } } catch (JDOUserException e) { // could not locate persistent object created in previous transaction fail(ASSERTION_FAILED, "JDOUserException " + e + " could not reference previously created object."); } t.rollback(); t = null; } finally { if ((t != null) && t.isActive()) t.rollback(); } } void removeAllInstances(PersistenceManager pm) { Extent e = pm.getExtent(TopNonPersistH.class, true); Iterator i = e.iterator(); while( i.hasNext() ){ pm.deletePersistent(i.next()); } } } ././@LongLink100644 0 0 154 12500111677 10253 Lustar 0 0 tck/src/java/org/apache/jdo/tck/models/inheritance/PersistenceCapableFlexibilityInInheritanceHierarchy.javatck/src/java/org/apache/jdo/tck/models/inheritance/PersistenceCapableFlexibilityInInheritanceHierarc100664 24617 12500110373 34356 0ustarmbouschenstaff 0 0 /* * 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.inheritance; import java.util.Iterator; import javax.jdo.Extent; import javax.jdo.JDOUserException; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.inheritance.Constants; import org.apache.jdo.tck.pc.inheritance.TopPersistH; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Persistence Capable Flexibility in Inheritance Hierarchy *
*Keywords: inheritance *
*Assertion ID: A6.5-3. *
*Assertion Description: Subclasses of such classes that are not persistence-capable, but have a superclass that is persistence-capable might be persistence-capable. That is, it is possible for classes in the inheritance hierarchy to be alternately persistence-capable and not persistence-capable. */ public class PersistenceCapableFlexibilityInInheritanceHierarchy extends TestParts { /** */ private static final String ASSERTION_FAILED = "Assertion A6.5-3 (PersistenceCapableFlexibilityInInheritanceHierarchy) failed: "; /** * The main 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(PersistenceCapableFlexibilityInInheritanceHierarchy.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(TopPersistH.class); } /** */ public void test() { pm = getPM(); runTest(pm); pm.close(); pm = null; } /** */ void runTest(PersistenceManager pm) { Transaction t = pm.currentTransaction(); try { t.setRestoreValues(true); t.begin(); TopPersistH refa = new TopPersistH(Constants.intA_V[1], Constants.doubleB_V[1], Constants.intB_V[1], Constants.charC_V[1], Constants.booleanD_V[1], Constants.floatE_V[1], Constants.shortF_V[1], Constants.shortG_V[1], Constants.intH_V[1]); pm.makePersistent(refa); Object objPtrA = pm.getObjectId(refa); refa.secondObj = new TopPersistH(Constants.intA_V[2], Constants.doubleB_V[2], Constants.intB_V[2], Constants.charC_V[2], Constants.booleanD_V[2], Constants.floatE_V[2], Constants.shortF_V[2], Constants.shortG_V[2], Constants.intH_V[2]); TestParts.secondObj_V[1] = refa.secondObj; refa.thirdObj = new TopPersistH(Constants.intA_V[3], Constants.doubleB_V[3], Constants.intB_V[3], Constants.charC_V[3], Constants.booleanD_V[3], Constants.floatE_V[3], Constants.shortF_V[3], Constants.shortG_V[3], Constants.intH_V[3]); TestParts.thirdObj_V[1] = refa.thirdObj; pm.makePersistent(refa.thirdObj); Object objPtrB = pm.getObjectId(refa.thirdObj); refa.fourthObj = new TopPersistH(Constants.intA_V[4], Constants.doubleB_V[4], Constants.intB_V[4], Constants.charC_V[4], Constants.booleanD_V[4], Constants.floatE_V[4], Constants.shortF_V[4], Constants.shortG_V[4], Constants.intH_V[4]); TestParts.fourthObj_V[1] = refa.fourthObj; t.commit(); t.begin(); TopPersistH a = null; TopPersistH b = null; try { // retrieve object created in previous transaction & store in value array for later comparison TestParts.thirdObj_V[1] = (TopPersistH)pm.getObjectById(objPtrB, true); } catch (JDOUserException e) { // could not locate persistent object created in previous transaction fail(ASSERTION_FAILED, "JDOUserException " + e + " could not reference thirdObj."); } try { // retrieve object created in previous transaction a = (TopPersistH)pm.getObjectById(objPtrA, true); checkPersistentAreCorrect(ASSERTION_FAILED, persistentAfterCommit, 1, a.doubleB, a.intB, a.shortF, a.thirdObj, a.intH); // verify referenced persistent object contains correct values b = a.thirdObj; if(b != null) { // if previous error caused b to be null, then these tests cannot be performed. checkPersistentAreCorrect(ASSERTION_FAILED, persistentAfterCommit, 3, b.doubleB, b.intB, b.shortF, b.thirdObj, b.intH); } } catch (JDOUserException e) { // could not locate persistent object created in previous transaction fail(ASSERTION_FAILED, "JDOUserException " + e + " could not reference previously created object."); } // set in new values a.intA = Constants.intA_V[5]; a.charC = Constants.charC_V[5]; a.booleanD = Constants.booleanD_V[5]; a.shortG = Constants.shortG_V[5]; a.fourthObj = new TopPersistH(Constants.intA_V[6], Constants.doubleB_V[6], Constants.intB_V[6], Constants.charC_V[6], Constants.booleanD_V[6], Constants.floatE_V[6], Constants.shortF_V[6], Constants.shortG_V[6], Constants.intH_V[6]); TestParts.fourthObj_V[5] = a.fourthObj; a.floatE = Constants.floatE_V[5]; a.secondObj = null; a.doubleB = Constants.doubleB_V[5]; a.intB = Constants.intB_V[5]; a.shortF = Constants.shortF_V[5]; a.thirdObj = null; a.intH = Constants.intH_V[5]; b.intA = Constants.intA_V[7]; b.charC = Constants.charC_V[7]; b.booleanD = Constants.booleanD_V[7]; b.shortG = Constants.shortG_V[7]; b.fourthObj = null; b.floatE = Constants.floatE_V[7]; b.secondObj = null; b.doubleB = Constants.doubleB_V[7]; b.intB = Constants.intB_V[7]; b.shortF = Constants.shortF_V[7]; b.thirdObj = null; b.intH = Constants.intH_V[7]; // create new objects and make persistent TopPersistH c = new TopPersistH(Constants.intA_V[8], Constants.doubleB_V[8], Constants.intB_V[8], Constants.charC_V[8], Constants.booleanD_V[8], Constants.floatE_V[8], Constants.shortF_V[8], Constants.shortG_V[8], Constants.intH_V[8]); TopPersistH d = new TopPersistH(Constants.intA_V[9], Constants.doubleB_V[9], Constants.intB_V[9], Constants.charC_V[9], Constants.booleanD_V[9], Constants.floatE_V[9], Constants.shortF_V[9], Constants.shortG_V[9], Constants.intH_V[9]); c.thirdObj = d; c.fourthObj = d; TestParts.thirdObj_V[8] = d; TestParts.fourthObj_V[8] = d; pm.makePersistent(c); // change values of newly persistent object c.intA = Constants.intA_V[10]; c.charC = Constants.charC_V[10]; c.booleanD = Constants.booleanD_V[10]; c.shortG = Constants.shortG_V[10]; c.fourthObj = null; c.floatE = Constants.floatE_V[10]; c.secondObj = null; c.doubleB = Constants.doubleB_V[10]; c.intB = Constants.intB_V[10]; c.shortF = Constants.shortF_V[10]; c.thirdObj = null; c.intH = Constants.intH_V[10]; t.rollback(); // verify objects revert back to transient after rollback checkPersistentAreCorrect(ASSERTION_FAILED, transientAfterRollback, 8, c.doubleB, c.intB, c.shortF, c.thirdObj, c.intH); checkTransactionalAreCorrect(ASSERTION_FAILED, transientAfterRollback, 8, c.floatE, c.secondObj); checkNonpersistentAreCorrect(ASSERTION_FAILED, transientAfterRollback, 10, c.intA, c.charC, c.booleanD, c.shortG, c.fourthObj); t.begin(); // verify rollback lost all persistent changes. try { // retrieve object created in previous transaction & store in value array for later comparison TestParts.thirdObj_V[1] = (TopPersistH)pm.getObjectById(objPtrB, true); } catch (JDOUserException e) { // could not locate persistent object created in previous transaction fail(ASSERTION_FAILED, "JDOUserException " + e + " could not reference thirdObj."); } try { // retrieve object created in previous transaction a = (TopPersistH)pm.getObjectById(objPtrA, true); checkPersistentAreCorrect(ASSERTION_FAILED, persistentAfterRollback, 1, a.doubleB, a.intB, a.shortF, a.thirdObj, a.intH); b = a.thirdObj; if(b != null) { // if previous error caused b to be null, then these tests cannot be performed. checkPersistentAreCorrect(ASSERTION_FAILED, persistentAfterRollback, 3, b.doubleB, b.intB, b.shortF, b.thirdObj, b.intH); } } catch (JDOUserException e) { // could not locate persistent object created in previous transaction fail(ASSERTION_FAILED, "JDOUserException " + e + " could not reference previously created object."); } t.rollback(); t = null; } finally { if ((t != null) && t.isActive()) t.rollback(); } } void removeAllInstances(PersistenceManager pm) { Extent e = pm.getExtent(TopPersistH.class, true); Iterator i = e.iterator(); while( i.hasNext() ){ pm.deletePersistent(i.next()); } } } tck/src/java/org/apache/jdo/tck/models/inheritance/PersistentFieldsArePersistentInSubClasses.java100664 24201 12500110373 33642 0ustarmbouschenstaff 0 0 /* * 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.inheritance; import java.util.Iterator; import javax.jdo.Extent; import javax.jdo.JDOUserException; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.inheritance.AllPersist4; import org.apache.jdo.tck.pc.inheritance.Constants; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Persistent Fields Are Persistent in SubClasses *
*Keywords: inheritance *
*Assertion ID: A6.5-4. *
*Assertion Description: Fields identified as persistent in persistence-capable classes will be persistent in subclasses. */ public class PersistentFieldsArePersistentInSubClasses extends TestParts { /** */ private static final String ASSERTION_FAILED = "Assertion A6.5-4 (PersistentFieldsArePersistentInSubClasses) failed: "; /** * The main 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(PersistentFieldsArePersistentInSubClasses.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(AllPersist4.class); } /** */ public void test() { pm = getPM(); runTest(pm); pm.close(); pm = null; } /** */ void runTest(PersistenceManager pm) { Transaction t = pm.currentTransaction(); try { t.setRestoreValues(true); t.begin(); AllPersist4 refa = new AllPersist4(Constants.intA_V[1], Constants.doubleB_V[1], Constants.intB_V[1], Constants.charC_V[1], Constants.booleanD_V[1], Constants.floatE_V[1], Constants.shortF_V[1], Constants.shortG_V[1], Constants.intH_V[1]); pm.makePersistent(refa); Object objPtrA = pm.getObjectId (refa); refa.secondObj = new AllPersist4(Constants.intA_V[2], Constants.doubleB_V[2], Constants.intB_V[2], Constants.charC_V[2], Constants.booleanD_V[2], Constants.floatE_V[2], Constants.shortF_V[2], Constants.shortG_V[2], Constants.intH_V[2]); TestParts.secondObj_V[1] = refa.secondObj; refa.thirdObj = new AllPersist4(Constants.intA_V[3], Constants.doubleB_V[3], Constants.intB_V[3], Constants.charC_V[3], Constants.booleanD_V[3], Constants.floatE_V[3], Constants.shortF_V[3], Constants.shortG_V[3], Constants.intH_V[3]); TestParts.thirdObj_V[1] = refa.thirdObj; pm.makePersistent(refa.thirdObj); Object objPtrB = pm.getObjectId (refa.thirdObj); refa.fourthObj = new AllPersist4(Constants.intA_V[4], Constants.doubleB_V[4], Constants.intB_V[4], Constants.charC_V[4], Constants.booleanD_V[4], Constants.floatE_V[4], Constants.shortF_V[4], Constants.shortG_V[4], Constants.intH_V[4]); TestParts.fourthObj_V[1] = refa.fourthObj; t.commit(); t.begin(); AllPersist4 a = null; AllPersist4 b = null; try { // retrieve object created in previous transaction & store in value array for later comparison TestParts.thirdObj_V[1] = (AllPersist4)pm.getObjectById(objPtrB, true); } catch (JDOUserException e) { // could not locate persistent object created in previous transaction fail(ASSERTION_FAILED, "JDOUserException " + e + " could not reference thirdObj."); } try { // retrieve object created in previous transaction a = (AllPersist4)pm.getObjectById(objPtrA, true); checkPersistentAreCorrect(ASSERTION_FAILED, persistentAfterCommit, 1, a.doubleB, a.intB, a.shortF, a.thirdObj, a.intH); // verify referenced persistent object contains correct values b = a.thirdObj; if(b != null) { // if previous error caused b to be null, then these tests cannot be performed. checkPersistentAreCorrect(ASSERTION_FAILED, persistentAfterCommit, 3, b.doubleB, b.intB, b.shortF, b.thirdObj, b.intH); } } catch (JDOUserException e) { // could not locate persistent object created in previous transaction fail(ASSERTION_FAILED, "JDOUserException " + e + " could not reference previously created object."); } // set in new values a.intA = Constants.intA_V[5]; a.charC = Constants.charC_V[5]; a.booleanD = Constants.booleanD_V[5]; a.shortG = Constants.shortG_V[5]; a.fourthObj = new AllPersist4(Constants.intA_V[6], Constants.doubleB_V[6], Constants.intB_V[6], Constants.charC_V[6], Constants.booleanD_V[6], Constants.floatE_V[6], Constants.shortF_V[6], Constants.shortG_V[6], Constants.intH_V[6]); TestParts.fourthObj_V[5] = a.fourthObj; a.floatE = Constants.floatE_V[5]; a.secondObj = null; a.doubleB = Constants.doubleB_V[5]; a.intB = Constants.intB_V[5]; a.shortF = Constants.shortF_V[5]; a.thirdObj = null; a.intH = Constants.intH_V[5]; b.intA = Constants.intA_V[7]; b.charC = Constants.charC_V[7]; b.booleanD = Constants.booleanD_V[7]; b.shortG = Constants.shortG_V[7]; b.fourthObj = null; b.floatE = Constants.floatE_V[7]; b.secondObj = null; b.doubleB = Constants.doubleB_V[7]; b.intB = Constants.intB_V[7]; b.shortF = Constants.shortF_V[7]; b.thirdObj = null; b.intH = Constants.intH_V[7]; // create new objects and make persistent AllPersist4 c = new AllPersist4(Constants.intA_V[8], Constants.doubleB_V[8], Constants.intB_V[8], Constants.charC_V[8], Constants.booleanD_V[8], Constants.floatE_V[8], Constants.shortF_V[8], Constants.shortG_V[8], Constants.intH_V[8]); AllPersist4 d = new AllPersist4(Constants.intA_V[9], Constants.doubleB_V[9], Constants.intB_V[9], Constants.charC_V[9], Constants.booleanD_V[9], Constants.floatE_V[9], Constants.shortF_V[9], Constants.shortG_V[9], Constants.intH_V[9]); c.thirdObj = d; c.fourthObj = d; TestParts.thirdObj_V[8] = d; TestParts.fourthObj_V[8] = d; pm.makePersistent(c); // change values of newly persistent object c.intA = Constants.intA_V[10]; c.charC = Constants.charC_V[10]; c.booleanD = Constants.booleanD_V[10]; c.shortG = Constants.shortG_V[10]; c.fourthObj = null; c.floatE = Constants.floatE_V[10]; c.secondObj = null; c.doubleB = Constants.doubleB_V[10]; c.intB = Constants.intB_V[10]; c.shortF = Constants.shortF_V[10]; c.thirdObj = null; c.intH = Constants.intH_V[10]; t.rollback(); // verify objects revert back to transient after rollback checkPersistentAreCorrect(ASSERTION_FAILED, transientAfterRollback, 8, c.doubleB, c.intB, c.shortF, c.thirdObj, c.intH); t.begin(); // verify rollback lost all persistent changes. try { // retrieve object created in previous transaction & store in value array for later comparison TestParts.thirdObj_V[1] = (AllPersist4)pm.getObjectById(objPtrB, true); } catch (JDOUserException e) { // could not locate persistent object created in previous transaction fail(ASSERTION_FAILED, "JDOUserException " + e + " could not reference thirdObj."); } try { // retrieve object created in previous transaction a = (AllPersist4)pm.getObjectById(objPtrA, true); checkPersistentAreCorrect(ASSERTION_FAILED, persistentAfterRollback, 1, a.doubleB, a.intB, a.shortF, a.thirdObj, a.intH); b = a.thirdObj; if(b != null) { // if previous error caused b to be null, then these tests cannot be performed. checkPersistentAreCorrect(ASSERTION_FAILED, persistentAfterRollback, 3, b.doubleB, b.intB, b.shortF, b.thirdObj, b.intH); } } catch (JDOUserException e) { // could not locate persistent object created in previous transaction fail(ASSERTION_FAILED, "JDOUserException " + e + " could not reference previously created object."); } t.rollback(); t = null; } finally { if ((t != null) && t.isActive()) t.rollback(); } } void removeAllInstances(PersistenceManager pm) { AllPersist4 a = new AllPersist4(0, 0.0, 0, '0', false, 0.0f, (short)0, (short)0, 0); pm.makePersistent(a); // guarantee the class is registered; this will be removed Extent e = pm.getExtent(AllPersist4.class, true); Iterator i = e.iterator(); while( i.hasNext() ){ pm.deletePersistent(i.next()); } } } tck/src/java/org/apache/jdo/tck/models/inheritance/TestParts.java100664 13724 12500110373 25324 0ustarmbouschenstaff 0 0 /* * 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.inheritance; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.inheritance.Constants; /** * The test data is in arrays, making it easy to change values. The Inheritance test classes refer to the * data via array index and the checkXXXX() routines carry an index value--indicating the expected value. * If those attributes are references and should be other than null, as is the case with thirdObj, then the * test code inserts the reference into the data array. * * Each test class follows the same pattern: * 1. Persistent and transient object are created in the first transaction. * 2. A second transaction is started, the first persistent object retrieved and checking is done on * its attribute values. * 3. A rollback is performed and value comparisions are made on the transient instances that were created. * 4. A third transation is started and the first persistent object again retrieved and checking is done on * its attribute values. */ public abstract class TestParts extends JDO_Test { // 0 1 2 3 4 5 6 7 8 9 10 11 static final Object[] secondObj_V = { null, null, null, null, null, null, null, null, null, null, null, null}; static final Object[] thirdObj_V = { null, null, null, null, null, null, null, null, null, null, null, null}; static final Object[] fourthObj_V = { null, null, null, null, null, null, null, null, null, null, null, null}; static String persistentAfterCommit = "Read object back after committed to Database. "; static String persistentAfterRollback = "Read object back after rollback. "; static String transientAfterRollback = "Object reverted to transient after rollback. "; /** */ void checkPersistentAreCorrect(String assertion, String title, int index, double doubleB, int intB, short shortF, Object thirdObj, int intH) { if(doubleB != Constants.doubleB_V[index]) { fail(assertion, title + "Persistent attribute doubleB is " + doubleB + ", it should be " + Constants.doubleB_V[index]); } if(intB != Constants.intB_V[index]) { fail(assertion, title + "Persistent attribute intB is " + intB + ", it should be " + Constants.intB_V[index]); } if(shortF != Constants.shortF_V[index]) { fail(assertion, title + "Persistent attribute shortF is " + shortF + ", it should be " + Constants.shortF_V[index]); } if(thirdObj != TestParts.thirdObj_V[index]) { fail(assertion, title + "Persistent attribute thirdObj is " + thirdObj + ", it should be " + TestParts.thirdObj_V[index]); } if(intH != Constants.intH_V[index]) { fail(assertion, title + "Persistent attribute intH is " + intH + ", it should be " + Constants.intH_V[index]); } } /** */ void checkTransactionalAreCorrect(String assertion, String title, int index, float floatE, Object secondObj) { if(floatE != Constants.floatE_V[index]) { fail(assertion, title + "Transactional attribute floatE is " + floatE + ", it should be " + Constants.floatE_V[index]); } if(secondObj != TestParts.secondObj_V[index]) { fail(assertion, title + "Transactional attribute secondObj is " + secondObj + ", it should be " + TestParts.secondObj_V[index]); } } /** */ void checkNonpersistentAreCorrect(String assertion, String title, int index, int intA, char charC, boolean booleanD, short shortG, Object fourthObj) { if(intA != Constants.intA_V[index]) { fail(assertion, title + "In non-persistent class, attribute intA is " + intA + ", it should be " + Constants.intA_V[index]); } if(charC != Constants.charC_V[index]) { fail(assertion, title + "In non-persistent class, attribute charC is " + charC + ", it should be " + Constants.charC_V[index]); } if(booleanD != Constants.booleanD_V[index]) { fail(assertion, title + "In non-persistent class, attribute booleanD is " + booleanD + ", it should be " + Constants.booleanD_V[index]); } if(shortG != Constants.shortG_V[index]) { fail(assertion, title + "In non-persistent class, attribute shortG is " + shortG + ", it should be " + Constants.shortG_V[index]); } if(fourthObj != TestParts.fourthObj_V[index]) { fail(assertion, title + "In non-persistent class, attribute fourthObj is " + fourthObj + ", it should be " + TestParts.fourthObj_V[index]); } } } ././@LongLink100644 0 0 150 12500111677 10247 Lustar 0 0 tck/src/java/org/apache/jdo/tck/models/inheritance/TransactionalFieldsAreTransactionalInSubclasses.javatck/src/java/org/apache/jdo/tck/models/inheritance/TransactionalFieldsAreTransactionalInSubclasses.j100664 10736 12500110373 34326 0ustarmbouschenstaff 0 0 /* * 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.inheritance; import java.util.Iterator; import javax.jdo.Extent; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.inheritance.AllPersist4; import org.apache.jdo.tck.pc.inheritance.Constants; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Transactional Fields are Transactional in Subclasses *
*Keywords: inheritance *
*Assertion ID: A6.5-5. *
*Assertion Description: Fields marked as transactional in persistence-capable classes will be transactional in subclasses. */ public class TransactionalFieldsAreTransactionalInSubclasses extends TestParts { /** */ private static final String ASSERTION_FAILED = "Assertion A6.5-5 (TransactionalFieldsAreTransactionalInSubclasses) failed: "; /** * The main 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(TransactionalFieldsAreTransactionalInSubclasses.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(AllPersist4.class); } /** */ public void test() { pm = getPM(); runTest(pm); pm.close(); pm = null; } /** */ void runTest(PersistenceManager pm) { Transaction t = pm.currentTransaction(); try { t.setRestoreValues(true); t.begin(); // create new objects and make persistent AllPersist4 c = new AllPersist4(Constants.intA_V[8], Constants.doubleB_V[8], Constants.intB_V[8], Constants.charC_V[8], Constants.booleanD_V[8], Constants.floatE_V[8], Constants.shortF_V[8], Constants.shortG_V[8], Constants.intH_V[8]); AllPersist4 d = new AllPersist4(Constants.intA_V[9], Constants.doubleB_V[9], Constants.intB_V[9], Constants.charC_V[9], Constants.booleanD_V[9], Constants.floatE_V[9], Constants.shortF_V[9], Constants.shortG_V[9], Constants.intH_V[9]); c.thirdObj = d; c.fourthObj = d; TestParts.thirdObj_V[8] = d; TestParts.fourthObj_V[8] = d; pm.makePersistent(c); // change values of newly persistent object c.intA = Constants.intA_V[10]; c.charC = Constants.charC_V[10]; c.booleanD = Constants.booleanD_V[10]; c.shortG = Constants.shortG_V[10]; c.fourthObj = null; c.floatE = Constants.floatE_V[10]; c.secondObj = d; c.doubleB = Constants.doubleB_V[10]; c.intB = Constants.intB_V[10]; c.shortF = Constants.shortF_V[10]; c.thirdObj = null; c.intH = Constants.intH_V[10]; t.rollback(); t = null; // verify objects revert back to transient after rollback checkTransactionalAreCorrect(ASSERTION_FAILED, transientAfterRollback, 8, c.floatE, c.secondObj); } finally { if ((t != null) && t.isActive()) t.rollback(); } } void removeAllInstances(PersistenceManager pm) { AllPersist4 a = new AllPersist4(0, 0.0, 0, '0', false, 0.0f, (short)0, (short)0, 0); pm.makePersistent(a); // guarantee the class is registered; this will be removed Extent e = pm.getExtent(AllPersist4.class, true); Iterator i = e.iterator(); while( i.hasNext() ){ pm.deletePersistent(i.next()); } } } tck/src/java/org/apache/jdo/tck/pc/building/Kitchen.java100664 5626 12500110372 23364 0ustarmbouschenstaff 0 0 /* * 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); } } } tck/src/java/org/apache/jdo/tck/pc/building/MultifunctionOven.java100664 4103 12500110372 25454 0ustarmbouschenstaff 0 0 /* * 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); } } tck/src/java/org/apache/jdo/tck/pc/building/Oven.java100664 4551 12500110372 22702 0ustarmbouschenstaff 0 0 /* * 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); } } tck/src/java/org/apache/jdo/tck/pc/building/package.html100664 1654 12500110372 23412 0ustarmbouschenstaff 0 0 Package providing a simple model for testing embedding of objects and, in particular, the use of inheritance of the embedded objects. tck/src/java/org/apache/jdo/tck/pc/company/Address.java100664 24604 12500110373 23253 0ustarmbouschenstaff 0 0 /* * 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.company; import java.io.Serializable; import java.util.Comparator; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a postal address. */ public class Address implements IAddress, Serializable, Comparable, Comparator, DeepEquality { private long addrid; private String street; private String city; private String state; private String zipcode; private String country; /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public Address() {} /** * This constructor initializes the Address components. * @param addrid The address ID. * @param street The street address. * @param city The city. * @param state The state. * @param zipcode The zip code. * @param country The zip country. */ public Address(long addrid, String street, String city, String state, String zipcode, String country) { this.addrid = addrid; this.street = street; this.city = city; this.state = state; this.zipcode = zipcode; this.country = country; } /** * Get the addrid associated with this object. * @return the addrid. */ public long getAddrid() { return addrid; } /** * Set the id associated with this object. * @param id the id. */ public void setAddrid(long id) { if (this.addrid != 0) throw new IllegalStateException("Id is already set."); this.addrid = id; } /** * Get the street component of the address. * @return The street component of the address. */ public String getStreet() { return street; } /** * Set the street component of the address. * @param street The street component. */ public void setStreet(String street) { this.street = street; } /** * Get the city. * @return The city component of the address. */ public String getCity() { return city; } /** * Set the city component of the address. * @param city The city. */ public void setCity(String city) { this.city = city; } /** * Get the state component of the address. * @return The state. */ public String getState() { return state; } /** * Set the state component of the address. * @param state The state. */ public void setState(String state) { this.state = state; } /** * Get the zipcode component of the address. * @return The zipcode. */ public String getZipcode() { return zipcode; } /** * Set the zip code component of the address. * @param zipcode The zipcode. */ public void setZipcode(String zipcode) { this.zipcode = zipcode; } /** * Get the country component of the address. * @return The country. */ public String getCountry() { return country; } /** * Set the country component of the address. * @param country The country. */ public void setCountry(String country) { this.country = country; } /** * Returns a String representation of a Address object. * @return a String representation of a Address object. */ public String toString() { return "Address(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(addrid); rc.append(", street ").append(street); rc.append(", city ").append(city); rc.append(", state ").append(state); rc.append(", zipcode ").append(zipcode); rc.append(", country ").append(country); return rc.toString(); } /** * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the specified Person. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { IAddress otherAddress = (IAddress)other; String where = "Address<" + addrid + ">"; return helper.equals(addrid, otherAddress.getAddrid(), where + ".addrid") & helper.equals(street, otherAddress.getStreet(), where + ".street") & helper.equals(city, otherAddress.getCity(), where + ".city") & helper.equals(state, otherAddress.getState(), where + ".state") & helper.equals(zipcode, otherAddress.getZipcode(), where + ".zipcode") & helper.equals(country, otherAddress.getCountry(), where + ".country"); } /** * Compares this object with the specified object for order. Returns a * negative integer, zero, or a positive integer as this object is less * than, equal to, or greater than the specified object. * @param o The Object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified object. * @throws ClassCastException - if the specified object's type prevents * it from being compared to this Object. */ public int compareTo(Object o) { return compareTo((IAddress)o); } /** * Compare two instances. This is a method in Comparator. */ public int compare(Object o1, Object o2) { return compare((IAddress)o1, (IAddress)o2); } /** * Compares this object with the specified Address object for * order. Returns a negative integer, zero, or a positive integer as * this object is less than, equal to, or greater than the specified * object. * @param other The Address object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified Address * object. */ public int compareTo(IAddress other) { return compare(this, other); } /** * Compares its two IAddress arguments for order. Returns a negative * integer, zero, or a positive integer as the first argument is less * than, equal to, or greater than the second. * @param o1 the first IAddress object to be compared. * @param o2 the second IAddress object to be compared. * @return a negative integer, zero, or a positive integer as the first * object is less than, equal to, or greater than the second object. */ public static int compare(IAddress o1, IAddress o2) { return EqualityHelper.compare(o1.getAddrid(), o2.getAddrid()); } /** * Indicates whether some other object is "equal to" this one. * @param obj the object with which to compare. * @return true if this object is the same as the obj * argument; false otherwise. */ public boolean equals(Object obj) { if (obj instanceof IAddress) { return compareTo((IAddress)obj) == 0; } return false; } /** * Returns a hash code value for the object. * @return a hash code value for this object. */ public int hashCode() { return (int)addrid; } /** * This class is used to represent the application identifier * for the Address class. */ public static class Oid implements Serializable, Comparable { /** * This is the identifier field for Address and must * correspond in type and name to the field in * Address. */ public long addrid; /** The required public, no-arg constructor. */ public Oid() { addrid = 0; } /** * A constructor to initialize the identifier field. * @param addrid the id of the Address. */ public Oid(long addrid) { this.addrid = addrid; } public Oid(String s) { addrid = Long.parseLong(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + addrid;} /** */ public boolean equals(java.lang.Object obj) { if( obj==null || !this.getClass().equals(obj.getClass()) ) return( false ); Oid o = (Oid) obj; if( this.addrid != o.addrid ) return( false ); return( true ); } /** */ public int hashCode() { return( (int) addrid ); } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } /** */ public int compareTo(Object obj) { // may throw ClassCastException which the user must handle Oid other = (Oid) obj; if( addrid < other.addrid ) return -1; if( addrid > other.addrid ) return 1; return 0; } } } tck/src/java/org/apache/jdo/tck/pc/company/Company.java100664 27307 12500110373 23277 0ustarmbouschenstaff 0 0 /* * 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.company; import java.io.Serializable; import java.io.ObjectInputStream; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.Collections; import java.util.Comparator; import java.util.Set; import java.util.HashSet; import java.util.Date; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents information about a company. */ public class Company implements ICompany, Serializable, Comparable, Comparator, DeepEquality { private long companyid; private String name; private Date founded; private Address address; private transient Set departments = new HashSet(); // element type is Department protected static SimpleDateFormat formatter = new SimpleDateFormat("d/MMM/yyyy"); /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public Company() {} /** * Initialize the Company instance. * @param companyid The company id. * @param name The company name. * @param founded The date the company was founded. */ public Company(long companyid, String name, Date founded) { this.companyid = companyid; this.name = name; this.founded = founded; } /** * Initialize the Company instance. * @param companyid The company id. * @param name The company name. * @param founded The date the company was founded. * @param addr The company's address. */ public Company(long companyid, String name, Date founded, IAddress addr) { this(companyid, name, founded); this.address = (Address)addr; } /** * Get the company id. * @return The company id. */ public long getCompanyid() { return companyid; } /** * Set the id associated with this object. * @param id the id. */ public void setCompanyid(long id) { if (this.companyid != 0) throw new IllegalStateException("Id is already set."); this.companyid = id; } /** * Get the name of the company. * @return The name of the company. */ public String getName() { return name; } /** * Set the name of the company. * @param name The value to use for the name of the company. */ public void setName(String name) { this.name = name; } /** * Get the date that the company was founded. * @return The date the company was founded. */ public Date getFounded() { return founded; } /** * Set the date that the company was founded. * @param founded The date to set that the company was founded. */ public void setFounded(Date founded) { this.founded = founded; } /** * Get the address of the company. * @return The primary address of the company. */ public IAddress getAddress() { return address; } /** * Set the primary address for the company. * @param address The address to set for the company. */ public void setAddress(IAddress address) { this.address = (Address)address; } /** * Get the departments contained in the company. * @return An unmodifiable Set that contains all the * Departments of the company. */ public Set getDepartments() { return Collections.unmodifiableSet(departments); } /** * Add a Department instance to the company. * @param dept The Department instance to add. */ public void addDepartment(Department dept) { departments.add(dept); } /** * Remove a Department instance from the company. * @param dept The Department instance to remove. */ public void removeDepartment(Department dept) { departments.remove(dept); } /** * Initialize the set of Departments in the company to the * parameter. * @param departments The set of Departments for the * company. */ public void setDepartments(Set departments) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this.departments = (departments != null) ? new HashSet(departments) : null; } /** Serialization support: initialize transient fields. */ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); departments = new HashSet(); } /** * Returns a String representation of a Company object. * @return a String representation of a Company object. */ public String toString() { return "Company(" + getFieldRepr()+ ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(companyid); rc.append(", name ").append(name); rc.append(", founded ").append( founded==null ? "null" : formatter.format(founded)); return rc.toString(); } /** * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the specified Person. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { ICompany otherCompany = (ICompany)other; String where = "Company<" + companyid + ">"; return helper.equals(companyid, otherCompany.getCompanyid(), where + ".companyid") & helper.equals(name, otherCompany.getName(), where + ".name") & helper.equals(founded, otherCompany.getFounded(), where + ".founded") & helper.deepEquals(address, otherCompany.getAddress(), where + ".address") & helper.deepEquals(departments, otherCompany.getDepartments(), where + ".departments"); } /** * Compares this object with the specified object for order. Returns a * negative integer, zero, or a positive integer as this object is less * than, equal to, or greater than the specified object. * @param o The Object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified object. * @throws ClassCastException - if the specified object's type prevents * it from being compared to this Object. */ public int compareTo(Object o) { return compareTo((ICompany)o); } /** * Compare two instances. This is a method in Comparator. */ public int compare(Object o1, Object o2) { return compare((ICompany)o1, (ICompany)o2); } /** * Compares this object with the specified Company object for * order. Returns a negative integer, zero, or a positive integer as * this object is less than, equal to, or greater than the specified * object. * @param other The Company object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified Company * object. */ public int compareTo(ICompany other) { return compare(this, other); } /** * Compares its two ICompany arguments for order. Returns a negative * integer, zero, or a positive integer as the first argument is less * than, equal to, or greater than the second. * @param o1 the first ICompany object to be compared. * @param o2 the second ICompany object to be compared. * @return a negative integer, zero, or a positive integer as the first * object is less than, equal to, or greater than the second object. */ public static int compare(ICompany o1, ICompany o2) { return EqualityHelper.compare(o1.getCompanyid(), o2.getCompanyid()); } /** * Indicates whether some other object is "equal to" this one. * @param obj the object with which to compare. * @return true if this object is the same as the obj * argument; false otherwise. */ public boolean equals(Object obj) { if (obj instanceof ICompany) { return compareTo((ICompany)obj) == 0; } return false; } /** * Returns a hash code value for the object. * @return a hash code value for this object. */ public int hashCode() { return (int)companyid; } /** * The class to be used as the application identifier * for the Company class. It consists of both the company * name and the date that the company was founded. */ public static class Oid implements Serializable, Comparable { /** * This field is part of the identifier and should match in name * and type with a field in the Company class. */ public long companyid; /** The required public no-arg constructor. */ public Oid() { } /** * Initialize the identifier. * @param companyid The id of the company. */ public Oid(long companyid) { this.companyid = companyid; } public Oid(String s) { companyid = Long.parseLong(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + companyid;} /** */ public boolean equals(Object obj) { if (obj==null || !this.getClass().equals(obj.getClass())) return false; Oid o = (Oid) obj; if (this.companyid != o.companyid) return false; return true; } /** */ public int hashCode() { return (int)companyid; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } /** */ public int compareTo(Object obj) { // may throw ClassCastException which the user must handle Oid other = (Oid) obj; if( companyid < other.companyid ) return -1; if( companyid > other.companyid ) return 1; return 0; } } } tck/src/java/org/apache/jdo/tck/pc/company/company.jpg100664 263513 12500110373 23217 0ustarmbouschenstaff 0 0 ÿØÿàJFIFÿÛC    $.' ",#(7),01444'9=82<.342ÿÛC  2!!22222222222222222222222222222222222222222222222222ÿÀ¶'"ÿÄÿÄW!"12AQV•Ó#6TUu“³Ô$35Ba”Ò%4R‘´bqC&7Scs‚Ddrƒ’µãEFv†ÁÃÅÿÄÿÄ4Q!1R‘ÑAaq¡Ááð23±"ñ#C4BÿÚ ?÷úR””¥¥)@)JP R””¥¥)@)JP R””¥¥)@)JP R””¥¥)@)JP R””¥¥)@)JP R””¥¥)@)JP R””¥¥)@)JP R””¥¥)@)JP R””¥¥)@)JP R””¥¥)@)JP R””¥¥)@)JP R””¥¥)@)JP R””¥¥)@)JP R””¥¥)@)JP R””¯‰¦ŠÞ 'žDŠ(Ô»ÈìU@Ù$Ÿ€€û¥Fù_Ó?h±ëcÿu>WôÏÚ,GúØÿÝCMMNȳJò¿¦~Ñb?ÖÇþê|¯éŸ´Xõ±ÿºƒSS…ò,Ò£|¯éŸ´Xõ±ÿºŸ+úgí#ýlî ÔÔá|‹4¨ß+úgí#ýlî§Êþ™ûEˆÿ[û¨558_"Í*7Êþ™ûEˆÿ[û©ò¿¦~Ñb?ÖÇþê MNȳJò¿¦~Ñb?ÖÇþê|¯éŸ´Xõ±ÿºƒSS…ò,Ò£|¯éŸ´Xõ±ÿº¬Ð¬¡(ýÊ”¥ ŠR””¥¥)@)JP R””¥¥)@)JP R””¥¥)@)JP R””¥¥)@)JP R””¥¥)@)JP R””¥¥)@)\Ná-ïúcysy—y糆YÞ×C“2N„šOÑT¾MXþ“—ûÞëñ+é0NÆò§¶›{;½ËÔ¨?&¬IËýïuø”ù5cúN_ï{¯Ä¨ú¨dÊà†o—¹z•äÕé9½î¿Ÿ&¬IËýïuø”ú¨dÆfù{—©P~MXþ“—ûÞëñ)òjÇôœ¿Þ÷_‰Oª†L`†o—¹z•äÕé9½î¿Ÿ&¬IËýïuø”ú¨dÆfù{—©P~MXþ“—ûÞëñ)òjÇôœ¿Þ÷_‰Oª†L`†o—¹z•äÕé9½î¿Ÿ&¬IËýïuø”ú¨dÆfù{—©P~MXþ“—ûÞëñ)òjÇôœ¿Þ÷_‰Oª†L`†o—¹z•äÕé9½î¿Ÿ&¬IËýïuø”ú¨dÆfù{—©P~MXþ“—ûÞëñ)òjÇôœ¿Þ÷_‰Oª†L`†o—¹z•äÕé9½î¿Ÿ&¬IËýïuø”ú¨dÆfù{—©RzZin:G <ò<²Éa¼ŽÅ™˜Æ¤’OÄ“U«¤¤£†N9 R”*)JP R””¥¥)@)JP R”£uæV{öuÇðÚ¬Ôn¯üÊÏ~θþPÒäŠ)Ò”¯ ׳½·È@ÓZÉÜe’x‘§Ùyú™Xž¼x­ŠóœU³ärÖ÷¾¾‚ÍåÏK4V·-t®A픆æNÔƒñâX%rF¥ymÎræ\?Od¯òŽ×8‹k…‚+ç³™ç+ÉÚÞ5SܬJ zTª jZ©–ÎûC'Ÿ+ì÷³çñÞÅl÷$’Ý¢¿mIÙŒ‘0:ðO=ý58¹ßR¼æK‡·é»«ÛÌô‚ç5wyòmioQÜ\W™Ahcô€}LÆ8Éá¥ð^õ˜ {ëìŒ5¾[»7RÄÎ!»Š8•Ü…”•]z:<¾s‚ÀJ¥y­–eoíñ7=E›º²yðV76OíOvâC7ÓÄïâÉ•p9(ãë!²d2/—ÓÛ Ø ™2Éi™)’Gµ+ —…š¡I”“8î·Í<‰*"0=Âç£R”ªFêï̼ïìûáµ_¨]ù—ýŸqü6«õÛ¢îe§ø×‹ô¥+¨ÄR” ¥()JJR€R” ¥()JJR€R” ¥( Kqsm‡ ipöóIumuY•dž4mo‹ˆ5‡ÝµoÝZþ}õO÷7hÔ›ÿý cÉr]ÿݵoÝZþ=Ñ‘ûQ–ýÕ¯àT{¾£ËÃy›Çb-¬ò¸ëfevs$âØq°8¡œ·ð6œy2,Õãå¬q÷ðØÜ\ÛæšÉîRƒÍƒÜ #RÌcm0CêmŽ_Z u3Ç’äº=Ñ‘ûQ–ýÕ¯àSݵoÝZþr˜Î¿ÈO‡ºÌM`óZ D¹UQaqj°Ue€Í +1`ÇN€ɓĆßê3Õ6¸4 “Ç,ç%`©s¬©É^åÇÝ'[*IçêRËÅ~qœu/fÈÖ<—%йîŒÚŒ·î­žèÈý¨Ë~ê×ð*½*šéæN±ä¹.„td~Ôe¿ukø÷FGíF[÷V¿UéMtóÇ’äº=Ñ‘ûQ–ýÕ¯àSݵoÝZþW¥5ÓÌkK’èNé«‹›œ9k»‡¸š;«˜{®ª¬Ëò"ì(|T|ªõ¥¿¹æý¡}ÿ•-Z¯J;‘J»*JÙ±JR¤ÌR” ¥(#ù—‚ýŸoü5«5Èô¿QYAÒXhž ™d±IL]Ë©"5FAæUùOaú>[ï.Qw{º´§Ž_åï}…šTo”ö£å¾èºü:|§°ý-÷E×áÕp¼ŒõU8_"Í*7Ê{Ñòßt]~>SØ~–û¢ëðé…ä5U8_"Í*7Ê{Ñòßt]~>SØ~–û¢ëðé…ä5U8_"O]ÃÄ7Î#Þð¶U¹Yp‰»¿Õ.>‰YSÁõy#áãΫAd—¥l²¹k,¹¬¦ö;X1ý”n34ÍÏÙ·fâX¼)ý®>=&¯\fqSÚM5žY¤´”Í÷UØàå ñŸK°óõýz¥îg‘³’ÖêÏ,ð¾‰v¤A ¬#X`A"®¯d¬558_"L]Mž¸·±‚hÍÎU¬ÍåŒö©$~ÊówV<Ç^hÒºvß(r1ØfDüÚES¾1Fí¾N‘àŽvÛePO7Ùõ6Íw UNÈšzÏ/O6VT±“Û0«8–_gí¤l"ó=Ý÷”r?˜|z½=##‘“1}ŒÉ­¯~x.Õ­ƒE•¥^ÙävåL'×¥åÈz^c$*–÷vþìÌ´Vïjѽû,p¸ÓG*DHF½1ñ•ÿ¤j¢fqä&¿[<°¹š(á‘ýÕwå¹Q®Þ¼þÿä(ÖHjªp¾GAJòžÃô|·Ý_‡O”ö£å¾èºü:¦ÕTá|‹4¨ß)ì?GË}ÑuøtùOaú>[æÕTá|‹4¨ß)ì?GË}ÑuøtùOaú>[æÕTá|‹4¨ß)ì?GË}ÑuøtùOaú>[æÕTá|ŒÝ!ù•ýoü5«5¤?2°?³­ÿ†µf½b•¿$¼X¥)C1JR€R” ¥()JJR€R” «ÿ2³ß³®?†Õf£uæV{öuÇðÚ†”$|Q3)Ô|5ªÜ_c±h¯"Å¥üò<Ž~ ˆ–Řø'@Ÿ€4Åõ_3j×8ì[ªHÑH¯AÑÁàEr?Ò@ƒ!Ô©mt.HÇØ¤ÐÇk,HÓw^C"¸•Y«FèÉØmTn޾»Ãä§ŸlÒÛ]ÛFnW%"©·uc"D¢(Ð/¦Y¯ÒFÀÜ´tYÖIA]™ée›«VÊ+·oSÕ=§©Tâ~ó“ùz{ORþ©Äýç'òõ zòÒx®2XÛ‹Õ0ØE¹¹šê[rФöÃ++zÓø¸€Õ·sÖYcn^êÊÖ Ë[Ñepe½+g –`ï9Mªu]”þÑ‚ëD5sÊŒœe4lªE«¨¯>¥/iê_Õ8Ÿ¼äþ^žÓÔ¿ªq?yÉü½M¸ê¸m×#yhü"÷ ÆÚìJ†8Zð…8pÈç‰è^LL%öRç¬röù+ehqöeaŽç½ -%ÎÝ”ùAÚ©ÚkD&¶Ù{Ž<+Ï©½í=Kú§÷œŸËÓÚz—õN'ï9?—ª±™‹Ê%ê"®X²ñXhq<¹ øï·(™»Ë<¶fÚý®æã4––qO9Ž$þ¡Ì b‹¥øS¶o€Ù ¶ö qá^}JÞÓÔ¿ªq?yÉü½=§©Tâ~ó“ùzš½[}u5…¦?“^]%àIwÛŠ¶™!“oÀ±BÌÜX.ϧj%uïúñ£ÃÉ•ÆbòÞ Dyy’IÖ)UÌaFˆ$v›Ÿ‘Äy^gÓL/!Ž<+Ï©kÚz—õN'ï9?—§´õ/êœOÞr/ViUºÈc óêr=QqÔ ÒY‘63‘òddfUí¶È³þ[ûŠí*W~eçgÜ ªývèÏcpVVÚý)Jé0¥()JJR€R” ¥()JJR€R” ¥()JW;&šDŽ(ï¬ÝØUQI?+çåwM}¡Äÿ­ýÕ—ª¹áý¡cÿ•p½s—ÌÝõ"ã±®ãfnÅ·qpP¹ ð;€ \/å’ÅBŽZñÅ$Žˆ¸ªKí~Çkò»¦¾ÐâÖÇþê|®é¯´8Ÿõ±ÿº¹n‚ë6Þåê;¸áËE2GRN³;Äê8• Wõ‡@ÛÙÒõ¸åÛ¶9oÒÁ²¢ñÝ‘-ÌËÜfUÀ.öHVV#è À×<é¸ïET©¾ÇÏØÒù]Ó_hq?ëcÿu>Wt×ÚOúØÿÝ[3gqð\O6VÆ(mõß‘îV-»F9}>´eóþ%#â |]f!ŽÝn-îqÏÙKw’ÞÕÕBÛ Ãµ¦õIþ¯ƒËÅ,²&ôò|ýŒ?+ºkí'ýlî¬}AÒXø\î&8ÚY&#Ûíävw>[éfcþ[ñâ¶sCg‰xàîÁ-ëËl¾ÉÞ Ž[„‡¹ÇÉâ üu¢F¶*œ“à Ēʈó?•˜íĶ—ë~Ç7.O¢¦Šú938’·Ò¬ó‘PLЍªêCmÓEtAPFš–.ºn ¶,ZgpÑØÙ\5ëÏ.[½qq1†Hx¿2Id™rtxëDu™ Ÿ°^âm»<ýátÖܹk·¨e—–µçû-kÇÎßÑ¢;ˆ›Û»Y[÷~ý³ÂfÖ÷Üóè×øë柪¦âôò|ýŽ~Ön‚³ïò¸—Žhšù!4i|è£Gr±ÆtDHUÒc' ÚÂ{7ÎÙÈ“¼o$²æÝæÜl=Ld2¬9I#âwÔ&[%½ÝÂd-Z 7tº‘fR°2 ¸s½)QñáôÖKKë<„F[+¨.cvðÈJyZ²°úÃð4¿ˆ½<Ÿ?bwÊîšûC‰ÿ[û©ò»¦¾ÐâÖÇþê³J®Ázy>~Äo•Ý5ö‡þ¶?÷SåwM}¡Äÿ­ýÕf”Ø/O'ÏØò»¦¾ÐâÖÇþê|®é¯´8Ÿõ±ÿº¬Ò›éäùû:Bh®0/42$‘I}zèèÀ«)º”‚øƒWj/KsÍûBûÿ*Zµ^¬w"•¿$¼X¥)Rf)JP R”’õÕä¿Ñ×Láln ·–ï“LnKˆd‚8£FŠ+7—š#Ä 2«@:1ú?::c4²,Ö×XlšH[â~s¨X 1ìåRè y^~˜íí:Zרú7¦$’îòÎæÛŽ{GPÜZ8Ë)¬¤ˆ~Fˆó¾në£3]3’1a-}í÷äíî® ¡´sê~ð@lúŸ’€Ä€¤ÄÖz:5g«©+oùrŸôjV§Ê„qJûïøw³u~¬ÜÞ3›Ô‘í¢† $’^ÙPêT·%,9.¹ 6Ç¥µ–ëª0Ö}“%ç8æ‰gÁÍDß6YXã:$;¤+éN¹;lïLõ.\Ñd/䱿¸»’þFŒ]9’ÍI ¡»ZÒh`ëg˜ýºþn=žÒÒ9òˆ·ÄÎd¾¹´P±Ã'Sɳ.¸è7¨‘ÉV”Úƒ¼{>|ýn4ƒ–iÕËÕho/­óúŇsÄìc,¢øYûŠFË…«ùOŠ÷¶÷§ãÝìv}–_hîk—Çç.>½qßWÍóZs`.^¢me9 Øî IÔi!4YtÑ¿(IW]”‘Uá32‚HÙÖÍekì >«qÝü€~û^Þ[Ç ¬³»$7.´§&Öaðäl\õ~Öá “"ŒïoÐ1#H¢,Å”"ô¹Z-äP÷Á›ÚZ4RŽ–-³ÈÖ€ŽŽÎö| y±Ëœ³Ç]YÜÅ$ï5´W1òv•iäIevQtß§J9”ꎜaÆo‘x¥Ä&(\Cw+WX½¤7¥ùn—Û«)U«õ ­Ëæ÷vÙ‹¬H·@ƒxð5»†s+È±È *bâH} ¥úµñY,Šõmx—؉쯥i¦vY‡ £TFVRÜⱞL‰rà2鬯¼+…N¸™°öÙÛŒ3ÀdÁ]åaƒÛ‰Üq¬ Å€vÅý-䪀.Ê´ä껋e¼Šóؽ‹ÙL0{@`ÂæS "FÐÁÔó (ò¥þ\ Ý]ù—ýŸqü6«õÄä3nêø®ì=ŠâÂídA0”9öe“’¤÷jâîç¦Æ8Å™˜xßÜGÝ·HÀ•Iñ"¶Ø$gÎùrø17ì°÷M—Íã-lÞà Æ4É•šei ÛEi)¦bBž%ym¶zŽ~‚ë6Þåê;¸áËE2GRN³;Äê8• Wõ‡@ÛÙÒõ¸åÙ%ö"ß$Ö‰ucý̧”"DË"Æ„í~,Â>Ù?H^?F«]7L«[ e’Ýo7áݹZ.‡F„§(]¹;¶Ýßrð]Ç3÷ggy3¹qoŸ¾ÈÏoF²Ü$¦æ4`Y‚–á,GÔÃJºø€µ#„ÈIm&4[ÿ_¿Âõ‘[—]†¸¸†DF;ãÈw»D5èQå±Óe%ÆEµ|„)Î[E™L¨¾<²o`z—ÉHúëB,·K[¾C'C”ï®’h”•eü‰•Áø#‰cäÀ¤îu3[ù2—P®ïë;c“†ñ^˳£òæáÃñ†Oš§aÀß’m$Œ¬/ wâÌ¥uâO&Ù[xÙÛÙ÷™lv>âÖÞ÷!km=Ûð·Ži•fØ@NØí‡õ®¶&žt<©T ìf £ÏÒX€ÒHVÛ°&f,®.²?41òŽÓ óNyÁ ´èŸ©Ôxúþ­×ý7›¸éaŒ÷kÅ>;¦.°êÏ,|næ‘!Uh´Ä„Ü'Ì©||x÷Y¬Ÿºq¦èCÞ‘¥Š£-Ä4’ȱ§&ÑÒòuÙ6@'Á‘yÕ˜;˾¤ÆÁim¬—"k;³:Gm™ãŒ,Œ]B/žZo†¼Ì\»¡œÂKåäöÖðAd‘aÒÚ0é»[ÞI!… !‘T)gQ±ç[}¬/:¥žÁ,L¿u­Ñ”ñ-knÛb¾9íµ±È3|ãS#—ÄIŠ^óé‰$»¼³¹¶ÇÂ#žÑÔ7Ž2ÊC«)¢†ÁQ¢<èÌ×LäŒXK_{G}ù;{«‚¨múŸ¼Û>§ä 1 )ñ5ž‡NYêêJÛþ\§ý•©Ær¡R¾Åûþ6k­¢Ž{8q·‘A ¶7 o§ÇÏqqàèU i¼¶öÛRJòu«’õFËëG¼þ±aÄ\Ʊ;Ë(¾–~â„Q²çaA*ÀróG“˹¶´½[‹‹¬NBÚâæéˆ2Üܾ€!Pu¡ó@PòjäØ —‡¨‡YNBö;¨FuH`M]4oÊU×e‘ƸëF’›TÝ×gÏŸ£H9áX÷ö‰ºÊÁn°ðÁÔÞñ½k6Öd{v4Ÿ”B›Btž¥¹üÕ&·,ú£ È5­çru–Häœ –2ÁâæGàâÍÃ|ŠŽ@qóQíð¸Ó$’@íg•7FÞkÙgìÀÖòBʳº•¹HdÀùÜ6ƒ[½9yºyIö<ÕîBM1óÞÕÄ8wÓG†ò|o6¢XÜN®Â=½ÝǵºÁkn÷M#ÛÈ«$(6ÒDJ*¯T|‡©êÇò×§¿XêþÆOì¿û?ÍþÃÿ·ÿgÿª¹‰º=uï&¹¾‚Y®0·¸Ñ$·“ÉÝš^Þ¦âÛHUŠÇé44\h-üïN^dþSvd}é…L|ØŽ2hÙm¥ü²ü6| Í¢ “u2ß(1ÒNâ~k0‚CnÚâ(^çk¥fóMRï~I–'‰92¿ã0‰oQJ4§ÉÐއĀy ®¸›ªî/ø¤¶—7°^³>BåMÄû2‡p‚˜h°Ú°@¯Ì!hÈ_R–r¥W‰ò£G‘åÄhëÁ'~4jÒìާË͇²¶’)ím{·×ŠZ EàíÎAÉ|UŒm—Õ"ù?4˸ê{ü5orkRÒymÖ÷o IDòp "´­é]8méùª?ùTÊ —𢗜NÜá8²ð.Šh²¾Âðãà1#™›¦ró[dn"´ÅY\Ü]Y\­Œ.`y!¸I+ÉÚ¹ Ò“ÀŸÉ®Éø,ÆÖÚ w]MŒKÛŒ|YKË[ˆ"¸V·’A‘â §Z¸•B’u¾GÈG%ŸTa²±µ¼îN²Éü“„ÆX<\ÈãÜY¸o‘QÈ>j}×N^Oïn2@=³5el|G²òÇÎ=‡×Ñå|:Zôåäéå$ØóW¹ 4ÇÌs{W<|áßMýÉñµ£`PÇõF)wË–‰§D1:ó‰JŽê’hÉqÅÆÕ¼ñ'‰ÕzóžŽw~¡ÃYEwcum‡ÂÍbM©c$d=°Sp¬†G·äHÚ˜ßÔÞxú5D•˜¥*¤ŠR””¥3¤?2°?³­ÿ†µf£t‡æVöu¿ð֬׮+~Ix±JR†b”¥¥)@)JP R””¥¥)@*7Wþeg¿g\ ªÍjä¬bÊbîñó³¬WP¼P€ÁYJo~th^›QšlÓÉà±®×½qV7ý­öýªÝ%á½o\Öô?ì+‘ºþ"|Ÿ³Ú_5¯MÎÆ[œlC‰ ½˜âaó"rIaôkK ÇSî+ï´ùÝÚþ=Å}öŸ/û»_À¬tw¤híºRµþsÉ‘WG£U%RÎÎûSÞ¿Fž™¶–å%³»»Æ¯³¥¬±X”e… pÊ“^nŒ£_ ¬wÝ%gk¦¼¾‰ê Ù-¡”,rO‹·ŽGÓ)]ñÐßúaµî+ï´ùÝÚþ=Å}öŸ/û»_À¬>ž¦f˜cļú0ôåœÅÆIϱä.2퇙&ïrÇÍ÷×Óá|Ÿ;×n”&²ÈßY\Å-Ô‹siŸÄ½éNŒ¼Kñ×§à<ù;Ú÷÷Ú|¿îí´²Ö7ØÌd×C¨òóH8¤1pµ^ì¬BÆ›ìxäÌ£gÀÞÏŠ}=LÉP‹vR^} V˜‹{,„·±<í$–°Z,…ý žM¶,{­²IÞ‡Ó½îØ\<¦g(Ȫ"!x©í‡ìì²G¤h;ç°v<ŽÚæã©²‹tT¥Ê$V¼Rd%dQùà:°ÞÎõàŸP÷÷Ú|¿îí£é§š„bÚr^}œ†Ýä ý¦Vûrñ,3=¨…»¨…Š%Àâ]þn·ÈïzÇiÓÖW¸ë¸.î„–ir­²„\›‡Y%i=> ‘Cú8€|ÇÅf÷÷Ú|¿îí¹ùjÓ¨/ìî³9yl`Ž’{H –UY9( ·$úâ“ÊïA“ƹ0Ÿ§©š-Jw´—ŸB”Ž—mŒiî»ø‰pèÁב†EY§\õèë^O«&s—+}SÏw4V¨#ŽUB¾Ï+J`W¸Ëþ†*¡´ Ï"æâ烫2’Å"‡I-YHØ ˆ|‚+ïÜWßiòÿ»µü }=LÊaóèswè^±ží.‘ïÒ{·’¤“ê©2%-0T¯=rßY¿oÔ Ý•àRÎEåÉÖÃì|GúhGÔ6w=C*ÒX.yErÓK Á»2Bð«FÀoMù`H$¯‡Ÿ~&γ„nÎ =•“&ERë§m17PÙMjª¯ÈLò«Ÿ•Ðhƒt};ôé¤h2Bóê¼P¨ ·’€;?NÐ'@éÛçqVr]Ûålf¶Š.ü“GpŒ‰Øs,‚íoáèo¨Ö¤Ý]‚…ðárv³&^á­í$ŠtdvUbH<¼ŽJÆýN£é£n]€ÛͥĘ‰ã¶´‚ñ›ˆ’Úp ÍaÝ@ ±Nay¼ˆäuºãn°w÷8|åžu‡³¸Ä][Œ|óÂ#–áÔŒ)Ž‘ù^ZàÈ ävW¾’xax’YQgá³]¸–ÒýgбÐú?ELÏe¯1­†ÂÊ «›û£l‹=Á…QI)bÁü"#Zúj"ÚØ;½Ë|¦½Ææÿ¦ÒÆÔJÑ÷SíâäåâÙß@òuãîï§nÞã;q’wï3¸ë” %¼&Ô±'{Ò”›J|üt=^j[g¯ÕÍŽJÒÆÒöfrô¼-ò4k§hÔ÷7€œtOËÔxÓls_½‚ä-Mâ:£Û‰—¸¬Ê]A]ìªÌÒŸ€©¼8X-凨úv'±‚HáÏä™2+*8nò^Hc[a¯› n:xÀÇ‘èÕÄá2Ïaê«þšÅX.^(Ûígï\þ[€‰eÜ(x’Q|3hññÄ^ª<¶:l¤¸È²¯…9Ëh³)•Ç–MìRù#é]'pnR¦>{%¾M¬²8éçÇ#„kµU€o°ÙŒmNÉ4|Vs–Ç-úX6BÔ^;²%¹™{ŒÊ¡ØÞÉ ÊÄ}ø­˜7)Sýûˆ÷G½ýëcîÏÓ=¡;?;Ïßããññ_5 ¹Œu•¿ ྲšò;˜äJ£Bµáƒ ·½ýNü,ÁùÒßÜó~оÿÊ–­T^–þç›ö…÷þTµj½XîDÖü’ñb”¥I˜¥)@)JPKÔW’ÿG]3…±º‚Þ[¼jM1¹.!’â6(¬Þ^h4ʬ èÇèüèéŒÒȳ[]a²i"AoˆùΠb0Æ?³•K¢åyøNc·´ék^£èÞ˜’K»Ë;›l|"9íCqhã,¤:²J!øl#Îù»®ŒÍtÎHÅ„µ÷´wß“·º¸*†ÑÏ©ûÁ³ê~JOYètèÕž®¤­¿åÊÑ©Zœg*Å+ì_¿áÜü§¶|¥‡jâßÝsãîï%¸”í˜^<‰#Ž»È0Ø+çZ"¶aê|TÖw&iá[~=È®-e†oQÒj'Píɶ« y0*6A ÑX‰"’Ç*ÞÖÖ7±Ï™yÈn¦6üeŸOè&À(óäÖÉÂsS\-«›ë{T†Úl…Õ×m¡’V#¿!æ¤óR²(ì!)·ã«JmSw]œþtFr±ïí+ÍÖV u‡†®¦÷ëY°6³#Û°‰¤ü¢Ú¤ðÜ}-Ïæ©5¹gÕl†A¬mo;“¬²@$á±–28÷näTršo€ÍƘy$’k<©º6ó^Ë?f·’Uм­ÊC æÎá°صéËÈ=ÓÊH±æ¯ri˜æö® xùþ›ú<7“ãyµÆâuvíîî=­Ö [wºiÞEY!A¶’"T P z£ä=KÿPÞ?–½=úÃÿWö2eÿÙþoöý¿û?ýUÌMÐÙë¯y5ÍôÍq…½Æ‰%¼žNìÒöõ7ÚB¬Pî8×I¡¢ãAoçzró'ò›³$ ïL*càæÄq{FËh/å—á³àøønmT›¨q–ùAŽ’wóXÙ„£v×yBðG;]+0'šhz—{òL±N†ô>$È]t}ÄÝWqÅ%´¹½‚õ™ò("h– Ùˆä;„ìÃE†Õ‚Ý|†`ñ£FBú”³•*¼O•<.#G^ ;ñ£V—`$u>^l=•´‘Okh“Ü¥¾¼RÐZ/nrKಬcl¾©Éù¦]ÇSß౫{“X2–“Ëh¶·¸»yJ'“¥oJéÃoOÍPyøßʦPŸ§€Í¼ä‚và— Å—p¬SE•öÌÝ3—šÛ#q¦*ÊæâêÊål`¹sÉ ÀšI^NÐ=É”žþMvOÁf6¶Ð[ºêlb^ÜcâÈ"^ZÜAµ¼’ÌU:ÐĪ“­ò>B8,ú£ È5­çru–Häœ –2ÁâæGàâÍÃ|ŠŽ@qóSîºrò{q’홫,„{câ8}—>>qì>¾+äyÒ×§/ ÷O) >Çš½ÈI¦>c›Ú¸ãçúoèðÞO­†?ª0ÙL€°³¼î\´M:!‰×œJTwTFKŽ.6­ç‰kmK#!í‚›…` 28¿"FÔÆþ¦óÇѪ$¬À¥)U$R” ¥( !ù•ýoü5«5¤?2°?³­ÿ†µf½q[òKÅŠR”3¥()JJR€R” ¥()JJR€R” ¥(Fþ1œ[ÿ'‹‘Ò?þÛpW‰u#èEi#ø³8 îeç½¶Ä]Kµö«åŒû<;Pþ ½²oÉòךeœÇa,­1×¹{y‡äÂMc$Ï+è±bñ+#»ÎJ’wÈèmNqn;_Ë›½?ù³6Kæ;lŒœ øžê$í¿þúfü€ø“f¹œn_yÖ·"ÒòÞããFõÀa‘ù Púžú€ÞÕÁÖ¼ôÔ"²j[{mó˜¨Ùoê¹Ì-øð ’YJÍóQ%^@ïè&H¢A¿½h’5f§ç,eÈá®m­Ùè¨{grx¤ÈCFÇãà:©ÖŽõä… ÓiKo˘fÂ,3Éwˆ‘,.äbÒz A)'Ôdˆ2†cñæod©ûÃæS+í1˜»w’vgT‘e@ãâÔèùÃqp4YWcs.çÍæñqgkwEŒH¶³K‹³ñ1’öA]¯-‡ wéá§¹Ž–Òl| `mUxFˆœôðã¡Ä©*@ ‚¡¤ÓPÿ[_ðÚ¥)CJR€R” ¥()JJR€R” ¥()JJR€R” ¥(½SýÏí ü¨«•êŸèÞ^¡¿ÈKVÞ+[ò¯qosbgõ„DÚ°‘ Ž1'ÖAï·cŸ²¹Èb»6bp—óªÌå»s$„‘°¤oFµ»ÝMú§÷œŸË×=USp7ŠÅM.÷Ûàymž5qwsÓcbÌ̼oî#îÛ¤`J¤ø‘[l3ç|¹|žž>œ¿·Èd,#Æ]J.2x똞X[¹ ²Û$n]Âû†P=äûð #«ïu7êœGÞr/N÷S~©Ä}ç'òõ¶—¤×ÒV’Ë?‡&ÿ:ž)ÊlÝÛrMøoÜ·#ŸµÆå`Ëâl›9·³Í^ä$¿ÅÙ1Ì·E@ûœú5°ÞHÑ0ߦïÎYÝcSlzNë>VæXD2·B0ebý¡ÂVÛªèàEwî¦ýSˆûÎOåë¦G?}l—6ØÜD¾ø?¼¥†õ±» üAÑãÕÕÈëÕ;_g4rW–ù¬ßR1‹¼’ßv#W„Ü?fæf,Oª>éPY—A96…ž)øË÷³ÈÏ+çMå×µÍlgHÍ›ÛsaÀ‡¥ >|’TXÇcò˜{v·Æt×OXÀÎ]£¶½h”¶€Ù nôŸò¹ÞêoÕ8¼äþ^ŽNÄF­æ¹¢”’2ÑYûÝMú§÷œŸËÕU‰ÞÄêݯ³š9xúz飺lnÜöR]c1ßM Ø’i¸ÄÌžcà7¾Gµ­x]ëÁo,=GÓ±=ŒG$É‘YQÃw’òCzÛ |ÙqÓÆ<ŽÃ½ÔߪqyÉü½iÇÊC”—'Mtòd&NÝ­ë ]|xgö}‘é_ýê«jêv¢5o5ÍðÖ9‹¾”ÀtõæëlÅ®.®%ЛfÊ ŽFf,Ñä(“½€¬ÄôöRß©"g"ö–¹+Ëø‰–ØZñ›ÎÏ©ôCqPyÄ Òwº›õN#ï9?—§{©¿Tâ>ó“ùzU\†­æ¹®§.¸|¬¿ÑõÇO¶ íž\dWrMåä1*jDlP_¶|'¤ùã±’éio~QsÆÁ7¼sXù0‡¿k²ó ¿ŠŽzOùèz¼ôî¦ýSˆûÎOåéÞêoÕ8¼äþ^šº¹ [Ís]HWجÄSåî­mœ™résÛöäEìqDZ÷äÕù©SÏ^Žæ¼•ßÇJà³8ûÌTÙ8¿) YQq'uo=ärÆv¡wÉU›aW_HSâº÷S~©Ä}ç'òôïu7êœGÞr/MU[ZÃVó\×S륿¹æý¡}ÿ•-Z©˜ +œ~+³x!qq;,.]W¹3Èb: ô*wGb+U§RMfÅ)J“1JR€R” <—¨.¯%þŽºg cu¼·xÔšcr\C$Å4lQY¼¼Ñ i•XÑÑùÑÓ¥‘f¶ºÃdÒD‚ßó@*ÄaŒg*—EÊóðœÇoiÒÖ½Gѽ1$—w–w6ØøDsÚ:†âÑÆYHue ”CðØ*4Gów]šéœ‘‹ kïhï¿'oupU £ŸS÷‚;gÔü”$ ž&³ÐéÑ«=]I[Ë”ÿ£Rµ8ÎT#ŠWØ¿ý›«ðpEfæñœÞ¤m0I$’öʇPŠ¥¹)aÉuÈi¶=-¯‰:» 6?!=–V6Ö²\‹žËË D§Bº*±Ñ!IŠÒÀôk`r¶7Iv×L¶×Bòâb{“Ï+[Á~ ¡`â(óäÖŒý‘—¥¬1‹=¯~ߦ.pîÅÛ‰šDU‡§|7lë~G«Ž¤i*Sw]çÎå¸ÒxV=ý¥|ÿVZbæŠÎ ‘¯žöÒØ«Æå?+4jÉÌi{½·.|µ¦âV—]Yh:‡‰³™$–æöKy¹ÆàH&v17…r¯«q-Äž-¢Eiäº/.Bí-ÆK+ì­žFi¦¸t’Ƀ’*Ø>Ÿ –_/­xÙ[ôþ^ ¾:.-Œ²ÊÝd}£ÚLýå¸ôv»|Fšã[ævzÐ¥£bÆÆ3¬¬›§°×¹I{W7¸ø/'[ÈñÀ/#(a{å¦r•¼úN¨7Ta“/&(Þ\ŠT†Uí9XÕY¾¸§>jdrmªíèúù±øûY ð[\UØ÷ͼiÚøE¯hSÜ>‡)áu±Ìêý×N^Oïn2@=³5el|G²òÇÎ=‡×Ñå|:5‚¤=CŒ¸Êts¹Ÿ›F¬`E#®ù"JWƒ¸ÓmU‰cÒÚŸ]ôåÕ¼SÛß¼É2·ZÊÍrÙì¨]ÊWüa)£ËŽOù/˜“¬lr·‰-½¥ìÓ’×s“$o¨Š°eš®À%À,J«n`ºróòg½$ î¼+ãçàÄòû>Šì ¯ä[ã£äxøê-PºêŒ5ŸdÉyÎ9¢YİDóF‘7Í–G@V8Ήä) ÇzSªsL° wAuODlçlÁG€ ÖÏ“ðdèkÏ_ú>¾l~>ÖCÇü×v=ãsovƒ†~kÚ÷¡Êx]ls:ô)ŒÊ€Á;óPC¹QÇävòd¤€67±In‡PäfÄáf¼Pº¼hd”«:«JàèEbíäxSå~#Ÿ›©ò8œîv{Œv{”×Üâ¡h×¹Fu$¥ƒÛq ¶åññÓäã¾’Á†6dŠí];ƒÒáX3FNê r•å° ®W!Ó9|ÌY¹e´Åc.oñWL-n^Qu$Š«“7iä•_ u#kZÓLmÚ ù­ÅZE<&ûÙ¯oÂÍi+¡âäJñ€ˆí° • ñS¦eaº£ ™y1FóúäR¤2¯iÊÄîªÈõÅ9óP»#“mWlòÝ=‘ÊÛõ1µ†|® ;A+2Ç0¶ÜA)¹—G[:>‘Y.ºrò{q’홫,„{câ8}—>>qì>¾+äyÒÑêŒ3åãÅ Ïë’ÊðĽ§ +¢³8G×áÁƒhž-¥m1ׯ9µw^®Äâ »±ž;<Õíä°¡ojA,wMÎHȨեÔ$æŒ ‚z5D•€¥)U$R” &t‡æVöu¿ðÖ¬ÔnüÊÀþηþÕšõÅoÉ/)JPÌR” ¥()JJR€R” ¥()JJR€R” 1ëÍtôkêu½’VQä„ó)b> Îƒ ²¤Uš?¯­l8z»8ëžæ¼ðç$7õràúúø6¾†”·¿ü,Ò”¡˜¥)@*5ßüýò+ÿ#u 7ü¾œDûø¤DaðOé å¬Ò…£+ Tloüæ<+ø³¨ÇHßHî ý%A貟ñv6h%,R”¡QJR€R” ¥()JJR€R” ¥(+^þúß޹¿¼“·kkÍ3ñ'Š(%އ“ ±ß屸¤ç‘ÈZY Bü®&XÇʤúˆñÉÐoëeH 7)ZïgâÙ½Ü túã m‡#Kñò#ÿ1¾£Zqgñ·ÖÙ‹Éco ÀÒ¥Ú˜Ã3ªñ伇=8Òÿˆ•7º¥+N<¶6l¤Ø¸²…9Ëh³)•Ç–MìRù#é]OÈu~‹Ëß¶NÒtÄ¡7‘Á:3ÆÃ`!¼;0*ÖÏŠå*|¹Ü<>ÃÝÊØÇï {+„Ó½k·ç×¾KðßÎ]P ¥IÈM.BvÅØÈèU“Û.ˆì¦ÃÁ{޾<Q[žÁàZ1ÄÏ‹¿øôc÷trw7Ñ1VÙ~†d'c[O$· 5ñ 1[ÁF‘E„HÑBª¨ðWÝ¥}‹p¥)B¤nªõ`Zæ;›‹kY—þ¨¥#‘ËjÌ6<øÑª³O ²žXâBê‚‚ÌÁTyúKúI¥g¿)wƒµ0Ï‘Åÿ«·“'ŸˆÔ‘!ÿå£àt:Ç’ÌÛAì[è8]Ù³[B-øi.QÚ]ÉnJ °´xÄì‚4–ÈEx¿OC¨¥yþO¦ò/‘ê`’ú÷&?8ëé™bcpÆóÊ” ‘Cª†WøŽm¹øìDö¶w¹l}¯°–ÚîÞÚË.9 Fd8$rÒM$4|Š…;ŒÚ’ƒ3ÓŒn# „¤¯$¨ó½võ çY+Ëî:w1eÉÛ,]Ë©1ø·¼™!y¡¸“Û.%½Ò&E!ä&%Ñe~ @R >bÏ ïäný®k{P˜·³Žg…#ü³—)¹H¦rÁN’V«zÀõ W—ÝtîaqYu‹pâ»8û0¼‹ìféf”pLñû0·—e™¡•Ëù-±F,±»²’çïƒ5Å”Xi „[û+ T²%ä)í‚»æLœx€ä¡úÂ&šÞ FJþyÞñDpvT¨¶˜C#$Š4Y†´I ùªbrÉ•ŠêÓÚÜ[KÙ¸¶Ÿ8ŸŠ¸£2££zXüí@àð8Kéîp¾Ëq™ÅÀ‰šapaü¯ /£hÖOhÈ.¾¯PäxﱕéHZão0»É$ù†¹ÈÏ6·/õ)£AT ¥Š2º ÃAäviXà‘¦·ŠW†HÐ3E!RÈHù§‰#cáà‘õ\3éÕŽ1ÓÇ—L­ä¹ ÓjËݲaqÙSpGTrµÔa˜¯ð;g.17÷ý=ÓåSòrôÕŒXù†&KÙ ¹àüÚWUµ“Õ î9PHS°#:Ú+^Îúß!Mk'r5–HIâFž7hÜyú™Xž¼x®OØí¬ï¥Éaîîr^ÂøÛ¸­œ˜mÄQàic@ë9hË‚À·¥»€4xp––ýqf˜™-¢ƒ;xòÛûç‚E2ËÛ2[¯ž. ø²Æ~¶€ôÊT~–G§-K?dãÌ$ 2€œÛ‹*1-²é„Gû0B†¬P R”’õÕä¿Ñ×Láln ·–ï“LnKˆd‚8£FŠ+7—š#Ä 2«@:1ú?::c4²,Ö×XlšH[â~s¨X 1ìåRè y^~˜íí:Zרú7¦$’îòÎæÛŽ{GPÜZ8Ë)¬¤ˆ~Fˆó¾në£3]3’1a-}í÷äíî® ¡´sê~ð@lúŸ’€Ä€¤ÄÖz:5g«©+oùrŸôjV§Ê„qJûïøvW]gco”ĪL%°¿´¹•LPI$ï,O ðXÔ$“’ñ,8ë‹VåÇTblÌ÷79kU±K{Y»OYätI  •(Ä5®½qßWÍóRîz{#=ÆeAµ]åì20¿u¹q„Û÷—ŽÕ¹ã¢wËÏRç§²)“¹ÉÚ›Yg\¸ÈÛÁ,­ȾĶ¥]±C²Íá[zÆÉÚ%Œ˜Î²²¸ÃGq/{¿uwºãíä¹2ÅïÈ0ìWˆM·ÍÛ‡ +bß«q÷ËûÜm­1ðß›ò@Ñ¿=‘!^BªÁˆ;m|ÆÔ“9çÃ[[˜!‘®¯'¸† éâDiçiA$a$“¶‡lðWå²ÊUMc²è¼Šaî1Ú¤]1m‡’â7fhæeRÁ €ÈDÛß }:×…¢«š²ËwE«N²E¢ñ\ÛIo"ƒ½7 [‰ÓÚÑ*Àƒ­ÈæY^TPàÄü”l ž!½$0Ó#c{@Ó+Œ]ÅíÝÜ ÷ Z+›ö*…Èܳh¹”(ד¶å¥¿˜¼¢XÑP>¢*å‹/冇ËÐ߀üèQ¥}€ç÷¨ï³9”°¸Å%¶:é Kyíd/7ä"”îQ&“fB7Ûmkzo…lGÖXfÇãïd–x£½µŽðnïØ‰ÆÕæd ±/ÇÔä/¥¼éNµÒ˨ìs9—°·Å=¶Fé'K‰î¤ä"ˆî!ŸF2uÜ]ï[_Hê>†É^tôx,U÷õ(±BÂh¼šÓ*äë„üÇ!ô©ÇWäÊoh½à¿iÕ–SÏIãžÞAAÑtEf¡F­±ŠR” R” ¥()JJR€R” ¥(¬zhu?O_Y$ÓÅtö“EnVòhcæé¡ÜXȻ׆ ã~<ÃÈc× Ö¸°ÆÝåLVWóžù¦ kT-\9ÑÖ¹¨âÎA'ÒÝåc0B× pÑFgDdI ŽJ¬A`ÄUIOõPC_.!’+Ok~’¶ÂÁxN׺«:È×0›h‰ñçÇ‚F†LÌW·3\æn±Óããžï j\¼m!1_ò-ù7uâ{Ê«{VØDöYÜ=ŽF uæVÆÞú~=›i®$“‘â¼T@×ÄÖÄÖw–דZA%Õ¯/g™ãâä4ÜXù]_‹ÄtîVß©ag$ö–™;Ì„DËl-xÍÇ€ ggÔú!ø¨<Èb†Æ¸l´¿ÑåÇO6õŸOËŒŠîI¢ü¼†%MC¦$FÅ%ûgÂzOž=àž¸{u–3:"»ÆrUbB’> ¬úxŸª²P_QXeonÖ;v“ßY$#=³ÀÚ.DW‰&ÏiL³30iøPžÒ•?+}-´‹%I2S« Xœ¼€ù﯄jH,̶eLS“²>2—s·,n9øäfŒ‘.ªv¬ƒä+þ2ð2îÚZAcl–öéÂ4Þ†É$“²I>I$’IÙ$’vMc±±ŠÂDg’GnrÍ!år,Äk΀T-&­…n¥(PR” #d?/Õ8[fð‘Gsz¤|y H€?åÆáÏ×°¾~ Ù¨Ëýc­eçãØ±ÉÛ×Óß‘¹ïÿogM|>-½øÕšTÝÝïêOºÎáìr0c¯2¶6÷ÓñìÛMp‰$œâ¤ì삾&¨WŸæ¿6?¥/ÿOÿìØ+Ð(fcÂ×n²ÆgDWxÃJ¬HRGÄU€?OõVJçíz3 eÕõ6P-ü܉aoâHòÀ„äîB[{nã,è()JJR€×¾²‹!g%¬Ï:FúÙ‚w…ƈ>aðúŸ‡Â²A6¶ñ[ÛÅ0D#Ž5 ¨ h€ñªÉJJR€R” ¥(%ê «É£®™ÂØÝAo-Þ5&˜Ü—ÉqFVo/4GˆeV€tcô~ttÆidY­®°Ù4‘ ·ÄüçP ±cÙÊ¥Ñ@ò¼ü'1ÛÚtµ¯QôoLI%ÝåͶ>öŽ¡¸´q–RYH%ü6 ç|Ý×Ffºg$bÂZûÚ;ïÉÛÝ\ChçÔýà€Ùõ?%‰H'‰¬ô:tjÏWRVßòå?èÔ­N3•â•ö/ßðïfêüY¹¼g7©#ÛE I$½²¡Ô"©nJXr]rmKkRN³ÇÛu Ö—p{ÇÛ^[Í ´œ–G˜<ŒË°"QdÈt«ËËyÛ{Ó=K†‡4Y ù,oî.ä¿‘£Nd³RC(nÖ´šX@ºÙæ7~DÞAÓÙLT7PIßé»|4¸)¹#IÔ»=Õ> ?¨o’¬iFmAÞ=œþ{AÉÅcßÚtsu2ß(1ÒNâ~k0‚CnÚâ(^çk¥fóMRïŸTa²±µ¼îN²Éü“„ÆX<\ÈãÜY¸o‘QÈ>j]çOdfÊ^Gµ÷}öJ×%,í+ bh;“Xøá½}E×\ϤñõdµéËÈ=ÓÊH±æ¯ri˜æö® xùþ›ú<7“ãyZ6,2}ed½=™½ÅËݹ²ÇÏyžÞDŽpˆHxÙ‚‰cß²4ËçÔ7‘:’i¥ÃÄ-Òî2RØ^Àä±…’ ¤ôŸLcFRÀrGˆä5ÎYÿG×Öý=}ŒÜá…Ÿks.Fæ~ç4UçÛEº’ŠJ ˆ€¾®Žÿ¦æ›«q™‹K„Žî;×–ì­– ¢Y^9êP­°v¨žG 4µn?Ta£ÇÃ~ך¶›&J7í?›dYõ­ø'Ÿ‡ƒZÿ-z{õ‡þ¯ìdþËÿ³üßì?ûöú«œ~ŽÎ͇‡ä‚Ó§n°Ö· rìÓ´‹ ¤Ž°#‡d}rÐÞ¶mçzró'ò›³$ ïL*càæÄq{FËh/å—á³àøømhƒ%¯VZ¡Êâo&Hå¶½ŽÞ¹^]L­åP³ÈʼŠò#ŠìƒT!êeÆPã£ÌüÚ5c‚)wÉR¼Æ›j¬Hàû–Ô;ŽŸËÏ—ÈÅÂÅq—¹[\´{C™“²¶þŽ×o‰Û[ë|ƃïGZ8ñ}qcÔ‚îUI-â½¹½ŠvÈ\¹å1ñ[mˆ£#¼ËÌØñö±hØ!ëLÎ>ÞúÖê{¨.6aö[9¦y Y• ^J¬ÚÒ±âHo_ÛmÛíñIß¶1w•íÔËÜMl ²Û;ßѺå¥òô·OX$6·7xÛ$µ”®Bâɶ)<@· §”+¦ô’A@OwÖ¸x¢y’û!¸V–AÙYå óÜ7Ÿë~¨ivRdfÃô¶_'n¨ÓÙÙMqÈ RÈ…€: ëcë©oÖ¸‹¬Î‡Ìb¯ä¼ºx¦Ž ”•Ò1²r[Ç©lìyúȪIŽ›1ÒÙ|e»"Ïye5¼m!!C:è­Ÿª™Lt×Ù%ÄL,oZâPÄì©·š-/)ã¯ÿíEkm;^¨Ã^wŒwœ#†&œËw??W§~+O ÑsaãĤs£ <“\IÉÉÜ)hö龨„·ÑË™4)þl ÕØG·»¸ö·X-mÞé¤{yd…ÚH‰P%@5êõ/ýC{xÌÞ?1ÝöŽïoDíy+o‹¯ 9ÆÚ<]v­£¢tkÏs}/˜±ÃçòÙĸôîBÕØÝÏ+M#ª7x#ú! ÛmÅ|ÎáÛâ1ÙóÙ<›Z÷æ·‚ÑVرWXšVîChXÌ}n뇾ÈÁ‘¼ÅXÜ_Adzs5º<‘ñ<—‹±¢IøØk 7îr´»²¤òn0yÈœx¹úØpMˆâ¿P­ŠPÌR” ¥()JJR€R” ¥(|M4VðI<ò$QF¥ÞG`ªªÉ$ü??&BD³c[RGë‘V.ä­ùÂ!ðîkÊìHŒ6xhh °âlä=ë™Âôäqáo-3Ö6é sC"7 E5È#äƒÞ5½ÔÃgÕMf|¦%* ªc¥eV× œloéÐÿØVi¿âùÄ·_6xÙ9ÜoüwU£Mˆ*¿pøðÝ¢Õ€³Yê¡‘µZÎËb¾ýË¡غ—õ¾'î¹?˜§±u/ë|OÝr1W)ML22×K»’èCö.¥ýo‰û®Oæ)ì]Kúß÷\ŸÌUÊSS †º]Ü—B±u/ë|OÝr1Obê_ÖøŸºäþb®Rš˜d5Òîäºý‹©[â~ë“ùŠ{Rþ·Äý×'ór”ÔÃ!®—w%Їì]Kúß÷\ŸÌVµê »ÏWª³K‹QÈÑ·Âãáµ:ÿ-WKQº_û¦Ú7ßùRÓS ‹*’ÀÞÎÎÅßÜ|{Rþ·Äý×'óö.¥ýo‰û®Oæ*å)©†EuÒîäºý‹©[â~ë“ùŠ{Rþ·Äý×'ór”ÔÃ!®—w%Їì]Kúß÷\ŸÌSغ—õ¾'î¹?˜«”¦¦ t»¹.„?bê_ÖøŸºäþbžÅÔ¿­ñ?uÉüÅ\¥50Èk¥ÝÉt!ûRþ·Äý×'óö.¥ýo‰û®Oæ*å)©†C].îK¡¥ˆ°÷VÃÝîû%¼pw8ñçÅBï[:Þ¾»JV†m¶îÅ)J)JP R””¥¥)@)JP R””¥¥)@)JPº³×ÒÙ aóï#ö(ÏÐb"RÈ3‚~'[ð~f£u墯Ù/‰.r6ü øÓ÷Ûýì,ù‘ð"Í Ø— ¥)C1JR€ƒ—kÙúƒam’¸±ŠK[‰¤6é32¡¼Å™2Ë=Ôv–½CrÐ<Ä ;¨#R|ëKµGˆ:^«¸´ƒ$/q^Ïsi?h ‹ÎÈ3¨ø˜ÜÈG5Eƒ?²XõC]Èv·µq‘½{EšÎõn !a–^q¸PXn"„¤7/ˆ´k*æ5%Ét7=Ñ‘ûQ–ýÕ¯àSݵoÝZþO¶ê»‹Ì¶+›\Ë|!¸aK[•…œøÙä`}\Tø%×Aÿ¤$‡ßËmb÷6û›ñmk‘Y¤A¹Gpu ›eÆÃùôŽLusÇ’äºýÑ‘ûQ–ýÕ¯àSݵoÝZþO“ªî-–ò+ÌWbö/e0Áíƒ ™L0‰CSÌ(p£Ê—øS+ÕW,Telìl®çºöXÌù–›í´œŒÅ9*ñF_1ƒÏÆ´CÓ\Ʊä¹.…td~Ôe¿ukøŠÐ_ØõE­œÙ{»Ûyì®%d¸ŽÅ‘áƒj~7Çu³ÓÙ¨zƒ J䌘¤!hÝ£bŽ5É )*Ú:Ðø›ó×û:óø–ÕzU&ê$ÙhËÓKsìY)JWqÌ)JP R””¥ñ4Ñ[Á$óÈ‘E—y‚ª¨$“ðTÌt2ä^ µôoçki"m•‡Åÿâté¨ÿ?ÅŸü±’—û·Ó5œ'ÿ‹ô¬Î?ìQ> Þ­ìÐÑÿ¿6 R”3¥()JJV®Jú,^.ï!:»Ek Îá,UT±ÖõçB„¤Û²4:W×Ó°\™y$×±¤$Ò¼ªù…pÄo~OƬÔüŒ¸¾žÆcçdimm"ÊT² S­ëÆÅP¡j­9¶³¥(PR” ¥()JJR€R” ­[ì¦6šòá"Vn–‘È$"(òÌtt ~ZíŸ3ëÍE ³>¨ñ¬€úŒÇed#â*IùåUÀºŽË½ˆwîsž›CØÄ¿Æí$"[ôˆ€”?ý“{  md¬ÃsÓÛ“i5ݤ‘°6½ÂÍí80fÙÎñߨ«7#‚”,ª[e¶dibl=ÙŒ†ÔËÞry¥ãÇ»+Ò>·ã“3z+v”¡›m»±JR„ R””¥¥)@*7KÿtÏûFûÿ*Z³Qº_û¦Ú7ßùRÐÑ~7â½K4¥(f)JP R””¥¥)@)JP R””¥¥)@)JP R””¥¥)@)JP R””¥)ù~¢Á[/‡ŠI¯XŸ‡ˆÄ@ÿ>W~­óðÍFoëkÅŽ~æþžü‹Ã_û{;ïáñ]oάÐÒ{¢»½X¥)C1JR€æ³YgVâf¿¼·´‰¬nÐ=Ä«–î[lŸƒÿjÅ–Ît¦c}Œ¸êØBÈ)fEr¡—l§‰ßþÞj.MéäùûÕñèûüƒ]7VÛÄuì–ÐäaXäž#oñLH¥wÇC|Cé†;ˆ:&âÖâÝú¢Ì$öù v"þ…¼”K)æz~¡ñ߯¬àzƒ#‘ŠK¬Ž;f·Ú,‰iY¦IÌtÑ Ó2[;Q­ŸçËc­D¦ã!k‰ÊHd™Wƒû¤ŸGë×ý>~iv¶ ÓÉóö9ûœ—J\^ÞÞ/UÙÁquo Hr1)´ò:2ùøòì6Õ€‚6Ÿ>“ö]|²·÷‡µ{g¼}¶Û½ÞíöyqãÚþËÑ®×rõWQuÄXãáÈ]ålmì§ãÙ¹šá99KÅ‰ÑØ|EnO<6¶òÜ\JÁ’I*¢²I>騸½<Ÿ?cÅOÒ8©­'^¬³¸žÝ.×¹5ôÜ̳HÌ(ß%Ð|V‡»º$ÛËnÝ_ÀØÙñPÆÙ(xÛÛHpA­mB 3mø‹iuÛå²0áð÷Ù;…v‚ÎÞK‰0 E,@Ùz]L\Î^ÊxÛ9‹±µ²~a®­ožeƒŠ3–—”Q„HG-ŸQQ¯;Ÿh½<Ÿ?buýßGän¯.eê[šæ+hù%ü?’h$ybu~ ï¿VÔñ‚69.ºfk(£—­â{Øn=¦+ö¿·2¤œ {U×hÛ2ñ ¯%µÈò«¸¾§Äe±ì”7Ð$9–XYP9Û*Ð'ÔÕ阉’ö;Ùìšë#ŽŠ{¤„¢%Ú²»J Uø\N‡ƒQ~ázy>~Æ•—QôÕ•œp¨°¸eÙi§ÈFÎìI$Ÿ:$ø(ø|[eñ¹^µ°÷vFÒó·Ž»çìó,œw%¾·ÄoGþÕ^l¶:ÞôYOµŠì¢¸æUr¬áñ'z.Bƒô’ƵfüõÆ~μþ%µiBÚÄZ.lžçÛÝà\¥)^Ì)JP R”£þÉ,gÆ&))é»tb¬¤}†ñrùŸÚ}Í4¹yä´´‘Ⲋ\ÝFÅYØ¢#àAðÎ>o•_^Ìtá†+x#‚Ò(£P‰(UU@> }›{žçÝ)JŠR””¥¥)@*7VúºK+ó%Í»Z¿õK(íÆ¿å¶e>üèUšÔ¿”´±µO3O‘µí¯ý]¹VgóðŽ'?ü´<Ò—ä^%šR”3¥()JJR€R” ¥(O¾Ê-´ëgo ÜߺòHP* 4ޝ†ò|ž,1¬3_\ä'’Ï®‘«›!¥)L±ƒóäÆõÁNöIR‡rÆÆ+žI¹Ë4„•ȳ¯:h 0¨í—.¿.a±ÇKíy}:]_2ðî$f46=(„·H’Ä *…¡JP£““»¥(@¥)@)JP R””¥¥)@*7KÿtÏûFûÿ*Z³Qº_û¦Ú7ßùRÐÑ~7â½K4¥(f)JP R””¥¥)@)JP R””¥¥)@)JP R””¥¥)@)JP R””¥ù~©Í\¯„Š;k&ãÍÊHÿ.7>½†ñð&ÍFéïË{ÖûáíY½ôöµoñúwÙåþ\µç[6hiWî¶VòB”¥ Å)J˜ê,t9ŒÜˆu‚ó·‘£ 0Wku$l½ª¸L×ôwš²c™pe¥E)q •™¶¸–ÜØ#w1؉ë|H:¯DË­ìAŽ¿¶ÆÜ_E­Ä2 w‰YYÞ¿Ú:øü›|+÷Þù²ùoÞÚþ=cŽ¥:ªqWY=ÆÓ§¬¦•û3³Þÿhó1wYNÍgÕ†µÃ^Ecà÷hÐ0æÃ[X|©ã‘Uc º¹py;¹&1 `Šø‹xíRXÊ„µ»2ÈñëCµÁý; ljÚ/€oÏ»º·–Þ㤲SA*’9Ñ•ÔA›DôVO{ä~Ëå¿{køõ]zÚMLn6ËÃ×ÄæÑ4h”UV²ï\÷œââ:úÇ3Àé´É\\:FÖélâœ#Æ¡{¬ç¸;…ØzÝŠ«)Úçén»Ä'I#Y%ºXশºT)¤¸v¶b<$´r’Ã`I>Fî{ß#ö_-ûÛ_ǧ½ò?eòß½µüzæp©‘Õ«y®k©>Û§î.z?'ˆ¸od¸¹º¾’€a2\Ë$2®Î^HãÈ ð#Ç8U®0• q‘Ëœ³A#(bd¶¸•3xg8"âi< ù½]í̹+9-/ú6þêÚMs†sfèÚ ©›GDÿʲI»™âyzK$ï ó‰™í FâWkùo‹0Øú M*dF­æ¹®§1&9j1¹ uÈÅ"¾I¥‡Ö¦áÕÊΊÝýÇ¥ ¦âIå®%—fºüM›`úZÆÉ-ÞW±²Ž%†9UÙÊ C°@IÖ¶Bƒñ<~Œço. Žx:o',R(t‘&´ee#`‚'ò¯¿{ä~Ëå¿{køõGØN©®ÕÍu7ï½³Ý÷>ïì{oi½ŸÚ7Ûîhñç¯ ñB9kJn{ß#ö_-ûÛ_ǧ½ò?eòß½µüz*uµ†­æ¹®¤šÀÞÇò6\Ž3³&' 5¤æÚÿ« *UÎXåÑæª—Hd×¥¯à“žð~޶ÄÂKÆ[¾q$A·àrh¶wÄøòuã³÷¾Gì¾[÷¶¿O{ä~Ëå¿{køõ8jdF­æ¹®§!Ô6ò¦Bõ}† ¨dêLeßµ÷P‹Vݤ\8ùq)zÐ^Ü›å³Äö~zã?g^Ú´¤a6R,œ½xùS„Wl,Œ¨¾|+÷¶©¼ôŸ®³Úû¼›weo•ÄL÷By3¼$#‘Â6øê´¥ )«¢Ñ޶ÖçÚ²:*R•ØsŠR”¦]ÝÏurøìsð‘5í7Z[‚6Á‚aA ÛUþﯥYÖÆÅRKç^^°J@„‘Ü}kÆÁv @Ð Ë›c:Ím¢g`ÝÈäîìYØëCe˜ß€Š%…]™-- ±¶K{táoCd’IÙ$Ÿ$’I$ì’I;&³R”(Ýö±JR„ R””¥¥)@*6cךéè×Ôë{$¬£É-æRÄ}AþeH«5_ZØpõvq×=ÍyáÎH8oêåÁõõðm| )o~øY¥)C1JR€R” ¥()ZWùKlwm%~w3l[Ú¡YÈÖÂ)#zØÙðyb&„¤Û²6¦š+x$žy(£Rï#°UUd’~ “Æç;âXîì1ÃÈà ÷è;SÊ4øm\Ÿ îd·ÓÇyšŠÝ剃[Û#"·`|8,£”›ÿˆð z™ëP½Ô7où»ç†gÄ0ÅopAEj#E ª hÀ_t¥ Å)JJR€R” ¥()JJR€R” ¥ÿºgý£}ÿ•-Y¨Ý/ýÓ?íïü©hh¿ñ^¥šR”3¥()JJR€R” ¥()JJR€R” ¥()JJR€R” ¥()JJV–^ÿÝXKük»ì–òOÛåÇŸ-­èëzøÐ”›vFŸJzúfÒëáí¼ï¸ÿÑßv›Žþž<õ¿Öô>f´±êÂXc»½ßd·Žç<ø¨]ëg[×·hZ£Nm¬Å)J¥()Xæžd<±Ä…Õ;™‚¨óô– ô’’”¥¥*~;,™Eî[ÛN!ÜÂÒ?á”ÄA·ê*Äh|ÎŽ…)Zw¹(ln±Öò¬…ïî ¼E@Ða’í¼ü8ÆÃÆü‘ÿ¸K¤?2°?³­ÿ†µf¦ôìöW]3‰¸ÆÅ$62ÙÂöÑIó’2€¨>O4>'ÿsT¨^rÅ'%Ú)JP ¥)@)JP R”´¯ïý“· 1wïgØ‚Üyk[f:sÑ‹žkk1åïÖ!¹>¡u*Àø&M €¼‰%£Ì×yNw/ŽÆ¼3dW]ÀO%µl< Ò»þ̹¬,=“¹4Ò÷ïgÑžr¼ykzUpiYÂÌR¨?4»¨Œ{^ãïi;ÜÍ’¾N72úa‰ˆcm—ò{6HäÄ}$.Ø"š§JP‰K¸¥)B¢”¥¥)@)JP R””¥¨Ý/ýÓ?íïü©jÍFé=†ùyl¢–Fú]ÝC3ô’Ä’~$’hh¿ñ^¥šR”3¥(a»»‚ÆÙî.„i­I'@<’I²IlšÁì¸a‹¿{>ÄãËZÛ1Ñ⋱¶ÑÖÀ±U8m1Ž×)È¿vôl¢,Œa·ØÖ‘N  „r<›æ©ÔU¯-ß>\Ãìsç=yH&¶³Á¥“ë3b¬#ÙR -ÈÍ)B%&Å)J¥()JJR€R” ¥(rw½omgÕVø³k’h ½ËLˈ»vîFñ*ðã™4ï¶PGÍò67ÖV»ØÛÉ‘†ý£ÝÔ1I oÈúQÊøy1§ý¿ÌÐúõ‚/WǸK’y^¢L‚Év¥ci9ɈÙPÜÉõGµˆXëÖW ‘³ÍÝÙOoˆù?{”!œI߈gNHxñ™T¶×ÊŽzÛmtôœY‹l‚Þ_qµ»–òÞÓº;1É*È%:ã¶äefõTøRªJ{~…°ò3Þß]Ø.>ld634b8m¤à‘Câ4PY˜è|vw@K“©²øÌæbkü\$6ø¸’ÆÞðI´÷SD^&`£d2ƒÉSf=Ä;ÿHÙõânÓéqogqÈhïL# Ã@dˆSnJ+ž> èøšk‰ï²ù+ùç{62OÙR¢Úc4jq¨Ñf;Ø$ƒàŠÜnŸO|IBúÞ9åIî-!uXç•UUYà𑂪áHMAn@i㺥²KqŠ[kE¼ˆÑûjû\a»’[•bb ćŒñMuKu Äè-­#HÐ9HoVYí‰>#¹‹Š˜eøúG0 8,49n/O§¾#¿›!}q¼öö“:´pJÊȨ̂pøyVr >€/?§ÒÇ"/dÈ_^ÉM°»uog‰Š–PÁC>ûqú¤.Þçe¶ŠÒÿÝ3þѾÿÊ–¬Ôn—þéŸö÷þT´4_ø¯RÍ)JŠR””¥¥)@)JP R””¥¥)@*7Wþeg¿g\ ªÍFêÿ̬÷ìëáµ (þHø¢)Jò¥)@)JP Ÿ•ÍYab‚KÖŸúĽ˜’ i'w~,ú ³|Ôcðú*…s]}g¿é{»û¨-m£Ê¿9§".ìî@ÛdÿΦ*ì‚Þ;'i•·i­ÈG(é,O‘¶Ó£€ÊtAÑaøkr¼÷5šägs¸9Ò{-ñ¶‚ò9ÊDê·2›L •EŠoT«¾­Hu¯c%îBÛl2î,ns¯oŽÉKrÜXÊÍ´º«J Šä°ÙRt¬­ãl ôc<+p–í* ÝÒ2Ó*ñ ]Ÿ£úëõí¾7sw'nÚÚ&šgâOPK'@…p8VŠ^´ÀÍy{9¸H³6vÂ[·ü¢Ãvˆ‹Ä¶¤a$’ 7ÌIPD ¬Ô÷Xþ¡µIgkyúo#<â{ùndï(Œ•vò¨‘¹ÃÒ—€nU=¢ç®ÛÞÛÝOw 2r’ÒQ ㉢¸~>—Sãëú÷[ç·)5ÇSÜÙÇ{uk×Sˆç6Ò˜ÚHÆ!X¡#Ȩò4G‚¤0kÞßÈ0vM{—H­â½ÈZ…½ÊÍYW-E®ã‹ª!îNLä“5éT¯5ê£ln7=ÞRë÷]1 ãÆBU·™®xÜâ£@L7 ƒ`”øzj…ÜÓG/X_M}‘híïaµŠîŒQAAjÎÅ€&4%‰y<˜Ð;',Yƒº¥yn"ú÷.¶v𺷴ùDÖªmo嘽¿»šb¢yd‘‰`ÿ(ÚTa¸¹š¬Ò™XÙÖÿÃZ™s–Æàºë#q—ÈZcà¹ÆY¤]̱,¬’Ü— X€ÅC¡ |9®þ"©ô‡æVöu¿ðÖ¬ÖÄVü’ñg7Ò3Ãè\5½ü±ÚÏc‡¶{¸ç`n¢- >Tmlëæ·ÔiÔB½IÒ× bwɲ Ò±±•gkëæI/xú )m7¯–Ð,@'@*­ “IaB”¯‰¦ŠÞ 'žDŠ(Ô»ÈìU@Ù$Ÿ€…º“6N[éä³ÂËnòÄÅn.]L‘[°>P…aÊMÿ„Äyb=*ÿËÌçö 5Ž4ú]¤‰â¸Ÿë ½4CèäG#¶ãÃJæ´0ÅopAEj#E ª hÀCK(oßóÏ[ ]¶;¸ñ';™´n.œ,äoEؽlèx <([´¥ 6Û»¥(@¥)@)JP R””¥¥)@)JP R””¥çøž;.ˆËûmô—y¾ßÞ¼–Häçg,ÍÆ&b‘þQŽ ºCJH¯@®Òpcç±ÿˆß\Zc¿ä,¦íví}5âU¶£fAÍ›ÁÙÛh‹Û˳ó½ž^ÔF7æw›Óëm(Óx?7Šú†€‡Ò|/:Ž …ü—²Ã“UËÅT*‹çŠfÐÙ>|–$±é+NË ÖFâ&½ýÀ¸”1 "Ž-/‡Ôùß’ö”£t¿÷Lÿ´o¿ò¥«5¥ÿºgý£}ÿ•- ã~+Ô³JR†b”¥¥)@)JP R””¥¥)@)JP Õÿ™YïÙ×Ãj³Qº¿ó+=û:ãømCJ?’>(™”ê ¾Õn/±Ø´W‘bRþyG?DKbÌ| €OÀbúƒ/™µk‹v-Õ$h¤W¿ž7ÇÅ]Ø2Ÿ èàƒð"¹é AêT¶º$cìRhcµ–$i»¯!‘\Jެ¿Õ£täÀì6ª7G_]áòS϶im®í£7+’‘TÛº±‘"QhÓ,ŠW‰ é#`nZ:,ë$ ®Ìô2ŽMÕ«eÛ·©êžÓÔ¿ªq?yÉü½=§©Tâ~ó“ùzæ¡êË|–Bã#j÷ã凱B.1’_O © é€å¢UÂkeNëNÇ«îqQ<ùWÇE’È^ß*›üÓÅh±[Nb⥣!\r  æ¨]/„©Ê-Å­¨ÙT‹WQ^}NÇÚz—õN'ï9?—§´õ/êœOÞr/\ÓõuåÜY쉵僦àÊ[Ä.ŒSžâÌÚ%WhÌ‚Cž<–¥/iê_Õ8Ÿ¼äþ^žÓÔ¿ªq?yÉü½I½ëvØÉíöö6·ñä=Ä÷ü-C¸ÎSaLd™¾g޵ê¬vùµêé±±ÌðØÝÛÞÍ;Y]2™ÞháÒL„7h³³^%‚¦ô )Yä1Ç…yõ-{ORþ©Äýç'òôöž¥ýS‰ûÎOåê,ù‰ºVï#c WY+ktǽ¼2Ü—›•ÍÃÂÊ$í€(so‹È/ºyÞ¢ö ë^À‰%–wØ]sb¬Ö¬ñdŒÂCåžã)Ò¨$£~ÁŽ<+Ï©ÔûORþ©Äýç'òôöž¥ýS‰ûÎOåëGåEçc÷lø÷‡»ûÖ}Ÿ¹ìþÓ¾ïo—×ÿkß/ת¢dò“fòØAì‰ÛäRâÏ‘6äMðÄ[Ÿv.h¸~Hpx:%šã¼úO´õ/êœOÞr/Oiê_Õ8Ÿ¼äþ^¹«~¨ù;Œ»[–ìï*,í Ìä8û&í–b³Ü'ÇNÊA“ûH×kä&ý¯Z\e˜|d“_ÅvüÍèXÛÊ‘9î%£bÇ‹*’};P•ay qá^}JÞÓÔ¿ªq?yÉü½=§©Tâ~ó“ùzç²Òv:ÂÞÖéEªA&6,£¥íêÛÌðȪša,ºFÚòQ²ƒ‘屎<–Hõ•ó\Û÷f\©ÇcÑr³G ¯°›ÜSÙ8«02lF¼˜_jã¼ú/´õ/êœOÞr/Oiê_Õ8Ÿ¼äþ^¾z:þû)Ñx\†H¡¼¹²ŠYYÖPy|ÕA Hf¼f·‰®#Hç( ‰—Umyˆý:ú…Uìv°ÇçÔ•í=Kú§÷œŸËÓÚz—õN'ï9?—® §æ¼NœéÌ‘¶ê;{™ýƒ»’¾Ê™í¥î¥/iê_Õ8Ÿ¼äþ^žÓÔ¿ªq?yÉü½sض¬³ {u&FÞ pXûÈí­²s±´Íp[}¶@ÇJ£d„|(z屘ë8o'ÇÉn/¡[ŒêÙDémpaÙpŒ;¬ !@>²8€aì°ÇçÔè}§©Tâ~ó“ùz{ORþ©Äýç'òõ£UÜe=•ð¸¯jñöùV{ ‚)¹ðXÆ™ZOɾÃ2(<}Z$®;ž¥šÏ'sie‹{«™rãª÷…W‘²Yùú€ ¨?`îã¼ú”½§©Tâ~ó“ùz{ORþ©Äýç'òõ£Žê»‹ËË8î1^Ïosu6=eɹ„Hd⺋ò2ä«äÀ;¨™Ž·k¬?RãÑ­m²b/nbö,ŠÏ5±‰B‘0P;2†uÐVqµW¤*.ö°ÇçÔ¿m.JNµ°÷¥¥¾±×|=žé¦åùK}ï”i¯£ëÿå]MC›ó×û:óø–Õr»¨~4EW|>¬Ò™XÙÖÿÃZ³QºCó+û:ßøkVkRµ¿$¼X¥)C1JR€“Ô“J˜i-­äxî¯Ym!x؇Fñ2.¼’ŠZM xCä|FÝÃ{³ýK%À…U"´´í¡ãà¼ÙT?Ìx>ªÑŸúïVÛ@|ÇŽ·7L§Çåe-l5ñÒ­À øõ¯ÄüÛ44–Ȩþþ|í<þ׬³ÍÓ“Ý{’qt2­k·ÒB°°l‡`DLNÌQ¸òàFП_Ž[ƒ¨³Ö×+v1²ÁÉÛc®(å® :dRÄD\&ödçÄÿg⺉±V3Ú‹W¶Œ@.ë‚zue‡ôëÏpr?YÞ÷³XäÂc¥öžvûö›¸¯eõ·ªh»|ãã]˜üvv39¼WVä2=J-VÖG³{Û›6EÆÜ(·™º×GòN¢€ƒ(%-|7QuVZ߬0ÐϙƂ8ŠW[UA-¯ e.f] ÇÃϪMyê!éìe¾Päc‚A?6‘PÏ!Š7mòtˆ·sɶʠžo³êmä³Âc¬=ßìÖý¿wÚ+_[Ü'†×Éóý’y;>Ÿ“°8?”¹&¸¿ê«+{H /a”¹‚bÒ1Pn¤ì¡@$;‡|t= ¿M‹®­È'V\címd– [Û{9 LmĦA"ÄÍ/´¯ä¢&ÙF‘ò9TnŠÀ·³ec‚Ò+! ÞL±É|¸G"ã*ŽL4ᶃ°krnžÆ\eFH$3óYò¤u×xƒpwWLÊHàš>•Ðøê¡—u|°Z,C'qgÚMtÐÅÓ'uâBBÅ#N óvd'[Eé0—Ï‘ÃÁs,I#rVx•IV*vê¼z£m”m©$®Î9z{5‡±$H…Ä—JÑO$r$²;;ºH¬I.ûâG†+ð:­Ë|uœv¶±öáM $’K31Ùf$’X’I$’I 6)JP R””©÷Ùblì`K«æ^}·Æ‘¦Ï©Üâ ¢Xƒ¡¥b¢T\‘÷ì¸a‹¿{>ÄãËZÛ1Ñ⋱¶ÑÖÀ±U+ dîM4½ûÙôgœ¯ZÞ•FÏ].ζI%‹1XX{'ri¥ïÞÏ£<åxòÖôª6x¢ìévu²I,YŽí 6’Þß<¥O¾Éµ¼ëiij÷—¬¼»HÁV5$€ò1ù«±¯±ÓqVât*¢äìŒ××ÑX@®êòHíÂ(c¼®A!TyÐ'd€$#Nœ„ñÞdÙÒ5`ðãö¥# íZB>|€ùÖø)Ö*æ±Å­´íyq3Üߺñyœž* ¬hI¯…ð<ž*X±ª/‰GdyôùqJR†b”¥¥)@)JP R””¥¥)@)JP R””¥Íc³]A“ÆZ_ÆÆ,WP¤È' `¬ êšÙöÞ¥ýQ‰ûÒOåëã¤2ð_³íÿ†µf¸‘4Κ˜#6”WŸRO¶õ/êŒOÞ’/Omê_ÕŸ½$þ^«R£êfSxWŸRO¶õ/êŒOÞ’/Omê_ÕŸ½$þ^´®ú’k~«‡¶èØðñAqu³¨æ•ddRß#·ñ>XÝE­xÏõe¦.h¬à™ùïm-мnSò³F¬œÆ—»Ûrá7ËZn%jÚúƒxWŸSwÛz—õF'ïI?—­â¾ûO—ýݯàSÜWßiòÿ»µü ÇGzFŽÛ¥+_ç<™tz5RU,ìïµ=ëôaŸ¥qÓNÒ(’+d‹_÷v¿X}=LÍ0ljyô5o:JÎóÛÕ¯/–ìPÅMt>ãø¿'Ì€JþKwäæ¶&éË9ý·”“lÈ[ä$ÓCÙâš{ ¿§Ëy5õî+ï´ùÝÚþ=Å}öŸ/û»_À§ÓÔÌaóèa¹é‹i幸ŽîêÚîkÑ|—-¢€ð ¥H1‚4Á¾q#GZÉ7O¤–vè¹ èïmùvò!Õ§õ¾ù)B¬~)Ç€ÒñUàœ~½Å}öŸ/û»_À§¸¯¾Óåÿwkøúz™¡†ž¦haóèjü”ƒÙuïïx{W¶{Çò]î÷o³Ë×ö^pּ뗪·-°pÛÞÙ^5ÕÔ÷¶ó@$š@ÆNëÆîÍããÊ1 ºU€Ð>â¾ûO—ýݯàSÜWßiòÿ»µü }=LÐÃ%çÐч£­­mì ³ÉdmÞÊ L2 k˜""»%Häþ¨Ê7¬ùðºÜù9gïOxw'ï{ÃÞä8÷=›Ùµðù¼<ý|¾x¯¯q_}§Ëþî×ð+J çÉÜØÍÔyxdM<KSß‹K·ú•#É’tvúz™’¡ºKÏ¡KŠLËÄ÷ÙİÇ$üyð_ Qàh|>;;5¹m ¼Q<Ï;¢id È8ñlü|> *w¸¯¾Óåÿwkø÷÷Ú|¿îí£é¦ûQcļúl:1l¬ì,$Îåo1Ö=žÍœâÜ'䊘¶É¹âȧçyãç`uò¸b¶¯µÊÜê[¶•ì.¡Ž~7÷¤òœTFÍþ%e‘x§刵î+ï´ùÝÚþ=Å}öŸ/û»_À«j*f†ñ/>„\WF]Xãñœs·Ö°b­q÷Ä xäì†Ñؘüd«c^*¤ý1mÂÏÝ÷wXÉíH㸶(îRFV7u\1fEbÄ$o—–Þoq_}§Ëþî×ð)î+ï´ùÝÚþCÑê>Ô0ljyô0ÜôÌ2Ü$Öù™öxígìÎ \Ä…Š«ÈáœÍýhÊþ²Kl2|œ³÷§¼;“÷½áï r{žÍìÚø|Þ~¾_N¼W׸¯¾Óåÿwkø÷÷Ú|¿îíŸOS1†Éó¹ qÆÞ[v¾È¼ Ÿ m*ñ·¶ àƒŽ¶¡™¶ÇüE´º­î+ï´ùÝÚþ=Å}öŸ/û»_À§ÓÔÌaóè~MùëŒýyüKj¹R,°Mm”L…ÆVúúXáx\,!U]‘›û8×Îã_W®šQp‚‹+Q§džî¬Ò™XÙÖÿÃZ³QºCó+û:ßøkVkA[òKÅŠR”3¥Lê¹ìðw/jý»¹xÛÛI BM+ãc¿ 3©>€|… F8šŠí0ôïåãÈd‡„¿½ycQaVüAÖ àü4ããñ;9<î Ú÷¶VÆÃ½¾ßµÜ$\õ­ë‘ÖÇÃëµgi…”vÉÛ··b‰6OQ 6|Ÿ騶ýaæeXî„ÎX¤ÚÜtŒÏ Ü%»KÑ#,92©ˆeý‡×Púÿ«Îšý•kü%¥×Fa/z¢¢šÊ¿‡‰ mâ<ˆ’œ‹ FCokÛP¥Ap‡AJR€R” ¥()JJTË»¹î®_Ž~&½¦ë@‹pFÀø2Aì(!›`ª¸´csîúúUllU$¾uåë¤IÇÖ¼l`± ̹¬lb°‘ä‘Ûœ³HAy\€ 1󠀯Æ+žI¹Ë4„•ȳ¯:hmP–Õ¬…+ Ýåµ…³ÜÞ\Ãmnšå,ÎWgCdøH3±sœõ]ŽÆ%þÜ ÊIô¡ÿìzÙr#mc}¯p÷”ùŸFXM™ôÉ’W Ö!+!ÄñRGÏ*È7ìqÖ˜Ø;t‰Y¹¹ZG îÇË1ÐÛIúMmRËe–Ä)JP ¥)@)JP R””¥¥)@)JP R””¥¥)@)JP:Gó/û>ßøkVkDzÝCyÒ½ÒÑÃÔw–×8ŒFhíL0ª¬@€±ü¢ÉÔ¶g|ÖèõïW&BÞN¨¿’êÁ—¹5´V‚7Vg àFüXvØ”Ž,¬Chy²¦ìåØuUŒu’ÿK{Ï¡ét¨Þå¿ûO–ýÕ¯àÖ Ë)ñð,×]W–Ž6–8AìÛ¼Ž¨ƒÄK2òߟKw”Á%çЙô}gy‹—Þ·Y”½i»šÓ)pˆ·>hÓ—FU|”#MïUñ'Oõ¼’TÅIíÙ ôËq"vd‡Ùû‰vÛšŸgÚ–e>½ãfµÅ”ö³ÚC7Uå–K¹L0ͱæáÈñJ1óõ}z¯³‹½[„€õ6g›£8"ÞØ®í»Ô4 Ùó­èê×yŒâ^} ¶ý?—ƒ/Ž‹…‹c,²·Yhö‡?yn=®ß¦¸Öù„Þ†ô5%èÜ‚aúb4)=Þ'ìÅNâÅ\•‡n%‰K :âWG–Ί€m%”òd&°^«Ë˜bŽi³má¸S¾Æ¼˜ßþßæ+?¹oþÓå¿ukø4»Ì`óèE½éL„VøÛ|Iµí¬¢´[¸®®-šÜÆWí‚âå{X¥:`Y»„ËÌIúo¬Ìд±É%Äws#P¡Ñí†â™™T§uˆeV] Ƥ緲žê{¸aê¼³Ii(†qÙ¶¢¸`óéu>>¿¯uŸÜ·ÿiòߺµü]æ0G‰yô,Ò£{–ÿí>[÷V¿ƒOrßý§Ë~ê×ðj–YŒâ^} 4¨Þå¿ûO–ýÕ¯àÓÜ·ÿiòߺµüYf0G‰yô3t‡æVöu¿ðÖ¬ÔnüÊÀþηþÕšõŠVü’ñb”¥ Å)JJR€R” ¥(kß^ų’êdãMlAÌçd€±øýÇÇá[ 8¼w_Gy‡¸¸ö+¶»[Ù-aI,§·‰·wìðò‘Ó@ú£.Øzý;Rµ¦aq‡©²©µÄ™´²†;쀎ÚìQH-£Æ3ÅÙ};%×j¥›]dø ±2ã‘d‚'¸7jѶÙ'3wûƒ–ÆÄ¾­Wè >>‰!˜¶_%%ûÞûrä³ÝŽ^ȃj¢1»@®ŠœOÇD§kÖ·UÅ&ä×ñ]¿pß ¼©žàRZ6,x²©'Óµ‰V©ò9|åäðÙ÷1„³ÈYÂ%Q;4½ÒR†nþȤ¤‹Û8‡`Aö™Öy7ãèe}Cã³æ€7]£{¡ìí íä­!»…oïVÖIÄ¿6(e˜xÚ–P ÇêÓlP¸êg÷—õ>^Å•´Æÿk®}ÿgõüß%*Ïp!E?> Ó+Iù7ØfE«D•׿ëë;¨l;É]Ág$o|í¤˜GÅ£ƒ®1ÝM· F¤ðxŽ[ômµ­½”Y,•¢[ÙCa)†D s@„Wb„©ŸÕFõŸ>[Óéï‰/áÈ_[Ç<©=Ť.«òªª«1ãÜ0U\) ¢-È ?/c-墽«"_Ú±žÍä'€—‹(åñÚ̧éÓ4@"…(L[‹º5q÷ÑdlÖæ%uHèÅ]N¶6HØ$x$y­ª‘ÿƒÞŒºx´}%ú/䪬çè!G’OmV¬Ð´’Þ·1JR…)JJR€R” ¥(Ý!ù•ýoü5«5¤?2°?³­ÿ†µf†•¿$¼X¥)C1Q®ÿ®õN>ØyKÞöB<w @ïâ ›ƒãÈ(»#àÖj7OÿZöü±óí· Ù'Πòqño¥‹J5ãòÇ[ÞÈÒ—;×,Ôüž ›í{ÛcÙßoÚíÒ^ÖõÈoCáõ ¡JšóXYÜ{G~Ò }¦!üã ÝŒrÒ6þrúÛÁñê?Y­ŠR€R” ¥()JJT™¦—/<––’ÇÍò«ëÙŒZ1¸›"Ùä±ÄÜ!hØ¥ÕÚiÖØƒ¢ƒâ ¿úO…ùÌ>j½ KH,m’ÞÝ8F›ÐÙ$’vI'É$’I;$’Nɯ¸aŠÞà‚4Š(Ô"FŠU@Ѐ¾èL¥Ø· Ò¿ÉÁí£$Ó\K¾Õ¼—y5¯£à£eAf!Aa²7Xnò3½ËØã`ï\®„³¶»6ÄŽ~Ac¯!Ï•äP0jÍaŒƒÜuy¦¸—]Û‰ä.òkOÁF˪‚Ç@n„¨¥¶\Œ6˜éÞå/²S÷®Wf(]›bF±×‚íçËq­S¥(VRrÞ)JP¨¥)@)JP R””¥¥)@)JP R””¥¥)@)JP R”É‹êOuâ/°–דGu‚²·g±ºŽ)"hÖS²$eð#[ù§`xß<“±™¯:’æùòÖl=ŒHÞÐò±F_J±Û3¢ºq%AÓƒ°8uÙ·^‘莒·ŒÁÕýŒ=¹®tcETˆ7‚éÉq@•@äÌÀ.ŽßCgñk•¸¿¹³²Ÿ7‡^Êß@£nFpߋۦq£µb$"«¡é1¡'R¤.–ï›;·™ÿÒÑ¥¤©RŒÜnöµ¾×Ú»¯šþº£7Åà#›&ïvß×(£#$)ÜÈ)1‘u"*¡•X” *;ßê[¸[;qö]íï—;ŒK¹.-»–¬JÂ|8™OqG-¡^\T­zUcŽxfyR)QÞá*«Q¸†Ó}G‹)Ñú?Myòª¥,V·²VV<æ¸gë"Üåݳ;z'Ç=È%aX®ÖìŸ1Ž×oEB‡¹¤kØ]f­z[qg‘ÈÞd®ºNòø\ÌÒ\„´íé5¢Fô¶vIÛ3õ*Uq÷q=#..^±Î{Ÿ1ïK5ÇØ…“Û}«´{—D§seÇ—©‰µ°¼@ë­Í¹žìC7rA(¯x¿mø.—Džž'ˆ×Îå­±'$Ãuoż©4 xäƒ+©à‚>šÉU“»žß\-¾W..¯Ï'Q"d.á­Äq{²"¼¥R `Ê" 6H_<´XÕ¹Íd0–w<ˆ±{|«¯bíã70Gu Û±‘O6¶VäÀì±ܺx:·sqQÉuÂW ËØÎ–òt¼f(#!‰Hm1#Žö7^á¸BðJ’ vBÈÁ€eb¬<}!}Wrk°M—ÏÞOÑÆÿ!š¾´½~•·»°{Y M=ÓÇ)œª Ôš"ÞiO0cùÕëµ%…‡¨R@÷ù-%Gµ»µP.c ÊÊË" í‡8ø–D"ÝDš`R”ªLé̬ìëá­Y¨Ý!ù•ýoü5«5ëŠß’^,R”¡˜¥)@)JP R””¥¥)@)JP R””¥¥)@)JP ãñC˜¹NÈ^=‹ØçõÙ¶†ÝÒK^Vï:òÈÂMÊ"lž^5ÄöÇâ:{1l;¼K±Àk³s ü—\mÞåD{:wÑ|ï°¨};—¾Ê˘Kû8íÎôA*üÙPÁ £™9þPïŽÀøÚäjB÷ìýø NQ? ‹p“Ó¥]¨ä¾[ÔxŸÓäëOšÇ#œ¸•£)z·'aE¼1i¼|yFÇÆüÿ°¥FÇÁïN!üZ>ÞÁÛÀòYšô£Ç£À¶ÍVkVúÆ+øž9¹Å4d‰À 2“¿:$h‚$A ‹Å­Ïs6©SñÒÞZ2]*%ý«/0x x«?© ¬>0D(P¬“‹³¥(@¥)@)JP R”nüÊÀþηþÕšÒ™XÙÖÿÃZ³CJß’^,R”¡™3¨nç³Áܽ«öîåãom& 4¬#Žþ€Î¤ø>ð~»gi…”vÉÛ··b‰6OQ 6|Ÿé©™ë½AŒÇ1ÁÊúqó‡§Ñ°ú6Ì]Iú`:[44–È%ûùó´R±™á[„·icº3¤e‡&U 1â@, Ÿ£úë% Å)Xá‘¥BÏ ì¼\©$ 7¤‘¢ÇÓ¢6Ød¥)@)JP WÄÓEo“Ï"Ej]äv ª l’OÀR8¿cçûŸâùŸÚ F7Ú÷íÎwͤþω> èvè}&&pO£ž‰`I^>—jÐüÁiQ¨D*ª }Ö­öFÓÍyp‘+7ËHäyf::P ?@¡-¹˜£j£wîsž›CØÄ¿Æí$"[ôˆ€”?ý“{  md§»gÌúóQBlϪ£1ÙYø…Š’~yUqf„ì†í¯ç̼L6–XÛ%½ºp7¡²I$ì’O’I$’vI$“Y©JnûX¥)B)JJR€R” ¥()JJR€R” ¥()JJR€R” ¥(!“ÔžëÄ_a-¯&ŽëenÏcuRDѬ§dHÊ=àF·óNÀñ¾y'c3^u%Íó嬨{‘½¡åbŒ¾•c¶gEtâJƒ§`pë²=n½#Ñ%o‚;«û{s\èÆŠ©oÓ“†*É™€]¾†Ïã:×+qsge>o½•¾G܌࿶LãGjÄHEWCÒcBN¥H]-Þ?6wo3ÿ¥£KIR¥¸Ýík}¯µw_5ü4rwù{(1²uð#ì…¾Eí¦îìUSµ{9^Ø1À:²ÖK…[[ޝŠÃ'um}/QcÚ;¶y"IM äË”‹åtBñÑU =*µý¶ÜOÙy;r{($RÇáÏI½sôìúwó[éS¯>U1I»[Ãq²VV<öæë!oÖÍŽù!x/m"²KŒµÇzKN™xÚ„apçg$©äKÞÃuÈu|¶w7ɯ{yÜ –¸7ÐwV/ꪜmÆ„ & ¤Ž'‘2húU*¸ön$æ?£“n£~6³w£÷|@·xɧâ9®É:Órî 4/Ø›vÇÛI»öÆ%0ËÞ2÷C‹s$–ØÑäIßÇfµòy«,Oh]4í$»)µ´—0ÛpY¸¨-­Ê ÙYfñù£xn8³Ê`N ¢@¥øÜ ÀsÑ+êøy¨w{AÄã²ØÛh1v8ÌÄð™m¢9|!{«%UBiÑ ·î ò?9H-Zø›x½ßŒÆXå/¢I:«#oyÙ¾v“Š‹¶í³1,»UŒŸƒló9å^•$ËÄŒ™_‚ñ˜Ä·¨¥SäèoCâ@9*qƒÏlç3™ÇÙÝdò)lÏ›iR ·ˆÊ#¿#RÊC øâAqßÊbeó÷“ôq¿Èf¯­/_¥mîìÖCOtñÊg*ˆ5&€ˆ·ƒÚSÌþuzíHÌôúf¹Ç.Búi¢0][BëÛ¹ˆïjÁ”•Øf£(Ä'Òº•5} ¯JR³$™Ò™XÙÖÿÃZ³QºCó+û:ßøkVk׿$¼X¥)C1JR€R” ¥()JJR€R” ¥()JJR€R” ¥()JJR€“—†[W\ÅœnóÛ)ïÃ’÷P€Ç¶ÒÀžKãâ ‚¡ØÕ8fŠâç‚D–):HŒYHØ ˆ"¾ê2ÿÁrì§Æ;!!pÇÂÁpxŽ^í¾_/$È  ûVí_>áf”¥ Å)JJR€R” #t‡æVöu¿ðÖ¬ÔnüÊÀþηþÕšVü’ñb”©ùËéqØk››uFº Ù/3±©øx.Ê7±­ù#ãB‘NM$ka?­Þårç½pmbß‚±@Jq#áý¯}òHq¿¨Y­\mŒX¼]¦>vŠÖ Xª¨Q½kÎ…mPµFœ›[Ž>ÿ¦2÷eiQebµ[Kµ.‰iùò@V% %HFòyÛ¡³ËŸ¼éùãÀ‰ÖÇûn ¼›"·VÞ¬–ýÛ®Ðku!¤›Æê«à3w5óz…(Pó8ús%îìm´BF·Ê¤–á­Zì¾ÐÓ"ööæ…¹¹‰ ÀͤùUëAbnì£|zÞåÚX¯0Ò䓸÷¥¡gŒ†ÙNáY<€ñö˜î¬ƒ!=ü:úÞÓ#ÿ!{7k·uè2/®]w³Žj¾Ž›@Üže¶·–w °Ž6v øU±ÿ ?Eæ÷5Ô}›lmÄ¼šâðr>Ým @ò°æ™E‹… ÊE¼¿<õòx«Û”Çe/ì£{|ƒÝÝÝC}†—"GhE¨{hÈ)*[ÇÛ/¢«‚I}·yÓýKeÔO-”7Ѭ¼MívrA²®Èt\|¡ð×À`§ÅX <þϧ.òåïÓ+5Ü5gmÒÈs>®VFF.c0õr<{‡ÕÅÉ;½ã ÉÉìV¶6©!¸‡.. 7=ÛÊÇE@Reð0_þu·wpXÛ=ÅÃð5³¢I$è’I 6I “Sáµ»ÉOÆR‚˜<K'?P;W”¢ËãH6ªÃ—&UÍðÍëÐŽµ*L××9 䳯+¤jÅ&ÈiJFAÓ,`üùñ½pS½’T¡¶}ɯ²‹m:ÙÛÂ÷7î¼’Š‚H #€Dk἟'‹ F©cŽ–)Úòútº¾eáÜHÌilzQ n ;%ˆ:U šÆÆ+žI¹Ë4„•ȳ¯:hmP‡$•¢)JP ¥)@)JP R””¥¥)@)JP R””¥¥)@)JP R””¥¥)@)JPC&/©=׈¾Â[^MÖ ÊÝžÆê8¤‰£YNÈ‘”{Àoæã|òNÆf¼êK›çËX°ö1#{CÊÅ}*ÇlΊéÄ•NÀá×dzÝzG¢:JÞ3wWö0öæ¹ÑR Þ §&=ÅU“3º;} ŸÆu®VâþæÎÊ|Þ{+}Ž=¹À~,;l™ÆŽÕˆŠ®‡¤Æ„Jº[¼~lîÞgÿKF–’¥J3q»ÚÖû_jî¾køaKËŹ‚.³ÊÍŒ¼\|2Y­¥Û#Ipd›˜UM-Ì¡Vß’puä})§Ñdš)ºÒÒKûÙÒ;nªX íãEå‹VT0rkCéæÃàì£V8ç†g•"•á~ª°%ˆm7Ôx² ƒôן*˜¤åk_-ËÀÙ++¥Ê7YÉŠ–iÍ•„³d†m¼‰0$>¨ù½à ¯O³Å½x/Ó¹·÷„!¦ÕÉŠC]â9&Ó“pÞ›G€å£Ç–¶9ê[XÛc²“ÞO|òÞdaF¸dSÁ;Ž P … +yµ½’Õ:£dœÇTMµÈcç¾ËÏ„˜E2E“W…#U&2б™Y99 Àq娛DAçîÓ'“éÛë«›R¨ŒK‘°•ííïØÙ9W9 y‡Ë>Ìl»ŠW¥TüžjËÚM;I.ÊEmm%ÄŒ¶Ü#Vn#j k@²‚vFæ2ì#‹’ño172d¯¦k¾¤È[ºI9(°Æ/¸FáÄÎÏ…Ò Yxë¬Õ—Kcn,²9Ü–C¤î/‰™Ìì÷1¥¿g‚@#ºÃJ6ûù·šô+,Þ?!o ÇyL)Ñ¡”H¿€Á¸z#e}_5±wÚ’!k/|-Ï(w0FÔ’y§”ð›c΀;"§ݨ§I]ÚMÕ9˜1™{¬Ž.;+6¥¹{ˆÕ™î9öäm™*6Ü›DØà{:™‹ÂŒuÅÅÔ×÷W÷“¢F÷"0Ý´,Qt ¹Þ·ê;$:¬Ø¥*¤“:Có+û:ßøkVj7H~e`g[ÿ jÍzâ·ä—‹¥(f)JP R””¥¥)@)JP R””¥¥)@)JP R””¥¥)@)Xçžn.%Ž"BòI#TP6I'ÀyÝd †îÒ ëg·¸Nq¾¶6A‚ò Fˆ ¢+5(JvÚ‰˜«¹Ì“ã¯Ÿí®˜¾‡åafaž ÈUÑe]˜ä §jGÐAE É_ý#j•Žs2ÛÊÖñÇ$á $rŠÍ¯°¿§G_Q¯?^ ê¬}·ZßÏa)Žyeäe˜BÉcŠˆ†%ä…´O©<»øñ¶ž‰Jó·Ìu5¥ý¹žîÞu¸Æ­¼¹e´–qߺíIÊ;f ÚââÄ™4Þƒ‘ÎXÜ^³æ$¹ƒ˜³Ç*Kok•¸6üÚfUj.Ø\.{ ;ÊÇðÝ[Åqo,sA*ŽHØ2º‘°A#Îë‡Ãgrså-e—/ÜwÛüSÚ,Q…·H½¢DäG«»¨l 0ô–õ˜øÜ¾Nסm峿’Ù0%e’H’8Ùn\Å.Ò^JOÈ(ô>¦óðЈ°÷VÃÝîû%¼pw8ñçÅBï[:Þ¾»\öS/V $O' Ë‹{˜nD@ˆmÕX͵ê U.NÔÞ§ÃJ~#;¼êX^D»äï,[¼Ö«kÂ2©„ﴤ» ±£!¤ m·vw•#ýw¨1˜ñæ89_N>pôú"VFÙ‹©?LCckÎtFw;–¸ÇÏ‘Kµ·Éc ñmj_q-–&îvµ#lÊ “Ùôxëy|¶Oü "ÙBG€É.DŽÄ¯2ý…]¤‹ÓÙyeóܳJR†b”¥çøžK.ˆÄ{ôwxNßÞ³–8ãág,-ÆVP’~QÔ Ûcj ®âاö~ 8ïÄfNp:iG °87¨z[Mññé:Ø¥¯gagˆÅei´gŽÒÂÅB/õ*ª¨(_WwpXÛ=ÅÃð5³¢I$è’I 6I “Xﯢ°]Õä‘Û„PÆy\‚B¨:ó NÉI Fµ¦/ÊdrI ÙßlÉmA)#cÁõ6§@*¨ºŠµå¸ZZOur™Šp‘7ìÖ»[‚4I#Á‚A#aA*»™èM4VðI<ò$QF¥ÞG`ªªÉ$ü«”¶ÇvÒWçs6Žªeœl"’7­ŸG– kZd·ÓÇyšŠÝ剃[Û#"·`|8,£”›ÿˆð z™Å­õ-‹æïžgÇœï‰c»°Ç w 3Ü íO(Óàuµr|0PzÐüÁiQ¨D*ª }Ò…%+ìì¥(TR” ¥()JJR€R” ¥()JJR€R” ¥()JJR€R” ¥()JÈdÅõ'ºñØKkÉ£ºÁY[³ØÝG‘4k)Ù2‚x­üÓ°¶eå¿>+b¨¶ƒÍ^îÓ'“éÛë«›R¨ŒK‘°•ííïØÙ9W9 y‡Ë>Ìl»ŠVæ.KżÄÜÉ’¾™®ú“!né$ä¢Ã¾á_‡T;>oH{ꟓÍYb{Bé§i%ÙH­­¤¸‘€ÖÛ„jÍÄmAmhPNÈݱ_b@óÜuÖjË¥±·YîK!ÒwÄÌæv{˜Òß³Á Ýa¥}‚üÛÍ_é+»Iº§33/u‘ÅÇefÐ4·/q³=Ç>ܳ %FÛ“h‚»¯AW˜²1¥ËÆ.­»oܶœ?Åxž2#ðõã¦4k?˜›Ç¸¸½¾È^Þð€ÜÏ’º©í"¢¨-!ä@Ù}lúEK•Ó¸+Ò”¬É&t‡æVöu¿ðÖ¬ÔnüÊÀþηþÕšõÅoÉ/)JPÌR” ¥(iä²pb­Ö{ˆîÝÂki-ÃoDùXÕˆ>:×Ãë¹JÎáë+ÜÖ+£¯l­.Úþæâ3sna–Ò ZK+†Ðyž ʕ砠€Çˆ7-z²âöÿeoŠå5ßµ‹†7%¹¶!”캒ÍÄ€ Òì(f)Qp1C…‚’0îÒ5m€/V'd€²§{ÏÇxìznÏ äRNÒEíœC° ûLë<›ñô2€>¡ñÙó@C‹úB¶Žã'ìVìl®/ž ô¹ž$„¨t™9}` àã—¤Ž¢ÊZu•Üykg„Å‚EŽï» FY.•eOH-Éû1ª|ª†4-ú俏¾¹µù±qÚÍ7äâ´“‡ä”(ÀŒä— ú™´¼rŠDÊ{v_%}>BÞ+sq7e;FÑöãP®­!`ÄR>ø:Ñe‹!’\|ÊÚæk¦í<Ï:E+5pA+¾‹*1 l Ü‹ªî.16[YØÜ]ßݵ­©ƒ"$´”¬o!a:¡n!cuþÏ|×Zãëª Óvk-Ä–²OdÒÚ[Ú ´a`ghÊ5àÈv§j@©_äœ˯xß{ÃÚý·Þ_’ïw»]ž\xv¿²üž¸k^uËÕ@kÚõeÅíþ*ÊßÊk¿k nKsm:C)Ùu%›‰¥ØPÌS¨¨ö7gŽº³¹ŠIÞkh®cäì?*פ²»¨ºoÓ¥ˆ b€R” ¥()J^ùï#³‘¬ ‚{¡®Ï1‰ÈÞØ+ãá?Wyý¶ªmºFòækH 6V[Xå·¾3Îò&ˆ²Æ¨8«0BÍÇЛP Ò+ðCuo-½ÄQͨRHäPÊêFˆ ø  88²G0°Ç5ìöSI›k&–é-e¹ì{Î{‚cY9O #,¬ ±‰Ëf}³-ÖKÚ!ºÊÞbL&AÛ€\ñ•ˆ31· ªiˆ‚9WYm‰ÆÙ[Û[Úcí ‚ÕËÛÇ*« À”iIà‘ÿQúÍd[ 4íñ´{R¼ñê08Hü¹8ú˜ó}Ÿ‰äßY <®LîO#ýË-î^<Ët•õä¥"bŽ$*œ<ïr¸~Dú—Òmk¨¿ËäãÊdnã¿‘ °ÌYcVÈGŠT›Ù¹;’¼ùimqe„Ø>®V0}-ÃàbƵ­¥Ã›(lï'6ʦñcŒF;ƒÏ!ÇcDª¡&'6R¤¸ûGÈBœ"»hTʋ羶©¼ôŸ®€çìr™yº°á%y8YÜ\\ÍrbMnʦõ¯Hå;(pvÆÉþ;`¼Þ7«ú:z|ÝÌSñ—§çË"_›Qu7QBÝÓ­·ÜÛÛ'}å†*k|ÎC)usÓÝ$p"Åc†6‘³}Êûm€|iFŽö,ñ8Ü}ÅÕÅ–>ÒÚ{·çs$0ª4Ͳvä ±Û³õŸ®€‡Ò×™wÈä,²bû·PËÉ=¡¹Û™mm¡x’'Ÿ’ûŸø.N\‡ÍÇ]z¯XùíJ*ËþIÅx¹òmÍ«w‰Æá­Úß´±œ»Gk Ä¥´ÈPôßù Ùš® ’ ãIb‘JÍ­k·ãÑ®+ð×ÍUOê»ì¥…µ„¸ù ŠÈZErî¼’K˜£(£à6¶ÄøÖ€ÛrN‚€ç°ÑM™ºÇõ=ı¢IÖÖ8È1,Â';’{‡”kÄ…M ì‚*ljÆÃ”›)>Ñ2' nÖºøðÏ­‘é_ýê­.üÊÀþηþÕš¨’›K25ÜÞš±Êe¬qV‘ÝJ¦Y¬Oy/ž X ³36†övþ6Mnb,=׈µ²2÷žÂÉ7_âÒ'Ë6Øù$’|šÓËÿ[ËâqŸàiö`|Hxñüv%x[è+lýÍ { –{}:ŠR”3¥(i_äRÇ·Á5ÕÔ»í[AÇ›®GÔB€66Id‹W÷þÉÛ†»÷³ìAn<µ­³(»ml R°°öNäÓKß½ŸFyÊñå­éTlñEÙÒìëd’X³t’X¥óÛç‡ÅŒ«;__2I|ëÇÐIH{i½xضb:U~.òœî_xfÈ®»€žKjØy@;¥v ý™pûdùÏF.y­¬Ç—¿X†äú„!Ô«à™4T‚ò$”§ii²[Û§Óz$’NÉ$ù$’I'd’IÙ4,ö;Ë~_?† dîM4½ûÙôgœ¯ZÞ•FÏ].ζI%‹1Ý®3Ö¼Fò­sŒÝ›ûòöQ§˜ˆ,ë+`•€`<Ô¶ÈC-½³M=¢Ï3˜xE8u3(nähÄÅJ>üè;GC6Ûwfå+NË-É<‰a´ºxÒ7u‚erªëÉ Ñð|ƒô"§ÙõN6úöù`º´“keáÈ%Ê´E]çVõ/`ìïé? y\¥O÷îÜþ÷÷­»?Mö„ìüî??|~wÇÅCW’¼»µ´Åâm%žgÈö«æ…Umn ‚±9%‹Ö†¼š¬¥K‡'5¥‘›¨}Ûrì…ñ‘ ª'“¤~B«’5à);øëb ¶6êâ+{|…¤ÓËn.£Ž9•™á'B@ÙB|røP”­;,¶7$ò%†BÒéãHÝÖ •Ê«¯$'GÀeòÒ<ŠcrØÜÍ»\bò—Ð+”i-fYT6Ñ*HÞˆ:ÿ1@nR” ¥()JJR€Vœ™[n.àšæ8žÎÝn® ž•Ž&.–>5ù7ú|qó¯¹\—D[YõUÆP]dšol°«eîÝ»‘¼¬ÜùI¦M:iX‘ó¼ ¹ÓÝWgœÁœ»Ïcojbö¥ãxÇnw§›À¶Ò@ÃlFŽŽª¶5oÒÁ²‚ñÝ‘-ÌËÜfTÀ.öHVV#è À×ËÓÙëšÂ<4÷wWý)mˆ)Ðgž8æ Ü.ê8îa¢œ¾k|Erw;•—«/ 9'ÇÞdírA-²Z¯e`þÔ²™¹òƒzOI%Û×é« »›Ûv‹ö½G“¿–õ]8Ï·ºƒ‹ÝÛ¯Äàƒ×¿@´Áælú‡e—°~v·q,©² ]üU´H ÁðAB¡ômµÝEa,¯ídµ»µ²ŠÞX]‘ˆdP„í ;~oG`\ ¥()JJR€ò1}Iî¼EöÚòhî°VVìö7QÅ$MÊvDŒ ƒÞk4ìç’v35çR\ß>ZÀ-‡±‰ÚV(ËéV;ftWN$¨:pv»#ÖëÒ=ÒVñ˜#º¿±‡·5ÎŒhª‘ð]91î(²¨™˜ÑÛèlþ3­r·÷6vSæðëÙ[èqíÈÎ;ñaÛ`tÎ4v¬D„Ut=&4$êT…ÒÝãógvó?úZ4´•*Q›ÞÖ·ÚûWuó_ÃG)y ‡UgF;4"âéÓ4öÑÇrƒÁ•¥7ÀâFS¨ÕNÆo$ñæ'Šï-}iaò‘`™à•—„ëÊHßùm™†¸ù}©‡£Væ:ë¬}Ĭáìn ÄAHÑc‘i¼|8Èß yÿjóåQJMÚÛþ#d¬¬p©‘‰í± ËÏiƒxvîÞýíD¼.m7:²³ò€» ±îÌò#u6Iáö¢ùkè®cÂÅ6 K+ZÉwz{Û‘ÀM&Ößq2 Às ú5cžxmm常•!‚$/$’0UEd’|ÓUÇ·q'œõ-Ü-¸‚û.ö÷ËÆ%‹\„ÝËV%a> L§¸£–Я.*V²ar+ޏíK{Ü …Ú\Ûœ”ÒLmTÊ!ÝŸÜ+¡ v9>I—MèÔ¦=–°5ÜÛûÂÓjäÅ!Ž.ñ“iɸoM£ÀrÑãË[ŽàuDØÛ\†>{ì¼øI„S$Y5xR5Rc- •““¬Z‰´@ž¤^õ66ÂòKWÓM„‚Ï=ÈŒVh‘‚¶ˆv|(Þ‘öÖ×Öwœ}–ê ùD“ŽÔ·ïƒøÿ qmÑײ •®š"¹&6 ¢HmhŸIØcÆõ±»9vXcŽºÍYt¶6âË#‘½Éd:Nâø™œÎÏs[öx!;¬4£o°_›y«ý%wi7Tæ`Æeî²8¸ì¬Ú–åî#Vg¸çÛ‘¶d¨ÛrmWc€Uëç…n-åË„‘ 1ŽFFxe ©ÿ0AEhbð£qqu5ýÕýä葽ÅÈŒ7m @#D]îw­úŽÉ.I¦H~e`g[ÿ jÍFé̬ìëá­Y¯Lšß’^,R”¡˜¥)@)JP R””¥­'š×¡z†âÞY!ž,eËÇ$lU‘„LAy;©öØœn ®±ÖøŒ}¦> œeãϤ+ÊÉ-°BÁ@ T;€OÛkâjýÝÖ.ksÞOfó]DÃØ¦u-4d}Ë.ƒoƼÔµéŒmŸ|ÆožI¢hLÓä.&‘¾pÝËG½x²ª~*4%¦·•'¦·–$šHЪËRÈHùÃ#cãäõƒ\ÿCB¶Ý7$d)O Šd‘ˆ“,Ä–?æI'鮀B«póƒ'7EB ŒWJI]èQÙgÆ÷¡¬vv6øøXûq´²LG"vò;HçÏÖÌÇü·ãÅ6)JP R””¥¥)@)JP R””¥¥+Ïð-~ Ø¥ Ž.‡—…í[½ÝÅÙÌGrUò3KƒÞ+>øÈüyˆÆÉ×"CybÇy-q™h3›&ÅNmìów¹ /ıvLs-ÑP>ç gE#†¶É' ±êŒNFò;ky§-.ûÉi,pÏ Oä¥e &ÔíAa° ª“Ï ­¼·Ç !y$‘‚ª($“à<î€ó¸º/"zKˆ†Ò I¥/1Óí”$wS-¿Îã½í’BXð'âFò_ár¹›¼õý¾ï%ÂbÝK½·~y-®W+ÅÝ ðàªdÐ$(:Qºì0½I…ê$™ðùKKá”—±(b‡“/‘ñ•mƒ±±æªP¶+k¶Y¬òWW)˜9 ­î¦¶ö©TÙµ¨Ð„*FÔë‘ô©<¹]¿K¼1ášû¢=¾ÆzëÆÑý—½v’CéyɆ‚uð¯P¥ÅÇ€·¹8iÒqâ-,óî{WŠÙ@Õ´ª³q‰ÙIæÑ€wÈ@ ÓÓ—vŠqcNGºe( ŽE»XämQ+$#é hhë´¥åýƒ¸Éô– $ÂA Œ}5-¡ŒÜŠôܬ°È9¦ÄmÜ%A þž:ºÎ—ƒ*··(®Àt‰#“"¶ÞÖÜK’Ûz C*¨3I¿jÓÉa†Æ©‘í¬lmÑQKŠ(—¨Àÿ°­”Oãa‘Ȉ0ۘїþµ–^¸øk‹ƒ±±²ã KjEšTn]GwêqØÔøªÌ¯tìÀ0VP¤pIð|l¾Ow¿ç³{½|Ïë>ÍÇëÿ—òß½kƶv'_sõöó7/òøÌWoÞ9K>æû~Ñ:ÇÏZÞ¹½lÞ´þP÷¿äpù{½|ÿêÞÍÇêÿ˜1òߟ›½kζ7¹aˆÆb»žîÇZY÷5Üöx>zÞ·Ä ëgþõ»Ax-Êÿ2÷#ôšãõF?ÿt¼çü:ÿï·¿£^_'»ßóÙŒ½Þ¾gõŸfãõÿˈùoÇÎÞµã[;³J k_nÏ™ïó#{Ýß•ÁÉìœ|ûõk'þž:=¯§Ìzòy0}hæ´Ì£Ü¥ü^Ã~ûíÁ$ŠDúZ&ÖÐ UØÝ:Ãwgmlö×–ÐÜÛ¾¹E2VÑØØ> <_>ßs5*7g)ˆõ[É6VÌxöi8ûB}\$fUp4ZÀ-‡±‰ÚV(ËéV;ftWN$¨:pvKé~¨éû~’ÃC6w±ØÀŽwea‚'Á±.W¢gÌ[ååÊ`ß!mE Ã]Å; ÿïÿ¶Û_8îš—ªC^?9úZ ]%Jœe(Ýík}¯µ_²ù¯áÏ¥åâÜÁYåfÆ^.>,ÖÒ푤¸2MÌ*¦–æP«oÉ8:ò>”Óèìd¯Ý:žíFxò镳‹d.™{¶L ï0·ŒŠ9\îB¤¯ò;cKò»¦¾ÐâÖÇþê|®é¯´8Ÿõ±ÿº¸e')9aµû; •‰ZÌæ¬ó¿ñ|."\¯üOßùh³kË{?Æ‹’o—od®ÆµÀ¢¹Ë¥¹oèî%¹ÉänŽO£®¯®š{·%¥Ž;s´@PŒæ¯™Ù¯Hù]Ó_hq?ëcÿu>Wt×ÚOúØÿÝP›Oq:šœ/‘+5Ìu%í¥¶k"¸ÕÁZ{3ZÞ±Ên“¼ì³ñ†$‚tÄ1U+¹Ñ×yL´WyL¨íLÝ»Og‰ÿ"êb«³¦´ñ“¿+kcLÛSõONÍo,IÔøØЪËä%‘ó‡-GÖ `Æg:S`¶õ5Àw‘ä’ú"ÒHì]Üè¶ffÐ è4*ÚÜ558_"å¹·3݈fîH%uïí¿Òè“ÃÓÄñùܵ¶$ò9,–7žÉ4}Qõ¥G’Û&aö{¶í"÷‚±Yx€›IyD|7+¿+ºkí'ýlî§ÊîšûC‰ÿ[ûªk°jªp¾Gsh€CœéLU‚ÚCÔx×ÞG’Kè‹I#±ws¢Ù™›@7 Ð¨wkpÔÔá|Š=!ù•ýoü5«5¤?2°?³­ÿ†µf½2•¿$¼X¥)C1JR€R” ¥()JŸk;kþ¬ËÛ^[Csnøë.QLÕµ-ÉÁò¬ÿ%±qy°ŽliTXLÐ o¡ÌJ{l~9NÀì RÛó×)û:Ïø—5f†óœ¢ìŸbþ"7»svÿò½AÞåó½ãf’ëêãÚ1kéÞù}×½¯¨-¼ÏŠ´º<³»"Y>ŽKŠª»ødð7åˆóf”)¬¾ôŸ—òÄo”Aã#a‘ÇŸ‰3[™Wþ¶–.q øï“ ³¡¢w,2øÌ¯sÝÙKÎÞ»žÏ:ÉÃ{Öø“­èÿÚ·kJÿŒÊöý㎴¼íï·í,œ7­ë:Þ‡ý¨/½[æ^æí*7É«H½V7y_ìû7ŽÉú–'-ð ðÖ†žÉÔÞ ÊÚ]FžBÞZ,ŸO’6U]üøðÄy 1{¥Ïã,Ò£{Ë7oÿ5Óýî_7Ý׉.¾¾]Ѿk—Ó½xÛåF:/ùÕ»°ãâG¼´’(£?SLW·ñðb Ö‰ØØj§Ø¯á·øY¥a´¼¶¿¶K›;˜nmß|e…ëhèèÈ"³P£VØÅ)J)JP R”¹üwIÁžÇþ#}qiŽÿ²›µÛµô׉TÚ™6ogm¢: PðÛ˳ó½ž^ÔF7æw›Óëm(Óx?7Šú†±Ùca±ºÈÜDÒ¿¸†#A„QÅ¥ñðãŸ;òOþÃr””¥ÿ½8‡ñhû{oÉfhÐ8 Û5Y­[ë¯àTvxäFçÑ'€ÊNüè‘¢ Aƒ‡}-å£%Ò¢_Ú°‚ñ#€—бãñÚÊÃéÓtAi/ô±vöõùÚP¥)C27H~e`g[ÿ i›þ·{ŠÅ¯žõÀº—^ Åȇö½…#É!ξ°é̬ìëá­1ß×zƒ'>cƒŒçO®VSôm˜#ôÀ6v4£¢[*JY\³JR‡8©—wsÝ\¾;ü$M{MÖà€ðd ‚ØPC6ÁU|7—²^÷ÒÖ÷Øl­¹{VDpô•ùÈœÁ_N6 ¢£mÈÇ‚Ò ¯­’ÚÀMŽÄ.Ã4‘È—7±ˆhöw·`]‰b8ž.ÃhÂßê_>eÏa÷Âð8¾œkrmÙ–{™74p>Éem02J[dŽ@–c²¡èXbí±Ýlj9ÜÍ£qtàg#z.À ëgCÀQá@ Ú†­àŽ#H¢B$h¡UT ø+î…e;ì_ûâ)JPÌR” <ß§¯ìÑö*Þî ²XÎß·ÙÇ i­8ØMwPyM;*@i˜‰¯@†þÎãÙûpKí1àá nìcŽÝuó—Ö¾GPúÅlTûìæ+:ÛÞd-â¹eä–æ@e@áõ1$“ày¡*.NÉ1¸»LM»[Ù¤‰9rW“l@ÙÛvHäOø˜³³w*7¾îný8¼=ÜÛñÞ¼SiŸ‰ Ìw>±°$¿ŽžÉž½ós’‡‡ÈŠÂ1#©øhË*•`~:©C~!}[_s·Ì·–j7ʼ#ÿÊÞû~¾w»¢{¾W.Ðn;ó­ëz:ø|–ÅËæþ9²Dùa3N…¾—1í©øüÕ uVh?ù¬ß—R7¶ç®¿å°ðÙ¡ô—¿¹ÐÿÔ#‹š¸Q‘I OƒOtd.ÿ¼óS2|  ì¨Ãè%¹4 ïéY×ÇviA¬·Ú’ùÞL´éìE•Ê]Åa ^&õw0îÏäk̯·>¼Ÿ‡‡Š§JP¬¤å¶N┥ ŠR””¥¥)@*}ö"ÞòuºG{Kõ^ {nª% ³èÛ|ŸK7ç[Š¡*N.èï[œ_£5ã}ám kÿZòf‹^vÇh¸'ˆÝËcaÌᯱw "Á{o%¼‚º•$l½¨ÖåF÷+ã?)€0ÚñYHÙÜ|tŠ¡$ïÔ SW:пù—sòöù¸ªccp’‰¤¨Êbx±$iìh¢¨ìӻĥþ2ÞÊêæy{2ÛÌfšÏ¶~ÞyHƺDáDøÌ‚Þ@Ç[+ÏŠãÁ ®´ÊA;!nP R””¥¥)@)JP R”koÏ\§ìë?â\Õšmùë”ýgüKš³CJ¿wé¥)C1JR€R” ¥( —};…¾¹{«Œ]£Ý¾·sÚ`@Ð"Aêhh‚ÐÖµX~Oväs{Müÿë>ÓËêÿ˜qן›­ïÎô5f”4Uf¶_aµÔvŸÙÜc²(=*“#Û>¾†iš±úÀA'cZÑ{ã#oé½éû¿O™&³–9âãµÛ,¡ñ=ìxÝšPkßüþ¾Uáþj÷Ø7ó}ãÚsúø÷Bò×ëzØßÄUšTo’xóm†Åþ™,7jä}Eâ*Ä‘:ØèüÞkÏ¡f•ÜwpÈç²0¢ùŽ ¸\ ?S3©•?ÜG@¯?úMoú£!ËÿºYðþ7-ÿ÷º×Ó¿=Ò_<¼Ë5Åô¿KôýÇIa¦›Œ’Y,`ww´Œ³1I$‘äš½ncHô×ÙìOú(ÿÛ\V;«º‰:z|ÕÌSñ—>UøÛû¨‘ºˆ&m¾æØØä ;éú^ï.ù …–H_vâŠb9´7;s m­±â#ô/@$óò@ñ-IvuN'ÌÞù#Ó_g±?è£ÿm>Hô×ÙìOú(ÿÛViTÄóÚœO™äM}žÄÿ¢ý´ù#Ó_g±?è£ÿmY¥1<ƶ§ær=QÒý?oÒY™¡Ác#–;Ý-# ¬#b x"ºë»Ëk g¹¼¹†ÚÝ5ÊYœ"®Î†Éð<*7W~eçgÜ «~,*È.>Üßfö§Œ4Û;ß¬íµ£ 7 4€»tfÚw-9b‚ÆÞ÷èk|¥¶¸þëµ»Êý<ìã¢>’³9XÛGÁ Äï~<;½Gwý¾;‡Ô¯3½ËëèVx*Ÿ¬‰47½Œ½A’›‰ïÛ¬fy.-íc2Ui’ ä /ËŽÆõ­ìkáïò^ù¾Äe%´¸žÚÞ ¥¸µ R²´«À£;ƒ <¹y䆶zL±Å}«žßo#ïä÷{þ{1—»×Ìþ³ìÜ~¿ùq-øùÛÖ¼kg{ö8Û\ >ÊÞÒ&nf;x–5- 7 ÿjú¾šâ 9$´µö«8Œ$¶cðQ½’:AŽÓ鬔ٞ•Äe.5žöʉ0B†t @Ù'[?Y¡¤š³{ ”¥(PR” ¥()JJR€R” ¥()JJR€R” 9¶¿»éûkËx® |‹rŠd­«iÈØ> }|‘鯳؟ôQÿ¶²g½:sö‹ÿâÜUZáÒ[SØtã”a¶z²ý3Ò–¶òÜ\`ðÐÁ’I-"UEd’F€é­Lf; ó]ßuYôÝÿk]ÏeŠ xozßu½ûÙë¯þ¯º—öU×𚙿ÎN™ìÿÌ{TÝÎ?ÙýžN{מßs±¿£—oéãX¦í¼®¶§æfù#Ó_g±?è£ÿm>Hô×ÙìOú(ÿÛ\5¯Uu+ôµÞZSu ¸éÛŒœMuìœc™Q=™#%ÌC¸wÝ F£ìÜ9»ÛeÉÛ¶kÛ­lnm¯-íãbÏu,‘ˆà Ä”A·ûvu-IvuN'Ì»òG¦¾ÏbÑGþÚ|‘鯳؟ôQÿ¶¹+ Ídž> ŒöÒ.~Ld·ÛË?mlšg Ú&! }€WÀ⼕ˆef'Þ¶xŒe¦ju{î¤ÈÁ5ÄÐDî# vÍÄ ´AÁ €ÇàSÑSi.Ñ®©ÄùoÉšû=‰ÿEûiòG¦¾ÏbÑGþÚ…ŠÊæ}³-ÖKÚ!ºÊÝâŒ&QÛ€\jV lÊM¸ÙSL@@Fê¯Uu+ôµÞZSu ¸éÛŒœMuìœc™Q=™#%ÌC¸wÝ F£ìÅ¥˜×Tâ|ÎçäM}žÄÿ¢ý´ù#Ó_g±?è£ÿmr]IïY Æç5;47X{±q! 5錢‚¬jcWPy6Æ™œx¯F¨w]£[S‰ó#|‘鯳؟ôQÿ¶¾ºB­ð/ 1¤qG}zˆˆ *¨º”øUê_KsÍûBûÿ*ZèÑ›mÜ™NR¦îïµz–©JWaÎ)JP R”£t‡æVöu¿ðÖ¬ÔnüÊÀþηþÐÑ~7â½J)coFkõWSE2?#êD.TkáàÈÿ÷ÿ!\ý¿Aââüœ××6£6.;Y¦üœV’pü’…ø€’äS6— ¶Zò×#iÆÙAu}s·\ܘ#Xã1«z•òÜ©¡ÇZåäh±…Éûß.Œ=™YmåŒ7 ²E#Fü[CkÉD€HÑ fK^‰Íô—¹|•õÅÒ[¨žnÊ´& X™qªí]Ëzƒ #`ä±é8-.cº›#}{t¹3OÚä6ÆÛD"(âèïè­Œþ{Üke«)îZêî rPi"Y%H‹³ ‹¥fúƒ2Ø #ÙôúXäZâ…ðµ2É:XsQ K!fvØPí¶wOÖ~ºc¤\=»[ã:"òÆrí²ÙÄ¥´ÈY€Þ€óþBµ2ÝgugdÝœòdcº³ŽK9ÌÄ3ÍÛ ËÃÔVE_VÃXóU.:žÚß(ö†ÒéàŠâ+Yï'jäáÂ6¹’{±yU*9‘¦ÓnCxWŸSëßWÿf2ß½µüj{êÿìÆ[÷¶¿ViTºÈc óêF÷ÕÿÙŒ·ïmžú¿û1–ýí¯ãUšRë!Ž<+Ï©ÈõF^öN’ÌÆý;“‰ZÆpdy-Š 1·“©‰Ðÿ OùWiP:»ó/;û>ãøm[3uŒÉ Á”-%1W.¤ƒ¯ # óF»tg±–šs‚Ã׺ýÇ×PcfÊâ{íž;‹{¨Ä„…v†d”! ¡Šq壭ïGZ:xë,Âå¯s¶Ö1]\Åmj-¡ºycŽIŸ¸cSËS6—޽ÕêôçùQý/÷EßáÓåF?ô|¿Ý‡]&Zšœ/‘V31y„±Æ¨QrÅ—ˆòÃC‰åÈhoÀ~t'ôÖ6l7Jâ1w Oee ¼%K"$l­¨V/•ÿÑòÿt]þ>TcÿGËýÑwøtšœ/‘f•åF?ô|¿Ý‡O•ÿÑòÿt]þ¦§ äY¥FùQý/÷EßáÓåF?ô|¿Ý‡A©©ÂùiQ¾TcÿGËýÑwøtùQý/÷EßáÐjjp¾EšTo•ÿÑòÿt]þ>TcÿGËýÑwøtšœ/‘f•åF?ô|¿Ý‡O•ÿÑòÿt]þ¦§ äY¥FùQý/÷EßáÓåF?ô|¿Ý‡A©©ÂùiQ¾TcÿGËýÑwøtùQý/÷EßáÐjjp¾EšTo•ÿÑòÿt]þ>TcÿGËýÑwøtšœ/‘f•åF?ô|¿Ý‡O•ÿÑòÿt]þ¦§ äY¥FùQý/÷EßáÓåF?ô|¿Ý‡A©©ÂùýQ4–÷}?,V²Ý:ä[PÂP3VŸáÍ•ÏÉ ÒÉõ½¾µï\mŇw}¿j½²‹žµ½rœo[÷÷™µÈæºz"¾FîÄÜXOëÙg9Ð|ü7¿ûW™õíwÔ9,¤™»»ws&68ÒÒIDE$0&äYãKDîÇor· ßæ« U-Ük'‚1RgmógªO“¹º·–Þã¤òSA*’9Ñ•ÔA›DôV¦1-ð½ßutŇw]ÏeŽÊ.zÞ·ÆQ½lÿÜ×5ÐÝWî¬Bbïá˜ã즒”b>òM&ÉHÓ‘Œù!8/’9ú+Ž©kŽ¡ÃYYCu´Ù)­¤¸h”Åp"‚~â©òT¬±¨õ-ĕ䠚ʥ ”­Š6Oi=&G% 7gµìyo5²6 u‡ÎYYtuå„ù‹yb¸¹†;0Îά9¾¦È.O“ôŸ>j‚H±ÛÝÛ§D^,Žïu­˜YÙÆœ¸ïi‹‰?¦¾®,=ßq%•ôVÉ—%l챟l¶Œ)gŒ$xxüIÀúÇ ­|·ZËmdÏe‡¾{´º³Co:";A<ݵ”‘xòâêªÄ2¶¹ªšËnëc óêmÁ"Úˆ…¿D^B"pñˆÖÍx0´ÔÞÑ¿ú|| Q5ÈbúÐEÒØ›«ø.¯'÷E¾G%q FÚ7BL® ) ””ñŒ1ôO•®÷!Ž<+Ï©¿y"ät½è‹Ë”&Y–ÍÄŠŒYCno 1$ð$šÛ÷ÕÿÙŒ·ïm°ÉÕ¶qeîlÎû­ÔV—]¡ÙŽIV3ÞöÜŒª¾JŸ,Hb«låËÛX-÷«©m-î»C³$‘,†Q½íx˜™}@>T2‚Á·!Ž<+Ï©›ßWÿf2ß½µüjúéi0/#Äñ3_^“Y º—ÁÑ#cü‰çUê_KsÍûBûÿ*ZèÑžÖL¤7em«>òÕ)Jì9Å)JJR€TnüÊÀþηþÕšÒ™XÙÖÿÃZ/ÆüW©ƒ3í·Pãs6¸éòÁisjð[î9/ ÑÃßåÚH‘PÆYCz§WŸ ø?F“n)aq¦ñ.Õê}Ž•3\<ý—°ºÆÞ8‚âw¹ö¦±u.®YŒƒGÄl|3ƒ¾$ë³ÃôuŽöÂkeKkkˆ¤îR\I3ÂÍ+¿ÒÛ‡Ïñ h(æ=5œŸÔ±åln.³)Š[g·xä·1ב¥–WeWF__•ï7íPúZuÎ)íîä r$¶¶rª%‘ù0"òõJÆ4<ôD$Ro¤ÕÒçB1—ضxøçmË©çÒ†‹ "x,ªJÍæÖäü [^‡ök+[oxòö{\U·.ƹ{Æ^Zåãžõ¯ðü}_ ÉqÑÓu[æ‚ã˜ËqÌ>9%¹WQTE3"j5ñÀKÊH+¹?WX,ý›8§ÈÈý¡±˜Ù'yäŽÌŠ3!äG¥‚KGªà’ _cÇ_^]Üw¿©ÃÚY#츎nEÝSÑ! tÇdíy šóï3°×‡¥ï ËÙJ¹(2Ï!qŽÜÚñ’e›2÷8ñ ;‘èÞ‚Ÿ$ÈOèÍÞd Y.ñWXÆ•,UdKÃSLü¹M/¤–b@bv\©ÃÕɘžH¦{«ñ¶7ø"Œ '’f¸:@Ú;eO¨€¡K 1­‹\ûC˜ÊÛÞ³´/»…P´†Aͼxi¨'d´ˆ¿HÔÞhy®‡LæB+û³Ššå­cµ¹{¬ZÏ …+pìDLLó»ƒÂl'—W0™$D~jIt,8ò†JìôŽ´yIú¶WÍbÂÎúîÒöÖù’Þ´íЪJˆQFvV,•×âJŠÜ¹ëLtVéuoÕ埱G‘žâP¶Öά®•ˆ!ñ@Íè;] 5'`Pê \ÙŒO²ÛÜ¥´ëqÄrÉ•CE2JPÊH%5ñÓ^Ÿ¼¼ö‰²ÙNw¯k-œã¢6¾ÍœK²î{„ªD8.€õØ›¨ìàöÞQÎ}!o“J<É7g‰~hï¦þŸ àøÞšõ´©!·Æäfq{%„1ˆÑ Ìñ´Ö2³ò$.¼\±[`$[GmgA­/1Ö—oc([LZÃoÛNeF® °Ü‚ykJ»÷m7U¾h.9Œ·\Èóã’[•xÕDS1Ò&£_ ¹ ¤‚½•×¶ÙÇ9‚{vm††tâèÀAúˆ>A*~ A9 ‘¦·ŠW…àw@Í…K!#æž$‡‚GÔMN9%+ŒN¶†lŵÃ-Õ¦b.ò/$гĎd+Èë‹Ièðãc’ ®ê/UÀ‹*Þ㯬®b–Ö6¶›´ÏÆâ^Ìo´v^%ùoÕÈp><Æ ô®S5Õ-k“²‚Ω;Y`¹†(•ÚrlžuTú‡&‹ÔJ£²I:²’³»yžß¸ÜÅärF E%´°#Çd”&Uô’Ärði…‚—W~eçgÜ ªýq¹œÐÈô§RÚÍauay2YÞäÆ[¶é G7uÑ(ã[ߤìA=•uèªÉ–Ÿã^/ÐR¸û§ËÜu•Ý„½;•ŠÕm-#½§ä É8iX¬Ä•!ÀäGlúFÇ(ö}–¹éëüºÙóÜ“å!/Œ¸‚;gDVHZG¤áâ2u¦zŒH¥pù.¤êL_½ûñâ›ÝXõËOÁd<£=Ý[.ÈÛ~E¿.t<Èüu±qÔ™ˆ3#Û±÷eŽVÓÇ‹™¦ï­¸Þ÷Å84ü·¦æ=:Mr`; W…¿Ép‡‹–ÒÞ{›ÜÍÓ\]@Ó¨X¯Êð®‡dÌ.^8‘£½Œ’õ½áÆc‚938¨.qѱ.#¸’Hã+3ln0×6þToBCñâÅ+‹ºêÜ‚ueÆ>ÖÖI`µ½·³’ÆÜJd,LÒûJþJ ‚m”`IŸ#˜ÓÕ¹ R‹Uµ‘ìÞöæÍ‘q· -Ä&EîµÑü“†h€à ÊÉCÈÒ•æþÁgÿà³å‡²Aò“Üžò÷§l{G´v;œ¹üxïÇ™ÃÑ®šÓê 49,Wô•}™¶ÆßÏd“%Œ²Y-²‹(äP®ÌÄ\/_6ÿ”T¥p÷˜tõ–Ó¥ìñXÎæ>ýÜû6£OÊZm»qñæÇНÎ_{ÈcaždÈ-ÍÄÑ;ªµ­ÂAÍ# I< Ž<‡©¸éùüŽc%œÀõ^BYãwѰ^Ed‰…¥ŽàüþZ'ÒÀƒáðáêÕ)Pðù,”™›ì^Qm;ð[Áv­j*,­*öÏ#·*a>½/.Cкór€R” ¥()J&wûÓ§?h¿þ-Ås}MÓ òÜf/cÄ\_se“Þ¯j ÿ‰Ñ9„-²úNÉÙÞÎúLï÷§N~Ñü[Šò>¢®ú‡%”“7wb.îdÆÇZI(ˆ¤†Ü‹òM&ÉHÓ‘Œù!8/’9úë­³¿È-ªÙßDu=”w3D9'ˆÉÉÏ#鉨6¸èk}¨¶WJ©%*ùlËÇÅï},qhÑi©SѬ¬ÝÒì{ÝþwÅÇ@¦£³ñXAc,žå¸²µ[,bÇs01èwdšYù¡%‰RJñ·uÒW×q]Ë.a$ÈJöb+‡´ô„µœÍqÇ',Ì” ;U׉ºÆÚÖÞö{ÌnFÑ-즿ˆM¹‚ ²(rTŽIé#zÇ ¬su½¿´w±™X½ž!u?8ö­-\6ÛÒ¾†ü™ü·¤þOÁ®+ÍfKž˜™ï.oíoÒ+ÆÉ ¹–$q·²­±WPÊ\q |2è‘ñƒC§ñsañ>Ëqr—3µÄ÷KF%-,Ï)K1×Äü+^ã©í­òhm.ž®"µžñBv¡žN#`[™'»•R£˜ÙmW’FG‰V;ñfRºŒq'“lƒ­€6øÇg –T×ý2Éé;úwÀ‘ñõP¶­¯¹¥ó»if§ßg1XÙÖÞó!oË/$·2,€’Ç©‰ €$ŸÍk|›‚9üŽ@üšàÆŒ¿ô4QpÇÇ|”ì¿c±ÅÀÐcì­í"fæc·‰cRÚzyÐö ´÷Ÿ; ”=ïù>^ï_?ú·³qú¿æ |·çæïZó­¿úMqú£Çÿº^sþ÷Ûßѯ6iA/µzûy¾Ow¿ç³{½|Ïë>ÍÇëÿ—òß½kƶw³cƒÅcgk‹<}¼W,¼^àF ²A<ä>¦$€I$’|Ÿ5B”!Ô›V¾Á\^7¦ñ=EÑ8™;f”Ãaã™âuÜk°m èèxí+ž´é{‹ (,íº“.AÅpµ,Ú‡“h#3õ.Q%* ª-«*¶¼€M¸ØßÓ¡ÿ°®mE\Î\R¾%çЙ/CÛÔ¾‚tŽòÚÊÒÖÆãÙ=¹ämú8€’èœPTŒ}G‹{L.}íÄ÷7ùK¤¹°HmÙ»WI BDl@ŒYôƒzoÖ±¾9uÇÃÔyy#\1KU#r ¯Èz‹27àbHô†Ý÷÷Ú|¿î횊™ á¾KÏ¡ómÓööY TÖÙ¶Æãå°†ßE½ a+ê'~‘w¾_aü…š<;mú|8òe¦›íETvR^} Ðô,Ín˜ûÜ¢K‹ƒ>Þ8mLs,2ˆ—“È]•œ,CÈE’uôVä/yz·—”dgö^ܶö†8SÙ¥3E¸ÚF-ëcËÖ6º‰õ^â¾ûO—ýݯàSÜWßiòÿ»µü ¶¢¦hŒ1â^}¿%2ýÏm÷ͼýëï统³ÿ)ìÜ;}î_7Õ¾¢²7DC=¯³ÜÞ»$¶Y k“a µä©,Œ›'ˆ ­ÅO/llÖ÷÷Ú|¿îížâ¾ûO—ýݯàSQS40ljyô9ËŽšNŸè¾§q*9.1ò†\f5lãÒÆú$rffõ%µ 4ä[¨›©1¶sÉFWÇ”b½ËÄ1DÞ|q”þM‰ ¡¹k{‚¥ßKÜ_ÙOgsÔ™w‚xÚ)…¨ä¬4FÄ;Ñ] mJñ'û÷~³F1+p÷ bwEG(äʤ•üH˜ôr?]GNÁ¥½Ý¿²HÐ][½«F÷²Ç 4qÄB„hqˆô¯ý+¯¿“ø=XÎö%ÇÃØ¶€ý$Å£?µ#GÕñð5.פ­Qer÷°Ç$·7±ÜCÂGªA (•|+•xÝ—n$ò]koå5”20Ýãho eŠ?«”˸¼ø×¯â@øøªÐÍÄω,R(t‘2²‘°AE ÊŽôJŸ¥ñ3À‘vg‡„³L²[]Ë¥s$ƒ¸Œ‹9äW|vǤkÎirØD·‚ÒÛŠswéô"øoãæ¨R€×{y20ß´{º†)!ùJ9BÃ_&4ÿ·ùš–ý!ƒ{{Kd‘`µ·KU.%U’X候Øã'!êoú›w)@O“ Ž—ÚyÛïÚnâ½—ÖÞ©¢íðovcð<>AÙÞ;žžÆ]‹žä+ÜÜ §–)äŽA(bެ x‘±°~qÝJPí0˜ëme··á%¬R×bxÈÊò$ú™™‹6ØìéŽÁ­»Û­¤‚Æ.%ãñkU*ËD€Ì|áÈùóW)@k¥¼y¯Ö=]MpÈü©¹Q¯‡ƒ#ÿßü…lR””¥¥)@)JP3¿Þ9ûEÿñn*VSú;é̬÷WouoqsÉšK[Ù¢ çâá¸rߨú|“½ÓêU·‘lU®o¢½Žc5ªXF²JíÁøee ©4Y´ ²í†ë¦0öÈ×E‘†àï’Bm¤QçÆ˜Û)>5ôÿÍaRœÜÔ ìtaNmÛÿYÉâz#uz–ÝHö’b1åV {eâ—ìº*ò'ÁQ|ßX}!Aê-úg±îïë|½‹+u‘þÏ\ûÞÑèøø×´||ï‡ÀoÆ×¸¯¾Óåÿwkø÷÷Ú|¿îí¯¥OIÒd¥RKgÏ>Ó›GÑ4}8(Ú*íì¿oèå“ú3D÷K¼UÖ1¥KY$ðÔÓ?.SKé%˜€‡—+ù~™÷¯¿ÿ­ö½íŠ\wö|»\{þ¿ˆåý¿ÃÇÍøùñµî+ï´ùÝÚþ=Å}öŸ/û»_À®wB£íFøcļún:"Ún«|Ð\sn"¹‘çÇ$·*ñª*ˆ¦c¤MF¾8 rIzyÅâ1HŠ÷(d,YxŸ v8ž\NÎü5çbw¸¯¾Óåÿwkø¥ˆ±¾Êá,2?(òñ{]¼söøZ·J[ì 뇣Ô{Ú'µñ/>…,­•åäP5…÷²\ÛËÝFt2Dþ–R² e.ºb@ä4ʧδb]t®Fþ+»‹¬µ©ÊNöe&ŠÅ–[iÌÈ fRÄ–góÐ$Ö÷÷Ú|¿îížâ¾ûO—ýݯàQhõj# x—ŸCVã¦{þñþ·ÇÛr¶¹ì÷óìþû?ÇÆ¹ü¼­úg±îïë|½‹+u‘þÏ\ûÞÑèøø×´||ï‡ÀoÆ×¸¯¾Óåÿwkø÷÷Ú|¿îíŸOS40ljyô9n”°¼‹¨q«»ãeŠÅMXîlM¿`sƒ¶¥ŽÄòò’61úAyÝWKsÍûBûÿ*Zü÷÷Ú|¿îí·±XÔÄØ Džiÿ)$­,Üy3;³±<@?+jTåÛ ÒwÚ³ï7iJVæ"”¥¥)@*7H~e`g[ÿ jÍFé̬ìëá­ ã~+Ô³JR†b”¥¥)@)JP R””¥¥)@)JP R”koÏ\§ìë?â\ÕšçÚòÚë2÷7—0Û[¦:Ë”³8E]ËrÉð<+?Êk)üc¡»É±þÌÙÀÍŸ_›Qxó¿_ÄññCyÂRwK±f•Úú‚çÌ«KXßÀk˲eèäÑÆ¬­¯ˆO#^TŸtå.¼ßç¦úZ+Ý~KsärW_ÖˆÙÕÛ{_ßáZi¢·‚Iç‘"Š5.ò;UP6I'à©?*ðÿ+{íúùÞî‰îø}\»A¸ïη­èëàkî™ÃEFΔYk5õôV+º¼’;pŠÀ/+HU^t Ù $H˱–Ù%¸¼d’þá‹M"’B®ÉHÔzPgl@,Ô Ž_=ŒÖ61X@ÈŒòHíÎY¤ ¼®@˜yÐ@Vú[h;J’d§V±8%yóß_ÔXÿ˜lÊ ç&kü&C#•¹¶Kø&Q¹`‘!{x“‘Te‘‚]»9ì—× hL)]ïþŒÕŒV(‘ä‘òv/,Ò^W7P‚ÌF¼è Ñ×-šÍØdl"·‚gK‘bæÞâ'‚^×çÛp®Î¹k[ñ½ŠêhME%‹}ß¡©)icjžfŸ#kÛ_ú»r¬Ïçà5Nùhy . °áq$¢^Žÿj'”/.ÅÚȾÍ7 Ž^®*ÛÞøÄ”19©¢¼*I"D¶Í>BY$`¨±GDÛ?AÜè|øÐo>?õWO^÷¬ã¸÷šÿ,–V²^'ØÓ˜Õ”oMàý4†4¢â®·ùû/ÙOïLE­é‹²óFHylÄÿŒøU¶§À ƒàVíqý×øùî±YKkˆV{›Oh‘ž5*¾ ×ör;9<Î@ðIì(eZ in#YÿÀ;Ù»}0ÙÌø_BÂçþÁéð­êÑ’Í|M WIñ¤±H¥7PÊÊFˆ üA34¸ù×}#¹fc¸v'¼›,#$ùî"øòIu^{'˜Qýííù´­JR†b”¥¥+›¼9 §U]âàËÝã`³²·¸ i,Ò´¯2ÝØÜhW\@ùͽøÐ%I›¦ñ¯<—Ñ=…ÔŒ]ç±s ;“¾NÓ!gNy><ýtÖJlÏJâ2— Ï{e Ä‹!C: l“­Ÿ¬ÔûÅê¿–6¾Éqh0<52µ˜fÙÑùÝàIr OS ´e(îfßc¨,¼Aui“àðy~¾M$jÊÚø#_yØõ>RÛ[ÿzZÝ⾞w‘ŽÐAi´k³à`w¯FìÒ…±§÷.[=¼ˆfŠâç‚D–):HŒYHØ ˆ"¾êLÝ7y丶‰ì.¤bï=‹˜YÜòp¾™;:pÃÉñäïã±Ô^ º´ÉÇð x ¼¿_&’5em|¯‚<ìzƒ _ÚùüèY¥FùKmoýékwŠúyÞF;@}¦BѮπÞ¼y­ Ñ\AðH’Å"‡Iƒ+)ñP¬¡(ïGÝ)J¥()JJR€R” ¥i_å-±Ý´•ùÜͱoj„g#[¤ëcgÀQ刚“nÈݨÞòŸ3èÂË ³>™2Já€úÄ#Ed#àXž*HùåYÝ×9^\öí”ÇÆÄxú§emIãâƒÑê`{šV«4/þaÞü½ÿž&•†.ÛÜx“ÌÚ7N–r7¢ìÞ¶t<­ÚŸïÜ?¾=Ñï[yþ…í Þù¼¾fù|ß?‡š¡B¶îÅ+ž¸{u–3:"»ÆrUbB’> ¬úxŸª²PJR€TnüÊÀþηþÕšÒ™XÙÖÿÃZ/ÆüW©ñ˜É{æL^#iu<ñÜN×wn¡diñŽBÇq>ö½:ÞΨbrPæpÖ9Ku‘`½·Žâ5Á]CtHÞÖj=àÈbúªï)"ï%啽¸[I!V‰¢y˜–îȃDLºâOÍmëÆö0×x.•Çâæµ’â|v2Ë@ÉÆy8”‘S½ òÁG­|üt35ï:®KN±µéñ…»”Nœ½©g€(Þµé2Ö„ÇÈ {/Å\+ÒR””¥¥)@)JP R”£t‡æVöu¿ðÖ¬ÔnüÊÀþηþÐÑ~7â½K4¥(f)JP R””¥¥)@)JP R””¥¥)@j¾6Æ\„y ,­Þö%áËD¦D_>k`y?÷?]mR”%¶÷œ½Õ Íu•õ…ÝÍòZÚcíf…-/f¶ÓÉ%ÀrLL¥¶"O½hë[;¡Òw×>ÁßÞIܺºÇÛÍ3ñ“´jXèx$ü)À›¼‰¿´Êßc.ž%†g´·u±@D±¸K¿ÍÖùïC[Ø”±Ç-…Ìö¶±Z%­²'öp€€Ê]I-¢¿?ôˆ%Þas“u®J íÜX¸ÓŒ–jñmèŸI„’7-Ëò¯Å“:JR€R” ¥()JJR€R” ¥O¾Éµ¼ëiij÷—¬¼»HÁV5$€ò1ù«±¯±ÓqVât%EÉÙ¯²Øè[–p¸"GHîÚ'JŠ 1Ð'À:Ÿ€5§ ÞBxîrœa$ 7Áô´¬ Ã@€4ªÇüeUÆkc[Î×wwOyzËǺêcRA)š»òK/&n#T(^ê;#Ï ¬7wpXÛ=ÅÃð5³¢I$è’I 6I “Yª5Ÿü±’—û·Ó5œ'ÿ‹ô¬Î?ìQ> Þ­ÄF7Ú÷¬-'’öL­êvî$ŒE¹!½ž=“­ùØè¿”®š)B%,Nâ£u/õ‹+|_ë;…µ}ü Z/*“ñ¢Içl>f£Z]꜅Éò–¥”`ø*îYH×Ä6ãÏQ´Å…©ìx²ÛÓ̧qgmyÚö›hgìÈ%‹º¸8ø2ïàGÐGšÍJP¥Í[œmìöóÝÙ[Ï-³s‚IbVh›`íI“°>P­ —õ~¦ÁÝ|î÷~ÇÃ\ÐMËåìú×þ½ïÆšÕ?’Á½øðqòGzX|à‘°iŸ­£'Ð" šRmÉGõÌuõKhs é|t‚YÿÉÉ`Úò@M¿ñhÐèèf•§?©Ù6üI‹ãn›ø¼ü“ÿž×JN€æ’àPºÏýþ–k ݤÖÏopœã}ll‚;ä@ @#DVjP¢vÚ‰˜ë¹Òælmóò¹‹Õ ¬›˜t¿”Ðñ°Oé´¡ÔU:Õ¾±ŠþGgŽDnqMâp ¤ïΉ ‚ H8lo¥iÚÆùR;ä^^€BN€ÜMïÆÈvJ’Ø*Ì.Ö/ôŠ¥(f*þ%ï™2˜Œ¥¬óÛÇo:Ýٵ•¤d+ÆHÊÊûÙ;ôëZ;¹J^?6# .Âæ1¥”v¶Ѩ¿†÷ìrV9H|}í½ÜJÜ –ò¬Š@ë`Ÿ:#þô!Ó’WkaµJR…+Vû!mŽe¹g›‚$q´Ží¢t¨ ³|  øZÁs™õeâìZ™cäó霮ƒxô˜Ç$ùÛ/µâ.¡²ïböŸ+èÀöd„ÿüJ@$·øª`Ò€ðBW«’”;–È1ýÇWšk‰uݸžBï&·ôül±  (,tëv”{-ˆR”¡CÏÿþHÿû¯ÿûUè?ÜX|{ßÝV>óý7ÙÓ½óxüýrù¾>?°¶iÛãiö¥yãÔ`p‘ùrqõ1æû?ɾ³@sø›{/é¨ ¼|Z|}”Ò±bÌîe»òIòtQõ*ªê+‚¸{…Š1;¢£ÈreRJ‚~$Ì@ú9®²P R”£t‡æVöu¿ð֬ןdo3?ÐÄâbƒÑÓÅä®Þ Õ¸!£ ɇ“ä¯<ùØ/ÆüW©è5Ž áº·ŠâÞXæ‚T‘°eu#`‚<G×/=çQÝfqø¹^Ó<¶÷7a­$öµ~Ó@¨¯Î4< ™¹*…oJé×f¸û,îvÓ¥qb’ì¦;¥ìo…­Rì’ \´ì‹ò#Ìd ìüÝ Ï\¥pw9Üœ}A™dËÆbÇf,,Ó"û+‘l¬ÒŸ­É!Mqõ+l¸ôª.¥¼^·ÇÚ-ÝÜö™ Û«UGo¿RRÝ¥ íÑãTf}¡%ˆ2hò•æý/ïl†s£²ù<Ü÷3ÞtýÅÌ‘$GåìžòóÈ1<¼²úx©)Y0I”·é¸®zŠ@ùœ9È\Kœ!¡( Їj@-ÞÛ—ÀG± =•å÷=_ÔwØëkÛ(§Y#éû\³‹Sk·vQ)"á®0„v‡öd0öÛã«YlÌ9ŒµÐÉS²ÍÙXEeØN,“­ª¿7×#®û2è®›|‹®”ÜR¼ï2¶#Ù³É]Ï<ùÛôb¦ÙnEÅÆÄÕb.Y9°aóL¼u¥°éëÆ¾ÂC4—O"¼Èòı¸tvFW JóR¥X¯¥ˆ%@RR”¥¨Ý!ù•ýoü5­Ì¥ÿ»¬šT‹¿rûKkpÚ3Ë¢UÑÖôv~ c  ¦"ÃÝXK ww»ì–ñÁÜãÇŸ ½lëzøPÓu7Þú›´¥(f)JP R””¥¥)@)JP R””¥¥)@iäòPâ­Râu‘‘î ·'”²¬J|‘ã“‚Ë…G¼êÛL_U]âòGÙ[ÜÆË³o2ÈïÇabQmÈ ¼½MäVN¥èì?S¬O{±’ê9`aq5¢Jý¸åY=Ÿï_­ÃÔØûkU’{™.]î."D³±šG=©Yòhô„g×H>9(¨pt]äñâ%¿x#¸ƒ!usrL]rÝ‹µTb€³ "I =Ϥ©'él‚㢎(-.'KÛé½9 ‹ =Ãʺž[Z*2ºbïÐ9rëªpÖ}ƒ%ç8æ‰gAÍDß6YXã:$;¤+éN²MÔ8Ë| ÇI<‚~k8‚CnÚâ(^ç’éY<ÓCÔ»åó=É\,“ÜG‘{œd8ûÉd½¸²RPÉÊS  ƒwXöÙ: ê$l]tuÄÝYqÆ9m.¯m#s‰¢X€_fB#”î!Ù†‹ «€è!êeÆP㣞C?6\Á ŠG]òD”¯qŶªÄޱémT®^Ï“µê†»ŒÁmbe’I s2Ü+†< «~N&äÁÚTbÌÈN‡q€ê()JJR€R¾&š+x$žy(£Rï#°UUd’~ “Ú¹Îø»ƒÙñ'ÈÉîÝ J¤ ôðÙ, ÇÔŒ-ßkÜ}Í}sžK%ÿŽÞÍh}X˜=3ø]K²"è]@l1J4¼§.¦¿Hr³ÜÏàE*ÎŒlÝOwòjÃÎÀGµ¹ž†óòŸ±šÊ·º°‰”ƒÑ<®Ï´îFÖ¶¿‘_ÈCäþOá¯H¥æ÷Y'^¯ËD™kïyE›²ŠÊǼÂ3Gkíá.‘¤f—liÀBÜ›V‘%¤9Œœ˜ì+ÞæšIÅóÙ©¸äD¦Ue;*Óœ´tNG Yca±ºÈÜDÒ¿¸†#A„QÅ¥ñðãŸ;òOþÃr€ó¹§ê7ÅôúÍ-Ú]çñ–öW…›´ö÷—‘ãQ®Ü½—»ru­ÁÖÀVÇ‘Èdÿü Ol/`‚dÈZ¥œräæIÔ¬&^j…&RLãºß4ò$¨ˆÜ\bRï1ižæw[M´Þ‘JUËáyàìº-ÇG|w£T(7Âd2wsÚšö¸ ´¹·99¤˜Ú©”C»>¸Bìr|“.›s¢¯Ì¹™­›!%üþÎÍs4WòN¦@Ê7<(6R’X¬)ãĀɮ»ÊP R””¥©÷Ø“T)BTœ]Ó#{§)kæÃ=1Ò±_À·‹ôW„„“;xÞöNÃÚúÿ!î«Hfo>ÑífX~*ìàùáÅTþ >*Í(_Y}é?Þ¤ûE½œítî÷wì¼öáTÊScѵ*ø•oζI4)Jrrwg'eÖö×Uq‹¹%€[Û4,Ø‹´nä*·>QéSHšf|ï'GR׬®#g›»²žßò~÷)C8“¿6Μñã2©m¯•ô¶ÚîÆÞ<Œ×뮦Š8d~GÔˆ\¨×ÃÁ‘ÿïþB¹û~…°ò3Þß]Ø.>ld634b8m¤à‘Câ4PY˜è|vwB öÿÒ"Mc}$VÖ9 «IlÐLjÉ-Ìn.fì¨2 • qõzõ]ž&þk›;{» µµº3äDv‘$ gd Ĭˆ¿Ùï›k\}u5Ów8'´9–Ny¯l™äšt…’îcváÚª¡Û’€çÀÙÒ¹òNe×¼o½áí~Ûï/Éw»Ý®Ï.<;_Ù~O\5¯:åê 'Úõ­ÆUqI‡ÅÁy5üWoÜ7Á`Co*D縖‹,ªIôí@bW_ Õ9ÛŒKDq^år¸¦½’V»D¼;>§"=ŽBPtªx¶—Evâæ'¥lpÓZKm5Û›T»DïËÜ$\L³?&>¦!IÞ·½Ÿ4Ãô½¶1+ÝÝÁÅÙIcNSf'hÎ›Š€JˆP5ã{Ù; %Ûõâ6;Þ—x¹íì&ÅM—´ü¢¼ÒABüÐzQu €í°O.jµíÿ¤DšÆúH­¬rV’Ù¡’[˜Ü\ÍÙP$e@$1*@ãêõ6£±cca/~k[LT˜€ŽúîA ˆ7" Z…||Oùk é¡-«C–É_¹¸·œK;F¥{2¬¨¡Qä¾ODáx~¥ÍK˜ÃÙEgi‹˜k’ ¢èG²4ê#cØqem‡’qò¬Xv•n—¶—"/ÒîîÆMr[B„âܦ™O Æ<ý;$‚Ð^;«½À…{ŒÊ…–ÖÉ Ì ýˆøÜ¥¦¸œj½“®>Ð=‚³a îÝJ…"?€T¡¯U’ ;gìZA³D`ƒ„a{Qž;E×Í_Bø=#ê±J|¸,<ÞÃÝÅXÉîý{+t>Í­k·ãÑ®+ð×ÍUl5…›÷9Z@ÝÙRy7<äN<\ýl8&Äq_¨VÅ( ï‚ÃÉgug&*Åínå3ÜÂÖèRi »®´Í°ÏŸ· ‚­íâŽ"@‘Ç…TP4ÀxÕd¥¯‰¦ŠÞ 'žDŠ(Ô»ÈìU@Ù$Ÿ€¾ê4ŸñÌ‹AñÆÙȎοü{„}ðßÕ*“¯‹zv8:‘hÆû÷xØe½»÷ÅÜoœd†ÖR¦8KÉóÉø#Àq. Zµ)A)bb”¥ ŠR””¥¥)@)JP R””¥¥)@)JP R””¥¥)@)JP R””¥­+ü¥¶;¶’¿;™¶-íPƒ,äka‘½llø <±Xnòn×/Ç'vôh;´la·ØÞ݆ D`ò<—æ©.3Xc’ǹ#O5ÕÔºîÜÏÇ›¾#Ò€6tdŸ‹FŠ)m—#ZT·sÇwšö{™b`öð"³oa‡/Ÿ >;„Ò©¶åZ”¡YIËx¥+K#ì1±ÅÞº¹“³o.!ß‹7–Ñâ«1>N”è D$Û²>/¯¥YÖÆÅRKç^^°J@„‘Ü}kÆÁv @Ð Ë›c7œ,î±.Œ’^Fø³±c¶'é$Ÿ¦¾,,=“¹4Ò÷ïgÑžr¼ykzU »…–R5ñM¸óämñk53§­'³ÁÛ%ÒvîååqsÁ 4¬d‘F¾€ÎÀy>ò~5N…ê?õe¹lùã¼R”¡˜¥)@Foêýk>ÛŽ~æþŽÄ‹Ã_ûûCïãð]kÎìÔn¡üº¯¾>Ë‘‡ÑÿWwvÿ£]î_çÇ^7±f†“Û¿›=¬F²ÿ‡õ%å€ôÛÝÇí¶ëÿ¬3…˜ŸÏ’Ò¹Ùó«5©¿«c£Ë'!½+ÿReké=·“9qÙÖêÍö¥/›>!JR†b¦dí'Y#MÞÅÅ]Ú! ¶Œï@ $1ø…g(Z2Âîa´»‚úÙ.-ßœo½AD|‚ ƒ¢ èŠÍRr0ËŽyòÖ1¼ŒÕ¤jI¹UÿŠÐÿ¨§ü,”áš+ˆ#ž X¤Pé"0ee#`‚> Š(ö­ÇÝ)J¥()JJR€R” ¥()JJR€R” ¥()JJR€R” ¥(Fé̬ìëá­Y¨Ý!ù•ýoü5¡¢üoÅz–iJPÌR” ¥()JJV–RÿÝÖM*Eß¹}¥µ¸måÑ*€èëz;?±ÐД›vFÜïs6ÅøÜËêšU´:oÊhøÙ#Šƒô’Ú`Œ+vÎÒ (,í“·ooÅlž*£@lù>ÓX1ÖÃÍ$½ë«™;×ñâøªø]ž *ªäéFÉ;'v…¤×Ú· R”()JP R””¥¥)@)JP R””¥¥)@)JP R””¥¥)@)JP R°ÝÝÁcl÷Â4ÖΉ$“ I$€Ù$€6M Jûš£{]ÞoÓŽy¬ì~>ðP„Ì>ŽÈnC[ø».ˆ×Áƒ«Ø.s>¬¼]‹Aó,cœž`ý3•Ðo“äŸ;eö¼lоÈw¿/s ¥¤6Éonœ#Mèl’I;$“ä’I$’I'dÖjR…¾Ö)Jøšh­à’yäH¢K¼ŽÁUT ’Iø(Añww³Ü\?Ó[:$’N€y$’d’Ù5¥‹´¸ä²)Ç#4`¶µS¢bR< roñ€WâÎrz\Æé(Vò© Ÿ84¬¿áf©Tš]ÔV¡£ÿ+ ßóg_—R”¡˜¥)@*7PZö Hóí· ÞΠò’r_¥ŠÄwãòÃ{Þšiýwªr'ÊXF–Qƒà«¸Ye#_TÛ>AFÐSØÜ²ø¼Ë4¥(f)JP R”ü匹,õ»"\Ë $r@Ž]mcÈ*ÜXäò+66ú,¦.Ó!ºÅu NÀ ”0Þ·çF¶ª7LþC.8ú[q%¨ãÛˆP®þŸÈ´^|Ÿ>|m7Üÿ¿f£tïõKi°ïé|t†(×ÿÉÉ&»ò@M'#ñhÜlè“f£_ÿÃú‚Ç ¾#¼ÕÉ>ùÏ ~nHŽFq䢂SÍŸf”¥ Å)JRf†\Dò]ÚFòÙHÅîmcRÌŒṈñ$ùd;Ë/¯bJÔ¡hÊÇÄ3EqsÁ"KŠ$F ¬¤lGÄ_uÿôzId>q2ÈòÈßM£»f'錱$ŸŠOÌþÎÍ£m«p¥)B¢”¥¥)@)JP R””¥¥)@)JP R””¥¥)@)JP R”£t‡æVöu¿ðÖ¬ÔnüÊÀþηþÐÑ~7â½K4¥(f)JP R””¥ñ4Ñ[Á$óÈ‘E—y‚ª¨$“ðTÌd2ßOjò7†W„¥µ»©V·‰Ê±>™ªúˆQðf?ÕaޏÿÜ\ΣþÅ·þýÄÿoÕf†ü+v¿Ÿ9f)JPÌR” ¥()JJR€R” ¥()JJR€R” ¥()JJR€R” ¥I›'-ôòYáe·ybb·.¦H­Ø(B°å&ÿÂâ<±•qhÅÈÍ}•ŠÚu²ƒ…ÆJEå pŽÈæÿ‚Û_äbüZbùܦG$Í‘]öÈ–Ô¢‘6<ShútªìØØÅa"3É#·9f‚ò¹b5ç@ ªrKdE)JŠR”£'ü~æÞáºíäÄ~>Öà-¯‡mIä§â̆•T¿ÝÔÒä²âíäx`…TÝÜFÄ7«dDŒ>khÇÃ*²ñòá–œ0ÅopAEj#E ª hÀCO±_´ÖÉI’ŠÝ[iis?0.®Z £ä2ÆäëÆ¾“çÇž ”ê›®–訥¹‚ɲ=ˆšõ&7sO²šFfF¡$Ú#·¾<€!½"±É3 ³hk~øV–VZ뇶Š8Ò{³{2Æ¡HHœJÎ>™ÌA¾$÷ýl.ÐÑì‚Yíùæ)JPÌR” ¥(F²þ«Õ9[o‚]Ç êø»èÅ _¬*Ç ?H2y> *ÍFÊ~C¨°W+åå’k&áÁâ2’?Ï•º«E¼|SÛušþmô,Ö–^ÃÞ˜‹«!/e挬sqÙ‰þ+ ò<«i‡AÈ­ÚP¢m;£Kï Q ¡¤ÊÄÿ_>M¨aŠÞà‚4Š(Ô"FŠU@Ѐ¾éJŠR””¥¥)@)JP R””¥¥)@)JP R””¥¥)@)JP R”¾&š+x$žy(£Rï#°UUd’~ Á}}„ î¯$ŽÜ"†0 ÊäA×vHI4áÇËž;좺”`ðYwtv €2I°ª8ùØ]Ge司åsó—váàžÙ†{ƒô0å|Fô®O•*/Zb·‚8 "Š5‘¢…UP4௺P‰JûáJR…E)JS27s½Ì8Ûãs/ªiT6Ðé¿)£ãdŽ*ÒKi‚0¬×÷þÉÛ†»÷³ìAn<µ­³(»ml RÅØ{ºÉby{÷/§¹¸+£<ºœoCCà  EaXŸëçÏéžÒÒ d··N¦ô6I$’IòI$’NÉ$“²kÎXYåúËŽÉZA{bq÷³›k˜Ä‘™KeWâÛ€wü@fúÍu?'…²ËöÒβE°“[\Éo"ƒ­¯8Ù[‰Ò’»Ñ*¤¡Fﵓú3ÓÓïñ9 è"AðŽ4»•} ªª ZýqkÞÇã® Äê°el…Š;È-¯-¡Ë@ž>­HR·,ñv˜ô-RHÒuUî¹ Íƒ3>Ï­Ë —m¶Ëú›iqv“ØAe2I,<.É]›”N®„±<˜†E;$ï^w³B ÊR””­\•ôX¼]ÞBuvŠÖÂXª©c­ëÎ… I·dhc¿®õO |ÇΟ\¬§èÛ0Fé€lìilÔüŒ¸ì5µµÃ#]/rèO™Éi|<f:ÐÖüðª-Q§-›…)J¥()JQº¯ÑÓ7w_bá}Çþ¾Ã¬Üwôrá­ùÖ÷£ð«5ñ41\A$Æ’Å"”xÝC+) ƒñP´%†JYt©=34²ôåš\HòÜÛ©µžGbÆIbc¶Ï’ #O’ÞŠ­A(ᓎDž¡†SŽöÞ7’æÂdºcRÎʾ$U_ñ3DÒ(éað:"œ3EqsÁ"KŠ$F ¬¤lGÄ_u§¿ªGu†>6Aø&ܨhˆ(&.[<ŒLw½€-÷CÃùÿ¿Óöûª18ëÉ-®&œ4Zïˤ²CÀ?••T¤zRóa¥!ެW›õ ý®7úAÅ\]ÁK'Üö 9$ 5ß+c^Ò/·VAIJ‘ñè fÎWp/jT‚MÈ ?Si¡ñ<—ë3'Ûõ_OÝg$Â[æ¬eÉÇá­Ru/±Ëjü°àÛQåu²ÆìVœx»H²“d‘$s' Êä2hq'ZØðYÈÑwå¹@)JPní ¾¶{{„çëcdAØ ‚h‚"´­.çµ¹LvEùÈûök­. àH$ À]Ê”ëVúÆ+øž9¹Å4d‰À 2“¿:$h‚$A ‹Å¯µî6©Sìo¥iÚÆùR;ä^^€BN€ÜMïÆÈvJ’Ø*ÍB…ZiÙŠR” R” ¥()JJR€R” ¥()JJR€çúbû)wsž‹-$ 5®Ab _DHm “€'ËèÈÞ¢þ:Q¥'3-¼­orN˜ÒG(¬Úð HútuõŸmŠšÊ\Üö÷1÷ò7â3$E–EÆâåñ_޼|j€{C³I€¢„@„0mžD¶ôAt45£äïÀúJòúûÒä®#¸»KÛÈHâí©ÜËévt8¨I><’|›•? Œ÷EŒ–Ýîï;»›ž\xë½3ËÇ[?zßÓ­øøU QºCó+û:ßøkVj7H~e`g[ÿ hh¿ñ^¥šR”3¥(a¼»‚ÂÊ{Ë—íÛÛÆÒÊú'ЍÙ:OôVjüs"³üq¶r:*7ÿá\õõFÊÀoâÞ­Ä^1¾×¸ÍŽ´îfÉ_'™}0ÄÄ1¶‡Kù=$rb>’lMS¥(D¥‰ÜR”¡QJR€R” ¥()JJR€R” ¥()JJR€R” #å²×–¹Ln6Ê «ë˜¥¸æäÁÇ[Ô¨ç–åM:×/#@Œ.OÞøÁtaìȲËo,a¹’)7âÚ^HÚ$F‰øó1^Ûu73kŽŸ!—6¯³Æ²+ÂÁ¿(è¼GeõolºlŒ5mwÇ-½Õ¬ˆ÷—Œy!÷nUô~4xò]£z¾i`2góÞã[-YOr×Wp[’ƒIÉ*D]˜øðd](Û7Ð4–ÅCÏ[]å°V‹ ¬‰9½°¸x$d ¥ÌR8$»UVø½xߊ¹@*}öFX§[;êù—Ÿmä1¤i³êw¸‚Ah– èiX®·¼§Ìú0²ÂlϦL’¸`>±ÑYø'Š’>yVA¿cŽ´ÆÀÐÙÛ¤JÍÍÈòÒ9v>YŽ†Ø’OÒhi…Cîß—S Ž-m§kˉžæý׋ÌäñPH%cBH|/äñRňÝP¥(QÉÉÝŠR” R” «}}„ î¯$ŽÜ"†0 ÊäA×vHI3Í4VðI<ò$QF¥ÞG`ªªÉ$ü3 ¹ƒ-}ÆÅyÚÚH¤eañ`ø¤úA*?ÄÎ/¾ç¸ÍŒ±–Ýî.îÙöíƒKÀ’±¨XП%WÉó­³;iyhP¥(VMÉÝŠR” R” ¥(FÍÿ[½Åb×Ïzà]K¯b€‡äÃû^‘äç_X³Q±ß×zƒ'>cƒŒçO®VSôm˜#ôÀ6v4£J{/,‹4¥(f)JP R””¥¥)@FÂÿUÉæ1ÇÒ©p. ã¨¦‹oüæ‘þCY¨ÒÿTë$ø%ý“Dìßp·(ÕOÖVY‰Iìk‰ÝšTÚÓÍ|ó'ýC7Ê|!“úμhËÚcô¶¤ô¯ö;Ù­\ŒY,|ös3¢ÊºF@xÛ⮤üN˜ €~Š”¶î6©SðwÒäpÖ×7 ‹tT¥Ê wÐ¥jØßE:+Ç"7 añ8•`7çD‚AH ™=wÿÕçRþʺþP«M;2†3;‡Í÷}Ó•±¿ìë¹ì— / ï[âN·£ñúP®~óÿ¬<7ì«ÿâÚUÉá[›y`s I£äd`׆R ŸóôP ðÜ¡x%ŽTÈY0 ¬U‡¤0  ‚+%s} 6½7%½¼QÃY<‚GjQEäÀ€ñªé()JJR€R” ¥(oªú®>œŠX.äžK‹e%1óÍnIÒ7õ¢•çĶ—{'ƒ°õ=Íåéƒ ‰’èCn—7 vÏg/yDqÈ›g&<9Œ|ÏV˜‘röÆß!Ãur5–9€äFž7Yøú™Tÿž¼ø©ùŸK쉽!}e$±,"ÑÕ}¢%,UK,šîIꌣzÏ…Ðw]Q5¾Râ5°ñö—¶øû™ÍÁ‰¦ípá?/Éu#×¥:´Ó¬²2Ê‚,(î28ËV7Š ³ÄÒŽl8úaã ’Û. FÃLÕ.:^Úç(÷fîí šâ+¹ì”§jiãáÛ‘‰RàŽÔ^‚ž`í¹d‡¦ìàö.2N}!ql<É7{>>hヌÇÂù>vµêëë¹±ö˜ü4s^]%àKyÛŠµ™!“oÀ±BÌÜX.ϧj%5òßÒ¶3 ̘­#ÇÝÙ-ðöëô·žD*¤1黲…#jJ²ÇgŽKŽ‘•søç±¼¾µ‚²2µÜ2§8游Š^>[Èñ­|f:Vêܶ^\²ÆñGmsyYû’Žé]E¸òCʆPh‚£t‡æVöu¿ðÖ¬ÔnüÊÀþηþÐÑ~7â½K4¥(f)JŸ•¾–ÚÅ’¤™)Õ…¬N ^@|÷×Â5$?æÛ2‚&)ÉÙo¦—!x¸Ë9cFþ¿4lTÆ…I«„ŒJü<ªv¤¡4á†+x#‚Ò(£P‰(UU@> Ácc„ ˆÏ$ŽÜåšB ÊäYˆ×46¨ZMn[…)J¥()JJR€R” ¥()JJR€R” ¥()JJW/žëpÙ¬e‡³_?zìÅpÉŒ¹”pìI í²!WnJ› ËC–ÀÑ ¢•ÉŽ²™¯îBâ$ÛkÛk9.¤”Ç!k„„ÇÆ^@†C‡ãÄyŽÕQõuõÊj 4bIòsãl»÷œRg…§æìU¢q€ëÁ%‰]زµr8ûl®>{Åw¶xH©#!eúFÔƒ£ð>|ƒà×3aÔ™L—Uâ-ã¶‚+ m/ÅÚöÂ{yã…ŠþOÔ¡¶íy,„¥@:xÏéCoutÂÒH"ÆK•D±½[‰Ò–Y“J"—Nº^L6rvD¦Óº:?’øÿÒ2ÿ{Ýþ%>KãÿHËýïwø•"ë­n1K•LÆ. 9¬"´~ྠ›‰^$= ¬jTrfPG«JB‚Õ:_¨áê[+™¢6Œö·ÞW²º3pGÜriy2(;Q¦ <ëd_]S‰ó>þKãÿHËýïwø”ù/ý#/÷½ßâUšPkªq>do’øÿÒ2ÿ{Ýþ%>KãÿHËýïwø•f”êœO™ä¾?ôŒ¿Þ÷‰O’øÿÒ2ÿ{Ýþ%Y¥º§æI‡¦ñÐÏ¥¯¦1°uKœ„ó' v Gr¤ƒ¢6<òV¥(VR”¾çqJR…E)JJR€R” 5rWÑbñwy ÕÚ+X^wbª¥Ž·¯:‡c.; mmpÈ×AKܺÅærZFÙŽ´5¿|+[3ýw#ŒÄI=¶VÿÑnèÀ)úÌÄk? ê¬ÐÑì‚Yíùæ)JPÌR” ¥()JJR€Ô?‘÷U÷ÇÙr0ú?êîîßãôk½ËüøëÆö,Ôü팹NžÉãàdYn­% ’3!Q½oÆÍfÆßE”ÅÚd WX®¡IÐ8‚²†ÖüèÐÑí‚y|êmR”¡™&ã¦ñדݖ¾Š[†/³ä'…Y‚…Š8âª>E||—Çþ‘—ûÞïñ*Í(i­©»æFù/ý#/÷½ßâSä¾?ôŒ¿Þ÷‰ViA®©Äù‘¾KãÿHËýïwø”ù/ý#/÷½ßâUšPkªq>do’øÿÒ2ÿ{Ýþ%>KãÿHËýïwø•f”êœO™ä¾?ôŒ¿Þ÷‰O’øÿÒ2ÿ{Ýþ%Y­{缎ÎF°‚ G<Æ$o#{`¬Gÿ„ý^>4êœO™©a€°ÆÞÉynnÚâHÄNóÞÍ6Ô@Ó¹ :ú¶~³TëÍís=X½-<Ì,m¤lÛ[Gtnžé”¶O´c1´i¸Â³(!Áâ« ¤úwG9cqzϘ’æ fbÏ©-¼A®VàÛói™T ¨¸<;b=p¹î…e''y;EŸM`qö÷VöXLm´iÂæ8mQeÑp˜iˆÑúÏ×T­ÃÜ,Q‰Ý@£“*’Tñ bÑÈýuÃÅÔ·‹ÖøûE»»žÓ!{uj¢Híã·ã J[´¡½ º…ÚÒ™XÙÖÿÃZÇîŒÚŒ·î­°ÙôíÕ…”vÝK–ŽÞÞ5Š$íÚž*£@lóà}4ú˜PŽK³>þ㣥B÷FGíF[÷V¿Otd~Ôe¿ukøú˜Õ®%çЯww³Ü\?Ó[:$’N€y$’d’Ù5¥Œ´¤lŽA5{/%D$g„¶Ö1­€H \‚vÃâUP ÷;uwÚïõ.YÄR ULvºä>ŽÎŽ‘½è€~ ›ÝµoÝZþ>¦ðEFÊJÿ¾…ÚT/td~Ôe¿ukø÷FGíF[÷V¿O©MZâ^} ´®vÐ_ØõE­œÙ{»Ûyì®%d¸ŽÅ‘áƒj~7ÇuÑV±’’º+8a¶ÛŠR•b‚”¥¥)@)JP R””¥¥)@)JP R””¥­{‹{¹í&ž>rZJf€ò#ƒ”hÉññô»?_תإÉÛô«\ufúök¸í§ÉÁuºÊ¦+ý·aä©Yccé*[ˆ É@Aú^ÛØ#¶‚îîÞXog¾‚ê2†He•äg 2”#SHºe>Ö«” !Út½µî:î »±%’\«l¡&áÖIZOO‚dPþŽ qôÖºt”6¸k¼rÜ]ßÙµ“Ù[cî®PE ^= Ñ mh*ó~n –åÒR€áñ3uu–ºÊŒ¬>ך$—ó@×+5¼²H²ªÂZU/D£S²_¬ÆØ6>Ý£’úîöWrï=Ó)f:h(TPJ |IÙ$ÊP R””¥¥)@)JP R””¥¥)@)JÒËßû¯uz"ï<1–ŽZ2¿Ác–m(ðI$x4%&Ý‘§ˆþ·—ËdÿÀÒ-”$x òäHøìJó/ÐUÐúMšÒÄX{¯kdeï<1…’n:2¿Å¤>O–m±òI$ù5»BÕrvÜ)JP ¥)@)JP R””¥¨Ý7ù kÜqøØ^Ëæª1Æ«õŽX×^â@ð6j5·õ>­¾ƒæG}oÔkñç*Ü­þZ_fð>¯<¨i ±’ýüý\³JR†b”¥¥)@)JP R””¥Žh!¹@“Ũ\+¨`X2Ÿ?H`?AÖ6°³~ç+H»*O&㜉NjŸ­‡ÑøŽ+õ Ø¥¦18Õ¿{õÇÚ Çuw¸¯q™P¢’ÚÙ!Y” 1Y!°³·ö~Ť{4F8Fµã´]|Õô/ãÒ>¡[ #ÍÓ–áî,1vv8õ–!£³ŒÆÈ›¶ñ茗}¯>Š“Êµñ})gm‰¼±ÉAc{ì©,ð-˜KaÂ8ãEH˜· ~ >A#C@t 5á°³·ö~Ť{4F8Fµã´]|Õô/ãÒ>¡[¥¥)@)JP R”¡Ãùë“ýgüKš¹\µÎ_Šë[ÿxäm,û˜ëNÑ2ÇËR\o\ˆÞ¶?ïYWW¦Í©&ñ%—ª::To•Ý5ö‡þ¶?÷SåwM}¡Äÿ­ýÕçayª©Âùj'QO7wŽŽW†<•é¶žH˜¬‚1²Œ<©& ¼‡ñ*Úaõò»¦¾ÐâÖÇþêÔÈç:S%n±ÉÔxؤÄOôBH$€èI#z$h‚%X$QwÜ5U8_#,åúW4‘Í=í»Ë6\ÌÎé,²Ài˜³˺!™}Zä8¢éÉշј­%Ê6KݲCßä‘ͱ¸W2S^G«A´kúFK á¹êË;›¹Þ9þ[è;Üâ`ñÄ/ì•%›’Ú~‘‚[k‰:²ÎæîÓ|÷ß@yL æF@Ò…ù îÖÍ UNÈÝÇu]Åååœw¯g·¹º›²‹€äÜÂ$2q] ÅùrU‰ò`Ö<WÝå­ì¦Ÿöç!lœ1ܤ’H¨#ä­¾*¤™S‡¨ì·lŽ5оƒØ¸õ-ö<…ÆB=ßÃæI»ÜÿÒ;ﯧÂù>w¦mºRߥ¬-3=Gg<žèùmfÊDËn²"wãFSȆdn<@N+â§ Èjªp¾EX?¤$šÊöH­¬r6²Ù¡‘[˜Ü\MÚP$e@$1*@ãêõ4âêyq¾°Hdƒ%:ôÅ9’8ZHÕ¢d%Uœ3K |ÕÑr~jìÆDéõÅÅ×YÅyspö,Óä`Ù6ÓcÒ¨ £gD(¿œYŽ>¡ÉôùÂæàÆfl./s2óY=án«i7e#Žm–*£m¯' åAñ¦}ÃUS…ò; &Oß8ˆ2+jŽRAêåÎÇ·'Àkšq~$lrÑò*…Bƒ©ºRÖÞ+{|æ"@‘ÇÜJ¨ hÐ}“åwM}¡Äÿ­ýÕGÕTá|‹4¨ß+ºkí'ýlî§ÊîšûC‰ÿ[ûª0¼†ª§ ä}ÍùëŒýyüKj¹\µ¶_•ë[wdm/;xë¾~Ï2ÉÇr[ë|IÖôí]Mz4©¢*¦°§—«¥+SJR€R” ¥()JJR€R” ¥()JJR€R” ¥()JJR€R” ¥()JJƒÔˆg¸ÂZ™®"Š{öI}žw…™E¼Ì$ ë’©øýù5cúN_ï{¯Ä¬ªVŒ™ª„lœžþïrõ*É«Òrÿ{Ý~%>MXþ“—ûÞëñ+?ª†L`†o—¹z•äÕé9½î¿Ÿ&¬IËýïuø”ú¨dÆfù{—©P~MXþ“—ûÞëñ)òjÇôœ¿Þ÷_‰Oª†L`†o—¹z£eÿ­åñ8Ïð4{0>$ª2ðTâïwËÜèiP~MXþ“—ûÞëñ)òjÇôœ¿Þ÷_‰Oª†L¦fù{—©P~MXþ“—ûÞëñ)òjÇôœ¿Þ÷_‰Oª†L`†o—¹z•äÕé9½î¿Ÿ&¬IËýïuø”ú¨dÆfù{—©\&Íû·^ä[Ž/䝿‹nýîlÜr'ŠìŸwäÕé9½î¿­:ñ„°²ó¥K žßrõ*É«Òrÿ{Ý~%>MXþ“—ûÞëñ*¿U ™LÍò÷/R üš±ý'/÷½×âSäÕé9½î¿ŸU ˜Á ß/rõFËUÎaoÇ€d’ÊVoš‰*òA2E øõëD‘¬_&¬IËýïuø•ñ/Jc'@“K”‘C+€ùk¢) §ÌŸ@#ê Sê¡“/N.÷|½Î†•äÕé9½î¿Ÿ&¬IËýïuø”ú¨dÊ`†o—¹z•äÕé9½î¿Ÿ&¬IËýïuø”ú¨dÆfù{—©P~MXþ“—ûÞëñ)òjÇôœ¿Þ÷_‰Oª†L`†o—¹z•äÕé9½î¿Ÿ&¬IËýïuø”ú¨dÆfù{—©Pzm »Q5ıA~©´Nó2©·…ˆäärf?¦¯WD]ÕÊN8]…)J’¢”¥¥)@)JP R””¥¥)@)JP æîomñ½Kœ¿»“·mm‰¶šgâOWº,t<~ÒW/ÇC˜Îõ2á`¼Ã[ÛÈÑ+µÒ’6ÞÕYWünæ´÷KÃÕY.c® •ò²Fã(’•„Áá<§l]p)¿G×=zûœëØp½Eˆê+s>&ú;¨Â£  6ˆ_þL¬§Ê°ošþŽóVLs"î ´¨¥.!²³6×À[›nã;ñ o‰U÷鬇Vb//-Æã[qe‹‰“¶n„±IãiÀªkgйUÖ‹F¦*Îi[bñÊÛöö~ßaÃR½hé¥ mÅݹv+_ÏIµÎâ/±ód-2¶7Prï\Ãp|G&äÀèhNþ‹Ä>><‚ålZÊ^}»‘p†7â›M½r~ ­õ‰‘‚ÿ7ŽžápeqÅ”¡g–h¸X.bž†e@„äãÔí°ƒÔu{ËZänñ¸dÏŒ‹[Ü4lð"X›‹2òâ[[Sàƒ¯7 ;ª ¶:êâ+{|…¬ÓËn.£Ž9•™á'B@ÙBÅð¥–[’yÇ!ktñ¢;¬+•W^HN€Ëä¤yÌcúvîÑñN,’7N¢¿È]2”Ç"ݬr6¨•’ô4´u¤19 ΓÁ´{xàé¹m£[’¯mw%ÂÀêÅWÕÄöÏp2ƒ·v~:ñ¯<æG£¯Ÿoж‘%#§rùo%ô .fì~QÇ–Û²Èì}G{Ù$ù§·º“«3Yy°sâ㻵´‹òíy¤§äÇ´ïðWŒlø×ÀTYZàèãžžTŠTw…øJªÀ”n!´ßQâÊt~‚ÓS¨lãlËß˶.é-žây‚¡åR$è/™‚ëGùê©Ç#;Ê­ Æø«1]H8ƒÉtIÖÉtv§Æ´O!sˆÉÁš¹ÊÇb÷)t_$I’xŽ=mLäøb¾‘¿ÄR{ÁÑÜgq¶qÝÜela¶–.üsIpŠÔs NŠíÐoáë_¬VKܶ;ñ¥öBÖÕäGtYæT,¨¼œŸ!WÉ?@òk˜ÃtíÜY¼Eýå’egÛ”f¶’ææ9Q|ë확ØðÃdO+˜Å^ã:#es‚êo’–÷14ñ‘föé;l“äžÙ@ÛxÎÊʬ ›ÞG›ó×û:óø–Õr¡ÍùëŒýyüKj¹]´?-St|=X¥)[ R””¥¥)@)JP R””¥¥)@)JP R””¥¥)@)JP R””¥¥)@)JP3¿Þ9ûEÿñn+W®¿ú¾ê_ÙW_ÂjÉÕQÙÝôýÄ«+"d[b^Vóm8ð¨ Ð+ög’ÇÜØ]Ù夶¹‰¡™=Õv9#lG±°O¸´„õ‰%(E¥}ž¬“ì_%:{=œ‡¥zs{i–X{Î(\«‘D.Õ|wþZ÷ÕY¥¾ŸÊ‹{Œ-Â0‘i2X:Ö¢]xúOÿ*ÓçñWVòÛÜYd¦‚T)$ra®™]HÑ´AEH·‡¦-ÌÌ,ú‚g™àw{›lŒìL"ÓH \“¡àìïu’¾öˆÔÔá|ˆ·x,FC¥EÝî*Ææäu#@&šÝÄm˜ §"7Ć`GÀò?]XÈ_ü™¼¾²ÀáñPö"Ť1¬]•oh¼–6Vdl°Ò3±ÓoU½í?ì^Çîü·³ûW¶p÷]çöÝîÿ-ðßöž­|>kÅ.o:~òêK™ñùgšOgäÞë¼ìHe‹ÀOð»þ{ÑØñK¾Ô558_#PuvÚâán†:X1ù+luÃÅ£\´æ2)b".âdçÄÿg☾¬Èdz[-«½›ÞÜÙ².6áE¸„Ƚֹ?’pÍÙ(ymÉyÓòûO<~XûMÔW’ÿÂï=SEÛàß3Æ»1ø ìï3tí¾Päc°Ì‰ù´Š§|bÛ|")Áí¶Ê žo³êmŶnªœ/‘Îô/Nô{¦¯~Eô¯ü­¬¾ßÞþ³ó÷uìßÚ‹\þ?âújÄ]GÔsËŽ’£@q#Zñ­Uï:~/fáËfº–ò/ø]ç¦i{œÛæyßzOÀåà KÚïa©©Âùuw%wް²èg™2 qq4Nê­kpóHÃC’Oã!ên:} n¤šk¹³–öéùFG„ºÂ×7 'Z.ɽzyqÖ×{W–˜;¬Õ„âÏ,–vÑ^“Û°¿Ždžâh¤.ލwÆPtÃÃñ×ETyziÒT÷VIKxmŠÅ‰¼@‘ÄÌÑãàQœ•eÑDK,¾\jªp¾GêuFØH—¢ÖSc—‡y,12wVhã1´hXñ"KˆÛ7¥\$(П¬²aƒ’>ZÞ{ø¥LeÅ÷'i(X0r“!fåÄ27Èó–{ékì&&Ï$£"’Asqwc|ò*È…RÍ4®£ˆ Ì6Jª™;Ü[´n­³«$[ -µý¼Š¶¼ãEn'JJïDª’6–/‘'%×h»ÏŠž+•ÅA‘–ÃÝ×RJò÷?«óŒ^n§e·Äp ÷ÕÇÝ—¼ì‰1ydŽ–ÛØcx—æÅ""’1²8*0Ö˜î¿Ê{Ñòßt]~VJûÕTá|‰ÿâŸÿNâÿÿ}~õÜ0\IÓq\â=ï e[•—›»ýRãè••<W’><ê´ºg'oöüwoÜéÜf½žÒYõ®ÿǶ­¯Ó­ÿò«—œEÔö“Mg–i-%3@}Õv89FB|GçÒì<ý^«Z©ªÛå´Šs•FÒd›eÀÁ—ÈÙb éû)"·Š )Ñ8‰ƒ¸yDVìÁÙ„‘*ªò4a=>“Xíº»1{µ­¢ZµãåÎ5ç¹³žÙJû#\wy©_‰>¾'Ô¡Á[W¹œFFÎK[«<³Âú$ UÚA2°Œ`@! ŠŸd:_ѵ®/,Œ—Fô1ÆÞ±3˜Œ&F%&(H$ïd–;cº§Š1ÔÔá|ˆ7øïzÿE]GuÔ c”½³÷¿²ÜIkꃌ’¯ »9]ñ¢4¡Ï›¹¬ú3½î<6*×µ…Éd·jò‘{>‡§^–Øåôž äj¶–n\^Gì“g‘yžæ&Çß0c6ûœv›@I'K  $hšÉ‘¼éü·?nÇå¥çk5›ÂïpËǸ¾|x/Ÿˆ×‚<Òîû¶ MNÈÑÈõQã=ïÞÞëÇ®V~ !åîêÙvFÛò-ùs¡ä~K㯻®¬È'UÜcím^X-o`³’ÆÜJd,LÒûJþN ‚m”`IŸ#˜ÖÝåçOßû´ãòÏï Qgsÿ ¼ÈG=/„ñý«ù>¯¬sMÓ·A‘’Ã2gæ²2Œ}ðŠG]qwˆ'q¥Ó2’8&¥t·pÕTá|ŽwÓžßBçä_Jäyåoÿ­_ÍÆi5w(õf†´=GÀ€·Ô™Ûkü³ÛÛ㤳°É[XG…ÖIÚu·n6# Óï|_ñÅH䨧L÷f’8ú®ô¯3¤õ‰9»bt£lÄøãT$¼éù}§ž?,}¦ê+Éáwž©¢íðo™ã]˜üvv{^á©©Âù’uug‹ÇIvËrÑ:DTÙ›žâÇÈWj8–<¸ŸRrÚè\õ$ÐÝܸ·IgÇb3bHã%f¶¸ Ù@Æ=ëÕÇ–¶ÚÙÍš‹ ”¼²Xä»~òöûÎXËÐÎÂÕàVB#ÚºžÑ×@òøÐIzi$÷VIÒ;y­‚ˉ¼pñÊÊÒ‡åæ]fÙ'dŸ'kw UNÈø»ê ¾ Ò_=ÔØ«X22M»Â­nÏ'uò ©äfP@“!Õ×°Ù áDDºËËŽµYËtñ¬I'6xc<œ™ ”$iYüWÜ9 vÎâL6?-s{'¼…¾A‹€|)™â‘€X…Ñ'ÀäMc´÷,]-‹Â]Å™œcíâ‰."ÅÞÁ dNÑ‘!#cÃ|NÖ/‘†ã¬rb×aìîïéÚWÃÝ\°J±ƒìÈD‘‰‡¤iO"A®»y6Cc{qhösÜ[Ç,–Òo”,Ê C°Á:ø‡Â¹¹¾MÍgol,³°­¿.ܶöwðÍê;}ÊŠ¹6™¶O&ŽÈ©ÁŸÅZÛÅooe’†$qdžºUE@"Ð} l؆ª§ äl`¿½:öŠâÛÕºçº^ê;˾ ¸‰eT|ŠèM ÄÞ- UÀaðúEt5èSûZÊӳɥ)W2¥()JJR€R” ¥()JJR€W7s{oê\åýÜ»klM´Ó?x¢½Ñc¡äèð®’¹|†:Æw¨q— ëæÞÞFŒ€Á]®”‘°Fô~ªÊ¿ãw5§º^¨òÉsu¯•’7DÈÐ ¬& å;bëMú8v¹ë×Üç^»Œêœc5ýŽN -!ŒM,¬x*!^\-hh0'è*Àè«çy¯èï5dÇ2.àËJŠRâ+3mq,¹°Fî0c°Öøu_–=“êlG!cYØ ]Õ¦&ÕTD÷½ÈŠmë„?7Šl…s ´Z-š<«9¥m‹Ç+wö~ßaÃR½hé¥ mÅݹv+_ÏQL¶:K{»„ÈZ´néu"Ì¥`dpçzR£âÃé¬kÄ>><‚ålZÊ^}»‘p†7â›M½r~ ­õ‘ÁÞÅ}”“cÛû¿ ª*G¥ìÏ3°‰[Ò²"2˜ùøoÀ:™Šé¼Ä·Ö÷{Gœ¢÷‰k·ÜD,;q»ÕSšÈiG‚6 Ìù˜VgaÛA–Ç]\EooµšymÅÔqÇ2³<$èH;(Oø¾}ˆ›»Å]X¿»õ–Ö²!ömmB_™®$kÇÍ?Us˜þ»´|S‹$Ó¨¯òL¥1È·k£ê%d„}$ ­`讞Êbî1ë“98¼i°G¹–Û²vbßab^l‡²<ÊU€ãé$·ŠÌ°ž¸{u• èŠïaÉU‰ Hø€J¶ÓÄýU3s5öaq–˜LvF{†ü¶FsÄÌÒ,m¢ó96tºØÑ;:¾$cpñ\"¢°”•âÄ“µw± NÀ¡¢|ëœê;CuŒÝôǾm’ me¶ì­Í¬»<Ø<’!MVŒòX’4µÞ ‹>«³—+c†½OcËÝE<‚ÕÜoò2pm†7|™lt–÷w µh,ÝÒêE™JÀÈ6áÎô¥GćÓY-/¬òl® ¹ŒqÛà p9(qä}jÊÃë À×#œÂKåäöÖðAd‘aÒÚ0é»[ÞI!… !‘T)gQ±ç[}¬/:¥žÁ,L¿u­Ñ”ñ-knÛb¾9íµ±È3|ãU®®´ï18ì…Å­Åî>Öæ{Gço$Ы´-°v„©Ú#êUnR¨I&oÏ\gìëÏâ[Uʇ7ç®3öuçñ-ªåz4?&¦èøz±JR¶2¥()JJR€R” ¥()JJR€R” ¥()JJR€R” ¥()JJR€R” "g½:sö‹ÿâÜW‘õƒÍŸêK¹î/pæÐË-Ž>ß%²ÑÈÚ '³Èºi#‘½HÀ ä¼u^¹þôéÏÚ/ÿ‹q\Þcú1²ÉKy-¾c#fg‘§XŠXRbÅùñt,}l_\‡’tWƹæâªÿ§m†³ûcáêÌ= ÖQ½Œ8|µÄÒ_ÛÎö¯vÁš$†…D¬bQÕvÀËêõ:së!êeÆPã£ÌüÚ5c‚)wÉR¼Æ›j¬Hàû–מâzC1—“Üùk/vb,½†I÷ƒ|xÆß;´ÀíØú‰b¿ƺë<JÛ©Úî3µ‘–I$0]ÌVá\1àm›òq7&Ò£fBt;Œ´ú=)%JWvÛ—wþvg¾ÜZ%M"¢“¯ ;]•îíßÙÈdúÊÉz{3{‹—»sežò=¼‰áñ³Ǿ;d$i—Ϩn¤ÝCŒ·Ê t“¸ŸšÆÌ Ŷ¸£Ê‚9ÚéY<ÓCÔ»ã&èlõ×¼šæú f¸ÂÞãD’ÞO'vi{z›‹m!V(wk¤ÐÑq ´óý/˜Ëgb¸KÄ6‘^Ú]';¹Ð$qI4=„ÔlIWq+ò;`œ@ ëÅhæu—-z£ {yì¶÷ɽ©ì´"} ÐHZ2ÚÐ`!rFþOÁ×–ýí¾BšÖNäk,“ijÇÜõ 6–÷p{ÇÜÞ\M2´|V7„$ŠÍ ba$„H6­ÇÃx5ÑÀfkxšâ4Žr€È‘¹uV×€HßÓ¡¿¨W Feî1ðáîÞÆ +\θfy$—¸!U•¢(¡âEŒÅQn²ô>ºóI­3PßMqïŒõ4LnZéd~þÂðå¿eç®~8—íqüŸ y¯Né›+|–=l.ãî[\ôÆ:“‘‘…Àa±äl𩙟èÂToqù;Ì¥ä~É‘hBN„í£æ‘©RHÉ*HÓ G¡ [®ã7kÛi¦˜Ú©&•ÿðéqy„ËÙEr­qj&˜’ê •‘¨ØH¨OÀÍef­&o´ó¸×³]Eg/¡½3KÛà¿;ïGäx¼‘£®#Ñ·Im>C¨–æÊ‹y`²Ç«q’–3K'ÄwJ³§aó¶'U1=5žc“¹ èqx±¹ãíLÓ¶£Úﵻ˯‰åé‹êmÓL£B•W Rº_Þݽ¿<_‡R½J*zDTdûÛeû¶òå¯Ta¯;Æ;ÎÃNež'†7‰~t±»€²F6 t%@e;Ó ãƒ«°— xÉvêöi\C%¼‘Ëq™cS(nlWÒšäÛ]ÉwÊMÑyi=åq•ÈsŽ\-î>Y’[‹¹$y{g¾°ŸJràdz ÎáŽ{žµ»ÏJ—XéQíñ¦'ÆÞ; ‰¥0ûJ€yŸI,ª WÒt sa‰ÔwØì¦Vݦ´w!£¤±ÞâiZe•b^ó¡U@„Ÿ|Èä8ìÞѾ£êk|%´¤OMo-‘¹ïíR('¸-àCññÇdkâ~¥Šâç ¶”w™´¸Iáx¥‹VòË¢Œ‘½}CʶÀѤ^àº%q¿š×Ìžíì@—Ò:7²Ý<íÉÌ ¯ ÚVøVÝ·Od_'m“º6±NÙs‘¸‚)ZE}‰­B£•Rça[Ê®¶GVcÔ8̵ÃAg;³ð2!x$f@@/2*y_R¥óê§\gGô}ÇOÜ[›…FV^Å ç!spÓ.Ól#„·¶¤¢òø€õvuI$žÀ)JTJÁzuíÿÅ·«uýéÔ´SÿޭשOì^¯Ýú_Ä)JUÌÅ)JJR€R” ¥()JJR€R” ÍÜÞÛãz—9w'nÚÛm4ÏÄž(¯tXèy:ü+¤®_!އ1êeÃ:Áy†··‘£ 0Wk¥$l½ª²¯øÝÍiî—‡ª<²\Ç]A+ådÆQ$24+ ƒÂyNغàS~Ž®zõ÷9ש»éÖé»ìôî,làÈPñfv¡Cke úÁ_œ¤5ý欘æEÜiQJ\Cefm®%€·6ÝÆ vâ@:ß«òÓ§²}M€Èä,`k;‹º´ÄÚªˆž÷¹@ͽp‡æñS­®tÖ‹E£SG•iM+l^9[¿³öû•ëGH…(Sn.í˱[úþxz6?¨,î=ŠÚîûNò.ü6¶×Ânìge^2B³©U'auàüuºß[ë7íñº»²¼ê@yȼ¹ úØp}ˆâßQ®Rû““)´ŽÅÞ ü½–Io‘ˆ¢H}›’8-Ï™öv×aëM‘êãñkÊÁ—ÄÙ6.sogš½ÈI~%‹²c™nŠ€9÷9:)ôka¼‘¢|Ì(ì:«,¶;$ò%ŽBÖéãDwX&W*®¼—È?Hò+BϪ1××·«Õ¬˜û[(¯ ú\+DUÞeoPðöÎþ“ðÕr‘tf@ôž' ¤’/JÞc¦Û(Hî¦[Ç{Û$„°àOÄä¿Âå37yÛû|-Ö&K„Æ:—{nôò[\<®W‹ºáÁTÉàôÔáŽ`ì½ûˆ÷G½ýëcîÏÓ=¡;?;ÏßããññL>OÞÖR\ö{\.®m¸òå¾ÔÏ-è|xo_Fõçã\­¶)m¶Y¬ò7W)—7ó[ÜÍmíR©´ka¡T©×#éRyr<¾ŒÇˋ鴵–ÃÝÿÖ®åŽÓÑùÞâGEô£HËࡤ-Á<7Vñ\[Ê“A*ŽHØ2º‘°A#é®cÕY¬^3-“ÄÚÚcr)Š[{æãi¸ˆÃ¡‰4 2®Ô¶‹vËÓÁ#Mo¯ Àîš) –BGÍ/RxùÀ[ Ýpz5*~ îžžÆãu¯dµŠ w;šà~wåðøñ]ýCáT+2I3~zã?g^Ú®T9¿=qŸ³¯?‰mW+Ñ¡øÑ57GÃÕŠR•±¥)@)JP R””¥¥)@)JP R””¥¥)@)JP R””¥¥)@)JP R””¥#;e}røËŒ|vòKgvg1ÜLÑ+)†HþpVó¹ø}‹½ÔߪqyÉü½\¥g*P›¼‘¢©d“WçÔ‡ÞêoÕ8¼äþ^î¦ýSˆûÎOåêå*ºŠy¬\+Ï©½ÔߪqyÉü½;ÝMú§÷œŸËÕÊSQO!¬\+Ï©½ÔߪqyÉü½;ÝMú§÷œŸËÕÊSQO!¬\+Ï©½ÔߪqyÉü½;ÝMú§÷œŸËÕÊSQO!¬\+Ï©½ÔߪqyÉü½;ÝMú§÷œŸËÕÊSQO!¬\+Ï©½ÔߪqyÉü½;ÝMú§÷œŸËÕÊSQO!¬\+Ï©½ÔߪqyÉü½;ÝMú§÷œŸËÕÊSQO!¬\+Ï©ÈãpÙÌ/²{4뮫K){·ožæÊê&Ø<üoGÇ©wº›õN#ï9?—«”«JŒ$îÑ2­‰ÞI7ûêCïu7êœGÞr/N÷S~©Ä}ç'òõr•]E<ˆÖ.çÔ‡ÞêoÕ8¼äþ^î¦ýSˆûÎOåêå)¨§Ö.çÔ‡ÞêoÕ8¼äþ^î¦ýSˆûÎOåêå)¨§Ö.çÔ‡ÞêoÕ8¼äþ^î¦ýSˆûÎOåêå)¨§Ö.çÔ‡ÞêoÕ8¼äþ^î¦ýSˆûÎOåêå)¨§Ö.çÔ‡ÞêoÕ8¼äþ^î¦ýSˆûÎOåêå)¨§Ö.çÔ‡ÞêoÕ8¼äþ^î¦ýSˆûÎOåêå)¨§Ö.çÔ‘‚²¾¶|ÆB;xå¼»ˆíæiUTC8ªùÜdü>š¯JV©$¬ŠJXÅ)J’¢”¥¥)@)JP R””¥¥)@)JP ƒwi˜ƒ¨n2ûkˆ§´†..žVåo¢7Ø"Aõ|*õ*%%fZÂCïu7êœGÞr/N÷S~©Ä}ç'òõr•–¢žEõ‹…yõ!÷º›õN#ï9?—§{©¿Tâ>ó“ùz¹Jj)ä5‹…yõ!÷º›õN#ï9?—§{©¿Tâ>ó“ùz¹Jj)ä5‹…yõ!÷º›õN#ï9?—§{©¿Tâ>ó“ùz¹Jj)ä5‹…yõ!÷º›õN#ï9?—§{©¿Tâ>ó“ùz¹Jj)ä5‹…yõ!÷º›õN#ï9?—§{©¿Tâ>ó“ùz¹Jj)ä5‹…yõ!÷º›õN#ï9?—§{©¿Tâ>ó“ùz¹Jj)ä5‹…yõ ÚZf'ê|†BÚÆÞ(-&€ {§™™¤x›é4Œý½JV±ŠŠ²)9â¥*JŠR””¥¥)@)JP R””¥¥)@)JP R””¥¥)@)JP R””¥¥)@)JP R””¥¥)@)JP R””¥¥)@)JP R””¥¥)@)JP R””¥¥)@)JP R””¥¥)@)JP R””¥¥)@)JP R””¥¥)@)JP R””¥¥)@)JP R””¥¥)@)JP R””¥¥)@)JP R””¥¥)@)JPÿÙtck/src/java/org/apache/jdo/tck/pc/company/CompanyFactory.java100664 5717 12500110373 24610 0ustarmbouschenstaff 0 0 /* * 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. */ /* * CompanyFactory.java * */ package org.apache.jdo.tck.pc.company; import java.math.BigDecimal; import java.util.Date; /** * This interface is implemented by a factory class that can create * Company model instances. The factory instance is registered with * CompanyFactoryRegistry. */ public interface CompanyFactory { ICompany newCompany(long companyid, String name, Date founded); ICompany newCompany(long companyid, String name, Date founded, IAddress addr); IAddress newAddress(long addrid, String street, String city, String state, String zipcode, String country); IMeetingRoom newMeetingRoom(long roomid, String name); IDentalInsurance newDentalInsurance(long insid, String carrier, BigDecimal lifetimeOrthoBenefit); IDentalInsurance newDentalInsurance(long insid, String carrier, IEmployee employee, BigDecimal lifetimeOrthoBenefit); IDepartment newDepartment(long deptid, String name); IDepartment newDepartment(long deptid, String name, ICompany company); IDepartment newDepartment(long deptid, String name, ICompany company, IEmployee employeeOfTheMonth); IFullTimeEmployee newFullTimeEmployee(long personid, String first, String last, String middle, Date born, IAddress addr, Date hired, double sal); IFullTimeEmployee newFullTimeEmployee(long personid, String first, String last, String middle, Date born, Date hired, double sal); IMedicalInsurance newMedicalInsurance(long insid, String carrier, String planType); IMedicalInsurance newMedicalInsurance(long insid, String carrier, IEmployee employee, String planType); IPartTimeEmployee newPartTimeEmployee(long personid, String first, String last, String middle, Date born, Date hired, double wage); IPartTimeEmployee newPartTimeEmployee(long personid, String first, String last, String middle, Date born, IAddress addr, Date hired, double wage); IProject newProject(long projid, String name, BigDecimal budget); Class[] getTearDownClasses(); } tck/src/java/org/apache/jdo/tck/pc/company/CompanyFactoryAbstractImpl.java100664 22640 12500110373 27130 0ustarmbouschenstaff 0 0 /* * 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.company; import javax.jdo.PersistenceManager; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /* * This class provides an implementation of CompanyFactory that sets all * of the properties of the instance and defines abstract methods to * construct the instance itself. It is intended to be subclassed by * classes that implement only the methods to construct the instance. */ public abstract class CompanyFactoryAbstractImpl implements CompanyFactory { protected PersistenceManager pm; /** Logger */ protected Log logger = LogFactory.getFactory().getInstance("org.apache.jdo.tck"); /** true if debug logging is enabled. */ protected boolean debug = logger.isDebugEnabled(); /** Creates a new instance of CompanyFactoryAbstractImpl */ public CompanyFactoryAbstractImpl(PersistenceManager pm) { this.pm = pm; } /** * String indicating the type of identity used for the current test case. * The value is either "applicationidentity" or "datastoreidentity". */ public final String identitytype = System.getProperty("jdo.tck.identitytype"); public boolean isAppIdentity = "applicationidentity".equals(identitytype); abstract public IAddress newAddress(); abstract public IMeetingRoom newMeetingRoom(); abstract public ICompany newCompany(); abstract public IDentalInsurance newDentalInsurance(); abstract public IDepartment newDepartment(); abstract public IFullTimeEmployee newFullTimeEmployee(); abstract public IMedicalInsurance newMedicalInsurance(); abstract public IPartTimeEmployee newPartTimeEmployee(); abstract public IProject newProject(); public IAddress newAddress(long addrid, String street, String city, String state, String zipcode, String country) { IAddress result = newAddress(); result.setAddrid(addrid); result.setStreet(street); result.setCity(city); result.setState(state); result.setZipcode(zipcode); result.setCountry(country); if (debug) logger.debug("newAddress returned" + result); return result; } public IMeetingRoom newMeetingRoom(long roomid, String name) { IMeetingRoom result = newMeetingRoom(); result.setRoomid(roomid); result.setName(name); if (debug) logger.debug("newMeetingRoom returned" + result); return result; } public ICompany newCompany(long companyid, String name, java.util.Date founded) { ICompany result = newCompany(); result.setCompanyid(companyid); result.setName(name); result.setFounded(founded); if (debug) logger.debug("newCompany returned" + result); return result; } public ICompany newCompany(long companyid, String name, java.util.Date founded, IAddress addr) { ICompany result = newCompany(); result.setCompanyid(companyid); result.setName(name); result.setFounded(founded); result.setAddress(addr); if (debug) logger.debug("newCompany returned" + result); return result; } public IDentalInsurance newDentalInsurance(long insid, String carrier, java.math.BigDecimal lifetimeOrthoBenefit) { IDentalInsurance result = newDentalInsurance(); result.setInsid(insid); result.setCarrier(carrier); result.setLifetimeOrthoBenefit(lifetimeOrthoBenefit); if (debug) logger.debug("newDentalInsurance returned" + result); return result; } public IDentalInsurance newDentalInsurance(long insid, String carrier, IEmployee employee, java.math.BigDecimal lifetimeOrthoBenefit) { IDentalInsurance result = newDentalInsurance(); result.setInsid(insid); result.setCarrier(carrier); result.setEmployee(employee); result.setLifetimeOrthoBenefit(lifetimeOrthoBenefit); if (debug) logger.debug("newDentalInsurance returned" + result); return result; } public IDepartment newDepartment(long deptid, String name) { IDepartment result = newDepartment(); result.setDeptid(deptid); result.setName(name); if (debug) logger.debug("newDepartment returned" + result); return result; } public IDepartment newDepartment(long deptid, String name, ICompany company) { IDepartment result = newDepartment(); result.setDeptid(deptid); result.setName(name); result.setCompany(company); if (debug) logger.debug("newDepartment returned" + result); return result; } public IDepartment newDepartment(long deptid, String name, ICompany company, IEmployee employeeOfTheMonth) { IDepartment result = newDepartment(); result.setDeptid(deptid); result.setName(name); result.setCompany(company); result.setEmployeeOfTheMonth(employeeOfTheMonth); if (debug) logger.debug("newDepartment returned" + result); return result; } public IFullTimeEmployee newFullTimeEmployee(long personid, String first, String last, String middle, java.util.Date born, java.util.Date hired, double sal) { IFullTimeEmployee result = newFullTimeEmployee(); result.setPersonid(personid); result.setFirstname(first); result.setLastname(last); result.setMiddlename(middle); result.setBirthdate(born); result.setHiredate(hired); result.setSalary(sal); if (debug) logger.debug("newFullTimeEmployee returned" + result); return result; } public IFullTimeEmployee newFullTimeEmployee(long personid, String first, String last, String middle, java.util.Date born, IAddress addr, java.util.Date hired, double sal) { IFullTimeEmployee result = newFullTimeEmployee(); result.setPersonid(personid); result.setFirstname(first); result.setLastname(last); result.setMiddlename(middle); result.setBirthdate(born); result.setAddress(addr); result.setHiredate(hired); result.setSalary(sal); if (debug) logger.debug("newFullTimeEmployee returned" + result); return result; } public IMedicalInsurance newMedicalInsurance(long insid, String carrier, String planType) { IMedicalInsurance result = newMedicalInsurance(); result.setInsid(insid); result.setCarrier(carrier); result.setPlanType(planType); if (debug) logger.debug("newMedicalInsurance returned" + result); return result; } public IMedicalInsurance newMedicalInsurance(long insid, String carrier, IEmployee employee, String planType) { IMedicalInsurance result = newMedicalInsurance(); result.setInsid(insid); result.setCarrier(carrier); result.setEmployee(employee); result.setPlanType(planType); if (debug) logger.debug("newMedicalInsurance returned" + result); return result; } public IPartTimeEmployee newPartTimeEmployee(long personid, String first, String last, String middle, java.util.Date born, java.util.Date hired, double wage) { IPartTimeEmployee result = newPartTimeEmployee(); result.setPersonid(personid); result.setFirstname(first); result.setLastname(last); result.setMiddlename(middle); result.setBirthdate(born); result.setHiredate(hired); result.setWage(wage); if (debug) logger.debug("newPartTimeEmployee returned" + result); return result; } public IPartTimeEmployee newPartTimeEmployee(long personid, String first, String last, String middle, java.util.Date born, IAddress addr, java.util.Date hired, double wage) { IPartTimeEmployee result = newPartTimeEmployee(); result.setPersonid(personid); result.setFirstname(first); result.setLastname(last); result.setMiddlename(middle); result.setBirthdate(born); result.setAddress(addr); result.setHiredate(hired); result.setWage(wage); if (debug) logger.debug("newPartTimeEmployee returned" + result); return result; } public IProject newProject(long projid, String name, java.math.BigDecimal budget) { IProject result = newProject(); result.setProjid(projid); result.setName(name); result.setBudget(budget); if (debug) logger.debug("newProject returned" + result); return result; } } tck/src/java/org/apache/jdo/tck/pc/company/CompanyFactoryAnnotatedAbstractDelegator.java100664 5146 12500110373 31755 0ustarmbouschenstaff 0 0 /* * 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.company; import javax.jdo.PersistenceManager; /* * CompanyFactoryAnnotatedPMFieldClass.java * * This class uses the PersistenceManager.newInstance method with the concrete * class as a parameter. */ public abstract class CompanyFactoryAnnotatedAbstractDelegator extends CompanyFactoryAbstractImpl { public CompanyFactoryNewInstance delegate = null; public final String identitytype = System.getProperty("jdo.tck.identitytype"); public boolean isAppIdentity = "applicationidentity".equals(identitytype); /** * Creates a new instance of CompanyFactory */ public CompanyFactoryAnnotatedAbstractDelegator(PersistenceManager pm) { super(pm); } public IAddress newAddress() { return (IAddress)delegate.newAddress(); } public IMeetingRoom newMeetingRoom() { return (IMeetingRoom)delegate.newMeetingRoom(); } public ICompany newCompany() { return (ICompany)delegate.newCompany(); } public IDentalInsurance newDentalInsurance() { return (IDentalInsurance)delegate.newDentalInsurance(); } public IDepartment newDepartment() { return (IDepartment)delegate.newDepartment(); } public IFullTimeEmployee newFullTimeEmployee() { return (IFullTimeEmployee)delegate.newFullTimeEmployee(); } public IMedicalInsurance newMedicalInsurance() { return (IMedicalInsurance)delegate.newMedicalInsurance(); } public IPartTimeEmployee newPartTimeEmployee() { return (IPartTimeEmployee)delegate.newPartTimeEmployee(); } public IProject newProject() { return (IProject)delegate.newProject(); } public Class[]getTearDownClasses() { return delegate.getTearDownClasses(); } } tck/src/java/org/apache/jdo/tck/pc/company/CompanyFactoryConcreteClass.java100664 12373 12500110372 27274 0ustarmbouschenstaff 0 0 /* * 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.company; import java.math.BigDecimal; import java.util.Date; import javax.jdo.PersistenceManager; /* * This class is the company factory that uses constructors of the * concrete classes. */ public class CompanyFactoryConcreteClass implements CompanyFactory { /** */ public static final Class[] tearDownClasses = new Class[] { DentalInsurance.class, MedicalInsurance.class, PartTimeEmployee.class, FullTimeEmployee.class, Project.class, Department.class, Company.class, MeetingRoom.class }; public CompanyFactoryConcreteClass(PersistenceManager pm) { } public CompanyFactoryConcreteClass() { } public ICompany newCompany(long companyid, String name, Date founded) { return new Company(companyid, name, founded); } public ICompany newCompany(long companyid, String name, Date founded, IAddress addr) { return new Company(companyid, name, founded, addr); } public IAddress newAddress(long addrid, String street, String city, String state, String zipcode, String country) { return new Address(addrid, street, city, state, zipcode, country); } public IMeetingRoom newMeetingRoom(long roomid, String name) { return new MeetingRoom(roomid, name); } public IDentalInsurance newDentalInsurance(long insid, String carrier, BigDecimal lifetimeOrthoBenefit) { return new DentalInsurance(insid, carrier, lifetimeOrthoBenefit); } public IDentalInsurance newDentalInsurance(long insid, String carrier, IEmployee employee, BigDecimal lifetimeOrthoBenefit) { return new DentalInsurance(insid, carrier, lifetimeOrthoBenefit); } public IDepartment newDepartment(long deptid, String name) { return new Department(deptid, name); } public IDepartment newDepartment(long deptid, String name, ICompany company) { return new Department(deptid, name, company); } public IDepartment newDepartment(long deptid, String name, ICompany company, IEmployee employeeOfTheMonth) { return new Department(deptid, name, company, employeeOfTheMonth); } public IFullTimeEmployee newFullTimeEmployee(long personid, String first, String last, String middle, Date born, Date hired, double sal) { return new FullTimeEmployee(personid, first, last, middle, born, hired, sal); } public IFullTimeEmployee newFullTimeEmployee(long personid, String first, String last, String middle, Date born, IAddress addr, Date hired, double sal) { return new FullTimeEmployee(personid, first, last, middle, born, addr, hired, sal); } public IMedicalInsurance newMedicalInsurance(long insid, String carrier, String planType) { return new MedicalInsurance(insid, carrier, planType); } public IMedicalInsurance newMedicalInsurance(long insid, String carrier, IEmployee employee, String planType) { return new MedicalInsurance(insid, carrier, planType); } public IPartTimeEmployee newPartTimeEmployee(long personid, String first, String last, String middle, Date born, Date hired, double wage ) { return new PartTimeEmployee(personid, first, last, middle, born, hired, wage); } public IPartTimeEmployee newPartTimeEmployee(long personid, String first, String last, String middle, Date born, IAddress addr, Date hired, double wage) { return new PartTimeEmployee(personid, first, last, middle, born, addr, hired, wage); } public IPerson newPerson(long personid, String firstname, String lastname, String middlename, Date birthdate) { return new Person(personid, firstname, lastname, middlename, birthdate); } public IPerson newPerson(long personid, String firstname, String lastname, String middlename, Date birthdate, IAddress address) { return new Person(personid, firstname, lastname, middlename, birthdate, address); } public IProject newProject(long projid, String name, BigDecimal budget) { return new Project(projid, name, budget); } public Class[] getTearDownClasses() { return tearDownClasses; } } tck/src/java/org/apache/jdo/tck/pc/company/CompanyFactoryNewInstance.java100664 2611 12500110372 26734 0ustarmbouschenstaff 0 0 /* * 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.company; /** * */ public interface CompanyFactoryNewInstance { abstract public IAddress newAddress(); abstract public IMeetingRoom newMeetingRoom(); abstract public ICompany newCompany(); abstract public IDentalInsurance newDentalInsurance(); abstract public IDepartment newDepartment(); abstract public IFullTimeEmployee newFullTimeEmployee(); abstract public IMedicalInsurance newMedicalInsurance(); abstract public IPartTimeEmployee newPartTimeEmployee(); abstract public IProject newProject(); Class[] getTearDownClasses(); } tck/src/java/org/apache/jdo/tck/pc/company/CompanyFactoryPMClass.java100664 5234 12500110373 26025 0ustarmbouschenstaff 0 0 /* * 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.company; import javax.jdo.PersistenceManager; /* * CompanyFactoryPMClass.java * * This class uses the PersistenceManager.newInstance method with the concrete * class as a parameter. */ public class CompanyFactoryPMClass extends CompanyFactoryAbstractImpl { /** */ public static final Class[] tearDownClasses = new Class[] { DentalInsurance.class, MedicalInsurance.class, PartTimeEmployee.class, FullTimeEmployee.class, Project.class, Department.class, Company.class, MeetingRoom.class }; /** * Creates a new instance of CompanyFactoryPMInterface */ public CompanyFactoryPMClass(PersistenceManager pm) { super(pm); } public IAddress newAddress() { return (IAddress)pm.newInstance(Address.class); } public IMeetingRoom newMeetingRoom() { return (IMeetingRoom)pm.newInstance(MeetingRoom.class); } public ICompany newCompany() { return (ICompany)pm.newInstance(Company.class); } public IDentalInsurance newDentalInsurance() { return (IDentalInsurance)pm.newInstance(DentalInsurance.class); } public IDepartment newDepartment() { return (IDepartment)pm.newInstance(Department.class); } public IFullTimeEmployee newFullTimeEmployee() { return (IFullTimeEmployee)pm.newInstance(FullTimeEmployee.class); } public IMedicalInsurance newMedicalInsurance() { return (IMedicalInsurance)pm.newInstance(MedicalInsurance.class); } public IPartTimeEmployee newPartTimeEmployee() { return (IPartTimeEmployee)pm.newInstance(PartTimeEmployee.class); } public IProject newProject() { return (IProject)pm.newInstance(Project.class); } public Class[] getTearDownClasses() { return tearDownClasses; } } tck/src/java/org/apache/jdo/tck/pc/company/CompanyFactoryPMInterface.java100664 4766 12500110373 26671 0ustarmbouschenstaff 0 0 /* * 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.company; import javax.jdo.PersistenceManager; /* * CompanyFactoryPMInterface.java * * Created on August 29, 2005, 9:56 PM * */ public class CompanyFactoryPMInterface extends CompanyFactoryAbstractImpl { /** */ public static final Class[] tearDownClasses = new Class[] { PIDentalInsurance.class, PIMedicalInsurance.class, PIPartTimeEmployee.class, PIFullTimeEmployee.class, PIProject.class, PIDepartment.class, PICompany.class }; /** * Creates a new instance of CompanyFactoryPMInterface */ public CompanyFactoryPMInterface(PersistenceManager pm) { super(pm); } public IAddress newAddress() { return pm.newInstance(PIAddress.class); } public IMeetingRoom newMeetingRoom() { return pm.newInstance(PIMeetingRoom.class); } public ICompany newCompany() { return pm.newInstance(PICompany.class); } public IDentalInsurance newDentalInsurance() { return pm.newInstance(PIDentalInsurance.class); } public IDepartment newDepartment() { return pm.newInstance(PIDepartment.class); } public IFullTimeEmployee newFullTimeEmployee() { return pm.newInstance(PIFullTimeEmployee.class); } public IMedicalInsurance newMedicalInsurance() { return pm.newInstance(PIMedicalInsurance.class); } public IPartTimeEmployee newPartTimeEmployee() { return pm.newInstance(PIPartTimeEmployee.class); } public IProject newProject() { return pm.newInstance(PIProject.class); } public Class[] getTearDownClasses() { return tearDownClasses; } } tck/src/java/org/apache/jdo/tck/pc/company/CompanyFactoryRegistry.java100664 11606 12500110373 26353 0ustarmbouschenstaff 0 0 /* * 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.company; import java.lang.reflect.Constructor; import java.math.BigDecimal; import java.util.Date; import javax.jdo.PersistenceManager; /* * This is the registry for company factories. It is used for the * CompletenessTest to create instances from input xml test data files. * Factory instances that implement CompanyFactory interface are * registered (using the singleton pattern). *

Several registration methods are available. The default factory, * which creates instances by construction, is automatically * registered during class initialization. The default factory can * also be registered by using the no-args method registerFactory(). *

Non-default factories can be registered using the registerFactory * method taking the factory as an argument. Non-default factories that * have a single constructor argument PersistenceManager can be * registered using either the method that explicitly names the class, * or with the method that takes the class name from a system property. */ public class CompanyFactoryRegistry { /** The system property for factory name */ final static String FACTORY_PROPERTY_NAME = "jdo.tck.mapping.companyfactory"; /** The factory name if the system property is not set. */ final static String DEFAULT_FACTORY_CLASS_NAME = "org.apache.jdo.tck.pc.company.CompanyFactoryConcreteClass"; /** * The default factory class name */ final static String FACTORY_CLASS_NAME; static { String prop = System.getProperty(FACTORY_PROPERTY_NAME); if ((prop == null) || (prop.length() == 0)) prop = DEFAULT_FACTORY_CLASS_NAME; FACTORY_CLASS_NAME = prop; } /** * This is the default company factory singleton. This is statically * loaded regardless of the setting of the system property. */ final static CompanyFactory SINGLETON = new CompanyFactoryConcreteClass(); /** * This is the currently registered factory. */ static CompanyFactory instance = SINGLETON; /** * Creates a new instance of CompanyFactoryRegistry */ private CompanyFactoryRegistry() { } /** * Get the currently registered factory. * @return the factory */ public static CompanyFactory getInstance() { return instance; } /** Register the default factory. */ public static void registerFactory() { instance = SINGLETON; } /** Register a factory using the default factory name from the * system property. The factory must be available in the current * class path and have a public constructor * taking a PersistenceManager as a parameter. * @param pm the PersistenceManager */ public static void registerFactory(PersistenceManager pm) { registerFactory(FACTORY_CLASS_NAME, pm); } /** Register a factory using the specified factoryName * parameter. The factory class must be loadable by the current context * classloader and have a public constructor * taking a PersistenceManager as a parameter. * @param factoryClassName the fully-qualified class name of the factory * @param pm the PersistenceManager */ public static void registerFactory(String factoryClassName, PersistenceManager pm) { CompanyFactory factory = null; try { if (factoryClassName != null) { Class factoryClass = Class.forName(factoryClassName); Constructor ctor = factoryClass.getConstructor(new Class[] {PersistenceManager.class}); factory = (CompanyFactory) ctor.newInstance(new Object[]{pm}); } registerFactory(factory); } catch (Exception ex) { throw new RuntimeException ("Unable to construct CompanyFactory " + factoryClassName, ex); } } /** Register the factory. * @param factory the factory */ public static void registerFactory(CompanyFactory factory) { instance = factory!=null?factory:SINGLETON; } } tck/src/java/org/apache/jdo/tck/pc/company/CompanyModelReader.java100664 23415 12500110373 25377 0ustarmbouschenstaff 0 0 /* * 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.company; import java.io.InputStream; import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; import java.util.Locale; import java.util.TimeZone; import org.apache.jdo.tck.util.ConversionHelper; import org.springframework.beans.factory.xml.XmlBeanFactory; import org.springframework.beans.propertyeditors.CustomDateEditor; import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.InputStreamResource; /** * Utility class to create a graph of company model instances from an xml * representation. * * @author Michael Bouschen */ public class CompanyModelReader extends XmlBeanFactory { /** The format of date values in the xml representation */ public static final String DATE_PATTERN = "d/MMM/yyyy"; /** The name of the root list bean. */ public static final String ROOT_LIST_NAME = "root"; /** The bean-factory name in the xml input files. */ public static final String BEAN_FACTORY_NAME = "companyFactory"; /** The company factory instance. */ private CompanyFactory companyFactory; /** * Create a CompanyModelReader for the specified resourceName. * @param resourceName the name of the resource */ public CompanyModelReader(String resourceName) { // Use the class loader of the Company class to find the resource this(resourceName, Company.class.getClassLoader()); } /** * Create a CompanyModelReader for the specified resourceName. * @param resourceName the name of the resource */ public CompanyModelReader(String resourceName, ClassLoader classLoader) { super(new ClassPathResource(resourceName, classLoader)); configureFactory(); } /** * Create a CompanyModelReader for the specified InputStream. * @param stream the input stream */ public CompanyModelReader(InputStream stream) { super(new InputStreamResource(stream)); configureFactory(); } /** * Returns a list of root objects. The method expects to find a bean * called "root" of type list in the xml and returns it. * @return a list of root instances */ public List getRootList() { return (List)getBean(ROOT_LIST_NAME); } /** * Configure the CompanyModelReader, e.g. register CustomEditor classes * to convert the string representation of a property into an instance * of the right type. */ private void configureFactory() { SimpleDateFormat formatter = new SimpleDateFormat(DATE_PATTERN, Locale.US); CustomDateEditor dateEditor = new CustomDateEditor(formatter, true); registerCustomEditor(Date.class, dateEditor); companyFactory = CompanyFactoryRegistry.getInstance(); addSingleton(BEAN_FACTORY_NAME, companyFactory); } /** * @return Returns the tearDownClasses. */ public Class[] getTearDownClassesFromFactory() { return companyFactory.getTearDownClasses(); } /** * @return Returns the tearDownClasses. */ public static Class[] getTearDownClasses() { return CompanyFactoryConcreteClass.tearDownClasses; } public static Date stringToUtilDate(String value) { return ConversionHelper.toUtilDate(DATE_PATTERN, Locale.US, value); } // Convenience methods /** * Convenience method returning an Address instance for the specified * name. The method returns null if there is no Address * bean with the specified name. * @param name the name of the bean to return. * @return the instance of the bean or null if there no * Address bean. */ public IAddress getAddress(String name) { return (IAddress)getBean(name, Address.class); } /** * Convenience method returning a MeetingRoom instance for the specified * name. The method returns null if there is no MeetingRoom * bean with the specified name. * @param name the name of the bean to return. * @return the instance of the bean or null if there no * MeetingRoom bean. */ public IMeetingRoom getMeetingRoom(String name) { return (IMeetingRoom)getBean(name, MeetingRoom.class); } /** * Convenience method returning a Company instance for the specified * name. The method returns null if there is no Company * bean with the specified name. * @param name the name of the bean to return. * @return the instance of the bean or null if there no * Company bean. */ public ICompany getCompany(String name) { return (ICompany)getBean(name, Company.class); } /** * Convenience method returning a DentalInsurance instance for the * specified name. The method returns null if there is no * DentalInsurance bean with the specified name. * @param name the name of the bean to return. * @return the instance of the bean or null if there no * DentalInsurance bean. */ public IDentalInsurance getDentalInsurance(String name) { return (IDentalInsurance)getBean(name, DentalInsurance.class); } /** * Convenience method returning a Department instance for the specified * name. The method returns null if there is no Department * bean with the specified name. * @param name the name of the bean to return. * @return the instance of the bean or null if there no * Department bean. */ public IDepartment getDepartment(String name) { return (IDepartment)getBean(name, Department.class); } /** * Convenience method returning an Employee instance for the specified * name. The method returns null if there is no Employee * bean with the specified name. * @param name the name of the bean to return. * @return the instance of the bean or null if there no * Employee bean. */ public IEmployee getEmployee(String name) { return (IEmployee)getBean(name, Employee.class); } /** * Convenience method returning a FullTimeEmployee instance for the * specified name. The method returns null if there is no * FullTimeEmployee bean with the specified name. * @param name the name of the bean to return. * @return the instance of the bean or null if there no * FullTimeEmployee bean. */ public IFullTimeEmployee getFullTimeEmployee(String name) { return (IFullTimeEmployee)getBean(name, FullTimeEmployee.class); } /** * Convenience method returning an Insurance instance for the specified * name. The method returns null if there is no Insurance * bean with the specified name. * @param name the name of the bean to return. * @return the instance of the bean or null if there no * Insurance bean. */ public IInsurance getInsurance(String name) { return (IInsurance)getBean(name, Insurance.class); } /** * Convenience method returning a MedicalInsurance instance for the * specified name. The method returns null if there is no * MedicalInsurance bean with the specified name. * @param name the name of the bean to return. * @return the instance of the bean or null if there no * MedicalInsurance bean. */ public IMedicalInsurance getMedicalInsurance(String name) { return (IMedicalInsurance)getBean(name, MedicalInsurance.class); } /** * Convenience method returning a PartTimeEmployee instance for the * specified name. The method returns null if there is no * PartTimeEmployee bean with the specified name. * @param name the name of the bean to return. * @return the instance of the bean or null if there no * PartTimeEmployee bean. */ public IPartTimeEmployee getPartTimeEmployee(String name) { return (IPartTimeEmployee)getBean(name, PartTimeEmployee.class); } /** * Convenience method returning a Person instance for the specified * name. The method returns null if there is no Person * bean with the specified name. * @param name the name of the bean to return. * @return the instance of the bean or null if there no * Person bean. */ public IPerson getPerson(String name) { return (IPerson)getBean(name, Person.class); } /** * Convenience method returning a Project instance for the specified * name. The method returns null if there is no Project * bean with the specified name. * @param name the name of the bean to return. * @return the instance of the bean or null if there no * Project bean. */ public IProject getProject(String name) { return (IProject)getBean(name, Project.class); } } tck/src/java/org/apache/jdo/tck/pc/company/DentalInsurance.java100664 10713 12500110373 24741 0ustarmbouschenstaff 0 0 /* * 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.company; import java.math.BigDecimal; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a dental insurance carrier selection for a * particular Employee. */ public class DentalInsurance extends Insurance implements IDentalInsurance { private BigDecimal lifetimeOrthoBenefit; /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public DentalInsurance() {} /** * Construct a DentalInsurance instance. * @param insid The insurance instance identifier. * @param carrier The insurance carrier. * @param lifetimeOrthoBenefit The lifetimeOrthoBenefit. */ public DentalInsurance(long insid, String carrier, BigDecimal lifetimeOrthoBenefit) { super(insid, carrier); this.lifetimeOrthoBenefit = lifetimeOrthoBenefit; } /** * Construct a DentalInsurance instance. * @param insid The insurance instance identifier. * @param carrier The insurance carrier. * @param employee The employee associated with this insurance. * @param lifetimeOrthoBenefit The lifetimeOrthoBenefit. */ public DentalInsurance(long insid, String carrier, IEmployee employee, BigDecimal lifetimeOrthoBenefit) { super(insid, carrier, employee); this.lifetimeOrthoBenefit = lifetimeOrthoBenefit; } /** * Get the insurance lifetimeOrthoBenefit. * @return The insurance lifetimeOrthoBenefit. */ public BigDecimal getLifetimeOrthoBenefit() { return lifetimeOrthoBenefit; } /** * Set the insurance lifetimeOrthoBenefit. * @param lifetimeOrthoBenefit The insurance lifetimeOrthoBenefit. */ public void setLifetimeOrthoBenefit(BigDecimal lifetimeOrthoBenefit) { this.lifetimeOrthoBenefit = lifetimeOrthoBenefit; } /** * Returns a String representation of a DentalInsurance * object. * @return a String representation of a DentalInsurance * object. */ public String toString() { return "DentalInsurance(" + getFieldRepr()+ ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(super.getFieldRepr()); rc.append(", lifetimeOrthoBenefit ").append(lifetimeOrthoBenefit); return rc.toString(); } /** * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the other Object. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { IDentalInsurance otherIns = (IDentalInsurance)other; String where = "DentalInsurance<" + getInsid() + ">"; return super.deepCompareFields(otherIns, helper) & helper.equals(lifetimeOrthoBenefit, otherIns.getLifetimeOrthoBenefit(), where + ".lifetimeOrthoBenefit"); } } tck/src/java/org/apache/jdo/tck/pc/company/Department.java100664 34722 12500110373 23773 0ustarmbouschenstaff 0 0 /* * 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.company; import java.io.Serializable; import java.io.ObjectInputStream; import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.HashSet; import java.util.List; import java.util.Set; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a department within a company. */ public class Department implements IDepartment, Serializable, Comparable, Comparator, DeepEquality { public static final int RECOMMENDED_NO_OF_EMPS = 2; private long deptid; private String name; private Company company; private Employee employeeOfTheMonth; private transient Set employees = new HashSet(); // element type is Employee private transient Set fundedEmps = new HashSet(); // element type is Employee private transient List meetingRooms = new ArrayList(); // element type is MeetingRoom /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public Department() {} /** * Construct a Department instance. * @param deptid The department id. * @param name The name of the department. */ public Department(long deptid, String name) { this.deptid = deptid; this.name = name; } /** * Construct a Department instance. * @param deptid The department id. * @param name The name of the department. * @param company The company that the department is associated with. */ public Department(long deptid, String name, ICompany company) { this.deptid = deptid; this.name = name; this.company = (Company)company; } /** * Construct a Department instance. * @param deptid The department id. * @param name The name of the department. * @param company The company that the department is associated with. * @param employeeOfTheMonth The employee of the month the * department is associated with. */ public Department(long deptid, String name, ICompany company, IEmployee employeeOfTheMonth) { this.deptid = deptid; this.name = name; this.company = (Company)company; this.employeeOfTheMonth = (Employee)employeeOfTheMonth; } /** * Set the id associated with this object. * @param id the id. */ public void setDeptid(long id) { if (this.deptid != 0) throw new IllegalStateException("Id is already set."); this.deptid = id; } /** * Get the department id. * @return The department id. */ public long getDeptid() { return deptid; } /** * Get the name of the department. * @return The name of the department. */ public String getName() { return name; } /** * Set the name of the department. * @param name The name to set for the department. */ public void setName(String name) { this.name = name; } /** * Get the company associated with the department. * @return The company. */ public ICompany getCompany() { return company; } /** * Set the company for the department. * @param company The company to associate with the department. */ public void setCompany(ICompany company) { this.company = (Company)company; } /** * Get the employee of the month associated with the department. * @return The employee of the month. */ public IEmployee getEmployeeOfTheMonth() { return employeeOfTheMonth; } /** * Set the employee of the month for the department. * @param employeeOfTheMonth The employee of the month to * associate with the department. */ public void setEmployeeOfTheMonth(IEmployee employeeOfTheMonth) { this.employeeOfTheMonth = (Employee)employeeOfTheMonth; } /** * Get the employees in the department as an unmodifiable set. * @return The set of employees in the department, as an unmodifiable * set. */ public Set getEmployees() { return Collections.unmodifiableSet(employees); } /** * Add an employee to the department. * @param emp The employee to add to the department. */ public void addEmployee(Employee emp) { employees.add(emp); } /** * Remove an employee from the department. * @param emp The employee to remove from the department. */ public void removeEmployee(Employee emp) { employees.remove(emp); } /** * Set the employees to be in this department. * @param employees The set of employees for this department. */ public void setEmployees(Set employees) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this.employees = (employees != null) ? new HashSet(employees) : null; } /** * Get the funded employees in the department as an unmodifiable set. * @return The set of funded employees in the department, as an * unmodifiable set. */ public Set getFundedEmps() { return Collections.unmodifiableSet(fundedEmps); } /** * Add an employee to the collection of funded employees of this * department. * @param emp The employee to add to the department. */ public void addFundedEmp(Employee emp) { fundedEmps.add(emp); } /** * Remove an employee from collection of funded employees of this * department. * @param emp The employee to remove from the department. */ public void removeFundedEmp(Employee emp) { fundedEmps.remove(emp); } /** * Set the funded employees to be in this department. * @param employees The set of funded employees for this department. */ public void setFundedEmps(Set employees) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this.fundedEmps = (fundedEmps != null) ? new HashSet(employees) : null; } /** * Get the meeting rooms in the department as an unmodifiable list. * @return List of meeting rooms in the department, as an unmodifiable list. */ public List getMeetingRooms() { return Collections.unmodifiableList(meetingRooms); } /** * Add a meeting room to the department. * @param room Meeting room to add to the department. */ public void addMeetingRoom(MeetingRoom room) { meetingRooms.add(room); } /** * Remove a meeting room from the department. * @param room Meeting room to remove from the department. */ public void removeMeetingRoom(MeetingRoom room) { meetingRooms.remove(room); } /** * Set the rooms for this department. * @param rooms The rooms for this department. */ public void setMeetingRooms(List rooms) { this.meetingRooms = (rooms != null) ? new ArrayList(rooms) : null; } /** Serialization support: initialize transient fields. */ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); employees = new HashSet(); fundedEmps = new HashSet(); meetingRooms = new ArrayList(); } /** * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the other Department. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { IDepartment otherDept = (IDepartment)other; String where = "Department<" + deptid + ">"; return helper.equals(deptid, otherDept.getDeptid(), where + ".deptid") & helper.equals(name, otherDept.getName(), where + ".name") & helper.deepEquals(company, otherDept.getCompany(), where + ".company") & helper.deepEquals(employeeOfTheMonth, otherDept.getEmployeeOfTheMonth(), where + ".employeeOfTheMonth") & helper.deepEquals(employees, otherDept.getEmployees(), where + ".employees") & helper.deepEquals(fundedEmps, otherDept.getFundedEmps(), where + ".fundedEmps"); // TODO Add meetingRooms to comparison } /** * Returns a String representation of a Department object. * @return a String representation of a Department object. */ public String toString() { return "Department(" + getFieldRepr()+ ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(deptid); rc.append(", name ").append(name); return rc.toString(); } /** * Compares this object with the specified object for order. Returns a * negative integer, zero, or a positive integer as this object is less * than, equal to, or greater than the specified object. * @param o The Object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified object. * @throws ClassCastException - if the specified object's type prevents * it from being compared to this Object. */ public int compareTo(Object o) { return compareTo((IDepartment)o); } /** * Compare two instances. This is a method in Comparator. */ public int compare(Object o1, Object o2) { return compare((IDepartment)o1, (IDepartment)o2); } /** * Compares this object with the specified Department object for * order. Returns a negative integer, zero, or a positive integer as * this object is less than, equal to, or greater than the specified * object. * @param other The Department object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified * Department object. */ public int compareTo(IDepartment other) { return compare(this, other); } /** * Compares its two IDepartment arguments for order. Returns a negative * integer, zero, or a positive integer as the first argument is less * than, equal to, or greater than the second. * @param o1 the first IDepartment object to be compared. * @param o2 the second IDepartment object to be compared. * @return a negative integer, zero, or a positive integer as the first * object is less than, equal to, or greater than the second object. */ public static int compare(IDepartment o1, IDepartment o2) { return EqualityHelper.compare(o1.getDeptid(), o2.getDeptid()); } /** * Indicates whether some other object is "equal to" this one. * @param obj the object with which to compare. * @return true if this object is the same as the obj * argument; false otherwise. */ public boolean equals(Object obj) { if (obj instanceof IDepartment) { return compareTo((IDepartment)obj) == 0; } return false; } /** * Returns a hash code value for the object. * @return a hash code value for this object. */ public int hashCode() { return (int)deptid; } /** * The application identity class associated with the * Department class. */ public static class Oid implements Serializable, Comparable { /** * This field represents the application identifier field * for the Department class. * It must match in name and type with the field in the * Department class. */ public long deptid; /** * The required public, no-arg constructor. */ public Oid() { } /** * A constructor to initialize the identifier field. * @param deptid the deptid of the Department. */ public Oid(long deptid) { this.deptid = deptid; } public Oid(String s) { deptid = Long.parseLong(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + deptid;} /** */ public boolean equals(java.lang.Object obj) { if( obj==null || !this.getClass().equals(obj.getClass()) ) return( false ); Oid o = (Oid) obj; if( this.deptid != o.deptid ) return( false ); return( true ); } /** */ public int hashCode() { return( (int) deptid ); } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } /** */ public int compareTo(Object obj) { // may throw ClassCastException which the user must handle Oid other = (Oid) obj; if( deptid < other.deptid ) return -1; if( deptid > other.deptid ) return 1; return 0; } } } tck/src/java/org/apache/jdo/tck/pc/company/Employee.java100664 36520 12500110373 23445 0ustarmbouschenstaff 0 0 /* * 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.company; import java.io.ObjectInputStream; import java.io.IOException; import java.util.Collections; import java.util.Date; import java.util.HashSet; import java.util.Set; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents an employee. */ public abstract class Employee extends Person implements IEmployee { private Date hiredate; private double weeklyhours; private DentalInsurance dentalInsurance; private MedicalInsurance medicalInsurance; private Department department; private Department fundingDept; private Employee manager; private Employee mentor; private Employee protege; private Employee hradvisor; private transient Set reviewedProjects = new HashSet(); // element-type is Project private transient Set projects = new HashSet(); // element-type is Project private transient Set team = new HashSet(); // element-type is Employee private transient Set hradvisees = new HashSet(); // element-type is Employee /** This is the JDO-required no-args constructor */ protected Employee() {} /** * Construct an Employee instance. * @param personid The identifier for the person. * @param firstname The first name of the employee. * @param lastname The last name of the employee. * @param middlename The middle name of the employee. * @param birthdate The birth date of the employee. * @param hiredate The date that the employee was hired. */ public Employee(long personid, String firstname, String lastname, String middlename, Date birthdate, Date hiredate) { super(personid, firstname, lastname, middlename, birthdate); this.hiredate = hiredate; } /** * Construct an Employee instance. * @param personid The identifier for the person. * @param firstname The first name of the employee. * @param lastname The last name of the employee. * @param middlename The middle name of the employee. * @param birthdate The birth date of the employee. * @param address The address of the employee. * @param hiredate The date that the employee was hired. */ public Employee(long personid, String firstname, String lastname, String middlename, Date birthdate, IAddress address, Date hiredate) { super(personid, firstname, lastname, middlename, birthdate, address); this.hiredate = hiredate; } /** * Get the date that the employee was hired. * @return The date the employee was hired. */ public Date getHiredate() { return hiredate; } /** * Set the date that the employee was hired. * @param hiredate The date the employee was hired. */ public void setHiredate(Date hiredate) { this.hiredate = hiredate; } /** * Get the weekly hours of the employee. * @return The number of hours per week that the employee works. */ public double getWeeklyhours() { return weeklyhours; } /** * Set the number of hours per week that the employee works. * @param weeklyhours The number of hours per week that the employee * works. */ public void setWeeklyhours(double weeklyhours) { this.weeklyhours = weeklyhours; } /** * Get the reviewed projects. * @return The reviewed projects as an unmodifiable set. */ public Set getReviewedProjects() { return Collections.unmodifiableSet(reviewedProjects); } /** * Add a reviewed project. * @param project A reviewed project. */ public void addReviewedProjects(Project project) { reviewedProjects.add(project); } /** * Remove a reviewed project. * @param project A reviewed project. */ public void removeReviewedProject(Project project) { reviewedProjects.remove(project); } /** * Set the reviewed projects for the employee. * @param reviewedProjects The set of reviewed projects. */ public void setReviewedProjects(Set reviewedProjects) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this.reviewedProjects = (reviewedProjects != null) ? new HashSet(reviewedProjects) : null; } /** * Get the employee's projects. * @return The employee's projects are returned as an unmodifiable * set. */ public Set getProjects() { return Collections.unmodifiableSet(projects); } /** * Add a project for the employee. * @param project The project. */ public void addProject(Project project) { projects.add(project); } /** * Remove a project from an employee's set of projects. * @param project The project. */ public void removeProject(Project project) { projects.remove(project); } /** * Set the projects for the employee. * @param projects The set of projects of the employee. */ public void setProjects(Set projects) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this.projects = (projects != null) ? new HashSet(projects) : null; } /** * Get the dental insurance of the employee. * @return The employee's dental insurance. */ public IDentalInsurance getDentalInsurance() { return dentalInsurance; } /** * Set the dental insurance object for the employee. * @param dentalInsurance The dental insurance object to associate with * the employee. */ public void setDentalInsurance(IDentalInsurance dentalInsurance) { this.dentalInsurance = (DentalInsurance)dentalInsurance; } /** * Get the medical insurance of the employee. * @return The employee's medical insurance. */ public IMedicalInsurance getMedicalInsurance() { return medicalInsurance; } /** * Set the medical insurance object for the employee. * @param medicalInsurance The medical insurance object to associate * with the employee. */ public void setMedicalInsurance(IMedicalInsurance medicalInsurance) { this.medicalInsurance = (MedicalInsurance)medicalInsurance; } /** * Get the employee's department. * @return The department associated with the employee. */ public IDepartment getDepartment() { return department; } /** * Set the employee's department. * @param department The department. */ public void setDepartment(IDepartment department) { this.department = (Department)department; } /** * Get the employee's funding department. * @return The funding department associated with the employee. */ public IDepartment getFundingDept() { return fundingDept; } /** * Set the employee's funding department. * @param department The funding department. */ public void setFundingDept(IDepartment department) { this.fundingDept = (Department)department; } /** * Get the employee's manager. * @return The employee's manager. */ public IEmployee getManager() { return manager; } /** * Set the employee's manager. * @param manager The employee's manager. */ public void setManager(IEmployee manager) { this.manager = (Employee)manager; } /** * Get the employee's team. * @return The set of Employees on this employee's team, * returned as an unmodifiable set. */ public Set getTeam() { return Collections.unmodifiableSet(team); } /** * Add an Employee to this employee's team. * This method sets both sides of the relationship, modifying * this employees team to include parameter emp and modifying * emp to set its manager attribute to this object. * @param emp The Employee to add to the team. */ public void addToTeam(Employee emp) { team.add(emp); emp.manager = this; } /** * Remove an Employee from this employee's team. * This method will also set the emp manager to null. * @param emp The Employee to remove from the team. */ public void removeFromTeam(Employee emp) { team.remove(emp); emp.manager = null; } /** * Set the employee's team. * @param team The set of Employees. */ public void setTeam(Set team) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this.team = (team != null) ? new HashSet(team) : null; } /** * Set the mentor for this employee. * @param mentor The mentor for this employee. */ public void setMentor(IEmployee mentor) { this.mentor = (Employee)mentor; } /** * Get the mentor for this employee. * @return The mentor. */ public IEmployee getMentor() { return mentor; } /** * Set the protege for this employee. * @param protege The protege for this employee. */ public void setProtege(IEmployee protege) { this.protege = (Employee)protege; } /** * Get the protege of this employee. * @return The protege of this employee. */ public IEmployee getProtege() { return protege; } /** * Set the HR advisor for this employee. * @param hradvisor The hradvisor for this employee. */ public void setHradvisor(IEmployee hradvisor) { this.hradvisor = (Employee)hradvisor; } /** * Get the HR advisor for the employee. * @return The HR advisor. */ public IEmployee getHradvisor() { return hradvisor; } /** * Get the HR advisees of this HR advisor. * @return An unmodifiable Set containing the * Employees that are HR advisees of this employee. */ public Set getHradvisees() { return Collections.unmodifiableSet(hradvisees); } /** * Add an Employee as an advisee of this HR advisor. * This method also sets the emp hradvisor to reference * this object. In other words, both sides of the relationship are * set. * @param emp The employee to add as an advisee. */ public void addAdvisee(Employee emp) { hradvisees.add(emp); emp.hradvisor = this; } /** * Remove an Employee as an advisee of this HR advisor. * This method also sets the emp hradvisor to null. * In other words, both sides of the relationship are set. * @param emp The employee to add as an HR advisee. */ public void removeAdvisee(Employee emp) { hradvisees.remove(emp); emp.hradvisor = null; } /** * Set the HR advisees of this HR advisor. * @param hradvisees The Employees that are HR advisees of * this employee. */ public void setHradvisees(Set hradvisees) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this.hradvisees = (hradvisees != null) ? new HashSet(hradvisees) : null; } /** Serialization support: initialize transient fields. */ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); reviewedProjects = new HashSet(); projects = new HashSet(); team = new HashSet(); hradvisees = new HashSet(); } /** * Return a String representation of a Employee object. * @return a String representation of a Employee object. */ public String toString() { return "Employee(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(super.getFieldRepr()); rc.append(", hired ").append( hiredate==null ? "null" : formatter.format(hiredate)); rc.append(", weeklyhours ").append(weeklyhours); return rc.toString(); } /** * Returns true if all the fields of this instance are * deep equal to the corresponding fields of the specified Employee. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { IEmployee otherEmp = (IEmployee)other; String where = "Employee<" + getPersonid() + ">"; return super.deepCompareFields(otherEmp, helper) & helper.equals(hiredate, otherEmp.getHiredate(), where + ".hiredate") & helper.closeEnough(weeklyhours, otherEmp.getWeeklyhours(), where + ".weeklyhours") & helper.deepEquals(dentalInsurance, otherEmp.getDentalInsurance(), where + ".dentalInsurance") & helper.deepEquals(medicalInsurance, otherEmp.getMedicalInsurance(), where + ".medicalInsurance") & helper.deepEquals(department, otherEmp.getDepartment(), where + ".department") & helper.deepEquals(fundingDept, otherEmp.getFundingDept(), where + ".fundingDept") & helper.deepEquals(manager, otherEmp.getManager(), where + ".manager") & helper.deepEquals(mentor, otherEmp.getMentor(), where + ".mentor") & helper.deepEquals(protege, otherEmp.getProtege(), where + ".protege") & helper.deepEquals(hradvisor, otherEmp.getHradvisor(), where + ".hradvisor") & helper.deepEquals(reviewedProjects, otherEmp.getReviewedProjects(), where + ".reviewedProjects") & helper.deepEquals(projects, otherEmp.getProjects(), where + ".projects") & helper.deepEquals(team, otherEmp.getTeam(), where + ".team") & helper.deepEquals(hradvisees, otherEmp.getHradvisees(), where + ".hradvisees"); } } tck/src/java/org/apache/jdo/tck/pc/company/FullTimeEmployee.java100664 11130 12500110373 25075 0ustarmbouschenstaff 0 0 /* * 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.company; import java.util.Date; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a full-time employee. */ public class FullTimeEmployee extends Employee implements IFullTimeEmployee { private double salary; /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public FullTimeEmployee() {} /** * Construct a full-time employee. * @param personid The person identifier. * @param first The person's first name. * @param last The person's last name. * @param middle The person's middle name. * @param born The person's birthdate. * @param hired The date that the person was hired. * @param sal The salary of the full-time employee. */ public FullTimeEmployee(long personid, String first, String last, String middle, Date born, Date hired, double sal) { super(personid, first, last, middle, born, hired); salary = sal; } /** * Construct a full-time employee. * @param personid The person identifier. * @param first The person's first name. * @param last The person's last name. * @param middle The person's middle name. * @param born The person's birthdate. * @param addr The person's address. * @param hired The date that the person was hired. * @param sal The salary of the full-time employee. */ public FullTimeEmployee(long personid, String first, String last, String middle, Date born, IAddress addr, Date hired, double sal) { super(personid, first, last, middle, born, addr, hired); salary = sal; } /** * Get the salary of the full time employee. * @return The salary of the full time employee. */ public double getSalary() { return salary; } /** * Set the salary for the full-time employee. * @param salary The salary to set for the full-time employee. */ public void setSalary(double salary) { this.salary = salary; } /** * Return a String representation of a FullTimeEmployee object. * @return a String representation of a FullTimeEmployee object. */ public String toString() { return "FullTimeEmployee(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ public String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(super.getFieldRepr()); rc.append(", $").append(salary); return rc.toString(); } /** * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the specified * FullTimeEmployee. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { IFullTimeEmployee otherEmp = (IFullTimeEmployee)other; String where = "FullTimeEmployee<" + getPersonid() + ">"; return super.deepCompareFields(otherEmp, helper) & helper.closeEnough(salary, otherEmp.getSalary(), where + ".salary"); } } tck/src/java/org/apache/jdo/tck/pc/company/IAddress.java100664 2572 12500110373 23344 0ustarmbouschenstaff 0 0 /* * 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.company; /** * This interface represents the persistent state of Address. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ public interface IAddress { long getAddrid(); String getStreet(); String getCity(); String getState(); String getZipcode(); String getCountry(); void setAddrid(long addrid); void setStreet(String street); void setCity(String city); void setState(String state); void setZipcode(String zipcode); void setCountry(String country); } tck/src/java/org/apache/jdo/tck/pc/company/ICompany.java100664 2562 12500110373 23364 0ustarmbouschenstaff 0 0 /* * 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.company; import java.util.Date; import java.util.Set; /** * This interface represents the persistent state of Company. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ public interface ICompany { IAddress getAddress(); long getCompanyid(); Set getDepartments(); Date getFounded(); String getName(); void setAddress(IAddress a); void setCompanyid(long id); void setDepartments(Set depts); void setFounded(Date date); void setName(String string); } tck/src/java/org/apache/jdo/tck/pc/company/IDentalInsurance.java100664 2310 12500110373 25024 0ustarmbouschenstaff 0 0 /* * 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.company; import java.math.BigDecimal; /** * This interface represents the persistent state of DentalInsurance. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ public interface IDentalInsurance extends IInsurance { BigDecimal getLifetimeOrthoBenefit(); void setLifetimeOrthoBenefit(BigDecimal lifetimeOrthoBenefit); } tck/src/java/org/apache/jdo/tck/pc/company/IDepartment.java100664 3043 12500110373 24054 0ustarmbouschenstaff 0 0 /* * 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.company; import java.util.List; import java.util.Set; /** * This interface represents the persistent state of Department. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ public interface IDepartment { long getDeptid(); String getName(); ICompany getCompany(); IEmployee getEmployeeOfTheMonth(); Set getEmployees(); Set getFundedEmps(); List getMeetingRooms(); void setDeptid(long deptid); void setName(String name); void setCompany(ICompany company); void setEmployeeOfTheMonth(IEmployee employeeOfTheMonth); void setEmployees(Set employees); void setFundedEmps(Set employees); void setMeetingRooms(List rooms); } tck/src/java/org/apache/jdo/tck/pc/company/IEmployee.java100664 4172 12500110373 23534 0ustarmbouschenstaff 0 0 /* * 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.company; import java.util.Date; import java.util.Set; /** * This interface represents the persistent state of Employee. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ public interface IEmployee extends IPerson { Date getHiredate(); double getWeeklyhours(); Set getReviewedProjects(); Set getProjects(); IDentalInsurance getDentalInsurance(); IMedicalInsurance getMedicalInsurance(); IDepartment getDepartment(); IDepartment getFundingDept(); IEmployee getManager(); Set getTeam(); IEmployee getMentor(); IEmployee getProtege(); IEmployee getHradvisor(); Set getHradvisees(); void setHiredate(Date hiredate); void setWeeklyhours(double weeklyhours); void setReviewedProjects(Set reviewedProjects); void setProjects(Set projects); void setDentalInsurance(IDentalInsurance dentalInsurance); void setMedicalInsurance(IMedicalInsurance medicalInsurance); void setDepartment(IDepartment department); void setFundingDept(IDepartment department); void setManager(IEmployee manager); void setTeam(Set team); void setMentor(IEmployee mentor); void setProtege(IEmployee protege); void setHradvisor(IEmployee hradvisor); void setHradvisees(Set hradvisees); } tck/src/java/org/apache/jdo/tck/pc/company/IFullTimeEmployee.java100664 2172 12500110373 25174 0ustarmbouschenstaff 0 0 /* * 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.company; /** * This interface represents the persistent state of FullTimeEmployee. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ public interface IFullTimeEmployee extends IEmployee { double getSalary(); void setSalary(double salary); } tck/src/java/org/apache/jdo/tck/pc/company/IInsurance.java100664 2331 12500110372 23676 0ustarmbouschenstaff 0 0 /* * 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.company; /** * This interface represents the persistent state of Insurance. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ public interface IInsurance { long getInsid(); String getCarrier(); IEmployee getEmployee(); void setInsid(long insid); void setCarrier(String carrier); void setEmployee(IEmployee employee); } tck/src/java/org/apache/jdo/tck/pc/company/IMedicalInsurance.java100664 2201 12500110372 25151 0ustarmbouschenstaff 0 0 /* * 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.company; /** * This interface represents the persistent state of MedicalInsurance. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ public interface IMedicalInsurance extends IInsurance { String getPlanType(); void setPlanType(String planType); } tck/src/java/org/apache/jdo/tck/pc/company/IMeetingRoom.java100664 2216 12500110373 24177 0ustarmbouschenstaff 0 0 /* * 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.company; /** * This interface represents the persistent state of MeetingRoom. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ public interface IMeetingRoom { long getRoomid(); String getName(); void setRoomid(long roomid); void setName(String name); }tck/src/java/org/apache/jdo/tck/pc/company/Insurance.java100664 22003 12500110373 23604 0ustarmbouschenstaff 0 0 /* * 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.company; import java.io.Serializable; import java.util.Comparator; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents an insurance carrier selection for a particular * Employee. */ public abstract class Insurance implements IInsurance, Serializable, Comparable, Comparator, DeepEquality { private long insid; private String carrier; private Employee employee; /** This is the JDO-required no-args constructor. */ protected Insurance() {} /** * Construct an Insurance instance. * @param insid The insurance instance identifier. * @param carrier The insurance carrier. */ protected Insurance(long insid, String carrier) { this.insid = insid; this.carrier = carrier; } /** * Construct an Insurance instance. * @param insid The insurance instance identifier. * @param carrier The insurance carrier. * @param employee The employee associated with this insurance. */ protected Insurance(long insid, String carrier, IEmployee employee) { this.insid = insid; this.carrier = carrier; this.employee = (Employee)employee; } /** * Get the insurance ID. * @return the insurance ID. */ public long getInsid() { return insid; } /** * Set the insurance ID. * @param id The insurance ID value. */ public void setInsid(long id) { if (this.insid != 0) throw new IllegalStateException("Id is already set."); this.insid = id; } /** * Get the insurance carrier. * @return The insurance carrier. */ public String getCarrier() { return carrier; } /** * Set the insurance carrier. * @param carrier The insurance carrier. */ public void setCarrier(String carrier) { this.carrier = carrier; } /** * Get the associated employee. * @return The employee for this insurance. */ public IEmployee getEmployee() { return employee; } /** * Set the associated employee. * @param employee The associated employee. */ public void setEmployee(IEmployee employee) { this.employee = (Employee)employee; } /** * Returns a String representation of a Insurance object. * @return a String representation of a Insurance object. */ public String toString() { return "Insurance(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(insid); rc.append(", carrier ").append(carrier); return rc.toString(); } /** * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the other Object. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { IInsurance otherIns = (IInsurance)other; String where = "Insurance<" + insid + ">"; return helper.equals(insid, otherIns.getInsid(), where + ".insid") & helper.equals(carrier, otherIns.getCarrier(), where + ".carrier") & helper.deepEquals(employee, otherIns.getEmployee(), where + ".employee"); } /** * Compares this object with the specified object for order. Returns a * negative integer, zero, or a positive integer as this object is less * than, equal to, or greater than the specified object. * @param o The Object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified object. * @throws ClassCastException - if the specified object's type prevents * it from being compared to this Object. */ public int compareTo(Object o) { return compareTo((IInsurance)o); } /** * Compare two instances. This is a method in Comparator. */ public int compare(Object o1, Object o2) { return compare((IInsurance)o1, (IInsurance)o2); } /** * Compares this object with the specified Insurance object for * order. Returns a negative integer, zero, or a positive integer as * this object is less than, equal to, or greater than the specified * object. * @param other The Insurance object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified * Insurance object. */ public int compareTo(IInsurance other) { return compare(this, other); } /** * Compares its two IInsurance arguments for order. Returns a negative * integer, zero, or a positive integer as the first argument is less * than, equal to, or greater than the second. * @param o1 the first IInsurance object to be compared. * @param o2 the second IInsurance object to be compared. * @return a negative integer, zero, or a positive integer as the first * object is less than, equal to, or greater than the second object. */ public static int compare(IInsurance o1, IInsurance o2) { return EqualityHelper.compare(o1.getInsid(), o2.getInsid()); } /** * Indicates whether some other object is "equal to" this one. * @param obj the object with which to compare. * @return true if this object is the same as the obj * argument; false otherwise. */ public boolean equals(Object obj) { if (obj instanceof IInsurance) { return compareTo((IInsurance)obj) == 0; } return false; } /** * Returns a hash code value for the object. * @return a hash code value for this object. */ public int hashCode() { return (int)insid; } /** * This class is used to represent the application * identifier for the Insurance class. */ public static class Oid implements Serializable, Comparable { /** * This field represents the application identifier for the * Insurance class. It must match the field in the * Insurance class in both name and type. */ public long insid; /** * The required public no-args constructor. */ public Oid() { } /** * Initialize with an insurance identifier. * @param insid the insurance ID. */ public Oid(long insid) { this.insid = insid; } public Oid(String s) { insid = Long.parseLong(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + insid;} /** */ public boolean equals(java.lang.Object obj) { if( obj==null || !this.getClass().equals(obj.getClass()) ) return( false ); Oid o=(Oid) obj; if( this.insid!=o.insid ) return( false ); return( true ); } /** */ public int hashCode() { return( (int) insid ); } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } /** */ public int compareTo(Object obj) { // may throw ClassCastException which the user must handle Oid other = (Oid) obj; if( insid < other.insid ) return -1; if( insid > other.insid ) return 1; return 0; } } } tck/src/java/org/apache/jdo/tck/pc/company/IPartTimeEmployee.java100664 2163 12500110373 25200 0ustarmbouschenstaff 0 0 /* * 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.company; /** * This interface represents the persistent state of PartTimeEmployee. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ public interface IPartTimeEmployee extends IEmployee { double getWage(); void setWage(double wage); } tck/src/java/org/apache/jdo/tck/pc/company/IPerson.java100664 3037 12500110373 23222 0ustarmbouschenstaff 0 0 /* * 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.company; import java.util.Date; import java.util.Map; /** * This interface represents the persistent state of Person. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ public interface IPerson { long getPersonid(); String getLastname(); String getFirstname(); String getMiddlename(); IAddress getAddress(); Date getBirthdate(); Map getPhoneNumbers(); void setPersonid(long personid); void setLastname(String lastname); void setFirstname(String firstname); void setMiddlename(String middlename); void setAddress(IAddress address); void setBirthdate(Date birthdate); void setPhoneNumbers(Map phoneNumbers); } tck/src/java/org/apache/jdo/tck/pc/company/IProject.java100664 2576 12500110372 23370 0ustarmbouschenstaff 0 0 /* * 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.company; import java.math.BigDecimal; import java.util.Set; /** * This interface represents the persistent state of Project. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ public interface IProject { long getProjid(); String getName(); BigDecimal getBudget(); Set getReviewers(); Set getMembers(); void setProjid(long projid); void setName(String name); void setBudget(BigDecimal budget); void setReviewers(Set reviewers); void setMembers(Set employees); } tck/src/java/org/apache/jdo/tck/pc/company/MedicalInsurance.java100664 10231 12500110372 25062 0ustarmbouschenstaff 0 0 /* * 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.company; import java.io.Serializable; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a dental insurance carrier selection for a * particular Employee. */ public class MedicalInsurance extends Insurance implements IMedicalInsurance { private String planType; // possible values: "PPO", "EPO", "NPO" /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public MedicalInsurance() {} /** * Construct a MedicalInsurance instance. * @param insid The insurance instance identifier. * @param carrier The insurance carrier. * @param planType The planType. */ public MedicalInsurance(long insid, String carrier, String planType) { super(insid, carrier); this.planType = planType; } /** * Construct a MedicalInsurance instance. * @param insid The insurance instance identifier. * @param carrier The insurance carrier. * @param employee The employee associated with this insurance. * @param planType The planType. */ public MedicalInsurance(long insid, String carrier, IEmployee employee, String planType) { super(insid, carrier, employee); this.planType = planType; } /** * Get the insurance planType. * @return The insurance planType. */ public String getPlanType() { return planType; } /** * Set the insurance planType. * @param planType The insurance planType. */ public void setPlanType(String planType) { this.planType = planType; } /** * Returns a String representation of a MedicalInsurance * object. * @return a String representation of a MedicalInsurance * object. */ public String toString() { return "MedicalInsurance(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(super.getFieldRepr()); rc.append(", planType ").append(planType); return rc.toString(); } /** * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the other Object. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { IMedicalInsurance otherIns = (IMedicalInsurance)other; String where = "MedicalInsurance<" + getInsid() + ">"; return super.deepCompareFields(otherIns, helper) & helper.equals(planType, otherIns.getPlanType(), where + ".planType"); } } tck/src/java/org/apache/jdo/tck/pc/company/MeetingRoom.java100664 20341 12500110373 24105 0ustarmbouschenstaff 0 0 /* * 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.company; import java.io.Serializable; import java.util.Comparator; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a meeting room. */ public class MeetingRoom implements IMeetingRoom, Serializable, Comparable, Comparator, DeepEquality { private long roomid; private String name; /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public MeetingRoom() {} /** * This constructor initializes the MeetingRoom components. * @param roomid The room ID. * @param name The name of the room */ public MeetingRoom(long roomid, String name) { this.roomid = roomid; this.name = name; } /** * Get the room id associated with this object. * @return the room id. */ public long getRoomid() { return roomid; } /** * Set the id associated with this object. * @param id the id. */ public void setRoomid(long id) { if (this.roomid != 0) throw new IllegalStateException("Id is already set."); this.roomid = id; } /** * Get the name of the meeting room. * @return The name of the meeting room. */ public String getName() { return name; } /** * Set the name of the meeting room. * @param name The name. */ public void setName(String name) { this.name = name; } /** * Returns a String representation of a Address object. * @return a String representation of a MeetingRoom object. */ public String toString() { return "MeetingRoom(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(roomid); rc.append(", name ").append(name); return rc.toString(); } /** * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the specified Person. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { IMeetingRoom otherMeetingRoom = (IMeetingRoom)other; String where = "MeetingRoom<" + roomid + ">"; return helper.equals(roomid, otherMeetingRoom.getRoomid(), where + ".roomid") & helper.equals(name, otherMeetingRoom.getName(), where + ".name"); } /** * Compares this object with the specified object for order. Returns a * negative integer, zero, or a positive integer as this object is less * than, equal to, or greater than the specified object. * @param o The Object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified object. * @throws ClassCastException - if the specified object's type prevents * it from being compared to this Object. */ public int compareTo(Object o) { return compareTo((IMeetingRoom)o); } /** * Compare two instances. This is a method in Comparator. */ public int compare(Object o1, Object o2) { return compare((IMeetingRoom)o1, (IMeetingRoom)o2); } /** * Compares this object with the specified MeetingRoom object for * order. Returns a negative integer, zero, or a positive integer as * this object is less than, equal to, or greater than the specified * object. * @param other The MeetingRoom object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified MeetingRoom * object. */ public int compareTo(IMeetingRoom other) { return compare(this, other); } /** * Compares its two IMeetingRoom arguments for order. Returns a negative * integer, zero, or a positive integer as the first argument is less * than, equal to, or greater than the second. * @param o1 the first IMeetingRoom object to be compared. * @param o2 the second IMeetingRoom object to be compared. * @return a negative integer, zero, or a positive integer as the first * object is less than, equal to, or greater than the second object. */ public static int compare(IMeetingRoom o1, IMeetingRoom o2) { return EqualityHelper.compare(o1.getRoomid(), o2.getRoomid()); } /** * Indicates whether some other object is "equal to" this one. * @param obj the object with which to compare. * @return true if this object is the same as the obj * argument; false otherwise. */ public boolean equals(Object obj) { if (obj instanceof IMeetingRoom) { return compareTo((IMeetingRoom)obj) == 0; } return false; } /** * Returns a hash code value for the object. * @return a hash code value for this object. */ public int hashCode() { return (int)roomid; } /** * This class is used to represent the application identifier * for the MeetingRoom class. */ public static class Oid implements Serializable, Comparable { /** * This is the identifier field for MeetingRoom and must * correspond in type and name to the field in * MeetingRoom. */ public long roomid; /** The required public, no-arg constructor. */ public Oid() { roomid = 0; } /** * A constructor to initialize the identifier field. * @param roomid the id of the MeetingRoom. */ public Oid(long roomid) { this.roomid = roomid; } public Oid(String s) { roomid = Long.parseLong(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + roomid;} /** */ public boolean equals(java.lang.Object obj) { if( obj==null || !this.getClass().equals(obj.getClass()) ) return( false ); Oid o = (Oid) obj; if( this.roomid != o.roomid ) return( false ); return( true ); } /** */ public int hashCode() { return( (int) roomid ); } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } /** */ public int compareTo(Object obj) { // may throw ClassCastException which the user must handle Oid other = (Oid) obj; if( roomid < other.roomid ) return -1; if( roomid > other.roomid ) return 1; return 0; } } } tck/src/java/org/apache/jdo/tck/pc/company/PartTimeEmployee.java100664 11014 12500110373 25102 0ustarmbouschenstaff 0 0 /* * 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.company; import java.util.Date; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a part-time employee. */ public class PartTimeEmployee extends Employee implements IPartTimeEmployee { private double wage; /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public PartTimeEmployee() {} /** * Construct a part-time employee. * @param personid The identifier for the person. * @param first The person's first name. * @param last The person's last name. * @param middle The person's middle name. * @param born The person's birthdate. * @param hired The date the person was hired. * @param wage The person's wage. */ public PartTimeEmployee(long personid, String first, String last, String middle, Date born, Date hired, double wage ) { super(personid, first, last, middle, born, hired); this.wage = wage; } /** * Construct a part-time employee. * @param personid The identifier for the person. * @param first The person's first name. * @param last The person's last name. * @param middle The person's middle name. * @param born The person's birthdate. * @param addr The person's address. * @param hired The date the person was hired. * @param wage The person's wage. */ public PartTimeEmployee(long personid, String first, String last, String middle, Date born, IAddress addr, Date hired, double wage ) { super(personid, first, last, middle, born, addr, hired); this.wage = wage; } /** * Get the wage of the part-time employee. * @return The wage of the part-time employee. */ public double getWage() { return wage; } /** * Set the wage of the part-time employee. * @param wage The wage of the part-time employee. */ public void setWage(double wage) { this.wage = wage; } /** * Returns a String representation of a PartTimeEmployee object. * @return a String representation of a PartTimeEmployee object. */ public String toString() { return "PartTimeEmployee(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ public String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(super.getFieldRepr()); rc.append(", $" + wage); return rc.toString(); } /** * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the specified * PartTimeEmployee. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { IPartTimeEmployee otherEmp = (IPartTimeEmployee)other; String where = "PartTimeEmployee<" + getPersonid() + ">"; return super.deepCompareFields(otherEmp, helper) & helper.closeEnough(wage, otherEmp.getWage(), where + ".wage"); } } tck/src/java/org/apache/jdo/tck/pc/company/Person.java100664 32732 12500110373 23135 0ustarmbouschenstaff 0 0 /* * 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.company; import java.io.Serializable; import java.text.SimpleDateFormat; import java.util.Collections; import java.util.Comparator; import java.util.Date; import java.util.HashMap; import java.util.Map; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a person. */ public class Person implements IPerson, Serializable, Comparable, Comparator, DeepEquality { private long personid; private String firstname; private String lastname; private String middlename; private Date birthdate; private Address address; // maps phone number types ("home", "work", "mobile", etc.) // to phone numbers specified as String private Map phoneNumbers = new HashMap(); protected static SimpleDateFormat formatter = new SimpleDateFormat("d/MMM/yyyy"); /** This is the JDO-required no-args constructor. */ protected Person() {} /** * Construct a Person instance. * @param personid The person identifier. * @param firstname The person's first name. * @param lastname The person's last name. * @param middlename The person's middle name. * @param birthdate The person's birthdate. */ public Person(long personid, String firstname, String lastname, String middlename, Date birthdate) { this.personid = personid; this.firstname = firstname; this.lastname = lastname; this.middlename = middlename; this.birthdate = birthdate; } /** * Construct a Person instance. * @param personid The person identifier. * @param firstname The person's first name. * @param lastname The person's last name. * @param middlename The person's middle name. * @param birthdate The person's birthdate. * @param address The person's address. */ public Person(long personid, String firstname, String lastname, String middlename, Date birthdate, IAddress address) { this(personid, firstname, lastname, middlename, birthdate); this.address = (Address)address; } /** * Set the id associated with this object. * @param id the id. */ public void setPersonid(long id) { if (this.personid != 0) throw new IllegalStateException("Id is already set."); this.personid = id; } /** * Get the person's id. * @return The personid. */ public long getPersonid() { return personid; } /** * Set the person's id. * @param personid The personid. */ public void setLastname(long personid) { this.personid = personid; } /** * Get the person's last name. * @return The last name. */ public String getLastname() { return lastname; } /** * Set the person's last name. * @param lastname The last name. */ public void setLastname(String lastname) { this.lastname = lastname; } /** * Get the person's first name. * @return The first name. */ public String getFirstname() { return firstname; } /** * Set the person's first name. * @param firstname The first name. */ public void setFirstname(String firstname) { this.firstname = firstname; } /** * Get the person's middle name. * @return The middle name. */ public String getMiddlename() { return middlename; } /** * Set the person's middle name. * @param middlename The middle name. */ public void setMiddlename(String middlename) { this.middlename = middlename; } /** * Get the address. * @return The address. */ public IAddress getAddress() { return address; } /** * Set the address. * @param address The address. */ public void setAddress(IAddress address) { this.address = (Address)address; } /** * Get the person's birthdate. * @return The person's birthdate. */ public Date getBirthdate() { return birthdate; } /** * Set the person's birthdate. * @param birthdate The person's birthdate. */ public void setBirthdate(Date birthdate) { this. birthdate = birthdate; } /** * Get the map of phone numbers as an unmodifiable map. * @return The map of phone numbers, as an unmodifiable map. */ public Map getPhoneNumbers() { return Collections.unmodifiableMap(phoneNumbers); } /** * Get the phone number for the specified phone number type. * @param type The phone number type ("home", "work", "mobile", etc.). * @return The phone number associated with specified type, or * null if there was no phone number for the type. */ public String getPhoneNumber(String type) { return (String)phoneNumbers.get(type); } /** * Associates the specified phone number with the specified type in the * map of phone numbers of this person. * @param type The phone number type ("home", "work", "mobile", etc.). * @param phoneNumber The phone number * @return The previous phone number associated with specified type, or * null if there was no phone number for the type. */ public String putPhoneNumber(String type, String phoneNumber) { return (String)phoneNumbers.put(type, phoneNumber); } /** * Remove a phoneNumber from the map of phone numbers. * @param type The phone number type ("home", "work", "mobile", etc.). * @return The previous phone number associated with specified type, or * null if there was no phone number for the type. */ public String removePhoneNumber(String type) { return (String)phoneNumbers.remove(type); } /** * Set the phoneNumber map to be in this person. * @param phoneNumbers The map of phoneNumbers for this person. */ public void setPhoneNumbers(Map phoneNumbers) { // workaround: create a new HashMap, because fostore does not // support LinkedHashMap this.phoneNumbers = (phoneNumbers != null) ? new HashMap(phoneNumbers) : null; } /** * Returns a String representation of a Person object. * @return a string representation of a Person object. */ public String toString() { return "Person(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(personid); rc.append(", ").append(lastname); rc.append(", ").append(firstname); rc.append(", born ").append( birthdate==null ? "null" : formatter.format(birthdate)); rc.append(", phone ").append(phoneNumbers); return rc.toString(); } /** * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the specified Person. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { IPerson otherPerson = (IPerson)other; String where = "Person<" + personid + ">"; return helper.equals(personid, otherPerson.getPersonid(), where + ".personid") & helper.equals(firstname, otherPerson.getFirstname(), where + ".firstname") & helper.equals(lastname, otherPerson.getLastname(), where + ".lastname") & 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"); } /** * Compares this object with the specified object for order. Returns a * negative integer, zero, or a positive integer as this object is less * than, equal to, or greater than the specified object. * @param o The Object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified object. * @throws ClassCastException - if the specified object's type prevents * it from being compared to this Object. */ public int compareTo(Object o) { return compareTo((IPerson)o); } /** * Compare two instances. This is a method in Comparator. */ public int compare(Object o1, Object o2) { return compare((IPerson)o1, (IPerson)o2); } /** * Compares this object with the specified Person object for * order. Returns a negative integer, zero, or a positive integer as * this object is less than, equal to, or greater than the specified * object. * @param other The Person object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified Person * object. */ public int compareTo(IPerson other) { return compare(this, other); } /** * Compares its two IPerson arguments for order. Returns a negative * integer, zero, or a positive integer as the first argument is less * than, equal to, or greater than the second. * @param o1 the first IPerson object to be compared. * @param o2 the second IPerson object to be compared. * @return a negative integer, zero, or a positive integer as the first * object is less than, equal to, or greater than the second object. */ public static int compare(IPerson o1, IPerson o2) { return EqualityHelper.compare(o1.getPersonid(), o2.getPersonid()); } /** * Indicates whether some other object is "equal to" this one. * @param obj the object with which to compare. * @return true if this object is the same as the obj * argument; false otherwise. */ public boolean equals(Object obj) { if (obj instanceof IPerson) { return compareTo((IPerson)obj) == 0; } return false; } /** * Returns a hash code value for the object. * @return a hash code value for this object. */ public int hashCode() { return (int)personid; } /** * This class is used to represent the application identifier * for the Person class. */ public static class Oid implements Serializable, Comparable { /** * This field represents the identifier for the Person * class. It must match a field in the Person class in * both name and type. */ public long personid; /** * The required public no-arg constructor. */ public Oid() { } /** * Initialize the identifier. * @param personid The person identifier. */ public Oid(long personid) { this.personid = personid; } public Oid(String s) { personid = Long.parseLong(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + personid;} /** */ public boolean equals(java.lang.Object obj) { if( obj==null || !this.getClass().equals(obj.getClass()) ) return( false ); Oid o = (Oid) obj; if( this.personid != o.personid ) return( false ); return( true ); } /** */ public int hashCode() { return( (int) personid ); } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } /** */ public int compareTo(Object obj) { // may throw ClassCastException which the user must handle Oid other = (Oid) obj; if( personid < other.personid ) return -1; if( personid > other.personid ) return 1; return 0; } } } tck/src/java/org/apache/jdo/tck/pc/company/PIAddress.java100664 2614 12500110372 23460 0ustarmbouschenstaff 0 0 /* * 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.company; /** * This interface represents the persistent state of Address. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ public interface PIAddress extends IAddress { long getAddrid(); String getStreet(); String getCity(); String getState(); String getZipcode(); String getCountry(); void setAddrid(long addrid); void setStreet(String street); void setCity(String city); void setState(String state); void setZipcode(String zipcode); void setCountry(String country); } tck/src/java/org/apache/jdo/tck/pc/company/PICompany.java100664 2670 12500110372 23503 0ustarmbouschenstaff 0 0 /* * 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.company; import java.util.Date; import java.util.Set; /** * This interface represents the persistent state of Company. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ public interface PICompany extends ICompany { //temporary for test. No methods should be here IAddress getAddress(); long getCompanyid(); Set getDepartments(); Date getFounded(); String getName(); void setAddress(IAddress a); void setCompanyid(long id); void setDepartments(Set depts); void setFounded(Date date); void setName(String string); } tck/src/java/org/apache/jdo/tck/pc/company/PIDentalInsurance.java100664 2334 12500110373 25152 0ustarmbouschenstaff 0 0 /* * 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.company; import java.math.BigDecimal; /** * This interface represents the persistent state of DentalInsurance. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ public interface PIDentalInsurance extends PIInsurance, IDentalInsurance { BigDecimal getLifetimeOrthoBenefit(); void setLifetimeOrthoBenefit(BigDecimal lifetimeOrthoBenefit); } tck/src/java/org/apache/jdo/tck/pc/company/PIDepartment.java100664 2744 12500110373 24203 0ustarmbouschenstaff 0 0 /* * 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.company; import java.util.Set; /** * This interface represents the persistent state of Department. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ public interface PIDepartment extends IDepartment { long getDeptid(); String getName(); ICompany getCompany(); IEmployee getEmployeeOfTheMonth(); Set getEmployees(); Set getFundedEmps(); void setDeptid(long deptid); void setName(String name); void setCompany(ICompany company); void setEmployeeOfTheMonth(IEmployee employeeOfTheMonth); void setEmployees(Set employees); void setFundedEmps(Set employees); } tck/src/java/org/apache/jdo/tck/pc/company/PIEmployee.java100664 4207 12500110372 23652 0ustarmbouschenstaff 0 0 /* * 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.company; import java.util.Date; import java.util.Set; /** * This interface represents the persistent state of Employee. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ public interface PIEmployee extends PIPerson, IEmployee { Date getHiredate(); double getWeeklyhours(); Set getReviewedProjects(); Set getProjects(); IDentalInsurance getDentalInsurance(); IMedicalInsurance getMedicalInsurance(); IDepartment getDepartment(); IDepartment getFundingDept(); IEmployee getManager(); Set getTeam(); IEmployee getMentor(); IEmployee getProtege(); IEmployee getHradvisor(); Set getHradvisees(); void setHiredate(Date hiredate); void setWeeklyhours(double weeklyhours); void setReviewedProjects(Set reviewedProjects); void setProjects(Set projects); void setDentalInsurance(IDentalInsurance dentalInsurance); void setMedicalInsurance(IMedicalInsurance medicalInsurance); void setDepartment(IDepartment department); void setFundingDept(IDepartment department); void setManager(IEmployee manager); void setTeam(Set team); void setMentor(IEmployee mentor); void setProtege(IEmployee protege); void setHradvisor(IEmployee hradvisor); void setHradvisees(Set hradvisees); } tck/src/java/org/apache/jdo/tck/pc/company/PIFullTimeEmployee.java100664 2217 12500110372 25313 0ustarmbouschenstaff 0 0 /* * 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.company; /** * This interface represents the persistent state of FullTimeEmployee. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ public interface PIFullTimeEmployee extends PIEmployee, IFullTimeEmployee { double getSalary(); void setSalary(double salary); } tck/src/java/org/apache/jdo/tck/pc/company/PIInsurance.java100664 2355 12500110373 24025 0ustarmbouschenstaff 0 0 /* * 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.company; /** * This interface represents the persistent state of Insurance. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ public interface PIInsurance extends IInsurance { long getInsid(); String getCarrier(); IEmployee getEmployee(); void setInsid(long insid); void setCarrier(String carrier); void setEmployee(IEmployee employee); } tck/src/java/org/apache/jdo/tck/pc/company/PIMedicalInsurance.java100664 2226 12500110372 25300 0ustarmbouschenstaff 0 0 /* * 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.company; /** * This interface represents the persistent state of MedicalInsurance. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ public interface PIMedicalInsurance extends PIInsurance, IMedicalInsurance { String getPlanType(); void setPlanType(String planType); } tck/src/java/org/apache/jdo/tck/pc/company/PIMeetingRoom.java100664 2251 12500110372 24315 0ustarmbouschenstaff 0 0 /* * 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.company; /** * This interface represents the persistent state of MeetingRoom. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ public interface PIMeetingRoom extends IMeetingRoom { long getRoomid(); String getName(); void setRoomid(long roomid); void setName(String name); } tck/src/java/org/apache/jdo/tck/pc/company/PIPartTimeEmployee.java100664 2210 12500110372 25310 0ustarmbouschenstaff 0 0 /* * 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.company; /** * This interface represents the persistent state of PartTimeEmployee. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ public interface PIPartTimeEmployee extends PIEmployee, IPartTimeEmployee { double getWage(); void setWage(double wage); } tck/src/java/org/apache/jdo/tck/pc/company/PIPerson.java100664 3060 12500110373 23336 0ustarmbouschenstaff 0 0 /* * 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.company; import java.util.Date; import java.util.Map; /** * This interface represents the persistent state of Person. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ public interface PIPerson extends IPerson { long getPersonid(); String getLastname(); String getFirstname(); String getMiddlename(); IAddress getAddress(); Date getBirthdate(); Map getPhoneNumbers(); void setPersonid(long personid); void setLastname(String lastname); void setFirstname(String firstname); void setMiddlename(String middlename); void setAddress(IAddress address); void setBirthdate(Date birthdate); void setPhoneNumbers(Map phoneNumbers); } tck/src/java/org/apache/jdo/tck/pc/company/PIProject.java100664 2620 12500110372 23476 0ustarmbouschenstaff 0 0 /* * 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.company; import java.math.BigDecimal; import java.util.Set; /** * This interface represents the persistent state of Project. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ public interface PIProject extends IProject { long getProjid(); String getName(); BigDecimal getBudget(); Set getReviewers(); Set getMembers(); void setProjid(long projid); void setName(String name); void setBudget(BigDecimal budget); void setReviewers(Set reviewers); void setMembers(Set employees); } tck/src/java/org/apache/jdo/tck/pc/company/Project.java100664 26553 12500110373 23301 0ustarmbouschenstaff 0 0 /* * 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.company; import java.io.Serializable; import java.io.ObjectInputStream; import java.io.IOException; import java.util.Collections; import java.util.Comparator; import java.util.Set; import java.util.HashSet; import java.math.BigDecimal; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a project, a budgeted task with one or more * employees working on it. */ public class Project implements IProject, Serializable, Comparable, Comparator, DeepEquality { private long projid; private String name; private BigDecimal budget; private transient Set reviewers = new HashSet(); // element type is Employee private transient Set members = new HashSet(); // element type is Employee /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public Project() {} /** * Initialize a project. * @param projid The project identifier. * @param name The name of the project. * @param budget The budget for the project. */ public Project(long projid, String name, BigDecimal budget) { this.projid = projid; this.name = name; this.budget = budget; } /** * Set the id associated with this object. * @param id the id. */ public void setProjid(long id) { if (this.projid != 0) throw new IllegalStateException("Id is already set."); this.projid = id; } /** * Get the project ID. * @return The project ID. */ public long getProjid() { return projid; } /** * Get the name of the project. * @return The name of the project. */ public String getName() { return name; } /** * Set the name of the project. * @param name The name of the project. */ public void setName(String name) { this.name = name; } /** * Get the project's budget. * @return The project's budget. */ public BigDecimal getBudget() { return budget; } /** * Set the project's budget. * @param budget The project's budget. */ public void setBudget(BigDecimal budget) { this.budget = budget; } /** * Get the reviewers associated with this project. */ public Set getReviewers() { return Collections.unmodifiableSet(reviewers); } /** * Add a reviewer to the project. * @param emp The employee to add as a reviewer. */ public void addReviewer(Employee emp) { reviewers.add(emp); } /** * Remove a reviewer from the project. * @param emp The employee to remove as a reviewer of this project. */ public void removeReviewer(Employee emp) { reviewers.remove(emp); } /** * Set the reviewers associated with this project. * @param reviewers The set of reviewers to associate with this project. */ public void setReviewers(Set reviewers) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this.reviewers = (reviewers != null) ? new HashSet(reviewers) : null; } /** * Get the project members. * @return The members of the project is returned as an unmodifiable * set of Employees. */ public Set getMembers() { return Collections.unmodifiableSet(members); } /** * Add a new member to the project. * @param emp The employee to add to the project. */ public void addMember(Employee emp) { members.add(emp); } /** * Remove a member from the project. * @param emp The employee to remove from the project. */ public void removeMember(Employee emp) { members.remove(emp); } /** * Set the members of the project. * @param employees The set of employees to be the members of this * project. */ public void setMembers(Set employees) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this.members = (employees != null) ? new HashSet(employees) : null; } /** Serialization support: initialize transient fields. */ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); reviewers = new HashSet(); members = new HashSet(); } /** * Returns a String representation of a Project object. * @return a String representation of a Project object. */ public String toString() { return "Project(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(projid); rc.append(", name ").append(name); rc.append(", budget ").append(budget); return rc.toString(); } /** * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the specified Person. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { IProject otherProject = (IProject)other; String where = "Project<" + projid + ">"; return helper.equals(projid, otherProject.getProjid(), where + ".projid") & helper.equals(name, otherProject.getName(), where + ".name") & helper.equals(budget, otherProject.getBudget(), where + ".budget") & helper.deepEquals(reviewers, otherProject.getReviewers(), where + ".reviewers") & helper.deepEquals(members, otherProject.getMembers(), where + ".members"); } /** * Compares this object with the specified object for order. Returns a * negative integer, zero, or a positive integer as this object is less * than, equal to, or greater than the specified object. * @param o The Object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified object. * @throws ClassCastException - if the specified object's type prevents * it from being compared to this Object. */ public int compareTo(Object o) { return compareTo((IProject)o); } /** * Compare two instances. This is a method in Comparator. */ public int compare(Object o1, Object o2) { return compare((IProject)o1, (IProject)o2); } /** * Compares this object with the specified Project object for * order. Returns a negative integer, zero, or a positive integer as * this object is less than, equal to, or greater than the specified * object. * @param other The Project object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified Project * object. */ public int compareTo(IProject other) { return compare(this, other); } /** * Compares its two IProject arguments for order. Returns a negative * integer, zero, or a positive integer as the first argument is less * than, equal to, or greater than the second. * @param o1 the first IProject object to be compared. * @param o2 the second IProject object to be compared. * @return a negative integer, zero, or a positive integer as the first * object is less than, equal to, or greater than the second object. */ public static int compare(IProject o1, IProject o2) { return EqualityHelper.compare(o1.getProjid(), o2.getProjid()); } /** * Indicates whether some other object is "equal to" this one. * @param obj the object with which to compare. * @return true if this object is the same as the obj * argument; false otherwise. */ public boolean equals(Object obj) { if (obj instanceof IProject) { return compareTo((IProject)obj) == 0; } return false; } /** * Returns a hash code value for the object. * @return a hash code value for this object. */ public int hashCode() { return (int)projid; } /** * This class is used to represent the application identity * for the Project class. */ public static class Oid implements Serializable, Comparable { /** * This field represents the identifier for the * Project class. It must match a field in the * Project class in both name and type. */ public long projid; /** * The required public no-arg constructor. */ public Oid() { } /** * Initialize the application identifier with a project ID. * @param projid The id of the project. */ public Oid(long projid) { this.projid = projid; } public Oid(String s) { projid = Long.parseLong(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + projid;} /** */ public boolean equals(java.lang.Object obj) { if( obj==null || !this.getClass().equals(obj.getClass()) ) return( false ); Oid o = (Oid) obj; if( this.projid != o.projid ) return( false ); return( true ); } /** */ public int hashCode() { return( (int) projid ); } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } /** */ public int compareTo(Object obj) { // may throw ClassCastException which the user must handle Oid other = (Oid) obj; if( projid < other.projid ) return -1; if( projid > other.projid ) return 1; return 0; } } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedFC/CompanyFactoryAnnotatedFCAppConcrete.java100664 5431 12500110373 33043 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedFC; import javax.jdo.PersistenceManager; import org.apache.jdo.tck.pc.company.*; /* * CompanyFactoryAnnotatedPMFieldClass.java * * This class uses the PersistenceManager.newInstance method with the concrete * class as a parameter. */ public class CompanyFactoryAnnotatedFCAppConcrete implements CompanyFactoryNewInstance { PersistenceManager pm = null; /** * Creates a new instance of CompanyFactoryAnnotatedPMFieldClass */ public CompanyFactoryAnnotatedFCAppConcrete(PersistenceManager pm) { this.pm = pm; } public Class[] getTearDownClasses() { return new Class[] { FCAppDentalInsurance.class, FCAppMedicalInsurance.class, FCAppPartTimeEmployee.class, FCAppFullTimeEmployee.class, FCAppProject.class, FCAppDepartment.class, FCAppMeetingRoom.class, FCAppCompany.class, FCAppAddress.class }; } public IAddress newAddress() { return (IAddress) new FCAppAddress(); } public IMeetingRoom newMeetingRoom() { return (IMeetingRoom) new FCAppMeetingRoom(); } public ICompany newCompany() { return (ICompany) new FCAppCompany(); } public IDentalInsurance newDentalInsurance() { return (IDentalInsurance) new FCAppDentalInsurance(); } public IDepartment newDepartment() { return (IDepartment) new FCAppDepartment(); } public IFullTimeEmployee newFullTimeEmployee() { return (IFullTimeEmployee) new FCAppFullTimeEmployee(); } public IMedicalInsurance newMedicalInsurance() { return (IMedicalInsurance) new FCAppMedicalInsurance(); } public IPartTimeEmployee newPartTimeEmployee() { return (IPartTimeEmployee) new FCAppPartTimeEmployee(); } public IProject newProject() { return (IProject) new FCAppProject(); } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedFC/CompanyFactoryAnnotatedFCAppPM.java100664 5624 12500110373 31621 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedFC; import javax.jdo.PersistenceManager; import org.apache.jdo.tck.pc.company.*; /* * CompanyFactoryAnnotatedPMFieldClass.java * * This class uses the PersistenceManager.newInstance method with the concrete * class as a parameter. */ public class CompanyFactoryAnnotatedFCAppPM implements CompanyFactoryNewInstance { PersistenceManager pm = null; /** * Creates a new instance of CompanyFactoryAnnotatedPMFieldClass */ public CompanyFactoryAnnotatedFCAppPM(PersistenceManager pm) { this.pm = pm; } public Class[] getTearDownClasses() { return new Class[] { FCAppDentalInsurance.class, FCAppMedicalInsurance.class, FCAppPartTimeEmployee.class, FCAppFullTimeEmployee.class, FCAppProject.class, FCAppDepartment.class, FCAppMeetingRoom.class, FCAppCompany.class, FCAppAddress.class }; } public IAddress newAddress() { return (IAddress)pm.newInstance(FCAppAddress.class); } public IMeetingRoom newMeetingRoom() { return (IMeetingRoom)pm.newInstance(FCAppMeetingRoom.class); } public ICompany newCompany() { return (ICompany)pm.newInstance(FCAppCompany.class); } public IDentalInsurance newDentalInsurance() { return (IDentalInsurance)pm.newInstance(FCAppDentalInsurance.class); } public IDepartment newDepartment() { return (IDepartment)pm.newInstance(FCAppDepartment.class); } public IFullTimeEmployee newFullTimeEmployee() { return (IFullTimeEmployee)pm.newInstance(FCAppFullTimeEmployee.class); } public IMedicalInsurance newMedicalInsurance() { return (IMedicalInsurance)pm.newInstance(FCAppMedicalInsurance.class); } public IPartTimeEmployee newPartTimeEmployee() { return (IPartTimeEmployee)pm.newInstance(FCAppPartTimeEmployee.class); } public IProject newProject() { return (IProject)pm.newInstance(FCAppProject.class); } } ././@LongLink100644 0 0 146 12500111677 10254 Lustar 0 0 tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedFC/CompanyFactoryAnnotatedFCConcreteDelegator.javatck/src/java/org/apache/jdo/tck/pc/companyAnnotatedFC/CompanyFactoryAnnotatedFCConcreteDelegator.jav100664 3144 12500110373 34067 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedFC; import javax.jdo.PersistenceManager; import org.apache.jdo.tck.pc.company.CompanyFactoryAnnotatedAbstractDelegator; /* * CompanyFactoryAnnotatedPMFieldClass.java * * This class uses the PersistenceManager.newInstance method with the concrete * class as a parameter. */ public class CompanyFactoryAnnotatedFCConcreteDelegator extends CompanyFactoryAnnotatedAbstractDelegator { /** * Creates a new instance of CompanyFactory */ public CompanyFactoryAnnotatedFCConcreteDelegator(PersistenceManager pm) { super(pm); if (isAppIdentity){ delegate = new CompanyFactoryAnnotatedFCAppConcrete(pm); } else { //datastoreidentity delegate = new CompanyFactoryAnnotatedFCDSConcrete(pm); } } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedFC/CompanyFactoryAnnotatedFCDSConcrete.java100664 5377 12500110373 32642 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedFC; import javax.jdo.PersistenceManager; import org.apache.jdo.tck.pc.company.*; /* * CompanyFactoryAnnotatedFCDSPM.java * * This class uses the PersistenceManager.newInstance method with the concrete * class as a parameter. */ public class CompanyFactoryAnnotatedFCDSConcrete implements CompanyFactoryNewInstance { PersistenceManager pm = null; /** * Creates a new instance of CompanyFactoryAnnotatedPMFieldClass */ public CompanyFactoryAnnotatedFCDSConcrete(PersistenceManager pm) { this.pm = pm; } public Class[] getTearDownClasses() { return new Class[] { FCDSDentalInsurance.class, FCDSMedicalInsurance.class, FCDSPartTimeEmployee.class, FCDSFullTimeEmployee.class, FCDSProject.class, FCDSDepartment.class, FCDSMeetingRoom.class, FCDSCompany.class, FCDSAddress.class }; } public IAddress newAddress() { return (IAddress) new FCDSAddress(); } public IMeetingRoom newMeetingRoom() { return (IMeetingRoom) new FCDSMeetingRoom(); } public ICompany newCompany() { return (ICompany) new FCDSCompany(); } public IDentalInsurance newDentalInsurance() { return (IDentalInsurance) new FCDSDentalInsurance(); } public IDepartment newDepartment() { return (IDepartment) new FCDSDepartment(); } public IFullTimeEmployee newFullTimeEmployee() { return (IFullTimeEmployee) new FCDSFullTimeEmployee(); } public IMedicalInsurance newMedicalInsurance() { return (IMedicalInsurance) new FCDSMedicalInsurance(); } public IPartTimeEmployee newPartTimeEmployee() { return (IPartTimeEmployee) new FCDSPartTimeEmployee(); } public IProject newProject() { return (IProject) new FCDSProject(); } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedFC/CompanyFactoryAnnotatedFCDSPM.java100664 5572 12500110373 31411 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedFC; import javax.jdo.PersistenceManager; import org.apache.jdo.tck.pc.company.*; /* * CompanyFactoryAnnotatedFCDSPM.java * * This class uses the PersistenceManager.newInstance method with the concrete * class as a parameter. */ public class CompanyFactoryAnnotatedFCDSPM implements CompanyFactoryNewInstance { PersistenceManager pm = null; /** * Creates a new instance of CompanyFactoryAnnotatedPMFieldClass */ public CompanyFactoryAnnotatedFCDSPM(PersistenceManager pm) { this.pm = pm; } public Class[] getTearDownClasses() { return new Class[] { FCDSDentalInsurance.class, FCDSMedicalInsurance.class, FCDSPartTimeEmployee.class, FCDSFullTimeEmployee.class, FCDSProject.class, FCDSDepartment.class, FCDSMeetingRoom.class, FCDSCompany.class, FCDSAddress.class }; } public IAddress newAddress() { return (IAddress)pm.newInstance(FCDSAddress.class); } public IMeetingRoom newMeetingRoom() { return (IMeetingRoom)pm.newInstance(FCDSMeetingRoom.class); } public ICompany newCompany() { return (ICompany)pm.newInstance(FCDSCompany.class); } public IDentalInsurance newDentalInsurance() { return (IDentalInsurance)pm.newInstance(FCDSDentalInsurance.class); } public IDepartment newDepartment() { return (IDepartment)pm.newInstance(FCDSDepartment.class); } public IFullTimeEmployee newFullTimeEmployee() { return (IFullTimeEmployee)pm.newInstance(FCDSFullTimeEmployee.class); } public IMedicalInsurance newMedicalInsurance() { return (IMedicalInsurance)pm.newInstance(FCDSMedicalInsurance.class); } public IPartTimeEmployee newPartTimeEmployee() { return (IPartTimeEmployee)pm.newInstance(FCDSPartTimeEmployee.class); } public IProject newProject() { return (IProject)pm.newInstance(FCDSProject.class); } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedFC/CompanyFactoryAnnotatedFCPMDelegator.java100664 3114 12500110373 32777 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedFC; import javax.jdo.PersistenceManager; import org.apache.jdo.tck.pc.company.CompanyFactoryAnnotatedAbstractDelegator; /* * CompanyFactoryAnnotatedPMFieldClass.java * * This class uses the PersistenceManager.newInstance method with the concrete * class as a parameter. */ public class CompanyFactoryAnnotatedFCPMDelegator extends CompanyFactoryAnnotatedAbstractDelegator { /** * Creates a new instance of CompanyFactory */ public CompanyFactoryAnnotatedFCPMDelegator(PersistenceManager pm) { super(pm); if (isAppIdentity){ delegate = new CompanyFactoryAnnotatedFCAppPM(pm); } else { //datastoreidentity delegate = new CompanyFactoryAnnotatedFCDSPM(pm); } } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedFC/CompanyFactoryAnnotatedPMFieldClass.java100664 12324 12500110373 32714 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedFC; import javax.jdo.PersistenceManager; import org.apache.jdo.tck.pc.company.*; /* * CompanyFactoryAnnotatedPMFieldClass.java * * This class uses the PersistenceManager.newInstance method with the concrete * class as a parameter. */ public class CompanyFactoryAnnotatedPMFieldClass extends org.apache.jdo.tck.pc.company.CompanyFactoryAbstractImpl { Class addressClass = null; Class dentalInsuranceClass = null; Class medicalInsuranceClass = null; Class partTimeEmployeeClass = null; Class fullTimeEmployeeClass = null; Class projectClass = null; Class departmentClass = null; Class meetingRoomClass = null; Class companyClass = null; /** * Creates a new instance of CompanyFactoryAnnotatedPMFieldClass */ public CompanyFactoryAnnotatedPMFieldClass(PersistenceManager pm) { super(pm); if (isAppIdentity){ addressClass = org.apache.jdo.tck.pc.companyAnnotatedFC.FCAppAddress.class; dentalInsuranceClass = org.apache.jdo.tck.pc.companyAnnotatedFC.FCAppDentalInsurance.class; medicalInsuranceClass = org.apache.jdo.tck.pc.companyAnnotatedFC.FCAppMedicalInsurance.class; partTimeEmployeeClass = org.apache.jdo.tck.pc.companyAnnotatedFC.FCAppPartTimeEmployee.class; fullTimeEmployeeClass = org.apache.jdo.tck.pc.companyAnnotatedFC.FCAppFullTimeEmployee.class; projectClass = org.apache.jdo.tck.pc.companyAnnotatedFC.FCAppProject.class; departmentClass = org.apache.jdo.tck.pc.companyAnnotatedFC.FCAppDepartment.class; meetingRoomClass = org.apache.jdo.tck.pc.companyAnnotatedFC.FCAppMeetingRoom.class; companyClass = org.apache.jdo.tck.pc.companyAnnotatedFC.FCAppCompany.class; } else { //datastoreidentity addressClass = org.apache.jdo.tck.pc.companyAnnotatedFC.FCDSAddress.class; dentalInsuranceClass = org.apache.jdo.tck.pc.companyAnnotatedFC.FCDSDentalInsurance.class; medicalInsuranceClass = org.apache.jdo.tck.pc.companyAnnotatedFC.FCDSMedicalInsurance.class; partTimeEmployeeClass = org.apache.jdo.tck.pc.companyAnnotatedFC.FCDSPartTimeEmployee.class; fullTimeEmployeeClass = org.apache.jdo.tck.pc.companyAnnotatedFC.FCDSFullTimeEmployee.class; projectClass = org.apache.jdo.tck.pc.companyAnnotatedFC.FCDSProject.class; departmentClass = org.apache.jdo.tck.pc.companyAnnotatedFC.FCDSDepartment.class; meetingRoomClass = org.apache.jdo.tck.pc.companyAnnotatedFC.FCDSMeetingRoom.class; companyClass = org.apache.jdo.tck.pc.companyAnnotatedFC.FCDSCompany.class; } } public Class[] getTearDownClasses() { return new Class[] { dentalInsuranceClass, medicalInsuranceClass, partTimeEmployeeClass, fullTimeEmployeeClass, projectClass, departmentClass, meetingRoomClass, companyClass }; } public IAddress newAddress() { return (IAddress)pm.newInstance(addressClass); } public IMeetingRoom newMeetingRoom() { return (IMeetingRoom)pm.newInstance(meetingRoomClass); } public ICompany newCompany() { return (ICompany)pm.newInstance(companyClass); } public IDentalInsurance newDentalInsurance() { return (IDentalInsurance)pm.newInstance(dentalInsuranceClass); } public IDepartment newDepartment() { return (IDepartment)pm.newInstance(departmentClass); } public IFullTimeEmployee newFullTimeEmployee() { return (IFullTimeEmployee)pm.newInstance(fullTimeEmployeeClass); } public IMedicalInsurance newMedicalInsurance() { return (IMedicalInsurance)pm.newInstance(medicalInsuranceClass); } public IPartTimeEmployee newPartTimeEmployee() { return (IPartTimeEmployee)pm.newInstance(partTimeEmployeeClass); } public IProject newProject() { return (IProject)pm.newInstance(projectClass); } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedFC/FCAppAddress.java100664 25204 12500110373 26171 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedFC; import java.io.Serializable; import java.util.Comparator; import javax.jdo.annotations.*; import org.apache.jdo.tck.pc.company.IAddress; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a postal address. */ @PersistenceCapable(embeddedOnly="true", requiresExtent="false") public class FCAppAddress implements IAddress, Serializable, Comparable, Comparator, DeepEquality { private long addrid; private String street; private String city; private String state; private String zipcode; private String country; /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public FCAppAddress() {} /** * This constructor initializes the FCAppAddress components. * * * @param addrid The address ID. * @param street The street address. * @param city The city. * @param state The state. * @param zipcode The zip code. * @param country The zip country. */ public FCAppAddress(long addrid, String street, String city, String state, String zipcode, String country) { this.addrid = addrid; this.street = street; this.city = city; this.state = state; this.zipcode = zipcode; this.country = country; } /** * Get the addrid associated with this object. * @return the addrid. */ public long getAddrid() { return addrid; } /** * Set the id associated with this object. * @param id the id. */ public void setAddrid(long id) { if (this.addrid != 0) throw new IllegalStateException("Id is already set."); this.addrid = id; } /** * Get the street component of the address. * @return The street component of the address. */ public String getStreet() { return street; } /** * Set the street component of the address. * @param street The street component. */ public void setStreet(String street) { this.street = street; } /** * Get the city. * @return The city component of the address. */ public String getCity() { return city; } /** * Set the city component of the address. * @param city The city. */ public void setCity(String city) { this.city = city; } /** * Get the state component of the address. * @return The state. */ public String getState() { return state; } /** * Set the state component of the address. * @param state The state. */ public void setState(String state) { this.state = state; } /** * Get the zipcode component of the address. * @return The zipcode. */ public String getZipcode() { return zipcode; } /** * Set the zip code component of the address. * @param zipcode The zipcode. */ public void setZipcode(String zipcode) { this.zipcode = zipcode; } /** * Get the country component of the address. * @return The country. */ public String getCountry() { return country; } /** * Set the country component of the address. * @param country The country. */ public void setCountry(String country) { this.country = country; } /** * Returns a String representation of a Address object. * @return a String representation of a Address object. */ public String toString() { return "Address(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(addrid); rc.append(", street ").append(street); rc.append(", city ").append(city); rc.append(", state ").append(state); rc.append(", zipcode ").append(zipcode); rc.append(", country ").append(country); return rc.toString(); } /** * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the specified Person. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { FCAppAddress otherAddress = (FCAppAddress)other; String where = "Address<" + addrid + ">"; return helper.equals(addrid, otherAddress.getAddrid(), where + ".addrid") & helper.equals(street, otherAddress.getStreet(), where + ".street") & helper.equals(city, otherAddress.getCity(), where + ".city") & helper.equals(state, otherAddress.getState(), where + ".state") & helper.equals(zipcode, otherAddress.getZipcode(), where + ".zipcode") & helper.equals(country, otherAddress.getCountry(), where + ".country"); } /** * Compares this object with the specified object for order. Returns a * negative integer, zero, or a positive integer as this object is less * than, equal to, or greater than the specified object. * @param o The Object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified object. * @throws ClassCastException - if the specified object's type prevents * it from being compared to this Object. */ public int compareTo(Object o) { return compareTo((FCAppAddress)o); } /** * Compare two instances. This is a method in Comparator. */ public int compare(Object o1, Object o2) { return compare((FCAppAddress)o1, (FCAppAddress)o2); } /** * Compares this object with the specified Address object for * order. Returns a negative integer, zero, or a positive integer as * this object is less than, equal to, or greater than the specified * object. * @param other The Address object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified Address * object. */ public int compareTo(FCAppAddress other) { return compare(this, other); } /** * Compares its two FCAppAddress arguments for order. Returns a negative * integer, zero, or a positive integer as the first argument is less * than, equal to, or greater than the second. * * * @param o1 the firstFCAppAddresss object to be compared. * @param o2 the second FFCPIAddressobject to be compared. * @return a negative integer, zero, or a positive integer as the first * object is less than, equal to, or greater than the second object. */ public static int compare(FCAppAddress o1, FCAppAddress o2) { return EqualityHelper.compare(o1.getAddrid(), o2.getAddrid()); } /** * Indicates whether some other object is "equal to" this one. * @param obj the object with which to compare. * @return true if this object is the same as the obj * argument; false otherwise. */ public boolean equals(Object obj) { if (obj instanceof FCAppAddress) { return compareTo((FCAppAddress)obj) == 0; } return false; } /** * Returns a hash code value for the object. * @return a hash code value for this object. */ public int hashCode() { return (int)addrid; } /** * This class is used to represent the application identifier * for the Address class. */ public static class Oid implements Serializable, Comparable { /** * This is the identifier field for Address and must * correspond in type and name to the field in * Address. */ public long addrid; /** The required public, no-arg constructor. */ public Oid() { addrid = 0; } /** * A constructor to initialize the identifier field. * @param addrid the id of the Address. */ public Oid(long addrid) { this.addrid = addrid; } public Oid(String s) { addrid = Long.parseLong(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + addrid;} /** */ public boolean equals(java.lang.Object obj) { if( obj==null || !this.getClass().equals(obj.getClass()) ) return( false ); Oid o = (Oid) obj; if( this.addrid != o.addrid ) return( false ); return( true ); } /** */ public int hashCode() { return( (int) addrid ); } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } /** */ public int compareTo(Object obj) { // may throw ClassCastException which the user must handle Oid other = (Oid) obj; if( addrid < other.addrid ) return -1; if( addrid > other.addrid ) return 1; return 0; } } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedFC/FCAppCompany.java100664 32063 12500110373 26213 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedFC; import javax.jdo.annotations.*; import java.io.Serializable; import java.io.ObjectInputStream; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.Collections; import java.util.Comparator; import java.util.Set; import java.util.HashSet; import java.util.Date; import org.apache.jdo.tck.pc.company.IAddress; import org.apache.jdo.tck.pc.company.ICompany; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents information about a company. */ @PersistenceCapable(identityType=IdentityType.APPLICATION,table="companies") @Inheritance(strategy=InheritanceStrategy.NEW_TABLE) @Discriminator(strategy=DiscriminatorStrategy.CLASS_NAME, column="DISCRIMINATOR") public class FCAppCompany implements ICompany, Serializable, Comparable, Comparator, DeepEquality { @Persistent(primaryKey="true") @Column(name="ID") private long companyid; @Column(name="NAME", jdbcType="VARCHAR") private String name; @Column(name="FOUNDEDDATE") private Date founded; @Persistent(persistenceModifier=PersistenceModifier.PERSISTENT) @Embedded(nullIndicatorColumn="COUNTRY", members={ @Persistent(name="addrid", columns=@Column(name="ADDRID")), @Persistent(name="street", columns=@Column(name="STREET")), @Persistent(name="city", columns=@Column(name="CITY")), @Persistent(name="state", columns=@Column(name="STATE")), @Persistent(name="zipcode", columns=@Column(name="ZIPCODE")), @Persistent(name="country", columns=@Column(name="COUNTRY")) }) private FCAppAddress address; @Persistent(persistenceModifier=PersistenceModifier.PERSISTENT, mappedBy="company") @Element(types=org.apache.jdo.tck.pc.companyAnnotatedFC.FCAppDepartment.class) private transient Set departments = new HashSet(); protected static SimpleDateFormat formatter = new SimpleDateFormat("d/MMM/yyyy"); /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public FCAppCompany() {} /** * * Initialize the FCAppCompany instance. * * @param companyid The company id. * @param name The company name. * @param founded The date the company was founded. */ public FCAppCompany(long companyid, String name, Date founded) { this.companyid = companyid; this.name = name; this.founded = founded; } /** * Initialize the Company instance. * @param companyid The company id. * @param name The company name. * @param founded The date the company was founded. * @param addr The company's address. */ public FCAppCompany(long companyid, String name, Date founded, IAddress addr) { this(companyid, name, founded); this.address = (FCAppAddress)addr; } /** * Get the company id. * @return The company id. */ public long getCompanyid() { return companyid; } /** * Set the id associated with this object. * @param id the id. */ public void setCompanyid(long id) { if (this.companyid != 0) throw new IllegalStateException("Id is already set."); this.companyid = id; } /** * Get the name of the company. * @return The name of the company. */ public String getName() { return name; } /** * Set the name of the company. * @param name The value to use for the name of the company. */ public void setName(String name) { this.name = name; } /** * Get the date that the company was founded. * @return The date the company was founded. */ public Date getFounded() { return founded; } /** * Set the date that the company was founded. * @param founded The date to set that the company was founded. */ public void setFounded(Date founded) { this.founded = founded; } /** * Get the address of the company. * @return The primary address of the company. */ public IAddress getAddress() { return address; } /** * Set the primary address for the company. * @param address The address to set for the company. */ public void setAddress(IAddress address) { this.address = (FCAppAddress)address; } /** * Get the departments contained in the company. * * @return An unmodifiable Set that contains all the * FCAppDepartments of the company. */ public Set getDepartments() { return Collections.unmodifiableSet(departments); } /** * Add a FCAppDepartment instance to the company. * * @param dept The FCAppDepartment instance to add. */ public void addDepartment(FCAppDepartment dept) { departments.add(dept); } /** * Remove a FCAppDepartment instance from the company. * * @param dept The FCAppDepartment instance to remove. */ public void removeDepartment(FCAppDepartment dept) { departments.remove(dept); } /** * Initialize the set of FCAppDepartments in the company to the * parameter. * * @param departments The set of FCAppDepartments for the * company. */ public void setDepartments(Set departments) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this.departments = (departments != null) ? new HashSet(departments) : null; } /** Serialization support: initialize transient fields. */ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); departments = new HashSet(); } /** * Returns a String representation of a Company object. * @return a String representation of a Company object. */ public String toString() { return "Company(" + getFieldRepr()+ ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(companyid); rc.append(", name ").append(name); rc.append(", founded ").append( founded==null ? "null" : formatter.format(founded)); return rc.toString(); } /** * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the specified Person. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { FCAppCompany otherCompany = (FCAppCompany)other; String where = "Company<" + companyid + ">"; return helper.equals(companyid, otherCompany.getCompanyid(), where + ".companyid") & helper.equals(name, otherCompany.getName(), where + ".name") & helper.equals(founded, otherCompany.getFounded(), where + ".founded") & helper.deepEquals(address, otherCompany.getAddress(), where + ".address") & helper.deepEquals(departments, otherCompany.getDepartments(), where + ".departments"); } /** * Compares this object with the specified object for order. Returns a * negative integer, zero, or a positive integer as this object is less * than, equal to, or greater than the specified object. * @param o The Object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified object. * @throws ClassCastException - if the specified object's type prevents * it from being compared to this Object. */ public int compareTo(Object o) { return compareTo((FCAppCompany)o); } /** * Compare two instances. This is a method in Comparator. */ public int compare(Object o1, Object o2) { return compare((FCAppCompany)o1, (FCAppCompany)o2); } /** * Compares this object with the specified Company object for * order. Returns a negative integer, zero, or a positive integer as * this object is less than, equal to, or greater than the specified * object. * @param other The Company object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified Company * object. */ public int compareTo(FCAppCompany other) { return compare(this, other); } /** * Compares its two ICompany arguments for order. Returns a negative * integer, zero, or a positive integer as the first argument is less * than, equal to, or greater than the second. * @param o1 the first ICompany object to be compared. * @param o2 the second ICompany object to be compared. * @return a negative integer, zero, or a positive integer as the first * object is less than, equal to, or greater than the second object. */ public static int compare(FCAppCompany o1, FCAppCompany o2) { return EqualityHelper.compare(o1.getCompanyid(), o2.getCompanyid()); } /** * Indicates whether some other object is "equal to" this one. * @param obj the object with which to compare. * @return true if this object is the same as the obj * argument; false otherwise. */ public boolean equals(Object obj) { if (obj instanceof FCAppCompany) { return compareTo((FCAppCompany)obj) == 0; } return false; } /** * Returns a hash code value for the object. * @return a hash code value for this object. */ public int hashCode() { return (int)companyid; } /** * The class to be used as the application identifier * for the Company class. It consists of both the company * name and the date that the company was founded. */ public static class Oid implements Serializable, Comparable { /** * This field is part of the identifier and should match in name * and type with a field in the Company class. */ public long companyid; /** The required public no-arg constructor. */ public Oid() { } /** * Initialize the identifier. * @param companyid The id of the company. */ public Oid(long companyid) { this.companyid = companyid; } public Oid(String s) { companyid = Long.parseLong(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + companyid;} /** */ public boolean equals(Object obj) { if (obj==null || !this.getClass().equals(obj.getClass())) return false; Oid o = (Oid) obj; if (this.companyid != o.companyid) return false; return true; } /** */ public int hashCode() { return (int)companyid; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } /** */ public int compareTo(Object obj) { // may throw ClassCastException which the user must handle Oid other = (Oid) obj; if( companyid < other.companyid ) return -1; if( companyid > other.companyid ) return 1; return 0; } } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedFC/FCAppDentalInsurance.java100664 11333 12500110373 27661 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedFC; import javax.jdo.annotations.*; import java.math.BigDecimal; import org.apache.jdo.tck.pc.company.IDentalInsurance; import org.apache.jdo.tck.pc.company.IEmployee; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a dental insurance carrier selection for a * particular Employee. */ @PersistenceCapable(identityType=IdentityType.APPLICATION) public class FCAppDentalInsurance extends FCAppInsurance implements IDentalInsurance { @Column(name="LIFETIME_ORTHO_BENEFIT") private BigDecimal lifetimeOrthoBenefit; /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public FCAppDentalInsurance() {} /** * Construct a DentalInsurance instance. * @param insid The insurance instance identifier. * @param carrier The insurance carrier. * @param lifetimeOrthoBenefit The lifetimeOrthoBenefit. */ public FCAppDentalInsurance(long insid, String carrier, BigDecimal lifetimeOrthoBenefit) { super(insid, carrier); this.lifetimeOrthoBenefit = lifetimeOrthoBenefit; } /** * Construct a FCAppDentalInsurance instance. * * @param insid The insurance instance identifier. * @param carrier The insurance carrier. * @param employee The employee associated with this insurance. * @param lifetimeOrthoBenefit The lifetimeOrthoBenefit. */ public FCAppDentalInsurance(long insid, String carrier, IEmployee employee, BigDecimal lifetimeOrthoBenefit) { super(insid, carrier, employee); this.lifetimeOrthoBenefit = lifetimeOrthoBenefit; } /** * Get the insurance lifetimeOrthoBenefit. * @return The insurance lifetimeOrthoBenefit. */ public BigDecimal getLifetimeOrthoBenefit() { return lifetimeOrthoBenefit; } /** * Set the insurance lifetimeOrthoBenefit. * @param lifetimeOrthoBenefit The insurance lifetimeOrthoBenefit. */ public void setLifetimeOrthoBenefit(BigDecimal lifetimeOrthoBenefit) { this.lifetimeOrthoBenefit = lifetimeOrthoBenefit; } /** * Returns a String representation of a FCAppDentalInsurance * object. * * @return a String representation of a FCAppDentalInsurance * object. */ public String toString() { return "FCDentalInsurance(" + getFieldRepr()+ ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(super.getFieldRepr()); rc.append(", lifetimeOrthoBenefit ").append(lifetimeOrthoBenefit); return rc.toString(); } /** * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the other Object. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { FCAppDentalInsurance otherIns = (FCAppDentalInsurance)other; String where = "FCDentalInsurance<" + getInsid() + ">"; return super.deepCompareFields(otherIns, helper) & helper.equals(lifetimeOrthoBenefit, otherIns.getLifetimeOrthoBenefit(), where + ".lifetimeOrthoBenefit"); } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedFC/FCAppDepartment.java100664 34614 12500110373 26714 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedFC; import javax.jdo.annotations.*; import java.io.Serializable; import java.io.ObjectInputStream; import java.io.IOException; import java.util.Collections; import java.util.Comparator; import java.util.HashSet; import java.util.List; import java.util.Set; import org.apache.jdo.tck.pc.company.ICompany; import org.apache.jdo.tck.pc.company.IDepartment; import org.apache.jdo.tck.pc.company.IEmployee; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a department within a company. */ @PersistenceCapable(identityType=IdentityType.APPLICATION, table="departments") @Inheritance(strategy=InheritanceStrategy.NEW_TABLE) @Discriminator(strategy=DiscriminatorStrategy.CLASS_NAME, column="DISCRIMINATOR") public class FCAppDepartment implements IDepartment, Serializable, Comparable, Comparator, DeepEquality { public static final int RECOMMENDED_NO_OF_EMPS = 2; @PrimaryKey @Column(name="ID") private long deptid; @Column(name="NAME") private String name; @Column(name="COMPANYID") private FCAppCompany company; @Column(name="EMP_OF_THE_MONTH") private FCAppEmployee employeeOfTheMonth; @Persistent(mappedBy="department") @Element(types=org.apache.jdo.tck.pc.companyAnnotatedFC.FCAppEmployee.class) private transient Set employees = new HashSet(); @Element(types=org.apache.jdo.tck.pc.companyAnnotatedFC.FCAppEmployee.class) @Persistent(mappedBy="fundingDept") private transient Set fundedEmps = new HashSet(); /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public FCAppDepartment() {} /** * Construct a Department instance. * @param deptid The department id. * @param name The name of the department. */ public FCAppDepartment(long deptid, String name) { this.deptid = deptid; this.name = name; } /** * Construct a Department instance. * @param deptid The department id. * @param name The name of the department. * @param company The company that the department is associated with. */ public FCAppDepartment(long deptid, String name, ICompany company) { this.deptid = deptid; this.name = name; this.company = (FCAppCompany)company; } /** * Construct a Department instance. * @param deptid The department id. * @param name The name of the department. * @param company The company that the department is associated with. * @param employeeOfTheMonth The employee of the month the * department is associated with. */ public FCAppDepartment(long deptid, String name, ICompany company, IEmployee employeeOfTheMonth) { this.deptid = deptid; this.name = name; this.company = (FCAppCompany)company; this.employeeOfTheMonth = (FCAppEmployee)employeeOfTheMonth; } /** * Set the id associated with this object. * @param id the id. */ public void setDeptid(long id) { if (this.deptid != 0) throw new IllegalStateException("Id is already set."); this.deptid = id; } /** * Get the department id. * @return The department id. */ public long getDeptid() { return deptid; } /** * Get the name of the department. * @return The name of the department. */ public String getName() { return name; } /** * Set the name of the department. * @param name The name to set for the department. */ public void setName(String name) { this.name = name; } /** * Get the company associated with the department. * @return The company. */ public ICompany getCompany() { return company; } /** * Set the company for the department. * @param company The company to associate with the department. */ public void setCompany(ICompany company) { this.company = (FCAppCompany)company; } /** * Get the employee of the month associated with the department. * @return The employee of the month. */ public IEmployee getEmployeeOfTheMonth() { return employeeOfTheMonth; } /** * Set the employee of the month for the department. * @param employeeOfTheMonth The employee of the month to * associate with the department. */ public void setEmployeeOfTheMonth(IEmployee employeeOfTheMonth) { this.employeeOfTheMonth = (FCAppEmployee)employeeOfTheMonth; } /** * Get the employees in the department as an unmodifiable set. * @return The set of employees in the department, as an unmodifiable * set. */ public Set getEmployees() { return Collections.unmodifiableSet(employees); } /** * Add an employee to the department. * @param emp The employee to add to the department. */ public void addEmployee(FCAppEmployee emp) { employees.add(emp); } /** * Remove an employee from the department. * @param emp The employee to remove from the department. */ public void removeEmployee(FCAppEmployee emp) { employees.remove(emp); } /** * Set the employees to be in this department. * @param employees The set of employees for this department. */ public void setEmployees(Set employees) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this.employees = (employees != null) ? new HashSet(employees) : null; } /** * Get the funded employees in the department as an unmodifiable set. * @return The set of funded employees in the department, as an * unmodifiable set. */ public Set getFundedEmps() { return Collections.unmodifiableSet(fundedEmps); } /** * Add an employee to the collection of funded employees of this * department. * @param emp The employee to add to the department. */ public void addFundedEmp(FCAppEmployee emp) { fundedEmps.add(emp); } /** * Remove an employee from collection of funded employees of this * department. * @param emp The employee to remove from the department. */ public void removeFundedEmp(FCAppEmployee emp) { fundedEmps.remove(emp); } /** * Set the funded employees to be in this department. * @param employees The set of funded employees for this department. */ public void setFundedEmps(Set employees) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this.fundedEmps = (fundedEmps != null) ? new HashSet(employees) : null; } @Override public List getMeetingRooms() { // TODO Auto-generated method stub return null; } @Override public void setMeetingRooms(List rooms) { // TODO Auto-generated method stub } /** Serialization support: initialize transient fields. */ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); employees = new HashSet(); fundedEmps = new HashSet(); } /** * * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the other FCAppDepartment. * * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { FCAppDepartment otherDept = (FCAppDepartment)other; String where = "FCDepartment<" + deptid + ">"; return helper.equals(deptid, otherDept.getDeptid(), where + ".deptid") & helper.equals(name, otherDept.getName(), where + ".name") & helper.deepEquals(company, otherDept.getCompany(), where + ".company") & helper.deepEquals(employeeOfTheMonth, otherDept.getEmployeeOfTheMonth(), where + ".employeeOfTheMonth") & helper.deepEquals(employees, otherDept.getEmployees(), where + ".employees") & helper.deepEquals(fundedEmps, otherDept.getFundedEmps(), where + ".fundedEmps"); } /** * Returns a String representation of a FCAppDepartment object. * * @return a String representation of a FCAppDepartment object. */ public String toString() { return "FCDepartment(" + getFieldRepr()+ ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(deptid); rc.append(", name ").append(name); return rc.toString(); } /** * Compares this object with the specified object for order. Returns a * negative integer, zero, or a positive integer as this object is less * than, equal to, or greater than the specified object. * @param o The Object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified object. * @throws ClassCastException - if the specified object's type prevents * it from being compared to this Object. */ public int compareTo(Object o) { return compareTo((FCAppDepartment)o); } /** * Compare two instances. This is a method in Comparator. */ public int compare(Object o1, Object o2) { return compare((FCAppDepartment)o1, (FCAppDepartment)o2); } /** * Compares this object with the specified Department object for * order. Returns a negative integer, zero, or a positive integer as * this object is less than, equal to, or greater than the specified * object. * @param other The Department object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified * Department object. */ public int compareTo(FCAppDepartment other) { return compare(this, other); } /** * Compares its two IDepartment arguments for order. Returns a negative * integer, zero, or a positive integer as the first argument is less * than, equal to, or greater than the second. * @param o1 the first IDepartment object to be compared. * @param o2 the second IDepartment object to be compared. * @return a negative integer, zero, or a positive integer as the first * object is less than, equal to, or greater than the second object. */ public static int compare(FCAppDepartment o1, FCAppDepartment o2) { return EqualityHelper.compare(o1.getDeptid(), o2.getDeptid()); } /** * Indicates whether some other object is "equal to" this one. * @param obj the object with which to compare. * @return true if this object is the same as the obj * argument; false otherwise. */ public boolean equals(Object obj) { if (obj instanceof FCAppDepartment) { return compareTo((FCAppDepartment)obj) == 0; } return false; } /** * Returns a hash code value for the object. * @return a hash code value for this object. */ public int hashCode() { return (int)deptid; } /** * The application identity class associated with the * Department class. */ public static class Oid implements Serializable, Comparable { /** * This field represents the application identifier field * for the Department class. * It must match in name and type with the field in the * Department class. */ public long deptid; /** * The required public, no-arg constructor. */ public Oid() { } /** * A constructor to initialize the identifier field. * @param deptid the deptid of the Department. */ public Oid(long deptid) { this.deptid = deptid; } public Oid(String s) { deptid = Long.parseLong(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + deptid;} /** */ public boolean equals(java.lang.Object obj) { if( obj==null || !this.getClass().equals(obj.getClass()) ) return( false ); Oid o = (Oid) obj; if( this.deptid != o.deptid ) return( false ); return( true ); } /** */ public int hashCode() { return( (int) deptid ); } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } /** */ public int compareTo(Object obj) { // may throw ClassCastException which the user must handle Oid other = (Oid) obj; if( deptid < other.deptid ) return -1; if( deptid > other.deptid ) return 1; return 0; } } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedFC/FCAppEmployee.java100664 41267 12500110373 26372 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedFC; import javax.jdo.annotations.*; import java.io.ObjectInputStream; import java.io.IOException; import java.util.Collections; import java.util.Date; import java.util.HashSet; import java.util.Set; import org.apache.jdo.tck.pc.company.IAddress; import org.apache.jdo.tck.pc.company.IDentalInsurance; import org.apache.jdo.tck.pc.company.IDepartment; import org.apache.jdo.tck.pc.company.IEmployee; import org.apache.jdo.tck.pc.company.IMedicalInsurance; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents an employee. */ @PersistenceCapable(identityType=IdentityType.APPLICATION) @Inheritance(strategy=InheritanceStrategy.SUPERCLASS_TABLE) public abstract class FCAppEmployee extends FCAppPerson implements IEmployee { @Column(name="HIREDATE") private Date hiredate; @Column(name="WEEKLYHOURS") private double weeklyhours; @Persistent(mappedBy="employee") private FCAppDentalInsurance dentalInsurance; @Persistent(mappedBy="employee") private FCAppMedicalInsurance medicalInsurance; @Column(name="DEPARTMENT") private FCAppDepartment department; @Column(name="FUNDINGDEPT") private FCAppDepartment fundingDept; @Column(name="MANAGER") private FCAppEmployee manager; @Column(name="MENTOR") private FCAppEmployee mentor; @Persistent(mappedBy="mentor") private FCAppEmployee protege; @Column(name="HRADVISOR") private FCAppEmployee hradvisor; @Persistent(mappedBy="reviewers") @Element(types=org.apache.jdo.tck.pc.companyAnnotatedFC.FCAppProject.class) private transient Set reviewedProjects = new HashSet(); @Persistent(mappedBy="members") @Element(types=org.apache.jdo.tck.pc.companyAnnotatedFC.FCAppProject.class) private transient Set projects = new HashSet(); @Persistent(mappedBy="manager") @Element(types=org.apache.jdo.tck.pc.companyAnnotatedFC.FCAppEmployee.class) private transient Set team = new HashSet(); @Persistent(mappedBy="hradvisor") @Element(types=org.apache.jdo.tck.pc.companyAnnotatedFC.FCAppEmployee.class) private transient Set hradvisees = new HashSet(); /** This is the JDO-required no-args constructor */ protected FCAppEmployee() {} /** * Construct an FCAppEmployee instance. * * @param personid The identifier for the person. * @param firstname The first name of the employee. * @param lastname The last name of the employee. * @param middlename The middle name of the employee. * @param birthdate The birth date of the employee. * @param hiredate The date that the employee was hired. */ public FCAppEmployee(long personid, String firstname, String lastname, String middlename, Date birthdate, Date hiredate) { super(personid, firstname, lastname, middlename, birthdate); this.hiredate = hiredate; } /** * Construct an FCAppEmployee instance. * * @param personid The identifier for the person. * @param firstname The first name of the employee. * @param lastname The last name of the employee. * @param middlename The middle name of the employee. * @param birthdate The birth date of the employee. * @param address The address of the employee. * @param hiredate The date that the employee was hired. */ public FCAppEmployee(long personid, String firstname, String lastname, String middlename, Date birthdate, IAddress address, Date hiredate) { super(personid, firstname, lastname, middlename, birthdate, (FCAppAddress)address); this.hiredate = hiredate; } /** * Get the date that the employee was hired. * @return The date the employee was hired. */ public Date getHiredate() { return hiredate; } /** * Set the date that the employee was hired. * @param hiredate The date the employee was hired. */ public void setHiredate(Date hiredate) { this.hiredate = hiredate; } /** * Get the weekly hours of the employee. * @return The number of hours per week that the employee works. */ public double getWeeklyhours() { return weeklyhours; } /** * Set the number of hours per week that the employee works. * @param weeklyhours The number of hours per week that the employee * works. */ public void setWeeklyhours(double weeklyhours) { this.weeklyhours = weeklyhours; } /** * Get the reviewed projects. * @return The reviewed projects as an unmodifiable set. */ public Set getReviewedProjects() { return Collections.unmodifiableSet(reviewedProjects); } /** * Add a reviewed project. * @param project A reviewed project. */ public void addReviewedProjects(FCAppProject project) { reviewedProjects.add(project); } /** * Remove a reviewed project. * @param project A reviewed project. */ public void removeReviewedProject(FCAppProject project) { reviewedProjects.remove(project); } /** * Set the reviewed projects for the employee. * @param reviewedProjects The set of reviewed projects. */ public void setReviewedProjects(Set reviewedProjects) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this.reviewedProjects = (reviewedProjects != null) ? new HashSet(reviewedProjects) : null; } /** * Get the employee's projects. * @return The employee's projects are returned as an unmodifiable * set. */ public Set getProjects() { return Collections.unmodifiableSet(projects); } /** * Add a project for the employee. * @param project The project. */ public void addProject(FCAppProject project) { projects.add(project); } /** * Remove a project from an employee's set of projects. * @param project The project. */ public void removeProject(FCAppProject project) { projects.remove(project); } /** * Set the projects for the employee. * @param projects The set of projects of the employee. */ public void setProjects(Set projects) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this.projects = (projects != null) ? new HashSet(projects) : null; } /** * Get the dental insurance of the employee. * @return The employee's dental insurance. */ public IDentalInsurance getDentalInsurance() { return dentalInsurance; } /** * Set the dental insurance object for the employee. * @param dentalInsurance The dental insurance object to associate with * the employee. */ public void setDentalInsurance(IDentalInsurance dentalInsurance) { this.dentalInsurance = (FCAppDentalInsurance)dentalInsurance; } /** * Get the medical insurance of the employee. * @return The employee's medical insurance. */ public IMedicalInsurance getMedicalInsurance() { return medicalInsurance; } /** * Set the medical insurance object for the employee. * @param medicalInsurance The medical insurance object to associate * with the employee. */ public void setMedicalInsurance(IMedicalInsurance medicalInsurance) { this.medicalInsurance = (FCAppMedicalInsurance)medicalInsurance; } /** * Get the employee's department. * @return The department associated with the employee. */ public IDepartment getDepartment() { return department; } /** * Set the employee's department. * @param department The department. */ public void setDepartment(IDepartment department) { this.department = (FCAppDepartment)department; } /** * Get the employee's funding department. * @return The funding department associated with the employee. */ public IDepartment getFundingDept() { return fundingDept; } /** * Set the employee's funding department. * @param department The funding department. */ public void setFundingDept(IDepartment department) { this.fundingDept = (FCAppDepartment)department; } /** * Get the employee's manager. * @return The employee's manager. */ public IEmployee getManager() { return manager; } /** * Set the employee's manager. * @param manager The employee's manager. */ public void setManager(IEmployee manager) { this.manager = (FCAppEmployee)manager; } /** * Get the employee's team. * * @return The set of FCAppEmployees on this employee's team, * returned as an unmodifiable set. */ public Set getTeam() { return Collections.unmodifiableSet(team); } /** * Add an FCAppEmployee to this employee's team. * This method sets both sides of the relationship, modifying * this employees team to include parameter emp and modifying * emp to set its manager attribute to this object. * * @param emp The FCAppEmployee to add to the team. */ public void addToTeam(FCAppEmployee emp) { team.add(emp); emp.manager = this; } /** * Remove an FCAppEmployee from this employee's team. * This method will also set the emp manager to null. * * @param emp The FCAppEmployee to remove from the team. */ public void removeFromTeam(FCAppEmployee emp) { team.remove(emp); emp.manager = null; } /** * Set the employee's team. * * @param team The set of FCAppEmployees. */ public void setTeam(Set team) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this.team = (team != null) ? new HashSet(team) : null; } /** * Set the mentor for this employee. * @param mentor The mentor for this employee. */ public void setMentor(IEmployee mentor) { this.mentor = (FCAppEmployee)mentor; } /** * Get the mentor for this employee. * @return The mentor. */ public IEmployee getMentor() { return mentor; } /** * Set the protege for this employee. * @param protege The protege for this employee. */ public void setProtege(IEmployee protege) { this.protege = (FCAppEmployee)protege; } /** * Get the protege of this employee. * @return The protege of this employee. */ public IEmployee getProtege() { return protege; } /** * Set the HR advisor for this employee. * @param hradvisor The hradvisor for this employee. */ public void setHradvisor(IEmployee hradvisor) { this.hradvisor = (FCAppEmployee)hradvisor; } /** * Get the HR advisor for the employee. * @return The HR advisor. */ public IEmployee getHradvisor() { return hradvisor; } /** * Get the HR advisees of this HR advisor. * * @return An unmodifiable Set containing the * FCAppEmployees that are HR advisees of this employee. */ public Set getHradvisees() { return Collections.unmodifiableSet(hradvisees); } /** * Add an FCAppEmployee as an advisee of this HR advisor. * This method also sets the emp hradvisor to reference * this object. In other words, both sides of the relationship are * set. * * @param emp The employee to add as an advisee. */ public void addAdvisee(FCAppEmployee emp) { hradvisees.add(emp); emp.hradvisor = this; } /** * Remove an FCAppEmployee as an advisee of this HR advisor. * This method also sets the emp hradvisor to null. * In other words, both sides of the relationship are set. * * @param emp The employee to add as an HR advisee. */ public void removeAdvisee(FCAppEmployee emp) { hradvisees.remove(emp); emp.hradvisor = null; } /** * Set the HR advisees of this HR advisor. * * @param hradvisees The FCAppEmployees that are HR advisees of * this employee. */ public void setHradvisees(Set hradvisees) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this.hradvisees = (hradvisees != null) ? new HashSet(hradvisees) : null; } /** Serialization support: initialize transient fields. */ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); reviewedProjects = new HashSet(); projects = new HashSet(); team = new HashSet(); hradvisees = new HashSet(); } /** * Return a String representation of a FCAppEmployee object. * * @return a String representation of a FCAppEmployee object. */ public String toString() { return "FCEmployee(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(super.getFieldRepr()); rc.append(", hired ").append( hiredate==null ? "null" : formatter.format(hiredate)); rc.append(", weeklyhours ").append(weeklyhours); return rc.toString(); } /** * * Returns true if all the fields of this instance are * deep equal to the corresponding fields of the specified FCAppEmployee. * * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { FCAppEmployee otherEmp = (FCAppEmployee)other; String where = "Employee<" + getPersonid() + ">"; return super.deepCompareFields(otherEmp, helper) & helper.equals(hiredate, otherEmp.getHiredate(), where + ".hiredate") & helper.closeEnough(weeklyhours, otherEmp.getWeeklyhours(), where + ".weeklyhours") & helper.deepEquals(dentalInsurance, otherEmp.getDentalInsurance(), where + ".dentalInsurance") & helper.deepEquals(medicalInsurance, otherEmp.getMedicalInsurance(), where + ".medicalInsurance") & helper.deepEquals(department, otherEmp.getDepartment(), where + ".department") & helper.deepEquals(fundingDept, otherEmp.getFundingDept(), where + ".fundingDept") & helper.deepEquals(manager, otherEmp.getManager(), where + ".manager") & helper.deepEquals(mentor, otherEmp.getMentor(), where + ".mentor") & helper.deepEquals(protege, otherEmp.getProtege(), where + ".protege") & helper.deepEquals(hradvisor, otherEmp.getHradvisor(), where + ".hradvisor") & helper.deepEquals(reviewedProjects, otherEmp.getReviewedProjects(), where + ".reviewedProjects") & helper.deepEquals(projects, otherEmp.getProjects(), where + ".projects") & helper.deepEquals(team, otherEmp.getTeam(), where + ".team") & helper.deepEquals(hradvisees, otherEmp.getHradvisees(), where + ".hradvisees"); } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedFC/FCAppFullTimeEmployee.java100664 11654 12500110373 30031 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedFC; import javax.jdo.annotations.*; import java.util.Date; import org.apache.jdo.tck.pc.company.IAddress; import org.apache.jdo.tck.pc.company.IFullTimeEmployee; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a full-time employee. */ @PersistenceCapable(identityType=IdentityType.APPLICATION) @Inheritance(strategy=InheritanceStrategy.SUPERCLASS_TABLE) public class FCAppFullTimeEmployee extends FCAppEmployee implements IFullTimeEmployee { @Column(name="SALARY") private double salary; /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public FCAppFullTimeEmployee() {} /** * Construct a full-time employee. * @param personid The person identifier. * @param first The person's first name. * @param last The person's last name. * @param middle The person's middle name. * @param born The person's birthdate. * @param hired The date that the person was hired. * @param sal The salary of the full-time employee. */ public FCAppFullTimeEmployee(long personid, String first, String last, String middle, Date born, Date hired, double sal) { super(personid, first, last, middle, born, hired); salary = sal; } /** * Construct a full-time employee. * @param personid The person identifier. * @param first The person's first name. * @param last The person's last name. * @param middle The person's middle name. * @param born The person's birthdate. * @param addr The person's address. * @param hired The date that the person was hired. * @param sal The salary of the full-time employee. */ public FCAppFullTimeEmployee(long personid, String first, String last, String middle, Date born, IAddress addr, Date hired, double sal) { super(personid, first, last, middle, born, (FCAppAddress)addr, hired); salary = sal; } /** * Get the salary of the full time employee. * @return The salary of the full time employee. */ public double getSalary() { return salary; } /** * Set the salary for the full-time employee. * @param salary The salary to set for the full-time employee. */ public void setSalary(double salary) { this.salary = salary; } /** * Return a String representation of a FCAppFullTimeEmployee object. * * @return a String representation of a FCAppFullTimeEmployee object. */ public String toString() { return "FCFullTimeEmployee(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ public String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(super.getFieldRepr()); rc.append(", $").append(salary); return rc.toString(); } /** * * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the specified * FCAppFullTimeEmployee. * * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { FCAppFullTimeEmployee otherEmp = (FCAppFullTimeEmployee)other; String where = "FCFullTimeEmployee<" + getPersonid() + ">"; return super.deepCompareFields(otherEmp, helper) & helper.closeEnough(salary, otherEmp.getSalary(), where + ".salary"); } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedFC/FCAppInsurance.java100664 23301 12500110373 26527 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedFC; import javax.jdo.annotations.*; import java.io.Serializable; import java.util.Comparator; import org.apache.jdo.tck.pc.company.IEmployee; import org.apache.jdo.tck.pc.company.IInsurance; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents an insurance carrier selection for a particular * FCAppEmployee. */ @PersistenceCapable(identityType=IdentityType.APPLICATION,table="insuranceplans" ) @Inheritance(strategy=InheritanceStrategy.NEW_TABLE) @Discriminator(strategy=DiscriminatorStrategy.CLASS_NAME, column="DISCRIMINATOR", indexed="true") @Index(name="INS_DISCRIMINATOR_INDEX", unique="false", columns=@Column(name="DISCRIMINATOR")) public class FCAppInsurance implements IInsurance, Serializable, Comparable, Comparator, DeepEquality { @PrimaryKey @Column(name="INSID") private long insid; @Column(name="CARRIER") private String carrier; @Column(name="EMPLOYEE") private FCAppEmployee employee; /** This is the JDO-required no-args constructor. */ protected FCAppInsurance() {} /** * Construct an FCAppInsurance instance. * * @param insid The insurance instance identifier. * @param carrier The insurance carrier. */ protected FCAppInsurance(long insid, String carrier) { this.insid = insid; this.carrier = carrier; } /** * Construct an FCAppInsurance instance. * * @param insid The insurance instance identifier. * @param carrier The insurance carrier. * @param employee The employee associated with this insurance. */ protected FCAppInsurance(long insid, String carrier, IEmployee employee) { this.insid = insid; this.carrier = carrier; this.employee = (FCAppEmployee)employee; } /** * Get the insurance ID. * @return the insurance ID. */ public long getInsid() { return insid; } /** * Set the insurance ID. * @param id The insurance ID value. */ public void setInsid(long id) { if (this.insid != 0) throw new IllegalStateException("Id is already set."); this.insid = id; } /** * Get the insurance carrier. * @return The insurance carrier. */ public String getCarrier() { return carrier; } /** * Set the insurance carrier. * @param carrier The insurance carrier. */ public void setCarrier(String carrier) { this.carrier = carrier; } /** * Get the associated employee. * @return The employee for this insurance. */ public IEmployee getEmployee() { return employee; } /** * Set the associated employee. * @param employee The associated employee. */ public void setEmployee(IEmployee employee) { this.employee = (FCAppEmployee)employee; } /** * Returns a String representation of a FCAppInsurance object. * * @return a String representation of a FCAppInsurance object. */ public String toString() { return "FCInsurance(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(insid); rc.append(", carrier ").append(carrier); return rc.toString(); } /** * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the other Object. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { FCAppInsurance otherIns = (FCAppInsurance)other; String where = "FCInsurance<" + insid + ">"; return helper.equals(insid, otherIns.getInsid(), where + ".insid") & helper.equals(carrier, otherIns.getCarrier(), where + ".carrier") & helper.deepEquals(employee, otherIns.getEmployee(), where + ".employee"); } /** * Compares this object with the specified object for order. Returns a * negative integer, zero, or a positive integer as this object is less * than, equal to, or greater than the specified object. * @param o The Object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified object. * @throws ClassCastException - if the specified object's type prevents * it from being compared to this Object. */ public int compareTo(Object o) { return compareTo((FCAppInsurance)o); } /** * Compare two instances. This is a method in Comparator. */ public int compare(Object o1, Object o2) { return compare((FCAppInsurance)o1, (FCAppInsurance)o2); } /** * Compares this object with the specified Insurance object for * order. Returns a negative integer, zero, or a positive integer as * this object is less than, equal to, or greater than the specified * object. * @param other The Insurance object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified * Insurance object. */ public int compareTo(FCAppInsurance other) { return compare(this, other); } /** * Compares its two IInsurance arguments for order. Returns a negative * integer, zero, or a positive integer as the first argument is less * than, equal to, or greater than the second. * @param o1 the first IInsurance object to be compared. * @param o2 the second IInsurance object to be compared. * @return a negative integer, zero, or a positive integer as the first * object is less than, equal to, or greater than the second object. */ public static int compare(FCAppInsurance o1, FCAppInsurance o2) { return EqualityHelper.compare(o1.getInsid(), o2.getInsid()); } /** * Indicates whether some other object is "equal to" this one. * @param obj the object with which to compare. * @return true if this object is the same as the obj * argument; false otherwise. */ public boolean equals(Object obj) { if (obj instanceof FCAppInsurance) { return compareTo((FCAppInsurance)obj) == 0; } return false; } /** * Returns a hash code value for the object. * @return a hash code value for this object. */ public int hashCode() { return (int)insid; } /** * This class is used to represent the application * identifier for the Insurance class. */ public static class Oid implements Serializable, Comparable { /** * This field represents the application identifier for the * Insurance class. It must match the field in the * Insurance class in both name and type. */ public long insid; /** * The required public no-args constructor. */ public Oid() { } /** * Initialize with an insurance identifier. * @param insid the insurance ID. */ public Oid(long insid) { this.insid = insid; } public Oid(String s) { insid = Long.parseLong(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + insid;} /** */ public boolean equals(java.lang.Object obj) { if( obj==null || !this.getClass().equals(obj.getClass()) ) return( false ); Oid o=(Oid) obj; if( this.insid!=o.insid ) return( false ); return( true ); } /** */ public int hashCode() { return( (int) insid ); } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } /** */ public int compareTo(Object obj) { // may throw ClassCastException which the user must handle Oid other = (Oid) obj; if( insid < other.insid ) return -1; if( insid > other.insid ) return 1; return 0; } } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedFC/FCAppMedicalInsurance.java100664 10632 12500110373 30011 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedFC; import javax.jdo.annotations.*; import org.apache.jdo.tck.pc.company.IEmployee; import org.apache.jdo.tck.pc.company.IMedicalInsurance; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a dental insurance carrier selection for a * particular Employee. */ @PersistenceCapable(identityType=IdentityType.APPLICATION) public class FCAppMedicalInsurance extends FCAppInsurance implements IMedicalInsurance { @Column(name="PLANTYPE") private String planType; // possible values: "PPO", "EPO", "NPO" /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public FCAppMedicalInsurance() {} /** * Construct a FCAppMedicalInsurance instance. * * @param insid The insurance instance identifier. * @param carrier The insurance carrier. * @param planType The planType. */ public FCAppMedicalInsurance(long insid, String carrier, String planType) { super(insid, carrier); this.planType = planType; } /** * Construct a FCAppMedicalInsurance instance. * * @param insid The insurance instance identifier. * @param carrier The insurance carrier. * @param employee The employee associated with this insurance. * @param planType The planType. */ public FCAppMedicalInsurance(long insid, String carrier, IEmployee employee, String planType) { super(insid, carrier, (FCAppEmployee)employee); this.planType = planType; } /** * Get the insurance planType. * @return The insurance planType. */ public String getPlanType() { return planType; } /** * Set the insurance planType. * @param planType The insurance planType. */ public void setPlanType(String planType) { this.planType = planType; } /** * Returns a String representation of a FCAppMedicalInsurance * object. * * @return a String representation of a FCAppMedicalInsurance * object. */ public String toString() { return "FCMedicalInsurance(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(super.getFieldRepr()); rc.append(", planType ").append(planType); return rc.toString(); } /** * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the other Object. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { FCAppMedicalInsurance otherIns = (FCAppMedicalInsurance)other; String where = "FCMedicalInsurance<" + getInsid() + ">"; return super.deepCompareFields(otherIns, helper) & helper.equals(planType, otherIns.getPlanType(), where + ".planType"); } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedFC/FCAppMeetingRoom.java100664 21302 12500110373 27024 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedFC; import javax.jdo.annotations.*; import java.io.Serializable; import java.util.Comparator; import org.apache.jdo.tck.pc.company.IMeetingRoom; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a meeting room. */ @PersistenceCapable(identityType=IdentityType.APPLICATION,table="meetingrooms") @Inheritance(strategy=InheritanceStrategy.NEW_TABLE) @Discriminator(strategy=DiscriminatorStrategy.CLASS_NAME, column="DISCRIMINATOR") public class FCAppMeetingRoom implements IMeetingRoom, Serializable, Comparable, Comparator, DeepEquality { @Persistent(primaryKey="true") @Column(name="ID") private long roomid; @Column(name="NAME", jdbcType="VARCHAR") private String name; /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public FCAppMeetingRoom() {} /** * This constructor initializes the FCAppMeetingRoom components. * @param roomid The room ID. * @param name The name of the room */ public FCAppMeetingRoom(long roomid, String name) { this.roomid = roomid; this.name = name; } /** * Get the room id associated with this object. * @return the room id. */ public long getRoomid() { return roomid; } /** * Set the id associated with this object. * @param id the id. */ public void setRoomid(long id) { if (this.roomid != 0) throw new IllegalStateException("Id is already set."); this.roomid = id; } /** * Get the name of the meeting room. * @return The name of the meeting room. */ public String getName() { return name; } /** * Set the name of the meeting room. * @param name The name. */ public void setName(String name) { this.name = name; } /** * Returns a String representation of a Address object. * @return a String representation of a FCAppMeetingRoom object. */ public String toString() { return "FCAppMeetingRoom(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(roomid); rc.append(", name ").append(name); return rc.toString(); } /** * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the specified Person. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { IMeetingRoom otherMeetingRoom = (IMeetingRoom)other; String where = "FCAppMeetingRoom<" + roomid + ">"; return helper.equals(roomid, otherMeetingRoom.getRoomid(), where + ".roomid") & helper.equals(name, otherMeetingRoom.getName(), where + ".name"); } /** * Compares this object with the specified object for order. Returns a * negative integer, zero, or a positive integer as this object is less * than, equal to, or greater than the specified object. * @param o The Object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified object. * @throws ClassCastException - if the specified object's type prevents * it from being compared to this Object. */ public int compareTo(Object o) { return compareTo((IMeetingRoom)o); } /** * Compare two instances. This is a method in Comparator. */ public int compare(Object o1, Object o2) { return compare((IMeetingRoom)o1, (IMeetingRoom)o2); } /** * Compares this object with the specified FCAppMeetingRoom object for * order. Returns a negative integer, zero, or a positive integer as * this object is less than, equal to, or greater than the specified * object. * @param other The MeetingRoom object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified MeetingRoom * object. */ public int compareTo(IMeetingRoom other) { return compare(this, other); } /** * Compares its two IMeetingRoom arguments for order. Returns a negative * integer, zero, or a positive integer as the first argument is less * than, equal to, or greater than the second. * @param o1 the first IMeetingRoom object to be compared. * @param o2 the second IMeetingRoom object to be compared. * @return a negative integer, zero, or a positive integer as the first * object is less than, equal to, or greater than the second object. */ public static int compare(IMeetingRoom o1, IMeetingRoom o2) { return EqualityHelper.compare(o1.getRoomid(), o2.getRoomid()); } /** * Indicates whether some other object is "equal to" this one. * @param obj the object with which to compare. * @return true if this object is the same as the obj * argument; false otherwise. */ public boolean equals(Object obj) { if (obj instanceof IMeetingRoom) { return compareTo((IMeetingRoom)obj) == 0; } return false; } /** * Returns a hash code value for the object. * @return a hash code value for this object. */ public int hashCode() { return (int)roomid; } /** * This class is used to represent the application identifier * for the FCAppMeetingRoom class. */ public static class Oid implements Serializable, Comparable { /** * This is the identifier field for FCAppMeetingRoom and must * correspond in type and name to the field in * FCAppMeetingRoom. */ public long roomid; /** The required public, no-arg constructor. */ public Oid() { roomid = 0; } /** * A constructor to initialize the identifier field. * @param roomid the id of the FCAppMeetingRoom. */ public Oid(long roomid) { this.roomid = roomid; } public Oid(String s) { roomid = Long.parseLong(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + roomid;} /** */ public boolean equals(java.lang.Object obj) { if( obj==null || !this.getClass().equals(obj.getClass()) ) return( false ); Oid o = (Oid) obj; if( this.roomid != o.roomid ) return( false ); return( true ); } /** */ public int hashCode() { return( (int) roomid ); } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } /** */ public int compareTo(Object obj) { // may throw ClassCastException which the user must handle Oid other = (Oid) obj; if( roomid < other.roomid ) return -1; if( roomid > other.roomid ) return 1; return 0; } } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedFC/FCAppPartTimeEmployee.java100664 11525 12500110373 30032 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedFC; import javax.jdo.annotations.*; import java.util.Date; import org.apache.jdo.tck.pc.company.IPartTimeEmployee; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a part-time employee. */ @PersistenceCapable(identityType=IdentityType.APPLICATION) @Inheritance(strategy=InheritanceStrategy.SUPERCLASS_TABLE) public class FCAppPartTimeEmployee extends FCAppEmployee implements IPartTimeEmployee { @Column(name="WAGE") private double wage; /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public FCAppPartTimeEmployee() {} /** * Construct a part-time employee. * @param personid The identifier for the person. * @param first The person's first name. * @param last The person's last name. * @param middle The person's middle name. * @param born The person's birthdate. * @param hired The date the person was hired. * @param wage The person's wage. */ public FCAppPartTimeEmployee(long personid, String first, String last, String middle, Date born, Date hired, double wage ) { super(personid, first, last, middle, born, hired); this.wage = wage; } /** * Construct a part-time employee. * @param personid The identifier for the person. * @param first The person's first name. * @param last The person's last name. * @param middle The person's middle name. * @param born The person's birthdate. * @param addr The person's address. * @param hired The date the person was hired. * @param wage The person's wage. */ public FCAppPartTimeEmployee(long personid, String first, String last, String middle, Date born, FCAppAddress addr, Date hired, double wage ) { super(personid, first, last, middle, born, addr, hired); this.wage = wage; } /** * Get the wage of the part-time employee. * @return The wage of the part-time employee. */ public double getWage() { return wage; } /** * Set the wage of the part-time employee. * @param wage The wage of the part-time employee. */ public void setWage(double wage) { this.wage = wage; } /** * Returns a String representation of a FCAppPartTimeEmployee object. * * @return a String representation of a FCAppPartTimeEmployee object. */ public String toString() { return "FCPartTimeEmployee(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ public String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(super.getFieldRepr()); rc.append(", $" + wage); return rc.toString(); } /** * * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the specified * FCAppPartTimeEmployee. * * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { FCAppPartTimeEmployee otherEmp = (FCAppPartTimeEmployee)other; String where = "FCPartTimeEmployee<" + getPersonid() + ">"; return super.deepCompareFields(otherEmp, helper) & helper.closeEnough(wage, otherEmp.getWage(), where + ".wage"); } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedFC/FCAppPerson.java100664 35604 12500110373 26057 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedFC; import javax.jdo.annotations.*; import java.io.Serializable; import java.text.SimpleDateFormat; import java.util.Collections; import java.util.Comparator; import java.util.Date; import java.util.HashMap; import java.util.Map; import org.apache.jdo.tck.pc.company.IAddress; import org.apache.jdo.tck.pc.company.IPerson; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a person. */ @PersistenceCapable(identityType=IdentityType.APPLICATION,table="persons") @Inheritance(strategy=InheritanceStrategy.NEW_TABLE) @Discriminator(strategy=DiscriminatorStrategy.CLASS_NAME, column="DISCRIMINATOR", indexed="true") public class FCAppPerson implements IPerson, Serializable, Comparable, Comparator, DeepEquality { @PrimaryKey @Column(name="PERSONID") private long personid; @Column(name="FIRSTNAME") private String firstname; @Column(name="LASTNAME") private String lastname; @Persistent(defaultFetchGroup="false") @Column(name="MIDDLENAME", allowsNull="true") private String middlename; @Column(name="BIRTHDATE") private Date birthdate; @Embedded(nullIndicatorColumn="COUNTRY", members={ @Persistent(name="addrid", columns=@Column(name="ADDRID")), @Persistent(name="street", columns=@Column(name="STREET")), @Persistent(name="city", columns=@Column(name="CITY")), @Persistent(name="state", columns=@Column(name="STATE")), @Persistent(name="zipcode", columns=@Column(name="ZIPCODE")), @Persistent(name="country", columns=@Column(name="COUNTRY")) }) private FCAppAddress address; // maps phone number types ("home", "work", "mobile", etc.) // to phone numbers specified as String @Persistent(table="employee_phoneno_type") @Join(column="EMPID") @Key(types=java.lang.String.class, column="TYPE") @Value(types=java.lang.String.class, column="PHONENO") private Map phoneNumbers = new HashMap(); protected static SimpleDateFormat formatter = new SimpleDateFormat("d/MMM/yyyy"); /** This is the JDO-required no-args constructor. */ protected FCAppPerson() {} /** * Construct a FCAppPerson instance. * * @param personid The person identifier. * @param firstname The person's first name. * @param lastname The person's last name. * @param middlename The person's middle name. * @param birthdate The person's birthdate. */ public FCAppPerson(long personid, String firstname, String lastname, String middlename, Date birthdate) { this.personid = personid; this.firstname = firstname; this.lastname = lastname; this.middlename = middlename; this.birthdate = birthdate; } /** * Construct a FCAppPerson instance. * * @param personid The person identifier. * @param firstname The person's first name. * @param lastname The person's last name. * @param middlename The person's middle name. * @param birthdate The person's birthdate. * @param address The person's address. */ public FCAppPerson(long personid, String firstname, String lastname, String middlename, Date birthdate, IAddress address) { this(personid, firstname, lastname, middlename, birthdate); this.address = (FCAppAddress)address; } /** * Set the id associated with this object. * @param id the id. */ public void setPersonid(long id) { if (this.personid != 0) throw new IllegalStateException("Id is already set."); this.personid = id; } /** * Get the person's id. * @return The personid. */ public long getPersonid() { return personid; } /** * Set the person's id. * @param personid The personid. */ public void setLastname(long personid) { this.personid = personid; } /** * Get the person's last name. * @return The last name. */ public String getLastname() { return lastname; } /** * Set the person's last name. * @param lastname The last name. */ public void setLastname(String lastname) { this.lastname = lastname; } /** * Get the person's first name. * @return The first name. */ public String getFirstname() { return firstname; } /** * Set the person's first name. * @param firstname The first name. */ public void setFirstname(String firstname) { this.firstname = firstname; } /** * Get the person's middle name. * @return The middle name. */ public String getMiddlename() { return middlename; } /** * Set the person's middle name. * @param middlename The middle name. */ public void setMiddlename(String middlename) { this.middlename = middlename; } /** * Get the address. * @return The address. */ public IAddress getAddress() { return address; } /** * Set the address. * @param address The address. */ public void setAddress(IAddress address) { this.address = (FCAppAddress)address; } /** * Get the person's birthdate. * @return The person's birthdate. */ public Date getBirthdate() { return birthdate; } /** * Set the person's birthdate. * @param birthdate The person's birthdate. */ public void setBirthdate(Date birthdate) { this. birthdate = birthdate; } /** * Get the map of phone numbers as an unmodifiable map. * @return The map of phone numbers, as an unmodifiable map. */ public Map getPhoneNumbers() { return Collections.unmodifiableMap(phoneNumbers); } /** * Get the phone number for the specified phone number type. * @param type The phone number type ("home", "work", "mobile", etc.). * @return The phone number associated with specified type, or * null if there was no phone number for the type. */ public String getPhoneNumber(String type) { return (String)phoneNumbers.get(type); } /** * Associates the specified phone number with the specified type in the * map of phone numbers of this person. * @param type The phone number type ("home", "work", "mobile", etc.). * @param phoneNumber The phone number * @return The previous phone number associated with specified type, or * null if there was no phone number for the type. */ public String putPhoneNumber(String type, String phoneNumber) { return (String)phoneNumbers.put(type, phoneNumber); } /** * Remove a phoneNumber from the map of phone numbers. * @param type The phone number type ("home", "work", "mobile", etc.). * @return The previous phone number associated with specified type, or * null if there was no phone number for the type. */ public String removePhoneNumber(String type) { return (String)phoneNumbers.remove(type); } /** * Set the phoneNumber map to be in this person. * @param phoneNumbers The map of phoneNumbers for this person. */ public void setPhoneNumbers(Map phoneNumbers) { // workaround: create a new HashMap, because fostore does not // support LinkedHashMap this.phoneNumbers = (phoneNumbers != null) ? new HashMap(phoneNumbers) : null; } /** * Returns a String representation of a FCAppPerson object. * * @return a string representation of a FCAppPerson object. */ public String toString() { return "FCPerson(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(personid); rc.append(", ").append(lastname); rc.append(", ").append(firstname); rc.append(", born ").append( birthdate==null ? "null" : formatter.format(birthdate)); rc.append(", phone ").append(phoneNumbers); return rc.toString(); } /** * * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the specified FCAppPerson. * * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { FCAppPerson otherPerson = (FCAppPerson)other; String where = "FCPerson<" + personid + ">"; return helper.equals(personid, otherPerson.getPersonid(), where + ".personid") & helper.equals(firstname, otherPerson.getFirstname(), where + ".firstname") & helper.equals(lastname, otherPerson.getLastname(), where + ".lastname") & 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"); } /** * Compares this object with the specified object for order. Returns a * negative integer, zero, or a positive integer as this object is less * than, equal to, or greater than the specified object. * @param o The Object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified object. * @throws ClassCastException - if the specified object's type prevents * it from being compared to this Object. */ public int compareTo(Object o) { return compareTo((FCAppPerson)o); } /** * Compare two instances. This is a method in Comparator. */ public int compare(Object o1, Object o2) { return compare((FCAppPerson)o1, (FCAppPerson)o2); } /** * * Compares this object with the specified FCAppPerson object for * order. Returns a negative integer, zero, or a positive integer as * this object is less than, equal to, or greater than the specified * object. * * @param other The FCAppPerson object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified FFCAppPerson * object. */ public int compareTo(FCAppPerson other) { return compare(this, other); } /** * Compares its two IPerson arguments for order. Returns a negative * integer, zero, or a positive integer as the first argument is less * than, equal to, or greater than the second. * @param o1 the first IPerson object to be compared. * @param o2 the second IPerson object to be compared. * @return a negative integer, zero, or a positive integer as the first * object is less than, equal to, or greater than the second object. */ public static int compare(FCAppPerson o1, FCAppPerson o2) { return EqualityHelper.compare(o1.getPersonid(), o2.getPersonid()); } /** * Indicates whether some other object is "equal to" this one. * @param obj the object with which to compare. * @return true if this object is the same as the obj * argument; false otherwise. */ public boolean equals(Object obj) { if (obj instanceof FCAppPerson) { return compareTo((FCAppPerson)obj) == 0; } return false; } /** * Returns a hash code value for the object. * @return a hash code value for this object. */ public int hashCode() { return (int)personid; } /** * This class is used to represent the application identifier * for the Person class. */ public static class Oid implements Serializable, Comparable { /** * This field represents the identifier for the Person * class. It must match a field in the Person class in * both name and type. */ public long personid; /** * The required public no-arg constructor. */ public Oid() { } /** * Initialize the identifier. * @param personid The person identifier. */ public Oid(long personid) { this.personid = personid; } public Oid(String s) { personid = Long.parseLong(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + personid;} /** */ public boolean equals(java.lang.Object obj) { if( obj==null || !this.getClass().equals(obj.getClass()) ) return( false ); Oid o = (Oid) obj; if( this.personid != o.personid ) return( false ); return( true ); } /** */ public int hashCode() { return( (int) personid ); } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } /** */ public int compareTo(Object obj) { // may throw ClassCastException which the user must handle Oid other = (Oid) obj; if( personid < other.personid ) return -1; if( personid > other.personid ) return 1; return 0; } } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedFC/FCAppProject.java100664 30457 12500110373 26220 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedFC; import javax.jdo.annotations.*; import java.io.Serializable; import java.io.ObjectInputStream; import java.io.IOException; import java.util.Collections; import java.util.Comparator; import java.util.Set; import java.util.HashSet; import java.math.BigDecimal; import org.apache.jdo.tck.pc.company.IProject; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a project, a budgeted task with one or more * employees working on it. */ @PersistenceCapable(identityType=IdentityType.APPLICATION, table="projects") @Inheritance(strategy=InheritanceStrategy.NEW_TABLE) @Discriminator(strategy=DiscriminatorStrategy.CLASS_NAME, column="DISCRIMINATOR") public class FCAppProject implements IProject, Serializable, Comparable, Comparator, DeepEquality { @PrimaryKey @Column(name="PROJID") private long projid; @Column(name="NAME") private String name; @Column(name="BUDGET", jdbcType="DECIMAL", length=11, scale=2) private BigDecimal budget; @Persistent(table="project_reviewer") @Element(types=org.apache.jdo.tck.pc.companyAnnotatedFC.FCAppEmployee.class, column="REVIEWER") @Join(column="PROJID", foreignKey="PR_PROJ_FK") private transient Set reviewers = new HashSet(); @Persistent(table="project_member") @Element(types=org.apache.jdo.tck.pc.companyAnnotatedFC.FCAppEmployee.class, column="MEMBER", foreignKey="PR_MEMB_FK") @Join(column="PROJID", foreignKey="PR_PROJ_FK") private transient Set members = new HashSet(); /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public FCAppProject() {} /** * Initialize a project. * @param projid The project identifier. * @param name The name of the project. * @param budget The budget for the project. */ public FCAppProject(long projid, String name, BigDecimal budget) { this.projid = projid; this.name = name; this.budget = budget; } /** * Set the id associated with this object. * @param id the id. */ public void setProjid(long id) { if (this.projid != 0) throw new IllegalStateException("Id is already set."); this.projid = id; } /** * Get the project ID. * @return The project ID. */ public long getProjid() { return projid; } /** * Get the name of the project. * @return The name of the project. */ public String getName() { return name; } /** * Set the name of the project. * @param name The name of the project. */ public void setName(String name) { this.name = name; } /** * Get the project's budget. * @return The project's budget. */ public BigDecimal getBudget() { return budget; } /** * Set the project's budget. * @param budget The project's budget. */ public void setBudget(BigDecimal budget) { this.budget = budget; } /** * Get the reviewers associated with this project. */ public Set getReviewers() { return Collections.unmodifiableSet(reviewers); } /** * Add a reviewer to the project. * @param emp The employee to add as a reviewer. */ public void addReviewer(FCAppEmployee emp) { reviewers.add(emp); } /** * Remove a reviewer from the project. * @param emp The employee to remove as a reviewer of this project. */ public void removeReviewer(FCAppEmployee emp) { reviewers.remove(emp); } /** * Set the reviewers associated with this project. * @param reviewers The set of reviewers to associate with this project. */ public void setReviewers(Set reviewers) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this.reviewers = (reviewers != null) ? new HashSet(reviewers) : null; } /** * Get the project members. * * @return The members of the project is returned as an unmodifiable * set of FCAppEmployees. */ public Set getMembers() { return Collections.unmodifiableSet(members); } /** * Add a new member to the project. * @param emp The employee to add to the project. */ public void addMember(FCAppEmployee emp) { members.add(emp); } /** * Remove a member from the project. * @param emp The employee to remove from the project. */ public void removeMember(FCAppEmployee emp) { members.remove(emp); } /** * Set the members of the project. * @param employees The set of employees to be the members of this * project. */ public void setMembers(Set employees) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this.members = (employees != null) ? new HashSet(employees) : null; } /** Serialization support: initialize transient fields. */ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); reviewers = new HashSet(); members = new HashSet(); } /** * Returns a String representation of a FCAppProject object. * * @return a String representation of a FCAppProject object. */ public String toString() { return "FCProject(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(projid); rc.append(", name ").append(name); rc.append(", budget ").append(budget); return rc.toString(); } /** * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the specified Person. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { FCAppProject otherProject = (FCAppProject)other; String where = "FCProject<" + projid + ">"; return helper.equals(projid, otherProject.getProjid(), where + ".projid") & helper.equals(name, otherProject.getName(), where + ".name") & helper.equals(budget, otherProject.getBudget(), where + ".budget") & helper.deepEquals(reviewers, otherProject.getReviewers(), where + ".reviewers") & helper.deepEquals(members, otherProject.getMembers(), where + ".members"); } /** * Compares this object with the specified object for order. Returns a * negative integer, zero, or a positive integer as this object is less * than, equal to, or greater than the specified object. * @param o The Object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified object. * @throws ClassCastException - if the specified object's type prevents * it from being compared to this Object. */ public int compareTo(Object o) { return compareTo((FCAppProject)o); } /** * Compare two instances. This is a method in Comparator. */ public int compare(Object o1, Object o2) { return compare((FCAppProject)o1, (FCAppProject)o2); } /** * * Compares this object with the specified FCAppProject object for * order. Returns a negative integer, zero, or a positive integer as * this object is less than, equal to, or greater than the specified * object. * * @param other The FCAppProject object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified FFCAppProject object. */ public int compareTo(FCAppProject other) { return compare(this, other); } /** * Compares its two IProject arguments for order. Returns a negative * integer, zero, or a positive integer as the first argument is less * than, equal to, or greater than the second. * @param o1 the first IProject object to be compared. * @param o2 the second IProject object to be compared. * @return a negative integer, zero, or a positive integer as the first * object is less than, equal to, or greater than the second object. */ public static int compare(FCAppProject o1, FCAppProject o2) { return EqualityHelper.compare(o1.getProjid(), o2.getProjid()); } /** * Indicates whether some other object is "equal to" this one. * @param obj the object with which to compare. * @return true if this object is the same as the obj * argument; false otherwise. */ public boolean equals(Object obj) { if (obj instanceof FCAppProject) { return compareTo((FCAppProject)obj) == 0; } return false; } /** * Returns a hash code value for the object. * @return a hash code value for this object. */ public int hashCode() { return (int)projid; } /** * This class is used to represent the application identity * for the FCAppProject class. */ public static class Oid implements Serializable, Comparable { /** * This field represents the identifier for the * FCAppProject class. It must match a field in the * FCAppProject class in both name and type. */ public long projid; /** * The required public no-arg constructor. */ public Oid() { } /** * Initialize the application identifier with a project ID. * @param projid The id of the project. */ public Oid(long projid) { this.projid = projid; } public Oid(String s) { projid = Long.parseLong(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + projid;} /** */ public boolean equals(java.lang.Object obj) { if( obj==null || !this.getClass().equals(obj.getClass()) ) return( false ); Oid o = (Oid) obj; if( this.projid != o.projid ) return( false ); return( true ); } /** */ public int hashCode() { return( (int) projid ); } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } /** */ public int compareTo(Object obj) { // may throw ClassCastException which the user must handle Oid other = (Oid) obj; if( projid < other.projid ) return -1; if( projid > other.projid ) return 1; return 0; } } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedFC/FCDSAddress.java100664 25144 12500110373 25762 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedFC; import java.io.Serializable; import java.util.Comparator; import javax.jdo.annotations.*; import org.apache.jdo.tck.pc.company.IAddress; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a postal address. */ @PersistenceCapable(embeddedOnly="true", requiresExtent="false") public class FCDSAddress implements IAddress, Serializable, Comparable, Comparator, DeepEquality { private long addrid; private String street; private String city; private String state; private String zipcode; private String country; /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public FCDSAddress() {} /** * This constructor initializes the FCDSAddress components. * * @param addrid The address ID. * @param street The street address. * @param city The city. * @param state The state. * @param zipcode The zip code. * @param country The zip country. */ public FCDSAddress(long addrid, String street, String city, String state, String zipcode, String country) { this.addrid = addrid; this.street = street; this.city = city; this.state = state; this.zipcode = zipcode; this.country = country; } /** * Get the addrid associated with this object. * @return the addrid. */ public long getAddrid() { return addrid; } /** * Set the id associated with this object. * @param id the id. */ public void setAddrid(long id) { if (this.addrid != 0) throw new IllegalStateException("Id is already set."); this.addrid = id; } /** * Get the street component of the address. * @return The street component of the address. */ public String getStreet() { return street; } /** * Set the street component of the address. * @param street The street component. */ public void setStreet(String street) { this.street = street; } /** * Get the city. * @return The city component of the address. */ public String getCity() { return city; } /** * Set the city component of the address. * @param city The city. */ public void setCity(String city) { this.city = city; } /** * Get the state component of the address. * @return The state. */ public String getState() { return state; } /** * Set the state component of the address. * @param state The state. */ public void setState(String state) { this.state = state; } /** * Get the zipcode component of the address. * @return The zipcode. */ public String getZipcode() { return zipcode; } /** * Set the zip code component of the address. * @param zipcode The zipcode. */ public void setZipcode(String zipcode) { this.zipcode = zipcode; } /** * Get the country component of the address. * @return The country. */ public String getCountry() { return country; } /** * Set the country component of the address. * @param country The country. */ public void setCountry(String country) { this.country = country; } /** * Returns a String representation of a Address object. * @return a String representation of a Address object. */ public String toString() { return "Address(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(addrid); rc.append(", street ").append(street); rc.append(", city ").append(city); rc.append(", state ").append(state); rc.append(", zipcode ").append(zipcode); rc.append(", country ").append(country); return rc.toString(); } /** * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the specified Person. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { FCDSAddress otherAddress = (FCDSAddress)other; String where = "Address<" + addrid + ">"; return helper.equals(addrid, otherAddress.getAddrid(), where + ".addrid") & helper.equals(street, otherAddress.getStreet(), where + ".street") & helper.equals(city, otherAddress.getCity(), where + ".city") & helper.equals(state, otherAddress.getState(), where + ".state") & helper.equals(zipcode, otherAddress.getZipcode(), where + ".zipcode") & helper.equals(country, otherAddress.getCountry(), where + ".country"); } /** * Compares this object with the specified object for order. Returns a * negative integer, zero, or a positive integer as this object is less * than, equal to, or greater than the specified object. * @param o The Object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified object. * @throws ClassCastException - if the specified object's type prevents * it from being compared to this Object. */ public int compareTo(Object o) { return compareTo((FCDSAddress)o); } /** * Compare two instances. This is a method in Comparator. */ public int compare(Object o1, Object o2) { return compare((FCDSAddress)o1, (FCDSAddress)o2); } /** * Compares this object with the specified Address object for * order. Returns a negative integer, zero, or a positive integer as * this object is less than, equal to, or greater than the specified * object. * @param other The Address object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified Address * object. */ public int compareTo(FCDSAddress other) { return compare(this, other); } /** * Compares its two FCDSAddress arguments for order. Returns a negative * integer, zero, or a positive integer as the first argument is less * than, equal to, or greater than the second. * * @param o1 the first FCDSAddress object to be compared. * @param o2 the second FFCDSAddressobject to be compared. * @return a negative integer, zero, or a positive integer as the first * object is less than, equal to, or greater than the second object. */ public static int compare(FCDSAddress o1, FCDSAddress o2) { return EqualityHelper.compare(o1.getAddrid(), o2.getAddrid()); } /** * Indicates whether some other object is "equal to" this one. * @param obj the object with which to compare. * @return true if this object is the same as the obj * argument; false otherwise. */ public boolean equals(Object obj) { if (obj instanceof FCDSAddress) { return compareTo((FCDSAddress)obj) == 0; } return false; } /** * Returns a hash code value for the object. * @return a hash code value for this object. */ public int hashCode() { return (int)addrid; } /** * This class is used to represent the application identifier * for the Address class. */ public static class Oid implements Serializable, Comparable { /** * This is the identifier field for Address and must * correspond in type and name to the field in * Address. */ public long addrid; /** The required public, no-arg constructor. */ public Oid() { addrid = 0; } /** * A constructor to initialize the identifier field. * @param addrid the id of the Address. */ public Oid(long addrid) { this.addrid = addrid; } public Oid(String s) { addrid = Long.parseLong(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + addrid;} /** */ public boolean equals(java.lang.Object obj) { if( obj==null || !this.getClass().equals(obj.getClass()) ) return( false ); Oid o = (Oid) obj; if( this.addrid != o.addrid ) return( false ); return( true ); } /** */ public int hashCode() { return( (int) addrid ); } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } /** */ public int compareTo(Object obj) { // may throw ClassCastException which the user must handle Oid other = (Oid) obj; if( addrid < other.addrid ) return -1; if( addrid > other.addrid ) return 1; return 0; } } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedFC/FCDSCompany.java100664 32052 12500110373 25777 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedFC; import javax.jdo.annotations.*; import java.io.Serializable; import java.io.ObjectInputStream; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.Collections; import java.util.Comparator; import java.util.Set; import java.util.HashSet; import java.util.Date; import org.apache.jdo.tck.pc.company.IAddress; import org.apache.jdo.tck.pc.company.ICompany; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents information about a company. */ @PersistenceCapable(table="companies") @Inheritance(strategy=InheritanceStrategy.NEW_TABLE) @Discriminator(strategy=DiscriminatorStrategy.CLASS_NAME, column="DISCRIMINATOR") @DatastoreIdentity(strategy=IdGeneratorStrategy.IDENTITY, column="DATASTORE_IDENTITY") public class FCDSCompany implements ICompany, Serializable, Comparable, Comparator, DeepEquality { @Column(name="ID") private long companyid; @Column(name="NAME", jdbcType="VARCHAR") private String name; @Column(name="FOUNDEDDATE") private Date founded; @Persistent(persistenceModifier=PersistenceModifier.PERSISTENT) @Embedded(nullIndicatorColumn="COUNTRY", members={ @Persistent(name="addrid", columns=@Column(name="ADDRID")), @Persistent(name="street", columns=@Column(name="STREET")), @Persistent(name="city", columns=@Column(name="CITY")), @Persistent(name="state", columns=@Column(name="STATE")), @Persistent(name="zipcode", columns=@Column(name="ZIPCODE")), @Persistent(name="country", columns=@Column(name="COUNTRY")) }) private FCDSAddress address; @Persistent(persistenceModifier=PersistenceModifier.PERSISTENT, mappedBy="company") @Element(types=org.apache.jdo.tck.pc.companyAnnotatedFC.FCDSDepartment.class) private transient Set departments = new HashSet(); protected static SimpleDateFormat formatter = new SimpleDateFormat("d/MMM/yyyy"); /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public FCDSCompany() {} /** * * Initialize the FCDSCompany instance. * * @param companyid The company id. * @param name The company name. * @param founded The date the company was founded. */ public FCDSCompany(long companyid, String name, Date founded) { this.companyid = companyid; this.name = name; this.founded = founded; } /** * Initialize the Company instance. * @param companyid The company id. * @param name The company name. * @param founded The date the company was founded. * @param addr The company's address. */ public FCDSCompany(long companyid, String name, Date founded, IAddress addr) { this(companyid, name, founded); this.address = (FCDSAddress)addr; } /** * Get the company id. * @return The company id. */ public long getCompanyid() { return companyid; } /** * Set the id associated with this object. * @param id the id. */ public void setCompanyid(long id) { if (this.companyid != 0) throw new IllegalStateException("Id is already set."); this.companyid = id; } /** * Get the name of the company. * @return The name of the company. */ public String getName() { return name; } /** * Set the name of the company. * @param name The value to use for the name of the company. */ public void setName(String name) { this.name = name; } /** * Get the date that the company was founded. * @return The date the company was founded. */ public Date getFounded() { return founded; } /** * Set the date that the company was founded. * @param founded The date to set that the company was founded. */ public void setFounded(Date founded) { this.founded = founded; } /** * Get the address of the company. * @return The primary address of the company. */ public IAddress getAddress() { return address; } /** * Set the primary address for the company. * @param address The address to set for the company. */ public void setAddress(IAddress address) { this.address = (FCDSAddress)address; } /** * Get the departments contained in the company. * * @return An unmodifiable Set that contains all the * FCDSDepartments of the company. */ public Set getDepartments() { return Collections.unmodifiableSet(departments); } /** * Add a FCDSDepartment instance to the company. * * @param dept The FCDSDepartment instance to add. */ public void addDepartment(FCDSDepartment dept) { departments.add(dept); } /** * Remove a FCDSDepartment instance from the company. * * @param dept The FCDSDepartment instance to remove. */ public void removeDepartment(FCDSDepartment dept) { departments.remove(dept); } /** * Initialize the set of FCDSDepartments in the company to the * parameter. * * @param departments The set of FCDSDepartments for the * company. */ public void setDepartments(Set departments) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this.departments = (departments != null) ? new HashSet(departments) : null; } /** Serialization support: initialize transient fields. */ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); departments = new HashSet(); } /** * Returns a String representation of a Company object. * @return a String representation of a Company object. */ public String toString() { return "Company(" + getFieldRepr()+ ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(companyid); rc.append(", name ").append(name); rc.append(", founded ").append( founded==null ? "null" : formatter.format(founded)); return rc.toString(); } /** * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the specified Person. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { FCDSCompany otherCompany = (FCDSCompany)other; String where = "Company<" + companyid + ">"; return helper.equals(companyid, otherCompany.getCompanyid(), where + ".companyid") & helper.equals(name, otherCompany.getName(), where + ".name") & helper.equals(founded, otherCompany.getFounded(), where + ".founded") & helper.deepEquals(address, otherCompany.getAddress(), where + ".address") & helper.deepEquals(departments, otherCompany.getDepartments(), where + ".departments"); } /** * Compares this object with the specified object for order. Returns a * negative integer, zero, or a positive integer as this object is less * than, equal to, or greater than the specified object. * @param o The Object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified object. * @throws ClassCastException - if the specified object's type prevents * it from being compared to this Object. */ public int compareTo(Object o) { return compareTo((FCDSCompany)o); } /** * Compare two instances. This is a method in Comparator. */ public int compare(Object o1, Object o2) { return compare((FCDSCompany)o1, (FCDSCompany)o2); } /** * Compares this object with the specified Company object for * order. Returns a negative integer, zero, or a positive integer as * this object is less than, equal to, or greater than the specified * object. * @param other The Company object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified Company * object. */ public int compareTo(FCDSCompany other) { return compare(this, other); } /** * Compares its two ICompany arguments for order. Returns a negative * integer, zero, or a positive integer as the first argument is less * than, equal to, or greater than the second. * @param o1 the first ICompany object to be compared. * @param o2 the second ICompany object to be compared. * @return a negative integer, zero, or a positive integer as the first * object is less than, equal to, or greater than the second object. */ public static int compare(FCDSCompany o1, FCDSCompany o2) { return EqualityHelper.compare(o1.getCompanyid(), o2.getCompanyid()); } /** * Indicates whether some other object is "equal to" this one. * @param obj the object with which to compare. * @return true if this object is the same as the obj * argument; false otherwise. */ public boolean equals(Object obj) { if (obj instanceof FCDSCompany) { return compareTo((FCDSCompany)obj) == 0; } return false; } /** * Returns a hash code value for the object. * @return a hash code value for this object. */ public int hashCode() { return (int)companyid; } /** * The class to be used as the application identifier * for the Company class. It consists of both the company * name and the date that the company was founded. */ public static class Oid implements Serializable, Comparable { /** * This field is part of the identifier and should match in name * and type with a field in the Company class. */ public long companyid; /** The required public no-arg constructor. */ public Oid() { } /** * Initialize the identifier. * @param companyid The id of the company. */ public Oid(long companyid) { this.companyid = companyid; } public Oid(String s) { companyid = Long.parseLong(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + companyid;} /** */ public boolean equals(Object obj) { if (obj==null || !this.getClass().equals(obj.getClass())) return false; Oid o = (Oid) obj; if (this.companyid != o.companyid) return false; return true; } /** */ public int hashCode() { return (int)companyid; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } /** */ public int compareTo(Object obj) { // may throw ClassCastException which the user must handle Oid other = (Oid) obj; if( companyid < other.companyid ) return -1; if( companyid > other.companyid ) return 1; return 0; } } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedFC/FCDSDentalInsurance.java100664 11333 12500110373 27447 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedFC; import javax.jdo.annotations.*; import java.math.BigDecimal; import org.apache.jdo.tck.pc.company.IDentalInsurance; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a dental insurance carrier selection for a * particular Employee. */ @PersistenceCapable @DatastoreIdentity(strategy=IdGeneratorStrategy.IDENTITY, column="DATASTORE_IDENTITY") public class FCDSDentalInsurance extends FCDSInsurance implements IDentalInsurance { @Column(name="LIFETIME_ORTHO_BENEFIT") private BigDecimal lifetimeOrthoBenefit; /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public FCDSDentalInsurance() {} /** * Construct a DentalInsurance instance. * @param insid The insurance instance identifier. * @param carrier The insurance carrier. * @param lifetimeOrthoBenefit The lifetimeOrthoBenefit. */ public FCDSDentalInsurance(long insid, String carrier, BigDecimal lifetimeOrthoBenefit) { super(insid, carrier); this.lifetimeOrthoBenefit = lifetimeOrthoBenefit; } /** * Construct a FCDSDentalInsurance instance. * * @param insid The insurance instance identifier. * @param carrier The insurance carrier. * @param employee The employee associated with this insurance. * @param lifetimeOrthoBenefit The lifetimeOrthoBenefit. */ public FCDSDentalInsurance(long insid, String carrier, FCDSEmployee employee, BigDecimal lifetimeOrthoBenefit) { super(insid, carrier, employee); this.lifetimeOrthoBenefit = lifetimeOrthoBenefit; } /** * Get the insurance lifetimeOrthoBenefit. * @return The insurance lifetimeOrthoBenefit. */ public BigDecimal getLifetimeOrthoBenefit() { return lifetimeOrthoBenefit; } /** * Set the insurance lifetimeOrthoBenefit. * @param lifetimeOrthoBenefit The insurance lifetimeOrthoBenefit. */ public void setLifetimeOrthoBenefit(BigDecimal lifetimeOrthoBenefit) { this.lifetimeOrthoBenefit = lifetimeOrthoBenefit; } /** * Returns a String representation of a FCDSDentalInsurance * object. * * @return a String representation of a FCDSDentalInsurance * object. */ public String toString() { return "FCDentalInsurance(" + getFieldRepr()+ ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(super.getFieldRepr()); rc.append(", lifetimeOrthoBenefit ").append(lifetimeOrthoBenefit); return rc.toString(); } /** * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the other Object. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { FCDSDentalInsurance otherIns = (FCDSDentalInsurance)other; String where = "FCDentalInsurance<" + getInsid() + ">"; return super.deepCompareFields(otherIns, helper) & helper.equals(lifetimeOrthoBenefit, otherIns.getLifetimeOrthoBenefit(), where + ".lifetimeOrthoBenefit"); } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedFC/FCDSDepartment.java100664 34626 12500110373 26505 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedFC; import javax.jdo.annotations.*; import java.io.Serializable; import java.io.ObjectInputStream; import java.io.IOException; import java.util.Collections; import java.util.Comparator; import java.util.HashSet; import java.util.List; import java.util.Set; import org.apache.jdo.tck.pc.company.ICompany; import org.apache.jdo.tck.pc.company.IDepartment; import org.apache.jdo.tck.pc.company.IEmployee; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a department within a company. */ @PersistenceCapable(table="departments") @Inheritance(strategy=InheritanceStrategy.NEW_TABLE) @Discriminator(strategy=DiscriminatorStrategy.CLASS_NAME, column="DISCRIMINATOR") @DatastoreIdentity(strategy=IdGeneratorStrategy.IDENTITY, column="DATASTORE_IDENTITY") public class FCDSDepartment implements IDepartment, Serializable, Comparable, Comparator, DeepEquality { public static final int RECOMMENDED_NO_OF_EMPS = 2; @Column(name="ID") private long deptid; @Column(name="NAME") private String name; @Column(name="COMPANYID") private FCDSCompany company; @Column(name="EMP_OF_THE_MONTH") private FCDSEmployee employeeOfTheMonth; @Persistent(mappedBy="department") @Element(types=org.apache.jdo.tck.pc.companyAnnotatedFC.FCDSEmployee.class) private transient Set employees = new HashSet(); @Element(types=org.apache.jdo.tck.pc.companyAnnotatedFC.FCDSEmployee.class) @Persistent(mappedBy="fundingDept") private transient Set fundedEmps = new HashSet(); /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public FCDSDepartment() {} /** * Construct a Department instance. * @param deptid The department id. * @param name The name of the department. */ public FCDSDepartment(long deptid, String name) { this.deptid = deptid; this.name = name; } /** * Construct a Department instance. * @param deptid The department id. * @param name The name of the department. * @param company The company that the department is associated with. */ public FCDSDepartment(long deptid, String name, ICompany company) { this.deptid = deptid; this.name = name; this.company = (FCDSCompany)company; } /** * Construct a Department instance. * @param deptid The department id. * @param name The name of the department. * @param company The company that the department is associated with. * @param employeeOfTheMonth The employee of the month the * department is associated with. */ public FCDSDepartment(long deptid, String name, ICompany company, IEmployee employeeOfTheMonth) { this.deptid = deptid; this.name = name; this.company = (FCDSCompany)company; this.employeeOfTheMonth = (FCDSEmployee)employeeOfTheMonth; } /** * Set the id associated with this object. * @param id the id. */ public void setDeptid(long id) { if (this.deptid != 0) throw new IllegalStateException("Id is already set."); this.deptid = id; } /** * Get the department id. * @return The department id. */ public long getDeptid() { return deptid; } /** * Get the name of the department. * @return The name of the department. */ public String getName() { return name; } /** * Set the name of the department. * @param name The name to set for the department. */ public void setName(String name) { this.name = name; } /** * Get the company associated with the department. * @return The company. */ public ICompany getCompany() { return company; } /** * Set the company for the department. * @param company The company to associate with the department. */ public void setCompany(ICompany company) { this.company = (FCDSCompany)company; } /** * Get the employee of the month associated with the department. * @return The employee of the month. */ public IEmployee getEmployeeOfTheMonth() { return employeeOfTheMonth; } /** * Set the employee of the month for the department. * @param employeeOfTheMonth The employee of the month to * associate with the department. */ public void setEmployeeOfTheMonth(IEmployee employeeOfTheMonth) { this.employeeOfTheMonth = (FCDSEmployee)employeeOfTheMonth; } /** * Get the employees in the department as an unmodifiable set. * @return The set of employees in the department, as an unmodifiable * set. */ public Set getEmployees() { return Collections.unmodifiableSet(employees); } /** * Add an employee to the department. * @param emp The employee to add to the department. */ public void addEmployee(FCDSEmployee emp) { employees.add(emp); } /** * Remove an employee from the department. * @param emp The employee to remove from the department. */ public void removeEmployee(FCDSEmployee emp) { employees.remove(emp); } /** * Set the employees to be in this department. * @param employees The set of employees for this department. */ public void setEmployees(Set employees) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this.employees = (employees != null) ? new HashSet(employees) : null; } /** * Get the funded employees in the department as an unmodifiable set. * @return The set of funded employees in the department, as an * unmodifiable set. */ public Set getFundedEmps() { return Collections.unmodifiableSet(fundedEmps); } /** * Add an employee to the collection of funded employees of this * department. * @param emp The employee to add to the department. */ public void addFundedEmp(FCDSEmployee emp) { fundedEmps.add(emp); } /** * Remove an employee from collection of funded employees of this * department. * @param emp The employee to remove from the department. */ public void removeFundedEmp(FCDSEmployee emp) { fundedEmps.remove(emp); } /** * Set the funded employees to be in this department. * @param employees The set of funded employees for this department. */ public void setFundedEmps(Set employees) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this.fundedEmps = (fundedEmps != null) ? new HashSet(employees) : null; } @Override public List getMeetingRooms() { // TODO Auto-generated method stub return null; } @Override public void setMeetingRooms(List rooms) { // TODO Auto-generated method stub } /** Serialization support: initialize transient fields. */ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); employees = new HashSet(); fundedEmps = new HashSet(); } /** * * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the other FCDSDepartment. * * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { FCDSDepartment otherDept = (FCDSDepartment)other; String where = "FCDepartment<" + deptid + ">"; return helper.equals(deptid, otherDept.getDeptid(), where + ".deptid") & helper.equals(name, otherDept.getName(), where + ".name") & helper.deepEquals(company, otherDept.getCompany(), where + ".company") & helper.deepEquals(employeeOfTheMonth, otherDept.getEmployeeOfTheMonth(), where + ".employeeOfTheMonth") & helper.deepEquals(employees, otherDept.getEmployees(), where + ".employees") & helper.deepEquals(fundedEmps, otherDept.getFundedEmps(), where + ".fundedEmps"); } /** * Returns a String representation of a FCDSDepartment object. * * @return a String representation of a FCDSDepartment object. */ public String toString() { return "FCDepartment(" + getFieldRepr()+ ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(deptid); rc.append(", name ").append(name); return rc.toString(); } /** * Compares this object with the specified object for order. Returns a * negative integer, zero, or a positive integer as this object is less * than, equal to, or greater than the specified object. * @param o The Object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified object. * @throws ClassCastException - if the specified object's type prevents * it from being compared to this Object. */ public int compareTo(Object o) { return compareTo((FCDSDepartment)o); } /** * Compare two instances. This is a method in Comparator. */ public int compare(Object o1, Object o2) { return compare((FCDSDepartment)o1, (FCDSDepartment)o2); } /** * Compares this object with the specified Department object for * order. Returns a negative integer, zero, or a positive integer as * this object is less than, equal to, or greater than the specified * object. * @param other The Department object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified * Department object. */ public int compareTo(FCDSDepartment other) { return compare(this, other); } /** * Compares its two IDepartment arguments for order. Returns a negative * integer, zero, or a positive integer as the first argument is less * than, equal to, or greater than the second. * @param o1 the first IDepartment object to be compared. * @param o2 the second IDepartment object to be compared. * @return a negative integer, zero, or a positive integer as the first * object is less than, equal to, or greater than the second object. */ public static int compare(FCDSDepartment o1, FCDSDepartment o2) { return EqualityHelper.compare(o1.getDeptid(), o2.getDeptid()); } /** * Indicates whether some other object is "equal to" this one. * @param obj the object with which to compare. * @return true if this object is the same as the obj * argument; false otherwise. */ public boolean equals(Object obj) { if (obj instanceof FCDSDepartment) { return compareTo((FCDSDepartment)obj) == 0; } return false; } /** * Returns a hash code value for the object. * @return a hash code value for this object. */ public int hashCode() { return (int)deptid; } /** * The application identity class associated with the * Department class. */ public static class Oid implements Serializable, Comparable { /** * This field represents the application identifier field * for the Department class. * It must match in name and type with the field in the * Department class. */ public long deptid; /** * The required public, no-arg constructor. */ public Oid() { } /** * A constructor to initialize the identifier field. * @param deptid the deptid of the Department. */ public Oid(long deptid) { this.deptid = deptid; } public Oid(String s) { deptid = Long.parseLong(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + deptid;} /** */ public boolean equals(java.lang.Object obj) { if( obj==null || !this.getClass().equals(obj.getClass()) ) return( false ); Oid o = (Oid) obj; if( this.deptid != o.deptid ) return( false ); return( true ); } /** */ public int hashCode() { return( (int) deptid ); } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } /** */ public int compareTo(Object obj) { // may throw ClassCastException which the user must handle Oid other = (Oid) obj; if( deptid < other.deptid ) return -1; if( deptid > other.deptid ) return 1; return 0; } } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedFC/FCDSEmployee.java100664 41153 12500110373 26152 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedFC; import javax.jdo.annotations.*; import java.io.ObjectInputStream; import java.io.IOException; import java.util.Collections; import java.util.Date; import java.util.HashSet; import java.util.Set; import org.apache.jdo.tck.pc.company.IDentalInsurance; import org.apache.jdo.tck.pc.company.IDepartment; import org.apache.jdo.tck.pc.company.IEmployee; import org.apache.jdo.tck.pc.company.IMedicalInsurance; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents an employee. */ @PersistenceCapable @Inheritance(strategy=InheritanceStrategy.SUPERCLASS_TABLE) @DatastoreIdentity(strategy=IdGeneratorStrategy.IDENTITY, column="DATASTORE_IDENTITY") public abstract class FCDSEmployee extends FCDSPerson implements IEmployee { @Column(name="HIREDATE") private Date hiredate; @Column(name="WEEKLYHOURS") private double weeklyhours; @Persistent(mappedBy="employee") private FCDSDentalInsurance dentalInsurance; @Persistent(mappedBy="employee") private FCDSMedicalInsurance medicalInsurance; @Column(name="DEPARTMENT") private FCDSDepartment department; @Column(name="FUNDINGDEPT") private FCDSDepartment fundingDept; @Column(name="MANAGER") private FCDSEmployee manager; @Column(name="MENTOR") private FCDSEmployee mentor; @Persistent(mappedBy="mentor") private FCDSEmployee protege; @Column(name="HRADVISOR") private FCDSEmployee hradvisor; @Persistent(mappedBy="reviewers") @Element(types=org.apache.jdo.tck.pc.companyAnnotatedFC.FCDSProject.class) private transient Set reviewedProjects = new HashSet(); @Persistent(mappedBy="members") @Element(types=org.apache.jdo.tck.pc.companyAnnotatedFC.FCDSProject.class) private transient Set projects = new HashSet(); @Persistent(mappedBy="manager") @Element(types=org.apache.jdo.tck.pc.companyAnnotatedFC.FCDSEmployee.class) private transient Set team = new HashSet(); @Persistent(mappedBy="hradvisor") @Element(types=org.apache.jdo.tck.pc.companyAnnotatedFC.FCDSEmployee.class) private transient Set hradvisees = new HashSet(); /** This is the JDO-required no-args constructor */ protected FCDSEmployee() {} /** * Construct an FCDSEmployee instance. * * @param personid The identifier for the person. * @param firstname The first name of the employee. * @param lastname The last name of the employee. * @param middlename The middle name of the employee. * @param birthdate The birth date of the employee. * @param hiredate The date that the employee was hired. */ public FCDSEmployee(long personid, String firstname, String lastname, String middlename, Date birthdate, Date hiredate) { super(personid, firstname, lastname, middlename, birthdate); this.hiredate = hiredate; } /** * Construct an FCDSEmployee instance. * * @param personid The identifier for the person. * @param firstname The first name of the employee. * @param lastname The last name of the employee. * @param middlename The middle name of the employee. * @param birthdate The birth date of the employee. * @param address The address of the employee. * @param hiredate The date that the employee was hired. */ public FCDSEmployee(long personid, String firstname, String lastname, String middlename, Date birthdate, FCDSAddress address, Date hiredate) { super(personid, firstname, lastname, middlename, birthdate, address); this.hiredate = hiredate; } /** * Get the date that the employee was hired. * @return The date the employee was hired. */ public Date getHiredate() { return hiredate; } /** * Set the date that the employee was hired. * @param hiredate The date the employee was hired. */ public void setHiredate(Date hiredate) { this.hiredate = hiredate; } /** * Get the weekly hours of the employee. * @return The number of hours per week that the employee works. */ public double getWeeklyhours() { return weeklyhours; } /** * Set the number of hours per week that the employee works. * @param weeklyhours The number of hours per week that the employee * works. */ public void setWeeklyhours(double weeklyhours) { this.weeklyhours = weeklyhours; } /** * Get the reviewed projects. * @return The reviewed projects as an unmodifiable set. */ public Set getReviewedProjects() { return Collections.unmodifiableSet(reviewedProjects); } /** * Add a reviewed project. * @param project A reviewed project. */ public void addReviewedProjects(FCDSProject project) { reviewedProjects.add(project); } /** * Remove a reviewed project. * @param project A reviewed project. */ public void removeReviewedProject(FCDSProject project) { reviewedProjects.remove(project); } /** * Set the reviewed projects for the employee. * @param reviewedProjects The set of reviewed projects. */ public void setReviewedProjects(Set reviewedProjects) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this.reviewedProjects = (reviewedProjects != null) ? new HashSet(reviewedProjects) : null; } /** * Get the employee's projects. * @return The employee's projects are returned as an unmodifiable * set. */ public Set getProjects() { return Collections.unmodifiableSet(projects); } /** * Add a project for the employee. * @param project The project. */ public void addProject(FCDSProject project) { projects.add(project); } /** * Remove a project from an employee's set of projects. * @param project The project. */ public void removeProject(FCDSProject project) { projects.remove(project); } /** * Set the projects for the employee. * @param projects The set of projects of the employee. */ public void setProjects(Set projects) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this.projects = (projects != null) ? new HashSet(projects) : null; } /** * Get the dental insurance of the employee. * @return The employee's dental insurance. */ public IDentalInsurance getDentalInsurance() { return dentalInsurance; } /** * Set the dental insurance object for the employee. * @param dentalInsurance The dental insurance object to associate with * the employee. */ public void setDentalInsurance(IDentalInsurance dentalInsurance) { this.dentalInsurance = (FCDSDentalInsurance)dentalInsurance; } /** * Get the medical insurance of the employee. * @return The employee's medical insurance. */ public IMedicalInsurance getMedicalInsurance() { return medicalInsurance; } /** * Set the medical insurance object for the employee. * @param medicalInsurance The medical insurance object to associate * with the employee. */ public void setMedicalInsurance(IMedicalInsurance medicalInsurance) { this.medicalInsurance = (FCDSMedicalInsurance)medicalInsurance; } /** * Get the employee's department. * @return The department associated with the employee. */ public IDepartment getDepartment() { return department; } /** * Set the employee's department. * @param department The department. */ public void setDepartment(IDepartment department) { this.department = (FCDSDepartment)department; } /** * Get the employee's funding department. * @return The funding department associated with the employee. */ public IDepartment getFundingDept() { return fundingDept; } /** * Set the employee's funding department. * @param department The funding department. */ public void setFundingDept(IDepartment department) { this.fundingDept = (FCDSDepartment)department; } /** * Get the employee's manager. * @return The employee's manager. */ public IEmployee getManager() { return manager; } /** * Set the employee's manager. * @param manager The employee's manager. */ public void setManager(IEmployee manager) { this.manager = (FCDSEmployee)manager; } /** * Get the employee's team. * * @return The set of FCDSEmployees on this employee's team, * returned as an unmodifiable set. */ public Set getTeam() { return Collections.unmodifiableSet(team); } /** * Add an FCDSEmployee to this employee's team. * This method sets both sides of the relationship, modifying * this employees team to include parameter emp and modifying * emp to set its manager attribute to this object. * * @param emp The FCDSEmployee to add to the team. */ public void addToTeam(FCDSEmployee emp) { team.add(emp); emp.manager = this; } /** * Remove an FCDSEmployee from this employee's team. * This method will also set the emp manager to null. * * @param emp The FCDSEmployee to remove from the team. */ public void removeFromTeam(FCDSEmployee emp) { team.remove(emp); emp.manager = null; } /** * Set the employee's team. * * @param team The set of FCDSEmployees. */ public void setTeam(Set team) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this.team = (team != null) ? new HashSet(team) : null; } /** * Set the mentor for this employee. * @param mentor The mentor for this employee. */ public void setMentor(IEmployee mentor) { this.mentor = (FCDSEmployee)mentor; } /** * Get the mentor for this employee. * @return The mentor. */ public IEmployee getMentor() { return mentor; } /** * Set the protege for this employee. * @param protege The protege for this employee. */ public void setProtege(IEmployee protege) { this.protege = (FCDSEmployee)protege; } /** * Get the protege of this employee. * @return The protege of this employee. */ public IEmployee getProtege() { return protege; } /** * Set the HR advisor for this employee. * @param hradvisor The hradvisor for this employee. */ public void setHradvisor(IEmployee hradvisor) { this.hradvisor = (FCDSEmployee)hradvisor; } /** * Get the HR advisor for the employee. * @return The HR advisor. */ public IEmployee getHradvisor() { return hradvisor; } /** * Get the HR advisees of this HR advisor. * * @return An unmodifiable Set containing the * FCDSEmployees that are HR advisees of this employee. */ public Set getHradvisees() { return Collections.unmodifiableSet(hradvisees); } /** * Add an FCDSEmployee as an advisee of this HR advisor. * This method also sets the emp hradvisor to reference * this object. In other words, both sides of the relationship are * set. * * @param emp The employee to add as an advisee. */ public void addAdvisee(FCDSEmployee emp) { hradvisees.add(emp); emp.hradvisor = this; } /** * Remove an FCDSEmployee as an advisee of this HR advisor. * This method also sets the emp hradvisor to null. * In other words, both sides of the relationship are set. * * @param emp The employee to add as an HR advisee. */ public void removeAdvisee(FCDSEmployee emp) { hradvisees.remove(emp); emp.hradvisor = null; } /** * Set the HR advisees of this HR advisor. * * @param hradvisees The FCDSEmployees that are HR advisees of * this employee. */ public void setHradvisees(Set hradvisees) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this.hradvisees = (hradvisees != null) ? new HashSet(hradvisees) : null; } /** Serialization support: initialize transient fields. */ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); reviewedProjects = new HashSet(); projects = new HashSet(); team = new HashSet(); hradvisees = new HashSet(); } /** * Return a String representation of a FCDSEmployee object. * * @return a String representation of a FCDSEmployee object. */ public String toString() { return "FCEmployee(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(super.getFieldRepr()); rc.append(", hired ").append( hiredate==null ? "null" : formatter.format(hiredate)); rc.append(", weeklyhours ").append(weeklyhours); return rc.toString(); } /** * * Returns true if all the fields of this instance are * deep equal to the corresponding fields of the specified FCDSEmployee. * * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { FCDSEmployee otherEmp = (FCDSEmployee)other; String where = "Employee<" + getPersonid() + ">"; return super.deepCompareFields(otherEmp, helper) & helper.equals(hiredate, otherEmp.getHiredate(), where + ".hiredate") & helper.closeEnough(weeklyhours, otherEmp.getWeeklyhours(), where + ".weeklyhours") & helper.deepEquals(dentalInsurance, otherEmp.getDentalInsurance(), where + ".dentalInsurance") & helper.deepEquals(medicalInsurance, otherEmp.getMedicalInsurance(), where + ".medicalInsurance") & helper.deepEquals(department, otherEmp.getDepartment(), where + ".department") & helper.deepEquals(fundingDept, otherEmp.getFundingDept(), where + ".fundingDept") & helper.deepEquals(manager, otherEmp.getManager(), where + ".manager") & helper.deepEquals(mentor, otherEmp.getMentor(), where + ".mentor") & helper.deepEquals(protege, otherEmp.getProtege(), where + ".protege") & helper.deepEquals(hradvisor, otherEmp.getHradvisor(), where + ".hradvisor") & helper.deepEquals(reviewedProjects, otherEmp.getReviewedProjects(), where + ".reviewedProjects") & helper.deepEquals(projects, otherEmp.getProjects(), where + ".projects") & helper.deepEquals(team, otherEmp.getTeam(), where + ".team") & helper.deepEquals(hradvisees, otherEmp.getHradvisees(), where + ".hradvisees"); } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedFC/FCDSFullTimeEmployee.java100664 11720 12500110373 27611 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedFC; import javax.jdo.annotations.*; import java.util.Date; import org.apache.jdo.tck.pc.company.IAddress; import org.apache.jdo.tck.pc.company.IFullTimeEmployee; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a full-time employee. */ @PersistenceCapable @Inheritance(strategy=InheritanceStrategy.SUPERCLASS_TABLE) @DatastoreIdentity(strategy=IdGeneratorStrategy.IDENTITY, column="DATASTORE_IDENTITY") public class FCDSFullTimeEmployee extends FCDSEmployee implements IFullTimeEmployee { @Column(name="SALARY") private double salary; /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public FCDSFullTimeEmployee() {} /** * Construct a full-time employee. * @param personid The person identifier. * @param first The person's first name. * @param last The person's last name. * @param middle The person's middle name. * @param born The person's birthdate. * @param hired The date that the person was hired. * @param sal The salary of the full-time employee. */ public FCDSFullTimeEmployee(long personid, String first, String last, String middle, Date born, Date hired, double sal) { super(personid, first, last, middle, born, hired); salary = sal; } /** * Construct a full-time employee. * @param personid The person identifier. * @param first The person's first name. * @param last The person's last name. * @param middle The person's middle name. * @param born The person's birthdate. * @param addr The person's address. * @param hired The date that the person was hired. * @param sal The salary of the full-time employee. */ public FCDSFullTimeEmployee(long personid, String first, String last, String middle, Date born, IAddress addr, Date hired, double sal) { super(personid, first, last, middle, born, (FCDSAddress)addr, hired); salary = sal; } /** * Get the salary of the full time employee. * @return The salary of the full time employee. */ public double getSalary() { return salary; } /** * Set the salary for the full-time employee. * @param salary The salary to set for the full-time employee. */ public void setSalary(double salary) { this.salary = salary; } /** * Return a String representation of a FCDSFullTimeEmployee object. * * @return a String representation of a FCDSFullTimeEmployee object. */ public String toString() { return "FCFullTimeEmployee(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ public String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(super.getFieldRepr()); rc.append(", $").append(salary); return rc.toString(); } /** * * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the specified * FCDSFullTimeEmployee. * * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { FCDSFullTimeEmployee otherEmp = (FCDSFullTimeEmployee)other; String where = "FCFullTimeEmployee<" + getPersonid() + ">"; return super.deepCompareFields(otherEmp, helper) & helper.closeEnough(salary, otherEmp.getSalary(), where + ".salary"); } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedFC/FCDSInsurance.java100664 23311 12500110373 26316 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedFC; import javax.jdo.annotations.*; import java.io.Serializable; import java.util.Comparator; import org.apache.jdo.tck.pc.company.IEmployee; import org.apache.jdo.tck.pc.company.IInsurance; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents an insurance carrier selection for a particular * FCDSEmployee. */ @PersistenceCapable(table="insuranceplans") @Inheritance(strategy=InheritanceStrategy.NEW_TABLE) @Discriminator(strategy=DiscriminatorStrategy.CLASS_NAME, column="DISCRIMINATOR", indexed="true") @Index(name="INS_DISCRIMINATOR_INDEX", unique="false", columns=@Column(name="DISCRIMINATOR")) @DatastoreIdentity(strategy=IdGeneratorStrategy.IDENTITY, column="DATASTORE_IDENTITY") public class FCDSInsurance implements IInsurance, Serializable, Comparable, Comparator, DeepEquality { @Column(name="INSID") private long insid; @Column(name="CARRIER") private String carrier; @Column(name="EMPLOYEE") private FCDSEmployee employee; /** This is the JDO-required no-args constructor. */ protected FCDSInsurance() {} /** * Construct an FCDSInsurance instance. * * @param insid The insurance instance identifier. * @param carrier The insurance carrier. */ protected FCDSInsurance(long insid, String carrier) { this.insid = insid; this.carrier = carrier; } /** * Construct an FCDSInsurance instance. * * @param insid The insurance instance identifier. * @param carrier The insurance carrier. * @param employee The employee associated with this insurance. */ protected FCDSInsurance(long insid, String carrier, FCDSEmployee employee) { this.insid = insid; this.carrier = carrier; this.employee = employee; } /** * Get the insurance ID. * @return the insurance ID. */ public long getInsid() { return insid; } /** * Set the insurance ID. * @param id The insurance ID value. */ public void setInsid(long id) { if (this.insid != 0) throw new IllegalStateException("Id is already set."); this.insid = id; } /** * Get the insurance carrier. * @return The insurance carrier. */ public String getCarrier() { return carrier; } /** * Set the insurance carrier. * @param carrier The insurance carrier. */ public void setCarrier(String carrier) { this.carrier = carrier; } /** * Get the associated employee. * @return The employee for this insurance. */ public IEmployee getEmployee() { return employee; } /** * Set the associated employee. * @param employee The associated employee. */ public void setEmployee(IEmployee employee) { this.employee = (FCDSEmployee)employee; } /** * Returns a String representation of a FCDSInsurance object. * * @return a String representation of a FCDSInsurance object. */ public String toString() { return "FCInsurance(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(insid); rc.append(", carrier ").append(carrier); return rc.toString(); } /** * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the other Object. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { FCDSInsurance otherIns = (FCDSInsurance)other; String where = "FCInsurance<" + insid + ">"; return helper.equals(insid, otherIns.getInsid(), where + ".insid") & helper.equals(carrier, otherIns.getCarrier(), where + ".carrier") & helper.deepEquals(employee, otherIns.getEmployee(), where + ".employee"); } /** * Compares this object with the specified object for order. Returns a * negative integer, zero, or a positive integer as this object is less * than, equal to, or greater than the specified object. * @param o The Object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified object. * @throws ClassCastException - if the specified object's type prevents * it from being compared to this Object. */ public int compareTo(Object o) { return compareTo((FCDSInsurance)o); } /** * Compare two instances. This is a method in Comparator. */ public int compare(Object o1, Object o2) { return compare((FCDSInsurance)o1, (FCDSInsurance)o2); } /** * Compares this object with the specified Insurance object for * order. Returns a negative integer, zero, or a positive integer as * this object is less than, equal to, or greater than the specified * object. * @param other The Insurance object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified * Insurance object. */ public int compareTo(FCDSInsurance other) { return compare(this, other); } /** * Compares its two IInsurance arguments for order. Returns a negative * integer, zero, or a positive integer as the first argument is less * than, equal to, or greater than the second. * @param o1 the first IInsurance object to be compared. * @param o2 the second IInsurance object to be compared. * @return a negative integer, zero, or a positive integer as the first * object is less than, equal to, or greater than the second object. */ public static int compare(FCDSInsurance o1, FCDSInsurance o2) { return EqualityHelper.compare(o1.getInsid(), o2.getInsid()); } /** * Indicates whether some other object is "equal to" this one. * @param obj the object with which to compare. * @return true if this object is the same as the obj * argument; false otherwise. */ public boolean equals(Object obj) { if (obj instanceof FCDSInsurance) { return compareTo((FCDSInsurance)obj) == 0; } return false; } /** * Returns a hash code value for the object. * @return a hash code value for this object. */ public int hashCode() { return (int)insid; } /** * This class is used to represent the application * identifier for the Insurance class. */ public static class Oid implements Serializable, Comparable { /** * This field represents the application identifier for the * Insurance class. It must match the field in the * Insurance class in both name and type. */ public long insid; /** * The required public no-args constructor. */ public Oid() { } /** * Initialize with an insurance identifier. * @param insid the insurance ID. */ public Oid(long insid) { this.insid = insid; } public Oid(String s) { insid = Long.parseLong(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + insid;} /** */ public boolean equals(java.lang.Object obj) { if( obj==null || !this.getClass().equals(obj.getClass()) ) return( false ); Oid o=(Oid) obj; if( this.insid!=o.insid ) return( false ); return( true ); } /** */ public int hashCode() { return( (int) insid ); } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } /** */ public int compareTo(Object obj) { // may throw ClassCastException which the user must handle Oid other = (Oid) obj; if( insid < other.insid ) return -1; if( insid > other.insid ) return 1; return 0; } } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedFC/FCDSMedicalInsurance.java100664 10612 12500110373 27575 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedFC; import javax.jdo.annotations.*; import org.apache.jdo.tck.pc.company.IMedicalInsurance; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a dental insurance carrier selection for a * particular Employee. */ @PersistenceCapable @DatastoreIdentity(strategy=IdGeneratorStrategy.IDENTITY, column="DATASTORE_IDENTITY") public class FCDSMedicalInsurance extends FCDSInsurance implements IMedicalInsurance { @Column(name="PLANTYPE") private String planType; // possible values: "PPO", "EPO", "NPO" /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public FCDSMedicalInsurance() {} /** * Construct a FCDSMedicalInsurance instance. * * @param insid The insurance instance identifier. * @param carrier The insurance carrier. * @param planType The planType. */ public FCDSMedicalInsurance(long insid, String carrier, String planType) { super(insid, carrier); this.planType = planType; } /** * Construct a FCDSMedicalInsurance instance. * * @param insid The insurance instance identifier. * @param carrier The insurance carrier. * @param employee The employee associated with this insurance. * @param planType The planType. */ public FCDSMedicalInsurance(long insid, String carrier, FCDSEmployee employee, String planType) { super(insid, carrier, employee); this.planType = planType; } /** * Get the insurance planType. * @return The insurance planType. */ public String getPlanType() { return planType; } /** * Set the insurance planType. * @param planType The insurance planType. */ public void setPlanType(String planType) { this.planType = planType; } /** * Returns a String representation of a FCDSMedicalInsurance * object. * * @return a String representation of a FCDSMedicalInsurance * object. */ public String toString() { return "FCMedicalInsurance(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(super.getFieldRepr()); rc.append(", planType ").append(planType); return rc.toString(); } /** * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the other Object. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { FCDSMedicalInsurance otherIns = (FCDSMedicalInsurance)other; String where = "FCMedicalInsurance<" + getInsid() + ">"; return super.deepCompareFields(otherIns, helper) & helper.equals(planType, otherIns.getPlanType(), where + ".planType"); } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedFC/FCDSMeetingRoom.java100664 21315 12500110373 26616 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedFC; import javax.jdo.annotations.*; import java.io.Serializable; import java.util.Comparator; import org.apache.jdo.tck.pc.company.IMeetingRoom; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a meeting room. */ @PersistenceCapable(table="meetingrooms") @Inheritance(strategy=InheritanceStrategy.NEW_TABLE) @Discriminator(strategy=DiscriminatorStrategy.CLASS_NAME, column="DISCRIMINATOR") @DatastoreIdentity(strategy=IdGeneratorStrategy.IDENTITY, column="DATASTORE_IDENTITY") public class FCDSMeetingRoom implements IMeetingRoom, Serializable, Comparable, Comparator, DeepEquality { @Column(name="ID") private long roomid; @Column(name="NAME", jdbcType="VARCHAR") private String name; /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public FCDSMeetingRoom() {} /** * This constructor initializes the FCDSMeetingRoom components. * @param roomid The room ID. * @param name The name of the room */ public FCDSMeetingRoom(long roomid, String name) { this.roomid = roomid; this.name = name; } /** * Get the room id associated with this object. * @return the room id. */ public long getRoomid() { return roomid; } /** * Set the id associated with this object. * @param id the id. */ public void setRoomid(long id) { if (this.roomid != 0) throw new IllegalStateException("Id is already set."); this.roomid = id; } /** * Get the name of the meeting room. * @return The name of the meeting room. */ public String getName() { return name; } /** * Set the name of the meeting room. * @param name The name. */ public void setName(String name) { this.name = name; } /** * Returns a String representation of a Address object. * @return a String representation of a FCDSMeetingRoom object. */ public String toString() { return "FCDSMeetingRoom(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(roomid); rc.append(", name ").append(name); return rc.toString(); } /** * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the specified Person. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { IMeetingRoom otherMeetingRoom = (IMeetingRoom)other; String where = "FCDSMeetingRoom<" + roomid + ">"; return helper.equals(roomid, otherMeetingRoom.getRoomid(), where + ".roomid") & helper.equals(name, otherMeetingRoom.getName(), where + ".name"); } /** * Compares this object with the specified object for order. Returns a * negative integer, zero, or a positive integer as this object is less * than, equal to, or greater than the specified object. * @param o The Object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified object. * @throws ClassCastException - if the specified object's type prevents * it from being compared to this Object. */ public int compareTo(Object o) { return compareTo((IMeetingRoom)o); } /** * Compare two instances. This is a method in Comparator. */ public int compare(Object o1, Object o2) { return compare((IMeetingRoom)o1, (IMeetingRoom)o2); } /** * Compares this object with the specified FCDSMeetingRoom object for * order. Returns a negative integer, zero, or a positive integer as * this object is less than, equal to, or greater than the specified * object. * @param other The MeetingRoom object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified MeetingRoom * object. */ public int compareTo(IMeetingRoom other) { return compare(this, other); } /** * Compares its two IMeetingRoom arguments for order. Returns a negative * integer, zero, or a positive integer as the first argument is less * than, equal to, or greater than the second. * @param o1 the first IMeetingRoom object to be compared. * @param o2 the second IMeetingRoom object to be compared. * @return a negative integer, zero, or a positive integer as the first * object is less than, equal to, or greater than the second object. */ public static int compare(IMeetingRoom o1, IMeetingRoom o2) { return EqualityHelper.compare(o1.getRoomid(), o2.getRoomid()); } /** * Indicates whether some other object is "equal to" this one. * @param obj the object with which to compare. * @return true if this object is the same as the obj * argument; false otherwise. */ public boolean equals(Object obj) { if (obj instanceof IMeetingRoom) { return compareTo((IMeetingRoom)obj) == 0; } return false; } /** * Returns a hash code value for the object. * @return a hash code value for this object. */ public int hashCode() { return (int)roomid; } /** * This class is used to represent the application identifier * for the FCDSMeetingRoom class. */ public static class Oid implements Serializable, Comparable { /** * This is the identifier field for FCDSMeetingRoom and must * correspond in type and name to the field in * FCDSMeetingRoom. */ public long roomid; /** The required public, no-arg constructor. */ public Oid() { roomid = 0; } /** * A constructor to initialize the identifier field. * @param roomid the id of the FCDSMeetingRoom. */ public Oid(long roomid) { this.roomid = roomid; } public Oid(String s) { roomid = Long.parseLong(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + roomid;} /** */ public boolean equals(java.lang.Object obj) { if( obj==null || !this.getClass().equals(obj.getClass()) ) return( false ); Oid o = (Oid) obj; if( this.roomid != o.roomid ) return( false ); return( true ); } /** */ public int hashCode() { return( (int) roomid ); } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } /** */ public int compareTo(Object obj) { // may throw ClassCastException which the user must handle Oid other = (Oid) obj; if( roomid < other.roomid ) return -1; if( roomid > other.roomid ) return 1; return 0; } } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedFC/FCDSPartTimeEmployee.java100664 11574 12500110373 27624 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedFC; import javax.jdo.annotations.*; import java.util.Date; import org.apache.jdo.tck.pc.company.IAddress; import org.apache.jdo.tck.pc.company.IPartTimeEmployee; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a part-time employee. */ @PersistenceCapable @Inheritance(strategy=InheritanceStrategy.SUPERCLASS_TABLE) @DatastoreIdentity(strategy=IdGeneratorStrategy.IDENTITY, column="DATASTORE_IDENTITY") public class FCDSPartTimeEmployee extends FCDSEmployee implements IPartTimeEmployee { @Column(name="WAGE") private double wage; /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public FCDSPartTimeEmployee() {} /** * Construct a part-time employee. * @param personid The identifier for the person. * @param first The person's first name. * @param last The person's last name. * @param middle The person's middle name. * @param born The person's birthdate. * @param hired The date the person was hired. * @param wage The person's wage. */ public FCDSPartTimeEmployee(long personid, String first, String last, String middle, Date born, Date hired, double wage ) { super(personid, first, last, middle, born, hired); this.wage = wage; } /** * Construct a part-time employee. * @param personid The identifier for the person. * @param first The person's first name. * @param last The person's last name. * @param middle The person's middle name. * @param born The person's birthdate. * @param addr The person's address. * @param hired The date the person was hired. * @param wage The person's wage. */ public FCDSPartTimeEmployee(long personid, String first, String last, String middle, Date born, IAddress addr, Date hired, double wage ) { super(personid, first, last, middle, born, (FCDSAddress)addr, hired); this.wage = wage; } /** * Get the wage of the part-time employee. * @return The wage of the part-time employee. */ public double getWage() { return wage; } /** * Set the wage of the part-time employee. * @param wage The wage of the part-time employee. */ public void setWage(double wage) { this.wage = wage; } /** * Returns a String representation of a FCDSPartTimeEmployee object. * * @return a String representation of a FCDSPartTimeEmployee object. */ public String toString() { return "FCPartTimeEmployee(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ public String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(super.getFieldRepr()); rc.append(", $" + wage); return rc.toString(); } /** * * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the specified * FCDSPartTimeEmployee. * * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { FCDSPartTimeEmployee otherEmp = (FCDSPartTimeEmployee)other; String where = "FCPartTimeEmployee<" + getPersonid() + ">"; return super.deepCompareFields(otherEmp, helper) & helper.closeEnough(wage, otherEmp.getWage(), where + ".wage"); } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedFC/FCDSPerson.java100664 35731 12500110373 25646 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedFC; import javax.jdo.annotations.*; import java.io.Serializable; import java.text.SimpleDateFormat; import java.util.Collections; import java.util.Comparator; import java.util.Date; import java.util.HashMap; import java.util.Map; import org.apache.jdo.tck.pc.company.IAddress; import org.apache.jdo.tck.pc.company.IPerson; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a person. */ @PersistenceCapable(table="persons") @Inheritance(strategy=InheritanceStrategy.NEW_TABLE) @Discriminator(strategy=DiscriminatorStrategy.CLASS_NAME, column="DISCRIMINATOR", indexed="true") @DatastoreIdentity(strategy=IdGeneratorStrategy.IDENTITY, column="DATASTORE_IDENTITY") public class FCDSPerson implements IPerson, Serializable, Comparable, Comparator, DeepEquality { @Column(name="PERSONID") private long personid; @Column(name="FIRSTNAME") private String firstname; @Column(name="LASTNAME") private String lastname; @Persistent(defaultFetchGroup="false") @Column(name="MIDDLENAME", allowsNull="true") private String middlename; @Column(name="BIRTHDATE") private Date birthdate; @Persistent(persistenceModifier=PersistenceModifier.PERSISTENT) @Embedded(nullIndicatorColumn="COUNTRY", members={ @Persistent(name="addrid", columns=@Column(name="ADDRID")), @Persistent(name="street", columns=@Column(name="STREET")), @Persistent(name="city", columns=@Column(name="CITY")), @Persistent(name="state", columns=@Column(name="STATE")), @Persistent(name="zipcode", columns=@Column(name="ZIPCODE")), @Persistent(name="country", columns=@Column(name="COUNTRY")) }) private FCDSAddress address; // maps phone number types ("home", "work", "mobile", etc.) // to phone numbers specified as String @Persistent(table="employee_phoneno_type") @Join(column="EMPID") @Key(types=java.lang.String.class, column="TYPE") @Value(types=java.lang.String.class, column="PHONENO") private Map phoneNumbers = new HashMap(); protected static SimpleDateFormat formatter = new SimpleDateFormat("d/MMM/yyyy"); /** This is the JDO-required no-args constructor. */ protected FCDSPerson() {} /** * Construct a FCDSPerson instance. * * @param personid The person identifier. * @param firstname The person's first name. * @param lastname The person's last name. * @param middlename The person's middle name. * @param birthdate The person's birthdate. */ public FCDSPerson(long personid, String firstname, String lastname, String middlename, Date birthdate) { this.personid = personid; this.firstname = firstname; this.lastname = lastname; this.middlename = middlename; this.birthdate = birthdate; } /** * Construct a FCDSPerson instance. * * @param personid The person identifier. * @param firstname The person's first name. * @param lastname The person's last name. * @param middlename The person's middle name. * @param birthdate The person's birthdate. * @param address The person's address. */ public FCDSPerson(long personid, String firstname, String lastname, String middlename, Date birthdate, IAddress address) { this(personid, firstname, lastname, middlename, birthdate); this.address = (FCDSAddress)address; } /** * Set the id associated with this object. * @param id the id. */ public void setPersonid(long id) { if (this.personid != 0) throw new IllegalStateException("Id is already set."); this.personid = id; } /** * Get the person's id. * @return The personid. */ public long getPersonid() { return personid; } /** * Set the person's id. * @param personid The personid. */ public void setLastname(long personid) { this.personid = personid; } /** * Get the person's last name. * @return The last name. */ public String getLastname() { return lastname; } /** * Set the person's last name. * @param lastname The last name. */ public void setLastname(String lastname) { this.lastname = lastname; } /** * Get the person's first name. * @return The first name. */ public String getFirstname() { return firstname; } /** * Set the person's first name. * @param firstname The first name. */ public void setFirstname(String firstname) { this.firstname = firstname; } /** * Get the person's middle name. * @return The middle name. */ public String getMiddlename() { return middlename; } /** * Set the person's middle name. * @param middlename The middle name. */ public void setMiddlename(String middlename) { this.middlename = middlename; } /** * Get the address. * @return The address. */ public IAddress getAddress() { return address; } /** * Set the address. * @param address The address. */ public void setAddress(IAddress address) { this.address = (FCDSAddress)address; } /** * Get the person's birthdate. * @return The person's birthdate. */ public Date getBirthdate() { return birthdate; } /** * Set the person's birthdate. * @param birthdate The person's birthdate. */ public void setBirthdate(Date birthdate) { this. birthdate = birthdate; } /** * Get the map of phone numbers as an unmodifiable map. * @return The map of phone numbers, as an unmodifiable map. */ public Map getPhoneNumbers() { return Collections.unmodifiableMap(phoneNumbers); } /** * Get the phone number for the specified phone number type. * @param type The phone number type ("home", "work", "mobile", etc.). * @return The phone number associated with specified type, or * null if there was no phone number for the type. */ public String getPhoneNumber(String type) { return (String)phoneNumbers.get(type); } /** * Associates the specified phone number with the specified type in the * map of phone numbers of this person. * @param type The phone number type ("home", "work", "mobile", etc.). * @param phoneNumber The phone number * @return The previous phone number associated with specified type, or * null if there was no phone number for the type. */ public String putPhoneNumber(String type, String phoneNumber) { return (String)phoneNumbers.put(type, phoneNumber); } /** * Remove a phoneNumber from the map of phone numbers. * @param type The phone number type ("home", "work", "mobile", etc.). * @return The previous phone number associated with specified type, or * null if there was no phone number for the type. */ public String removePhoneNumber(String type) { return (String)phoneNumbers.remove(type); } /** * Set the phoneNumber map to be in this person. * @param phoneNumbers The map of phoneNumbers for this person. */ public void setPhoneNumbers(Map phoneNumbers) { // workaround: create a new HashMap, because fostore does not // support LinkedHashMap this.phoneNumbers = (phoneNumbers != null) ? new HashMap(phoneNumbers) : null; } /** * Returns a String representation of a FCDSPerson object. * * @return a string representation of a FCDSPerson object. */ public String toString() { return "FCPerson(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(personid); rc.append(", ").append(lastname); rc.append(", ").append(firstname); rc.append(", born ").append( birthdate==null ? "null" : formatter.format(birthdate)); rc.append(", phone ").append(phoneNumbers); return rc.toString(); } /** * * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the specified FCDSPerson. * * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { FCDSPerson otherPerson = (FCDSPerson)other; String where = "FCPerson<" + personid + ">"; return helper.equals(personid, otherPerson.getPersonid(), where + ".personid") & helper.equals(firstname, otherPerson.getFirstname(), where + ".firstname") & helper.equals(lastname, otherPerson.getLastname(), where + ".lastname") & 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"); } /** * Compares this object with the specified object for order. Returns a * negative integer, zero, or a positive integer as this object is less * than, equal to, or greater than the specified object. * @param o The Object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified object. * @throws ClassCastException - if the specified object's type prevents * it from being compared to this Object. */ public int compareTo(Object o) { return compareTo((FCDSPerson)o); } /** * Compare two instances. This is a method in Comparator. */ public int compare(Object o1, Object o2) { return compare((FCDSPerson)o1, (FCDSPerson)o2); } /** * * Compares this object with the specified FCDSPerson object for * order. Returns a negative integer, zero, or a positive integer as * this object is less than, equal to, or greater than the specified * object. * * @param other The FCDSPerson object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified FFCDSPerson * object. */ public int compareTo(FCDSPerson other) { return compare(this, other); } /** * Compares its two IPerson arguments for order. Returns a negative * integer, zero, or a positive integer as the first argument is less * than, equal to, or greater than the second. * @param o1 the first IPerson object to be compared. * @param o2 the second IPerson object to be compared. * @return a negative integer, zero, or a positive integer as the first * object is less than, equal to, or greater than the second object. */ public static int compare(FCDSPerson o1, FCDSPerson o2) { return EqualityHelper.compare(o1.getPersonid(), o2.getPersonid()); } /** * Indicates whether some other object is "equal to" this one. * @param obj the object with which to compare. * @return true if this object is the same as the obj * argument; false otherwise. */ public boolean equals(Object obj) { if (obj instanceof FCDSPerson) { return compareTo((FCDSPerson)obj) == 0; } return false; } /** * Returns a hash code value for the object. * @return a hash code value for this object. */ public int hashCode() { return (int)personid; } /** * This class is used to represent the application identifier * for the Person class. */ public static class Oid implements Serializable, Comparable { /** * This field represents the identifier for the Person * class. It must match a field in the Person class in * both name and type. */ public long personid; /** * The required public no-arg constructor. */ public Oid() { } /** * Initialize the identifier. * @param personid The person identifier. */ public Oid(long personid) { this.personid = personid; } public Oid(String s) { personid = Long.parseLong(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + personid;} /** */ public boolean equals(java.lang.Object obj) { if( obj==null || !this.getClass().equals(obj.getClass()) ) return( false ); Oid o = (Oid) obj; if( this.personid != o.personid ) return( false ); return( true ); } /** */ public int hashCode() { return( (int) personid ); } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } /** */ public int compareTo(Object obj) { // may throw ClassCastException which the user must handle Oid other = (Oid) obj; if( personid < other.personid ) return -1; if( personid > other.personid ) return 1; return 0; } } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedFC/FCDSProject.java100664 30505 12500110373 26000 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedFC; import javax.jdo.annotations.*; import java.io.Serializable; import java.io.ObjectInputStream; import java.io.IOException; import java.util.Collections; import java.util.Comparator; import java.util.Set; import java.util.HashSet; import java.math.BigDecimal; import org.apache.jdo.tck.pc.company.IProject; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a project, a budgeted task with one or more * employees working on it. */ @PersistenceCapable(table="projects") @Inheritance(strategy=InheritanceStrategy.NEW_TABLE) @Discriminator(strategy=DiscriminatorStrategy.CLASS_NAME, column="DISCRIMINATOR") @DatastoreIdentity(strategy=IdGeneratorStrategy.IDENTITY, column="DATASTORE_IDENTITY") public class FCDSProject implements IProject, Serializable, Comparable, Comparator, DeepEquality { @Column(name="PROJID") private long projid; @Column(name="NAME") private String name; @Column(name="BUDGET", jdbcType="DECIMAL", length=11, scale=2) private BigDecimal budget; @Persistent(table="project_reviewer") @Element(types=org.apache.jdo.tck.pc.companyAnnotatedFC.FCDSEmployee.class, column="REVIEWER", foreignKey="PR_REV_FK") @Join(column="PROJID", foreignKey="PR_PROJ_FK") private transient Set reviewers = new HashSet(); @Persistent(table="project_member") @Element(types=org.apache.jdo.tck.pc.companyAnnotatedFC.FCDSEmployee.class, column="MEMBER", foreignKey="PR_MEMB_FK") @Join(column="PROJID", foreignKey="PR_PROJ_FK") private transient Set members = new HashSet(); /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public FCDSProject() {} /** * Initialize a project. * @param projid The project identifier. * @param name The name of the project. * @param budget The budget for the project. */ public FCDSProject(long projid, String name, BigDecimal budget) { this.projid = projid; this.name = name; this.budget = budget; } /** * Set the id associated with this object. * @param id the id. */ public void setProjid(long id) { if (this.projid != 0) throw new IllegalStateException("Id is already set."); this.projid = id; } /** * Get the project ID. * @return The project ID. */ public long getProjid() { return projid; } /** * Get the name of the project. * @return The name of the project. */ public String getName() { return name; } /** * Set the name of the project. * @param name The name of the project. */ public void setName(String name) { this.name = name; } /** * Get the project's budget. * @return The project's budget. */ public BigDecimal getBudget() { return budget; } /** * Set the project's budget. * @param budget The project's budget. */ public void setBudget(BigDecimal budget) { this.budget = budget; } /** * Get the reviewers associated with this project. */ public Set getReviewers() { return Collections.unmodifiableSet(reviewers); } /** * Add a reviewer to the project. * @param emp The employee to add as a reviewer. */ public void addReviewer(FCDSEmployee emp) { reviewers.add(emp); } /** * Remove a reviewer from the project. * @param emp The employee to remove as a reviewer of this project. */ public void removeReviewer(FCDSEmployee emp) { reviewers.remove(emp); } /** * Set the reviewers associated with this project. * @param reviewers The set of reviewers to associate with this project. */ public void setReviewers(Set reviewers) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this.reviewers = (reviewers != null) ? new HashSet(reviewers) : null; } /** * Get the project members. * * @return The members of the project is returned as an unmodifiable * set of FCDSEmployees. */ public Set getMembers() { return Collections.unmodifiableSet(members); } /** * Add a new member to the project. * @param emp The employee to add to the project. */ public void addMember(FCDSEmployee emp) { members.add(emp); } /** * Remove a member from the project. * @param emp The employee to remove from the project. */ public void removeMember(FCDSEmployee emp) { members.remove(emp); } /** * Set the members of the project. * @param employees The set of employees to be the members of this * project. */ public void setMembers(Set employees) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this.members = (members != null) ? new HashSet(employees) : null; } /** Serialization support: initialize transient fields. */ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); reviewers = new HashSet(); members = new HashSet(); } /** * Returns a String representation of a FCDSProject object. * * @return a String representation of a FCDSProject object. */ public String toString() { return "FCProject(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(projid); rc.append(", name ").append(name); rc.append(", budget ").append(budget); return rc.toString(); } /** * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the specified Person. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { FCDSProject otherProject = (FCDSProject)other; String where = "FCProject<" + projid + ">"; return helper.equals(projid, otherProject.getProjid(), where + ".projid") & helper.equals(name, otherProject.getName(), where + ".name") & helper.equals(budget, otherProject.getBudget(), where + ".budget") & helper.deepEquals(reviewers, otherProject.getReviewers(), where + ".reviewers") & helper.deepEquals(members, otherProject.getMembers(), where + ".members"); } /** * Compares this object with the specified object for order. Returns a * negative integer, zero, or a positive integer as this object is less * than, equal to, or greater than the specified object. * @param o The Object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified object. * @throws ClassCastException - if the specified object's type prevents * it from being compared to this Object. */ public int compareTo(Object o) { return compareTo((FCDSProject)o); } /** * Compare two instances. This is a method in Comparator. */ public int compare(Object o1, Object o2) { return compare((FCDSProject)o1, (FCDSProject)o2); } /** * * Compares this object with the specified FCDSProject object for * order. Returns a negative integer, zero, or a positive integer as * this object is less than, equal to, or greater than the specified * object. * * @param other The FCDSProject object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified FFCDSProject object. */ public int compareTo(FCDSProject other) { return compare(this, other); } /** * Compares its two IProject arguments for order. Returns a negative * integer, zero, or a positive integer as the first argument is less * than, equal to, or greater than the second. * @param o1 the first IProject object to be compared. * @param o2 the second IProject object to be compared. * @return a negative integer, zero, or a positive integer as the first * object is less than, equal to, or greater than the second object. */ public static int compare(FCDSProject o1, FCDSProject o2) { return EqualityHelper.compare(o1.getProjid(), o2.getProjid()); } /** * Indicates whether some other object is "equal to" this one. * @param obj the object with which to compare. * @return true if this object is the same as the obj * argument; false otherwise. */ public boolean equals(Object obj) { if (obj instanceof FCDSProject) { return compareTo((FCDSProject)obj) == 0; } return false; } /** * Returns a hash code value for the object. * @return a hash code value for this object. */ public int hashCode() { return (int)projid; } /** * This class is used to represent the application identity * for the FCDSProject class. */ public static class Oid implements Serializable, Comparable { /** * This field represents the identifier for the * FCDSProject class. It must match a field in the * FCDSProject class in both name and type. */ public long projid; /** * The required public no-arg constructor. */ public Oid() { } /** * Initialize the application identifier with a project ID. * @param projid The id of the project. */ public Oid(long projid) { this.projid = projid; } public Oid(String s) { projid = Long.parseLong(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + projid;} /** */ public boolean equals(java.lang.Object obj) { if( obj==null || !this.getClass().equals(obj.getClass()) ) return( false ); Oid o = (Oid) obj; if( this.projid != o.projid ) return( false ); return( true ); } /** */ public int hashCode() { return( (int) projid ); } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } /** */ public int compareTo(Object obj) { // may throw ClassCastException which the user must handle Oid other = (Oid) obj; if( projid < other.projid ) return -1; if( projid > other.projid ) return 1; return 0; } } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/CompanyFactoryAnnotatedJPAAppConcrete.java100664 5406 12500110372 33310 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedJPA; import javax.jdo.PersistenceManager; import org.apache.jdo.tck.pc.company.*; /* * CompanyFactoryAnnotatedPMFieldClass.java * * This class uses the PersistenceManager.newInstance method with the concrete * class as a parameter. */ public class CompanyFactoryAnnotatedJPAAppConcrete extends CompanyFactoryAbstractImpl { PersistenceManager pm = null; /** * Creates a new instance of CompanyFactoryAnnotatedPMFieldClass */ public CompanyFactoryAnnotatedJPAAppConcrete(PersistenceManager pm) { super(pm); this.pm = pm; } public Class[] getTearDownClasses() { return new Class[] { JPAAppDentalInsurance.class, JPAAppMedicalInsurance.class, JPAAppPartTimeEmployee.class, JPAAppFullTimeEmployee.class, JPAAppProject.class, JPAAppDepartment.class, JPAAppCompany.class, JPAAppAddress.class }; } public IAddress newAddress() { return (IAddress) new JPAAppAddress(); } public IMeetingRoom newMeetingRoom() { return (IMeetingRoom)null; } public ICompany newCompany() { return (ICompany) new JPAAppCompany(); } public IDentalInsurance newDentalInsurance() { return (IDentalInsurance) new JPAAppDentalInsurance(); } public IDepartment newDepartment() { return (IDepartment) new JPAAppDepartment(); } public IFullTimeEmployee newFullTimeEmployee() { return (IFullTimeEmployee) new JPAAppFullTimeEmployee(); } public IMedicalInsurance newMedicalInsurance() { return (IMedicalInsurance) new JPAAppMedicalInsurance(); } public IPartTimeEmployee newPartTimeEmployee() { return (IPartTimeEmployee) new JPAAppPartTimeEmployee(); } public IProject newProject() { return (IProject) new JPAAppProject(); } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/CompanyFactoryAnnotatedJPAAppPM.java100664 5532 12500110372 32062 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedJPA; import javax.jdo.PersistenceManager; import org.apache.jdo.tck.pc.company.*; /* * CompanyFactoryAnnotatedPMFieldClass.java * * This class uses the PersistenceManager.newInstance method with the concrete * class as a parameter. */ public class CompanyFactoryAnnotatedJPAAppPM extends CompanyFactoryAbstractImpl implements CompanyFactoryNewInstance { /** * Creates a new instance of CompanyFactoryAnnotatedPMFieldClass */ public CompanyFactoryAnnotatedJPAAppPM(PersistenceManager pm) { super(pm); } public Class[] getTearDownClasses() { return new Class[] { JPAAppDentalInsurance.class, JPAAppMedicalInsurance.class, JPAAppPartTimeEmployee.class, JPAAppFullTimeEmployee.class, JPAAppProject.class, JPAAppDepartment.class, JPAAppCompany.class, JPAAppAddress.class }; } public IAddress newAddress() { return (IAddress)pm.newInstance(JPAAppAddress.class); } public IMeetingRoom newMeetingRoom() { return (IMeetingRoom)null; } public ICompany newCompany() { return (ICompany)pm.newInstance(JPAAppCompany.class); } public IDentalInsurance newDentalInsurance() { return (IDentalInsurance)pm.newInstance(JPAAppDentalInsurance.class); } public IDepartment newDepartment() { return (IDepartment)pm.newInstance(JPAAppDepartment.class); } public IFullTimeEmployee newFullTimeEmployee() { return (IFullTimeEmployee)pm.newInstance(JPAAppFullTimeEmployee.class); } public IMedicalInsurance newMedicalInsurance() { return (IMedicalInsurance)pm.newInstance(JPAAppMedicalInsurance.class); } public IPartTimeEmployee newPartTimeEmployee() { return (IPartTimeEmployee)pm.newInstance(JPAAppPartTimeEmployee.class); } public IProject newProject() { return (IProject)pm.newInstance(JPAAppProject.class); } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/CompanyFactoryAnnotatedPMFieldClassJPA.java100664 7665 12500110372 33364 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedJPA; import javax.jdo.PersistenceManager; import org.apache.jdo.tck.pc.company.*; /* * CompanyFactoryAnnotatedPMFieldClassJPA.java * * This class uses the PersistenceManager.newInstance method with the concrete * class as a parameter. */ public class CompanyFactoryAnnotatedPMFieldClassJPA extends org.apache.jdo.tck.pc.company.CompanyFactoryAbstractImpl { Class addressClass = null; Class dentalInsuranceClass = null; Class medicalInsuranceClass = null; Class partTimeEmployeeClass = null; Class fullTimeEmployeeClass = null; Class projectClass = null; Class departmentClass = null; Class companyClass = null; /** * Creates a new instance of CompanyFactoryAnnotatedPMFieldClassJPA */ public CompanyFactoryAnnotatedPMFieldClassJPA(PersistenceManager pm) { super(pm); addressClass = org.apache.jdo.tck.pc.companyAnnotatedJPA.JPAAppAddress.class; dentalInsuranceClass = org.apache.jdo.tck.pc.companyAnnotatedJPA.JPAAppDentalInsurance.class; medicalInsuranceClass = org.apache.jdo.tck.pc.companyAnnotatedJPA.JPAAppMedicalInsurance.class; partTimeEmployeeClass = org.apache.jdo.tck.pc.companyAnnotatedJPA.JPAAppPartTimeEmployee.class; fullTimeEmployeeClass = org.apache.jdo.tck.pc.companyAnnotatedJPA.JPAAppFullTimeEmployee.class; projectClass = org.apache.jdo.tck.pc.companyAnnotatedJPA.JPAAppProject.class; departmentClass = org.apache.jdo.tck.pc.companyAnnotatedJPA.JPAAppDepartment.class; companyClass = org.apache.jdo.tck.pc.companyAnnotatedJPA.JPAAppCompany.class; } public Class[] getTearDownClasses() { return new Class[] { dentalInsuranceClass, medicalInsuranceClass, partTimeEmployeeClass, fullTimeEmployeeClass, projectClass, departmentClass, companyClass }; } public IAddress newAddress() { return (IAddress)pm.newInstance(addressClass); } public IMeetingRoom newMeetingRoom() { return (IMeetingRoom)null; } public ICompany newCompany() { return (ICompany)pm.newInstance(companyClass); } public IDentalInsurance newDentalInsurance() { return (IDentalInsurance)pm.newInstance(dentalInsuranceClass); } public IDepartment newDepartment() { return (IDepartment)pm.newInstance(departmentClass); } public IFullTimeEmployee newFullTimeEmployee() { return (IFullTimeEmployee)pm.newInstance(fullTimeEmployeeClass); } public IMedicalInsurance newMedicalInsurance() { return (IMedicalInsurance)pm.newInstance(medicalInsuranceClass); } public IPartTimeEmployee newPartTimeEmployee() { return (IPartTimeEmployee)pm.newInstance(partTimeEmployeeClass); } public IProject newProject() { return (IProject)pm.newInstance(projectClass); } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppAddress.java100664 25156 12500110372 26442 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedJPA; import java.io.Serializable; import java.util.Comparator; import javax.persistence.*; import org.apache.jdo.tck.pc.company.IAddress; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a postal address. */ @Embeddable public class JPAAppAddress implements IAddress, Serializable, Comparable, Comparator, DeepEquality { private long addrid; private String street; private String city; private String state; private String zipcode; private String country; /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public JPAAppAddress() {} /** * This constructor initializes the JPAAppAddress components. * * * * @param addrid The address ID. * @param street The street address. * @param city The city. * @param state The state. * @param zipcode The zip code. * @param country The zip country. */ public JPAAppAddress(long addrid, String street, String city, String state, String zipcode, String country) { this.addrid = addrid; this.street = street; this.city = city; this.state = state; this.zipcode = zipcode; this.country = country; } /** * Get the addrid associated with this object. * @return the addrid. */ public long getAddrid() { return addrid; } /** * Set the id associated with this object. * @param id the id. */ public void setAddrid(long id) { if (this.addrid != 0) throw new IllegalStateException("Id is already set."); this.addrid = id; } /** * Get the street component of the address. * @return The street component of the address. */ public String getStreet() { return street; } /** * Set the street component of the address. * @param street The street component. */ public void setStreet(String street) { this.street = street; } /** * Get the city. * @return The city component of the address. */ public String getCity() { return city; } /** * Set the city component of the address. * @param city The city. */ public void setCity(String city) { this.city = city; } /** * Get the state component of the address. * @return The state. */ public String getState() { return state; } /** * Set the state component of the address. * @param state The state. */ public void setState(String state) { this.state = state; } /** * Get the zipcode component of the address. * @return The zipcode. */ public String getZipcode() { return zipcode; } /** * Set the zip code component of the address. * @param zipcode The zipcode. */ public void setZipcode(String zipcode) { this.zipcode = zipcode; } /** * Get the country component of the address. * @return The country. */ public String getCountry() { return country; } /** * Set the country component of the address. * @param country The country. */ public void setCountry(String country) { this.country = country; } /** * Returns a String representation of a Address object. * @return a String representation of a Address object. */ public String toString() { return "Address(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(addrid); rc.append(", street ").append(street); rc.append(", city ").append(city); rc.append(", state ").append(state); rc.append(", zipcode ").append(zipcode); rc.append(", country ").append(country); return rc.toString(); } /** * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the specified Person. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { JPAAppAddress otherAddress = (JPAAppAddress)other; String where = "Address<" + addrid + ">"; return helper.equals(addrid, otherAddress.getAddrid(), where + ".addrid") & helper.equals(street, otherAddress.getStreet(), where + ".street") & helper.equals(city, otherAddress.getCity(), where + ".city") & helper.equals(state, otherAddress.getState(), where + ".state") & helper.equals(zipcode, otherAddress.getZipcode(), where + ".zipcode") & helper.equals(country, otherAddress.getCountry(), where + ".country"); } /** * Compares this object with the specified object for order. Returns a * negative integer, zero, or a positive integer as this object is less * than, equal to, or greater than the specified object. * @param o The Object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified object. * @throws ClassCastException - if the specified object's type prevents * it from being compared to this Object. */ public int compareTo(Object o) { return compareTo((JPAAppAddress)o); } /** * Compare two instances. This is a method in Comparator. */ public int compare(Object o1, Object o2) { return compare((JPAAppAddress)o1, (JPAAppAddress)o2); } /** * Compares this object with the specified Address object for * order. Returns a negative integer, zero, or a positive integer as * this object is less than, equal to, or greater than the specified * object. * @param other The Address object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified Address * object. */ public int compareTo(JPAAppAddress other) { return compare(this, other); } /** * Compares its two JPAAppAddress arguments for order. Returns a negative * integer, zero, or a positive integer as the first argument is less * than, equal to, or greater than the second. * * * * @param o1 the first JPAAppAddresss object to be compared. * @param o2 the second JPAAppAddressobject to be compared. * @return a negative integer, zero, or a positive integer as the first * object is less than, equal to, or greater than the second object. */ public static int compare(JPAAppAddress o1, JPAAppAddress o2) { return EqualityHelper.compare(o1.getAddrid(), o2.getAddrid()); } /** * Indicates whether some other object is "equal to" this one. * @param obj the object with which to compare. * @return true if this object is the same as the obj * argument; false otherwise. */ public boolean equals(Object obj) { if (obj instanceof JPAAppAddress) { return compareTo((JPAAppAddress)obj) == 0; } return false; } /** * Returns a hash code value for the object. * @return a hash code value for this object. */ public int hashCode() { return (int)addrid; } /** * This class is used to represent the application identifier * for the Address class. */ public static class Oid implements Serializable, Comparable { /** * This is the identifier field for Address and must * correspond in type and name to the field in * Address. */ public long addrid; /** The required public, no-arg constructor. */ public Oid() { addrid = 0; } /** * A constructor to initialize the identifier field. * @param addrid the id of the Address. */ public Oid(long addrid) { this.addrid = addrid; } public Oid(String s) { addrid = Long.parseLong(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + addrid;} /** */ public boolean equals(java.lang.Object obj) { if( obj==null || !this.getClass().equals(obj.getClass()) ) return( false ); Oid o = (Oid) obj; if( this.addrid != o.addrid ) return( false ); return( true ); } /** */ public int hashCode() { return( (int) addrid ); } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } /** */ public int compareTo(Object obj) { // may throw ClassCastException which the user must handle Oid other = (Oid) obj; if( addrid < other.addrid ) return -1; if( addrid > other.addrid ) return 1; return 0; } } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppCompany.java100664 31655 12500110372 26464 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedJPA; import javax.persistence.*; import java.io.Serializable; import java.io.ObjectInputStream; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.Collections; import java.util.Comparator; import java.util.Set; import java.util.HashSet; import java.util.Date; import org.apache.jdo.tck.pc.company.IAddress; import org.apache.jdo.tck.pc.company.ICompany; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents information about a company. */ @Entity(name="Company") @Table(name="companies") @Inheritance(strategy=InheritanceType.SINGLE_TABLE) @DiscriminatorColumn(discriminatorType=DiscriminatorType.STRING, name="DISCRIMINATOR") public class JPAAppCompany implements ICompany, Serializable, Comparable, Comparator, DeepEquality { @Id @Column(name="ID") private long companyid; @Column(name="NAME") private String name; @Column(name="FOUNDEDDATE") @Temporal(TemporalType.TIMESTAMP) private Date founded; @Basic @Embedded @AttributeOverrides({ @AttributeOverride(name="street", column=@Column(name="STREET")), @AttributeOverride(name="city", column=@Column(name="CITY")), @AttributeOverride(name="state", column=@Column(name="STATE")), @AttributeOverride(name="zipcode", column=@Column(name="ZIPCODE")), @AttributeOverride(name="country", column=@Column(name="COUNTRY")) }) private JPAAppAddress address; @OneToMany(mappedBy="company") private Set departments = new HashSet(); protected static SimpleDateFormat formatter = new SimpleDateFormat("d/MMM/yyyy"); /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public JPAAppCompany() {} /** * * Initialize the JPAAppCompany instance. * * * @param companyid The company id. * @param name The company name. * @param founded The date the company was founded. */ public JPAAppCompany(long companyid, String name, Date founded) { this.companyid = companyid; this.name = name; this.founded = founded; } /** * Initialize the Company instance. * @param companyid The company id. * @param name The company name. * @param founded The date the company was founded. * @param addr The company's address. */ public JPAAppCompany(long companyid, String name, Date founded, IAddress addr) { this(companyid, name, founded); this.address = (JPAAppAddress)addr; } /** * Get the company id. * @return The company id. */ public long getCompanyid() { return companyid; } /** * Set the id associated with this object. * @param id the id. */ public void setCompanyid(long id) { if (this.companyid != 0) throw new IllegalStateException("Id is already set."); this.companyid = id; } /** * Get the name of the company. * @return The name of the company. */ public String getName() { return name; } /** * Set the name of the company. * @param name The value to use for the name of the company. */ public void setName(String name) { this.name = name; } /** * Get the date that the company was founded. * @return The date the company was founded. */ public Date getFounded() { return founded; } /** * Set the date that the company was founded. * @param founded The date to set that the company was founded. */ public void setFounded(Date founded) { this.founded = founded; } /** * Get the address of the company. * @return The primary address of the company. */ public IAddress getAddress() { return address; } /** * Set the primary address for the company. * @param address The address to set for the company. */ public void setAddress(IAddress address) { this.address = (JPAAppAddress)address; } /** * Get the departments contained in the company. * * * @return An unmodifiable Set that contains all the * JPAAppDepartments of the company. */ public Set getDepartments() { return Collections.unmodifiableSet(departments); } /** * Add a JPAAppDepartment instance to the company. * * * @param dept The JPAAppDepartment instance to add. */ public void addDepartment(JPAAppDepartment dept) { departments.add(dept); } /** * Remove a JPAAppDepartment instance from the company. * * * @param dept The JPAAppDepartment instance to remove. */ public void removeDepartment(JPAAppDepartment dept) { departments.remove(dept); } /** * Initialize the set of JPAAppDepartments in the company to the * parameter. * * * @param departments The set of JPAAppDepartments for the * company. */ public void setDepartments(Set departments) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this.departments = (departments != null) ? new HashSet(departments) : null; } /** Serialization support: initialize transient fields. */ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); departments = new HashSet(); } /** * Returns a String representation of a Company object. * @return a String representation of a Company object. */ public String toString() { return "Company(" + getFieldRepr()+ ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(companyid); rc.append(", name ").append(name); rc.append(", founded ").append( founded==null ? "null" : formatter.format(founded)); return rc.toString(); } /** * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the specified Person. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { JPAAppCompany otherCompany = (JPAAppCompany)other; String where = "Company<" + companyid + ">"; return helper.equals(companyid, otherCompany.getCompanyid(), where + ".companyid") & helper.equals(name, otherCompany.getName(), where + ".name") & helper.equals(founded, otherCompany.getFounded(), where + ".founded") & helper.deepEquals(address, otherCompany.getAddress(), where + ".address") & helper.deepEquals(departments, otherCompany.getDepartments(), where + ".departments"); } /** * Compares this object with the specified object for order. Returns a * negative integer, zero, or a positive integer as this object is less * than, equal to, or greater than the specified object. * @param o The Object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified object. * @throws ClassCastException - if the specified object's type prevents * it from being compared to this Object. */ public int compareTo(Object o) { return compareTo((JPAAppCompany)o); } /** * Compare two instances. This is a method in Comparator. */ public int compare(Object o1, Object o2) { return compare((JPAAppCompany)o1, (JPAAppCompany)o2); } /** * Compares this object with the specified Company object for * order. Returns a negative integer, zero, or a positive integer as * this object is less than, equal to, or greater than the specified * object. * @param other The Company object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified Company * object. */ public int compareTo(JPAAppCompany other) { return compare(this, other); } /** * Compares its two ICompany arguments for order. Returns a negative * integer, zero, or a positive integer as the first argument is less * than, equal to, or greater than the second. * @param o1 the first ICompany object to be compared. * @param o2 the second ICompany object to be compared. * @return a negative integer, zero, or a positive integer as the first * object is less than, equal to, or greater than the second object. */ public static int compare(JPAAppCompany o1, JPAAppCompany o2) { return EqualityHelper.compare(o1.getCompanyid(), o2.getCompanyid()); } /** * Indicates whether some other object is "equal to" this one. * @param obj the object with which to compare. * @return true if this object is the same as the obj * argument; false otherwise. */ public boolean equals(Object obj) { if (obj instanceof JPAAppCompany) { return compareTo((JPAAppCompany)obj) == 0; } return false; } /** * Returns a hash code value for the object. * @return a hash code value for this object. */ public int hashCode() { return (int)companyid; } /** * The class to be used as the application identifier * for the Company class. It consists of both the company * name and the date that the company was founded. */ public static class Oid implements Serializable, Comparable { /** * This field is part of the identifier and should match in name * and type with a field in the Company class. */ public long companyid; /** The required public no-arg constructor. */ public Oid() { } /** * Initialize the identifier. * @param companyid The id of the company. */ public Oid(long companyid) { this.companyid = companyid; } public Oid(String s) { companyid = Long.parseLong(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + companyid;} /** */ public boolean equals(Object obj) { if (obj==null || !this.getClass().equals(obj.getClass())) return false; Oid o = (Oid) obj; if (this.companyid != o.companyid) return false; return true; } /** */ public int hashCode() { return (int)companyid; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } /** */ public int compareTo(Object obj) { // may throw ClassCastException which the user must handle Oid other = (Oid) obj; if( companyid < other.companyid ) return -1; if( companyid > other.companyid ) return 1; return 0; } } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppDentalInsurance.java100664 11313 12500110372 30122 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedJPA; import javax.persistence.*; import java.math.BigDecimal; import org.apache.jdo.tck.pc.company.IDentalInsurance; import org.apache.jdo.tck.pc.company.IEmployee; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a dental insurance carrier selection for a * particular Employee. */ @Entity public class JPAAppDentalInsurance extends JPAAppInsurance implements IDentalInsurance { @Column(name="LIFETIME_ORTHO_BENEFIT") private BigDecimal lifetimeOrthoBenefit; /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public JPAAppDentalInsurance() {} /** * Construct a DentalInsurance instance. * @param insid The insurance instance identifier. * @param carrier The insurance carrier. * @param lifetimeOrthoBenefit The lifetimeOrthoBenefit. */ public JPAAppDentalInsurance(long insid, String carrier, BigDecimal lifetimeOrthoBenefit) { super(insid, carrier); this.lifetimeOrthoBenefit = lifetimeOrthoBenefit; } /** * Construct a JPAAppDentalInsurance instance. * * * @param insid The insurance instance identifier. * @param carrier The insurance carrier. * @param employee The employee associated with this insurance. * @param lifetimeOrthoBenefit The lifetimeOrthoBenefit. */ public JPAAppDentalInsurance(long insid, String carrier, IEmployee employee, BigDecimal lifetimeOrthoBenefit) { super(insid, carrier, employee); this.lifetimeOrthoBenefit = lifetimeOrthoBenefit; } /** * Get the insurance lifetimeOrthoBenefit. * @return The insurance lifetimeOrthoBenefit. */ public BigDecimal getLifetimeOrthoBenefit() { return lifetimeOrthoBenefit; } /** * Set the insurance lifetimeOrthoBenefit. * @param lifetimeOrthoBenefit The insurance lifetimeOrthoBenefit. */ public void setLifetimeOrthoBenefit(BigDecimal lifetimeOrthoBenefit) { this.lifetimeOrthoBenefit = lifetimeOrthoBenefit; } /** * Returns a String representation of a JPAAppDentalInsurance * object. * * * @return a String representation of a JPAAppDentalInsurance * object. */ public String toString() { return "JPAAppDentalInsurance(" + getFieldRepr()+ ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(super.getFieldRepr()); rc.append(", lifetimeOrthoBenefit ").append(lifetimeOrthoBenefit); return rc.toString(); } /** * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the other Object. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { JPAAppDentalInsurance otherIns = (JPAAppDentalInsurance)other; String where = "JPAAppDentalInsurance<" + getInsid() + ">"; return super.deepCompareFields(otherIns, helper) & helper.equals(lifetimeOrthoBenefit, otherIns.getLifetimeOrthoBenefit(), where + ".lifetimeOrthoBenefit"); } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppDepartment.java100664 34571 12500110372 27161 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedJPA; import javax.persistence.*; import java.io.Serializable; import java.io.ObjectInputStream; import java.io.IOException; import java.util.Collections; import java.util.Comparator; import java.util.HashSet; import java.util.List; import java.util.Set; import org.apache.jdo.tck.pc.company.ICompany; import org.apache.jdo.tck.pc.company.IDepartment; import org.apache.jdo.tck.pc.company.IEmployee; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a department within a company. */ @Entity @Table(name="departments") @Inheritance(strategy=InheritanceType.SINGLE_TABLE) @DiscriminatorColumn(discriminatorType=DiscriminatorType.STRING, name="DISCRIMINATOR") public class JPAAppDepartment implements IDepartment, Serializable, Comparable, Comparator, DeepEquality { public static final int RECOMMENDED_NO_OF_EMPS = 2; @Id @Column(name="ID") private long deptid; @Column(name="NAME") private String name; @Column(name="COMPANYID") private JPAAppCompany company; @Column(name="EMP_OF_THE_MONTH") private JPAAppEmployee employeeOfTheMonth; @OneToMany(mappedBy="department", targetEntity=org.apache.jdo.tck.pc.companyAnnotatedJPA.JPAAppEmployee.class) private Set employees = new HashSet(); @OneToMany(mappedBy="fundingDept", targetEntity=org.apache.jdo.tck.pc.companyAnnotatedJPA.JPAAppEmployee.class) private Set fundedEmps = new HashSet(); /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public JPAAppDepartment() {} /** * Construct a Department instance. * @param deptid The department id. * @param name The name of the department. */ public JPAAppDepartment(long deptid, String name) { this.deptid = deptid; this.name = name; } /** * Construct a Department instance. * @param deptid The department id. * @param name The name of the department. * @param company The company that the department is associated with. */ public JPAAppDepartment(long deptid, String name, ICompany company) { this.deptid = deptid; this.name = name; this.company = (JPAAppCompany)company; } /** * Construct a Department instance. * @param deptid The department id. * @param name The name of the department. * @param company The company that the department is associated with. * @param employeeOfTheMonth The employee of the month the * department is associated with. */ public JPAAppDepartment(long deptid, String name, ICompany company, IEmployee employeeOfTheMonth) { this.deptid = deptid; this.name = name; this.company = (JPAAppCompany)company; this.employeeOfTheMonth = (JPAAppEmployee)employeeOfTheMonth; } /** * Set the id associated with this object. * @param id the id. */ public void setDeptid(long id) { if (this.deptid != 0) throw new IllegalStateException("Id is already set."); this.deptid = id; } /** * Get the department id. * @return The department id. */ public long getDeptid() { return deptid; } /** * Get the name of the department. * @return The name of the department. */ public String getName() { return name; } /** * Set the name of the department. * @param name The name to set for the department. */ public void setName(String name) { this.name = name; } /** * Get the company associated with the department. * @return The company. */ public ICompany getCompany() { return company; } /** * Set the company for the department. * @param company The company to associate with the department. */ public void setCompany(ICompany company) { this.company = (JPAAppCompany)company; } /** * Get the employee of the month associated with the department. * @return The employee of the month. */ public IEmployee getEmployeeOfTheMonth() { return employeeOfTheMonth; } /** * Set the employee of the month for the department. * @param employeeOfTheMonth The employee of the month to * associate with the department. */ public void setEmployeeOfTheMonth(IEmployee employeeOfTheMonth) { this.employeeOfTheMonth = (JPAAppEmployee)employeeOfTheMonth; } /** * Get the employees in the department as an unmodifiable set. * @return The set of employees in the department, as an unmodifiable * set. */ public Set getEmployees() { return Collections.unmodifiableSet(employees); } /** * Add an employee to the department. * @param emp The employee to add to the department. */ public void addEmployee(JPAAppEmployee emp) { employees.add(emp); } /** * Remove an employee from the department. * @param emp The employee to remove from the department. */ public void removeEmployee(JPAAppEmployee emp) { employees.remove(emp); } /** * Set the employees to be in this department. * @param employees The set of employees for this department. */ public void setEmployees(Set employees) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this.employees = (employees != null) ? new HashSet(employees) : null; } /** * Get the funded employees in the department as an unmodifiable set. * @return The set of funded employees in the department, as an * unmodifiable set. */ public Set getFundedEmps() { return Collections.unmodifiableSet(fundedEmps); } /** * Add an employee to the collection of funded employees of this * department. * @param emp The employee to add to the department. */ public void addFundedEmp(JPAAppEmployee emp) { fundedEmps.add(emp); } /** * Remove an employee from collection of funded employees of this * department. * @param emp The employee to remove from the department. */ public void removeFundedEmp(JPAAppEmployee emp) { fundedEmps.remove(emp); } /** * Set the funded employees to be in this department. * @param employees The set of funded employees for this department. */ public void setFundedEmps(Set employees) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this.fundedEmps = (fundedEmps != null) ? new HashSet(employees) : null; } @Override public List getMeetingRooms() { // TODO Auto-generated method stub return null; } @Override public void setMeetingRooms(List rooms) { // TODO Auto-generated method stub } /** Serialization support: initialize transient fields. */ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); employees = new HashSet(); fundedEmps = new HashSet(); } /** * * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the other JPAAppDepartment. * * * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { JPAAppDepartment otherDept = (JPAAppDepartment)other; String where = "JPADepartment<" + deptid + ">"; return helper.equals(deptid, otherDept.getDeptid(), where + ".deptid") & helper.equals(name, otherDept.getName(), where + ".name") & helper.deepEquals(company, otherDept.getCompany(), where + ".company") & helper.deepEquals(employeeOfTheMonth, otherDept.getEmployeeOfTheMonth(), where + ".employeeOfTheMonth") & helper.deepEquals(employees, otherDept.getEmployees(), where + ".employees") & helper.deepEquals(fundedEmps, otherDept.getFundedEmps(), where + ".fundedEmps"); } /** * Returns a String representation of a JPAAppDepartment object. * * * @return a String representation of a JPAAppDepartment object. */ public String toString() { return "JPADepartment(" + getFieldRepr()+ ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(deptid); rc.append(", name ").append(name); return rc.toString(); } /** * Compares this object with the specified object for order. Returns a * negative integer, zero, or a positive integer as this object is less * than, equal to, or greater than the specified object. * @param o The Object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified object. * @throws ClassCastException - if the specified object's type prevents * it from being compared to this Object. */ public int compareTo(Object o) { return compareTo((JPAAppDepartment)o); } /** * Compare two instances. This is a method in Comparator. */ public int compare(Object o1, Object o2) { return compare((JPAAppDepartment)o1, (JPAAppDepartment)o2); } /** * Compares this object with the specified Department object for * order. Returns a negative integer, zero, or a positive integer as * this object is less than, equal to, or greater than the specified * object. * @param other The Department object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified * Department object. */ public int compareTo(JPAAppDepartment other) { return compare(this, other); } /** * Compares its two IDepartment arguments for order. Returns a negative * integer, zero, or a positive integer as the first argument is less * than, equal to, or greater than the second. * @param o1 the first IDepartment object to be compared. * @param o2 the second IDepartment object to be compared. * @return a negative integer, zero, or a positive integer as the first * object is less than, equal to, or greater than the second object. */ public static int compare(JPAAppDepartment o1, JPAAppDepartment o2) { return EqualityHelper.compare(o1.getDeptid(), o2.getDeptid()); } /** * Indicates whether some other object is "equal to" this one. * @param obj the object with which to compare. * @return true if this object is the same as the obj * argument; false otherwise. */ public boolean equals(Object obj) { if (obj instanceof JPAAppDepartment) { return compareTo((JPAAppDepartment)obj) == 0; } return false; } /** * Returns a hash code value for the object. * @return a hash code value for this object. */ public int hashCode() { return (int)deptid; } /** * The application identity class associated with the * Department class. */ public static class Oid implements Serializable, Comparable { /** * This field represents the application identifier field * for the Department class. * It must match in name and type with the field in the * Department class. */ public long deptid; /** * The required public, no-arg constructor. */ public Oid() { } /** * A constructor to initialize the identifier field. * @param deptid the deptid of the Department. */ public Oid(long deptid) { this.deptid = deptid; } public Oid(String s) { deptid = Long.parseLong(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + deptid;} /** */ public boolean equals(java.lang.Object obj) { if( obj==null || !this.getClass().equals(obj.getClass()) ) return( false ); Oid o = (Oid) obj; if( this.deptid != o.deptid ) return( false ); return( true ); } /** */ public int hashCode() { return( (int) deptid ); } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } /** */ public int compareTo(Object obj) { // may throw ClassCastException which the user must handle Oid other = (Oid) obj; if( deptid < other.deptid ) return -1; if( deptid > other.deptid ) return 1; return 0; } } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppEmployee.java100664 41367 12500110372 26636 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedJPA; import javax.persistence.*; import java.io.ObjectInputStream; import java.io.IOException; import java.util.Collections; import java.util.Date; import java.util.HashSet; import java.util.Set; import org.apache.jdo.tck.pc.company.IAddress; import org.apache.jdo.tck.pc.company.IDentalInsurance; import org.apache.jdo.tck.pc.company.IDepartment; import org.apache.jdo.tck.pc.company.IEmployee; import org.apache.jdo.tck.pc.company.IMedicalInsurance; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents an employee. */ @Entity @Table(name="employees") public abstract class JPAAppEmployee extends JPAAppPerson implements IEmployee { @Column(name="HIREDATE") @Temporal(TemporalType.TIMESTAMP) private Date hiredate; @Column(name="WEEKLYHOURS") private double weeklyhours; @OneToOne(mappedBy="employee") private JPAAppDentalInsurance dentalInsurance; @OneToOne(mappedBy="employee") private JPAAppMedicalInsurance medicalInsurance; @Column(name="DEPARTMENT") private JPAAppDepartment department; @Column(name="FUNDINGDEPT") private JPAAppDepartment fundingDept; @Column(name="MANAGER") private JPAAppEmployee manager; @Column(name="MENTOR") private JPAAppEmployee mentor; @OneToOne(mappedBy="mentor") private JPAAppEmployee protege; @Column(name="HRADVISOR") private JPAAppEmployee hradvisor; @ManyToMany(mappedBy="reviewers", targetEntity=org.apache.jdo.tck.pc.companyAnnotatedJPA.JPAAppProject.class) private Set reviewedProjects = new HashSet(); @ManyToMany(mappedBy="members", targetEntity=org.apache.jdo.tck.pc.companyAnnotatedJPA.JPAAppProject.class) private Set projects = new HashSet(); @OneToMany(mappedBy="manager", targetEntity=org.apache.jdo.tck.pc.companyAnnotatedJPA.JPAAppEmployee.class) private Set team = new HashSet(); @OneToMany(mappedBy="hradvisor", targetEntity=org.apache.jdo.tck.pc.companyAnnotatedJPA.JPAAppEmployee.class) private Set hradvisees = new HashSet(); /** This is the JDO-required no-args constructor */ protected JPAAppEmployee() {} /** * Construct an JPAAppEmployee instance. * * * @param personid The identifier for the person. * @param firstname The first name of the employee. * @param lastname The last name of the employee. * @param middlename The middle name of the employee. * @param birthdate The birth date of the employee. * @param hiredate The date that the employee was hired. */ public JPAAppEmployee(long personid, String firstname, String lastname, String middlename, Date birthdate, Date hiredate) { super(personid, firstname, lastname, middlename, birthdate); this.hiredate = hiredate; } /** * Construct an JPAAppEmployee instance. * * * @param personid The identifier for the person. * @param firstname The first name of the employee. * @param lastname The last name of the employee. * @param middlename The middle name of the employee. * @param birthdate The birth date of the employee. * @param address The address of the employee. * @param hiredate The date that the employee was hired. */ public JPAAppEmployee(long personid, String firstname, String lastname, String middlename, Date birthdate, IAddress address, Date hiredate) { super(personid, firstname, lastname, middlename, birthdate, (JPAAppAddress)address); this.hiredate = hiredate; } /** * Get the date that the employee was hired. * @return The date the employee was hired. */ public Date getHiredate() { return hiredate; } /** * Set the date that the employee was hired. * @param hiredate The date the employee was hired. */ public void setHiredate(Date hiredate) { this.hiredate = hiredate; } /** * Get the weekly hours of the employee. * @return The number of hours per week that the employee works. */ public double getWeeklyhours() { return weeklyhours; } /** * Set the number of hours per week that the employee works. * @param weeklyhours The number of hours per week that the employee * works. */ public void setWeeklyhours(double weeklyhours) { this.weeklyhours = weeklyhours; } /** * Get the reviewed projects. * @return The reviewed projects as an unmodifiable set. */ public Set getReviewedProjects() { return Collections.unmodifiableSet(reviewedProjects); } /** * Add a reviewed project. * @param project A reviewed project. */ public void addReviewedProjects(JPAAppProject project) { reviewedProjects.add(project); } /** * Remove a reviewed project. * @param project A reviewed project. */ public void removeReviewedProject(JPAAppProject project) { reviewedProjects.remove(project); } /** * Set the reviewed projects for the employee. * @param reviewedProjects The set of reviewed projects. */ public void setReviewedProjects(Set reviewedProjects) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this.reviewedProjects = (reviewedProjects != null) ? new HashSet(reviewedProjects) : null; } /** * Get the employee's projects. * @return The employee's projects are returned as an unmodifiable * set. */ public Set getProjects() { return Collections.unmodifiableSet(projects); } /** * Add a project for the employee. * @param project The project. */ public void addProject(JPAAppProject project) { projects.add(project); } /** * Remove a project from an employee's set of projects. * @param project The project. */ public void removeProject(JPAAppProject project) { projects.remove(project); } /** * Set the projects for the employee. * @param projects The set of projects of the employee. */ public void setProjects(Set projects) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this.projects = (projects != null) ? new HashSet(projects) : null; } /** * Get the dental insurance of the employee. * @return The employee's dental insurance. */ public IDentalInsurance getDentalInsurance() { return dentalInsurance; } /** * Set the dental insurance object for the employee. * @param dentalInsurance The dental insurance object to associate with * the employee. */ public void setDentalInsurance(IDentalInsurance dentalInsurance) { this.dentalInsurance = (JPAAppDentalInsurance)dentalInsurance; } /** * Get the medical insurance of the employee. * @return The employee's medical insurance. */ public IMedicalInsurance getMedicalInsurance() { return medicalInsurance; } /** * Set the medical insurance object for the employee. * @param medicalInsurance The medical insurance object to associate * with the employee. */ public void setMedicalInsurance(IMedicalInsurance medicalInsurance) { this.medicalInsurance = (JPAAppMedicalInsurance)medicalInsurance; } /** * Get the employee's department. * @return The department associated with the employee. */ public IDepartment getDepartment() { return department; } /** * Set the employee's department. * @param department The department. */ public void setDepartment(IDepartment department) { this.department = (JPAAppDepartment)department; } /** * Get the employee's funding department. * @return The funding department associated with the employee. */ public IDepartment getFundingDept() { return fundingDept; } /** * Set the employee's funding department. * @param department The funding department. */ public void setFundingDept(IDepartment department) { this.fundingDept = (JPAAppDepartment)department; } /** * Get the employee's manager. * @return The employee's manager. */ public IEmployee getManager() { return manager; } /** * Set the employee's manager. * @param manager The employee's manager. */ public void setManager(IEmployee manager) { this.manager = (JPAAppEmployee)manager; } /** * Get the employee's team. * * * @return The set of JPAAppEmployees on this employee's team, * returned as an unmodifiable set. */ public Set getTeam() { return Collections.unmodifiableSet(team); } /** * Add an JPAAppEmployee to this employee's team. * This method sets both sides of the relationship, modifying * this employees team to include parameter emp and modifying * emp to set its manager attribute to this object. * * * @param emp The JPAAppEmployee to add to the team. */ public void addToTeam(JPAAppEmployee emp) { team.add(emp); emp.manager = this; } /** * Remove an JPAAppEmployee from this employee's team. * This method will also set the emp manager to null. * * * @param emp The JPAAppEmployee to remove from the team. */ public void removeFromTeam(JPAAppEmployee emp) { team.remove(emp); emp.manager = null; } /** * Set the employee's team. * * * @param team The set of JPAAppEmployees. */ public void setTeam(Set team) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this.team = (team != null) ? new HashSet(team) : null; } /** * Set the mentor for this employee. * @param mentor The mentor for this employee. */ public void setMentor(IEmployee mentor) { this.mentor = (JPAAppEmployee)mentor; } /** * Get the mentor for this employee. * @return The mentor. */ public IEmployee getMentor() { return mentor; } /** * Set the protege for this employee. * @param protege The protege for this employee. */ public void setProtege(IEmployee protege) { this.protege = (JPAAppEmployee)protege; } /** * Get the protege of this employee. * @return The protege of this employee. */ public IEmployee getProtege() { return protege; } /** * Set the HR advisor for this employee. * @param hradvisor The hradvisor for this employee. */ public void setHradvisor(IEmployee hradvisor) { this.hradvisor = (JPAAppEmployee)hradvisor; } /** * Get the HR advisor for the employee. * @return The HR advisor. */ public IEmployee getHradvisor() { return hradvisor; } /** * Get the HR advisees of this HR advisor. * * * @return An unmodifiable Set containing the * JPAAppEmployees that are HR advisees of this employee. */ public Set getHradvisees() { return Collections.unmodifiableSet(hradvisees); } /** * Add an JPAAppEmployee as an advisee of this HR advisor. * This method also sets the emp hradvisor to reference * this object. In other words, both sides of the relationship are * set. * * * @param emp The employee to add as an advisee. */ public void addAdvisee(JPAAppEmployee emp) { hradvisees.add(emp); emp.hradvisor = this; } /** * Remove an JPAAppEmployee as an advisee of this HR advisor. * This method also sets the emp hradvisor to null. * In other words, both sides of the relationship are set. * * * @param emp The employee to add as an HR advisee. */ public void removeAdvisee(JPAAppEmployee emp) { hradvisees.remove(emp); emp.hradvisor = null; } /** * Set the HR advisees of this HR advisor. * * * @param hradvisees The JPAAppEmployees that are HR advisees of * this employee. */ public void setHradvisees(Set hradvisees) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this.hradvisees = (hradvisees != null) ? new HashSet(hradvisees) : null; } /** Serialization support: initialize transient fields. */ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); reviewedProjects = new HashSet(); projects = new HashSet(); team = new HashSet(); hradvisees = new HashSet(); } /** * Return a String representation of a JPAAppEmployee object. * * * @return a String representation of a JPAAppEmployee object. */ public String toString() { return "JPAAPPEmployee(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(super.getFieldRepr()); rc.append(", hired ").append( hiredate==null ? "null" : formatter.format(hiredate)); rc.append(", weeklyhours ").append(weeklyhours); return rc.toString(); } /** * * Returns true if all the fields of this instance are * deep equal to the corresponding fields of the specified JPAAppEmployee. * * * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { JPAAppEmployee otherEmp = (JPAAppEmployee)other; String where = "Employee<" + getPersonid() + ">"; return super.deepCompareFields(otherEmp, helper) & helper.equals(hiredate, otherEmp.getHiredate(), where + ".hiredate") & helper.closeEnough(weeklyhours, otherEmp.getWeeklyhours(), where + ".weeklyhours") & helper.deepEquals(dentalInsurance, otherEmp.getDentalInsurance(), where + ".dentalInsurance") & helper.deepEquals(medicalInsurance, otherEmp.getMedicalInsurance(), where + ".medicalInsurance") & helper.deepEquals(department, otherEmp.getDepartment(), where + ".department") & helper.deepEquals(fundingDept, otherEmp.getFundingDept(), where + ".fundingDept") & helper.deepEquals(manager, otherEmp.getManager(), where + ".manager") & helper.deepEquals(mentor, otherEmp.getMentor(), where + ".mentor") & helper.deepEquals(protege, otherEmp.getProtege(), where + ".protege") & helper.deepEquals(hradvisor, otherEmp.getHradvisor(), where + ".hradvisor") & helper.deepEquals(reviewedProjects, otherEmp.getReviewedProjects(), where + ".reviewedProjects") & helper.deepEquals(projects, otherEmp.getProjects(), where + ".projects") & helper.deepEquals(team, otherEmp.getTeam(), where + ".team") & helper.deepEquals(hradvisees, otherEmp.getHradvisees(), where + ".hradvisees"); } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppFullTimeEmployee.java100664 11535 12500110372 30272 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedJPA; import javax.persistence.*; import java.util.Date; import org.apache.jdo.tck.pc.company.IAddress; import org.apache.jdo.tck.pc.company.IFullTimeEmployee; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a full-time employee. */ @Entity public class JPAAppFullTimeEmployee extends JPAAppEmployee implements IFullTimeEmployee { @Column(name="SALARY") private double salary; /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public JPAAppFullTimeEmployee() {} /** * Construct a full-time employee. * @param personid The person identifier. * @param first The person's first name. * @param last The person's last name. * @param middle The person's middle name. * @param born The person's birthdate. * @param hired The date that the person was hired. * @param sal The salary of the full-time employee. */ public JPAAppFullTimeEmployee(long personid, String first, String last, String middle, Date born, Date hired, double sal) { super(personid, first, last, middle, born, hired); salary = sal; } /** * Construct a full-time employee. * @param personid The person identifier. * @param first The person's first name. * @param last The person's last name. * @param middle The person's middle name. * @param born The person's birthdate. * @param addr The person's address. * @param hired The date that the person was hired. * @param sal The salary of the full-time employee. */ public JPAAppFullTimeEmployee(long personid, String first, String last, String middle, Date born, IAddress addr, Date hired, double sal) { super(personid, first, last, middle, born, (JPAAppAddress)addr, hired); salary = sal; } /** * Get the salary of the full time employee. * @return The salary of the full time employee. */ public double getSalary() { return salary; } /** * Set the salary for the full-time employee. * @param salary The salary to set for the full-time employee. */ public void setSalary(double salary) { this.salary = salary; } /** * Return a String representation of a JPAAppFullTimeEmployee object. * * * @return a String representation of a JPAAppFullTimeEmployee object. */ public String toString() { return "JPAAppFullTimeEmployee(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ public String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(super.getFieldRepr()); rc.append(", $").append(salary); return rc.toString(); } /** * * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the specified * JPAAppFullTimeEmployee. * * * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { JPAAppFullTimeEmployee otherEmp = (JPAAppFullTimeEmployee)other; String where = "JPAAppFullTimeEmployee<" + getPersonid() + ">"; return super.deepCompareFields(otherEmp, helper) & helper.closeEnough(salary, otherEmp.getSalary(), where + ".salary"); } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppInsurance.java100664 23115 12500110372 26775 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedJPA; import javax.persistence.*; import java.io.Serializable; import java.util.Comparator; import org.apache.jdo.tck.pc.company.IEmployee; import org.apache.jdo.tck.pc.company.IInsurance; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents an insurance carrier selection for a particular * JPAAppEmployee. */ @Entity @Table(name="insuranceplans") @Inheritance(strategy=InheritanceType.SINGLE_TABLE) @DiscriminatorColumn(discriminatorType=DiscriminatorType.STRING, name="DISCRIMINATOR") public class JPAAppInsurance implements IInsurance, Serializable, Comparable, Comparator, DeepEquality { @Id @Column(name="INSID") private long insid; @Column(name="CARRIER") private String carrier; @Column(name="EMPLOYEE") private JPAAppEmployee employee; /** This is the JDO-required no-args constructor. */ protected JPAAppInsurance() {} /** * Construct an JPAAppInsurance instance. * * * @param insid The insurance instance identifier. * @param carrier The insurance carrier. */ protected JPAAppInsurance(long insid, String carrier) { this.insid = insid; this.carrier = carrier; } /** * Construct an JPAAppInsurance instance. * * * @param insid The insurance instance identifier. * @param carrier The insurance carrier. * @param employee The employee associated with this insurance. */ protected JPAAppInsurance(long insid, String carrier, IEmployee employee) { this.insid = insid; this.carrier = carrier; this.employee = (JPAAppEmployee)employee; } /** * Get the insurance ID. * @return the insurance ID. */ public long getInsid() { return insid; } /** * Set the insurance ID. * @param id The insurance ID value. */ public void setInsid(long id) { if (this.insid != 0) throw new IllegalStateException("Id is already set."); this.insid = id; } /** * Get the insurance carrier. * @return The insurance carrier. */ public String getCarrier() { return carrier; } /** * Set the insurance carrier. * @param carrier The insurance carrier. */ public void setCarrier(String carrier) { this.carrier = carrier; } /** * Get the associated employee. * @return The employee for this insurance. */ public IEmployee getEmployee() { return employee; } /** * Set the associated employee. * @param employee The associated employee. */ public void setEmployee(IEmployee employee) { this.employee = (JPAAppEmployee)employee; } /** * Returns a String representation of a JPAAppInsurance object. * * * @return a String representation of a JPAAppInsurance object. */ public String toString() { return "JPAAppInsurance(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(insid); rc.append(", carrier ").append(carrier); return rc.toString(); } /** * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the other Object. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { JPAAppInsurance otherIns = (JPAAppInsurance)other; String where = "JPAAppInsurance<" + insid + ">"; return helper.equals(insid, otherIns.getInsid(), where + ".insid") & helper.equals(carrier, otherIns.getCarrier(), where + ".carrier") & helper.deepEquals(employee, otherIns.getEmployee(), where + ".employee"); } /** * Compares this object with the specified object for order. Returns a * negative integer, zero, or a positive integer as this object is less * than, equal to, or greater than the specified object. * @param o The Object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified object. * @throws ClassCastException - if the specified object's type prevents * it from being compared to this Object. */ public int compareTo(Object o) { return compareTo((JPAAppInsurance)o); } /** * Compare two instances. This is a method in Comparator. */ public int compare(Object o1, Object o2) { return compare((JPAAppInsurance)o1, (JPAAppInsurance)o2); } /** * Compares this object with the specified Insurance object for * order. Returns a negative integer, zero, or a positive integer as * this object is less than, equal to, or greater than the specified * object. * @param other The Insurance object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified * Insurance object. */ public int compareTo(JPAAppInsurance other) { return compare(this, other); } /** * Compares its two IInsurance arguments for order. Returns a negative * integer, zero, or a positive integer as the first argument is less * than, equal to, or greater than the second. * @param o1 the first IInsurance object to be compared. * @param o2 the second IInsurance object to be compared. * @return a negative integer, zero, or a positive integer as the first * object is less than, equal to, or greater than the second object. */ public static int compare(JPAAppInsurance o1, JPAAppInsurance o2) { return EqualityHelper.compare(o1.getInsid(), o2.getInsid()); } /** * Indicates whether some other object is "equal to" this one. * @param obj the object with which to compare. * @return true if this object is the same as the obj * argument; false otherwise. */ public boolean equals(Object obj) { if (obj instanceof JPAAppInsurance) { return compareTo((JPAAppInsurance)obj) == 0; } return false; } /** * Returns a hash code value for the object. * @return a hash code value for this object. */ public int hashCode() { return (int)insid; } /** * This class is used to represent the application * identifier for the Insurance class. */ public static class Oid implements Serializable, Comparable { /** * This field represents the application identifier for the * Insurance class. It must match the field in the * Insurance class in both name and type. */ public long insid; /** * The required public no-args constructor. */ public Oid() { } /** * Initialize with an insurance identifier. * @param insid the insurance ID. */ public Oid(long insid) { this.insid = insid; } public Oid(String s) { insid = Long.parseLong(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + insid;} /** */ public boolean equals(java.lang.Object obj) { if( obj==null || !this.getClass().equals(obj.getClass()) ) return( false ); Oid o=(Oid) obj; if( this.insid!=o.insid ) return( false ); return( true ); } /** */ public int hashCode() { return( (int) insid ); } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } /** */ public int compareTo(Object obj) { // may throw ClassCastException which the user must handle Oid other = (Oid) obj; if( insid < other.insid ) return -1; if( insid > other.insid ) return 1; return 0; } } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppMedicalInsurance.java100664 10615 12500110372 30255 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedJPA; import javax.persistence.*; import org.apache.jdo.tck.pc.company.IEmployee; import org.apache.jdo.tck.pc.company.IMedicalInsurance; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a dental insurance carrier selection for a * particular Employee. */ @Entity public class JPAAppMedicalInsurance extends JPAAppInsurance implements IMedicalInsurance { @Column(name="PLANTYPE") private String planType; // possible values: "PPO", "EPO", "NPO" /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public JPAAppMedicalInsurance() {} /** * Construct a JPAAppMedicalInsurance instance. * * * @param insid The insurance instance identifier. * @param carrier The insurance carrier. * @param planType The planType. */ public JPAAppMedicalInsurance(long insid, String carrier, String planType) { super(insid, carrier); this.planType = planType; } /** * Construct a JPAAppMedicalInsurance instance. * * * @param insid The insurance instance identifier. * @param carrier The insurance carrier. * @param employee The employee associated with this insurance. * @param planType The planType. */ public JPAAppMedicalInsurance(long insid, String carrier, IEmployee employee, String planType) { super(insid, carrier, (JPAAppEmployee)employee); this.planType = planType; } /** * Get the insurance planType. * @return The insurance planType. */ public String getPlanType() { return planType; } /** * Set the insurance planType. * @param planType The insurance planType. */ public void setPlanType(String planType) { this.planType = planType; } /** * Returns a String representation of a JPAAppMedicalInsurance * object. * * * @return a String representation of a JPAAppMedicalInsurance * object. */ public String toString() { return "JPAMedicalInsurance(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(super.getFieldRepr()); rc.append(", planType ").append(planType); return rc.toString(); } /** * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the other Object. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { JPAAppMedicalInsurance otherIns = (JPAAppMedicalInsurance)other; String where = "JPAAppMedicalInsurance<" + getInsid() + ">"; return super.deepCompareFields(otherIns, helper) & helper.equals(planType, otherIns.getPlanType(), where + ".planType"); } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppPartTimeEmployee.java100664 11400 12500110372 30265 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedJPA; import javax.persistence.*; import java.util.Date; import org.apache.jdo.tck.pc.company.IPartTimeEmployee; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a part-time employee. */ @Entity public class JPAAppPartTimeEmployee extends JPAAppEmployee implements IPartTimeEmployee { @Column(name="WAGE") private double wage; /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public JPAAppPartTimeEmployee() {} /** * Construct a part-time employee. * @param personid The identifier for the person. * @param first The person's first name. * @param last The person's last name. * @param middle The person's middle name. * @param born The person's birthdate. * @param hired The date the person was hired. * @param wage The person's wage. */ public JPAAppPartTimeEmployee(long personid, String first, String last, String middle, Date born, Date hired, double wage ) { super(personid, first, last, middle, born, hired); this.wage = wage; } /** * Construct a part-time employee. * @param personid The identifier for the person. * @param first The person's first name. * @param last The person's last name. * @param middle The person's middle name. * @param born The person's birthdate. * @param addr The person's address. * @param hired The date the person was hired. * @param wage The person's wage. */ public JPAAppPartTimeEmployee(long personid, String first, String last, String middle, Date born, JPAAppAddress addr, Date hired, double wage ) { super(personid, first, last, middle, born, addr, hired); this.wage = wage; } /** * Get the wage of the part-time employee. * @return The wage of the part-time employee. */ public double getWage() { return wage; } /** * Set the wage of the part-time employee. * @param wage The wage of the part-time employee. */ public void setWage(double wage) { this.wage = wage; } /** * Returns a String representation of a JPAAppPartTimeEmployee object. * * * @return a String representation of a JPAAppPartTimeEmployee object. */ public String toString() { return "JPAPartTimeEmployee(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ public String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(super.getFieldRepr()); rc.append(", $" + wage); return rc.toString(); } /** * * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the specified * JPAAppPartTimeEmployee. * * * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { JPAAppPartTimeEmployee otherEmp = (JPAAppPartTimeEmployee)other; String where = "JPAPartTimeEmployee<" + getPersonid() + ">"; return super.deepCompareFields(otherEmp, helper) & helper.closeEnough(wage, otherEmp.getWage(), where + ".wage"); } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppPerson.java100664 40542 12500110372 26317 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedJPA; import javax.persistence.*; import java.io.Serializable; import java.text.SimpleDateFormat; import java.util.Comparator; import java.util.Date; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.Set; import org.apache.jdo.tck.pc.company.IAddress; import org.apache.jdo.tck.pc.company.IPerson; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a person. */ @Entity @Table(name="persons") @IdClass(org.apache.jdo.tck.pc.companyAnnotatedJPA.JPAAppPerson.Oid.class) @Inheritance(strategy=InheritanceType.SINGLE_TABLE) @DiscriminatorColumn(discriminatorType=DiscriminatorType.STRING, name="DISCRIMINATOR") public class JPAAppPerson implements IPerson, Serializable, Comparable, Comparator, DeepEquality { @Id @Column(name="PERSONID") private long personid; @Column(name="FIRSTNAME") private String firstname; @Column(name="LASTNAME") private String lastname; @Basic(optional=true, fetch=FetchType.LAZY) @Column(name="MIDDLENAME") private String middlename; @Column(name="BIRTHDATE") @Temporal(TemporalType.TIMESTAMP) private Date birthdate; @Embedded @AttributeOverrides({ @AttributeOverride(name="street", column=@Column(name="STREET")), @AttributeOverride(name="city", column=@Column(name="CITY")), @AttributeOverride(name="state", column=@Column(name="STATE")), @AttributeOverride(name="zipcode", column=@Column(name="ZIPCODE")), @AttributeOverride(name="country", column=@Column(name="COUNTRY")) }) private JPAAppAddress address; @OneToMany(mappedBy="person", cascade=CascadeType.ALL) @MapKey(name="type") private Map phoneNumbers = new HashMap(); protected static SimpleDateFormat formatter = new SimpleDateFormat("d/MMM/yyyy"); /** This is the JDO-required no-args constructor. */ protected JPAAppPerson() {} /** * Construct a JPAAppPerson instance. * * * @param personid The person identifier. * @param firstname The person's first name. * @param lastname The person's last name. * @param middlename The person's middle name. * @param birthdate The person's birthdate. */ public JPAAppPerson(long personid, String firstname, String lastname, String middlename, Date birthdate) { this.personid = personid; this.firstname = firstname; this.lastname = lastname; this.middlename = middlename; this.birthdate = birthdate; } /** * Construct a JPAAppPerson instance. * * * @param personid The person identifier. * @param firstname The person's first name. * @param lastname The person's last name. * @param middlename The person's middle name. * @param birthdate The person's birthdate. * @param address The person's address. */ public JPAAppPerson(long personid, String firstname, String lastname, String middlename, Date birthdate, IAddress address) { this(personid, firstname, lastname, middlename, birthdate); this.address = (JPAAppAddress)address; } /** * Set the id associated with this object. * @param id the id. */ public void setPersonid(long id) { if (this.personid != 0) throw new IllegalStateException("Id is already set."); this.personid = id; } /** * Get the person's id. * @return The personid. */ public long getPersonid() { return personid; } /** * Get the person's last name. * @return The last name. */ public String getLastname() { return lastname; } /** * Set the person's last name. * @param lastname The last name. */ public void setLastname(String lastname) { this.lastname = lastname; } /** * Get the person's first name. * @return The first name. */ public String getFirstname() { return firstname; } /** * Set the person's first name. * @param firstname The first name. */ public void setFirstname(String firstname) { this.firstname = firstname; } /** * Get the person's middle name. * @return The middle name. */ public String getMiddlename() { return middlename; } /** * Set the person's middle name. * @param middlename The middle name. */ public void setMiddlename(String middlename) { this.middlename = middlename; } /** * Get the address. * @return The address. */ public IAddress getAddress() { return address; } /** * Set the address. * @param address The address. */ public void setAddress(IAddress address) { this.address = (JPAAppAddress)address; } /** * Get the person's birthdate. * @return The person's birthdate. */ public Date getBirthdate() { return birthdate; } /** * Set the person's birthdate. * @param birthdate The person's birthdate. */ public void setBirthdate(Date birthdate) { this. birthdate = birthdate; } /** * Get the map of phone numbers as an unmodifiable map. * @return A Map of phone numbers. */ public Map getPhoneNumbers() { return (convertPhone2String(phoneNumbers)); } /** * Get the phone number for the specified phone number type. * @param type The phone number type ("home", "work", "mobile", etc.). * @return The phone number associated with specified type, or * null if there was no phone number for the type. */ public String getPhoneNumber(String type) { JPAAppPhoneNumber pnum = phoneNumbers.get(type); return pnum.getPhoneNumber(); } /** * Associates the specified phone number with the specified type in the * map of phone numbers of this person. * @param type The phone number type ("home", "work", "mobile", etc.). * @param phoneNumber The phone number * @return The previous phone number associated with specified type, or * null if there was no phone number for the type. */ public String putPhoneNumber(String type, String phoneNumber) { JPAAppPhoneNumber pnum = phoneNumbers.get(type); String pnumAsString = null; if (pnum != null) { pnumAsString = pnum.getPhoneNumber(); // old val } pnum = phoneNumbers.put(type, new JPAAppPhoneNumber(this, type, phoneNumber)); return pnumAsString; } /** * Remove a phoneNumber from the map of phone numbers. * @param type The phone number type ("home", "work", "mobile", etc.). * @return The previous phone number associated with specified type, or * null if there was no phone number for the type. */ public String removePhoneNumber(String type) { JPAAppPhoneNumber pnum = phoneNumbers.get(type); if (pnum == null) return null; String pnumAsString = pnum.getPhoneNumber(); // old val pnum = phoneNumbers.remove(type); return pnumAsString; } /** * Set the phoneNumber map to be in this person. * @param phoneNumbers A Map of phoneNumbers for this person. */ public void setPhoneNumbers(Map phoneNumbers) { this.phoneNumbers = (phoneNumbers != null) ? convertString2Phone(phoneNumbers) : null; } /** * Converts HashMap to HashMap */ protected HashMap convertString2Phone(Map pnums) { HashMap retval = new HashMap(); for (Object objEntry: pnums.entrySet()) { Map.Entry entry = (Map.Entry)objEntry; String key = (String)entry.getKey(); String value = (String)entry.getValue(); JPAAppPhoneNumber newValue = new JPAAppPhoneNumber(this, key, value); // System.out.println("Key = " + key + " Value = " + value); retval.put(key, newValue); } return retval; } /** * Converts HashMap to HashMap */ protected HashMap convertPhone2String(Map pnums) { HashMap retval = new HashMap(); for (Object objEntry: pnums.entrySet()) { Map.Entry entry = (Map.Entry)objEntry; String key = (String)entry.getKey(); JPAAppPhoneNumber value = (JPAAppPhoneNumber)entry.getValue(); String newValue = value.getPhoneNumber(); retval.put(key, newValue); } return retval; } /** * Returns a String representation of a JPAAppPerson object. * * @return a string representation of a JPAAppPerson object. */ public String toString() { return "JPAPerson(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(personid); rc.append(", ").append(lastname); rc.append(", ").append(firstname); rc.append(", born ").append( birthdate==null ? "null" : formatter.format(birthdate)); rc.append(", phone ").append(convertPhone2String(phoneNumbers)); return rc.toString(); } /** * * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the specified JPAAppPerson. * * * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { JPAAppPerson otherPerson = (JPAAppPerson)other; String where = "JPAPerson<" + personid + ">"; return helper.equals(personid, otherPerson.getPersonid(), where + ".personid") & helper.equals(firstname, otherPerson.getFirstname(), where + ".firstname") & helper.equals(lastname, otherPerson.getLastname(), where + ".lastname") & helper.equals(middlename, otherPerson.getMiddlename(), where + ".middlename") & helper.equals(birthdate, otherPerson.getBirthdate(), where + ".birthdate") & helper.deepEquals(address, otherPerson.getAddress(), where + ".address") & helper.deepEquals(convertPhone2String(phoneNumbers), otherPerson.getPhoneNumbers(), where + ".phoneNumbers"); } /** * Compares this object with the specified object for order. Returns a * negative integer, zero, or a positive integer as this object is less * than, equal to, or greater than the specified object. * @param o The Object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified object. * @throws ClassCastException - if the specified object's type prevents * it from being compared to this Object. */ public int compareTo(Object o) { return compareTo((JPAAppPerson)o); } /** * Compare two instances. This is a method in Comparator. */ public int compare(Object o1, Object o2) { return compare((JPAAppPerson)o1, (JPAAppPerson)o2); } /** * * Compares this object with the specified JPAAppPerson object for * order. Returns a negative integer, zero, or a positive integer as * this object is less than, equal to, or greater than the specified * object. * * * @param other The JPAAppPerson object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified JPAAppPerson * object. */ public int compareTo(JPAAppPerson other) { return compare(this, other); } /** * Compares its two IPerson arguments for order. Returns a negative * integer, zero, or a positive integer as the first argument is less * than, equal to, or greater than the second. * @param o1 the first IPerson object to be compared. * @param o2 the second IPerson object to be compared. * @return a negative integer, zero, or a positive integer as the first * object is less than, equal to, or greater than the second object. */ public static int compare(JPAAppPerson o1, JPAAppPerson o2) { return EqualityHelper.compare(o1.getPersonid(), o2.getPersonid()); } /** * Indicates whether some other object is "equal to" this one. * @param obj the object with which to compare. * @return true if this object is the same as the obj * argument; false otherwise. */ public boolean equals(Object obj) { if (obj instanceof JPAAppPerson) { return compareTo((JPAAppPerson)obj) == 0; } return false; } /** * Returns a hash code value for the object. * @return a hash code value for this object. */ public int hashCode() { return (int)personid; } /** * This class is used to represent the application identifier * for the Person class. */ public static class Oid implements Serializable, Comparable { /** * This field represents the identifier for the Person * class. It must match a field in the Person class in * both name and type. */ public long personid; /** * The required public no-arg constructor. */ public Oid() { } /** * Initialize the identifier. * @param personid The person identifier. */ public Oid(long personid) { this.personid = personid; } public Oid(String s) { personid = Long.parseLong(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + personid;} /** */ public boolean equals(java.lang.Object obj) { if( obj==null || !this.getClass().equals(obj.getClass()) ) return( false ); Oid o = (Oid) obj; if( this.personid != o.personid ) return( false ); return( true ); } /** */ public int hashCode() { return( (int) personid ); } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } /** */ public int compareTo(Object obj) { // may throw ClassCastException which the user must handle Oid other = (Oid) obj; if( personid < other.personid ) return -1; if( personid > other.personid ) return 1; return 0; } } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppPhoneNumber.java100664 13624 12500110372 27274 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedJPA; import javax.persistence.*; import java.io.Serializable; /** * This class represents a person. */ @Entity @IdClass(org.apache.jdo.tck.pc.companyAnnotatedJPA.JPAAppPhoneNumber.Oid.class) @Table(name="employee_phoneno_type") @Inheritance(strategy=InheritanceType.SINGLE_TABLE) //@DiscriminatorColumn(discriminatorType=DiscriminatorType.STRING, // name="DISCRIMINATOR") public class JPAAppPhoneNumber implements Serializable { @Id @ManyToOne @Column(name="EMPID") private JPAAppPerson person; @Id @Column(name="TYPE") private String type; @Column(name="PHONENO") private String phoneNumber; /** This is the JDO-required no-args constructor. */ protected JPAAppPhoneNumber() {} /** * Construct a JPAAppPhoneNumber instance. * * @param person The person instance * @param type The type of the phone for this number * @param phoneNumber The phone number */ public JPAAppPhoneNumber(JPAAppPerson person, String type, String phoneNumber) { this.person = person; this.type = type; this.phoneNumber = phoneNumber; } /** * Set the id associated with this object. * @param id the id. */ public void setPerson(JPAAppPerson id) { if (this.person != null) throw new IllegalStateException("Id is already set."); this.person = id; } /** * Get the person's id. * @return The person. */ public JPAAppPerson getPerson() { return person; } /** * Get the person's last name. * @return The last name. */ public String getType() { return type; } /** * Set the phone number type * @param type The phone number type */ public void setType(String type) { this.type = type; } /** * Get the phone number. * @return The phone number. */ public String getPhoneNumber() { return phoneNumber; } /** * Set the phone number. * @param phoneNumber The phone number. */ public void setPhoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; } /** * Returns a String representation of a JPAAppPhoneNumber object. * * @return a string representation of a JPAAppPhoneNumber object. */ public String toString() { return "JPAAppPhoneNumber(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(person.getPersonid()); rc.append(", ").append(type); rc.append(", phone ").append(phoneNumber); return rc.toString(); } /** * This class is used to represent the application identifier * for the Person class. */ public static class Oid implements Serializable, Comparable { /** * This field represents the identifier for the Person * class. It must match a field in the Person class in * both name and type. */ public JPAAppPerson.Oid person; public String type; /** * The required public no-arg constructor. */ public Oid() { } /** * Initialize the identifier. * @param person The person identifier. */ public Oid(JPAAppPerson.Oid person, String type) { this.person = person; this.type = type; } public Oid(String s) { person = new JPAAppPerson.Oid(justTheOid(s)); type = justTheType(s); } public String toString() { return this.getClass().getName() + ": " + person + " + " + type; } /** */ public boolean equals(java.lang.Object obj) { if( obj==null || !this.getClass().equals(obj.getClass()) ) return( false ); Oid o = (Oid) obj; if( !this.person.equals(o.person) ) return( false ); if( !this.type.equals(o.type) ) return( false ); return( true ); } /** */ public int hashCode() { return( (int) person.hashCode() + type.hashCode() ); } protected static String justTheOid(String str) { return str.substring(str.indexOf(':') + 1, str.indexOf('+') - 1); } protected static String justTheType(String str) { return str.substring(str.indexOf('+') + 1); } /** */ public int compareTo(Object obj) { // may throw ClassCastException which the user must handle Oid other = (Oid) obj; int comparison = person.compareTo(other.person); if( comparison != 0 ) { return comparison; } else { return type.compareTo(other.type); } } } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppProject.java100664 30452 12500110372 26456 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedJPA; import javax.persistence.*; import java.io.Serializable; import java.io.ObjectInputStream; import java.io.IOException; import java.util.Collections; import java.util.Comparator; import java.util.Set; import java.util.HashSet; import java.math.BigDecimal; import org.apache.jdo.tck.pc.company.IProject; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a project, a budgeted task with one or more * employees working on it. */ @Entity @Table(name="projects") @Inheritance(strategy=InheritanceType.SINGLE_TABLE) @DiscriminatorColumn(discriminatorType=DiscriminatorType.STRING, name="DISCRIMINATOR") public class JPAAppProject implements IProject, Serializable, Comparable, Comparator, DeepEquality { @Id @Column(name="PROJID") private long projid; @Column(name="NAME") private String name; @Column(name="BUDGET", length=11, scale=2) private BigDecimal budget; @ManyToMany(targetEntity=org.apache.jdo.tck.pc.companyAnnotatedJPA.JPAAppEmployee.class) @JoinTable(name="project_reviewer", joinColumns=@JoinColumn(name="PROJID"), inverseJoinColumns=@JoinColumn(name="REVIEWER")) private Set reviewers = new HashSet(); @ManyToMany(targetEntity=org.apache.jdo.tck.pc.companyAnnotatedJPA.JPAAppEmployee.class) @JoinTable(name="project_member", joinColumns=@JoinColumn(name="PROJID"), inverseJoinColumns=@JoinColumn(name="MEMBER")) private Set members = new HashSet(); /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public JPAAppProject() {} /** * Initialize a project. * @param projid The project identifier. * @param name The name of the project. * @param budget The budget for the project. */ public JPAAppProject(long projid, String name, BigDecimal budget) { this.projid = projid; this.name = name; this.budget = budget; } /** * Set the id associated with this object. * @param id the id. */ public void setProjid(long id) { if (this.projid != 0) throw new IllegalStateException("Id is already set."); this.projid = id; } /** * Get the project ID. * @return The project ID. */ public long getProjid() { return projid; } /** * Get the name of the project. * @return The name of the project. */ public String getName() { return name; } /** * Set the name of the project. * @param name The name of the project. */ public void setName(String name) { this.name = name; } /** * Get the project's budget. * @return The project's budget. */ public BigDecimal getBudget() { return budget; } /** * Set the project's budget. * @param budget The project's budget. */ public void setBudget(BigDecimal budget) { this.budget = budget; } /** * Get the reviewers associated with this project. */ public Set getReviewers() { return Collections.unmodifiableSet(reviewers); } /** * Add a reviewer to the project. * @param emp The employee to add as a reviewer. */ public void addReviewer(JPAAppEmployee emp) { reviewers.add(emp); } /** * Remove a reviewer from the project. * @param emp The employee to remove as a reviewer of this project. */ public void removeReviewer(JPAAppEmployee emp) { reviewers.remove(emp); } /** * Set the reviewers associated with this project. * @param reviewers The set of reviewers to associate with this project. */ public void setReviewers(Set reviewers) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this.reviewers = (reviewers != null) ? new HashSet(reviewers) : null; } /** * Get the project members. * * * @return The members of the project is returned as an unmodifiable * set of JPAAppEmployees. */ public Set getMembers() { return Collections.unmodifiableSet(members); } /** * Add a new member to the project. * @param emp The employee to add to the project. */ public void addMember(JPAAppEmployee emp) { members.add(emp); } /** * Remove a member from the project. * @param emp The employee to remove from the project. */ public void removeMember(JPAAppEmployee emp) { members.remove(emp); } /** * Set the members of the project. * @param employees The set of employees to be the members of this * project. */ public void setMembers(Set employees) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this.members = (employees != null) ? new HashSet(employees) : null; } /** Serialization support: initialize transient fields. */ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); reviewers = new HashSet(); members = new HashSet(); } /** * Returns a String representation of a JPAAppProject object. * * * @return a String representation of a JPAAppProject object. */ public String toString() { return "JPAProject(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(projid); rc.append(", name ").append(name); rc.append(", budget ").append(budget); return rc.toString(); } /** * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the specified Person. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { JPAAppProject otherProject = (JPAAppProject)other; String where = "JPAProject<" + projid + ">"; return helper.equals(projid, otherProject.getProjid(), where + ".projid") & helper.equals(name, otherProject.getName(), where + ".name") & helper.equals(budget, otherProject.getBudget(), where + ".budget") & helper.deepEquals(reviewers, otherProject.getReviewers(), where + ".reviewers") & helper.deepEquals(members, otherProject.getMembers(), where + ".members"); } /** * Compares this object with the specified object for order. Returns a * negative integer, zero, or a positive integer as this object is less * than, equal to, or greater than the specified object. * @param o The Object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified object. * @throws ClassCastException - if the specified object's type prevents * it from being compared to this Object. */ public int compareTo(Object o) { return compareTo((JPAAppProject)o); } /** * Compare two instances. This is a method in Comparator. */ public int compare(Object o1, Object o2) { return compare((JPAAppProject)o1, (JPAAppProject)o2); } /** * * Compares this object with the specified JPAAppProject object for * order. Returns a negative integer, zero, or a positive integer as * this object is less than, equal to, or greater than the specified * object. * * * @param other The JPAAppProject object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified JPAAppProject object. */ public int compareTo(JPAAppProject other) { return compare(this, other); } /** * Compares its two IProject arguments for order. Returns a negative * integer, zero, or a positive integer as the first argument is less * than, equal to, or greater than the second. * @param o1 the first IProject object to be compared. * @param o2 the second IProject object to be compared. * @return a negative integer, zero, or a positive integer as the first * object is less than, equal to, or greater than the second object. */ public static int compare(JPAAppProject o1, JPAAppProject o2) { return EqualityHelper.compare(o1.getProjid(), o2.getProjid()); } /** * Indicates whether some other object is "equal to" this one. * @param obj the object with which to compare. * @return true if this object is the same as the obj * argument; false otherwise. */ public boolean equals(Object obj) { if (obj instanceof JPAAppProject) { return compareTo((JPAAppProject)obj) == 0; } return false; } /** * Returns a hash code value for the object. * @return a hash code value for this object. */ public int hashCode() { return (int)projid; } /** * This class is used to represent the application identity * for the JPAAppProject class. */ public static class Oid implements Serializable, Comparable { /** * This field represents the identifier for the * JPAAppProject class. It must match a field in the * JPAAppProject class in both name and type. */ public long projid; /** * The required public no-arg constructor. */ public Oid() { } /** * Initialize the application identifier with a project ID. * @param projid The id of the project. */ public Oid(long projid) { this.projid = projid; } public Oid(String s) { projid = Long.parseLong(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + projid;} /** */ public boolean equals(java.lang.Object obj) { if( obj==null || !this.getClass().equals(obj.getClass()) ) return( false ); Oid o = (Oid) obj; if( this.projid != o.projid ) return( false ); return( true ); } /** */ public int hashCode() { return( (int) projid ); } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } /** */ public int compareTo(Object obj) { // may throw ClassCastException which the user must handle Oid other = (Oid) obj; if( projid < other.projid ) return -1; if( projid > other.projid ) return 1; return 0; } } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPC/CompanyFactoryAnnotatedPCAppConcrete.java100664 5342 12500110372 33067 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedPC; import javax.jdo.PersistenceManager; import org.apache.jdo.tck.pc.company.*; /* * CompanyFactoryAnnotatedPMFieldClass.java * * This class uses the PersistenceManager.newInstance method with the concrete * class as a parameter. */ public class CompanyFactoryAnnotatedPCAppConcrete implements CompanyFactoryNewInstance { PersistenceManager pm = null; /** * Creates a new instance of CompanyFactoryAnnotatedPMFieldClass */ public CompanyFactoryAnnotatedPCAppConcrete(PersistenceManager pm) { this.pm = pm; } public Class[] getTearDownClasses() { return new Class[] { PCAppDentalInsurance.class, PCAppMedicalInsurance.class, PCAppPartTimeEmployee.class, PCAppFullTimeEmployee.class, PCAppProject.class, PCAppDepartment.class, PCAppCompany.class, PCAppAddress.class }; } public IAddress newAddress() { return (IAddress) new PCAppAddress(); } public IMeetingRoom newMeetingRoom() { return (IMeetingRoom)null; } public ICompany newCompany() { return (ICompany) new PCAppCompany(); } public IDentalInsurance newDentalInsurance() { return (IDentalInsurance) new PCAppDentalInsurance(); } public IDepartment newDepartment() { return (IDepartment) new PCAppDepartment(); } public IFullTimeEmployee newFullTimeEmployee() { return (IFullTimeEmployee) new PCAppFullTimeEmployee(); } public IMedicalInsurance newMedicalInsurance() { return (IMedicalInsurance) new PCAppMedicalInsurance(); } public IPartTimeEmployee newPartTimeEmployee() { return (IPartTimeEmployee) new PCAppPartTimeEmployee(); } public IProject newProject() { return (IProject) new PCAppProject(); } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPC/CompanyFactoryAnnotatedPCAppPM.java100664 5516 12500110372 31644 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedPC; import javax.jdo.PersistenceManager; import org.apache.jdo.tck.pc.company.*; /* * CompanyFactoryAnnotatedPMFieldClass.java * * This class uses the PersistenceManager.newInstance method with the concrete * class as a parameter. */ public class CompanyFactoryAnnotatedPCAppPM implements CompanyFactoryNewInstance { PersistenceManager pm = null; /** * Creates a new instance of CompanyFactoryAnnotatedPMFieldClass */ public CompanyFactoryAnnotatedPCAppPM(PersistenceManager pm) { this.pm = pm; } public Class[] getTearDownClasses() { return new Class[] { PCAppDentalInsurance.class, PCAppMedicalInsurance.class, PCAppPartTimeEmployee.class, PCAppFullTimeEmployee.class, PCAppProject.class, PCAppDepartment.class, PCAppCompany.class, PCAppAddress.class }; } public IAddress newAddress() { return (IAddress)pm.newInstance(PCAppAddress.class); } public IMeetingRoom newMeetingRoom() { return (IMeetingRoom)null; } public ICompany newCompany() { return (ICompany)pm.newInstance(PCAppCompany.class); } public IDentalInsurance newDentalInsurance() { return (IDentalInsurance)pm.newInstance(PCAppDentalInsurance.class); } public IDepartment newDepartment() { return (IDepartment)pm.newInstance(PCAppDepartment.class); } public IFullTimeEmployee newFullTimeEmployee() { return (IFullTimeEmployee)pm.newInstance(PCAppFullTimeEmployee.class); } public IMedicalInsurance newMedicalInsurance() { return (IMedicalInsurance)pm.newInstance(PCAppMedicalInsurance.class); } public IPartTimeEmployee newPartTimeEmployee() { return (IPartTimeEmployee)pm.newInstance(PCAppPartTimeEmployee.class); } public IProject newProject() { return (IProject)pm.newInstance(PCAppProject.class); } } ././@LongLink100644 0 0 146 12500111677 10254 Lustar 0 0 tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPC/CompanyFactoryAnnotatedPCConcreteDelegator.javatck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPC/CompanyFactoryAnnotatedPCConcreteDelegator.jav100664 3144 12500110372 34112 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedPC; import javax.jdo.PersistenceManager; import org.apache.jdo.tck.pc.company.CompanyFactoryAnnotatedAbstractDelegator; /* * CompanyFactoryAnnotatedPMFieldClass.java * * This class uses the PersistenceManager.newInstance method with the concrete * class as a parameter. */ public class CompanyFactoryAnnotatedPCConcreteDelegator extends CompanyFactoryAnnotatedAbstractDelegator { /** * Creates a new instance of CompanyFactory */ public CompanyFactoryAnnotatedPCConcreteDelegator(PersistenceManager pm) { super(pm); if (isAppIdentity){ delegate = new CompanyFactoryAnnotatedPCAppConcrete(pm); } else { //datastoreidentity delegate = new CompanyFactoryAnnotatedPCDSConcrete(pm); } } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPC/CompanyFactoryAnnotatedPCDSConcrete.java100664 5312 12500110372 32652 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedPC; import javax.jdo.PersistenceManager; import org.apache.jdo.tck.pc.company.*; /* * CompanyFactoryAnnotatedFCDSPM.java * * This class uses the PersistenceManager.newInstance method with the concrete * class as a parameter. */ public class CompanyFactoryAnnotatedPCDSConcrete implements CompanyFactoryNewInstance { PersistenceManager pm = null; /** * Creates a new instance of CompanyFactoryAnnotatedPMFieldClass */ public CompanyFactoryAnnotatedPCDSConcrete(PersistenceManager pm) { this.pm = pm; } public Class[] getTearDownClasses() { return new Class[] { PCDSDentalInsurance.class, PCDSMedicalInsurance.class, PCDSPartTimeEmployee.class, PCDSFullTimeEmployee.class, PCDSProject.class, PCDSDepartment.class, PCDSCompany.class, PCDSAddress.class }; } public IAddress newAddress() { return (IAddress) new PCDSAddress(); } public IMeetingRoom newMeetingRoom() { return (IMeetingRoom)null; } public ICompany newCompany() { return (ICompany) new PCDSCompany(); } public IDentalInsurance newDentalInsurance() { return (IDentalInsurance) new PCDSDentalInsurance(); } public IDepartment newDepartment() { return (IDepartment) new PCDSDepartment(); } public IFullTimeEmployee newFullTimeEmployee() { return (IFullTimeEmployee) new PCDSFullTimeEmployee(); } public IMedicalInsurance newMedicalInsurance() { return (IMedicalInsurance) new PCDSMedicalInsurance(); } public IPartTimeEmployee newPartTimeEmployee() { return (IPartTimeEmployee) new PCDSPartTimeEmployee(); } public IProject newProject() { return (IProject) new PCDSProject(); } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPC/CompanyFactoryAnnotatedPCDSPM.java100664 5466 12500110372 31436 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedPC; import javax.jdo.PersistenceManager; import org.apache.jdo.tck.pc.company.*; /* * CompanyFactoryAnnotatedPCDSPM.java * * This class uses the PersistenceManager.newInstance method with the concrete * class as a parameter. */ public class CompanyFactoryAnnotatedPCDSPM implements CompanyFactoryNewInstance { PersistenceManager pm = null; /** * Creates a new instance of CompanyFactoryAnnotatedPMFieldClass */ public CompanyFactoryAnnotatedPCDSPM(PersistenceManager pm) { this.pm = pm; } public Class[] getTearDownClasses() { return new Class[] { PCDSDentalInsurance.class, PCDSMedicalInsurance.class, PCDSPartTimeEmployee.class, PCDSFullTimeEmployee.class, PCDSProject.class, PCDSDepartment.class, PCDSCompany.class, PCDSAddress.class }; } public IAddress newAddress() { return (IAddress)pm.newInstance(PCDSAddress.class); } public IMeetingRoom newMeetingRoom() { return (IMeetingRoom)null; } public ICompany newCompany() { return (ICompany)pm.newInstance(PCDSCompany.class); } public IDentalInsurance newDentalInsurance() { return (IDentalInsurance)pm.newInstance(PCDSDentalInsurance.class); } public IDepartment newDepartment() { return (IDepartment)pm.newInstance(PCDSDepartment.class); } public IFullTimeEmployee newFullTimeEmployee() { return (IFullTimeEmployee)pm.newInstance(PCDSFullTimeEmployee.class); } public IMedicalInsurance newMedicalInsurance() { return (IMedicalInsurance)pm.newInstance(PCDSMedicalInsurance.class); } public IPartTimeEmployee newPartTimeEmployee() { return (IPartTimeEmployee)pm.newInstance(PCDSPartTimeEmployee.class); } public IProject newProject() { return (IProject)pm.newInstance(PCDSProject.class); } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPC/CompanyFactoryAnnotatedPCPMDelegator.java100664 3114 12500110372 33022 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedPC; import javax.jdo.PersistenceManager; import org.apache.jdo.tck.pc.company.CompanyFactoryAnnotatedAbstractDelegator; /* * CompanyFactoryAnnotatedPMFieldClass.java * * This class uses the PersistenceManager.newInstance method with the concrete * class as a parameter. */ public class CompanyFactoryAnnotatedPCPMDelegator extends CompanyFactoryAnnotatedAbstractDelegator { /** * Creates a new instance of CompanyFactory */ public CompanyFactoryAnnotatedPCPMDelegator(PersistenceManager pm) { super(pm); if (isAppIdentity){ delegate = new CompanyFactoryAnnotatedPCAppPM(pm); } else { //datastoreidentity delegate = new CompanyFactoryAnnotatedPCDSPM(pm); } } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPC/PCAppAddress.java100664 25064 12500110372 26220 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedPC; import java.io.Serializable; import java.util.Comparator; import javax.jdo.annotations.*; import org.apache.jdo.tck.pc.company.IAddress; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a postal address. */ @PersistenceCapable(embeddedOnly="true", requiresExtent="false") public class PCAppAddress implements IAddress, Serializable, Comparable, Comparator, DeepEquality { private long addrid; private String street; private String city; private String state; private String zipcode; private String country; /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public PCAppAddress() {} /** * This constructor initializes the PCAppAddress components. * * * * @param addrid The address ID. * @param street The street address. * @param city The city. * @param state The state. * @param zipcode The zip code. * @param country The zip country. */ public PCAppAddress(long addrid, String street, String city, String state, String zipcode, String country) { this.addrid = addrid; this.street = street; this.city = city; this.state = state; this.zipcode = zipcode; this.country = country; } /** * Get the addrid associated with this object. * @return the addrid. */ public long getAddrid() { return addrid; } /** * Set the id associated with this object. * @param id the id. */ public void setAddrid(long id) { this.addrid = id; } /** * Get the street component of the address. * @return The street component of the address. */ public String getStreet() { return street; } /** * Set the street component of the address. * @param street The street component. */ public void setStreet(String street) { this.street = street; } /** * Get the city. * @return The city component of the address. */ public String getCity() { return city; } /** * Set the city component of the address. * @param city The city. */ public void setCity(String city) { this.city = city; } /** * Get the state component of the address. * @return The state. */ public String getState() { return state; } /** * Set the state component of the address. * @param state The state. */ public void setState(String state) { this.state = state; } /** * Get the zipcode component of the address. * @return The zipcode. */ public String getZipcode() { return zipcode; } /** * Set the zip code component of the address. * @param zipcode The zipcode. */ public void setZipcode(String zipcode) { this.zipcode = zipcode; } /** * Get the country component of the address. * @return The country. */ public String getCountry() { return country; } /** * Set the country component of the address. * @param country The country. */ public void setCountry(String country) { this.country = country; } /** * Returns a String representation of a Address object. * @return a String representation of a Address object. */ public String toString() { return "Address(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(addrid); rc.append(", street ").append(street); rc.append(", city ").append(city); rc.append(", state ").append(state); rc.append(", zipcode ").append(zipcode); rc.append(", country ").append(country); return rc.toString(); } /** * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the specified Person. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { PCAppAddress otherAddress = (PCAppAddress)other; String where = "Address<" + addrid + ">"; return helper.equals(addrid, otherAddress.getAddrid(), where + ".addrid") & helper.equals(street, otherAddress.getStreet(), where + ".street") & helper.equals(city, otherAddress.getCity(), where + ".city") & helper.equals(state, otherAddress.getState(), where + ".state") & helper.equals(zipcode, otherAddress.getZipcode(), where + ".zipcode") & helper.equals(country, otherAddress.getCountry(), where + ".country"); } /** * Compares this object with the specified object for order. Returns a * negative integer, zero, or a positive integer as this object is less * than, equal to, or greater than the specified object. * @param o The Object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified object. * @throws ClassCastException - if the specified object's type prevents * it from being compared to this Object. */ public int compareTo(Object o) { return compareTo((PCAppAddress)o); } /** * Compare two instances. This is a method in Comparator. */ public int compare(Object o1, Object o2) { return compare((PCAppAddress)o1, (PCAppAddress)o2); } /** * Compares this object with the specified Address object for * order. Returns a negative integer, zero, or a positive integer as * this object is less than, equal to, or greater than the specified * object. * @param other The Address object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified Address * object. */ public int compareTo(PCAppAddress other) { return compare(this, other); } /** * Compares its two PCAppAddress arguments for order. Returns a negative * integer, zero, or a positive integer as the first argument is less * than, equal to, or greater than the second. * * * * @param o1 the first PCAppAddresss object to be compared. * @param o2 the second FFCPIAddressobject to be compared. * @return a negative integer, zero, or a positive integer as the first * object is less than, equal to, or greater than the second object. */ public static int compare(PCAppAddress o1, PCAppAddress o2) { return EqualityHelper.compare(o1.getAddrid(), o2.getAddrid()); } /** * Indicates whether some other object is "equal to" this one. * @param obj the object with which to compare. * @return true if this object is the same as the obj * argument; false otherwise. */ public boolean equals(Object obj) { if (obj instanceof PCAppAddress) { return compareTo((PCAppAddress)obj) == 0; } return false; } /** * Returns a hash code value for the object. * @return a hash code value for this object. */ public int hashCode() { return (int)addrid; } /** * This class is used to represent the application identifier * for the Address class. */ public static class Oid implements Serializable, Comparable { /** * This is the identifier field for Address and must * correspond in type and name to the field in * Address. */ public long addrid; /** The required public, no-arg constructor. */ public Oid() { addrid = 0; } /** * A constructor to initialize the identifier field. * @param addrid the id of the Address. */ public Oid(long addrid) { this.addrid = addrid; } public Oid(String s) { addrid = Long.parseLong(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + addrid;} /** */ public boolean equals(java.lang.Object obj) { if( obj==null || !this.getClass().equals(obj.getClass()) ) return( false ); Oid o = (Oid) obj; if( this.addrid != o.addrid ) return( false ); return( true ); } /** */ public int hashCode() { return( (int) addrid ); } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } /** */ public int compareTo(Object obj) { // may throw ClassCastException which the user must handle Oid other = (Oid) obj; if( addrid < other.addrid ) return -1; if( addrid > other.addrid ) return 1; return 0; } } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPC/PCAppCompany.java100664 32176 12500110372 26243 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedPC; import javax.jdo.annotations.*; import java.io.Serializable; import java.io.ObjectInputStream; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.Collections; import java.util.Comparator; import java.util.Set; import java.util.HashSet; import java.util.Date; import org.apache.jdo.tck.pc.company.IAddress; import org.apache.jdo.tck.pc.company.ICompany; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents information about a company. */ @PersistenceCapable(identityType=IdentityType.APPLICATION,table="companies") @Inheritance(strategy=InheritanceStrategy.NEW_TABLE) @Discriminator(strategy=DiscriminatorStrategy.CLASS_NAME, column="DISCRIMINATOR") public class PCAppCompany implements ICompany, Serializable, Comparable, Comparator, DeepEquality { @NotPersistent() private long _companyid; @NotPersistent() private String _name; @NotPersistent() private Date _founded; @NotPersistent() private PCAppAddress _address; @NotPersistent() private transient Set _departments = new HashSet(); protected static SimpleDateFormat formatter = new SimpleDateFormat("d/MMM/yyyy"); /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public PCAppCompany() {} /** * * Initialize the PCAppCompany instance. * * * @param companyid The company id. * @param name The company name. * @param founded The date the company was founded. */ public PCAppCompany(long companyid, String name, Date founded) { this._companyid = companyid; this._name = name; this._founded = founded; } /** * Initialize the Company instance. * @param companyid The company id. * @param name The company name. * @param founded The date the company was founded. * @param addr The company's address. */ public PCAppCompany(long companyid, String name, Date founded, IAddress addr) { this(companyid, name, founded); this._address = (PCAppAddress)addr; } /** * Get the company id. * @return The company id. */ @Persistent(primaryKey="true") @Column(name="ID") public long getCompanyid() { return _companyid; } /** * Set the id associated with this object. * @param id the id. */ public void setCompanyid(long id) { this._companyid = id; } /** * Get the name of the company. * @return The name of the company. */ @Column(name="NAME", jdbcType="VARCHAR") public String getName() { return _name; } /** * Set the name of the company. * @param name The value to use for the name of the company. */ public void setName(String name) { this._name = name; } /** * Get the date that the company was founded. * @return The date the company was founded. */ @Column(name="FOUNDEDDATE") public Date getFounded() { return _founded; } /** * Set the date that the company was founded. * @param founded The date to set that the company was founded. */ public void setFounded(Date founded) { this._founded = founded; } /** * Get the address of the company. * @return The primary address of the company. */ @Persistent(persistenceModifier=PersistenceModifier.PERSISTENT, types=org.apache.jdo.tck.pc.companyAnnotatedPC.PCAppAddress.class) @Embedded(nullIndicatorColumn="COUNTRY", members={ @Persistent(name="addrid", columns=@Column(name="ADDRID")), @Persistent(name="street", columns=@Column(name="STREET")), @Persistent(name="city", columns=@Column(name="CITY")), @Persistent(name="state", columns=@Column(name="STATE")), @Persistent(name="zipcode", columns=@Column(name="ZIPCODE")), @Persistent(name="country", columns=@Column(name="COUNTRY")) }) public IAddress getAddress() { return _address; } /** * Set the primary address for the company. * @param address The address to set for the company. */ public void setAddress(IAddress address) { this._address = (PCAppAddress)address; } /** * Get the departments contained in the company. * * * @return All the PCAppDepartments of the company. */ @Persistent(persistenceModifier=PersistenceModifier.PERSISTENT, mappedBy="company") @Element(types=org.apache.jdo.tck.pc.companyAnnotatedPC.PCAppDepartment.class) public Set getDepartments() { return _departments; } /** * Add a PCAppDepartment instance to the company. * * * @param dept The PCAppDepartment instance to add. */ public void addDepartment(PCAppDepartment dept) { _departments.add(dept); } /** * Remove a PCAppDepartment instance from the company. * * * @param dept The PCAppDepartment instance to remove. */ public void removeDepartment(PCAppDepartment dept) { _departments.remove(dept); } /** * Initialize the set of PCAppDepartments in the company to the * parameter. * * * @param departments The set of PCAppDepartments for the * company. */ public void setDepartments(Set departments) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this._departments = (departments != null) ? new HashSet(departments) : null; } /** Serialization support: initialize transient fields. */ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); _departments = new HashSet(); } /** * Returns a String representation of a Company object. * @return a String representation of a Company object. */ public String toString() { return "Company(" + getFieldRepr()+ ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(_companyid); rc.append(", name ").append(_name); rc.append(", founded ").append( _founded==null ? "null" : formatter.format(_founded)); return rc.toString(); } /** * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the specified Person. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { PCAppCompany otherCompany = (PCAppCompany)other; String where = "Company<" + _companyid + ">"; return helper.equals(_companyid, otherCompany.getCompanyid(), where + ".companyid") & helper.equals(_name, otherCompany.getName(), where + ".name") & helper.equals(_founded, otherCompany.getFounded(), where + ".founded") & helper.deepEquals(_address, otherCompany.getAddress(), where + ".address") & helper.deepEquals(_departments, otherCompany.getDepartments(), where + ".departments"); } /** * Compares this object with the specified object for order. Returns a * negative integer, zero, or a positive integer as this object is less * than, equal to, or greater than the specified object. * @param o The Object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified object. * @throws ClassCastException - if the specified object's type prevents * it from being compared to this Object. */ public int compareTo(Object o) { return compareTo((PCAppCompany)o); } /** * Compare two instances. This is a method in Comparator. */ public int compare(Object o1, Object o2) { return compare((PCAppCompany)o1, (PCAppCompany)o2); } /** * Compares this object with the specified Company object for * order. Returns a negative integer, zero, or a positive integer as * this object is less than, equal to, or greater than the specified * object. * @param other The Company object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified Company * object. */ public int compareTo(PCAppCompany other) { return compare(this, other); } /** * Compares its two ICompany arguments for order. Returns a negative * integer, zero, or a positive integer as the first argument is less * than, equal to, or greater than the second. * @param o1 the first ICompany object to be compared. * @param o2 the second ICompany object to be compared. * @return a negative integer, zero, or a positive integer as the first * object is less than, equal to, or greater than the second object. */ public static int compare(PCAppCompany o1, PCAppCompany o2) { return EqualityHelper.compare(o1.getCompanyid(), o2.getCompanyid()); } /** * Indicates whether some other object is "equal to" this one. * @param obj the object with which to compare. * @return true if this object is the same as the obj * argument; false otherwise. */ public boolean equals(Object obj) { if (obj instanceof PCAppCompany) { return compareTo((PCAppCompany)obj) == 0; } return false; } /** * Returns a hash code value for the object. * @return a hash code value for this object. */ public int hashCode() { return (int)_companyid; } /** * The class to be used as the application identifier * for the Company class. It consists of both the company * name and the date that the company was founded. */ public static class Oid implements Serializable, Comparable { /** * This field is part of the identifier and should match in name * and type with a field in the Company class. */ public long companyid; /** The required public no-arg constructor. */ public Oid() { } /** * Initialize the identifier. * @param companyid The id of the company. */ public Oid(long companyid) { this.companyid = companyid; } public Oid(String s) { companyid = Long.parseLong(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + companyid;} /** */ public boolean equals(Object obj) { if (obj==null || !this.getClass().equals(obj.getClass())) return false; Oid o = (Oid) obj; if (this.companyid != o.companyid) return false; return true; } /** */ public int hashCode() { return (int)companyid; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } /** */ public int compareTo(Object obj) { // may throw ClassCastException which the user must handle Oid other = (Oid) obj; if( companyid < other.companyid ) return -1; if( companyid > other.companyid ) return 1; return 0; } } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPC/PCAppDentalInsurance.java100664 11407 12500110372 27706 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedPC; import javax.jdo.annotations.*; import java.math.BigDecimal; import org.apache.jdo.tck.pc.company.IDentalInsurance; import org.apache.jdo.tck.pc.company.IEmployee; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a dental insurance carrier selection for a * particular Employee. */ @PersistenceCapable(identityType=IdentityType.APPLICATION) public class PCAppDentalInsurance extends PCAppInsurance implements IDentalInsurance { @NotPersistent() private BigDecimal _lifetimeOrthoBenefit; /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public PCAppDentalInsurance() {} /** * Construct a DentalInsurance instance. * @param insid The insurance instance identifier. * @param carrier The insurance carrier. * @param lifetimeOrthoBenefit The lifetimeOrthoBenefit. */ public PCAppDentalInsurance(long insid, String carrier, BigDecimal lifetimeOrthoBenefit) { super(insid, carrier); this._lifetimeOrthoBenefit = lifetimeOrthoBenefit; } /** * Construct a PCAppDentalInsurance instance. * * * @param insid The insurance instance identifier. * @param carrier The insurance carrier. * @param employee The employee associated with this insurance. * @param lifetimeOrthoBenefit The lifetimeOrthoBenefit. */ public PCAppDentalInsurance(long insid, String carrier, IEmployee employee, BigDecimal lifetimeOrthoBenefit) { super(insid, carrier, employee); this._lifetimeOrthoBenefit = lifetimeOrthoBenefit; } /** * Get the insurance lifetimeOrthoBenefit. * @return The insurance lifetimeOrthoBenefit. */ @Column(name="LIFETIME_ORTHO_BENEFIT") public BigDecimal getLifetimeOrthoBenefit() { return _lifetimeOrthoBenefit; } /** * Set the insurance lifetimeOrthoBenefit. * @param lifetimeOrthoBenefit The insurance lifetimeOrthoBenefit. */ public void setLifetimeOrthoBenefit(BigDecimal lifetimeOrthoBenefit) { this._lifetimeOrthoBenefit = lifetimeOrthoBenefit; } /** * Returns a String representation of a PCAppDentalInsurance * object. * * * @return a String representation of a PCAppDentalInsurance * object. */ public String toString() { return "FCDentalInsurance(" + getFieldRepr()+ ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(super.getFieldRepr()); rc.append(", lifetimeOrthoBenefit ").append(_lifetimeOrthoBenefit); return rc.toString(); } /** * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the other Object. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { PCAppDentalInsurance otherIns = (PCAppDentalInsurance)other; String where = "FCDentalInsurance<" + getInsid() + ">"; return super.deepCompareFields(otherIns, helper) & helper.equals(_lifetimeOrthoBenefit, otherIns.getLifetimeOrthoBenefit(), where + ".lifetimeOrthoBenefit"); } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPC/PCAppDepartment.java100664 34747 12500110372 26746 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedPC; import javax.jdo.annotations.*; import java.io.Serializable; import java.io.ObjectInputStream; import java.io.IOException; import java.util.Collections; import java.util.Comparator; import java.util.HashSet; import java.util.List; import java.util.Set; import org.apache.jdo.tck.pc.company.ICompany; import org.apache.jdo.tck.pc.company.IDepartment; import org.apache.jdo.tck.pc.company.IEmployee; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a department within a company. */ @PersistenceCapable(identityType=IdentityType.APPLICATION, table="departments") @Inheritance(strategy=InheritanceStrategy.NEW_TABLE) @Discriminator(strategy=DiscriminatorStrategy.CLASS_NAME, column="DISCRIMINATOR") public class PCAppDepartment implements IDepartment, Serializable, Comparable, Comparator, DeepEquality { public static final int RECOMMENDED_NO_OF_EMPS = 2; @NotPersistent() private long _deptid; @NotPersistent() private String _name; @NotPersistent() private PCAppCompany _company; @NotPersistent() private PCAppEmployee _employeeOfTheMonth; @NotPersistent() private transient Set _employees = new HashSet(); @NotPersistent() private transient Set _fundedEmps = new HashSet(); /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public PCAppDepartment() {} /** * Construct a Department instance. * @param deptid The department id. * @param name The name of the department. */ public PCAppDepartment(long deptid, String name) { this._deptid = deptid; this._name = name; } /** * Construct a Department instance. * @param deptid The department id. * @param name The name of the department. * @param company The company that the department is associated with. */ public PCAppDepartment(long deptid, String name, ICompany company) { this._deptid = deptid; this._name = name; this._company = (PCAppCompany)company; } /** * Construct a Department instance. * @param deptid The department id. * @param name The name of the department. * @param company The company that the department is associated with. * @param employeeOfTheMonth The employee of the month the * department is associated with. */ public PCAppDepartment(long deptid, String name, ICompany company, IEmployee employeeOfTheMonth) { this._deptid = deptid; this._name = name; this._company = (PCAppCompany)company; this._employeeOfTheMonth = (PCAppEmployee)employeeOfTheMonth; } /** * Set the id associated with this object. * @param id the id. */ public void setDeptid(long id) { this._deptid = id; } /** * Get the department id. * @return The department id. */ @PrimaryKey @Column(name="ID") public long getDeptid() { return _deptid; } /** * Get the name of the department. * @return The name of the department. */ @Column(name="NAME") public String getName() { return _name; } /** * Set the name of the department. * @param name The name to set for the department. */ public void setName(String name) { this._name = name; } /** * Get the company associated with the department. * @return The company. */ @Persistent(types=org.apache.jdo.tck.pc.companyAnnotatedPC.PCAppCompany.class) @Column(name="COMPANYID") public ICompany getCompany() { return _company; } /** * Set the company for the department. * @param company The company to associate with the department. */ public void setCompany(ICompany company) { this._company = (PCAppCompany)company; } /** * Get the employee of the month associated with the department. * @return The employee of the month. */ @Persistent(types=org.apache.jdo.tck.pc.companyAnnotatedPC.PCAppEmployee.class) @Column(name="EMP_OF_THE_MONTH") public IEmployee getEmployeeOfTheMonth() { return _employeeOfTheMonth; } /** * Set the employee of the month for the department. * @param employeeOfTheMonth The employee of the month to * associate with the department. */ public void setEmployeeOfTheMonth(IEmployee employeeOfTheMonth) { this._employeeOfTheMonth = (PCAppEmployee)employeeOfTheMonth; } /** * Get the employees in the department. * @return The set of employees in the department. */ @Persistent(mappedBy="department") @Element(types=org.apache.jdo.tck.pc.companyAnnotatedPC.PCAppEmployee.class) public Set getEmployees() { return _employees; } /** * Add an employee to the department. * @param emp The employee to add to the department. */ public void addEmployee(PCAppEmployee emp) { _employees.add(emp); } /** * Remove an employee from the department. * @param emp The employee to remove from the department. */ public void removeEmployee(PCAppEmployee emp) { _employees.remove(emp); } /** * Set the employees to be in this department. * @param employees The set of employees for this department. */ public void setEmployees(Set employees) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this._employees = (employees != null) ? new HashSet(employees) : null; } /** * Get the funded employees in the department. * @return The set of funded employees in the department. */ @Element(types=org.apache.jdo.tck.pc.companyAnnotatedPC.PCAppEmployee.class) @Persistent(mappedBy="fundingDept") public Set getFundedEmps() { return _fundedEmps; } /** * Add an employee to the collection of funded employees of this * department. * @param emp The employee to add to the department. */ public void addFundedEmp(PCAppEmployee emp) { _fundedEmps.add(emp); } /** * Remove an employee from collection of funded employees of this * department. * @param emp The employee to remove from the department. */ public void removeFundedEmp(PCAppEmployee emp) { _fundedEmps.remove(emp); } /** * Set the funded employees to be in this department. * @param employees The set of funded employees for this department. */ public void setFundedEmps(Set employees) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this._fundedEmps = (employees != null) ? new HashSet(employees) : null; } @Override public List getMeetingRooms() { // TODO Auto-generated method stub return null; } @Override public void setMeetingRooms(List rooms) { // TODO Auto-generated method stub } /** Serialization support: initialize transient fields. */ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); _employees = new HashSet(); _fundedEmps = new HashSet(); } /** * * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the other PCAppDepartment. * * * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { PCAppDepartment otherDept = (PCAppDepartment)other; String where = "FCDepartment<" + _deptid + ">"; return helper.equals(_deptid, otherDept.getDeptid(), where + ".deptid") & helper.equals(_name, otherDept.getName(), where + ".name") & helper.deepEquals(_company, otherDept.getCompany(), where + ".company") & helper.deepEquals(_employeeOfTheMonth, otherDept.getEmployeeOfTheMonth(), where + ".employeeOfTheMonth") & helper.deepEquals(_employees, otherDept.getEmployees(), where + ".employees") & helper.deepEquals(_fundedEmps, otherDept.getFundedEmps(), where + ".fundedEmps"); } /** * Returns a String representation of a PCAppDepartment object. * * * @return a String representation of a PCAppDepartment object. */ public String toString() { return "FCDepartment(" + getFieldRepr()+ ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(_deptid); rc.append(", name ").append(_name); return rc.toString(); } /** * Compares this object with the specified object for order. Returns a * negative integer, zero, or a positive integer as this object is less * than, equal to, or greater than the specified object. * @param o The Object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified object. * @throws ClassCastException - if the specified object's type prevents * it from being compared to this Object. */ public int compareTo(Object o) { return compareTo((PCAppDepartment)o); } /** * Compare two instances. This is a method in Comparator. */ public int compare(Object o1, Object o2) { return compare((PCAppDepartment)o1, (PCAppDepartment)o2); } /** * Compares this object with the specified Department object for * order. Returns a negative integer, zero, or a positive integer as * this object is less than, equal to, or greater than the specified * object. * @param other The Department object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified * Department object. */ public int compareTo(PCAppDepartment other) { return compare(this, other); } /** * Compares its two IDepartment arguments for order. Returns a negative * integer, zero, or a positive integer as the first argument is less * than, equal to, or greater than the second. * @param o1 the first IDepartment object to be compared. * @param o2 the second IDepartment object to be compared. * @return a negative integer, zero, or a positive integer as the first * object is less than, equal to, or greater than the second object. */ public static int compare(PCAppDepartment o1, PCAppDepartment o2) { return EqualityHelper.compare(o1.getDeptid(), o2.getDeptid()); } /** * Indicates whether some other object is "equal to" this one. * @param obj the object with which to compare. * @return true if this object is the same as the obj * argument; false otherwise. */ public boolean equals(Object obj) { if (obj instanceof PCAppDepartment) { return compareTo((PCAppDepartment)obj) == 0; } return false; } /** * Returns a hash code value for the object. * @return a hash code value for this object. */ public int hashCode() { return (int)_deptid; } /** * The application identity class associated with the * Department class. */ public static class Oid implements Serializable, Comparable { /** * This field represents the application identifier field * for the Department class. * It must match in name and type with the field in the * Department class. */ public long deptid; /** * The required public, no-arg constructor. */ public Oid() { } /** * A constructor to initialize the identifier field. * @param deptid the deptid of the Department. */ public Oid(long deptid) { this.deptid = deptid; } public Oid(String s) { deptid = Long.parseLong(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + deptid;} /** */ public boolean equals(java.lang.Object obj) { if( obj==null || !this.getClass().equals(obj.getClass()) ) return( false ); Oid o = (Oid) obj; if( this.deptid != o.deptid ) return( false ); return( true ); } /** */ public int hashCode() { return( (int) deptid ); } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } /** */ public int compareTo(Object obj) { // may throw ClassCastException which the user must handle Oid other = (Oid) obj; if( deptid < other.deptid ) return -1; if( deptid > other.deptid ) return 1; return 0; } } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPC/PCAppEmployee.java100664 42773 12500110372 26420 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedPC; import javax.jdo.annotations.*; import java.io.ObjectInputStream; import java.io.IOException; import java.util.Collections; import java.util.Date; import java.util.HashSet; import java.util.Set; import org.apache.jdo.tck.pc.company.IAddress; import org.apache.jdo.tck.pc.company.IDentalInsurance; import org.apache.jdo.tck.pc.company.IDepartment; import org.apache.jdo.tck.pc.company.IEmployee; import org.apache.jdo.tck.pc.company.IMedicalInsurance; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents an employee. */ @PersistenceCapable(identityType=IdentityType.APPLICATION) @Inheritance(strategy=InheritanceStrategy.SUPERCLASS_TABLE) public abstract class PCAppEmployee extends PCAppPerson implements IEmployee { @NotPersistent() private Date _hiredate; @NotPersistent() private double _weeklyhours; @NotPersistent() private PCAppDentalInsurance _dentalInsurance; @NotPersistent() private PCAppMedicalInsurance _medicalInsurance; @NotPersistent() private PCAppDepartment _department; @NotPersistent() private PCAppDepartment _fundingDept; @NotPersistent() private PCAppEmployee _manager; @NotPersistent() private PCAppEmployee _mentor; @NotPersistent() private PCAppEmployee _protege; @NotPersistent() private PCAppEmployee _hradvisor; @NotPersistent() private transient Set _reviewedProjects = new HashSet(); @NotPersistent() private transient Set _projects = new HashSet(); @NotPersistent() private transient Set _team = new HashSet(); @NotPersistent() private transient Set _hradvisees = new HashSet(); /** This is the JDO-required no-args constructor */ protected PCAppEmployee() {} /** * Construct an PCAppEmployee instance. * * * @param personid The identifier for the person. * @param firstname The first name of the employee. * @param lastname The last name of the employee. * @param middlename The middle name of the employee. * @param birthdate The birth date of the employee. * @param hiredate The date that the employee was hired. */ public PCAppEmployee(long personid, String firstname, String lastname, String middlename, Date birthdate, Date hiredate) { super(personid, firstname, lastname, middlename, birthdate); this._hiredate = hiredate; } /** * Construct an PCAppEmployee instance. * * * @param personid The identifier for the person. * @param firstname The first name of the employee. * @param lastname The last name of the employee. * @param middlename The middle name of the employee. * @param birthdate The birth date of the employee. * @param address The address of the employee. * @param hiredate The date that the employee was hired. */ public PCAppEmployee(long personid, String firstname, String lastname, String middlename, Date birthdate, IAddress address, Date hiredate) { super(personid, firstname, lastname, middlename, birthdate, (PCAppAddress)address); this._hiredate = hiredate; } /** * Get the date that the employee was hired. * @return The date the employee was hired. */ @Column(name="HIREDATE") public Date getHiredate() { return _hiredate; } /** * Set the date that the employee was hired. * @param hiredate The date the employee was hired. */ public void setHiredate(Date hiredate) { this._hiredate = hiredate; } /** * Get the weekly hours of the employee. * @return The number of hours per week that the employee works. */ @Column(name="WEEKLYHOURS") public double getWeeklyhours() { return _weeklyhours; } /** * Set the number of hours per week that the employee works. * @param weeklyhours The number of hours per week that the employee * works. */ public void setWeeklyhours(double weeklyhours) { this._weeklyhours = weeklyhours; } /** * Get the reviewed projects. * @return The reviewed projects. */ @Persistent(mappedBy="reviewers") @Element(types=org.apache.jdo.tck.pc.companyAnnotatedPC.PCAppProject.class) public Set getReviewedProjects() { return _reviewedProjects; } /** * Add a reviewed project. * @param project A reviewed project. */ public void addReviewedProjects(PCAppProject project) { _reviewedProjects.add(project); } /** * Remove a reviewed project. * @param project A reviewed project. */ public void removeReviewedProject(PCAppProject project) { _reviewedProjects.remove(project); } /** * Set the reviewed projects for the employee. * @param reviewedProjects The set of reviewed projects. */ public void setReviewedProjects(Set reviewedProjects) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this._reviewedProjects = (reviewedProjects != null) ? new HashSet(reviewedProjects) : null; } /** * Get the employee's projects. * @return The employee's projects * set. */ @Persistent(mappedBy="members") @Element(types=org.apache.jdo.tck.pc.companyAnnotatedPC.PCAppProject.class) public Set getProjects() { return _projects; } /** * Add a project for the employee. * @param project The project. */ public void addProject(PCAppProject project) { _projects.add(project); } /** * Remove a project from an employee's set of projects. * @param project The project. */ public void removeProject(PCAppProject project) { _projects.remove(project); } /** * Set the projects for the employee. * @param projects The set of projects of the employee. */ public void setProjects(Set projects) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this._projects = (projects != null) ? new HashSet(projects) : null; } /** * Get the dental insurance of the employee. * @return The employee's dental insurance. */ @Persistent(mappedBy="employee", types=org.apache.jdo.tck.pc.companyAnnotatedPC.PCAppDentalInsurance.class) public IDentalInsurance getDentalInsurance() { return _dentalInsurance; } /** * Set the dental insurance object for the employee. * @param dentalInsurance The dental insurance object to associate with * the employee. */ public void setDentalInsurance(IDentalInsurance dentalInsurance) { this._dentalInsurance = (PCAppDentalInsurance)dentalInsurance; } /** * Get the medical insurance of the employee. * @return The employee's medical insurance. */ @Persistent(mappedBy="employee", types=org.apache.jdo.tck.pc.companyAnnotatedPC.PCAppMedicalInsurance.class) public IMedicalInsurance getMedicalInsurance() { return _medicalInsurance; } /** * Set the medical insurance object for the employee. * @param medicalInsurance The medical insurance object to associate * with the employee. */ public void setMedicalInsurance(IMedicalInsurance medicalInsurance) { this._medicalInsurance = (PCAppMedicalInsurance)medicalInsurance; } /** * Get the employee's department. * @return The department associated with the employee. */ @Persistent(types=org.apache.jdo.tck.pc.companyAnnotatedPC.PCAppDepartment.class) @Column(name="DEPARTMENT") public IDepartment getDepartment() { return _department; } /** * Set the employee's department. * @param department The department. */ public void setDepartment(IDepartment department) { this._department = (PCAppDepartment)department; } /** * Get the employee's funding department. * @return The funding department associated with the employee. */ @Persistent(types=org.apache.jdo.tck.pc.companyAnnotatedPC.PCAppDepartment.class) @Column(name="FUNDINGDEPT") public IDepartment getFundingDept() { return _fundingDept; } /** * Set the employee's funding department. * @param department The funding department. */ public void setFundingDept(IDepartment department) { this._fundingDept = (PCAppDepartment)department; } /** * Get the employee's manager. * @return The employee's manager. */ @Persistent(types=org.apache.jdo.tck.pc.companyAnnotatedPC.PCAppEmployee.class) @Column(name="MANAGER") public IEmployee getManager() { return _manager; } /** * Set the employee's manager. * @param manager The employee's manager. */ public void setManager(IEmployee manager) { this._manager = (PCAppEmployee)manager; } /** * Get the employee's team. * * * @return The set of PCAppEmployees on this employee's team. */ @Persistent(mappedBy="manager") @Element(types=org.apache.jdo.tck.pc.companyAnnotatedPC.PCAppEmployee.class) public Set getTeam() { return _team; } /** * Add an PCAppEmployee to this employee's team. * This method sets both sides of the relationship, modifying * this employees team to include parameter emp and modifying * emp to set its manager attribute to this object. * * * @param emp The PCAppEmployee to add to the team. */ public void addToTeam(PCAppEmployee emp) { _team.add(emp); emp._manager = this; } /** * Remove an PCAppEmployee from this employee's team. * This method will also set the emp manager to null. * * * @param emp The PCAppEmployee to remove from the team. */ public void removeFromTeam(PCAppEmployee emp) { _team.remove(emp); emp._manager = null; } /** * Set the employee's team. * * * @param team The set of PCAppEmployees. */ public void setTeam(Set team) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this._team = (team != null) ? new HashSet(team) : null; } /** * Set the mentor for this employee. * @param mentor The mentor for this employee. */ public void setMentor(IEmployee mentor) { this._mentor = (PCAppEmployee)mentor; } /** * Get the mentor for this employee. * @return The mentor. */ @Persistent(types=org.apache.jdo.tck.pc.companyAnnotatedPC.PCAppEmployee.class) @Column(name="MENTOR") public IEmployee getMentor() { return _mentor; } /** * Set the protege for this employee. * @param protege The protege for this employee. */ public void setProtege(IEmployee protege) { this._protege = (PCAppEmployee)protege; } /** * Get the protege of this employee. * @return The protege of this employee. */ @Persistent(mappedBy="mentor", types=org.apache.jdo.tck.pc.companyAnnotatedPC.PCAppEmployee.class) public IEmployee getProtege() { return _protege; } /** * Set the HR advisor for this employee. * @param hradvisor The hradvisor for this employee. */ public void setHradvisor(IEmployee hradvisor) { this._hradvisor = (PCAppEmployee)hradvisor; } /** * Get the HR advisor for the employee. * @return The HR advisor. */ @Column(name="HRADVISOR") @Persistent(types=org.apache.jdo.tck.pc.companyAnnotatedPC.PCAppEmployee.class) public IEmployee getHradvisor() { return _hradvisor; } /** * Get the HR advisees of this HR advisor. * * * @return HR advisees of this employee. */ @Persistent(mappedBy="hradvisor") @Element(types=org.apache.jdo.tck.pc.companyAnnotatedPC.PCAppEmployee.class) public Set getHradvisees() { return _hradvisees; } /** * Add an PCAppEmployee as an advisee of this HR advisor. * This method also sets the emp hradvisor to reference * this object. In other words, both sides of the relationship are * set. * * * @param emp The employee to add as an advisee. */ public void addAdvisee(PCAppEmployee emp) { _hradvisees.add(emp); emp._hradvisor = this; } /** * Remove an PCAppEmployee as an advisee of this HR advisor. * This method also sets the emp hradvisor to null. * In other words, both sides of the relationship are set. * * * @param emp The employee to add as an HR advisee. */ public void removeAdvisee(PCAppEmployee emp) { _hradvisees.remove(emp); emp._hradvisor = null; } /** * Set the HR advisees of this HR advisor. * * * @param hradvisees The PCAppEmployees that are HR advisees of * this employee. */ public void setHradvisees(Set hradvisees) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this._hradvisees = (hradvisees != null) ? new HashSet(hradvisees) : null; } /** Serialization support: initialize transient fields. */ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); _reviewedProjects = new HashSet(); _projects = new HashSet(); _team = new HashSet(); _hradvisees = new HashSet(); } /** * Return a String representation of a PCAppEmployee object. * * * @return a String representation of a PCAppEmployee object. */ public String toString() { return "FCEmployee(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(super.getFieldRepr()); rc.append(", hired ").append( _hiredate==null ? "null" : formatter.format(_hiredate)); rc.append(", weeklyhours ").append(_weeklyhours); return rc.toString(); } /** * * Returns true if all the fields of this instance are * deep equal to the corresponding fields of the specified PCAppEmployee. * * * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { PCAppEmployee otherEmp = (PCAppEmployee)other; String where = "Employee<" + getPersonid() + ">"; return super.deepCompareFields(otherEmp, helper) & helper.equals(_hiredate, otherEmp.getHiredate(), where + ".hiredate") & helper.closeEnough(_weeklyhours, otherEmp.getWeeklyhours(), where + ".weeklyhours") & helper.deepEquals(_dentalInsurance, otherEmp.getDentalInsurance(), where + ".dentalInsurance") & helper.deepEquals(_medicalInsurance, otherEmp.getMedicalInsurance(), where + ".medicalInsurance") & helper.deepEquals(_department, otherEmp.getDepartment(), where + ".department") & helper.deepEquals(_fundingDept, otherEmp.getFundingDept(), where + ".fundingDept") & helper.deepEquals(_manager, otherEmp.getManager(), where + ".manager") & helper.deepEquals(_mentor, otherEmp.getMentor(), where + ".mentor") & helper.deepEquals(_protege, otherEmp.getProtege(), where + ".protege") & helper.deepEquals(_hradvisor, otherEmp.getHradvisor(), where + ".hradvisor") & helper.deepEquals(_reviewedProjects, otherEmp.getReviewedProjects(), where + ".reviewedProjects") & helper.deepEquals(_projects, otherEmp.getProjects(), where + ".projects") & helper.deepEquals(_team, otherEmp.getTeam(), where + ".team") & helper.deepEquals(_hradvisees, otherEmp.getHradvisees(), where + ".hradvisees"); } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPC/PCAppFullTimeEmployee.java100664 11730 12500110372 30047 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedPC; import javax.jdo.annotations.*; import java.util.Date; import org.apache.jdo.tck.pc.company.IAddress; import org.apache.jdo.tck.pc.company.IFullTimeEmployee; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a full-time employee. */ @PersistenceCapable(identityType=IdentityType.APPLICATION) @Inheritance(strategy=InheritanceStrategy.SUPERCLASS_TABLE) public class PCAppFullTimeEmployee extends PCAppEmployee implements IFullTimeEmployee { @NotPersistent() private double _salary; /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public PCAppFullTimeEmployee() {} /** * Construct a full-time employee. * @param personid The person identifier. * @param first The person's first name. * @param last The person's last name. * @param middle The person's middle name. * @param born The person's birthdate. * @param hired The date that the person was hired. * @param sal The salary of the full-time employee. */ public PCAppFullTimeEmployee(long personid, String first, String last, String middle, Date born, Date hired, double sal) { super(personid, first, last, middle, born, hired); _salary = sal; } /** * Construct a full-time employee. * @param personid The person identifier. * @param first The person's first name. * @param last The person's last name. * @param middle The person's middle name. * @param born The person's birthdate. * @param addr The person's address. * @param hired The date that the person was hired. * @param sal The salary of the full-time employee. */ public PCAppFullTimeEmployee(long personid, String first, String last, String middle, Date born, IAddress addr, Date hired, double sal) { super(personid, first, last, middle, born, (PCAppAddress)addr, hired); _salary = sal; } /** * Get the salary of the full time employee. * @return The salary of the full time employee. */ @Column(name="SALARY") public double getSalary() { return _salary; } /** * Set the salary for the full-time employee. * @param salary The salary to set for the full-time employee. */ public void setSalary(double salary) { this._salary = salary; } /** * Return a String representation of a PCAppFullTimeEmployee object. * * * @return a String representation of a PCAppFullTimeEmployee object. */ public String toString() { return "FCFullTimeEmployee(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ public String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(super.getFieldRepr()); rc.append(", $").append(_salary); return rc.toString(); } /** * * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the specified * PCAppFullTimeEmployee. * * * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { PCAppFullTimeEmployee otherEmp = (PCAppFullTimeEmployee)other; String where = "FCFullTimeEmployee<" + getPersonid() + ">"; return super.deepCompareFields(otherEmp, helper) & helper.closeEnough(_salary, otherEmp.getSalary(), where + ".salary"); } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPC/PCAppInsurance.java100664 23443 12500110372 26561 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedPC; import javax.jdo.annotations.*; import java.io.Serializable; import java.util.Comparator; import org.apache.jdo.tck.pc.company.IEmployee; import org.apache.jdo.tck.pc.company.IInsurance; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents an insurance carrier selection for a particular * PCAppEmployee. */ @PersistenceCapable(identityType=IdentityType.APPLICATION,table="insuranceplans" ) @Inheritance(strategy=InheritanceStrategy.NEW_TABLE) @Discriminator(strategy=DiscriminatorStrategy.CLASS_NAME, column="DISCRIMINATOR", indexed="true") @Index(name="INS_DISCRIMINATOR_INDEX", unique="false", columns=@Column(name="DISCRIMINATOR")) public class PCAppInsurance implements IInsurance, Serializable, Comparable, Comparator, DeepEquality { @NotPersistent() private long _insid; @NotPersistent() private String _carrier; @NotPersistent() private PCAppEmployee _employee; /** This is the JDO-required no-args constructor. */ protected PCAppInsurance() {} /** * Construct an PCAppInsurance instance. * * * @param insid The insurance instance identifier. * @param carrier The insurance carrier. */ protected PCAppInsurance(long insid, String carrier) { this._insid = insid; this._carrier = carrier; } /** * Construct an PCAppInsurance instance. * * * @param insid The insurance instance identifier. * @param carrier The insurance carrier. * @param employee The employee associated with this insurance. */ protected PCAppInsurance(long insid, String carrier, IEmployee employee) { this._insid = insid; this._carrier = carrier; this._employee = (PCAppEmployee)employee; } /** * Get the insurance ID. * @return the insurance ID. */ @PrimaryKey @Column(name="INSID") public long getInsid() { return _insid; } /** * Set the insurance ID. * @param id The insurance ID value. */ public void setInsid(long id) { this._insid = id; } /** * Get the insurance carrier. * @return The insurance carrier. */ @Column(name="CARRIER") public String getCarrier() { return _carrier; } /** * Set the insurance carrier. * @param carrier The insurance carrier. */ public void setCarrier(String carrier) { this._carrier = carrier; } /** * Get the associated employee. * @return The employee for this insurance. */ @Persistent(types=org.apache.jdo.tck.pc.companyAnnotatedPC.PCAppEmployee.class) @Column(name="EMPLOYEE") public IEmployee getEmployee() { return _employee; } /** * Set the associated employee. * @param employee The associated employee. */ public void setEmployee(IEmployee employee) { this._employee = (PCAppEmployee)employee; } /** * Returns a String representation of a PCAppInsurance object. * * * @return a String representation of a PCAppInsurance object. */ public String toString() { return "FCInsurance(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(_insid); rc.append(", carrier ").append(_carrier); return rc.toString(); } /** * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the other Object. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { PCAppInsurance otherIns = (PCAppInsurance)other; String where = "FCInsurance<" + _insid + ">"; return helper.equals(_insid, otherIns.getInsid(), where + ".insid") & helper.equals(_carrier, otherIns.getCarrier(), where + ".carrier") & helper.deepEquals(_employee, otherIns.getEmployee(), where + ".employee"); } /** * Compares this object with the specified object for order. Returns a * negative integer, zero, or a positive integer as this object is less * than, equal to, or greater than the specified object. * @param o The Object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified object. * @throws ClassCastException - if the specified object's type prevents * it from being compared to this Object. */ public int compareTo(Object o) { return compareTo((PCAppInsurance)o); } /** * Compare two instances. This is a method in Comparator. */ public int compare(Object o1, Object o2) { return compare((PCAppInsurance)o1, (PCAppInsurance)o2); } /** * Compares this object with the specified Insurance object for * order. Returns a negative integer, zero, or a positive integer as * this object is less than, equal to, or greater than the specified * object. * @param other The Insurance object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified * Insurance object. */ public int compareTo(PCAppInsurance other) { return compare(this, other); } /** * Compares its two IInsurance arguments for order. Returns a negative * integer, zero, or a positive integer as the first argument is less * than, equal to, or greater than the second. * @param o1 the first IInsurance object to be compared. * @param o2 the second IInsurance object to be compared. * @return a negative integer, zero, or a positive integer as the first * object is less than, equal to, or greater than the second object. */ public static int compare(PCAppInsurance o1, PCAppInsurance o2) { return EqualityHelper.compare(o1.getInsid(), o2.getInsid()); } /** * Indicates whether some other object is "equal to" this one. * @param obj the object with which to compare. * @return true if this object is the same as the obj * argument; false otherwise. */ public boolean equals(Object obj) { if (obj instanceof PCAppInsurance) { return compareTo((PCAppInsurance)obj) == 0; } return false; } /** * Returns a hash code value for the object. * @return a hash code value for this object. */ public int hashCode() { return (int)_insid; } /** * This class is used to represent the application * identifier for the Insurance class. */ public static class Oid implements Serializable, Comparable { /** * This field represents the application identifier for the * Insurance class. It must match the field in the * Insurance class in both name and type. */ public long insid; /** * The required public no-args constructor. */ public Oid() { } /** * Initialize with an insurance identifier. * @param insid the insurance ID. */ public Oid(long insid) { this.insid = insid; } public Oid(String s) { insid = Long.parseLong(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + insid;} /** */ public boolean equals(java.lang.Object obj) { if( obj==null || !this.getClass().equals(obj.getClass()) ) return( false ); Oid o=(Oid) obj; if( this.insid!=o.insid ) return( false ); return( true ); } /** */ public int hashCode() { return( (int) insid ); } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } /** */ public int compareTo(Object obj) { // may throw ClassCastException which the user must handle Oid other = (Oid) obj; if( insid < other.insid ) return -1; if( insid > other.insid ) return 1; return 0; } } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPC/PCAppMedicalInsurance.java100664 10715 12500110372 30036 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedPC; import javax.jdo.annotations.*; import org.apache.jdo.tck.pc.company.IEmployee; import org.apache.jdo.tck.pc.company.IMedicalInsurance; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a dental insurance carrier selection for a * particular Employee. */ @PersistenceCapable(identityType=IdentityType.APPLICATION) public class PCAppMedicalInsurance extends PCAppInsurance implements IMedicalInsurance { @NotPersistent private String _planType; // possible values: "PPO", "EPO", "NPO" /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public PCAppMedicalInsurance() {} /** * Construct a PCAppMedicalInsurance instance. * * * @param insid The insurance instance identifier. * @param carrier The insurance carrier. * @param planType The planType. */ public PCAppMedicalInsurance(long insid, String carrier, String planType) { super(insid, carrier); this._planType = planType; } /** * Construct a PCAppMedicalInsurance instance. * * * @param insid The insurance instance identifier. * @param carrier The insurance carrier. * @param employee The employee associated with this insurance. * @param planType The planType. */ public PCAppMedicalInsurance(long insid, String carrier, IEmployee employee, String planType) { super(insid, carrier, (PCAppEmployee)employee); this._planType = planType; } /** * Get the insurance planType. * @return The insurance planType. */ @Column(name="PLANTYPE") public String getPlanType() { return _planType; } /** * Set the insurance planType. * @param planType The insurance planType. */ public void setPlanType(String planType) { this._planType = planType; } /** * Returns a String representation of a PCAppMedicalInsurance * object. * * * @return a String representation of a PCAppMedicalInsurance * object. */ public String toString() { return "FCMedicalInsurance(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(super.getFieldRepr()); rc.append(", planType ").append(_planType); return rc.toString(); } /** * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the other Object. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { PCAppMedicalInsurance otherIns = (PCAppMedicalInsurance)other; String where = "FCMedicalInsurance<" + getInsid() + ">"; return super.deepCompareFields(otherIns, helper) & helper.equals(_planType, otherIns.getPlanType(), where + ".planType"); } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPC/PCAppPartTimeEmployee.java100664 11602 12500110372 30051 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedPC; import javax.jdo.annotations.*; import java.util.Date; import org.apache.jdo.tck.pc.company.IPartTimeEmployee; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a part-time employee. */ @PersistenceCapable(identityType=IdentityType.APPLICATION) @Inheritance(strategy=InheritanceStrategy.SUPERCLASS_TABLE) public class PCAppPartTimeEmployee extends PCAppEmployee implements IPartTimeEmployee { @NotPersistent() private double _wage; /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public PCAppPartTimeEmployee() {} /** * Construct a part-time employee. * @param personid The identifier for the person. * @param first The person's first name. * @param last The person's last name. * @param middle The person's middle name. * @param born The person's birthdate. * @param hired The date the person was hired. * @param wage The person's wage. */ public PCAppPartTimeEmployee(long personid, String first, String last, String middle, Date born, Date hired, double wage ) { super(personid, first, last, middle, born, hired); this._wage = wage; } /** * Construct a part-time employee. * @param personid The identifier for the person. * @param first The person's first name. * @param last The person's last name. * @param middle The person's middle name. * @param born The person's birthdate. * @param addr The person's address. * @param hired The date the person was hired. * @param wage The person's wage. */ public PCAppPartTimeEmployee(long personid, String first, String last, String middle, Date born, PCAppAddress addr, Date hired, double wage ) { super(personid, first, last, middle, born, addr, hired); this._wage = wage; } /** * Get the wage of the part-time employee. * @return The wage of the part-time employee. */ @Column(name="WAGE") public double getWage() { return _wage; } /** * Set the wage of the part-time employee. * @param wage The wage of the part-time employee. */ public void setWage(double wage) { this._wage = wage; } /** * Returns a String representation of a PCAppPartTimeEmployee object. * * * @return a String representation of a PCAppPartTimeEmployee object. */ public String toString() { return "FCPartTimeEmployee(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ public String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(super.getFieldRepr()); rc.append(", $" + _wage); return rc.toString(); } /** * * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the specified * PCAppPartTimeEmployee. * * * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { PCAppPartTimeEmployee otherEmp = (PCAppPartTimeEmployee)other; String where = "FCPartTimeEmployee<" + getPersonid() + ">"; return super.deepCompareFields(otherEmp, helper) & helper.closeEnough(_wage, otherEmp.getWage(), where + ".wage"); } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPC/PCAppPerson.java100664 35654 12500110372 26107 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedPC; import javax.jdo.annotations.*; import java.io.Serializable; import java.text.SimpleDateFormat; import java.util.Collections; import java.util.Comparator; import java.util.Date; import java.util.HashMap; import java.util.Map; import org.apache.jdo.tck.pc.company.IAddress; import org.apache.jdo.tck.pc.company.IPerson; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a person. */ @PersistenceCapable(identityType=IdentityType.APPLICATION,table="persons") @Inheritance(strategy=InheritanceStrategy.NEW_TABLE) @Discriminator(strategy=DiscriminatorStrategy.CLASS_NAME, column="DISCRIMINATOR", indexed="true") public class PCAppPerson implements IPerson, Serializable, Comparable, Comparator, DeepEquality { @NotPersistent() private long _personid; @NotPersistent() private String _firstname; @NotPersistent() private String _lastname; @NotPersistent() private String _middlename; @NotPersistent() private Date _birthdate; @NotPersistent() private PCAppAddress _address; @NotPersistent() private Map _phoneNumbers = new HashMap(); protected static SimpleDateFormat formatter = new SimpleDateFormat("d/MMM/yyyy"); /** This is the JDO-required no-args constructor. */ protected PCAppPerson() {} /** * Construct a PCAppPerson instance. * * * @param personid The person identifier. * @param firstname The person's first name. * @param lastname The person's last name. * @param middlename The person's middle name. * @param birthdate The person's birthdate. */ public PCAppPerson(long personid, String firstname, String lastname, String middlename, Date birthdate) { this._personid = personid; this._firstname = firstname; this._lastname = lastname; this._middlename = middlename; this._birthdate = birthdate; } /** * Construct a PCAppPerson instance. * * * @param personid The person identifier. * @param firstname The person's first name. * @param lastname The person's last name. * @param middlename The person's middle name. * @param birthdate The person's birthdate. * @param address The person's address. */ public PCAppPerson(long personid, String firstname, String lastname, String middlename, Date birthdate, IAddress address) { this(personid, firstname, lastname, middlename, birthdate); this._address = (PCAppAddress)_address; } /** * Set the id associated with this object. * @param id the id. */ public void setPersonid(long id) { this._personid = id; } /** * Get the person's id. * @return The personid. */ @PrimaryKey @Column(name="PERSONID") public long getPersonid() { return _personid; } /** * Get the person's last name. * @return The last name. */ @Column(name="LASTNAME") public String getLastname() { return _lastname; } /** * Set the person's last name. * @param lastname The last name. */ public void setLastname(String lastname) { this._lastname = lastname; } /** * Get the person's first name. * @return The first name. */ @Column(name="FIRSTNAME") public String getFirstname() { return _firstname; } /** * Set the person's first name. * @param firstname The first name. */ public void setFirstname(String firstname) { this._firstname = firstname; } /** * Get the person's middle name. * @return The middle name. */ @Persistent(defaultFetchGroup="false") @Column(name="MIDDLENAME", allowsNull="true") public String getMiddlename() { return _middlename; } /** * Set the person's middle name. * @param middlename The middle name. */ public void setMiddlename(String middlename) { this._middlename = middlename; } /** * Get the address. * @return The address. */ @Persistent(persistenceModifier=PersistenceModifier.PERSISTENT, types=org.apache.jdo.tck.pc.companyAnnotatedPC.PCAppAddress.class) @Embedded(nullIndicatorColumn="COUNTRY", members={ @Persistent(name="addrid", columns=@Column(name="ADDRID")), @Persistent(name="street", columns=@Column(name="STREET")), @Persistent(name="city", columns=@Column(name="CITY")), @Persistent(name="state", columns=@Column(name="STATE")), @Persistent(name="zipcode", columns=@Column(name="ZIPCODE")), @Persistent(name="country", columns=@Column(name="COUNTRY")) }) public IAddress getAddress() { return _address; } /** * Set the address. * @param address The address. */ public void setAddress(IAddress address) { this._address = (PCAppAddress)address; } /** * Get the person's birthdate. * @return The person's birthdate. */ @Column(name="BIRTHDATE") public Date getBirthdate() { return _birthdate; } /** * Set the person's birthdate. * @param birthdate The person's birthdate. */ public void setBirthdate(Date birthdate) { this._birthdate = birthdate; } /** * Get the map of phone numbers * @return The map of phone numbers. */ // maps phone number types ("home", "work", "mobile", etc.) // to phone numbers specified as String @Persistent(table="employee_phoneno_type") @Join(column="EMPID") @Key(types=java.lang.String.class, column="TYPE") @Value(types=java.lang.String.class, column="PHONENO") public Map getPhoneNumbers() { return _phoneNumbers; } /** * Get the phone number for the specified phone number type. * @param type The phone number type ("home", "work", "mobile", etc.). * @return The phone number associated with specified type, or * null if there was no phone number for the type. */ public String getPhoneNumber(String type) { return (String)_phoneNumbers.get(type); } /** * Associates the specified phone number with the specified type in the * map of phone numbers of this person. * @param type The phone number type ("home", "work", "mobile", etc.). * @param phoneNumber The phone number * @return The previous phone number associated with specified type, or * null if there was no phone number for the type. */ public String putPhoneNumber(String type, String phoneNumber) { return (String)_phoneNumbers.put(type, phoneNumber); } /** * Remove a phoneNumber from the map of phone numbers. * @param type The phone number type ("home", "work", "mobile", etc.). * @return The previous phone number associated with specified type, or * null if there was no phone number for the type. */ public String removePhoneNumber(String type) { return (String)_phoneNumbers.remove(type); } /** * Set the phoneNumber map to be in this person. * @param phoneNumbers The map of phoneNumbers for this person. */ public void setPhoneNumbers(Map phoneNumbers) { // workaround: create a new HashMap, because fostore does not // support LinkedHashMap this._phoneNumbers = (phoneNumbers != null) ? new HashMap(phoneNumbers) : null; } /** * Returns a String representation of a PCAppPerson object. * * * @return a string representation of a PCAppPerson object. */ public String toString() { return "FCPerson(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(_personid); rc.append(", ").append(_lastname); rc.append(", ").append(_firstname); rc.append(", born ").append( _birthdate==null ? "null" : formatter.format(_birthdate)); rc.append(", phone ").append(_phoneNumbers); return rc.toString(); } /** * * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the specified PCAppPerson. * * * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { PCAppPerson otherPerson = (PCAppPerson)other; String where = "FCPerson<" + _personid + ">"; return helper.equals(_personid, otherPerson.getPersonid(), where + ".personid") & helper.equals(_firstname, otherPerson.getFirstname(), where + ".firstname") & helper.equals(_lastname, otherPerson.getLastname(), where + ".lastname") & 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"); } /** * Compares this object with the specified object for order. Returns a * negative integer, zero, or a positive integer as this object is less * than, equal to, or greater than the specified object. * @param o The Object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified object. * @throws ClassCastException - if the specified object's type prevents * it from being compared to this Object. */ public int compareTo(Object o) { return compareTo((PCAppPerson)o); } /** * Compare two instances. This is a method in Comparator. */ public int compare(Object o1, Object o2) { return compare((PCAppPerson)o1, (PCAppPerson)o2); } /** * * Compares this object with the specified PCAppPerson object for * order. Returns a negative integer, zero, or a positive integer as * this object is less than, equal to, or greater than the specified * object. * * * @param other The PCAppPerson object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified PFCAppPerson * object. */ public int compareTo(PCAppPerson other) { return compare(this, other); } /** * Compares its two IPerson arguments for order. Returns a negative * integer, zero, or a positive integer as the first argument is less * than, equal to, or greater than the second. * @param o1 the first IPerson object to be compared. * @param o2 the second IPerson object to be compared. * @return a negative integer, zero, or a positive integer as the first * object is less than, equal to, or greater than the second object. */ public static int compare(PCAppPerson o1, PCAppPerson o2) { return EqualityHelper.compare(o1.getPersonid(), o2.getPersonid()); } /** * Indicates whether some other object is "equal to" this one. * @param obj the object with which to compare. * @return true if this object is the same as the obj * argument; false otherwise. */ public boolean equals(Object obj) { if (obj instanceof PCAppPerson) { return compareTo((PCAppPerson)obj) == 0; } return false; } /** * Returns a hash code value for the object. * @return a hash code value for this object. */ public int hashCode() { return (int)_personid; } /** * This class is used to represent the application identifier * for the Person class. */ public static class Oid implements Serializable, Comparable { /** * This field represents the identifier for the Person * class. It must match a field in the Person class in * both name and type. */ public long personid; /** * The required public no-arg constructor. */ public Oid() { } /** * Initialize the identifier. * @param personid The person identifier. */ public Oid(long personid) { this.personid = personid; } public Oid(String s) { personid = Long.parseLong(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + personid;} /** */ public boolean equals(java.lang.Object obj) { if( obj==null || !this.getClass().equals(obj.getClass()) ) return( false ); Oid o = (Oid) obj; if( this.personid != o.personid ) return( false ); return( true ); } /** */ public int hashCode() { return( (int) personid ); } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } /** */ public int compareTo(Object obj) { // may throw ClassCastException which the user must handle Oid other = (Oid) obj; if( personid < other.personid ) return -1; if( personid > other.personid ) return 1; return 0; } } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPC/PCAppProject.java100664 30365 12500110372 26241 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedPC; import javax.jdo.annotations.*; import java.io.Serializable; import java.io.ObjectInputStream; import java.io.IOException; import java.util.Collections; import java.util.Comparator; import java.util.Set; import java.util.HashSet; import java.math.BigDecimal; import org.apache.jdo.tck.pc.company.IProject; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a project, a budgeted task with one or more * employees working on it. */ @PersistenceCapable(identityType=IdentityType.APPLICATION, table="projects") @Inheritance(strategy=InheritanceStrategy.NEW_TABLE) @Discriminator(strategy=DiscriminatorStrategy.CLASS_NAME, column="DISCRIMINATOR") public class PCAppProject implements IProject, Serializable, Comparable, Comparator, DeepEquality { @NotPersistent() private long _projid; @NotPersistent() private String _name; @NotPersistent() private BigDecimal _budget; @NotPersistent() private transient Set _reviewers = new HashSet(); @NotPersistent() private transient Set _members = new HashSet(); /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public PCAppProject() {} /** * Initialize a project. * @param projid The project identifier. * @param name The name of the project. * @param budget The budget for the project. */ public PCAppProject(long projid, String name, BigDecimal budget) { this._projid = projid; this._name = name; this._budget = budget; } /** * Set the id associated with this object. * @param id the id. */ public void setProjid(long id) { this._projid = id; } /** * Get the project ID. * @return The project ID. */ @PrimaryKey @Column(name="PROJID") public long getProjid() { return _projid; } /** * Get the name of the project. * @return The name of the project. */ @Column(name="NAME") public String getName() { return _name; } /** * Set the name of the project. * @param name The name of the project. */ public void setName(String name) { this._name = name; } /** * Get the project's budget. * @return The project's budget. */ @Column(name="BUDGET", jdbcType="DECIMAL", length=11, scale=2) public BigDecimal getBudget() { return _budget; } /** * Set the project's budget. * @param budget The project's budget. */ public void setBudget(BigDecimal budget) { this._budget = budget; } /** * Get the reviewers associated with this project. */ @Persistent(table="project_reviewer") @Element(types=org.apache.jdo.tck.pc.companyAnnotatedPC.PCAppEmployee.class, column="REVIEWER") @Join(column="PROJID", foreignKey="PR_PROJ_FK") public Set getReviewers() { return _reviewers; } /** * Add a reviewer to the project. * @param emp The employee to add as a reviewer. */ public void addReviewer(PCAppEmployee emp) { _reviewers.add(emp); } /** * Remove a reviewer from the project. * @param emp The employee to remove as a reviewer of this project. */ public void removeReviewer(PCAppEmployee emp) { _reviewers.remove(emp); } /** * Set the reviewers associated with this project. * @param reviewers The set of reviewers to associate with this project. */ public void setReviewers(Set reviewers) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this._reviewers = (reviewers != null) ? new HashSet(reviewers) : null; } /** * Get the project members. * * * @return The members of the project. */ @Persistent(table="project_member") @Element(types=org.apache.jdo.tck.pc.companyAnnotatedPC.PCAppEmployee.class, column="MEMBER", foreignKey="PR_MEMB_FK") @Join(column="PROJID", foreignKey="PR_PROJ_FK") public Set getMembers() { return _members; } /** * Add a new member to the project. * @param emp The employee to add to the project. */ public void addMember(PCAppEmployee emp) { _members.add(emp); } /** * Remove a member from the project. * @param emp The employee to remove from the project. */ public void removeMember(PCAppEmployee emp) { _members.remove(emp); } /** * Set the members of the project. * @param employees The set of employees to be the members of this * project. */ public void setMembers(Set employees) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this._members = (employees != null) ? new HashSet(employees) : null; } /** Serialization support: initialize transient fields. */ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); _reviewers = new HashSet(); _members = new HashSet(); } /** * Returns a String representation of a PCAppProject object. * * * @return a String representation of a PCAppProject object. */ public String toString() { return "FCProject(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(_projid); rc.append(", name ").append(_name); rc.append(", budget ").append(_budget); return rc.toString(); } /** * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the specified Person. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { PCAppProject otherProject = (PCAppProject)other; String where = "FCProject<" + _projid + ">"; return helper.equals(_projid, otherProject.getProjid(), where + ".projid") & helper.equals(_name, otherProject.getName(), where + ".name") & helper.equals(_budget, otherProject.getBudget(), where + ".budget") & helper.deepEquals(_reviewers, otherProject.getReviewers(), where + ".reviewers") & helper.deepEquals(_members, otherProject.getMembers(), where + ".members"); } /** * Compares this object with the specified object for order. Returns a * negative integer, zero, or a positive integer as this object is less * than, equal to, or greater than the specified object. * @param o The Object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified object. * @throws ClassCastException - if the specified object's type prevents * it from being compared to this Object. */ public int compareTo(Object o) { return compareTo((PCAppProject)o); } /** * Compare two instances. This is a method in Comparator. */ public int compare(Object o1, Object o2) { return compare((PCAppProject)o1, (PCAppProject)o2); } /** * * Compares this object with the specified PCAppProject object for * order. Returns a negative integer, zero, or a positive integer as * this object is less than, equal to, or greater than the specified * object. * * * @param other The PCAppProject object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified F\PFCAppProject object. */ public int compareTo(PCAppProject other) { return compare(this, other); } /** * Compares its two IProject arguments for order. Returns a negative * integer, zero, or a positive integer as the first argument is less * than, equal to, or greater than the second. * @param o1 the first IProject object to be compared. * @param o2 the second IProject object to be compared. * @return a negative integer, zero, or a positive integer as the first * object is less than, equal to, or greater than the second object. */ public static int compare(PCAppProject o1, PCAppProject o2) { return EqualityHelper.compare(o1.getProjid(), o2.getProjid()); } /** * Indicates whether some other object is "equal to" this one. * @param obj the object with which to compare. * @return true if this object is the same as the obj * argument; false otherwise. */ public boolean equals(Object obj) { if (obj instanceof PCAppProject) { return compareTo((PCAppProject)obj) == 0; } return false; } /** * Returns a hash code value for the object. * @return a hash code value for this object. */ public int hashCode() { return (int)_projid; } /** * This class is used to represent the application identity * for the PCAppProject class. */ public static class Oid implements Serializable, Comparable { /** * This field represents the identifier for the * PCAppProject class. It must match a field in the * PCAppProject class in both name and type. */ public long projid; /** * The required public no-arg constructor. */ public Oid() { } /** * Initialize the application identifier with a project ID. * @param projid The id of the project. */ public Oid(long projid) { this.projid = projid; } public Oid(String s) { projid = Long.parseLong(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + projid;} /** */ public boolean equals(java.lang.Object obj) { if( obj==null || !this.getClass().equals(obj.getClass()) ) return( false ); Oid o = (Oid) obj; if( this.projid != o.projid ) return( false ); return( true ); } /** */ public int hashCode() { return( (int) projid ); } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } /** */ public int compareTo(Object obj) { // may throw ClassCastException which the user must handle Oid other = (Oid) obj; if( projid < other.projid ) return -1; if( projid > other.projid ) return 1; return 0; } } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPC/PCDSAddress.java100664 25022 12500110372 26000 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedPC; import java.io.Serializable; import java.util.Comparator; import javax.jdo.annotations.*; import org.apache.jdo.tck.pc.company.IAddress; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a postal address. */ @PersistenceCapable(embeddedOnly="true", requiresExtent="false") public class PCDSAddress implements IAddress, Serializable, Comparable, Comparator, DeepEquality { private long addrid; private String street; private String city; private String state; private String zipcode; private String country; /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public PCDSAddress() {} /** * This constructor initializes the PCDSAddress components. * * * @param addrid The address ID. * @param street The street address. * @param city The city. * @param state The state. * @param zipcode The zip code. * @param country The zip country. */ public PCDSAddress(long addrid, String street, String city, String state, String zipcode, String country) { this.addrid = addrid; this.street = street; this.city = city; this.state = state; this.zipcode = zipcode; this.country = country; } /** * Get the addrid associated with this object. * @return the addrid. */ public long getAddrid() { return addrid; } /** * Set the id associated with this object. * @param id the id. */ public void setAddrid(long id) { this.addrid = id; } /** * Get the street component of the address. * @return The street component of the address. */ public String getStreet() { return street; } /** * Set the street component of the address. * @param street The street component. */ public void setStreet(String street) { this.street = street; } /** * Get the city. * @return The city component of the address. */ public String getCity() { return city; } /** * Set the city component of the address. * @param city The city. */ public void setCity(String city) { this.city = city; } /** * Get the state component of the address. * @return The state. */ public String getState() { return state; } /** * Set the state component of the address. * @param state The state. */ public void setState(String state) { this.state = state; } /** * Get the zipcode component of the address. * @return The zipcode. */ public String getZipcode() { return zipcode; } /** * Set the zip code component of the address. * @param zipcode The zipcode. */ public void setZipcode(String zipcode) { this.zipcode = zipcode; } /** * Get the country component of the address. * @return The country. */ public String getCountry() { return country; } /** * Set the country component of the address. * @param country The country. */ public void setCountry(String country) { this.country = country; } /** * Returns a String representation of a Address object. * @return a String representation of a Address object. */ public String toString() { return "Address(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(addrid); rc.append(", street ").append(street); rc.append(", city ").append(city); rc.append(", state ").append(state); rc.append(", zipcode ").append(zipcode); rc.append(", country ").append(country); return rc.toString(); } /** * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the specified Person. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { PCDSAddress otherAddress = (PCDSAddress)other; String where = "Address<" + addrid + ">"; return helper.equals(addrid, otherAddress.getAddrid(), where + ".addrid") & helper.equals(street, otherAddress.getStreet(), where + ".street") & helper.equals(city, otherAddress.getCity(), where + ".city") & helper.equals(state, otherAddress.getState(), where + ".state") & helper.equals(zipcode, otherAddress.getZipcode(), where + ".zipcode") & helper.equals(country, otherAddress.getCountry(), where + ".country"); } /** * Compares this object with the specified object for order. Returns a * negative integer, zero, or a positive integer as this object is less * than, equal to, or greater than the specified object. * @param o The Object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified object. * @throws ClassCastException - if the specified object's type prevents * it from being compared to this Object. */ public int compareTo(Object o) { return compareTo((PCDSAddress)o); } /** * Compare two instances. This is a method in Comparator. */ public int compare(Object o1, Object o2) { return compare((PCDSAddress)o1, (PCDSAddress)o2); } /** * Compares this object with the specified Address object for * order. Returns a negative integer, zero, or a positive integer as * this object is less than, equal to, or greater than the specified * object. * @param other The Address object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified Address * object. */ public int compareTo(PCDSAddress other) { return compare(this, other); } /** * Compares its two PCDSAddress arguments for order. Returns a negative * integer, zero, or a positive integer as the first argument is less * than, equal to, or greater than the second. * * * @param o1 the first PCDSAddress object to be compared. * @param o2 the second PCDSAddressobject to be compared. * @return a negative integer, zero, or a positive integer as the first * object is less than, equal to, or greater than the second object. */ public static int compare(PCDSAddress o1, PCDSAddress o2) { return EqualityHelper.compare(o1.getAddrid(), o2.getAddrid()); } /** * Indicates whether some other object is "equal to" this one. * @param obj the object with which to compare. * @return true if this object is the same as the obj * argument; false otherwise. */ public boolean equals(Object obj) { if (obj instanceof PCDSAddress) { return compareTo((PCDSAddress)obj) == 0; } return false; } /** * Returns a hash code value for the object. * @return a hash code value for this object. */ public int hashCode() { return (int)addrid; } /** * This class is used to represent the application identifier * for the Address class. */ public static class Oid implements Serializable, Comparable { /** * This is the identifier field for Address and must * correspond in type and name to the field in * Address. */ public long addrid; /** The required public, no-arg constructor. */ public Oid() { addrid = 0; } /** * A constructor to initialize the identifier field. * @param addrid the id of the Address. */ public Oid(long addrid) { this.addrid = addrid; } public Oid(String s) { addrid = Long.parseLong(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + addrid;} /** */ public boolean equals(java.lang.Object obj) { if( obj==null || !this.getClass().equals(obj.getClass()) ) return( false ); Oid o = (Oid) obj; if( this.addrid != o.addrid ) return( false ); return( true ); } /** */ public int hashCode() { return( (int) addrid ); } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } /** */ public int compareTo(Object obj) { // may throw ClassCastException which the user must handle Oid other = (Oid) obj; if( addrid < other.addrid ) return -1; if( addrid > other.addrid ) return 1; return 0; } } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPC/PCDSCompany.java100664 32170 12500110372 26023 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedPC; import javax.jdo.annotations.*; import java.io.Serializable; import java.io.ObjectInputStream; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.Collections; import java.util.Comparator; import java.util.Set; import java.util.HashSet; import java.util.Date; import org.apache.jdo.tck.pc.company.IAddress; import org.apache.jdo.tck.pc.company.ICompany; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents information about a company. */ @PersistenceCapable(table="companies") @Inheritance(strategy=InheritanceStrategy.NEW_TABLE) @Discriminator(strategy=DiscriminatorStrategy.CLASS_NAME, column="DISCRIMINATOR") @DatastoreIdentity(strategy=IdGeneratorStrategy.IDENTITY, column="DATASTORE_IDENTITY") public class PCDSCompany implements ICompany, Serializable, Comparable, Comparator, DeepEquality { @NotPersistent() private long _companyid; @NotPersistent() private String _name; @NotPersistent() private Date _founded; @NotPersistent() private PCDSAddress _address; @NotPersistent() private transient Set _departments = new HashSet(); protected static SimpleDateFormat formatter = new SimpleDateFormat("d/MMM/yyyy"); /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public PCDSCompany() {} /** * * Initialize the PCDSCompany instance. * * * @param companyid The company id. * @param name The company name. * @param founded The date the company was founded. */ public PCDSCompany(long companyid, String name, Date founded) { this._companyid = companyid; this._name = name; this._founded = founded; } /** * Initialize the Company instance. * @param companyid The company id. * @param name The company name. * @param founded The date the company was founded. * @param addr The company's address. */ public PCDSCompany(long companyid, String name, Date founded, IAddress addr) { this(companyid, name, founded); this._address = (PCDSAddress)addr; } /** * Get the company id. * @return The company id. */ @Column(name="ID") public long getCompanyid() { return _companyid; } /** * Set the id associated with this object. * @param id the id. */ public void setCompanyid(long id) { this._companyid = id; } /** * Get the name of the company. * @return The name of the company. */ @Column(name="NAME", jdbcType="VARCHAR") public String getName() { return _name; } /** * Set the name of the company. * @param name The value to use for the name of the company. */ public void setName(String name) { this._name = name; } /** * Get the date that the company was founded. * @return The date the company was founded. */ @Column(name="FOUNDEDDATE") public Date getFounded() { return _founded; } /** * Set the date that the company was founded. * @param founded The date to set that the company was founded. */ public void setFounded(Date founded) { this._founded = founded; } /** * Get the address of the company. * @return The primary address of the company. */ @Persistent(persistenceModifier=PersistenceModifier.PERSISTENT, types=org.apache.jdo.tck.pc.companyAnnotatedPC.PCDSAddress.class) @Embedded(nullIndicatorColumn="COUNTRY", members={ @Persistent(name="addrid", columns=@Column(name="ADDRID")), @Persistent(name="street", columns=@Column(name="STREET")), @Persistent(name="city", columns=@Column(name="CITY")), @Persistent(name="state", columns=@Column(name="STATE")), @Persistent(name="zipcode", columns=@Column(name="ZIPCODE")), @Persistent(name="country", columns=@Column(name="COUNTRY")) }) public IAddress getAddress() { return _address; } /** * Set the primary address for the company. * @param address The address to set for the company. */ public void setAddress(IAddress address) { this._address = (PCDSAddress)address; } /** * Get the departments contained in the company. * * * @return All the PCDSDepartments of the company. */ @Persistent(persistenceModifier=PersistenceModifier.PERSISTENT, mappedBy="company") @Element(types=org.apache.jdo.tck.pc.companyAnnotatedPC.PCDSDepartment.class) public Set getDepartments() { return _departments; } /** * Add a PCDSDepartment instance to the company. * * * @param dept The PCDSDepartment instance to add. */ public void addDepartment(PCDSDepartment dept) { _departments.add(dept); } /** * Remove a PCDSDepartment instance from the company. * * * @param dept The PCDSDepartment instance to remove. */ public void removeDepartment(PCDSDepartment dept) { _departments.remove(dept); } /** * Initialize the set of PCDSDepartments in the company to the * parameter. * * * @param departments The set of PCDSDepartments for the * company. */ public void setDepartments(Set departments) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this._departments = (departments != null) ? new HashSet(departments) : null; } /** Serialization support: initialize transient fields. */ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); _departments = new HashSet(); } /** * Returns a String representation of a Company object. * @return a String representation of a Company object. */ public String toString() { return "Company(" + getFieldRepr()+ ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(_companyid); rc.append(", name ").append(_name); rc.append(", founded ").append( _founded==null ? "null" : formatter.format(_founded)); return rc.toString(); } /** * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the specified Person. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { PCDSCompany otherCompany = (PCDSCompany)other; String where = "Company<" + _companyid + ">"; return helper.equals(_companyid, otherCompany.getCompanyid(), where + ".companyid") & helper.equals(_name, otherCompany.getName(), where + ".name") & helper.equals(_founded, otherCompany.getFounded(), where + ".founded") & helper.deepEquals(_address, otherCompany.getAddress(), where + ".address") & helper.deepEquals(_departments, otherCompany.getDepartments(), where + ".departments"); } /** * Compares this object with the specified object for order. Returns a * negative integer, zero, or a positive integer as this object is less * than, equal to, or greater than the specified object. * @param o The Object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified object. * @throws ClassCastException - if the specified object's type prevents * it from being compared to this Object. */ public int compareTo(Object o) { return compareTo((PCDSCompany)o); } /** * Compare two instances. This is a method in Comparator. */ public int compare(Object o1, Object o2) { return compare((PCDSCompany)o1, (PCDSCompany)o2); } /** * Compares this object with the specified Company object for * order. Returns a negative integer, zero, or a positive integer as * this object is less than, equal to, or greater than the specified * object. * @param other The Company object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified Company * object. */ public int compareTo(PCDSCompany other) { return compare(this, other); } /** * Compares its two ICompany arguments for order. Returns a negative * integer, zero, or a positive integer as the first argument is less * than, equal to, or greater than the second. * @param o1 the first ICompany object to be compared. * @param o2 the second ICompany object to be compared. * @return a negative integer, zero, or a positive integer as the first * object is less than, equal to, or greater than the second object. */ public static int compare(PCDSCompany o1, PCDSCompany o2) { return EqualityHelper.compare(o1.getCompanyid(), o2.getCompanyid()); } /** * Indicates whether some other object is "equal to" this one. * @param obj the object with which to compare. * @return true if this object is the same as the obj * argument; false otherwise. */ public boolean equals(Object obj) { if (obj instanceof PCDSCompany) { return compareTo((PCDSCompany)obj) == 0; } return false; } /** * Returns a hash code value for the object. * @return a hash code value for this object. */ public int hashCode() { return (int)_companyid; } /** * The class to be used as the application identifier * for the Company class. It consists of both the company * name and the date that the company was founded. */ public static class Oid implements Serializable, Comparable { /** * This field is part of the identifier and should match in name * and type with a field in the Company class. */ public long companyid; /** The required public no-arg constructor. */ public Oid() { } /** * Initialize the identifier. * @param companyid The id of the company. */ public Oid(long companyid) { this.companyid = companyid; } public Oid(String s) { companyid = Long.parseLong(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + companyid;} /** */ public boolean equals(Object obj) { if (obj==null || !this.getClass().equals(obj.getClass())) return false; Oid o = (Oid) obj; if (this.companyid != o.companyid) return false; return true; } /** */ public int hashCode() { return (int)companyid; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } /** */ public int compareTo(Object obj) { // may throw ClassCastException which the user must handle Oid other = (Oid) obj; if( companyid < other.companyid ) return -1; if( companyid > other.companyid ) return 1; return 0; } } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPC/PCDSDentalInsurance.java100664 11410 12500110372 27466 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedPC; import javax.jdo.annotations.*; import java.math.BigDecimal; import org.apache.jdo.tck.pc.company.IDentalInsurance; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a dental insurance carrier selection for a * particular Employee. */ @PersistenceCapable @DatastoreIdentity(strategy=IdGeneratorStrategy.IDENTITY, column="DATASTORE_IDENTITY") public class PCDSDentalInsurance extends PCDSInsurance implements IDentalInsurance { @NotPersistent() private BigDecimal _lifetimeOrthoBenefit; /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public PCDSDentalInsurance() {} /** * Construct a DentalInsurance instance. * @param insid The insurance instance identifier. * @param carrier The insurance carrier. * @param lifetimeOrthoBenefit The lifetimeOrthoBenefit. */ public PCDSDentalInsurance(long insid, String carrier, BigDecimal lifetimeOrthoBenefit) { super(insid, carrier); this._lifetimeOrthoBenefit = lifetimeOrthoBenefit; } /** * Construct a PCDSDentalInsurance instance. * * * @param insid The insurance instance identifier. * @param carrier The insurance carrier. * @param employee The employee associated with this insurance. * @param lifetimeOrthoBenefit The lifetimeOrthoBenefit. */ public PCDSDentalInsurance(long insid, String carrier, PCDSEmployee employee, BigDecimal lifetimeOrthoBenefit) { super(insid, carrier, employee); this._lifetimeOrthoBenefit = lifetimeOrthoBenefit; } /** * Get the insurance lifetimeOrthoBenefit. * @return The insurance lifetimeOrthoBenefit. */ @Column(name="LIFETIME_ORTHO_BENEFIT") public BigDecimal getLifetimeOrthoBenefit() { return _lifetimeOrthoBenefit; } /** * Set the insurance lifetimeOrthoBenefit. * @param lifetimeOrthoBenefit The insurance lifetimeOrthoBenefit. */ public void setLifetimeOrthoBenefit(BigDecimal lifetimeOrthoBenefit) { this._lifetimeOrthoBenefit = lifetimeOrthoBenefit; } /** * Returns a String representation of a PCDSDentalInsurance * object. * * * @return a String representation of a PCDSDentalInsurance * object. */ public String toString() { return "FCDentalInsurance(" + getFieldRepr()+ ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(super.getFieldRepr()); rc.append(", lifetimeOrthoBenefit ").append(_lifetimeOrthoBenefit); return rc.toString(); } /** * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the other Object. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { PCDSDentalInsurance otherIns = (PCDSDentalInsurance)other; String where = "FCDentalInsurance<" + getInsid() + ">"; return super.deepCompareFields(otherIns, helper) & helper.equals(_lifetimeOrthoBenefit, otherIns.getLifetimeOrthoBenefit(), where + ".lifetimeOrthoBenefit"); } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPC/PCDSDepartment.java100664 34760 12500110372 26527 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedPC; import javax.jdo.annotations.*; import java.io.Serializable; import java.io.ObjectInputStream; import java.io.IOException; import java.util.Collections; import java.util.Comparator; import java.util.HashSet; import java.util.List; import java.util.Set; import org.apache.jdo.tck.pc.company.ICompany; import org.apache.jdo.tck.pc.company.IDepartment; import org.apache.jdo.tck.pc.company.IEmployee; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a department within a company. */ @PersistenceCapable(table="departments") @Inheritance(strategy=InheritanceStrategy.NEW_TABLE) @Discriminator(strategy=DiscriminatorStrategy.CLASS_NAME, column="DISCRIMINATOR") @DatastoreIdentity(strategy=IdGeneratorStrategy.IDENTITY, column="DATASTORE_IDENTITY") public class PCDSDepartment implements IDepartment, Serializable, Comparable, Comparator, DeepEquality { public static final int RECOMMENDED_NO_OF_EMPS = 2; @NotPersistent() private long _deptid; @NotPersistent() private String _name; @NotPersistent() private PCDSCompany _company; @NotPersistent() private PCDSEmployee _employeeOfTheMonth; @NotPersistent() private transient Set _employees = new HashSet(); @NotPersistent() private transient Set _fundedEmps = new HashSet(); /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public PCDSDepartment() {} /** * Construct a Department instance. * @param deptid The department id. * @param name The name of the department. */ public PCDSDepartment(long deptid, String name) { this._deptid = deptid; this._name = name; } /** * Construct a Department instance. * @param deptid The department id. * @param name The name of the department. * @param company The company that the department is associated with. */ public PCDSDepartment(long deptid, String name, ICompany company) { this._deptid = deptid; this._name = name; this._company = (PCDSCompany)company; } /** * Construct a Department instance. * @param deptid The department id. * @param name The name of the department. * @param company The company that the department is associated with. * @param employeeOfTheMonth The employee of the month the * department is associated with. */ public PCDSDepartment(long deptid, String name, ICompany company, IEmployee employeeOfTheMonth) { this._deptid = deptid; this._name = name; this._company = (PCDSCompany)company; this._employeeOfTheMonth = (PCDSEmployee)employeeOfTheMonth; } /** * Set the id associated with this object. * @param id the id. */ public void setDeptid(long id) { this._deptid = id; } /** * Get the department id. * @return The department id. */ @Column(name="ID") public long getDeptid() { return _deptid; } /** * Get the name of the department. * @return The name of the department. */ @Column(name="NAME") public String getName() { return _name; } /** * Set the name of the department. * @param name The name to set for the department. */ public void setName(String name) { this._name = name; } /** * Get the company associated with the department. * @return The company. */ @Persistent(types=org.apache.jdo.tck.pc.companyAnnotatedPC.PCDSCompany.class) @Column(name="COMPANYID") public ICompany getCompany() { return _company; } /** * Set the company for the department. * @param company The company to associate with the department. */ public void setCompany(ICompany company) { this._company = (PCDSCompany)company; } /** * Get the employee of the month associated with the department. * @return The employee of the month. */ @Persistent(types=org.apache.jdo.tck.pc.companyAnnotatedPC.PCDSEmployee.class) @Column(name="EMP_OF_THE_MONTH") public IEmployee getEmployeeOfTheMonth() { return _employeeOfTheMonth; } /** * Set the employee of the month for the department. * @param employeeOfTheMonth The employee of the month to * associate with the department. */ public void setEmployeeOfTheMonth(IEmployee employeeOfTheMonth) { this._employeeOfTheMonth = (PCDSEmployee)employeeOfTheMonth; } /** * Get the employees in the department. * @return The set of employees in the department. */ @Persistent(mappedBy="department") @Element(types=org.apache.jdo.tck.pc.companyAnnotatedPC.PCDSEmployee.class) public Set getEmployees() { return _employees; } /** * Add an employee to the department. * @param emp The employee to add to the department. */ public void addEmployee(PCDSEmployee emp) { _employees.add(emp); } /** * Remove an employee from the department. * @param emp The employee to remove from the department. */ public void removeEmployee(PCDSEmployee emp) { _employees.remove(emp); } /** * Set the employees to be in this department. * @param employees The set of employees for this department. */ public void setEmployees(Set employees) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this._employees = (employees != null) ? new HashSet(employees) : null; } /** * Get the funded employees in the department. * @return The set of funded employees in the department. */ @Element(types=org.apache.jdo.tck.pc.companyAnnotatedPC.PCDSEmployee.class) @Persistent(mappedBy="fundingDept") public Set getFundedEmps() { return _fundedEmps; } /** * Add an employee to the collection of funded employees of this * department. * @param emp The employee to add to the department. */ public void addFundedEmp(PCDSEmployee emp) { _fundedEmps.add(emp); } /** * Remove an employee from collection of funded employees of this * department. * @param emp The employee to remove from the department. */ public void removeFundedEmp(PCDSEmployee emp) { _fundedEmps.remove(emp); } /** * Set the funded employees to be in this department. * @param employees The set of funded employees for this department. */ public void setFundedEmps(Set employees) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this._fundedEmps = (employees != null) ? new HashSet(employees) : null; } @Override public List getMeetingRooms() { // TODO Auto-generated method stub return null; } @Override public void setMeetingRooms(List rooms) { // TODO Auto-generated method stub } /** Serialization support: initialize transient fields. */ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); _employees = new HashSet(); _fundedEmps = new HashSet(); } /** * * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the other PCDSDepartment. * * * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { PCDSDepartment otherDept = (PCDSDepartment)other; String where = "FCDepartment<" + _deptid + ">"; return helper.equals(_deptid, otherDept.getDeptid(), where + ".deptid") & helper.equals(_name, otherDept.getName(), where + ".name") & helper.deepEquals(_company, otherDept.getCompany(), where + ".company") & helper.deepEquals(_employeeOfTheMonth, otherDept.getEmployeeOfTheMonth(), where + ".employeeOfTheMonth") & helper.deepEquals(_employees, otherDept.getEmployees(), where + ".employees") & helper.deepEquals(_fundedEmps, otherDept.getFundedEmps(), where + ".fundedEmps"); } /** * Returns a String representation of a PCDSDepartment object. * * * @return a String representation of a PCDSDepartment object. */ public String toString() { return "FCDepartment(" + getFieldRepr()+ ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(_deptid); rc.append(", name ").append(_name); return rc.toString(); } /** * Compares this object with the specified object for order. Returns a * negative integer, zero, or a positive integer as this object is less * than, equal to, or greater than the specified object. * @param o The Object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified object. * @throws ClassCastException - if the specified object's type prevents * it from being compared to this Object. */ public int compareTo(Object o) { return compareTo((PCDSDepartment)o); } /** * Compare two instances. This is a method in Comparator. */ public int compare(Object o1, Object o2) { return compare((PCDSDepartment)o1, (PCDSDepartment)o2); } /** * Compares this object with the specified Department object for * order. Returns a negative integer, zero, or a positive integer as * this object is less than, equal to, or greater than the specified * object. * @param other The Department object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified * Department object. */ public int compareTo(PCDSDepartment other) { return compare(this, other); } /** * Compares its two IDepartment arguments for order. Returns a negative * integer, zero, or a positive integer as the first argument is less * than, equal to, or greater than the second. * @param o1 the first IDepartment object to be compared. * @param o2 the second IDepartment object to be compared. * @return a negative integer, zero, or a positive integer as the first * object is less than, equal to, or greater than the second object. */ public static int compare(PCDSDepartment o1, PCDSDepartment o2) { return EqualityHelper.compare(o1.getDeptid(), o2.getDeptid()); } /** * Indicates whether some other object is "equal to" this one. * @param obj the object with which to compare. * @return true if this object is the same as the obj * argument; false otherwise. */ public boolean equals(Object obj) { if (obj instanceof PCDSDepartment) { return compareTo((PCDSDepartment)obj) == 0; } return false; } /** * Returns a hash code value for the object. * @return a hash code value for this object. */ public int hashCode() { return (int)_deptid; } /** * The application identity class associated with the * Department class. */ public static class Oid implements Serializable, Comparable { /** * This field represents the application identifier field * for the Department class. * It must match in name and type with the field in the * Department class. */ public long deptid; /** * The required public, no-arg constructor. */ public Oid() { } /** * A constructor to initialize the identifier field. * @param deptid the deptid of the Department. */ public Oid(long deptid) { this.deptid = deptid; } public Oid(String s) { deptid = Long.parseLong(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + deptid;} /** */ public boolean equals(java.lang.Object obj) { if( obj==null || !this.getClass().equals(obj.getClass()) ) return( false ); Oid o = (Oid) obj; if( this.deptid != o.deptid ) return( false ); return( true ); } /** */ public int hashCode() { return( (int) deptid ); } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } /** */ public int compareTo(Object obj) { // may throw ClassCastException which the user must handle Oid other = (Oid) obj; if( deptid < other.deptid ) return -1; if( deptid > other.deptid ) return 1; return 0; } } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPC/PCDSEmployee.java100664 42726 12500110372 26204 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedPC; import javax.jdo.annotations.*; import java.io.ObjectInputStream; import java.io.IOException; import java.util.Collections; import java.util.Date; import java.util.HashSet; import java.util.Set; import org.apache.jdo.tck.pc.company.IDentalInsurance; import org.apache.jdo.tck.pc.company.IDepartment; import org.apache.jdo.tck.pc.company.IEmployee; import org.apache.jdo.tck.pc.company.IMedicalInsurance; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents an employee. */ @PersistenceCapable @Inheritance(strategy=InheritanceStrategy.SUPERCLASS_TABLE) @DatastoreIdentity(strategy=IdGeneratorStrategy.IDENTITY, column="DATASTORE_IDENTITY") public abstract class PCDSEmployee extends PCDSPerson implements IEmployee { @NotPersistent() private Date _hiredate; @NotPersistent() private double _weeklyhours; @NotPersistent() private PCDSDentalInsurance _dentalInsurance; @NotPersistent() private PCDSMedicalInsurance _medicalInsurance; @NotPersistent() private PCDSDepartment _department; @NotPersistent() private PCDSDepartment _fundingDept; @NotPersistent() private PCDSEmployee _manager; @NotPersistent() private PCDSEmployee _mentor; @NotPersistent() private PCDSEmployee _protege; @NotPersistent() private PCDSEmployee _hradvisor; @NotPersistent() private transient Set _reviewedProjects = new HashSet(); @NotPersistent() private transient Set _projects = new HashSet(); @NotPersistent() private transient Set _team = new HashSet(); @NotPersistent() private transient Set _hradvisees = new HashSet(); /** This is the JDO-required no-args constructor */ protected PCDSEmployee() {} /** * Construct an PCDSEmployee instance. * * * @param personid The identifier for the person. * @param firstname The first name of the employee. * @param lastname The last name of the employee. * @param middlename The middle name of the employee. * @param birthdate The birth date of the employee. * @param hiredate The date that the employee was hired. */ public PCDSEmployee(long personid, String firstname, String lastname, String middlename, Date birthdate, Date hiredate) { super(personid, firstname, lastname, middlename, birthdate); this._hiredate = hiredate; } /** * Construct an PCDSEmployee instance. * * * @param personid The identifier for the person. * @param firstname The first name of the employee. * @param lastname The last name of the employee. * @param middlename The middle name of the employee. * @param birthdate The birth date of the employee. * @param address The address of the employee. * @param hiredate The date that the employee was hired. */ public PCDSEmployee(long personid, String firstname, String lastname, String middlename, Date birthdate, PCDSAddress address, Date hiredate) { super(personid, firstname, lastname, middlename, birthdate, address); this._hiredate = hiredate; } /** * Get the date that the employee was hired. * @return The date the employee was hired. */ @Column(name="HIREDATE") public Date getHiredate() { return _hiredate; } /** * Set the date that the employee was hired. * @param hiredate The date the employee was hired. */ public void setHiredate(Date hiredate) { this._hiredate = hiredate; } /** * Get the weekly hours of the employee. * @return The number of hours per week that the employee works. */ @Column(name="WEEKLYHOURS") public double getWeeklyhours() { return _weeklyhours; } /** * Set the number of hours per week that the employee works. * @param weeklyhours The number of hours per week that the employee * works. */ public void setWeeklyhours(double weeklyhours) { this._weeklyhours = weeklyhours; } /** * Get the reviewed projects. * @return The reviewed projects. */ @Persistent(mappedBy="reviewers") @Element(types=org.apache.jdo.tck.pc.companyAnnotatedPC.PCDSProject.class) public Set getReviewedProjects() { return _reviewedProjects; } /** * Add a reviewed project. * @param project A reviewed project. */ public void addReviewedProjects(PCDSProject project) { _reviewedProjects.add(project); } /** * Remove a reviewed project. * @param project A reviewed project. */ public void removeReviewedProject(PCDSProject project) { _reviewedProjects.remove(project); } /** * Set the reviewed projects for the employee. * @param reviewedProjects The set of reviewed projects. */ public void setReviewedProjects(Set reviewedProjects) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this._reviewedProjects = (reviewedProjects != null) ? new HashSet(reviewedProjects) : null; } /** * Get the employee's projects. * @return The employee's projects. */ @Persistent(mappedBy="members") @Element(types=org.apache.jdo.tck.pc.companyAnnotatedPC.PCDSProject.class) public Set getProjects() { return _projects; } /** * Add a project for the employee. * @param project The project. */ public void addProject(PCDSProject project) { _projects.add(project); } /** * Remove a project from an employee's set of projects. * @param project The project. */ public void removeProject(PCDSProject project) { _projects.remove(project); } /** * Set the projects for the employee. * @param projects The set of projects of the employee. */ public void setProjects(Set projects) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this._projects = (projects != null) ? new HashSet(projects) : null; } /** * Get the dental insurance of the employee. * @return The employee's dental insurance. */ @Persistent(mappedBy="employee", types=org.apache.jdo.tck.pc.companyAnnotatedPC.PCDSDentalInsurance.class) public IDentalInsurance getDentalInsurance() { return _dentalInsurance; } /** * Set the dental insurance object for the employee. * @param dentalInsurance The dental insurance object to associate with * the employee. */ public void setDentalInsurance(IDentalInsurance dentalInsurance) { this._dentalInsurance = (PCDSDentalInsurance)dentalInsurance; } /** * Get the medical insurance of the employee. * @return The employee's medical insurance. */ @Persistent(mappedBy="employee", types=org.apache.jdo.tck.pc.companyAnnotatedPC.PCDSMedicalInsurance.class) public IMedicalInsurance getMedicalInsurance() { return _medicalInsurance; } /** * Set the medical insurance object for the employee. * @param medicalInsurance The medical insurance object to associate * with the employee. */ public void setMedicalInsurance(IMedicalInsurance medicalInsurance) { this._medicalInsurance = (PCDSMedicalInsurance)medicalInsurance; } /** * Get the employee's department. * @return The department associated with the employee. */ @Persistent(types=org.apache.jdo.tck.pc.companyAnnotatedPC.PCDSDepartment.class) @Column(name="DEPARTMENT") public IDepartment getDepartment() { return _department; } /** * Set the employee's department. * @param department The department. */ public void setDepartment(IDepartment department) { this._department = (PCDSDepartment)department; } /** * Get the employee's funding department. * @return The funding department associated with the employee. */ @Persistent(types=org.apache.jdo.tck.pc.companyAnnotatedPC.PCDSDepartment.class) @Column(name="FUNDINGDEPT") public IDepartment getFundingDept() { return _fundingDept; } /** * Set the employee's funding department. * @param department The funding department. */ public void setFundingDept(IDepartment department) { this._fundingDept = (PCDSDepartment)department; } /** * Get the employee's manager. * @return The employee's manager. */ @Persistent(types=org.apache.jdo.tck.pc.companyAnnotatedPC.PCDSEmployee.class) @Column(name="MANAGER") public IEmployee getManager() { return _manager; } /** * Set the employee's manager. * @param manager The employee's manager. */ public void setManager(IEmployee manager) { this._manager = (PCDSEmployee)manager; } /** * Get the employee's team. * * * @return The set of PCDSEmployees on this employee's team. */ @Persistent(mappedBy="manager") @Element(types=org.apache.jdo.tck.pc.companyAnnotatedPC.PCDSEmployee.class) public Set getTeam() { return _team; } /** * Add an PCDSEmployee to this employee's team. * This method sets both sides of the relationship, modifying * this employees team to include parameter emp and modifying * emp to set its manager attribute to this object. * * * @param emp The PCDSEmployee to add to the team. */ public void addToTeam(PCDSEmployee emp) { _team.add(emp); emp._manager = this; } /** * Remove an PCDSEmployee from this employee's team. * This method will also set the emp manager to null. * * * @param emp The PCDSEmployee to remove from the team. */ public void removeFromTeam(PCDSEmployee emp) { _team.remove(emp); emp._manager = null; } /** * Set the employee's team. * * * @param team The set of PCDSEmployees. */ public void setTeam(Set team) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this._team = (team != null) ? new HashSet(team) : null; } /** * Set the mentor for this employee. * @param mentor The mentor for this employee. */ public void setMentor(IEmployee mentor) { this._mentor = (PCDSEmployee)mentor; } /** * Get the mentor for this employee. * @return The mentor. */ @Persistent(types=org.apache.jdo.tck.pc.companyAnnotatedPC.PCDSEmployee.class) @Column(name="MENTOR") public IEmployee getMentor() { return _mentor; } /** * Set the protege for this employee. * @param protege The protege for this employee. */ public void setProtege(IEmployee protege) { this._protege = (PCDSEmployee)protege; } /** * Get the protege of this employee. * @return The protege of this employee. */ @Persistent(mappedBy="mentor", types=org.apache.jdo.tck.pc.companyAnnotatedPC.PCDSEmployee.class) public IEmployee getProtege() { return _protege; } /** * Set the HR advisor for this employee. * @param hradvisor The hradvisor for this employee. */ public void setHradvisor(IEmployee hradvisor) { this._hradvisor = (PCDSEmployee)hradvisor; } /** * Get the HR advisor for the employee. * @return The HR advisor. */ @Persistent(types=org.apache.jdo.tck.pc.companyAnnotatedPC.PCDSEmployee.class) @Column(name="HRADVISOR") public IEmployee getHradvisor() { return _hradvisor; } /** * Get the HR advisees of this HR advisor. * * * @return The PCDSEmployees that are HR advisees of this employee. */ @Persistent(mappedBy="hradvisor") @Element(types=org.apache.jdo.tck.pc.companyAnnotatedPC.PCDSEmployee.class) public Set getHradvisees() { return _hradvisees; } /** * Add an PCDSEmployee as an advisee of this HR advisor. * This method also sets the emp hradvisor to reference * this object. In other words, both sides of the relationship are * set. * * * @param emp The employee to add as an advisee. */ public void addAdvisee(PCDSEmployee emp) { _hradvisees.add(emp); emp._hradvisor = this; } /** * Remove an PCDSEmployee as an advisee of this HR advisor. * This method also sets the emp hradvisor to null. * In other words, both sides of the relationship are set. * * * @param emp The employee to add as an HR advisee. */ public void removeAdvisee(PCDSEmployee emp) { _hradvisees.remove(emp); emp._hradvisor = null; } /** * Set the HR advisees of this HR advisor. * * * @param hradvisees The PCDSEmployees that are HR advisees of * this employee. */ public void setHradvisees(Set hradvisees) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this._hradvisees = (hradvisees != null) ? new HashSet(hradvisees) : null; } /** Serialization support: initialize transient fields. */ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); _reviewedProjects = new HashSet(); _projects = new HashSet(); _team = new HashSet(); _hradvisees = new HashSet(); } /** * Return a String representation of a PCDSEmployee object. * * * @return a String representation of a PCDSEmployee object. */ public String toString() { return "FCEmployee(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(super.getFieldRepr()); rc.append(", hired ").append( _hiredate==null ? "null" : formatter.format(_hiredate)); rc.append(", weeklyhours ").append(_weeklyhours); return rc.toString(); } /** * * Returns true if all the fields of this instance are * deep equal to the corresponding fields of the specified PCDSEmployee. * * * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { PCDSEmployee otherEmp = (PCDSEmployee)other; String where = "Employee<" + getPersonid() + ">"; return super.deepCompareFields(otherEmp, helper) & helper.equals(_hiredate, otherEmp.getHiredate(), where + ".hiredate") & helper.closeEnough(_weeklyhours, otherEmp.getWeeklyhours(), where + ".weeklyhours") & helper.deepEquals(_dentalInsurance, otherEmp.getDentalInsurance(), where + ".dentalInsurance") & helper.deepEquals(_medicalInsurance, otherEmp.getMedicalInsurance(), where + ".medicalInsurance") & helper.deepEquals(_department, otherEmp.getDepartment(), where + ".department") & helper.deepEquals(_fundingDept, otherEmp.getFundingDept(), where + ".fundingDept") & helper.deepEquals(_manager, otherEmp.getManager(), where + ".manager") & helper.deepEquals(_mentor, otherEmp.getMentor(), where + ".mentor") & helper.deepEquals(_protege, otherEmp.getProtege(), where + ".protege") & helper.deepEquals(_hradvisor, otherEmp.getHradvisor(), where + ".hradvisor") & helper.deepEquals(_reviewedProjects, otherEmp.getReviewedProjects(), where + ".reviewedProjects") & helper.deepEquals(_projects, otherEmp.getProjects(), where + ".projects") & helper.deepEquals(_team, otherEmp.getTeam(), where + ".team") & helper.deepEquals(_hradvisees, otherEmp.getHradvisees(), where + ".hradvisees"); } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPC/PCDSFullTimeEmployee.java100664 11775 12500110372 27646 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedPC; import javax.jdo.annotations.*; import java.util.Date; import org.apache.jdo.tck.pc.company.IAddress; import org.apache.jdo.tck.pc.company.IFullTimeEmployee; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a full-time employee. */ @PersistenceCapable @Inheritance(strategy=InheritanceStrategy.SUPERCLASS_TABLE) @DatastoreIdentity(strategy=IdGeneratorStrategy.IDENTITY, column="DATASTORE_IDENTITY") public class PCDSFullTimeEmployee extends PCDSEmployee implements IFullTimeEmployee { @NotPersistent() private double _salary; /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public PCDSFullTimeEmployee() {} /** * Construct a full-time employee. * @param personid The person identifier. * @param first The person's first name. * @param last The person's last name. * @param middle The person's middle name. * @param born The person's birthdate. * @param hired The date that the person was hired. * @param sal The salary of the full-time employee. */ public PCDSFullTimeEmployee(long personid, String first, String last, String middle, Date born, Date hired, double sal) { super(personid, first, last, middle, born, hired); _salary = sal; } /** * Construct a full-time employee. * @param personid The person identifier. * @param first The person's first name. * @param last The person's last name. * @param middle The person's middle name. * @param born The person's birthdate. * @param addr The person's address. * @param hired The date that the person was hired. * @param sal The salary of the full-time employee. */ public PCDSFullTimeEmployee(long personid, String first, String last, String middle, Date born, IAddress addr, Date hired, double sal) { super(personid, first, last, middle, born, (PCDSAddress)addr, hired); _salary = sal; } /** * Get the salary of the full time employee. * @return The salary of the full time employee. */ @Column(name="SALARY") public double getSalary() { return _salary; } /** * Set the salary for the full-time employee. * @param salary The salary to set for the full-time employee. */ public void setSalary(double salary) { this._salary = salary; } /** * Return a String representation of a PCDSFullTimeEmployee object. * * * @return a String representation of a PCDSFullTimeEmployee object. */ public String toString() { return "FCFullTimeEmployee(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ public String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(super.getFieldRepr()); rc.append(", $").append(_salary); return rc.toString(); } /** * * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the specified * PCDSFullTimeEmployee. * * * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { PCDSFullTimeEmployee otherEmp = (PCDSFullTimeEmployee)other; String where = "FCFullTimeEmployee<" + getPersonid() + ">"; return super.deepCompareFields(otherEmp, helper) & helper.closeEnough(_salary, otherEmp.getSalary(), where + ".salary"); } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPC/PCDSInsurance.java100664 23452 12500110372 26347 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedPC; import javax.jdo.annotations.*; import java.io.Serializable; import java.util.Comparator; import org.apache.jdo.tck.pc.company.IEmployee; import org.apache.jdo.tck.pc.company.IInsurance; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents an insurance carrier selection for a particular * PCDSEmployee. */ @PersistenceCapable(table="insuranceplans") @Inheritance(strategy=InheritanceStrategy.NEW_TABLE) @Discriminator(strategy=DiscriminatorStrategy.CLASS_NAME, column="DISCRIMINATOR", indexed="true") @Index(name="INS_DISCRIMINATOR_INDEX", unique="false", columns=@Column(name="DISCRIMINATOR")) @DatastoreIdentity(strategy=IdGeneratorStrategy.IDENTITY, column="DATASTORE_IDENTITY") public class PCDSInsurance implements IInsurance, Serializable, Comparable, Comparator, DeepEquality { @NotPersistent() private long _insid; @NotPersistent() private String _carrier; @NotPersistent() private PCDSEmployee _employee; /** This is the JDO-required no-args constructor. */ protected PCDSInsurance() {} /** * Construct an PCDSInsurance instance. * * * @param insid The insurance instance identifier. * @param carrier The insurance carrier. */ protected PCDSInsurance(long insid, String carrier) { this._insid = insid; this._carrier = carrier; } /** * Construct an PCDSInsurance instance. * * * @param insid The insurance instance identifier. * @param carrier The insurance carrier. * @param employee The employee associated with this insurance. */ protected PCDSInsurance(long insid, String carrier, PCDSEmployee employee) { this._insid = insid; this._carrier = carrier; this._employee = employee; } /** * Get the insurance ID. * @return the insurance ID. */ @Column(name="INSID") public long getInsid() { return _insid; } /** * Set the insurance ID. * @param id The insurance ID value. */ public void setInsid(long id) { this._insid = id; } /** * Get the insurance carrier. * @return The insurance carrier. */ @Column(name="CARRIER") public String getCarrier() { return _carrier; } /** * Set the insurance carrier. * @param carrier The insurance carrier. */ public void setCarrier(String carrier) { this._carrier = carrier; } /** * Get the associated employee. * @return The employee for this insurance. */ @Column(name="EMPLOYEE") @Persistent(types=org.apache.jdo.tck.pc.companyAnnotatedPC.PCDSEmployee.class) public IEmployee getEmployee() { return _employee; } /** * Set the associated employee. * @param employee The associated employee. */ public void setEmployee(IEmployee employee) { this._employee = (PCDSEmployee)employee; } /** * Returns a String representation of a PCDSInsurance object. * * * @return a String representation of a PCDSInsurance object. */ public String toString() { return "FCInsurance(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(_insid); rc.append(", carrier ").append(_carrier); return rc.toString(); } /** * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the other Object. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { PCDSInsurance otherIns = (PCDSInsurance)other; String where = "FCInsurance<" + _insid + ">"; return helper.equals(_insid, otherIns.getInsid(), where + ".insid") & helper.equals(_carrier, otherIns.getCarrier(), where + ".carrier") & helper.deepEquals(_employee, otherIns.getEmployee(), where + ".employee"); } /** * Compares this object with the specified object for order. Returns a * negative integer, zero, or a positive integer as this object is less * than, equal to, or greater than the specified object. * @param o The Object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified object. * @throws ClassCastException - if the specified object's type prevents * it from being compared to this Object. */ public int compareTo(Object o) { return compareTo((PCDSInsurance)o); } /** * Compare two instances. This is a method in Comparator. */ public int compare(Object o1, Object o2) { return compare((PCDSInsurance)o1, (PCDSInsurance)o2); } /** * Compares this object with the specified Insurance object for * order. Returns a negative integer, zero, or a positive integer as * this object is less than, equal to, or greater than the specified * object. * @param other The Insurance object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified * Insurance object. */ public int compareTo(PCDSInsurance other) { return compare(this, other); } /** * Compares its two IInsurance arguments for order. Returns a negative * integer, zero, or a positive integer as the first argument is less * than, equal to, or greater than the second. * @param o1 the first IInsurance object to be compared. * @param o2 the second IInsurance object to be compared. * @return a negative integer, zero, or a positive integer as the first * object is less than, equal to, or greater than the second object. */ public static int compare(PCDSInsurance o1, PCDSInsurance o2) { return EqualityHelper.compare(o1.getInsid(), o2.getInsid()); } /** * Indicates whether some other object is "equal to" this one. * @param obj the object with which to compare. * @return true if this object is the same as the obj * argument; false otherwise. */ public boolean equals(Object obj) { if (obj instanceof PCDSInsurance) { return compareTo((PCDSInsurance)obj) == 0; } return false; } /** * Returns a hash code value for the object. * @return a hash code value for this object. */ public int hashCode() { return (int)_insid; } /** * This class is used to represent the application * identifier for the Insurance class. */ public static class Oid implements Serializable, Comparable { /** * This field represents the application identifier for the * Insurance class. It must match the field in the * Insurance class in both name and type. */ public long insid; /** * The required public no-args constructor. */ public Oid() { } /** * Initialize with an insurance identifier. * @param insid the insurance ID. */ public Oid(long insid) { this.insid = insid; } public Oid(String s) { insid = Long.parseLong(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + insid;} /** */ public boolean equals(java.lang.Object obj) { if( obj==null || !this.getClass().equals(obj.getClass()) ) return( false ); Oid o=(Oid) obj; if( this.insid!=o.insid ) return( false ); return( true ); } /** */ public int hashCode() { return( (int) insid ); } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } /** */ public int compareTo(Object obj) { // may throw ClassCastException which the user must handle Oid other = (Oid) obj; if( insid < other.insid ) return -1; if( insid > other.insid ) return 1; return 0; } } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPC/PCDSMedicalInsurance.java100664 10677 12500110372 27633 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedPC; import javax.jdo.annotations.*; import org.apache.jdo.tck.pc.company.IMedicalInsurance; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a dental insurance carrier selection for a * particular Employee. */ @PersistenceCapable @DatastoreIdentity(strategy=IdGeneratorStrategy.IDENTITY, column="DATASTORE_IDENTITY") public class PCDSMedicalInsurance extends PCDSInsurance implements IMedicalInsurance { @NotPersistent() private String _planType; // possible values: "PPO", "EPO", "NPO" /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public PCDSMedicalInsurance() {} /** * Construct a PCDSMedicalInsurance instance. * * * @param insid The insurance instance identifier. * @param carrier The insurance carrier. * @param planType The planType. */ public PCDSMedicalInsurance(long insid, String carrier, String planType) { super(insid, carrier); this._planType = planType; } /** * Construct a PCDSMedicalInsurance instance. * * * @param insid The insurance instance identifier. * @param carrier The insurance carrier. * @param employee The employee associated with this insurance. * @param planType The planType. */ public PCDSMedicalInsurance(long insid, String carrier, PCDSEmployee employee, String planType) { super(insid, carrier, employee); this._planType = planType; } /** * Get the insurance planType. * @return The insurance planType. */ @Column(name="PLANTYPE") public String getPlanType() { return _planType; } /** * Set the insurance planType. * @param planType The insurance planType. */ public void setPlanType(String planType) { this._planType = planType; } /** * Returns a String representation of a PCDSMedicalInsurance * object. * * * @return a String representation of a PCDSMedicalInsurance * object. */ public String toString() { return "FCMedicalInsurance(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(super.getFieldRepr()); rc.append(", planType ").append(_planType); return rc.toString(); } /** * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the other Object. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { PCDSMedicalInsurance otherIns = (PCDSMedicalInsurance)other; String where = "FCMedicalInsurance<" + getInsid() + ">"; return super.deepCompareFields(otherIns, helper) & helper.equals(_planType, otherIns.getPlanType(), where + ".planType"); } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPC/PCDSPartTimeEmployee.java100664 11651 12500110372 27643 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedPC; import javax.jdo.annotations.*; import java.util.Date; import org.apache.jdo.tck.pc.company.IAddress; import org.apache.jdo.tck.pc.company.IPartTimeEmployee; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a part-time employee. */ @PersistenceCapable @Inheritance(strategy=InheritanceStrategy.SUPERCLASS_TABLE) @DatastoreIdentity(strategy=IdGeneratorStrategy.IDENTITY, column="DATASTORE_IDENTITY") public class PCDSPartTimeEmployee extends PCDSEmployee implements IPartTimeEmployee { @NotPersistent() private double _wage; /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public PCDSPartTimeEmployee() {} /** * Construct a part-time employee. * @param personid The identifier for the person. * @param first The person's first name. * @param last The person's last name. * @param middle The person's middle name. * @param born The person's birthdate. * @param hired The date the person was hired. * @param wage The person's wage. */ public PCDSPartTimeEmployee(long personid, String first, String last, String middle, Date born, Date hired, double wage ) { super(personid, first, last, middle, born, hired); this._wage = wage; } /** * Construct a part-time employee. * @param personid The identifier for the person. * @param first The person's first name. * @param last The person's last name. * @param middle The person's middle name. * @param born The person's birthdate. * @param addr The person's address. * @param hired The date the person was hired. * @param wage The person's wage. */ public PCDSPartTimeEmployee(long personid, String first, String last, String middle, Date born, IAddress addr, Date hired, double wage ) { super(personid, first, last, middle, born, (PCDSAddress)addr, hired); this._wage = wage; } /** * Get the wage of the part-time employee. * @return The wage of the part-time employee. */ @Column(name="WAGE") public double getWage() { return _wage; } /** * Set the wage of the part-time employee. * @param wage The wage of the part-time employee. */ public void setWage(double wage) { this._wage = wage; } /** * Returns a String representation of a PCDSPartTimeEmployee object. * * * @return a String representation of a PCDSPartTimeEmployee object. */ public String toString() { return "FCPartTimeEmployee(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ public String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(super.getFieldRepr()); rc.append(", $" + _wage); return rc.toString(); } /** * * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the specified * PCDSPartTimeEmployee. * * * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { PCDSPartTimeEmployee otherEmp = (PCDSPartTimeEmployee)other; String where = "FCPartTimeEmployee<" + getPersonid() + ">"; return super.deepCompareFields(otherEmp, helper) & helper.closeEnough(_wage, otherEmp.getWage(), where + ".wage"); } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPC/PCDSPerson.java100664 35751 12500110372 25673 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedPC; import javax.jdo.annotations.*; import java.io.Serializable; import java.text.SimpleDateFormat; import java.util.Collections; import java.util.Comparator; import java.util.Date; import java.util.HashMap; import java.util.Map; import org.apache.jdo.tck.pc.company.IAddress; import org.apache.jdo.tck.pc.company.IPerson; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a person. */ @PersistenceCapable(table="persons") @Inheritance(strategy=InheritanceStrategy.NEW_TABLE) @Discriminator(strategy=DiscriminatorStrategy.CLASS_NAME, column="DISCRIMINATOR", indexed="true") @DatastoreIdentity(strategy=IdGeneratorStrategy.IDENTITY, column="DATASTORE_IDENTITY") public class PCDSPerson implements IPerson, Serializable, Comparable, Comparator, DeepEquality { @NotPersistent() private long _personid; @NotPersistent() private String _firstname; @NotPersistent() private String _lastname; @NotPersistent() private String _middlename; @NotPersistent() private Date _birthdate; @NotPersistent() private PCDSAddress _address; @NotPersistent() private Map _phoneNumbers = new HashMap(); protected static SimpleDateFormat formatter = new SimpleDateFormat("d/MMM/yyyy"); /** This is the JDO-required no-args constructor. */ protected PCDSPerson() {} /** * Construct a PCDSPerson instance. * * * @param personid The person identifier. * @param firstname The person's first name. * @param lastname The person's last name. * @param middlename The person's middle name. * @param birthdate The person's birthdate. */ public PCDSPerson(long personid, String firstname, String lastname, String middlename, Date birthdate) { this._personid = personid; this._firstname = firstname; this._lastname = lastname; this._middlename = middlename; this._birthdate = birthdate; } /** * Construct a PCDSPerson instance. * * * @param personid The person identifier. * @param firstname The person's first name. * @param lastname The person's last name. * @param middlename The person's middle name. * @param birthdate The person's birthdate. * @param address The person's address. */ public PCDSPerson(long personid, String firstname, String lastname, String middlename, Date birthdate, IAddress address) { this(personid, firstname, lastname, middlename, birthdate); this._address = (PCDSAddress)address; } /** * Set the id associated with this object. * @param id the id. */ public void setPersonid(long id) { this._personid = id; } /** * Get the person's id. * @return The personid. */ @Column(name="PERSONID") public long getPersonid() { return _personid; } /** * Get the person's last name. * @return The last name. */ @Column(name="LASTNAME") public String getLastname() { return _lastname; } /** * Set the person's last name. * @param lastname The last name. */ public void setLastname(String lastname) { this._lastname = lastname; } /** * Get the person's first name. * @return The first name. */ @Column(name="FIRSTNAME") public String getFirstname() { return _firstname; } /** * Set the person's first name. * @param firstname The first name. */ public void setFirstname(String firstname) { this._firstname = firstname; } /** * Get the person's middle name. * @return The middle name. */ @Persistent(defaultFetchGroup="false") @Column(name="MIDDLENAME", allowsNull="true") public String getMiddlename() { return _middlename; } /** * Set the person's middle name. * @param middlename The middle name. */ public void setMiddlename(String middlename) { this._middlename = middlename; } /** * Get the address. * @return The address. */ @Persistent(persistenceModifier=PersistenceModifier.PERSISTENT, types=org.apache.jdo.tck.pc.companyAnnotatedPC.PCDSAddress.class) @Embedded(nullIndicatorColumn="COUNTRY", members={ @Persistent(name="addrid", columns=@Column(name="ADDRID")), @Persistent(name="street", columns=@Column(name="STREET")), @Persistent(name="city", columns=@Column(name="CITY")), @Persistent(name="state", columns=@Column(name="STATE")), @Persistent(name="zipcode", columns=@Column(name="ZIPCODE")), @Persistent(name="country", columns=@Column(name="COUNTRY")) }) public IAddress getAddress() { return _address; } /** * Set the address. * @param address The address. */ public void setAddress(IAddress address) { this._address = (PCDSAddress)address; } /** * Get the person's birthdate. * @return The person's birthdate. */ @Column(name="BIRTHDATE") public Date getBirthdate() { return _birthdate; } /** * Set the person's birthdate. * @param birthdate The person's birthdate. */ public void setBirthdate(Date birthdate) { this._birthdate = birthdate; } /** * Get the map of phone numbers as an unmodifiable map. * @return The map of phone numbers, as an unmodifiable map. */ // maps phone number types ("home", "work", "mobile", etc.) // to phone numbers specified as String @Persistent(table="employee_phoneno_type") @Join(column="EMPID") @Key(types=java.lang.String.class, column="TYPE") @Value(types=java.lang.String.class, column="PHONENO") public Map getPhoneNumbers() { return _phoneNumbers; } /** * Get the phone number for the specified phone number type. * @param type The phone number type ("home", "work", "mobile", etc.). * @return The phone number associated with specified type, or * null if there was no phone number for the type. */ public String getPhoneNumber(String type) { return (String)_phoneNumbers.get(type); } /** * Associates the specified phone number with the specified type in the * map of phone numbers of this person. * @param type The phone number type ("home", "work", "mobile", etc.). * @param phoneNumber The phone number * @return The previous phone number associated with specified type, or * null if there was no phone number for the type. */ public String putPhoneNumber(String type, String phoneNumber) { return (String)_phoneNumbers.put(type, phoneNumber); } /** * Remove a phoneNumber from the map of phone numbers. * @param type The phone number type ("home", "work", "mobile", etc.). * @return The previous phone number associated with specified type, or * null if there was no phone number for the type. */ public String removePhoneNumber(String type) { return (String)_phoneNumbers.remove(type); } /** * Set the phoneNumber map to be in this person. * @param phoneNumbers The map of phoneNumbers for this person. */ public void setPhoneNumbers(Map phoneNumbers) { // workaround: create a new HashMap, because fostore does not // support LinkedHashMap this._phoneNumbers = (phoneNumbers != null) ? new HashMap(phoneNumbers) : null; } /** * Returns a String representation of a PCDSPerson object. * * * @return a string representation of a PCDSPerson object. */ public String toString() { return "FCPerson(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(_personid); rc.append(", ").append(_lastname); rc.append(", ").append(_firstname); rc.append(", born ").append( _birthdate==null ? "null" : formatter.format(_birthdate)); rc.append(", phone ").append(_phoneNumbers); return rc.toString(); } /** * * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the specified PCDSPerson. * * * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { PCDSPerson otherPerson = (PCDSPerson)other; String where = "FCPerson<" + _personid + ">"; return helper.equals(_personid, otherPerson.getPersonid(), where + ".personid") & helper.equals(_firstname, otherPerson.getFirstname(), where + ".firstname") & helper.equals(_lastname, otherPerson.getLastname(), where + ".lastname") & 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"); } /** * Compares this object with the specified object for order. Returns a * negative integer, zero, or a positive integer as this object is less * than, equal to, or greater than the specified object. * @param o The Object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified object. * @throws ClassCastException - if the specified object's type prevents * it from being compared to this Object. */ public int compareTo(Object o) { return compareTo((PCDSPerson)o); } /** * Compare two instances. This is a method in Comparator. */ public int compare(Object o1, Object o2) { return compare((PCDSPerson)o1, (PCDSPerson)o2); } /** * * Compares this object with the specified PCDSPerson object for * order. Returns a negative integer, zero, or a positive integer as * this object is less than, equal to, or greater than the specified * object. * * * @param other The PCDSPerson object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified PCDSPerson * object. */ public int compareTo(PCDSPerson other) { return compare(this, other); } /** * Compares its two IPerson arguments for order. Returns a negative * integer, zero, or a positive integer as the first argument is less * than, equal to, or greater than the second. * @param o1 the first IPerson object to be compared. * @param o2 the second IPerson object to be compared. * @return a negative integer, zero, or a positive integer as the first * object is less than, equal to, or greater than the second object. */ public static int compare(PCDSPerson o1, PCDSPerson o2) { return EqualityHelper.compare(o1.getPersonid(), o2.getPersonid()); } /** * Indicates whether some other object is "equal to" this one. * @param obj the object with which to compare. * @return true if this object is the same as the obj * argument; false otherwise. */ public boolean equals(Object obj) { if (obj instanceof PCDSPerson) { return compareTo((PCDSPerson)obj) == 0; } return false; } /** * Returns a hash code value for the object. * @return a hash code value for this object. */ public int hashCode() { return (int)_personid; } /** * This class is used to represent the application identifier * for the Person class. */ public static class Oid implements Serializable, Comparable { /** * This field represents the identifier for the Person * class. It must match a field in the Person class in * both name and type. */ public long personid; /** * The required public no-arg constructor. */ public Oid() { } /** * Initialize the identifier. * @param personid The person identifier. */ public Oid(long personid) { this.personid = personid; } public Oid(String s) { personid = Long.parseLong(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + personid;} /** */ public boolean equals(java.lang.Object obj) { if( obj==null || !this.getClass().equals(obj.getClass()) ) return( false ); Oid o = (Oid) obj; if( this.personid != o.personid ) return( false ); return( true ); } /** */ public int hashCode() { return( (int) personid ); } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } /** */ public int compareTo(Object obj) { // may throw ClassCastException which the user must handle Oid other = (Oid) obj; if( personid < other.personid ) return -1; if( personid > other.personid ) return 1; return 0; } } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPC/PCDSProject.java100664 30505 12500110372 26023 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedPC; import javax.jdo.annotations.*; import java.io.Serializable; import java.io.ObjectInputStream; import java.io.IOException; import java.util.Collections; import java.util.Comparator; import java.util.Set; import java.util.HashSet; import java.math.BigDecimal; import org.apache.jdo.tck.pc.company.IProject; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a project, a budgeted task with one or more * employees working on it. */ @PersistenceCapable(table="projects") @Inheritance(strategy=InheritanceStrategy.NEW_TABLE) @Discriminator(strategy=DiscriminatorStrategy.CLASS_NAME, column="DISCRIMINATOR") @DatastoreIdentity(strategy=IdGeneratorStrategy.IDENTITY, column="DATASTORE_IDENTITY") public class PCDSProject implements IProject, Serializable, Comparable, Comparator, DeepEquality { @NotPersistent() private long _projid; @NotPersistent() private String _name; @NotPersistent() private BigDecimal _budget; @NotPersistent() private transient Set _reviewers = new HashSet(); @NotPersistent() private transient Set _members = new HashSet(); /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public PCDSProject() {} /** * Initialize a project. * @param projid The project identifier. * @param name The name of the project. * @param budget The budget for the project. */ public PCDSProject(long projid, String name, BigDecimal budget) { this._projid = projid; this._name = name; this._budget = budget; } /** * Set the id associated with this object. * @param id the id. */ public void setProjid(long id) { this._projid = id; } /** * Get the project ID. * @return The project ID. */ @Column(name="PROJID") public long getProjid() { return _projid; } /** * Get the name of the project. * @return The name of the project. */ @Column(name="NAME") public String getName() { return _name; } /** * Set the name of the project. * @param name The name of the project. */ public void setName(String name) { this._name = name; } /** * Get the project's budget. * @return The project's budget. */ @Column(name="BUDGET", jdbcType="DECIMAL", length=11, scale=2) public BigDecimal getBudget() { return _budget; } /** * Set the project's budget. * @param budget The project's budget. */ public void setBudget(BigDecimal budget) { this._budget = budget; } /** * Get the reviewers associated with this project. */ @Persistent(table="project_reviewer") @Element(types=org.apache.jdo.tck.pc.companyAnnotatedPC.PCDSEmployee.class, column="REVIEWER", foreignKey="PR_REV_FK") @Join(column="PROJID", foreignKey="PR_PROJ_FK") public Set getReviewers() { return _reviewers; } /** * Add a reviewer to the project. * @param emp The employee to add as a reviewer. */ public void addReviewer(PCDSEmployee emp) { _reviewers.add(emp); } /** * Remove a reviewer from the project. * @param emp The employee to remove as a reviewer of this project. */ public void removeReviewer(PCDSEmployee emp) { _reviewers.remove(emp); } /** * Set the reviewers associated with this project. * @param reviewers The set of reviewers to associate with this project. */ public void setReviewers(Set reviewers) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this._reviewers = (reviewers != null) ? new HashSet(reviewers) : null; } /** * Get the project members. * * * @return The members of the project is returned as a * set of PCDSEmployees. */ @Persistent(table="project_member") @Element(types=org.apache.jdo.tck.pc.companyAnnotatedPC.PCDSEmployee.class, column="MEMBER", foreignKey="PR_MEMB_FK") @Join(column="PROJID", foreignKey="PR_PROJ_FK") public Set getMembers() { return _members; } /** * Add a new member to the project. * @param emp The employee to add to the project. */ public void addMember(PCDSEmployee emp) { _members.add(emp); } /** * Remove a member from the project. * @param emp The employee to remove from the project. */ public void removeMember(PCDSEmployee emp) { _members.remove(emp); } /** * Set the members of the project. * @param employees The set of employees to be the members of this * project. */ public void setMembers(Set employees) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this._members = (employees != null) ? new HashSet(employees) : null; } /** Serialization support: initialize transient fields. */ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); _reviewers = new HashSet(); _members = new HashSet(); } /** * Returns a String representation of a PCDSProject object. * * * @return a String representation of a PCDSProject object. */ public String toString() { return "FCProject(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(_projid); rc.append(", name ").append(_name); rc.append(", budget ").append(_budget); return rc.toString(); } /** * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the specified Person. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { PCDSProject otherProject = (PCDSProject)other; String where = "FCProject<" + _projid + ">"; return helper.equals(_projid, otherProject.getProjid(), where + ".projid") & helper.equals(_name, otherProject.getName(), where + ".name") & helper.equals(_budget, otherProject.getBudget(), where + ".budget") & helper.deepEquals(_reviewers, otherProject.getReviewers(), where + ".reviewers") & helper.deepEquals(_members, otherProject.getMembers(), where + ".members"); } /** * Compares this object with the specified object for order. Returns a * negative integer, zero, or a positive integer as this object is less * than, equal to, or greater than the specified object. * @param o The Object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified object. * @throws ClassCastException - if the specified object's type prevents * it from being compared to this Object. */ public int compareTo(Object o) { return compareTo((PCDSProject)o); } /** * Compare two instances. This is a method in Comparator. */ public int compare(Object o1, Object o2) { return compare((PCDSProject)o1, (PCDSProject)o2); } /** * * Compares this object with the specified PCDSProject object for * order. Returns a negative integer, zero, or a positive integer as * this object is less than, equal to, or greater than the specified * object. * * * @param other The PCDSProject object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified PCDSProject object. */ public int compareTo(PCDSProject other) { return compare(this, other); } /** * Compares its two IProject arguments for order. Returns a negative * integer, zero, or a positive integer as the first argument is less * than, equal to, or greater than the second. * @param o1 the first IProject object to be compared. * @param o2 the second IProject object to be compared. * @return a negative integer, zero, or a positive integer as the first * object is less than, equal to, or greater than the second object. */ public static int compare(PCDSProject o1, PCDSProject o2) { return EqualityHelper.compare(o1.getProjid(), o2.getProjid()); } /** * Indicates whether some other object is "equal to" this one. * @param obj the object with which to compare. * @return true if this object is the same as the obj * argument; false otherwise. */ public boolean equals(Object obj) { if (obj instanceof PCDSProject) { return compareTo((PCDSProject)obj) == 0; } return false; } /** * Returns a hash code value for the object. * @return a hash code value for this object. */ public int hashCode() { return (int)_projid; } /** * This class is used to represent the application identity * for the PCDSProject class. */ public static class Oid implements Serializable, Comparable { /** * This field represents the identifier for the * PCDSProject class. It must match a field in the * PCDSProject class in both name and type. */ public long projid; /** * The required public no-arg constructor. */ public Oid() { } /** * Initialize the application identifier with a project ID. * @param projid The id of the project. */ public Oid(long projid) { this.projid = projid; } public Oid(String s) { projid = Long.parseLong(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + projid;} /** */ public boolean equals(java.lang.Object obj) { if( obj==null || !this.getClass().equals(obj.getClass()) ) return( false ); Oid o = (Oid) obj; if( this.projid != o.projid ) return( false ); return( true ); } /** */ public int hashCode() { return( (int) projid ); } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } /** */ public int compareTo(Object obj) { // may throw ClassCastException which the user must handle Oid other = (Oid) obj; if( projid < other.projid ) return -1; if( projid > other.projid ) return 1; return 0; } } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPI/CompanyFactoryAnnotatedPIAppPM.java100664 5516 12500110372 31660 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedPI; import javax.jdo.PersistenceManager; import org.apache.jdo.tck.pc.company.*; /* * CompanyFactoryAnnotatedPMFieldClass.java * * This class uses the PersistenceManager.newInstance method with the concrete * class as a parameter. */ public class CompanyFactoryAnnotatedPIAppPM implements CompanyFactoryNewInstance { PersistenceManager pm = null; /** * Creates a new instance of CompanyFactoryAnnotatedPMFieldClass */ public CompanyFactoryAnnotatedPIAppPM(PersistenceManager pm) { this.pm = pm; } public Class[] getTearDownClasses() { return new Class[] { PIAppDentalInsurance.class, PIAppMedicalInsurance.class, PIAppPartTimeEmployee.class, PIAppFullTimeEmployee.class, PIAppProject.class, PIAppDepartment.class, PIAppCompany.class, PIAppAddress.class }; } public IAddress newAddress() { return (IAddress)pm.newInstance(PIAppAddress.class); } public IMeetingRoom newMeetingRoom() { return (IMeetingRoom)null; } public ICompany newCompany() { return (ICompany)pm.newInstance(PIAppCompany.class); } public IDentalInsurance newDentalInsurance() { return (IDentalInsurance)pm.newInstance(PIAppDentalInsurance.class); } public IDepartment newDepartment() { return (IDepartment)pm.newInstance(PIAppDepartment.class); } public IFullTimeEmployee newFullTimeEmployee() { return (IFullTimeEmployee)pm.newInstance(PIAppFullTimeEmployee.class); } public IMedicalInsurance newMedicalInsurance() { return (IMedicalInsurance)pm.newInstance(PIAppMedicalInsurance.class); } public IPartTimeEmployee newPartTimeEmployee() { return (IPartTimeEmployee)pm.newInstance(PIAppPartTimeEmployee.class); } public IProject newProject() { return (IProject)pm.newInstance(PIAppProject.class); } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPI/CompanyFactoryAnnotatedPIDSPM.java100664 5466 12500110372 31452 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedPI; import javax.jdo.PersistenceManager; import org.apache.jdo.tck.pc.company.*; /* * CompanyFactoryAnnotatedPIDSPM.java * * This class uses the PersistenceManager.newInstance method with the concrete * class as a parameter. */ public class CompanyFactoryAnnotatedPIDSPM implements CompanyFactoryNewInstance { PersistenceManager pm = null; /** * Creates a new instance of CompanyFactoryAnnotatedPMFieldClass */ public CompanyFactoryAnnotatedPIDSPM(PersistenceManager pm) { this.pm = pm; } public Class[] getTearDownClasses() { return new Class[] { PIDSDentalInsurance.class, PIDSMedicalInsurance.class, PIDSPartTimeEmployee.class, PIDSFullTimeEmployee.class, PIDSProject.class, PIDSDepartment.class, PIDSCompany.class, PIDSAddress.class }; } public IAddress newAddress() { return (IAddress)pm.newInstance(PIDSAddress.class); } public IMeetingRoom newMeetingRoom() { return (IMeetingRoom)null; } public ICompany newCompany() { return (ICompany)pm.newInstance(PIDSCompany.class); } public IDentalInsurance newDentalInsurance() { return (IDentalInsurance)pm.newInstance(PIDSDentalInsurance.class); } public IDepartment newDepartment() { return (IDepartment)pm.newInstance(PIDSDepartment.class); } public IFullTimeEmployee newFullTimeEmployee() { return (IFullTimeEmployee)pm.newInstance(PIDSFullTimeEmployee.class); } public IMedicalInsurance newMedicalInsurance() { return (IMedicalInsurance)pm.newInstance(PIDSMedicalInsurance.class); } public IPartTimeEmployee newPartTimeEmployee() { return (IPartTimeEmployee)pm.newInstance(PIDSPartTimeEmployee.class); } public IProject newProject() { return (IProject)pm.newInstance(PIDSProject.class); } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPI/CompanyFactoryAnnotatedPIPMDelegator.java100664 3107 12500110372 33040 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedPI; import javax.jdo.PersistenceManager; import org.apache.jdo.tck.pc.company.CompanyFactoryAnnotatedAbstractDelegator; /* * CompanyFactoryAnnotatedPMFieldClass.java * * This class uses the PersistenceManager.newInstance method with the concrete * class as a parameter. */ public class CompanyFactoryAnnotatedPIPMDelegator extends CompanyFactoryAnnotatedAbstractDelegator { /** * Creates a new instance of CompanyFactory */ public CompanyFactoryAnnotatedPIPMDelegator(PersistenceManager pm) { super(pm); if (isAppIdentity){ delegate = new CompanyFactoryAnnotatedPIAppPM(pm); } else { //datastoreidentity delegate = new CompanyFactoryAnnotatedPIDSPM(pm); } } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPI/CompanyFactoryAnnotatedPMInterface.java100664 11455 12500110372 32626 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedPI; import javax.jdo.PersistenceManager; import org.apache.jdo.tck.pc.company.*; /* * CompanyFactoryAnnotatedPMInterface.java * */ public class CompanyFactoryAnnotatedPMInterface extends CompanyFactoryAbstractImpl { Class addressClass = null; Class dentalInsuranceClass = null; Class medicalInsuranceClass = null; Class partTimeEmployeeClass = null; Class fullTimeEmployeeClass = null; Class projectClass = null; Class departmentClass = null; Class companyClass = null; /** */ public final Class[] tearDownClasses = new Class[] { dentalInsuranceClass, medicalInsuranceClass, partTimeEmployeeClass, fullTimeEmployeeClass, projectClass, departmentClass, companyClass }; /** * Creates a new instance of CompanyFactoryAnnotatedPMInterface */ public CompanyFactoryAnnotatedPMInterface(PersistenceManager pm) { super(pm); if (isAppIdentity){ addressClass = org.apache.jdo.tck.pc.companyAnnotatedPI.PIAppAddress.class; dentalInsuranceClass = org.apache.jdo.tck.pc.companyAnnotatedPI.PIAppDentalInsurance.class; medicalInsuranceClass = org.apache.jdo.tck.pc.companyAnnotatedPI.PIAppMedicalInsurance.class; partTimeEmployeeClass = org.apache.jdo.tck.pc.companyAnnotatedPI.PIAppPartTimeEmployee.class; fullTimeEmployeeClass = org.apache.jdo.tck.pc.companyAnnotatedPI.PIAppFullTimeEmployee.class; projectClass = org.apache.jdo.tck.pc.companyAnnotatedPI.PIAppProject.class; departmentClass = org.apache.jdo.tck.pc.companyAnnotatedPI.PIAppDepartment.class; companyClass = org.apache.jdo.tck.pc.companyAnnotatedPI.PIAppCompany.class; } else { //datastoreidentity addressClass = org.apache.jdo.tck.pc.companyAnnotatedPI.PIDSAddress.class; dentalInsuranceClass = org.apache.jdo.tck.pc.companyAnnotatedPI.PIDSDentalInsurance.class; medicalInsuranceClass = org.apache.jdo.tck.pc.companyAnnotatedPI.PIDSMedicalInsurance.class; partTimeEmployeeClass = org.apache.jdo.tck.pc.companyAnnotatedPI.PIDSPartTimeEmployee.class; fullTimeEmployeeClass = org.apache.jdo.tck.pc.companyAnnotatedPI.PIDSFullTimeEmployee.class; projectClass = org.apache.jdo.tck.pc.companyAnnotatedPI.PIDSProject.class; departmentClass = org.apache.jdo.tck.pc.companyAnnotatedPI.PIDSDepartment.class; companyClass = org.apache.jdo.tck.pc.companyAnnotatedPI.PIDSCompany.class; } } public IAddress newAddress() { return (IAddress)pm.newInstance(addressClass); } public IMeetingRoom newMeetingRoom() { return (IMeetingRoom)null; } public ICompany newCompany() { return (ICompany)pm.newInstance(companyClass); } public IDentalInsurance newDentalInsurance() { return (IDentalInsurance)pm.newInstance(dentalInsuranceClass); } public IDepartment newDepartment() { return (IDepartment)pm.newInstance(departmentClass); } public IFullTimeEmployee newFullTimeEmployee() { return (IFullTimeEmployee)pm.newInstance(fullTimeEmployeeClass); } public IMedicalInsurance newMedicalInsurance() { return (IMedicalInsurance)pm.newInstance(medicalInsuranceClass); } public IPartTimeEmployee newPartTimeEmployee() { return (IPartTimeEmployee)pm.newInstance(partTimeEmployeeClass); } public IProject newProject() { return (IProject)pm.newInstance(projectClass); } public Class[] getTearDownClasses() { return tearDownClasses; } } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPI/PIAppAddress.java100664 3117 12500110372 26207 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedPI; import javax.jdo.annotations.*; import org.apache.jdo.tck.pc.company.IAddress; /** * This interface represents the persistent state of Address. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ @PersistenceCapable(embeddedOnly="true", requiresExtent="false") public interface PIAppAddress extends IAddress { @Persistent(primaryKey="true") long getAddrid(); String getStreet(); String getCity(); String getState(); String getZipcode(); String getCountry(); void setAddrid(long addrid); void setStreet(String street); void setCity(String city); void setState(String state); void setZipcode(String zipcode); void setCountry(String country); } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPI/PIAppCompany.java100664 5037 12500110372 26233 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedPI; import javax.jdo.annotations.*; import org.apache.jdo.tck.pc.company.ICompany; import java.util.Date; import java.util.Set; import org.apache.jdo.tck.pc.company.IAddress; /** * This interface represents the persistent state of Company. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ @PersistenceCapable(identityType=IdentityType.APPLICATION, table="companies") @Inheritance(strategy=InheritanceStrategy.NEW_TABLE) @Discriminator(strategy=DiscriminatorStrategy.CLASS_NAME, column="DISCRIMINATOR") public interface PIAppCompany extends ICompany { @Persistent(types=org.apache.jdo.tck.pc.companyAnnotatedPI.PIAppAddress.class) @Embedded(nullIndicatorColumn="COUNTRY", members={ @Persistent(name="addrid", columns=@Column(name="ADDRID")), @Persistent(name="street", columns=@Column(name="STREET")), @Persistent(name="city", columns=@Column(name="CITY")), @Persistent(name="state", columns=@Column(name="STATE")), @Persistent(name="zipcode", columns=@Column(name="ZIPCODE")), @Persistent(name="country", columns=@Column(name="COUNTRY")) }) IAddress getAddress(); @PrimaryKey @Column(name="ID") long getCompanyid(); @Persistent(mappedBy="company") @Element(types=org.apache.jdo.tck.pc.companyAnnotatedPI.PIAppDepartment.class) Set getDepartments(); @Column(name="FOUNDEDDATE") Date getFounded(); @Column(name="NAME", jdbcType="VARCHAR") String getName(); void setAddress(IAddress a); void setCompanyid(long id); void setDepartments(Set depts); void setFounded(Date date); void setName(String string); } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPI/PIAppDentalInsurance.java100664 2664 12500110372 27707 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedPI; import javax.jdo.annotations.*; import java.math.BigDecimal; import org.apache.jdo.tck.pc.company.IDentalInsurance; /** * This interface represents the persistent state of DentalInsurance. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ @PersistenceCapable(identityType=IdentityType.APPLICATION) public interface PIAppDentalInsurance extends IDentalInsurance, PIAppInsurance { @Column(name="LIFETIME_ORTHO_BENEFIT") BigDecimal getLifetimeOrthoBenefit(); void setLifetimeOrthoBenefit(BigDecimal lifetimeOrthoBenefit); } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPI/PIAppDepartment.java100664 5063 12500110372 26727 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedPI; import javax.jdo.annotations.*; import java.util.Set; import org.apache.jdo.tck.pc.company.ICompany; import org.apache.jdo.tck.pc.company.IDepartment; import org.apache.jdo.tck.pc.company.IEmployee; /** * This interface represents the persistent state of Department. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ @PersistenceCapable(identityType=IdentityType.APPLICATION, table="departments") @Inheritance(strategy=InheritanceStrategy.NEW_TABLE) @Discriminator(strategy=DiscriminatorStrategy.CLASS_NAME, column="DISCRIMINATOR") public interface PIAppDepartment extends IDepartment { @Persistent(primaryKey="true") @Column(name="ID") long getDeptid(); @Column(name="NAME") String getName(); @Persistent(types=org.apache.jdo.tck.pc.companyAnnotatedPI.PIAppCompany.class) @Column(name="COMPANYID") ICompany getCompany(); @Persistent(types=org.apache.jdo.tck.pc.companyAnnotatedPI.PIAppEmployee.class) @Column(name="EMP_OF_THE_MONTH") IEmployee getEmployeeOfTheMonth(); @Persistent(persistenceModifier=PersistenceModifier.PERSISTENT, mappedBy="department") @Element(types=org.apache.jdo.tck.pc.companyAnnotatedPI.PIAppEmployee.class) Set getEmployees(); @Persistent(persistenceModifier=PersistenceModifier.PERSISTENT, mappedBy="fundingDept") @Element(types=org.apache.jdo.tck.pc.companyAnnotatedPI.PIAppEmployee.class) Set getFundedEmps(); void setDeptid(long deptid); void setName(String name); void setCompany(ICompany company); void setEmployeeOfTheMonth(IEmployee employeeOfTheMonth); void setEmployees(Set employees); void setFundedEmps(Set employees); } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPI/PIAppEmployee.java100664 10270 12500110372 26417 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedPI; import javax.jdo.annotations.*; import org.apache.jdo.tck.pc.company.IPerson; import java.util.Date; import java.util.Set; import org.apache.jdo.tck.pc.company.IDentalInsurance; import org.apache.jdo.tck.pc.company.IDepartment; import org.apache.jdo.tck.pc.company.IEmployee; import org.apache.jdo.tck.pc.company.IMedicalInsurance; /** * This interface represents the persistent state of Employee. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ @PersistenceCapable(identityType=IdentityType.APPLICATION) @Inheritance(strategy=InheritanceStrategy.SUPERCLASS_TABLE) public interface PIAppEmployee extends PIAppPerson, IPerson { @Column(name="HIREDATE") Date getHiredate(); @Column(name="WEEKLYHOURS") double getWeeklyhours(); @Persistent(persistenceModifier=PersistenceModifier.PERSISTENT, mappedBy="reviewers") @Element(types=org.apache.jdo.tck.pc.companyAnnotatedPI.PIAppProject.class) Set getReviewedProjects(); @Persistent(persistenceModifier=PersistenceModifier.PERSISTENT, mappedBy="members") @Element(types=org.apache.jdo.tck.pc.companyAnnotatedPI.PIAppProject.class) Set getProjects(); @Persistent(mappedBy="employee", types=org.apache.jdo.tck.pc.companyAnnotatedPI.PIAppDentalInsurance.class) IDentalInsurance getDentalInsurance(); @Persistent(mappedBy="employee", types=org.apache.jdo.tck.pc.companyAnnotatedPI.PIAppMedicalInsurance.class) IMedicalInsurance getMedicalInsurance(); @Persistent(types=org.apache.jdo.tck.pc.companyAnnotatedPI.PIAppDepartment.class) @Column(name="DEPARTMENT") IDepartment getDepartment(); @Persistent(types=org.apache.jdo.tck.pc.companyAnnotatedPI.PIAppDepartment.class) @Column(name="FUNDINGDEPT") IDepartment getFundingDept(); @Persistent(types=org.apache.jdo.tck.pc.companyAnnotatedPI.PIAppEmployee.class) @Column(name="MANAGER") IEmployee getManager(); @Persistent(persistenceModifier=PersistenceModifier.PERSISTENT, mappedBy="manager") @Element(types=org.apache.jdo.tck.pc.companyAnnotatedPI.PIAppEmployee.class) Set getTeam(); @Persistent(types=org.apache.jdo.tck.pc.companyAnnotatedPI.PIAppEmployee.class) @Column(name="MENTOR") IEmployee getMentor(); @Persistent(mappedBy="mentor", types=org.apache.jdo.tck.pc.companyAnnotatedPI.PIAppEmployee.class) IEmployee getProtege(); @Persistent(types=org.apache.jdo.tck.pc.companyAnnotatedPI.PIAppEmployee.class) @Column(name="HRADVISOR") IEmployee getHradvisor(); @Persistent(mappedBy="hradvisor", persistenceModifier=PersistenceModifier.PERSISTENT) @Element(types=org.apache.jdo.tck.pc.companyAnnotatedPI.PIAppEmployee.class) Set getHradvisees(); void setHiredate(Date hiredate); void setWeeklyhours(double weeklyhours); void setReviewedProjects(Set reviewedProjects); void setProjects(Set projects); void setDentalInsurance(IDentalInsurance dentalInsurance); void setMedicalInsurance(IMedicalInsurance medicalInsurance); void setDepartment(IDepartment department); void setFundingDept(IDepartment department); void setManager(IEmployee manager); void setTeam(Set team); void setMentor(IEmployee mentor); void setProtege(IEmployee protege); void setHradvisor(IEmployee hradvisor); void setHradvisees(Set hradvisees); } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPI/PIAppFullTimeEmployee.java100664 2613 12500110372 30043 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedPI; import org.apache.jdo.tck.pc.company.IFullTimeEmployee; import javax.jdo.annotations.*; /** * This interface represents the persistent state of FullTimeEmployee. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ @PersistenceCapable(identityType=IdentityType.APPLICATION) @Inheritance(strategy=InheritanceStrategy.SUPERCLASS_TABLE) public interface PIAppFullTimeEmployee extends PIAppEmployee, IFullTimeEmployee { @Column(name="SALARY") double getSalary(); void setSalary(double salary); } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPI/PIAppInsurance.java100664 3643 12500110372 26555 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedPI; import javax.jdo.annotations.*; import org.apache.jdo.tck.pc.company.IEmployee; import org.apache.jdo.tck.pc.company.IInsurance; /** * This interface represents the persistent state of Insurance. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ @PersistenceCapable(identityType=IdentityType.APPLICATION,table="insuranceplans") @Inheritance(strategy=InheritanceStrategy.NEW_TABLE) @Discriminator(strategy=DiscriminatorStrategy.CLASS_NAME, column="DISCRIMINATOR", indexed="true") @Index(name="INS_DISCRIMINATOR_INDEX", unique="false", columns=@Column(name="DISCRIMINATOR")) public interface PIAppInsurance extends IInsurance { @Persistent(primaryKey="true") @Column(name="INSID") long getInsid(); @Column(name="CARRIER") String getCarrier(); @Persistent(types=org.apache.jdo.tck.pc.companyAnnotatedPI.PIAppEmployee.class) @Column(name="EMPLOYEE") IEmployee getEmployee(); void setInsid(long insid); void setCarrier(String carrier); void setEmployee(IEmployee employee); } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPI/PIAppMedicalInsurance.java100664 2541 12500110372 30030 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedPI; import javax.jdo.annotations.*; import org.apache.jdo.tck.pc.company.IMedicalInsurance; /** * This interface represents the persistent state of MedicalInsurance. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ @PersistenceCapable(identityType=IdentityType.APPLICATION) public interface PIAppMedicalInsurance extends PIAppInsurance, IMedicalInsurance{ @Column(name="PLANTYPE") String getPlanType(); void setPlanType(String planType); } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPI/PIAppPartTimeEmployee.java100664 2602 12500110372 30045 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedPI; import org.apache.jdo.tck.pc.company.IPartTimeEmployee; import javax.jdo.annotations.*; /** * This interface represents the persistent state of PartTimeEmployee. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ @PersistenceCapable(identityType=IdentityType.APPLICATION) @Inheritance(strategy=InheritanceStrategy.SUPERCLASS_TABLE) public interface PIAppPartTimeEmployee extends PIAppEmployee, IPartTimeEmployee { @Column(name="WAGE") double getWage(); void setWage(double wage); } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPI/PIAppPerson.java100664 6035 12500110372 26072 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedPI; import javax.jdo.annotations.*; import java.util.Date; import java.util.Map; import org.apache.jdo.tck.pc.company.IAddress; import org.apache.jdo.tck.pc.company.IPerson; /** * This interface represents the persistent state of Person. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ @PersistenceCapable(identityType=IdentityType.APPLICATION,table="persons") @Inheritance(strategy=InheritanceStrategy.NEW_TABLE) @Discriminator(strategy=DiscriminatorStrategy.CLASS_NAME, column="DISCRIMINATOR", indexed="true") public interface PIAppPerson extends IPerson { @Persistent(primaryKey="true") @Column(name="PERSONID") long getPersonid(); @Column(name="LASTNAME") String getLastname(); @Column(name="FIRSTNAME") String getFirstname(); @Persistent(defaultFetchGroup="false") @Column(name="MIDDLENAME", allowsNull="true") String getMiddlename(); @Persistent(persistenceModifier=PersistenceModifier.PERSISTENT, types=org.apache.jdo.tck.pc.companyAnnotatedPI.PIAppAddress.class) @Embedded(nullIndicatorColumn="COUNTRY", members={ @Persistent(name="addrid", columns=@Column(name="ADDRID")), @Persistent(name="street", columns=@Column(name="STREET")), @Persistent(name="city", columns=@Column(name="CITY")), @Persistent(name="state", columns=@Column(name="STATE")), @Persistent(name="zipcode", columns=@Column(name="ZIPCODE")), @Persistent(name="country", columns=@Column(name="COUNTRY")) }) IAddress getAddress(); @Column(name="BIRTHDATE") Date getBirthdate(); @Persistent(persistenceModifier=PersistenceModifier.PERSISTENT, table="employee_phoneno_type") @Join(column="EMPID") @Key(types=java.lang.String.class, column="TYPE") @Value(types=java.lang.String.class, column="PHONENO") Map getPhoneNumbers(); void setPersonid(long personid); void setLastname(String lastname); void setFirstname(String firstname); void setMiddlename(String middlename); void setAddress(IAddress address); void setBirthdate(Date birthdate); void setPhoneNumbers(Map phoneNumbers); } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPI/PIAppProject.java100664 4425 12500110372 26233 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedPI; import javax.jdo.annotations.*; import java.math.BigDecimal; import java.util.Set; import org.apache.jdo.tck.pc.company.IProject; /** * This interface represents the persistent state of Project. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ @PersistenceCapable(identityType=IdentityType.APPLICATION,table="projects") @Inheritance(strategy=InheritanceStrategy.NEW_TABLE) @Discriminator(strategy=DiscriminatorStrategy.CLASS_NAME, column="DISCRIMINATOR") public interface PIAppProject extends IProject { @PrimaryKey @Column(name="PROJID") long getProjid(); @Column(name="NAME") String getName(); @Column(name="BUDGET", jdbcType="DECIMAL", length=11, scale=2) BigDecimal getBudget(); @Persistent(table="project_reviewer") @Element(types=org.apache.jdo.tck.pc.companyAnnotatedPI.PIAppEmployee.class, column="REVIEWER", foreignKey="PR_REV_FK") @Join(column="PROJID", foreignKey="PR_PROJ_FK") Set getReviewers(); @Persistent(table="project_member") @Element(types=org.apache.jdo.tck.pc.companyAnnotatedPI.PIAppEmployee.class, column="MEMBER", foreignKey="PM_MEMB_FK") @Join(column="PROJID", foreignKey="PM_PROJ_FK") Set getMembers(); void setProjid(long projid); void setName(String name); void setBudget(BigDecimal budget); void setReviewers(Set reviewers); void setMembers(Set employees); } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPI/PIDSAddress.java100664 3052 12500110372 25773 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedPI; import javax.jdo.annotations.*; import org.apache.jdo.tck.pc.company.IAddress; /** * This interface represents the persistent state of Address. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ @PersistenceCapable(embeddedOnly="true", requiresExtent="false") public interface PIDSAddress extends IAddress { long getAddrid(); String getStreet(); String getCity(); String getState(); String getZipcode(); String getCountry(); void setAddrid(long addrid); void setStreet(String street); void setCity(String city); void setState(String state); void setZipcode(String zipcode); void setCountry(String country); } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPI/PIDSCompany.java100664 5106 12500110372 26016 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedPI; import javax.jdo.annotations.*; import java.util.Date; import java.util.Set; import org.apache.jdo.tck.pc.company.IAddress; import org.apache.jdo.tck.pc.company.ICompany; /** * This interface represents the persistent state of Company. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ @PersistenceCapable(table="companies") @Inheritance(strategy=InheritanceStrategy.NEW_TABLE) @Discriminator(strategy=DiscriminatorStrategy.CLASS_NAME, column="DISCRIMINATOR") @DatastoreIdentity(strategy=IdGeneratorStrategy.IDENTITY, column="DATASTORE_IDENTITY") public interface PIDSCompany extends ICompany { @Persistent(types=org.apache.jdo.tck.pc.companyAnnotatedPI.PIDSAddress.class) @Embedded(nullIndicatorColumn="COUNTRY", members={ @Persistent(name="addrid", columns=@Column(name="ADDRID")), @Persistent(name="street", columns=@Column(name="STREET")), @Persistent(name="city", columns=@Column(name="CITY")), @Persistent(name="state", columns=@Column(name="STATE")), @Persistent(name="zipcode", columns=@Column(name="ZIPCODE")), @Persistent(name="country", columns=@Column(name="COUNTRY")) }) IAddress getAddress(); @Column(name="ID") long getCompanyid(); @Persistent(mappedBy="company") @Element(types=org.apache.jdo.tck.pc.companyAnnotatedPI.PIDSDepartment.class) Set getDepartments(); @Column(name="FOUNDEDDATE") Date getFounded(); @Column(name="NAME", jdbcType="VARCHAR") String getName(); void setAddress(IAddress a); void setCompanyid(long id); void setDepartments(Set depts); void setFounded(Date date); void setName(String string); } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPI/PIDSDentalInsurance.java100664 2603 12500110372 27466 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedPI; import javax.jdo.annotations.*; import java.math.BigDecimal; import org.apache.jdo.tck.pc.company.IDentalInsurance; /** * This interface represents the persistent state of DentalInsurance. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ @PersistenceCapable public interface PIDSDentalInsurance extends IDentalInsurance, PIDSInsurance { @Column(name="LIFETIME_ORTHO_BENEFIT") BigDecimal getLifetimeOrthoBenefit(); void setLifetimeOrthoBenefit(BigDecimal lifetimeOrthoBenefit); } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPI/PIDSDepartment.java100664 4703 12500110372 26515 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedPI; import javax.jdo.annotations.*; import java.util.Set; import org.apache.jdo.tck.pc.company.ICompany; import org.apache.jdo.tck.pc.company.IDepartment; import org.apache.jdo.tck.pc.company.IEmployee; /** * This interface represents the persistent state of Department. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ @PersistenceCapable(table="departments") @Inheritance(strategy=InheritanceStrategy.NEW_TABLE) @Discriminator(strategy=DiscriminatorStrategy.CLASS_NAME, column="DISCRIMINATOR") @DatastoreIdentity(strategy=IdGeneratorStrategy.IDENTITY, column="DATASTORE_IDENTITY") public interface PIDSDepartment extends IDepartment { @Column(name="ID") long getDeptid(); @Column(name="NAME") String getName(); @Persistent(types=org.apache.jdo.tck.pc.companyAnnotatedPI.PIDSCompany.class) @Column(name="COMPANYID") ICompany getCompany(); @Persistent(types=org.apache.jdo.tck.pc.companyAnnotatedPI.PIDSEmployee.class) @Column(name="EMP_OF_THE_MONTH") IEmployee getEmployeeOfTheMonth(); @Persistent(mappedBy="department") @Element(types=org.apache.jdo.tck.pc.companyAnnotatedPI.PIDSEmployee.class) Set getEmployees(); @Persistent(mappedBy="fundingDept") @Element(types=org.apache.jdo.tck.pc.companyAnnotatedPI.PIDSEmployee.class) Set getFundedEmps(); void setDeptid(long deptid); void setName(String name); void setCompany(ICompany company); void setEmployeeOfTheMonth(IEmployee employeeOfTheMonth); void setEmployees(Set employees); void setFundedEmps(Set employees); } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPI/PIDSEmployee.java100664 7541 12500110372 26174 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedPI; import javax.jdo.annotations.*; import java.util.Date; import java.util.Set; import org.apache.jdo.tck.pc.company.IDentalInsurance; import org.apache.jdo.tck.pc.company.IDepartment; import org.apache.jdo.tck.pc.company.IEmployee; import org.apache.jdo.tck.pc.company.IMedicalInsurance; /** * This interface represents the persistent state of Employee. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ @PersistenceCapable @Inheritance(strategy=InheritanceStrategy.SUPERCLASS_TABLE) public interface PIDSEmployee extends IEmployee, PIDSPerson { @Column(name="HIREDATE") Date getHiredate(); @Column(name="WEEKLYHOURS") double getWeeklyhours(); @Persistent(mappedBy="reviewers") @Element(types=org.apache.jdo.tck.pc.companyAnnotatedPI.PIDSProject.class) Set getReviewedProjects(); @Persistent(mappedBy="members") @Element(types=org.apache.jdo.tck.pc.companyAnnotatedPI.PIDSProject.class) Set getProjects(); @Persistent(mappedBy="employee",types=org.apache.jdo.tck.pc.companyAnnotatedPI.PIDSDentalInsurance.class) IDentalInsurance getDentalInsurance(); @Persistent(mappedBy="employee",types=org.apache.jdo.tck.pc.companyAnnotatedPI.PIDSMedicalInsurance.class) IMedicalInsurance getMedicalInsurance(); @Persistent(types=org.apache.jdo.tck.pc.companyAnnotatedPI.PIDSDepartment.class) @Column(name="DEPARTMENT") IDepartment getDepartment(); @Persistent(types=org.apache.jdo.tck.pc.companyAnnotatedPI.PIDSDepartment.class) @Column(name="FUNDINGDEPT") IDepartment getFundingDept(); @Persistent(types=org.apache.jdo.tck.pc.companyAnnotatedPI.PIDSEmployee.class) @Column(name="MANAGER") IEmployee getManager(); @Persistent(mappedBy="manager") @Element(types=org.apache.jdo.tck.pc.companyAnnotatedPI.PIDSEmployee.class) Set getTeam(); @Persistent(types=org.apache.jdo.tck.pc.companyAnnotatedPI.PIDSEmployee.class) @Column(name="MENTOR") IEmployee getMentor(); @Persistent(types=org.apache.jdo.tck.pc.companyAnnotatedPI.PIDSEmployee.class, mappedBy="mentor") IEmployee getProtege(); @Persistent(types=org.apache.jdo.tck.pc.companyAnnotatedPI.PIDSEmployee.class) @Column(name="HRADVISOR") IEmployee getHradvisor(); @Persistent(mappedBy="hradvisor") @Element(types=org.apache.jdo.tck.pc.companyAnnotatedPI.PIDSEmployee.class) Set getHradvisees(); void setHiredate(Date hiredate); void setWeeklyhours(double weeklyhours); void setReviewedProjects(Set reviewedProjects); void setProjects(Set projects); void setDentalInsurance(IDentalInsurance dentalInsurance); void setMedicalInsurance(IMedicalInsurance medicalInsurance); void setDepartment(IDepartment department); void setFundingDept(IDepartment department); void setManager(IEmployee manager); void setTeam(Set team); void setMentor(IEmployee mentor); void setProtege(IEmployee protege); void setHradvisor(IEmployee hradvisor); void setHradvisees(Set hradvisees); } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPI/PIDSFullTimeEmployee.java100664 2543 12500110372 27633 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedPI; import javax.jdo.annotations.*; import org.apache.jdo.tck.pc.company.IFullTimeEmployee; /** * This interface represents the persistent state of FullTimeEmployee. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ @PersistenceCapable @Inheritance(strategy=InheritanceStrategy.SUPERCLASS_TABLE) public interface PIDSFullTimeEmployee extends IFullTimeEmployee, PIDSEmployee { @Column(name="SALARY") double getSalary(); void setSalary(double salary); } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPI/PIDSInsurance.java100664 3664 12500110372 26346 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedPI; import javax.jdo.annotations.*; import org.apache.jdo.tck.pc.company.IEmployee; import org.apache.jdo.tck.pc.company.IInsurance; /** * This interface represents the persistent state of Insurance. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ @PersistenceCapable(table="insuranceplans") @Inheritance(strategy=InheritanceStrategy.NEW_TABLE) @Discriminator(strategy=DiscriminatorStrategy.CLASS_NAME, column="DISCRIMINATOR", indexed="true") @Index(name="INS_DISCRIMINATOR_INDEX", unique="false", columns=@Column(name="DISCRIMINATOR")) @DatastoreIdentity(strategy=IdGeneratorStrategy.IDENTITY, column="DATASTORE_IDENTITY") public interface PIDSInsurance extends IInsurance { @Column(name="INSID") long getInsid(); @Column(name="CARRIER") String getCarrier(); @Persistent(types=org.apache.jdo.tck.pc.companyAnnotatedPI.PIDSEmployee.class) @Column(name="EMPLOYEE") IEmployee getEmployee(); void setInsid(long insid); void setCarrier(String carrier); void setEmployee(IEmployee employee); } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPI/PIDSMedicalInsurance.java100664 2460 12500110372 27616 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedPI; import javax.jdo.annotations.*; import org.apache.jdo.tck.pc.company.IMedicalInsurance; /** * This interface represents the persistent state of MedicalInsurance. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ @PersistenceCapable public interface PIDSMedicalInsurance extends IMedicalInsurance, PIDSInsurance { @Column(name="PLANTYPE") String getPlanType(); void setPlanType(String planType); } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPI/PIDSPartTimeEmployee.java100664 2532 12500110372 27635 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedPI; import javax.jdo.annotations.*; import org.apache.jdo.tck.pc.company.IPartTimeEmployee; /** * This interface represents the persistent state of PartTimeEmployee. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ @PersistenceCapable @Inheritance(strategy=InheritanceStrategy.SUPERCLASS_TABLE) public interface PIDSPartTimeEmployee extends IPartTimeEmployee, PIDSEmployee { @Column(name="WAGE") double getWage(); void setWage(double wage); } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPI/PIDSPerson.java100664 5662 12500110372 25665 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedPI; import javax.jdo.annotations.*; import java.util.Date; import java.util.Map; import org.apache.jdo.tck.pc.company.IAddress; import org.apache.jdo.tck.pc.company.IPerson; /** * This interface represents the persistent state of Person. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ @PersistenceCapable(table="persons") @Inheritance(strategy=InheritanceStrategy.NEW_TABLE) @Discriminator(strategy=DiscriminatorStrategy.CLASS_NAME, column="DISCRIMINATOR", indexed="true") @DatastoreIdentity(strategy=IdGeneratorStrategy.IDENTITY, column="DATASTORE_IDENTITY") public interface PIDSPerson extends IPerson { @Column(name="PERSONID") long getPersonid(); @Column(name="LASTNAME") String getLastname(); @Column(name="FIRSTNAME") String getFirstname(); @Persistent(defaultFetchGroup="false") @Column(name="MIDDLENAME", allowsNull="true") String getMiddlename(); @Persistent(types=org.apache.jdo.tck.pc.companyAnnotatedPI.PIDSAddress.class) @Embedded(nullIndicatorColumn="COUNTRY", members={ @Persistent(name="addrid", columns=@Column(name="ADDRID")), @Persistent(name="street", columns=@Column(name="STREET")), @Persistent(name="city", columns=@Column(name="CITY")), @Persistent(name="state", columns=@Column(name="STATE")), @Persistent(name="zipcode", columns=@Column(name="ZIPCODE")), @Persistent(name="country", columns=@Column(name="COUNTRY")) }) IAddress getAddress(); @Column(name="BIRTHDATE") Date getBirthdate(); @Persistent(table="employee_phoneno_type") @Join(column="EMPID") @Key(types=java.lang.String.class, column="TYPE") @Value(types=java.lang.String.class, column="PHONENO") Map getPhoneNumbers(); void setPersonid(long personid); void setLastname(String lastname); void setFirstname(String firstname); void setMiddlename(String middlename); void setAddress(IAddress address); void setBirthdate(Date birthdate); void setPhoneNumbers(Map phoneNumbers); } tck/src/java/org/apache/jdo/tck/pc/companyAnnotatedPI/PIDSProject.java100664 4501 12500110372 26014 0ustarmbouschenstaff 0 0 /* * 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.companyAnnotatedPI; import javax.jdo.annotations.*; import java.math.BigDecimal; import java.util.Set; import org.apache.jdo.tck.pc.company.IProject; /** * This interface represents the persistent state of Project. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ @PersistenceCapable(table="projects") @Inheritance(strategy=InheritanceStrategy.NEW_TABLE) @Discriminator(strategy=DiscriminatorStrategy.CLASS_NAME, column="DISCRIMINATOR") @DatastoreIdentity(strategy=IdGeneratorStrategy.IDENTITY, column="DATASTORE_IDENTITY") public interface PIDSProject extends IProject { @Column(name="PROJID") long getProjid(); @Column(name="NAME") String getName(); @Column(name="BUDGET", jdbcType="DECIMAL", length=11, scale=2) BigDecimal getBudget(); @Persistent(table="project_reviewer") @Element(types=org.apache.jdo.tck.pc.companyAnnotatedPI.PIDSEmployee.class, column="REVIEWER", foreignKey="PR_REV_FK") @Join(column="PROJID", foreignKey="PR_PROJ_FK") Set getReviewers(); @Persistent(table="project_member") @Element(types=org.apache.jdo.tck.pc.companyAnnotatedPI.PIDSEmployee.class, column="MEMBER", foreignKey="PM_MEMB_FK") @Join(column="PROJID", foreignKey="PM_PROJ_FK") Set getMembers(); void setProjid(long projid); void setName(String name); void setBudget(BigDecimal budget); void setReviewers(Set reviewers); void setMembers(Set employees); } tck/src/java/org/apache/jdo/tck/pc/companyListWithoutJoin/Company.java100664 25473 12500110373 26341 0ustarmbouschenstaff 0 0 /* * 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.companyListWithoutJoin; import java.io.Serializable; import java.io.ObjectInputStream; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.Collections; import java.util.Comparator; import java.util.Set; import java.util.HashSet; import java.util.Date; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents information about a company. */ public class Company implements ICompany, Serializable, Comparable, Comparator, DeepEquality { private long companyid; private String name; private Date founded; private transient Set departments = new HashSet(); // element type is Department protected static SimpleDateFormat formatter = new SimpleDateFormat("d/MMM/yyyy"); /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public Company() {} /** * Initialize the Company instance. * @param companyid The company id. * @param name The company name. * @param founded The date the company was founded. */ public Company(long companyid, String name, Date founded) { this.companyid = companyid; this.name = name; this.founded = founded; } /** * Get the company id. * @return The company id. */ public long getCompanyid() { return companyid; } /** * Set the id associated with this object. * @param id the id. */ public void setCompanyid(long id) { if (this.companyid != 0) throw new IllegalStateException("Id is already set."); this.companyid = id; } /** * Get the name of the company. * @return The name of the company. */ public String getName() { return name; } /** * Set the name of the company. * @param name The value to use for the name of the company. */ public void setName(String name) { this.name = name; } /** * Get the date that the company was founded. * @return The date the company was founded. */ public Date getFounded() { return founded; } /** * Set the date that the company was founded. * @param founded The date to set that the company was founded. */ public void setFounded(Date founded) { this.founded = founded; } /** * Get the departments contained in the company. * @return An unmodifiable Set that contains all the * Departments of the company. */ public Set getDepartments() { return Collections.unmodifiableSet(departments); } /** * Add a Department instance to the company. * @param dept The Department instance to add. */ public void addDepartment(Department dept) { departments.add(dept); } /** * Remove a Department instance from the company. * @param dept The Department instance to remove. */ public void removeDepartment(Department dept) { departments.remove(dept); } /** * Initialize the set of Departments in the company to the * parameter. * @param departments The set of Departments for the * company. */ public void setDepartments(Set departments) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this.departments = (departments != null) ? new HashSet(departments) : null; } /** Serialization support: initialize transient fields. */ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); departments = new HashSet(); } /** * Returns a String representation of a Company object. * @return a String representation of a Company object. */ public String toString() { return "Company(" + getFieldRepr()+ ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(companyid); rc.append(", name ").append(name); rc.append(", founded ").append( founded==null ? "null" : formatter.format(founded)); return rc.toString(); } /** * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the specified Person. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { ICompany otherCompany = (ICompany)other; String where = "Company<" + companyid + ">"; return helper.equals(companyid, otherCompany.getCompanyid(), where + ".companyid") & helper.equals(name, otherCompany.getName(), where + ".name") & helper.equals(founded, otherCompany.getFounded(), where + ".founded") & helper.deepEquals(departments, otherCompany.getDepartments(), where + ".departments"); } /** * Compares this object with the specified object for order. Returns a * negative integer, zero, or a positive integer as this object is less * than, equal to, or greater than the specified object. * @param o The Object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified object. * @throws ClassCastException - if the specified object's type prevents * it from being compared to this Object. */ public int compareTo(Object o) { return compareTo((ICompany)o); } /** * Compare two instances. This is a method in Comparator. */ public int compare(Object o1, Object o2) { return compare((ICompany)o1, (ICompany)o2); } /** * Compares this object with the specified Company object for * order. Returns a negative integer, zero, or a positive integer as * this object is less than, equal to, or greater than the specified * object. * @param other The Company object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified Company * object. */ public int compareTo(ICompany other) { return compare(this, other); } /** * Compares its two ICompany arguments for order. Returns a negative * integer, zero, or a positive integer as the first argument is less * than, equal to, or greater than the second. * @param o1 the first ICompany object to be compared. * @param o2 the second ICompany object to be compared. * @return a negative integer, zero, or a positive integer as the first * object is less than, equal to, or greater than the second object. */ public static int compare(ICompany o1, ICompany o2) { return EqualityHelper.compare(o1.getCompanyid(), o2.getCompanyid()); } /** * Indicates whether some other object is "equal to" this one. * @param obj the object with which to compare. * @return true if this object is the same as the obj * argument; false otherwise. */ public boolean equals(Object obj) { if (obj instanceof ICompany) { return compareTo((ICompany)obj) == 0; } return false; } /** * Returns a hash code value for the object. * @return a hash code value for this object. */ public int hashCode() { return (int)companyid; } /** * The class to be used as the application identifier * for the Company class. It consists of both the company * name and the date that the company was founded. */ public static class Oid implements Serializable, Comparable { /** * This field is part of the identifier and should match in name * and type with a field in the Company class. */ public long companyid; /** The required public no-arg constructor. */ public Oid() { } /** * Initialize the identifier. * @param companyid The id of the company. */ public Oid(long companyid) { this.companyid = companyid; } public Oid(String s) { companyid = Long.parseLong(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + companyid;} /** */ public boolean equals(Object obj) { if (obj==null || !this.getClass().equals(obj.getClass())) return false; Oid o = (Oid) obj; if (this.companyid != o.companyid) return false; return true; } /** */ public int hashCode() { return (int)companyid; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } /** */ public int compareTo(Object obj) { // may throw ClassCastException which the user must handle Oid other = (Oid) obj; if( companyid < other.companyid ) return -1; if( companyid > other.companyid ) return 1; return 0; } } } tck/src/java/org/apache/jdo/tck/pc/companyListWithoutJoin/CompanyFactory.java100664 3304 12500110373 27636 0ustarmbouschenstaff 0 0 /* * 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. */ /* * CompanyFactory.java * */ package org.apache.jdo.tck.pc.companyListWithoutJoin; import java.math.BigDecimal; import java.util.Date; /** * This interface is implemented by a factory class that can create * Company model instances. The factory instance is registered with * CompanyFactoryRegistry. */ public interface CompanyFactory { ICompany newCompany(long companyid, String name, Date founded); IDepartment newDepartment(long deptid, String name); IDepartment newDepartment(long deptid, String name, ICompany company); IFullTimeEmployee newFullTimeEmployee(long personid, String first, String last, String middle, Date born, Date hired, double sal); IPartTimeEmployee newPartTimeEmployee(long personid, String first, String last, String middle, Date born, Date hired, double wage); Class[] getTearDownClasses(); } tck/src/java/org/apache/jdo/tck/pc/companyListWithoutJoin/CompanyFactoryAbstractImpl.java100664 10017 12500110373 32163 0ustarmbouschenstaff 0 0 /* * 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.companyListWithoutJoin; import javax.jdo.PersistenceManager; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /* * This class provides an implementation of CompanyFactory that sets all * of the properties of the instance and defines abstract methods to * construct the instance itself. It is intended to be subclassed by * classes that implement only the methods to construct the instance. */ public abstract class CompanyFactoryAbstractImpl implements CompanyFactory { protected PersistenceManager pm; /** Logger */ protected Log logger = LogFactory.getFactory().getInstance("org.apache.jdo.tck"); /** true if debug logging is enabled. */ protected boolean debug = logger.isDebugEnabled(); /** Creates a new instance of CompanyFactoryAbstractImpl */ public CompanyFactoryAbstractImpl(PersistenceManager pm) { this.pm = pm; } abstract ICompany newCompany(); abstract IDepartment newDepartment(); abstract IFullTimeEmployee newFullTimeEmployee(); abstract IPartTimeEmployee newPartTimeEmployee(); public ICompany newCompany(long companyid, String name, java.util.Date founded) { ICompany result = newCompany(); result.setCompanyid(companyid); result.setName(name); result.setFounded(founded); if (debug) logger.debug("newCompany returned" + result); return result; } public IDepartment newDepartment(long deptid, String name) { IDepartment result = newDepartment(); result.setDeptid(deptid); result.setName(name); if (debug) logger.debug("newDepartment returned" + result); return result; } public IDepartment newDepartment(long deptid, String name, ICompany company) { IDepartment result = newDepartment(); result.setDeptid(deptid); result.setName(name); result.setCompany(company); if (debug) logger.debug("newDepartment returned" + result); return result; } public IFullTimeEmployee newFullTimeEmployee(long personid, String first, String last, String middle, java.util.Date born, java.util.Date hired, double sal) { IFullTimeEmployee result = newFullTimeEmployee(); result.setPersonid(personid); result.setFirstname(first); result.setLastname(last); result.setMiddlename(middle); result.setBirthdate(born); result.setHiredate(hired); result.setSalary(sal); if (debug) logger.debug("newFullTimeEmployee returned" + result); return result; } public IPartTimeEmployee newPartTimeEmployee(long personid, String first, String last, String middle, java.util.Date born, java.util.Date hired, double wage) { IPartTimeEmployee result = newPartTimeEmployee(); result.setPersonid(personid); result.setFirstname(first); result.setLastname(last); result.setMiddlename(middle); result.setBirthdate(born); result.setHiredate(hired); result.setWage(wage); if (debug) logger.debug("newPartTimeEmployee returned" + result); return result; } } tck/src/java/org/apache/jdo/tck/pc/companyListWithoutJoin/CompanyFactoryConcreteClass.java100664 5252 12500110373 32313 0ustarmbouschenstaff 0 0 /* * 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.companyListWithoutJoin; import java.math.BigDecimal; import java.util.Date; import javax.jdo.PersistenceManager; /* * This class is the company factory that uses constructors of the * concrete classes. */ public class CompanyFactoryConcreteClass implements CompanyFactory { /** */ public static final Class[] tearDownClasses = new Class[] { PartTimeEmployee.class, FullTimeEmployee.class, Department.class, Company.class }; public CompanyFactoryConcreteClass(PersistenceManager pm) { } public CompanyFactoryConcreteClass() { } public ICompany newCompany(long companyid, String name, Date founded) { return new Company(companyid, name, founded); } public IDepartment newDepartment(long deptid, String name) { return new Department(deptid, name); } public IDepartment newDepartment(long deptid, String name, ICompany company) { return new Department(deptid, name, company); } public IFullTimeEmployee newFullTimeEmployee(long personid, String first, String last, String middle, Date born, Date hired, double sal) { return new FullTimeEmployee(personid, first, last, middle, born, hired, sal); } public IPartTimeEmployee newPartTimeEmployee(long personid, String first, String last, String middle, Date born, Date hired, double wage) { return new PartTimeEmployee(personid, first, last, middle, born, hired, wage); } public IPerson newPerson(long personid, String firstname, String lastname, String middlename, Date birthdate) { return new Person(personid, firstname, lastname, middlename, birthdate); } public Class[] getTearDownClasses() { return tearDownClasses; } } tck/src/java/org/apache/jdo/tck/pc/companyListWithoutJoin/CompanyFactoryPMClass.java100664 3740 12500110373 31065 0ustarmbouschenstaff 0 0 /* * 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.companyListWithoutJoin; import javax.jdo.PersistenceManager; /* * CompanyFactoryPMClass.java * * This class uses the PersistenceManager.newInstance method with the concrete * class as a parameter. */ public class CompanyFactoryPMClass extends CompanyFactoryAbstractImpl { /** */ public static final Class[] tearDownClasses = new Class[] { PartTimeEmployee.class, FullTimeEmployee.class, Department.class, Company.class }; /** * Creates a new instance of CompanyFactoryPMClass */ public CompanyFactoryPMClass(PersistenceManager pm) { super(pm); } ICompany newCompany() { return (ICompany)pm.newInstance(Company.class); } IDepartment newDepartment() { return (IDepartment)pm.newInstance(Department.class); } IFullTimeEmployee newFullTimeEmployee() { return (IFullTimeEmployee)pm.newInstance(FullTimeEmployee.class); } IPartTimeEmployee newPartTimeEmployee() { return (IPartTimeEmployee)pm.newInstance(PartTimeEmployee.class); } public Class[] getTearDownClasses() { return tearDownClasses; } } tck/src/java/org/apache/jdo/tck/pc/companyListWithoutJoin/CompanyFactoryPMInterface.java100664 3671 12500110373 31723 0ustarmbouschenstaff 0 0 /* * 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.companyListWithoutJoin; import javax.jdo.PersistenceManager; /* * CompanyFactoryPMInterface.java * * Created on August 29, 2005, 9:56 PM * */ public class CompanyFactoryPMInterface extends CompanyFactoryAbstractImpl { /** */ public static final Class[] tearDownClasses = new Class[] { IPartTimeEmployee.class, IFullTimeEmployee.class, IDepartment.class, ICompany.class }; /** * Creates a new instance of CompanyFactoryPMInterface */ public CompanyFactoryPMInterface(PersistenceManager pm) { super(pm); } ICompany newCompany() { return (ICompany)pm.newInstance(ICompany.class); } IDepartment newDepartment() { return (IDepartment)pm.newInstance(IDepartment.class); } IFullTimeEmployee newFullTimeEmployee() { return (IFullTimeEmployee)pm.newInstance(IFullTimeEmployee.class); } IPartTimeEmployee newPartTimeEmployee() { return (IPartTimeEmployee)pm.newInstance(IPartTimeEmployee.class); } public Class[] getTearDownClasses() { return tearDownClasses; } } tck/src/java/org/apache/jdo/tck/pc/companyListWithoutJoin/CompanyFactoryRegistry.java100664 11625 12500110373 31414 0ustarmbouschenstaff 0 0 /* * 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.companyListWithoutJoin; import java.lang.reflect.Constructor; import java.math.BigDecimal; import java.util.Date; import javax.jdo.PersistenceManager; /* * This is the registry for company factories. It is used for the * CompletenessTest to create instances from input xml test data files. * Factory instances that implement CompanyFactory interface are * registered (using the singleton pattern). *

Several registration methods are available. The default factory, * which creates instances by construction, is automatically * registered during class initialization. The default factory can * also be registered by using the no-args method registerFactory(). *

Non-default factories can be registered using the registerFactory * method taking the factory as an argument. Non-default factories that * have a single constructor argument PersistenceManager can be * registered using either the method that explicitly names the class, * or with the method that takes the class name from a system property. */ public class CompanyFactoryRegistry { /** The system property for factory name */ final static String FACTORY_PROPERTY_NAME = "jdo.tck.mapping.companyfactory"; /** The factory name if the system property is not set. */ final static String DEFAULT_FACTORY_CLASS_NAME = "org.apache.jdo.tck.pc.company.CompanyFactoryConcreteClass"; /** * The default factory class name */ final static String FACTORY_CLASS_NAME; static { String prop = System.getProperty(FACTORY_PROPERTY_NAME); if ((prop == null) || (prop.length() == 0)) prop = DEFAULT_FACTORY_CLASS_NAME; FACTORY_CLASS_NAME = prop; } /** * This is the default company factory singleton. This is statically * loaded regardless of the setting of the system property. */ final static CompanyFactory SINGLETON = new CompanyFactoryConcreteClass(); /** * This is the currently registered factory. */ static CompanyFactory instance = SINGLETON; /** * Creates a new instance of CompanyFactoryRegistry */ private CompanyFactoryRegistry() { } /** * Get the currently registered factory. * @return the factory */ public static CompanyFactory getInstance() { return instance; } /** Register the default factory. */ public static void registerFactory() { instance = SINGLETON; } /** Register a factory using the default factory name from the * system property. The factory must be available in the current * class path and have a public constructor * taking a PersistenceManager as a parameter. * @param pm the PersistenceManager */ public static void registerFactory(PersistenceManager pm) { registerFactory(FACTORY_CLASS_NAME, pm); } /** Register a factory using the specified factoryName * parameter. The factory class must be loadable by the current context * classloader and have a public constructor * taking a PersistenceManager as a parameter. * @param factoryClassName the fully-qualified class name of the factory * @param pm the PersistenceManager */ public static void registerFactory(String factoryClassName, PersistenceManager pm) { CompanyFactory factory = null; try { if (factoryClassName != null) { Class factoryClass = Class.forName(factoryClassName); Constructor ctor = factoryClass.getConstructor(new Class[] {PersistenceManager.class}); factory = (CompanyFactory) ctor.newInstance(new Object[]{pm}); } registerFactory(factory); } catch (Exception ex) { throw new RuntimeException ("Unable to construct CompanyFactory " + factoryClassName, ex); } } /** Register the factory. * @param factory the factory */ public static void registerFactory(CompanyFactory factory) { instance = factory!=null?factory:SINGLETON; } } tck/src/java/org/apache/jdo/tck/pc/companyListWithoutJoin/CompanyModelReader.java100664 15674 12500110373 30447 0ustarmbouschenstaff 0 0 /* * 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.companyListWithoutJoin; import java.io.InputStream; import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; import java.util.Locale; import java.util.TimeZone; import org.apache.jdo.tck.util.ConversionHelper; import org.springframework.beans.factory.xml.XmlBeanFactory; import org.springframework.beans.propertyeditors.CustomDateEditor; import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.InputStreamResource; /** * Utility class to create a graph of company model instances from an xml * representation. * * @author Michael Bouschen */ public class CompanyModelReader extends XmlBeanFactory { /** The format of date values in the xml representation */ public static final String DATE_PATTERN = "d/MMM/yyyy"; /** The name of the root list bean. */ public static final String ROOT_LIST_NAME = "root"; /** The bean-factory name in the xml input files. */ public static final String BEAN_FACTORY_NAME = "companyFactory"; /** The company factory instance. */ private CompanyFactory companyFactory; /** * Create a CompanyModelReader for the specified resourceName. * @param resourceName the name of the resource */ public CompanyModelReader(String resourceName) { // Use the class loader of the Company class to find the resource this(resourceName, Company.class.getClassLoader()); } /** * Create a CompanyModelReader for the specified resourceName. * @param resourceName the name of the resource */ public CompanyModelReader(String resourceName, ClassLoader classLoader) { super(new ClassPathResource(resourceName, classLoader)); configureFactory(); } /** * Create a CompanyModelReader for the specified InputStream. * @param stream the input stream */ public CompanyModelReader(InputStream stream) { super(new InputStreamResource(stream)); configureFactory(); } /** * Returns a list of root objects. The method expects to find a bean * called "root" of type list in the xml and returns it. * @return a list of root instances */ public List getRootList() { return (List)getBean(ROOT_LIST_NAME); } /** * Configure the CompanyModelReader, e.g. register CustomEditor classes * to convert the string representation of a property into an instance * of the right type. */ private void configureFactory() { SimpleDateFormat formatter = new SimpleDateFormat(DATE_PATTERN, Locale.US); CustomDateEditor dateEditor = new CustomDateEditor(formatter, true); registerCustomEditor(Date.class, dateEditor); companyFactory = CompanyFactoryRegistry.getInstance(); addSingleton(BEAN_FACTORY_NAME, companyFactory); } // Convenience methods /** * Convenience method returning a Company instance for the specified * name. The method returns null if there is no Company * bean with the specified name. * @param name the name of the bean to return. * @return the instance of the bean or null if there no * Company bean. */ public Company getCompany(String name) { return (Company)getBean(name, Company.class); } /** * Convenience method returning a Department instance for the specified * name. The method returns null if there is no Department * bean with the specified name. * @param name the name of the bean to return. * @return the instance of the bean or null if there no * Department bean. */ public Department getDepartment(String name) { return (Department)getBean(name, Department.class); } /** * Convenience method returning an Employee instance for the specified * name. The method returns null if there is no Employee * bean with the specified name. * @param name the name of the bean to return. * @return the instance of the bean or null if there no * Employee bean. */ public Employee getEmployee(String name) { return (Employee)getBean(name, Employee.class); } /** * Convenience method returning a FullTimeEmployee instance for the * specified name. The method returns null if there is no * FullTimeEmployee bean with the specified name. * @param name the name of the bean to return. * @return the instance of the bean or null if there no * FullTimeEmployee bean. */ public FullTimeEmployee getFullTimeEmployee(String name) { return (FullTimeEmployee)getBean(name, FullTimeEmployee.class); } /** * Convenience method returning a PartTimeEmployee instance for the * specified name. The method returns null if there is no * PartTimeEmployee bean with the specified name. * @param name the name of the bean to return. * @return the instance of the bean or null if there no * PartTimeEmployee bean. */ public PartTimeEmployee getPartTimeEmployee(String name) { return (PartTimeEmployee)getBean(name, PartTimeEmployee.class); } /** * Convenience method returning a Person instance for the specified * name. The method returns null if there is no Person * bean with the specified name. * @param name the name of the bean to return. * @return the instance of the bean or null if there no * Person bean. */ public Person getPerson(String name) { return (Person)getBean(name, Person.class); } /** * @return Returns the tearDownClasses. */ public Class[] getTearDownClassesFromFactory() { return companyFactory.getTearDownClasses(); } /** * @return Returns the tearDownClasses. */ public static Class[] getTearDownClasses() { return CompanyFactoryConcreteClass.tearDownClasses; } public static Date stringToUtilDate(String value) { return ConversionHelper.toUtilDate(DATE_PATTERN, Locale.US, value); } } tck/src/java/org/apache/jdo/tck/pc/companyListWithoutJoin/Department.java100664 25425 12500110373 27033 0ustarmbouschenstaff 0 0 /* * 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.companyListWithoutJoin; import java.io.Serializable; import java.io.ObjectInputStream; import java.io.IOException; import java.util.Collections; import java.util.Comparator; import java.util.List; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a department within a company. */ public class Department implements IDepartment, Serializable, Comparable, Comparator, DeepEquality { public static final int RECOMMENDED_NO_OF_EMPS = 2; private long deptid; private String name; private Company company; private List employees; /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public Department() {} /** * Construct a Department instance. * @param deptid The department id. * @param name The name of the department. */ public Department(long deptid, String name) { this.deptid = deptid; this.name = name; } /** * Construct a Department instance. * @param deptid The department id. * @param name The name of the department. * @param company The company that the department is associated with. */ public Department(long deptid, String name, ICompany company) { this.deptid = deptid; this.name = name; this.company = (Company)company; } /** * Construct a Department instance. * @param deptid The department id. * @param name The name of the department. * @param company The company that the department is associated with. * @param employees List of employees */ public Department(long deptid, String name, Company company, List employees) { this.deptid = deptid; this.name = name; this.company = (Company)company; this.employees = employees; } /** * Set the id associated with this object. * @param id the id. */ public void setDeptid(long id) { if (this.deptid != 0) throw new IllegalStateException("Id is already set."); this.deptid = id; } /** * Get the department id. * @return The department id. */ public long getDeptid() { return deptid; } /** * Get the name of the department. * @return The name of the department. */ public String getName() { return name; } /** * Set the name of the department. * @param name The name to set for the department. */ public void setName(String name) { this.name = name; } /** * Get the company associated with the department. * @return The company. */ public ICompany getCompany() { return company; } /** * Set the company for the department. * @param company The company to associate with the department. */ public void setCompany(ICompany company) { this.company = (Company)company; } /** * Get the employees in the department as an unmodifiable set. ******************* FIX?? * @return The set of employees in the department, as an unmodifiable * set. */ public List getEmployees() { return employees; } /** * Add an employee to the department. * @param emp The employee to add to the department. */ public void addEmployee(Employee emp) { employees.add(emp); } /** * Remove an employee from the department. * @param index The index of the employee to remove from the department. */ public void removeEmployee(int index) { employees.remove(index); } /** * Set the employees to be in this department. * @param employees The employees for this department. */ public void setEmployees(List employees) { this.employees = employees; } /** * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the other Department. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { IDepartment otherDept = (IDepartment)other; String where = "Department<" + deptid + ">"; return helper.equals(deptid, otherDept.getDeptid(), where + ".deptid") & helper.equals(name, otherDept.getName(), where + ".name") & helper.deepEquals(employees, otherDept.getEmployees(), where + ".employees") & helper.deepEquals(company, otherDept.getCompany(), where + ".company") ; } /** * Returns a String representation of a Department object. * @return a String representation of a Department object. */ public String toString() { return "Department(" + getFieldRepr()+ ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(deptid); rc.append(", name ").append(name); return rc.toString(); } /** * Compares this object with the specified object for order. Returns a * negative integer, zero, or a positive integer as this object is less * than, equal to, or greater than the specified object. * @param o The Object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified object. * @throws ClassCastException - if the specified object's type prevents * it from being compared to this Object. */ public int compareTo(Object o) { return compareTo((IDepartment)o); } /** * Compare two instances. This is a method in Comparator. */ public int compare(Object o1, Object o2) { return compare((IDepartment)o1, (IDepartment)o2); } /** * Compares this object with the specified Department object for * order. Returns a negative integer, zero, or a positive integer as * this object is less than, equal to, or greater than the specified * object. * @param other The Department object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified * Department object. */ public int compareTo(IDepartment other) { return compare(this, other); } /** * Compares its two IDepartment arguments for order. Returns a negative * integer, zero, or a positive integer as the first argument is less * than, equal to, or greater than the second. * @param o1 the first IDepartment object to be compared. * @param o2 the second IDepartment object to be compared. * @return a negative integer, zero, or a positive integer as the first * object is less than, equal to, or greater than the second object. */ public static int compare(IDepartment o1, IDepartment o2) { return EqualityHelper.compare(o1.getDeptid(), o2.getDeptid()); } /** * Indicates whether some other object is "equal to" this one. * @param obj the object with which to compare. * @return true if this object is the same as the obj * argument; false otherwise. */ public boolean equals(Object obj) { if (obj instanceof IDepartment) { return compareTo((IDepartment)obj) == 0; } return false; } /** * Returns a hash code value for the object. * @return a hash code value for this object. */ public int hashCode() { return (int)deptid; } /** * The application identity class associated with the * Department class. */ public static class Oid implements Serializable, Comparable { /** * This field represents the application identifier field * for the Department class. * It must match in name and type with the field in the * Department class. */ public long deptid; /** * The required public, no-arg constructor. */ public Oid() { } /** * A constructor to initialize the identifier field. * @param deptid the deptid of the Department. */ public Oid(long deptid) { this.deptid = deptid; } public Oid(String s) { deptid = Long.parseLong(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + deptid;} /** */ public boolean equals(java.lang.Object obj) { if( obj==null || !this.getClass().equals(obj.getClass()) ) return( false ); Oid o = (Oid) obj; if( this.deptid != o.deptid ) return( false ); return( true ); } /** */ public int hashCode() { return( (int) deptid ); } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } /** */ public int compareTo(Object obj) { // may throw ClassCastException which the user must handle Oid other = (Oid) obj; if( deptid < other.deptid ) return -1; if( deptid > other.deptid ) return 1; return 0; } } } tck/src/java/org/apache/jdo/tck/pc/companyListWithoutJoin/Employee.java100664 25627 12500110373 26513 0ustarmbouschenstaff 0 0 /* * 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.companyListWithoutJoin; import java.io.ObjectInputStream; import java.io.IOException; import java.util.Collections; import java.util.Date; import java.util.HashSet; import java.util.Set; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents an employee. */ public abstract class Employee extends Person implements IEmployee { private Date hiredate; private double weeklyhours; private Department department; private Department fundingDept; private Employee manager; private Employee mentor; private Employee protege; private Employee hradvisor; private transient Set team = new HashSet(); // element-type is Employee private transient Set hradvisees = new HashSet(); // element-type is Employee /** This is the JDO-required no-args constructor */ protected Employee() {} /** * Construct an Employee instance. * @param personid The identifier for the person. * @param firstname The first name of the employee. * @param lastname The last name of the employee. * @param middlename The middle name of the employee. * @param birthdate The birth date of the employee. * @param hiredate The date that the employee was hired. */ public Employee(long personid, String firstname, String lastname, String middlename, Date birthdate, Date hiredate) { super(personid, firstname, lastname, middlename, birthdate); this.hiredate = hiredate; } /** * Get the date that the employee was hired. * @return The date the employee was hired. */ public Date getHiredate() { return hiredate; } /** * Set the date that the employee was hired. * @param hiredate The date the employee was hired. */ public void setHiredate(Date hiredate) { this.hiredate = hiredate; } /** * Get the weekly hours of the employee. * @return The number of hours per week that the employee works. */ public double getWeeklyhours() { return weeklyhours; } /** * Set the number of hours per week that the employee works. * @param weeklyhours The number of hours per week that the employee * works. */ public void setWeeklyhours(double weeklyhours) { this.weeklyhours = weeklyhours; } /** * Get the employee's department. * @return The department associated with the employee. */ public IDepartment getDepartment() { return department; } /** * Set the employee's department. * @param department The department. */ public void setDepartment(IDepartment department) { this.department = (Department)department; } /** * Get the employee's funding department. * @return The funding department associated with the employee. */ public IDepartment getFundingDept() { return fundingDept; } /** * Set the employee's funding department. * @param department The funding department. */ public void setFundingDept(IDepartment department) { this.fundingDept = (Department)department; } /** * Get the employee's manager. * @return The employee's manager. */ public IEmployee getManager() { return manager; } /** * Set the employee's manager. * @param manager The employee's manager. */ public void setManager(IEmployee manager) { this.manager = (Employee)manager; } /** * Get the employee's team. * @return The set of Employees on this employee's team, * returned as an unmodifiable set. */ public Set getTeam() { return Collections.unmodifiableSet(team); } /** * Add an Employee to this employee's team. * This method sets both sides of the relationship, modifying * this employees team to include parameter emp and modifying * emp to set its manager attribute to this object. * @param emp The Employee to add to the team. */ public void addToTeam(Employee emp) { team.add(emp); emp.manager = this; } /** * Remove an Employee from this employee's team. * This method will also set the emp manager to null. * @param emp The Employee to remove from the team. */ public void removeFromTeam(Employee emp) { team.remove(emp); emp.manager = null; } /** * Set the employee's team. * @param team The set of Employees. */ public void setTeam(Set team) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this.team = (team != null) ? new HashSet(team) : null; } /** * Set the mentor for this employee. * @param mentor The mentor for this employee. */ public void setMentor(IEmployee mentor) { this.mentor = (Employee)mentor; } /** * Get the mentor for this employee. * @return The mentor. */ public IEmployee getMentor() { return mentor; } /** * Set the protege for this employee. * @param protege The protege for this employee. */ public void setProtege(IEmployee protege) { this.protege = (Employee)protege; } /** * Get the protege of this employee. * @return The protege of this employee. */ public IEmployee getProtege() { return protege; } /** * Set the HR advisor for this employee. * @param hradvisor The hradvisor for this employee. */ public void setHradvisor(IEmployee hradvisor) { this.hradvisor = (Employee)hradvisor; } /** * Get the HR advisor for the employee. * @return The HR advisor. */ public IEmployee getHradvisor() { return hradvisor; } /** * Get the HR advisees of this HR advisor. * @return An unmodifiable Set containing the * Employees that are HR advisees of this employee. */ public Set getHradvisees() { return Collections.unmodifiableSet(hradvisees); } /** * Add an Employee as an advisee of this HR advisor. * This method also sets the emp hradvisor to reference * this object. In other words, both sides of the relationship are * set. * @param emp The employee to add as an advisee. */ public void addAdvisee(Employee emp) { hradvisees.add(emp); emp.hradvisor = this; } /** * Remove an Employee as an advisee of this HR advisor. * This method also sets the emp hradvisor to null. * In other words, both sides of the relationship are set. * @param emp The employee to add as an HR advisee. */ public void removeAdvisee(Employee emp) { hradvisees.remove(emp); emp.hradvisor = null; } /** * Set the HR advisees of this HR advisor. * @param hradvisees The Employees that are HR advisees of * this employee. */ public void setHradvisees(Set hradvisees) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this.hradvisees = (hradvisees != null) ? new HashSet(hradvisees) : null; } /** Serialization support: initialize transient fields. */ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); team = new HashSet(); hradvisees = new HashSet(); } /** * Return a String representation of a Employee object. * @return a String representation of a Employee object. */ public String toString() { return "Employee(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(super.getFieldRepr()); rc.append(", hired ").append( hiredate==null ? "null" : formatter.format(hiredate)); rc.append(", weeklyhours ").append(weeklyhours); return rc.toString(); } /** * Returns true if all the fields of this instance are * deep equal to the corresponding fields of the specified Employee. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { IEmployee otherEmp = (IEmployee)other; String where = "Employee<" + getPersonid() + ">"; return super.deepCompareFields(otherEmp, helper) & helper.equals(hiredate, otherEmp.getHiredate(), where + ".hiredate") & helper.closeEnough(weeklyhours, otherEmp.getWeeklyhours(), where + ".weeklyhours") & helper.deepEquals(department, otherEmp.getDepartment(), where + ".department") & helper.deepEquals(fundingDept, otherEmp.getFundingDept(), where + ".fundingDept") & helper.deepEquals(manager, otherEmp.getManager(), where + ".manager") & helper.deepEquals(mentor, otherEmp.getMentor(), where + ".mentor") & helper.deepEquals(protege, otherEmp.getProtege(), where + ".protege") & helper.deepEquals(hradvisor, otherEmp.getHradvisor(), where + ".hradvisor") & helper.deepEquals(team, otherEmp.getTeam(), where + ".team") & helper.deepEquals(hradvisees, otherEmp.getHradvisees(), where + ".hradvisees"); } } tck/src/java/org/apache/jdo/tck/pc/companyListWithoutJoin/FullTimeEmployee.java100664 7627 12500110373 30135 0ustarmbouschenstaff 0 0 /* * 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.companyListWithoutJoin; import java.util.Date; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a full-time employee. */ public class FullTimeEmployee extends Employee implements IFullTimeEmployee { private double salary; /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public FullTimeEmployee() {} /** * Construct a full-time employee. * @param personid The person identifier. * @param first The person's first name. * @param last The person's last name. * @param middle The person's middle name. * @param born The person's birthdate. * @param hired The date that the person was hired. * @param sal The salary of the full-time employee. */ public FullTimeEmployee(long personid, String first, String last, String middle, Date born, Date hired, double sal) { super(personid, first, last, middle, born, hired); salary = sal; } /** * Get the salary of the full time employee. * @return The salary of the full time employee. */ public double getSalary() { return salary; } /** * Set the salary for the full-time employee. * @param salary The salary to set for the full-time employee. */ public void setSalary(double salary) { this.salary = salary; } /** * Return a String representation of a FullTimeEmployee object. * @return a String representation of a FullTimeEmployee object. */ public String toString() { return "FullTimeEmployee(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ public String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(super.getFieldRepr()); rc.append(", $").append(salary); return rc.toString(); } /** * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the specified * FullTimeEmployee. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { IFullTimeEmployee otherEmp = (IFullTimeEmployee)other; String where = "FullTimeEmployee<" + getPersonid() + ">"; return super.deepCompareFields(otherEmp, helper) & helper.closeEnough(salary, otherEmp.getSalary(), where + ".salary"); } } tck/src/java/org/apache/jdo/tck/pc/companyListWithoutJoin/ICompany.java100664 2505 12500110373 26421 0ustarmbouschenstaff 0 0 /* * 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.companyListWithoutJoin; import java.util.Date; import java.util.Set; /** * This interface represents the persistent state of Company. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ public interface ICompany { long getCompanyid(); Set getDepartments(); Date getFounded(); String getName(); void setCompanyid(long id); void setDepartments(Set depts); void setFounded(Date date); void setName(String string); } tck/src/java/org/apache/jdo/tck/pc/companyListWithoutJoin/IDepartment.java100664 2473 12500110373 27122 0ustarmbouschenstaff 0 0 /* * 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.companyListWithoutJoin; import java.util.List; /** * This interface represents the persistent state of Department. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ public interface IDepartment { long getDeptid(); String getName(); ICompany getCompany(); List getEmployees(); void setDeptid(long deptid); void setName(String name); void setCompany(ICompany company); void setEmployees(List employees); } tck/src/java/org/apache/jdo/tck/pc/companyListWithoutJoin/IEmployee.java100664 3442 12500110373 26573 0ustarmbouschenstaff 0 0 /* * 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.companyListWithoutJoin; import java.util.Date; import java.util.Set; /** * This interface represents the persistent state of Employee. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ public interface IEmployee extends IPerson { Date getHiredate(); double getWeeklyhours(); IDepartment getDepartment(); IDepartment getFundingDept(); IEmployee getManager(); Set getTeam(); IEmployee getMentor(); IEmployee getProtege(); IEmployee getHradvisor(); Set getHradvisees(); void setHiredate(Date hiredate); void setWeeklyhours(double weeklyhours); void setDepartment(IDepartment department); void setFundingDept(IDepartment department); void setManager(IEmployee manager); void setTeam(Set team); void setMentor(IEmployee mentor); void setProtege(IEmployee protege); void setHradvisor(IEmployee hradvisor); void setHradvisees(Set hradvisees); } tck/src/java/org/apache/jdo/tck/pc/companyListWithoutJoin/IFullTimeEmployee.java100664 2211 12500110373 30226 0ustarmbouschenstaff 0 0 /* * 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.companyListWithoutJoin; /** * This interface represents the persistent state of FullTimeEmployee. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ public interface IFullTimeEmployee extends IEmployee { double getSalary(); void setSalary(double salary); } tck/src/java/org/apache/jdo/tck/pc/companyListWithoutJoin/IPartTimeEmployee.java100664 2202 12500110373 30232 0ustarmbouschenstaff 0 0 /* * 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.companyListWithoutJoin; /** * This interface represents the persistent state of PartTimeEmployee. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ public interface IPartTimeEmployee extends IEmployee { double getWage(); void setWage(double wage); } tck/src/java/org/apache/jdo/tck/pc/companyListWithoutJoin/IPerson.java100664 2617 12500110373 26265 0ustarmbouschenstaff 0 0 /* * 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.companyListWithoutJoin; import java.util.Date; /** * This interface represents the persistent state of Person. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ public interface IPerson { long getPersonid(); String getLastname(); String getFirstname(); String getMiddlename(); Date getBirthdate(); void setPersonid(long personid); void setLastname(String lastname); void setFirstname(String firstname); void setMiddlename(String middlename); void setBirthdate(Date birthdate); } tck/src/java/org/apache/jdo/tck/pc/companyListWithoutJoin/PartTimeEmployee.java100664 7524 12500110373 30135 0ustarmbouschenstaff 0 0 /* * 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.companyListWithoutJoin; import java.util.Date; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a part-time employee. */ public class PartTimeEmployee extends Employee implements IPartTimeEmployee { private double wage; /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public PartTimeEmployee() {} /** * Construct a part-time employee. * @param personid The identifier for the person. * @param first The person's first name. * @param last The person's last name. * @param middle The person's middle name. * @param born The person's birthdate. * @param hired The date the person was hired. * @param wage The person's wage. */ public PartTimeEmployee(long personid, String first, String last, String middle, Date born, Date hired, double wage ) { super(personid, first, last, middle, born, hired); this.wage = wage; } /** * Get the wage of the part-time employee. * @return The wage of the part-time employee. */ public double getWage() { return wage; } /** * Set the wage of the part-time employee. * @param wage The wage of the part-time employee. */ public void setWage(double wage) { this.wage = wage; } /** * Returns a String representation of a PartTimeEmployee object. * @return a String representation of a PartTimeEmployee object. */ public String toString() { return "PartTimeEmployee(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ public String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(super.getFieldRepr()); rc.append(", $" + wage); return rc.toString(); } /** * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the specified * PartTimeEmployee. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { IPartTimeEmployee otherEmp = (IPartTimeEmployee)other; String where = "PartTimeEmployee<" + getPersonid() + ">"; return super.deepCompareFields(otherEmp, helper) & helper.closeEnough(wage, otherEmp.getWage(), where + ".wage"); } } tck/src/java/org/apache/jdo/tck/pc/companyListWithoutJoin/Person.java100664 24302 12500110373 26167 0ustarmbouschenstaff 0 0 /* * 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.companyListWithoutJoin; import java.io.Serializable; import java.text.SimpleDateFormat; import java.util.Collections; import java.util.Comparator; import java.util.Date; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a person. */ public class Person implements IPerson, Serializable, Comparable, Comparator, DeepEquality { private long personid; private String firstname; private String lastname; private String middlename; private Date birthdate; protected static SimpleDateFormat formatter = new SimpleDateFormat("d/MMM/yyyy"); /** This is the JDO-required no-args constructor. */ protected Person() {} /** * Construct a Person instance. * @param personid The person identifier. * @param firstname The person's first name. * @param lastname The person's last name. * @param middlename The person's middle name. * @param birthdate The person's birthdate. */ public Person(long personid, String firstname, String lastname, String middlename, Date birthdate) { this.personid = personid; this.firstname = firstname; this.lastname = lastname; this.middlename = middlename; this.birthdate = birthdate; } /** * Set the id associated with this object. * @param id the id. */ public void setPersonid(long id) { if (this.personid != 0) throw new IllegalStateException("Id is already set."); this.personid = id; } /** * Get the person's id. * @return The personid. */ public long getPersonid() { return personid; } /** * Set the person's id. * @param personid The personid. */ public void setLastname(long personid) { this.personid = personid; } /** * Get the person's last name. * @return The last name. */ public String getLastname() { return lastname; } /** * Set the person's last name. * @param lastname The last name. */ public void setLastname(String lastname) { this.lastname = lastname; } /** * Get the person's first name. * @return The first name. */ public String getFirstname() { return firstname; } /** * Set the person's first name. * @param firstname The first name. */ public void setFirstname(String firstname) { this.firstname = firstname; } /** * Get the person's middle name. * @return The middle name. */ public String getMiddlename() { return middlename; } /** * Set the person's middle name. * @param middlename The middle name. */ public void setMiddlename(String middlename) { this.middlename = middlename; } /** * Get the person's birthdate. * @return The person's birthdate. */ public Date getBirthdate() { return birthdate; } /** * Set the person's birthdate. * @param birthdate The person's birthdate. */ public void setBirthdate(Date birthdate) { this. birthdate = birthdate; } /** * Returns a String representation of a Person object. * @return a string representation of a Person object. */ public String toString() { return "Person(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(personid); rc.append(", ").append(lastname); rc.append(", ").append(firstname); rc.append(", born ").append( birthdate==null ? "null" : formatter.format(birthdate)); return rc.toString(); } /** * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the specified Person. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { IPerson otherPerson = (IPerson)other; String where = "Person<" + personid + ">"; return helper.equals(personid, otherPerson.getPersonid(), where + ".personid") & helper.equals(firstname, otherPerson.getFirstname(), where + ".firstname") & helper.equals(lastname, otherPerson.getLastname(), where + ".lastname") & helper.equals(middlename, otherPerson.getMiddlename(), where + ".middlename") & helper.equals(birthdate, otherPerson.getBirthdate(), where + ".birthdate") ; } /** * Compares this object with the specified object for order. Returns a * negative integer, zero, or a positive integer as this object is less * than, equal to, or greater than the specified object. * @param o The Object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified object. * @throws ClassCastException - if the specified object's type prevents * it from being compared to this Object. */ public int compareTo(Object o) { return compareTo((IPerson)o); } /** * Compare two instances. This is a method in Comparator. */ public int compare(Object o1, Object o2) { return compare((IPerson)o1, (IPerson)o2); } /** * Compares this object with the specified Person object for * order. Returns a negative integer, zero, or a positive integer as * this object is less than, equal to, or greater than the specified * object. * @param other The Person object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified Person * object. */ public int compareTo(IPerson other) { return compare(this, other); } /** * Compares its two IPerson arguments for order. Returns a negative * integer, zero, or a positive integer as the first argument is less * than, equal to, or greater than the second. * @param o1 the first IPerson object to be compared. * @param o2 the second IPerson object to be compared. * @return a negative integer, zero, or a positive integer as the first * object is less than, equal to, or greater than the second object. */ public static int compare(IPerson o1, IPerson o2) { return EqualityHelper.compare(o1.getPersonid(), o2.getPersonid()); } /** * Indicates whether some other object is "equal to" this one. * @param obj the object with which to compare. * @return true if this object is the same as the obj * argument; false otherwise. */ public boolean equals(Object obj) { if (obj instanceof IPerson) { return compareTo((IPerson)obj) == 0; } return false; } /** * Returns a hash code value for the object. * @return a hash code value for this object. */ public int hashCode() { return (int)personid; } /** * This class is used to represent the application identifier * for the Person class. */ public static class Oid implements Serializable, Comparable { /** * This field represents the identifier for the Person * class. It must match a field in the Person class in * both name and type. */ public long personid; /** * The required public no-arg constructor. */ public Oid() { } /** * Initialize the identifier. * @param personid The person identifier. */ public Oid(long personid) { this.personid = personid; } public Oid(String s) { personid = Long.parseLong(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + personid;} /** */ public boolean equals(java.lang.Object obj) { if( obj==null || !this.getClass().equals(obj.getClass()) ) return( false ); Oid o = (Oid) obj; if( this.personid != o.personid ) return( false ); return( true ); } /** */ public int hashCode() { return( (int) personid ); } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } /** */ public int compareTo(Object obj) { // may throw ClassCastException which the user must handle Oid other = (Oid) obj; if( personid < other.personid ) return -1; if( personid > other.personid ) return 1; return 0; } } } tck/src/java/org/apache/jdo/tck/pc/companyMapWithoutJoin/Company.java100664 25472 12500110373 26142 0ustarmbouschenstaff 0 0 /* * 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.companyMapWithoutJoin; import java.io.Serializable; import java.io.ObjectInputStream; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.Collections; import java.util.Comparator; import java.util.Set; import java.util.HashSet; import java.util.Date; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents information about a company. */ public class Company implements ICompany, Serializable, Comparable, Comparator, DeepEquality { private long companyid; private String name; private Date founded; private transient Set departments = new HashSet(); // element type is Department protected static SimpleDateFormat formatter = new SimpleDateFormat("d/MMM/yyyy"); /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public Company() {} /** * Initialize the Company instance. * @param companyid The company id. * @param name The company name. * @param founded The date the company was founded. */ public Company(long companyid, String name, Date founded) { this.companyid = companyid; this.name = name; this.founded = founded; } /** * Get the company id. * @return The company id. */ public long getCompanyid() { return companyid; } /** * Set the id associated with this object. * @param id the id. */ public void setCompanyid(long id) { if (this.companyid != 0) throw new IllegalStateException("Id is already set."); this.companyid = id; } /** * Get the name of the company. * @return The name of the company. */ public String getName() { return name; } /** * Set the name of the company. * @param name The value to use for the name of the company. */ public void setName(String name) { this.name = name; } /** * Get the date that the company was founded. * @return The date the company was founded. */ public Date getFounded() { return founded; } /** * Set the date that the company was founded. * @param founded The date to set that the company was founded. */ public void setFounded(Date founded) { this.founded = founded; } /** * Get the departments contained in the company. * @return An unmodifiable Set that contains all the * Departments of the company. */ public Set getDepartments() { return Collections.unmodifiableSet(departments); } /** * Add a Department instance to the company. * @param dept The Department instance to add. */ public void addDepartment(Department dept) { departments.add(dept); } /** * Remove a Department instance from the company. * @param dept The Department instance to remove. */ public void removeDepartment(Department dept) { departments.remove(dept); } /** * Initialize the set of Departments in the company to the * parameter. * @param departments The set of Departments for the * company. */ public void setDepartments(Set departments) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this.departments = (departments != null) ? new HashSet(departments) : null; } /** Serialization support: initialize transient fields. */ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); departments = new HashSet(); } /** * Returns a String representation of a Company object. * @return a String representation of a Company object. */ public String toString() { return "Company(" + getFieldRepr()+ ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(companyid); rc.append(", name ").append(name); rc.append(", founded ").append( founded==null ? "null" : formatter.format(founded)); return rc.toString(); } /** * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the specified Person. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { ICompany otherCompany = (ICompany)other; String where = "Company<" + companyid + ">"; return helper.equals(companyid, otherCompany.getCompanyid(), where + ".companyid") & helper.equals(name, otherCompany.getName(), where + ".name") & helper.equals(founded, otherCompany.getFounded(), where + ".founded") & helper.deepEquals(departments, otherCompany.getDepartments(), where + ".departments"); } /** * Compares this object with the specified object for order. Returns a * negative integer, zero, or a positive integer as this object is less * than, equal to, or greater than the specified object. * @param o The Object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified object. * @throws ClassCastException - if the specified object's type prevents * it from being compared to this Object. */ public int compareTo(Object o) { return compareTo((ICompany)o); } /** * Compare two instances. This is a method in Comparator. */ public int compare(Object o1, Object o2) { return compare((ICompany)o1, (ICompany)o2); } /** * Compares this object with the specified Company object for * order. Returns a negative integer, zero, or a positive integer as * this object is less than, equal to, or greater than the specified * object. * @param other The Company object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified Company * object. */ public int compareTo(ICompany other) { return compare(this, other); } /** * Compares its two ICompany arguments for order. Returns a negative * integer, zero, or a positive integer as the first argument is less * than, equal to, or greater than the second. * @param o1 the first ICompany object to be compared. * @param o2 the second ICompany object to be compared. * @return a negative integer, zero, or a positive integer as the first * object is less than, equal to, or greater than the second object. */ public static int compare(ICompany o1, ICompany o2) { return EqualityHelper.compare(o1.getCompanyid(), o2.getCompanyid()); } /** * Indicates whether some other object is "equal to" this one. * @param obj the object with which to compare. * @return true if this object is the same as the obj * argument; false otherwise. */ public boolean equals(Object obj) { if (obj instanceof ICompany) { return compareTo((ICompany)obj) == 0; } return false; } /** * Returns a hash code value for the object. * @return a hash code value for this object. */ public int hashCode() { return (int)companyid; } /** * The class to be used as the application identifier * for the Company class. It consists of both the company * name and the date that the company was founded. */ public static class Oid implements Serializable, Comparable { /** * This field is part of the identifier and should match in name * and type with a field in the Company class. */ public long companyid; /** The required public no-arg constructor. */ public Oid() { } /** * Initialize the identifier. * @param companyid The id of the company. */ public Oid(long companyid) { this.companyid = companyid; } public Oid(String s) { companyid = Long.parseLong(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + companyid;} /** */ public boolean equals(Object obj) { if (obj==null || !this.getClass().equals(obj.getClass())) return false; Oid o = (Oid) obj; if (this.companyid != o.companyid) return false; return true; } /** */ public int hashCode() { return (int)companyid; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } /** */ public int compareTo(Object obj) { // may throw ClassCastException which the user must handle Oid other = (Oid) obj; if( companyid < other.companyid ) return -1; if( companyid > other.companyid ) return 1; return 0; } } } tck/src/java/org/apache/jdo/tck/pc/companyMapWithoutJoin/CompanyFactory.java100664 3335 12500110373 27444 0ustarmbouschenstaff 0 0 /* * 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. */ /* * CompanyFactory.java * */ package org.apache.jdo.tck.pc.companyMapWithoutJoin; import java.math.BigDecimal; import java.util.Date; /** * This interface is implemented by a factory class that can create * Company model instances. The factory instance is registered with * CompanyFactoryRegistry. */ public interface CompanyFactory { ICompany newCompany(long companyid, String name, Date founded); IDepartment newDepartment(long deptid, String name); IDepartment newDepartment(long deptid, String name, ICompany company); IFullTimeEmployee newFullTimeEmployee(long personid, String first, String last, String middle, Date born, Date hired, String role, double sal); IPartTimeEmployee newPartTimeEmployee(long personid, String first, String last, String middle, Date born, Date hired, String role, double wage); Class[] getTearDownClasses(); } tck/src/java/org/apache/jdo/tck/pc/companyMapWithoutJoin/CompanyFactoryAbstractImpl.java100664 10144 12500110373 31766 0ustarmbouschenstaff 0 0 /* * 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.companyMapWithoutJoin; import javax.jdo.PersistenceManager; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /* * This class provides an implementation of CompanyFactory that sets all * of the properties of the instance and defines abstract methods to * construct the instance itself. It is intended to be subclassed by * classes that implement only the methods to construct the instance. */ public abstract class CompanyFactoryAbstractImpl implements CompanyFactory { protected PersistenceManager pm; /** Logger */ protected Log logger = LogFactory.getFactory().getInstance("org.apache.jdo.tck"); /** true if debug logging is enabled. */ protected boolean debug = logger.isDebugEnabled(); /** Creates a new instance of CompanyFactoryAbstractImpl */ public CompanyFactoryAbstractImpl(PersistenceManager pm) { this.pm = pm; } abstract ICompany newCompany(); abstract IDepartment newDepartment(); abstract IFullTimeEmployee newFullTimeEmployee(); abstract IPartTimeEmployee newPartTimeEmployee(); public ICompany newCompany(long companyid, String name, java.util.Date founded) { ICompany result = newCompany(); result.setCompanyid(companyid); result.setName(name); result.setFounded(founded); if (debug) logger.debug("newCompany returned" + result); return result; } public IDepartment newDepartment(long deptid, String name) { IDepartment result = newDepartment(); result.setDeptid(deptid); result.setName(name); if (debug) logger.debug("newDepartment returned" + result); return result; } public IDepartment newDepartment(long deptid, String name, ICompany company) { IDepartment result = newDepartment(); result.setDeptid(deptid); result.setName(name); result.setCompany(company); if (debug) logger.debug("newDepartment returned" + result); return result; } public IFullTimeEmployee newFullTimeEmployee(long personid, String first, String last, String middle, java.util.Date born, java.util.Date hired, String role, double sal) { IFullTimeEmployee result = newFullTimeEmployee(); result.setPersonid(personid); result.setFirstname(first); result.setLastname(last); result.setMiddlename(middle); result.setBirthdate(born); result.setHiredate(hired); result.setRole(role); result.setSalary(sal); if (debug) logger.debug("newFullTimeEmployee returned" + result); return result; } public IPartTimeEmployee newPartTimeEmployee(long personid, String first, String last, String middle, java.util.Date born, java.util.Date hired, String role, double wage) { IPartTimeEmployee result = newPartTimeEmployee(); result.setPersonid(personid); result.setFirstname(first); result.setLastname(last); result.setMiddlename(middle); result.setBirthdate(born); result.setHiredate(hired); result.setRole(role); result.setWage(wage); if (debug) logger.debug("newPartTimeEmployee returned" + result); return result; } } tck/src/java/org/apache/jdo/tck/pc/companyMapWithoutJoin/CompanyFactoryConcreteClass.java100664 5317 12500110373 32117 0ustarmbouschenstaff 0 0 /* * 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.companyMapWithoutJoin; import java.math.BigDecimal; import java.util.Date; import javax.jdo.PersistenceManager; /* * This class is the company factory that uses constructors of the * concrete classes. */ public class CompanyFactoryConcreteClass implements CompanyFactory { /** */ public static final Class[] tearDownClasses = new Class[] { PartTimeEmployee.class, FullTimeEmployee.class, Department.class, Company.class }; public CompanyFactoryConcreteClass(PersistenceManager pm) { } public CompanyFactoryConcreteClass() { } public ICompany newCompany(long companyid, String name, Date founded) { return new Company(companyid, name, founded); } public IDepartment newDepartment(long deptid, String name) { return new Department(deptid, name); } public IDepartment newDepartment(long deptid, String name, ICompany company) { return new Department(deptid, name, company); } public IFullTimeEmployee newFullTimeEmployee(long personid, String first, String last, String middle, Date born, Date hired, String role, double sal) { return new FullTimeEmployee(personid, first, last, middle, born, hired, role, sal); } public IPartTimeEmployee newPartTimeEmployee(long personid, String first, String last, String middle, Date born, Date hired, String role, double wage) { return new PartTimeEmployee(personid, first, last, middle, born, hired, role, wage); } public IPerson newPerson(long personid, String firstname, String lastname, String middlename, Date birthdate) { return new Person(personid, firstname, lastname, middlename, birthdate); } public Class[] getTearDownClasses() { return tearDownClasses; } } tck/src/java/org/apache/jdo/tck/pc/companyMapWithoutJoin/CompanyFactoryPMClass.java100664 3737 12500110373 30675 0ustarmbouschenstaff 0 0 /* * 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.companyMapWithoutJoin; import javax.jdo.PersistenceManager; /* * CompanyFactoryPMClass.java * * This class uses the PersistenceManager.newInstance method with the concrete * class as a parameter. */ public class CompanyFactoryPMClass extends CompanyFactoryAbstractImpl { /** */ public static final Class[] tearDownClasses = new Class[] { PartTimeEmployee.class, FullTimeEmployee.class, Department.class, Company.class }; /** * Creates a new instance of CompanyFactoryPMClass */ public CompanyFactoryPMClass(PersistenceManager pm) { super(pm); } ICompany newCompany() { return (ICompany)pm.newInstance(Company.class); } IDepartment newDepartment() { return (IDepartment)pm.newInstance(Department.class); } IFullTimeEmployee newFullTimeEmployee() { return (IFullTimeEmployee)pm.newInstance(FullTimeEmployee.class); } IPartTimeEmployee newPartTimeEmployee() { return (IPartTimeEmployee)pm.newInstance(PartTimeEmployee.class); } public Class[] getTearDownClasses() { return tearDownClasses; } } tck/src/java/org/apache/jdo/tck/pc/companyMapWithoutJoin/CompanyFactoryPMInterface.java100664 3670 12500110373 31524 0ustarmbouschenstaff 0 0 /* * 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.companyMapWithoutJoin; import javax.jdo.PersistenceManager; /* * CompanyFactoryPMInterface.java * * Created on August 29, 2005, 9:56 PM * */ public class CompanyFactoryPMInterface extends CompanyFactoryAbstractImpl { /** */ public static final Class[] tearDownClasses = new Class[] { IPartTimeEmployee.class, IFullTimeEmployee.class, IDepartment.class, ICompany.class }; /** * Creates a new instance of CompanyFactoryPMInterface */ public CompanyFactoryPMInterface(PersistenceManager pm) { super(pm); } ICompany newCompany() { return (ICompany)pm.newInstance(ICompany.class); } IDepartment newDepartment() { return (IDepartment)pm.newInstance(IDepartment.class); } IFullTimeEmployee newFullTimeEmployee() { return (IFullTimeEmployee)pm.newInstance(IFullTimeEmployee.class); } IPartTimeEmployee newPartTimeEmployee() { return (IPartTimeEmployee)pm.newInstance(IPartTimeEmployee.class); } public Class[] getTearDownClasses() { return tearDownClasses; } } tck/src/java/org/apache/jdo/tck/pc/companyMapWithoutJoin/CompanyFactoryRegistry.java100664 11624 12500110373 31215 0ustarmbouschenstaff 0 0 /* * 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.companyMapWithoutJoin; import java.lang.reflect.Constructor; import java.math.BigDecimal; import java.util.Date; import javax.jdo.PersistenceManager; /* * This is the registry for company factories. It is used for the * CompletenessTest to create instances from input xml test data files. * Factory instances that implement CompanyFactory interface are * registered (using the singleton pattern). *

Several registration methods are available. The default factory, * which creates instances by construction, is automatically * registered during class initialization. The default factory can * also be registered by using the no-args method registerFactory(). *

Non-default factories can be registered using the registerFactory * method taking the factory as an argument. Non-default factories that * have a single constructor argument PersistenceManager can be * registered using either the method that explicitly names the class, * or with the method that takes the class name from a system property. */ public class CompanyFactoryRegistry { /** The system property for factory name */ final static String FACTORY_PROPERTY_NAME = "jdo.tck.mapping.companyfactory"; /** The factory name if the system property is not set. */ final static String DEFAULT_FACTORY_CLASS_NAME = "org.apache.jdo.tck.pc.company.CompanyFactoryConcreteClass"; /** * The default factory class name */ final static String FACTORY_CLASS_NAME; static { String prop = System.getProperty(FACTORY_PROPERTY_NAME); if ((prop == null) || (prop.length() == 0)) prop = DEFAULT_FACTORY_CLASS_NAME; FACTORY_CLASS_NAME = prop; } /** * This is the default company factory singleton. This is statically * loaded regardless of the setting of the system property. */ final static CompanyFactory SINGLETON = new CompanyFactoryConcreteClass(); /** * This is the currently registered factory. */ static CompanyFactory instance = SINGLETON; /** * Creates a new instance of CompanyFactoryRegistry */ private CompanyFactoryRegistry() { } /** * Get the currently registered factory. * @return the factory */ public static CompanyFactory getInstance() { return instance; } /** Register the default factory. */ public static void registerFactory() { instance = SINGLETON; } /** Register a factory using the default factory name from the * system property. The factory must be available in the current * class path and have a public constructor * taking a PersistenceManager as a parameter. * @param pm the PersistenceManager */ public static void registerFactory(PersistenceManager pm) { registerFactory(FACTORY_CLASS_NAME, pm); } /** Register a factory using the specified factoryName * parameter. The factory class must be loadable by the current context * classloader and have a public constructor * taking a PersistenceManager as a parameter. * @param factoryClassName the fully-qualified class name of the factory * @param pm the PersistenceManager */ public static void registerFactory(String factoryClassName, PersistenceManager pm) { CompanyFactory factory = null; try { if (factoryClassName != null) { Class factoryClass = Class.forName(factoryClassName); Constructor ctor = factoryClass.getConstructor(new Class[] {PersistenceManager.class}); factory = (CompanyFactory) ctor.newInstance(new Object[]{pm}); } registerFactory(factory); } catch (Exception ex) { throw new RuntimeException ("Unable to construct CompanyFactory " + factoryClassName, ex); } } /** Register the factory. * @param factory the factory */ public static void registerFactory(CompanyFactory factory) { instance = factory!=null?factory:SINGLETON; } } tck/src/java/org/apache/jdo/tck/pc/companyMapWithoutJoin/CompanyModelReader.java100664 15673 12500110373 30250 0ustarmbouschenstaff 0 0 /* * 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.companyMapWithoutJoin; import java.io.InputStream; import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; import java.util.Locale; import java.util.TimeZone; import org.apache.jdo.tck.util.ConversionHelper; import org.springframework.beans.factory.xml.XmlBeanFactory; import org.springframework.beans.propertyeditors.CustomDateEditor; import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.InputStreamResource; /** * Utility class to create a graph of company model instances from an xml * representation. * * @author Michael Bouschen */ public class CompanyModelReader extends XmlBeanFactory { /** The format of date values in the xml representation */ public static final String DATE_PATTERN = "d/MMM/yyyy"; /** The name of the root list bean. */ public static final String ROOT_LIST_NAME = "root"; /** The bean-factory name in the xml input files. */ public static final String BEAN_FACTORY_NAME = "companyFactory"; /** The company factory instance. */ private CompanyFactory companyFactory; /** * Create a CompanyModelReader for the specified resourceName. * @param resourceName the name of the resource */ public CompanyModelReader(String resourceName) { // Use the class loader of the Company class to find the resource this(resourceName, Company.class.getClassLoader()); } /** * Create a CompanyModelReader for the specified resourceName. * @param resourceName the name of the resource */ public CompanyModelReader(String resourceName, ClassLoader classLoader) { super(new ClassPathResource(resourceName, classLoader)); configureFactory(); } /** * Create a CompanyModelReader for the specified InputStream. * @param stream the input stream */ public CompanyModelReader(InputStream stream) { super(new InputStreamResource(stream)); configureFactory(); } /** * Returns a list of root objects. The method expects to find a bean * called "root" of type list in the xml and returns it. * @return a list of root instances */ public List getRootList() { return (List)getBean(ROOT_LIST_NAME); } /** * Configure the CompanyModelReader, e.g. register CustomEditor classes * to convert the string representation of a property into an instance * of the right type. */ private void configureFactory() { SimpleDateFormat formatter = new SimpleDateFormat(DATE_PATTERN, Locale.US); CustomDateEditor dateEditor = new CustomDateEditor(formatter, true); registerCustomEditor(Date.class, dateEditor); companyFactory = CompanyFactoryRegistry.getInstance(); addSingleton(BEAN_FACTORY_NAME, companyFactory); } // Convenience methods /** * Convenience method returning a Company instance for the specified * name. The method returns null if there is no Company * bean with the specified name. * @param name the name of the bean to return. * @return the instance of the bean or null if there no * Company bean. */ public Company getCompany(String name) { return (Company)getBean(name, Company.class); } /** * Convenience method returning a Department instance for the specified * name. The method returns null if there is no Department * bean with the specified name. * @param name the name of the bean to return. * @return the instance of the bean or null if there no * Department bean. */ public Department getDepartment(String name) { return (Department)getBean(name, Department.class); } /** * Convenience method returning an Employee instance for the specified * name. The method returns null if there is no Employee * bean with the specified name. * @param name the name of the bean to return. * @return the instance of the bean or null if there no * Employee bean. */ public Employee getEmployee(String name) { return (Employee)getBean(name, Employee.class); } /** * Convenience method returning a FullTimeEmployee instance for the * specified name. The method returns null if there is no * FullTimeEmployee bean with the specified name. * @param name the name of the bean to return. * @return the instance of the bean or null if there no * FullTimeEmployee bean. */ public FullTimeEmployee getFullTimeEmployee(String name) { return (FullTimeEmployee)getBean(name, FullTimeEmployee.class); } /** * Convenience method returning a PartTimeEmployee instance for the * specified name. The method returns null if there is no * PartTimeEmployee bean with the specified name. * @param name the name of the bean to return. * @return the instance of the bean or null if there no * PartTimeEmployee bean. */ public PartTimeEmployee getPartTimeEmployee(String name) { return (PartTimeEmployee)getBean(name, PartTimeEmployee.class); } /** * Convenience method returning a Person instance for the specified * name. The method returns null if there is no Person * bean with the specified name. * @param name the name of the bean to return. * @return the instance of the bean or null if there no * Person bean. */ public Person getPerson(String name) { return (Person)getBean(name, Person.class); } /** * @return Returns the tearDownClasses. */ public Class[] getTearDownClassesFromFactory() { return companyFactory.getTearDownClasses(); } /** * @return Returns the tearDownClasses. */ public static Class[] getTearDownClasses() { return CompanyFactoryConcreteClass.tearDownClasses; } public static Date stringToUtilDate(String value) { return ConversionHelper.toUtilDate(DATE_PATTERN, Locale.US, value); } } tck/src/java/org/apache/jdo/tck/pc/companyMapWithoutJoin/Department.java100664 25357 12500110373 26641 0ustarmbouschenstaff 0 0 /* * 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.companyMapWithoutJoin; import java.io.Serializable; import java.io.ObjectInputStream; import java.io.IOException; import java.util.Collections; import java.util.Comparator; import java.util.Map; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a department within a company. */ public class Department implements IDepartment, Serializable, Comparable, Comparator, DeepEquality { public static final int RECOMMENDED_NO_OF_EMPS = 2; private long deptid; private String name; private Company company; private Map roles; /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public Department() {} /** * Construct a Department instance. * @param deptid The department id. * @param name The name of the department. */ public Department(long deptid, String name) { this.deptid = deptid; this.name = name; } /** * Construct a Department instance. * @param deptid The department id. * @param name The name of the department. * @param company The company that the department is associated with. */ public Department(long deptid, String name, ICompany company) { this.deptid = deptid; this.name = name; this.company = (Company)company; } /** * Construct a Department instance. * @param deptid The department id. * @param name The name of the department. * @param company The company that the department is associated with. * @param roles Map of employees and their roles */ public Department(long deptid, String name, Company company, Map roles) { this.deptid = deptid; this.name = name; this.company = (Company)company; this.roles = roles; } /** * Set the id associated with this object. * @param id the id. */ public void setDeptid(long id) { if (this.deptid != 0) throw new IllegalStateException("Id is already set."); this.deptid = id; } /** * Get the department id. * @return The department id. */ public long getDeptid() { return deptid; } /** * Get the name of the department. * @return The name of the department. */ public String getName() { return name; } /** * Set the name of the department. * @param name The name to set for the department. */ public void setName(String name) { this.name = name; } /** * Get the company associated with the department. * @return The company. */ public ICompany getCompany() { return company; } /** * Set the company for the department. * @param company The company to associate with the department. */ public void setCompany(ICompany company) { this.company = (Company)company; } /** * Get the roles in the department as an unmodifiable set. ******************* FIX?? * @return The set of employees in the department, as an unmodifiable * set. */ public Map getRoles() { return roles; } /** * Add an role to the department. * @param role The role to add to the department. * @param emp The employee in the role */ public void addRole(String role, Employee emp) { roles.put(role, emp); } /** * Remove a role from the department. * @param key The key of the role to remove from the department. */ public void removeRole(String key) { roles.remove(key); } /** * Set the roles to be in this department. * @param roles The roles for this department. */ public void setRoles(Map roles) { this.roles = roles; } /** * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the other Department. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { IDepartment otherDept = (IDepartment)other; String where = "Department<" + deptid + ">"; return helper.equals(deptid, otherDept.getDeptid(), where + ".deptid") & helper.equals(name, otherDept.getName(), where + ".name") & helper.deepEquals(roles, otherDept.getRoles(), where + ".roles") & helper.deepEquals(company, otherDept.getCompany(), where + ".company") ; } /** * Returns a String representation of a Department object. * @return a String representation of a Department object. */ public String toString() { return "Department(" + getFieldRepr()+ ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(deptid); rc.append(", name ").append(name); return rc.toString(); } /** * Compares this object with the specified object for order. Returns a * negative integer, zero, or a positive integer as this object is less * than, equal to, or greater than the specified object. * @param o The Object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified object. * @throws ClassCastException - if the specified object's type prevents * it from being compared to this Object. */ public int compareTo(Object o) { return compareTo((IDepartment)o); } /** * Compare two instances. This is a method in Comparator. */ public int compare(Object o1, Object o2) { return compare((IDepartment)o1, (IDepartment)o2); } /** * Compares this object with the specified Department object for * order. Returns a negative integer, zero, or a positive integer as * this object is less than, equal to, or greater than the specified * object. * @param other The Department object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified * Department object. */ public int compareTo(IDepartment other) { return compare(this, other); } /** * Compares its two IDepartment arguments for order. Returns a negative * integer, zero, or a positive integer as the first argument is less * than, equal to, or greater than the second. * @param o1 the first IDepartment object to be compared. * @param o2 the second IDepartment object to be compared. * @return a negative integer, zero, or a positive integer as the first * object is less than, equal to, or greater than the second object. */ public static int compare(IDepartment o1, IDepartment o2) { return EqualityHelper.compare(o1.getDeptid(), o2.getDeptid()); } /** * Indicates whether some other object is "equal to" this one. * @param obj the object with which to compare. * @return true if this object is the same as the obj * argument; false otherwise. */ public boolean equals(Object obj) { if (obj instanceof IDepartment) { return compareTo((IDepartment)obj) == 0; } return false; } /** * Returns a hash code value for the object. * @return a hash code value for this object. */ public int hashCode() { return (int)deptid; } /** * The application identity class associated with the * Department class. */ public static class Oid implements Serializable, Comparable { /** * This field represents the application identifier field * for the Department class. * It must match in name and type with the field in the * Department class. */ public long deptid; /** * The required public, no-arg constructor. */ public Oid() { } /** * A constructor to initialize the identifier field. * @param deptid the deptid of the Department. */ public Oid(long deptid) { this.deptid = deptid; } public Oid(String s) { deptid = Long.parseLong(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + deptid;} /** */ public boolean equals(java.lang.Object obj) { if( obj==null || !this.getClass().equals(obj.getClass()) ) return( false ); Oid o = (Oid) obj; if( this.deptid != o.deptid ) return( false ); return( true ); } /** */ public int hashCode() { return( (int) deptid ); } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } /** */ public int compareTo(Object obj) { // may throw ClassCastException which the user must handle Oid other = (Oid) obj; if( deptid < other.deptid ) return -1; if( deptid > other.deptid ) return 1; return 0; } } } tck/src/java/org/apache/jdo/tck/pc/companyMapWithoutJoin/Employee.java100664 26727 12500110373 26317 0ustarmbouschenstaff 0 0 /* * 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.companyMapWithoutJoin; import java.io.ObjectInputStream; import java.io.IOException; import java.util.Collections; import java.util.Date; import java.util.HashSet; import java.util.Map; import java.util.Set; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents an employee. */ public abstract class Employee extends Person implements IEmployee { private Date hiredate; private double weeklyhours; private Department department; private Department fundingDept; private String role; private Employee manager; private Employee mentor; private Employee protege; private Employee hradvisor; private transient Set team = new HashSet(); // element-type is Employee private transient Set hradvisees = new HashSet(); // element-type is Employee /** This is the JDO-required no-args constructor */ protected Employee() {} /** * Construct an Employee instance. * @param personid The identifier for the person. * @param firstname The first name of the employee. * @param lastname The last name of the employee. * @param middlename The middle name of the employee. * @param birthdate The birth date of the employee. * @param hiredate The date that the employee was hired. * @param role The role of the employee. */ public Employee(long personid, String firstname, String lastname, String middlename, Date birthdate, Date hiredate, String role) { super(personid, firstname, lastname, middlename, birthdate); this.hiredate = hiredate; this.role = role; } /** * Get the date that the employee was hired. * @return The date the employee was hired. */ public Date getHiredate() { return hiredate; } /** * Set the date that the employee was hired. * @param hiredate The date the employee was hired. */ public void setHiredate(Date hiredate) { this.hiredate = hiredate; } /** * Get the weekly hours of the employee. * @return The number of hours per week that the employee works. */ public double getWeeklyhours() { return weeklyhours; } /** * Set the number of hours per week that the employee works. * @param weeklyhours The number of hours per week that the employee * works. */ public void setWeeklyhours(double weeklyhours) { this.weeklyhours = weeklyhours; } /** * Get the role of the employee. * @return The role of th employee. */ public String getRole() { return role; } /** * Set the role of the employee. * @param role The role of the employee. */ public void setRole(String role) { this.role=role; } /** * Get the employee's department. * @return The department associated with the employee. */ public IDepartment getDepartment() { return department; } /** * Set the employee's department. * @param department The department. */ public void setDepartment(IDepartment department) { this.department = (Department)department; } /** * Get the employee's funding department. * @return The funding department associated with the employee. */ public IDepartment getFundingDept() { return fundingDept; } /** * Set the employee's funding department. * @param department The funding department. */ public void setFundingDept(IDepartment department) { this.fundingDept = (Department)department; } /** * Get the employee's manager. * @return The employee's manager. */ public IEmployee getManager() { return manager; } /** * Set the employee's manager. * @param manager The employee's manager. */ public void setManager(IEmployee manager) { this.manager = (Employee)manager; } /** * Get the employee's team. * @return The set of Employees on this employee's team, * returned as an unmodifiable set. */ public Set getTeam() { return Collections.unmodifiableSet(team); } /** * Add an Employee to this employee's team. * This method sets both sides of the relationship, modifying * this employees team to include parameter emp and modifying * emp to set its manager attribute to this object. * @param emp The Employee to add to the team. */ public void addToTeam(Employee emp) { team.add(emp); emp.manager = this; } /** * Remove an Employee from this employee's team. * This method will also set the emp manager to null. * @param emp The Employee to remove from the team. */ public void removeFromTeam(Employee emp) { team.remove(emp); emp.manager = null; } /** * Set the employee's team. * @param team The set of Employees. */ public void setTeam(Set team) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this.team = (team != null) ? new HashSet(team) : null; } /** * Set the mentor for this employee. * @param mentor The mentor for this employee. */ public void setMentor(IEmployee mentor) { this.mentor = (Employee)mentor; } /** * Get the mentor for this employee. * @return The mentor. */ public IEmployee getMentor() { return mentor; } /** * Set the protege for this employee. * @param protege The protege for this employee. */ public void setProtege(IEmployee protege) { this.protege = (Employee)protege; } /** * Get the protege of this employee. * @return The protege of this employee. */ public IEmployee getProtege() { return protege; } /** * Set the HR advisor for this employee. * @param hradvisor The hradvisor for this employee. */ public void setHradvisor(IEmployee hradvisor) { this.hradvisor = (Employee)hradvisor; } /** * Get the HR advisor for the employee. * @return The HR advisor. */ public IEmployee getHradvisor() { return hradvisor; } /** * Get the HR advisees of this HR advisor. * @return An unmodifiable Set containing the * Employees that are HR advisees of this employee. */ public Set getHradvisees() { return Collections.unmodifiableSet(hradvisees); } /** * Add an Employee as an advisee of this HR advisor. * This method also sets the emp hradvisor to reference * this object. In other words, both sides of the relationship are * set. * @param emp The employee to add as an advisee. */ public void addAdvisee(Employee emp) { hradvisees.add(emp); emp.hradvisor = this; } /** * Remove an Employee as an advisee of this HR advisor. * This method also sets the emp hradvisor to null. * In other words, both sides of the relationship are set. * @param emp The employee to add as an HR advisee. */ public void removeAdvisee(Employee emp) { hradvisees.remove(emp); emp.hradvisor = null; } /** * Set the HR advisees of this HR advisor. * @param hradvisees The Employees that are HR advisees of * this employee. */ public void setHradvisees(Set hradvisees) { // workaround: create a new HashSet, because fostore does not // support LinkedHashSet this.hradvisees = (hradvisees != null) ? new HashSet(hradvisees) : null; } /** Serialization support: initialize transient fields. */ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); team = new HashSet(); hradvisees = new HashSet(); } /** * Return a String representation of a Employee object. * @return a String representation of a Employee object. */ public String toString() { return "Employee(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(super.getFieldRepr()); rc.append(", hired ").append( hiredate==null ? "null" : formatter.format(hiredate)); rc.append(", weeklyhours ").append(weeklyhours); rc.append(", role ").append(role); return rc.toString(); } /** * Returns true if all the fields of this instance are * deep equal to the corresponding fields of the specified Employee. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { IEmployee otherEmp = (IEmployee)other; String where = "Employee<" + getPersonid() + ">"; return super.deepCompareFields(otherEmp, helper) & helper.equals(hiredate, otherEmp.getHiredate(), where + ".hiredate") & helper.closeEnough(weeklyhours, otherEmp.getWeeklyhours(), where + ".weeklyhours") & helper.equals(role, otherEmp.getRole(), where + ".role") & helper.deepEquals(department, otherEmp.getDepartment(), where + ".department") & helper.deepEquals(fundingDept, otherEmp.getFundingDept(), where + ".fundingDept") & helper.deepEquals(manager, otherEmp.getManager(), where + ".manager") & helper.deepEquals(mentor, otherEmp.getMentor(), where + ".mentor") & helper.deepEquals(protege, otherEmp.getProtege(), where + ".protege") & helper.deepEquals(hradvisor, otherEmp.getHradvisor(), where + ".hradvisor") & helper.deepEquals(team, otherEmp.getTeam(), where + ".team") & helper.deepEquals(hradvisees, otherEmp.getHradvisees(), where + ".hradvisees"); } } tck/src/java/org/apache/jdo/tck/pc/companyMapWithoutJoin/FullTimeEmployee.java100664 7651 12500110373 27734 0ustarmbouschenstaff 0 0 /* * 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.companyMapWithoutJoin; import java.util.Date; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a full-time employee. */ public class FullTimeEmployee extends Employee implements IFullTimeEmployee { private double salary; /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public FullTimeEmployee() {} /** * Construct a full-time employee. * @param personid The person identifier. * @param first The person's first name. * @param last The person's last name. * @param middle The person's middle name. * @param born The person's birthdate. * @param hired The date that the person was hired. * @param sal The salary of the full-time employee. */ public FullTimeEmployee(long personid, String first, String last, String middle, Date born, Date hired, String role, double sal) { super(personid, first, last, middle, born, hired, role); salary = sal; } /** * Get the salary of the full time employee. * @return The salary of the full time employee. */ public double getSalary() { return salary; } /** * Set the salary for the full-time employee. * @param salary The salary to set for the full-time employee. */ public void setSalary(double salary) { this.salary = salary; } /** * Return a String representation of a FullTimeEmployee object. * @return a String representation of a FullTimeEmployee object. */ public String toString() { return "FullTimeEmployee(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ public String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(super.getFieldRepr()); rc.append(", $").append(salary); return rc.toString(); } /** * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the specified * FullTimeEmployee. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { IFullTimeEmployee otherEmp = (IFullTimeEmployee)other; String where = "FullTimeEmployee<" + getPersonid() + ">"; return super.deepCompareFields(otherEmp, helper) & helper.closeEnough(salary, otherEmp.getSalary(), where + ".salary"); } } tck/src/java/org/apache/jdo/tck/pc/companyMapWithoutJoin/ICompany.java100664 2504 12500110373 26222 0ustarmbouschenstaff 0 0 /* * 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.companyMapWithoutJoin; import java.util.Date; import java.util.Set; /** * This interface represents the persistent state of Company. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ public interface ICompany { long getCompanyid(); Set getDepartments(); Date getFounded(); String getName(); void setCompanyid(long id); void setDepartments(Set depts); void setFounded(Date date); void setName(String string); } tck/src/java/org/apache/jdo/tck/pc/companyMapWithoutJoin/IDepartment.java100664 2453 12500110373 26722 0ustarmbouschenstaff 0 0 /* * 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.companyMapWithoutJoin; import java.util.Map; /** * This interface represents the persistent state of Department. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ public interface IDepartment { long getDeptid(); String getName(); ICompany getCompany(); Map getRoles(); void setDeptid(long deptid); void setName(String name); void setCompany(ICompany company); void setRoles(Map roles); } tck/src/java/org/apache/jdo/tck/pc/companyMapWithoutJoin/IEmployee.java100664 3526 12500110373 26400 0ustarmbouschenstaff 0 0 /* * 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.companyMapWithoutJoin; import java.util.Date; import java.util.Set; /** * This interface represents the persistent state of Employee. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ public interface IEmployee extends IPerson { Date getHiredate(); double getWeeklyhours(); String getRole(); IDepartment getDepartment(); IDepartment getFundingDept(); IEmployee getManager(); Set getTeam(); IEmployee getMentor(); IEmployee getProtege(); IEmployee getHradvisor(); Set getHradvisees(); void setHiredate(Date hiredate); void setWeeklyhours(double weeklyhours); void setRole(String role); void setDepartment(IDepartment department); void setFundingDept(IDepartment department); void setManager(IEmployee manager); void setTeam(Set team); void setMentor(IEmployee mentor); void setProtege(IEmployee protege); void setHradvisor(IEmployee hradvisor); void setHradvisees(Set hradvisees); } tck/src/java/org/apache/jdo/tck/pc/companyMapWithoutJoin/IFullTimeEmployee.java100664 2210 12500110373 30027 0ustarmbouschenstaff 0 0 /* * 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.companyMapWithoutJoin; /** * This interface represents the persistent state of FullTimeEmployee. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ public interface IFullTimeEmployee extends IEmployee { double getSalary(); void setSalary(double salary); } tck/src/java/org/apache/jdo/tck/pc/companyMapWithoutJoin/IPartTimeEmployee.java100664 2201 12500110373 30033 0ustarmbouschenstaff 0 0 /* * 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.companyMapWithoutJoin; /** * This interface represents the persistent state of PartTimeEmployee. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ public interface IPartTimeEmployee extends IEmployee { double getWage(); void setWage(double wage); } tck/src/java/org/apache/jdo/tck/pc/companyMapWithoutJoin/IPerson.java100664 2644 12500110373 26067 0ustarmbouschenstaff 0 0 /* * 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.companyMapWithoutJoin; import java.util.Date; import java.util.Map; /** * This interface represents the persistent state of Person. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ public interface IPerson { long getPersonid(); String getLastname(); String getFirstname(); String getMiddlename(); Date getBirthdate(); void setPersonid(long personid); void setLastname(String lastname); void setFirstname(String firstname); void setMiddlename(String middlename); void setBirthdate(Date birthdate); } tck/src/java/org/apache/jdo/tck/pc/companyMapWithoutJoin/PartTimeEmployee.java100664 7546 12500110373 27743 0ustarmbouschenstaff 0 0 /* * 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.companyMapWithoutJoin; import java.util.Date; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a part-time employee. */ public class PartTimeEmployee extends Employee implements IPartTimeEmployee { private double wage; /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public PartTimeEmployee() {} /** * Construct a part-time employee. * @param personid The identifier for the person. * @param first The person's first name. * @param last The person's last name. * @param middle The person's middle name. * @param born The person's birthdate. * @param hired The date the person was hired. * @param wage The person's wage. */ public PartTimeEmployee(long personid, String first, String last, String middle, Date born, Date hired, String role, double wage ) { super(personid, first, last, middle, born, hired, role); this.wage = wage; } /** * Get the wage of the part-time employee. * @return The wage of the part-time employee. */ public double getWage() { return wage; } /** * Set the wage of the part-time employee. * @param wage The wage of the part-time employee. */ public void setWage(double wage) { this.wage = wage; } /** * Returns a String representation of a PartTimeEmployee object. * @return a String representation of a PartTimeEmployee object. */ public String toString() { return "PartTimeEmployee(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ public String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(super.getFieldRepr()); rc.append(", $" + wage); return rc.toString(); } /** * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the specified * PartTimeEmployee. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { IPartTimeEmployee otherEmp = (IPartTimeEmployee)other; String where = "PartTimeEmployee<" + getPersonid() + ">"; return super.deepCompareFields(otherEmp, helper) & helper.closeEnough(wage, otherEmp.getWage(), where + ".wage"); } } tck/src/java/org/apache/jdo/tck/pc/companyMapWithoutJoin/Person.java100664 24361 12500110373 25776 0ustarmbouschenstaff 0 0 /* * 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.companyMapWithoutJoin; import java.io.Serializable; import java.text.SimpleDateFormat; import java.util.Collections; import java.util.Comparator; import java.util.Date; import java.util.HashMap; import java.util.Map; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; /** * This class represents a person. */ public class Person implements IPerson, Serializable, Comparable, Comparator, DeepEquality { private long personid; private String firstname; private String lastname; private String middlename; private Date birthdate; protected static SimpleDateFormat formatter = new SimpleDateFormat("d/MMM/yyyy"); /** This is the JDO-required no-args constructor. */ protected Person() {} /** * Construct a Person instance. * @param personid The person identifier. * @param firstname The person's first name. * @param lastname The person's last name. * @param middlename The person's middle name. * @param birthdate The person's birthdate. */ public Person(long personid, String firstname, String lastname, String middlename, Date birthdate) { this.personid = personid; this.firstname = firstname; this.lastname = lastname; this.middlename = middlename; this.birthdate = birthdate; } /** * Set the id associated with this object. * @param id the id. */ public void setPersonid(long id) { if (this.personid != 0) throw new IllegalStateException("Id is already set."); this.personid = id; } /** * Get the person's id. * @return The personid. */ public long getPersonid() { return personid; } /** * Set the person's id. * @param personid The personid. */ public void setLastname(long personid) { this.personid = personid; } /** * Get the person's last name. * @return The last name. */ public String getLastname() { return lastname; } /** * Set the person's last name. * @param lastname The last name. */ public void setLastname(String lastname) { this.lastname = lastname; } /** * Get the person's first name. * @return The first name. */ public String getFirstname() { return firstname; } /** * Set the person's first name. * @param firstname The first name. */ public void setFirstname(String firstname) { this.firstname = firstname; } /** * Get the person's middle name. * @return The middle name. */ public String getMiddlename() { return middlename; } /** * Set the person's middle name. * @param middlename The middle name. */ public void setMiddlename(String middlename) { this.middlename = middlename; } /** * Get the person's birthdate. * @return The person's birthdate. */ public Date getBirthdate() { return birthdate; } /** * Set the person's birthdate. * @param birthdate The person's birthdate. */ public void setBirthdate(Date birthdate) { this. birthdate = birthdate; } /** * Returns a String representation of a Person object. * @return a string representation of a Person object. */ public String toString() { return "Person(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(personid); rc.append(", ").append(lastname); rc.append(", ").append(firstname); rc.append(", born ").append( birthdate==null ? "null" : formatter.format(birthdate)); return rc.toString(); } /** * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the specified Person. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { IPerson otherPerson = (IPerson)other; String where = "Person<" + personid + ">"; return helper.equals(personid, otherPerson.getPersonid(), where + ".personid") & helper.equals(firstname, otherPerson.getFirstname(), where + ".firstname") & helper.equals(lastname, otherPerson.getLastname(), where + ".lastname") & helper.equals(middlename, otherPerson.getMiddlename(), where + ".middlename") & helper.equals(birthdate, otherPerson.getBirthdate(), where + ".birthdate") ; } /** * Compares this object with the specified object for order. Returns a * negative integer, zero, or a positive integer as this object is less * than, equal to, or greater than the specified object. * @param o The Object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified object. * @throws ClassCastException - if the specified object's type prevents * it from being compared to this Object. */ public int compareTo(Object o) { return compareTo((IPerson)o); } /** * Compare two instances. This is a method in Comparator. */ public int compare(Object o1, Object o2) { return compare((IPerson)o1, (IPerson)o2); } /** * Compares this object with the specified Person object for * order. Returns a negative integer, zero, or a positive integer as * this object is less than, equal to, or greater than the specified * object. * @param other The Person object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified Person * object. */ public int compareTo(IPerson other) { return compare(this, other); } /** * Compares its two IPerson arguments for order. Returns a negative * integer, zero, or a positive integer as the first argument is less * than, equal to, or greater than the second. * @param o1 the first IPerson object to be compared. * @param o2 the second IPerson object to be compared. * @return a negative integer, zero, or a positive integer as the first * object is less than, equal to, or greater than the second object. */ public static int compare(IPerson o1, IPerson o2) { return EqualityHelper.compare(o1.getPersonid(), o2.getPersonid()); } /** * Indicates whether some other object is "equal to" this one. * @param obj the object with which to compare. * @return true if this object is the same as the obj * argument; false otherwise. */ public boolean equals(Object obj) { if (obj instanceof IPerson) { return compareTo((IPerson)obj) == 0; } return false; } /** * Returns a hash code value for the object. * @return a hash code value for this object. */ public int hashCode() { return (int)personid; } /** * This class is used to represent the application identifier * for the Person class. */ public static class Oid implements Serializable, Comparable { /** * This field represents the identifier for the Person * class. It must match a field in the Person class in * both name and type. */ public long personid; /** * The required public no-arg constructor. */ public Oid() { } /** * Initialize the identifier. * @param personid The person identifier. */ public Oid(long personid) { this.personid = personid; } public Oid(String s) { personid = Long.parseLong(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + personid;} /** */ public boolean equals(java.lang.Object obj) { if( obj==null || !this.getClass().equals(obj.getClass()) ) return( false ); Oid o = (Oid) obj; if( this.personid != o.personid ) return( false ); return( true ); } /** */ public int hashCode() { return( (int) personid ); } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } /** */ public int compareTo(Object obj) { // may throw ClassCastException which the user must handle Oid other = (Oid) obj; if( personid < other.personid ) return -1; if( personid > other.personid ) return 1; return 0; } } } tck/src/java/org/apache/jdo/tck/pc/fieldtypes/AllTypes.java100664 32117 12500110373 24123 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.io.Serializable; import java.util.Date; import java.util.Locale; import java.util.GregorianCalendar; import java.util.Calendar; import java.util.TimeZone; import java.math.BigDecimal; import java.math.BigInteger; import javax.jdo.*; public class AllTypes { private int id; private boolean fld_boolean; private byte fld_byte; private char fld_char; private double fld_double; private float fld_float; private int fld_int; private long fld_long; private short fld_short; private Boolean fld_Boolean; private Byte fld_Byte; private Character fld_Character; private Double fld_Double; private Float fld_Float; private Integer fld_Integer; private Long fld_Long; private Short fld_Short; private String fld_String; private Locale fld_Locale; private Date fld_Date; private BigDecimal fld_BigDecimal; private BigInteger fld_BigInteger; public static int veryLargePositiveInt = Integer.MAX_VALUE - 511; public static int veryLargeNegativeInt = Integer.MIN_VALUE + 512; public static int NUM_VALUES = 10; // should equal number of elements in the following arrays // DO NOT CHANGE THE FOLLOWING VALUES, OR MANY LINES OF CODE IN TESTS MUST CHANGE!!! public static final boolean[] boolean_values = { false, true, true, false, true, false, false, false, true, false }; public static final byte[] byte_values = { Byte.MIN_VALUE, Byte.MAX_VALUE, 0, -100, 100, -10, 10, 50, 50, 75 }; public static final char[] char_values = { Character.MIN_VALUE, Character.MAX_VALUE, ' ', 'A', 'z', 'B', 'F', 'z', 'M', 'M'}; public static final double DOUBLE_SMALLEST = -9999999999999.9; public static final double DOUBLE_LARGEST = 9999999999999.9; public static final double[] double_values = { DOUBLE_SMALLEST, DOUBLE_LARGEST, 0.0, 100.0, 100.0, 50000000.0, -234234.234, 1000000000.0, 350.5, -25.5 }; public static final float FLOAT_SMALLEST = -999999999999.9f; public static final float FLOAT_LARGEST = 999999999999.9f; public static final float[] float_values = { FLOAT_SMALLEST, FLOAT_LARGEST, 0.0f, 100.0f, 100.0f, 50000000.0f, -234.23f, 1000000000.0f, 350.5f, -25.5f }; public static final int[] int_values = { veryLargeNegativeInt, veryLargePositiveInt, 0, 100, 100, 1000, -1000, 1000000, -1000000, 10000}; public static final long[] long_values = { Long.MIN_VALUE, Long.MAX_VALUE, 0, 100, 100, 1000, -1000, 1000000, -1000, -1000000}; public static final short[] short_values = { Short.MIN_VALUE, Short.MAX_VALUE, 0, 100, 100, 1000, -1000, 10000, -10000, -500}; public static final Boolean[] Boolean_values = { new Boolean(false), new Boolean(true), new Boolean(true), new Boolean(false), new Boolean(true), new Boolean(false), new Boolean(false), new Boolean(false), new Boolean(true), new Boolean(false) }; public static final Byte[] Byte_values = { new Byte(Byte.MIN_VALUE), new Byte(Byte.MAX_VALUE), new Byte((byte)0), new Byte((byte)-100), new Byte((byte)100), new Byte((byte)-10), new Byte((byte)10), new Byte((byte)50), new Byte((byte)50), new Byte((byte)75) }; public static final Character[] Character_values = { new Character(Character.MIN_VALUE), new Character(Character.MAX_VALUE), new Character(' '), new Character('A'), new Character('z'), new Character('B'), new Character('F'), new Character('z'), new Character('M'), new Character('M') }; public static final Double[] Double_values = { new Double(DOUBLE_SMALLEST), new Double(DOUBLE_LARGEST), new Double(0.0), new Double(100.0), new Double(100.0), new Double(50000000.0), new Double(-234234.234), new Double(1000000000.0), new Double(350.5), new Double(-25.5) }; public static final Float[] Float_values = { new Float(FLOAT_SMALLEST), new Float(FLOAT_LARGEST), new Float(0.0f), new Float(100.0f), new Float(100.0f), new Float(50000000.0f), new Float(234234.234f), new Float(1000000000.0f), new Float(350.5f), new Float(-25.5f) }; public static final Integer[] Integer_values = { new Integer(veryLargeNegativeInt), new Integer(veryLargePositiveInt), new Integer(0), new Integer(10000), new Integer(100), new Integer(100), new Integer(1000000), new Integer(-1000000), new Integer(-1000), new Integer(1000) }; public static final Long[] Long_values = { new Long(Long.MIN_VALUE), new Long(Long.MAX_VALUE), new Long(0), new Long(100), new Long(-1000), new Long(1000), new Long(-1000), new Long(1000000), new Long(100), new Long(-1000000) }; public static final Short[] Short_values = { new Short(Short.MIN_VALUE), new Short(Short.MAX_VALUE), new Short((short)0), new Short((short)100), new Short((short)100), new Short((short)1000), new Short((short)-1000), new Short((short)10000), new Short((short)-10000), new Short((short)-500) }; public static final String[] String_values = { new String(""), new String("hello world"), new String("JDO has a very nice persistence API"), new String("JDO"), new String("Java"), new String("abcde"), new String("abcdef"), new String("JDO is a breeze to use"), new String("Java"), new String("Long-live JDO") }; public static final Locale[] Locale_values = { Locale.US, Locale.UK, Locale.FRANCE, Locale.GERMANY, Locale.CANADA, Locale.JAPAN, Locale.ITALY, Locale.CHINA, Locale.KOREA, Locale.TAIWAN }; public static final BigDecimal[] BigDecimal_values = { new BigDecimal("24323423423.234234"), new BigDecimal("-1123123.22"), new BigDecimal("100.0"), new BigDecimal("100.0"), new BigDecimal("0"), new BigDecimal("123232.22"), new BigDecimal("-234234.23333"), new BigDecimal("98345983475.23"), new BigDecimal("-23.000034"), new BigDecimal("989899.98889") }; public static final BigInteger[] BigInteger_values = { new BigInteger("-999999999999999999"), new BigInteger("987034534985043985"), new BigInteger("0"), new BigInteger("39582"), new BigInteger("39582"), new BigInteger("1000000000"), new BigInteger("-1000000000"), new BigInteger("153"), new BigInteger("-27345"), new BigInteger("1333330") }; public static final Date[] Date_values = new Date[10]; static { GregorianCalendar gc = new GregorianCalendar(TimeZone.getTimeZone("GMT"), Locale.UK); gc.clear(); gc.set(1999, Calendar.DECEMBER, 31, 9, 0, 0); Date_values[0] = gc.getTime(); gc.set(1957, Calendar.FEBRUARY, 1, 9, 0, 0); Date_values[1] = gc.getTime(); gc.set(2032, Calendar.MARCH, 15, 9, 0, 0); Date_values[2] = gc.getTime(); gc.set(1957, Calendar.FEBRUARY, 1, 9, 0, 0); Date_values[3] = gc.getTime(); gc.set(1995, Calendar.JUNE, 14, 9, 0, 0); Date_values[4] = gc.getTime(); gc.set(1992, Calendar.NOVEMBER, 22, 9, 0, 0); Date_values[5] = gc.getTime(); gc.set(1900, Calendar.JANUARY, 1, 9, 0, 0); Date_values[6] = gc.getTime(); gc.set(2015, Calendar.SEPTEMBER, 15, 9, 0, 0); Date_values[7] = gc.getTime(); gc.set(1979, Calendar.AUGUST, 12, 9, 0, 0); Date_values[8] = gc.getTime(); gc.set(1979, Calendar.AUGUST, 13, 9, 0, 0); Date_values[9] = gc.getTime(); } public AllTypes() { id = 0; } public AllTypes(int id) { this.id = id; } public void setId(int id) { this.id = id; } public boolean getboolean() { return fld_boolean;} public void setboolean(boolean b) { fld_boolean = b;} public byte getbyte() { return fld_byte;} public void setbyte(byte b) { fld_byte = b;} public char getchar() { return fld_char;} public void setchar(char c) { fld_char = c;} public double getdouble() { return fld_double;} public void setdouble(double d) { fld_double = d;} public float getfloat() { return fld_float;} public void setfloat(float f) { fld_float = f;} public int getint() { return fld_int;} public void setint(int i) { fld_int = i;} public long getlong() { return fld_long;} public void setlong(long l) { fld_long = l;} public short getshort() { return fld_short;} public void setshort(short s) { fld_short = s;} public Boolean getBoolean() { return fld_Boolean;} public void setBoolean(Boolean b) { fld_Boolean = b;} public Byte getByte() { return fld_Byte;} public void setByte(Byte b) { fld_Byte = b;} public Character getCharacter() { return fld_Character;} public void setCharacter(Character c){ fld_Character = c;} public Double getDouble() { return fld_Double;} public void setDouble(Double d) { fld_Double = d;} public Float getFloat() { return fld_Float;} public void setFloat(Float f) { fld_Float = f;} public Integer getInteger() { return fld_Integer;} public void setInteger(Integer i) { fld_Integer = i;} public Long getLong() { return fld_Long;} public void setLong(Long l) { fld_Long = l;} public Short getShort() { return fld_Short;} public void setShort(Short s) { fld_Short = s;} public String getString() { return fld_String;} public void setString(String s) { fld_String = s;} public Locale getLocale() { return fld_Locale;} public void setLocale(Locale l) { fld_Locale = l;} public Date getDate() { return fld_Date;} public void setDate(Date d) { fld_Date = d;} public BigDecimal getBigDecimal() { return fld_BigDecimal;} public void setBigDecimal(BigDecimal bd) { fld_BigDecimal = bd;} public BigInteger getBigInteger() { return fld_BigInteger;} public void setBigInteger(BigInteger bi) { fld_BigInteger = bi;} public static void load(PersistenceManager pm) { Transaction t = pm.currentTransaction(); t.begin(); for( int i = 0; i < NUM_VALUES; ++i){ AllTypes o = new AllTypes(i); pm.makePersistent(o); o.setboolean(boolean_values[i]); o.setBoolean(Boolean_values[i]); o.setbyte(byte_values[i]); o.setByte(Byte_values[i]); o.setchar(char_values[i]); o.setCharacter(Character_values[i]); o.setdouble(double_values[i]); o.setDouble(Double_values[i]); o.setfloat(float_values[i]); o.setFloat(Float_values[i]); o.setint(int_values[i]); o.setInteger(Integer_values[i]); o.setlong(long_values[i]); o.setLong(Long_values[i]); o.setshort(short_values[i]); o.setShort(Short_values[i]); o.setString(String_values[i]); o.setLocale(Locale_values[i]); o.setDate(Date_values[i]); o.setBigDecimal(BigDecimal_values[i]); o.setBigInteger(BigInteger_values[i]); } t.commit(); } public static class Oid implements Serializable { public int id; public Oid() { } public Oid(String s) { id = Integer.parseInt(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 k = (Oid)other; return k.id == this.id; } return false; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } } } tck/src/java/org/apache/jdo/tck/pc/fieldtypes/ArrayCollections.java100664 22114 12500110373 25637 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.io.Serializable; import java.util.*; import java.math.*; public class ArrayCollections { public int identifier; public Object [] ArrayOfObject0; public Object [] ArrayOfObject1; public SimpleClass [] ArrayOfSimpleClass2; public SimpleClass [] ArrayOfSimpleClass3; public SimpleInterface [] ArrayOfSimpleInterface4; public SimpleInterface [] ArrayOfSimpleInterface5; public String [] ArrayOfString6; public String [] ArrayOfString7; public Date [] ArrayOfDate8; public Date [] ArrayOfDate9; public Locale [] ArrayOfLocale10; public Locale [] ArrayOfLocale11; public BigDecimal [] ArrayOfBigDecimal12; public BigDecimal [] ArrayOfBigDecimal13; public BigInteger [] ArrayOfBigInteger14; public BigInteger [] ArrayOfBigInteger15; public Byte [] ArrayOfByte16; public Byte [] ArrayOfByte17; public Double [] ArrayOfDouble18; public Double [] ArrayOfDouble19; public Float [] ArrayOfFloat20; public Float [] ArrayOfFloat21; public Integer [] ArrayOfInteger22; public Integer [] ArrayOfInteger23; public Long [] ArrayOfLong24; public Long [] ArrayOfLong25; public Short [] ArrayOfShort26; public Short [] ArrayOfShort27; public SimpleEnum [] ArrayOfSimpleEnum28; public SimpleEnum [] ArrayOfSimpleEnum29; public SimpleEnum [] ArrayOfSimpleEnum30; public static final String [] fieldSpecs = { "serialized=true public Object [] ArrayOfObject0", "embedded-element=false public Object [] ArrayOfObject1", "serialized=true public SimpleClass [] ArrayOfSimpleClass2", "embedded-element=false public SimpleClass [] ArrayOfSimpleClass3", "serialized=true public SimpleInterface [] ArrayOfSimpleInterface4", "embedded-element=false public SimpleInterface [] ArrayOfSimpleInterface5", "embedded-element=false public String [] ArrayOfString6", "embedded-element=true public String [] ArrayOfString7", "embedded-element=false public Date [] ArrayOfDate8", "embedded-element=true public Date [] ArrayOfDate9", "embedded-element=false public Locale [] ArrayOfLocale10", "embedded-element=true public Locale [] ArrayOfLocale11", "embedded-element=false public BigDecimal [] ArrayOfBigDecimal12", "embedded-element=true public BigDecimal [] ArrayOfBigDecimal13", "embedded-element=false public BigInteger [] ArrayOfBigInteger14", "embedded-element=true public BigInteger [] ArrayOfBigInteger15", "embedded-element=false public Byte [] ArrayOfByte16", "embedded-element=true public Byte [] ArrayOfByte17", "embedded-element=false public Double [] ArrayOfDouble18", "embedded-element=true public Double [] ArrayOfDouble19", "embedded-element=false public Float [] ArrayOfFloat20", "embedded-element=true public Float [] ArrayOfFloat21", "embedded-element=false public Integer [] ArrayOfInteger22", "embedded-element=true public Integer [] ArrayOfInteger23", "embedded-element=false public Long [] ArrayOfLong24", "embedded-element=true public Long [] ArrayOfLong25", "embedded-element=false public Short [] ArrayOfShort26", "embedded-element=true public Short [] ArrayOfShort27", "embedded-element=false public SimpleEnum [] ArrayOfSimpleEnum28", "embedded-element=true public SimpleEnum [] ArrayOfSimpleEnum29", "embedded-element=true public SimpleEnum [] ArrayOfSimpleEnum30" }; public int getLength() { return fieldSpecs.length; } public Object [] get(int index) { switch (index) { case(0): return ArrayOfObject0; case(1): return ArrayOfObject1; case(2): return ArrayOfSimpleClass2; case(3): return ArrayOfSimpleClass3; case(4): return ArrayOfSimpleInterface4; case(5): return ArrayOfSimpleInterface5; case(6): return ArrayOfString6; case(7): return ArrayOfString7; case(8): return ArrayOfDate8; case(9): return ArrayOfDate9; case(10): return ArrayOfLocale10; case(11): return ArrayOfLocale11; case(12): return ArrayOfBigDecimal12; case(13): return ArrayOfBigDecimal13; case(14): return ArrayOfBigInteger14; case(15): return ArrayOfBigInteger15; case(16): return ArrayOfByte16; case(17): return ArrayOfByte17; case(18): return ArrayOfDouble18; case(19): return ArrayOfDouble19; case(20): return ArrayOfFloat20; case(21): return ArrayOfFloat21; case(22): return ArrayOfInteger22; case(23): return ArrayOfInteger23; case(24): return ArrayOfLong24; case(25): return ArrayOfLong25; case(26): return ArrayOfShort26; case(27): return ArrayOfShort27; case(28): return ArrayOfSimpleEnum28; case(29): return ArrayOfSimpleEnum29; case(30): return ArrayOfSimpleEnum30; default: throw new IndexOutOfBoundsException(); } } public boolean set(int index, Object [] value) { if(fieldSpecs[index].indexOf("final") != -1) return false; switch (index) { case(0): ArrayOfObject0= (Object []) value ; break; case(1): ArrayOfObject1= (Object []) value ; break; case(2): ArrayOfSimpleClass2= (SimpleClass []) value ; break; case(3): ArrayOfSimpleClass3= (SimpleClass []) value ; break; case(4): ArrayOfSimpleInterface4= (SimpleInterface []) value ; break; case(5): ArrayOfSimpleInterface5= (SimpleInterface []) value ; break; case(6): ArrayOfString6= (String []) value ; break; case(7): ArrayOfString7= (String []) value ; break; case(8): ArrayOfDate8= (Date []) value ; break; case(9): ArrayOfDate9= (Date []) value ; break; case(10): ArrayOfLocale10= (Locale []) value ; break; case(11): ArrayOfLocale11= (Locale []) value ; break; case(12): ArrayOfBigDecimal12= (BigDecimal []) value ; break; case(13): ArrayOfBigDecimal13= (BigDecimal []) value ; break; case(14): ArrayOfBigInteger14= (BigInteger []) value ; break; case(15): ArrayOfBigInteger15= (BigInteger []) value ; break; case(16): ArrayOfByte16= (Byte []) value ; break; case(17): ArrayOfByte17= (Byte []) value ; break; case(18): ArrayOfDouble18= (Double []) value ; break; case(19): ArrayOfDouble19= (Double []) value ; break; case(20): ArrayOfFloat20= (Float []) value ; break; case(21): ArrayOfFloat21= (Float []) value ; break; case(22): ArrayOfInteger22= (Integer []) value ; break; case(23): ArrayOfInteger23= (Integer []) value ; break; case(24): ArrayOfLong24= (Long []) value ; break; case(25): ArrayOfLong25= (Long []) value ; break; case(26): ArrayOfShort26= (Short []) value ; break; case(27): ArrayOfShort27= (Short []) value ; break; case(28): ArrayOfSimpleEnum28= (SimpleEnum []) value ; break; case(29): ArrayOfSimpleEnum29= (SimpleEnum []) value ; break; case(30): ArrayOfSimpleEnum30= (SimpleEnum []) value ; break; default: throw new IndexOutOfBoundsException(); } return true; } public static class Oid implements Serializable { public int identifier; public Oid() { } public Oid(String s) { identifier = Integer.parseInt(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + identifier;} public int hashCode() { return (int)identifier ; } public boolean equals(Object other) { if (other != null && (other instanceof Oid)) { Oid k = (Oid)other; return k.identifier == this.identifier; } return false; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } } } tck/src/java/org/apache/jdo/tck/pc/fieldtypes/ArrayListCollections.java100664 30462 12500110373 26500 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.io.Serializable; import java.util.ArrayList; public class ArrayListCollections { public int identifier; public ArrayList ArrayListOfObject0; public ArrayList ArrayListOfObject1; public ArrayList ArrayListOfObject2; public ArrayList ArrayListOfSimpleClass3; public ArrayList ArrayListOfSimpleClass4; public ArrayList ArrayListOfSimpleClass5; public ArrayList ArrayListOfSimpleInterface6; public ArrayList ArrayListOfSimpleInterface7; public ArrayList ArrayListOfSimpleInterface8; public ArrayList ArrayListOfString9; public ArrayList ArrayListOfString10; public ArrayList ArrayListOfString11; public ArrayList ArrayListOfDate12; public ArrayList ArrayListOfDate13; public ArrayList ArrayListOfDate14; public ArrayList ArrayListOfLocale15; public ArrayList ArrayListOfLocale16; public ArrayList ArrayListOfLocale17; public ArrayList ArrayListOfBigDecimal18; public ArrayList ArrayListOfBigDecimal19; public ArrayList ArrayListOfBigDecimal20; public ArrayList ArrayListOfBigInteger21; public ArrayList ArrayListOfBigInteger22; public ArrayList ArrayListOfBigInteger23; public ArrayList ArrayListOfByte24; public ArrayList ArrayListOfByte25; public ArrayList ArrayListOfByte26; public ArrayList ArrayListOfDouble27; public ArrayList ArrayListOfDouble28; public ArrayList ArrayListOfDouble29; public ArrayList ArrayListOfFloat30; public ArrayList ArrayListOfFloat31; public ArrayList ArrayListOfFloat32; public ArrayList ArrayListOfInteger33; public ArrayList ArrayListOfInteger34; public ArrayList ArrayListOfInteger35; public ArrayList ArrayListOfLong36; public ArrayList ArrayListOfLong37; public ArrayList ArrayListOfLong38; public ArrayList ArrayListOfShort39; public ArrayList ArrayListOfShort40; public ArrayList ArrayListOfShort41; public ArrayList ArrayListOfSimpleEnum42; public ArrayList ArrayListOfSimpleEnum43; public ArrayList ArrayListOfSimpleEnum44; public ArrayList ArrayListOfSimpleEnum45; public ArrayList ArrayListOfSimpleEnum46; public static final String [] fieldSpecs = { "public ArrayList ArrayListOfObject0", "embedded-element=true public ArrayList ArrayListOfObject1", "embedded-element=false public ArrayList ArrayListOfObject2", "public ArrayList ArrayListOfSimpleClass3", "embedded-element=true public ArrayList ArrayListOfSimpleClass4", "embedded-element=false public ArrayList ArrayListOfSimpleClass5", "public ArrayList ArrayListOfSimpleInterface6", "embedded-element=true public ArrayList ArrayListOfSimpleInterface7", "embedded-element=false public ArrayList ArrayListOfSimpleInterface8", "public ArrayList ArrayListOfString9", "embedded-element=true public ArrayList ArrayListOfString10", "embedded-element=false public ArrayList ArrayListOfString11", "public ArrayList ArrayListOfDate12", "embedded-element=true public ArrayList ArrayListOfDate13", "embedded-element=false public ArrayList ArrayListOfDate14", "public ArrayList ArrayListOfLocale15", "embedded-element=true public ArrayList ArrayListOfLocale16", "embedded-element=false public ArrayList ArrayListOfLocale17", "public ArrayList ArrayListOfBigDecimal18", "embedded-element=true public ArrayList ArrayListOfBigDecimal19", "embedded-element=false public ArrayList ArrayListOfBigDecimal20", "public ArrayList ArrayListOfBigInteger21", "embedded-element=true public ArrayList ArrayListOfBigInteger22", "embedded-element=false public ArrayList ArrayListOfBigInteger23", "public ArrayList ArrayListOfByte24", "embedded-element=true public ArrayList ArrayListOfByte25", "embedded-element=false public ArrayList ArrayListOfByte26", "public ArrayList ArrayListOfDouble27", "embedded-element=true public ArrayList ArrayListOfDouble28", "embedded-element=false public ArrayList ArrayListOfDouble29", "public ArrayList ArrayListOfFloat30", "embedded-element=true public ArrayList ArrayListOfFloat31", "embedded-element=false public ArrayList ArrayListOfFloat32", "public ArrayList ArrayListOfInteger33", "embedded-element=true public ArrayList ArrayListOfInteger34", "embedded-element=false public ArrayList ArrayListOfInteger35", "public ArrayList ArrayListOfLong36", "embedded-element=true public ArrayList ArrayListOfLong37", "embedded-element=false public ArrayList ArrayListOfLong38", "public ArrayList ArrayListOfShort39", "embedded-element=true public ArrayList ArrayListOfShort40", "embedded-element=false public ArrayList ArrayListOfShort41", "public ArrayList ArrayListOfSimpleEnum42", "embedded-element=true public ArrayList ArrayListOfSimpleEnum43", "embedded-element=false public ArrayList ArrayListOfSimpleEnum44", "public ArrayList ArrayListOfSimpleEnum45", "embedded-element=false public ArrayList ArrayListOfSimpleEnum46" }; public int getLength() { return fieldSpecs.length; } public ArrayList get(int index) { switch (index) { case(0): return ArrayListOfObject0; case(1): return ArrayListOfObject1; case(2): return ArrayListOfObject2; case(3): return ArrayListOfSimpleClass3; case(4): return ArrayListOfSimpleClass4; case(5): return ArrayListOfSimpleClass5; case(6): return ArrayListOfSimpleInterface6; case(7): return ArrayListOfSimpleInterface7; case(8): return ArrayListOfSimpleInterface8; case(9): return ArrayListOfString9; case(10): return ArrayListOfString10; case(11): return ArrayListOfString11; case(12): return ArrayListOfDate12; case(13): return ArrayListOfDate13; case(14): return ArrayListOfDate14; case(15): return ArrayListOfLocale15; case(16): return ArrayListOfLocale16; case(17): return ArrayListOfLocale17; case(18): return ArrayListOfBigDecimal18; case(19): return ArrayListOfBigDecimal19; case(20): return ArrayListOfBigDecimal20; case(21): return ArrayListOfBigInteger21; case(22): return ArrayListOfBigInteger22; case(23): return ArrayListOfBigInteger23; case(24): return ArrayListOfByte24; case(25): return ArrayListOfByte25; case(26): return ArrayListOfByte26; case(27): return ArrayListOfDouble27; case(28): return ArrayListOfDouble28; case(29): return ArrayListOfDouble29; case(30): return ArrayListOfFloat30; case(31): return ArrayListOfFloat31; case(32): return ArrayListOfFloat32; case(33): return ArrayListOfInteger33; case(34): return ArrayListOfInteger34; case(35): return ArrayListOfInteger35; case(36): return ArrayListOfLong36; case(37): return ArrayListOfLong37; case(38): return ArrayListOfLong38; case(39): return ArrayListOfShort39; case(40): return ArrayListOfShort40; case(41): return ArrayListOfShort41; case(42): return ArrayListOfSimpleEnum42; case(43): return ArrayListOfSimpleEnum43; case(44): return ArrayListOfSimpleEnum44; case(45): return ArrayListOfSimpleEnum45; case(46): return ArrayListOfSimpleEnum46; default: throw new IndexOutOfBoundsException(); } } public boolean set(int index, ArrayList value) { if(fieldSpecs[index].indexOf("final") != -1) return false; switch (index) { case(0): ArrayListOfObject0= value; break; case(1): ArrayListOfObject1= value; break; case(2): ArrayListOfObject2= value; break; case(3): ArrayListOfSimpleClass3= value; break; case(4): ArrayListOfSimpleClass4= value; break; case(5): ArrayListOfSimpleClass5= value; break; case(6): ArrayListOfSimpleInterface6= value; break; case(7): ArrayListOfSimpleInterface7= value; break; case(8): ArrayListOfSimpleInterface8= value; break; case(9): ArrayListOfString9= value; break; case(10): ArrayListOfString10= value; break; case(11): ArrayListOfString11= value; break; case(12): ArrayListOfDate12= value; break; case(13): ArrayListOfDate13= value; break; case(14): ArrayListOfDate14= value; break; case(15): ArrayListOfLocale15= value; break; case(16): ArrayListOfLocale16= value; break; case(17): ArrayListOfLocale17= value; break; case(18): ArrayListOfBigDecimal18= value; break; case(19): ArrayListOfBigDecimal19= value; break; case(20): ArrayListOfBigDecimal20= value; break; case(21): ArrayListOfBigInteger21= value; break; case(22): ArrayListOfBigInteger22= value; break; case(23): ArrayListOfBigInteger23= value; break; case(24): ArrayListOfByte24= value; break; case(25): ArrayListOfByte25= value; break; case(26): ArrayListOfByte26= value; break; case(27): ArrayListOfDouble27= value; break; case(28): ArrayListOfDouble28= value; break; case(29): ArrayListOfDouble29= value; break; case(30): ArrayListOfFloat30= value; break; case(31): ArrayListOfFloat31= value; break; case(32): ArrayListOfFloat32= value; break; case(33): ArrayListOfInteger33= value; break; case(34): ArrayListOfInteger34= value; break; case(35): ArrayListOfInteger35= value; break; case(36): ArrayListOfLong36= value; break; case(37): ArrayListOfLong37= value; break; case(38): ArrayListOfLong38= value; break; case(39): ArrayListOfShort39= value; break; case(40): ArrayListOfShort40= value; break; case(41): ArrayListOfShort41= value; break; case(42): ArrayListOfSimpleEnum42= value; break; case(43): ArrayListOfSimpleEnum43= value; break; case(44): ArrayListOfSimpleEnum44= value; break; case(45): ArrayListOfSimpleEnum45= value; break; case(46): ArrayListOfSimpleEnum46= value; break; default: throw new IndexOutOfBoundsException(); } return true; } public static class Oid implements Serializable { public int identifier; public Oid() { } public Oid(String s) { identifier = Integer.parseInt(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + identifier;} public int hashCode() { return (int)identifier ; } public boolean equals(Object other) { if (other != null && (other instanceof Oid)) { Oid k = (Oid)other; return k.identifier == this.identifier; } return false; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } } } tck/src/java/org/apache/jdo/tck/pc/fieldtypes/CollectionCollections.java100664 27237 12500110373 26667 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.io.Serializable; import java.util.Collection; public class CollectionCollections { public int identifier; public Collection CollectionOfObject0; public Collection CollectionOfObject1; public Collection CollectionOfObject2; public Collection CollectionOfSimpleClass3; public Collection CollectionOfSimpleClass4; public Collection CollectionOfSimpleClass5; public Collection CollectionOfSimpleInterface6; public Collection CollectionOfSimpleInterface7; public Collection CollectionOfSimpleInterface8; public Collection CollectionOfString9; public Collection CollectionOfString10; public Collection CollectionOfString11; public Collection CollectionOfDate12; public Collection CollectionOfDate13; public Collection CollectionOfDate14; public Collection CollectionOfLocale15; public Collection CollectionOfLocale16; public Collection CollectionOfLocale17; public Collection CollectionOfBigDecimal18; public Collection CollectionOfBigDecimal19; public Collection CollectionOfBigDecimal20; public Collection CollectionOfBigInteger21; public Collection CollectionOfBigInteger22; public Collection CollectionOfBigInteger23; public Collection CollectionOfByte24; public Collection CollectionOfByte25; public Collection CollectionOfByte26; public Collection CollectionOfDouble27; public Collection CollectionOfDouble28; public Collection CollectionOfDouble29; public Collection CollectionOfFloat30; public Collection CollectionOfFloat31; public Collection CollectionOfFloat32; public Collection CollectionOfInteger33; public Collection CollectionOfInteger34; public Collection CollectionOfInteger35; public Collection CollectionOfLong36; public Collection CollectionOfLong37; public Collection CollectionOfLong38; public Collection CollectionOfShort39; public Collection CollectionOfShort40; public Collection CollectionOfShort41; public Collection CollectionOfSimpleClass42; public static final String [] fieldSpecs = { "public Collection CollectionOfObject0", "embedded-element=true public Collection CollectionOfObject1", "embedded-element=false public Collection CollectionOfObject2", "public Collection CollectionOfSimpleClass3", "embedded-element=true public Collection CollectionOfSimpleClass4", "embedded-element=false public Collection CollectionOfSimpleClass5", "public Collection CollectionOfSimpleInterface6", "embedded-element=true public Collection CollectionOfSimpleInterface7", "embedded-element=false public Collection CollectionOfSimpleInterface8", "public Collection CollectionOfString9", "embedded-element=true public Collection CollectionOfString10", "embedded-element=false public Collection CollectionOfString11", "public Collection CollectionOfDate12", "embedded-element=true public Collection CollectionOfDate13", "embedded-element=false public Collection CollectionOfDate14", "public Collection CollectionOfLocale15", "embedded-element=true public Collection CollectionOfLocale16", "embedded-element=false public Collection CollectionOfLocale17", "public Collection CollectionOfBigDecimal18", "embedded-element=true public Collection CollectionOfBigDecimal19", "embedded-element=false public Collection CollectionOfBigDecimal20", "public Collection CollectionOfBigInteger21", "embedded-element=true public Collection CollectionOfBigInteger22", "embedded-element=false public Collection CollectionOfBigInteger23", "public Collection CollectionOfByte24", "embedded-element=true public Collection CollectionOfByte25", "embedded-element=false public Collection CollectionOfByte26", "public Collection CollectionOfDouble27", "embedded-element=true public Collection CollectionOfDouble28", "embedded-element=false public Collection CollectionOfDouble29", "public Collection CollectionOfFloat30", "embedded-element=true public Collection CollectionOfFloat31", "embedded-element=false public Collection CollectionOfFloat32", "public Collection CollectionOfInteger33", "embedded-element=true public Collection CollectionOfInteger34", "embedded-element=false public Collection CollectionOfInteger35", "public Collection CollectionOfLong36", "embedded-element=true public Collection CollectionOfLong37", "embedded-element=false public Collection CollectionOfLong38", "public Collection CollectionOfShort39", "embedded-element=true public Collection CollectionOfShort40", "embedded-element=false public Collection CollectionOfShort41", "serialized=true public Collection CollectionOfSimpleClass42" }; public int getLength() { return fieldSpecs.length; } public Collection get(int index) { switch (index) { case(0): return CollectionOfObject0; case(1): return CollectionOfObject1; case(2): return CollectionOfObject2; case(3): return CollectionOfSimpleClass3; case(4): return CollectionOfSimpleClass4; case(5): return CollectionOfSimpleClass5; case(6): return CollectionOfSimpleInterface6; case(7): return CollectionOfSimpleInterface7; case(8): return CollectionOfSimpleInterface8; case(9): return CollectionOfString9; case(10): return CollectionOfString10; case(11): return CollectionOfString11; case(12): return CollectionOfDate12; case(13): return CollectionOfDate13; case(14): return CollectionOfDate14; case(15): return CollectionOfLocale15; case(16): return CollectionOfLocale16; case(17): return CollectionOfLocale17; case(18): return CollectionOfBigDecimal18; case(19): return CollectionOfBigDecimal19; case(20): return CollectionOfBigDecimal20; case(21): return CollectionOfBigInteger21; case(22): return CollectionOfBigInteger22; case(23): return CollectionOfBigInteger23; case(24): return CollectionOfByte24; case(25): return CollectionOfByte25; case(26): return CollectionOfByte26; case(27): return CollectionOfDouble27; case(28): return CollectionOfDouble28; case(29): return CollectionOfDouble29; case(30): return CollectionOfFloat30; case(31): return CollectionOfFloat31; case(32): return CollectionOfFloat32; case(33): return CollectionOfInteger33; case(34): return CollectionOfInteger34; case(35): return CollectionOfInteger35; case(36): return CollectionOfLong36; case(37): return CollectionOfLong37; case(38): return CollectionOfLong38; case(39): return CollectionOfShort39; case(40): return CollectionOfShort40; case(41): return CollectionOfShort41; case(42): return CollectionOfSimpleClass42; default: throw new IndexOutOfBoundsException(); } } public boolean set(int index,Collection value) { if(fieldSpecs[index].indexOf("final") != -1) return false; switch (index) { case(0): CollectionOfObject0= value; break; case(1): CollectionOfObject1= value; break; case(2): CollectionOfObject2= value; break; case(3): CollectionOfSimpleClass3= value; break; case(4): CollectionOfSimpleClass4= value; break; case(5): CollectionOfSimpleClass5= value; break; case(6): CollectionOfSimpleInterface6= value; break; case(7): CollectionOfSimpleInterface7= value; break; case(8): CollectionOfSimpleInterface8= value; break; case(9): CollectionOfString9= value; break; case(10): CollectionOfString10= value; break; case(11): CollectionOfString11= value; break; case(12): CollectionOfDate12= value; break; case(13): CollectionOfDate13= value; break; case(14): CollectionOfDate14= value; break; case(15): CollectionOfLocale15= value; break; case(16): CollectionOfLocale16= value; break; case(17): CollectionOfLocale17= value; break; case(18): CollectionOfBigDecimal18= value; break; case(19): CollectionOfBigDecimal19= value; break; case(20): CollectionOfBigDecimal20= value; break; case(21): CollectionOfBigInteger21= value; break; case(22): CollectionOfBigInteger22= value; break; case(23): CollectionOfBigInteger23= value; break; case(24): CollectionOfByte24= value; break; case(25): CollectionOfByte25= value; break; case(26): CollectionOfByte26= value; break; case(27): CollectionOfDouble27= value; break; case(28): CollectionOfDouble28= value; break; case(29): CollectionOfDouble29= value; break; case(30): CollectionOfFloat30= value; break; case(31): CollectionOfFloat31= value; break; case(32): CollectionOfFloat32= value; break; case(33): CollectionOfInteger33= value; break; case(34): CollectionOfInteger34= value; break; case(35): CollectionOfInteger35= value; break; case(36): CollectionOfLong36= value; break; case(37): CollectionOfLong37= value; break; case(38): CollectionOfLong38= value; break; case(39): CollectionOfShort39= value; break; case(40): CollectionOfShort40= value; break; case(41): CollectionOfShort41= value; break; case(42): CollectionOfSimpleClass42= value; break; default: throw new IndexOutOfBoundsException(); } return true; } public static class Oid implements Serializable { public int identifier; public Oid() { } public Oid(String s) { identifier = Integer.parseInt(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + identifier;} public int hashCode() { return (int)identifier ; } public boolean equals(Object other) { if (other != null && (other instanceof Oid)) { Oid k = (Oid)other; return k.identifier == this.identifier; } return false; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } } } tck/src/java/org/apache/jdo/tck/pc/fieldtypes/FieldsOfBigDecimal.java100664 106526 12500110373 26010 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.io.Serializable; import java.math.*; public class FieldsOfBigDecimal { public int identifier; private BigDecimal BigDecimal0; private BigDecimal BigDecimal1; private BigDecimal BigDecimal2; private BigDecimal BigDecimal3; private BigDecimal BigDecimal4; private BigDecimal BigDecimal5; private BigDecimal BigDecimal6; private BigDecimal BigDecimal7; private static BigDecimal BigDecimal8; private transient BigDecimal BigDecimal9; private transient BigDecimal BigDecimal10; private transient BigDecimal BigDecimal11; private transient BigDecimal BigDecimal12; private transient BigDecimal BigDecimal13; private transient BigDecimal BigDecimal14; private final BigDecimal BigDecimal15 = new BigDecimal(100.15); private volatile BigDecimal BigDecimal16; private volatile BigDecimal BigDecimal17; private volatile BigDecimal BigDecimal18; private volatile BigDecimal BigDecimal19; private volatile BigDecimal BigDecimal20; private volatile BigDecimal BigDecimal21; private volatile BigDecimal BigDecimal22; private volatile BigDecimal BigDecimal23; private static transient BigDecimal BigDecimal24; private static final BigDecimal BigDecimal25 = new BigDecimal(100.15); private static volatile BigDecimal BigDecimal26; private transient final BigDecimal BigDecimal27 = new BigDecimal(100.15); private transient volatile BigDecimal BigDecimal28; private transient volatile BigDecimal BigDecimal29; private transient volatile BigDecimal BigDecimal30; private transient volatile BigDecimal BigDecimal31; private transient volatile BigDecimal BigDecimal32; private transient volatile BigDecimal BigDecimal33; private static transient final BigDecimal BigDecimal34 = new BigDecimal(100.15); private static transient volatile BigDecimal BigDecimal35; public BigDecimal BigDecimal36; public BigDecimal BigDecimal37; public BigDecimal BigDecimal38; public BigDecimal BigDecimal39; public BigDecimal BigDecimal40; public BigDecimal BigDecimal41; public BigDecimal BigDecimal42; public BigDecimal BigDecimal43; public static BigDecimal BigDecimal44; public transient BigDecimal BigDecimal45; public transient BigDecimal BigDecimal46; public transient BigDecimal BigDecimal47; public transient BigDecimal BigDecimal48; public transient BigDecimal BigDecimal49; public transient BigDecimal BigDecimal50; public final BigDecimal BigDecimal51 = new BigDecimal(100.15); public volatile BigDecimal BigDecimal52; public volatile BigDecimal BigDecimal53; public volatile BigDecimal BigDecimal54; public volatile BigDecimal BigDecimal55; public volatile BigDecimal BigDecimal56; public volatile BigDecimal BigDecimal57; public volatile BigDecimal BigDecimal58; public volatile BigDecimal BigDecimal59; public static transient BigDecimal BigDecimal60; public static final BigDecimal BigDecimal61 = new BigDecimal(100.15); public static volatile BigDecimal BigDecimal62; public transient final BigDecimal BigDecimal63 = new BigDecimal(100.15); public transient volatile BigDecimal BigDecimal64; public transient volatile BigDecimal BigDecimal65; public transient volatile BigDecimal BigDecimal66; public transient volatile BigDecimal BigDecimal67; public transient volatile BigDecimal BigDecimal68; public transient volatile BigDecimal BigDecimal69; public static transient final BigDecimal BigDecimal70 = new BigDecimal(100.15); public static transient volatile BigDecimal BigDecimal71; protected BigDecimal BigDecimal72; protected BigDecimal BigDecimal73; protected BigDecimal BigDecimal74; protected BigDecimal BigDecimal75; protected BigDecimal BigDecimal76; protected BigDecimal BigDecimal77; protected BigDecimal BigDecimal78; protected BigDecimal BigDecimal79; protected static BigDecimal BigDecimal80; protected transient BigDecimal BigDecimal81; protected transient BigDecimal BigDecimal82; protected transient BigDecimal BigDecimal83; protected transient BigDecimal BigDecimal84; protected transient BigDecimal BigDecimal85; protected transient BigDecimal BigDecimal86; protected final BigDecimal BigDecimal87 = new BigDecimal(100.15); protected volatile BigDecimal BigDecimal88; protected volatile BigDecimal BigDecimal89; protected volatile BigDecimal BigDecimal90; protected volatile BigDecimal BigDecimal91; protected volatile BigDecimal BigDecimal92; protected volatile BigDecimal BigDecimal93; protected volatile BigDecimal BigDecimal94; protected volatile BigDecimal BigDecimal95; protected static transient BigDecimal BigDecimal96; protected static final BigDecimal BigDecimal97 = new BigDecimal(100.15); protected static volatile BigDecimal BigDecimal98; protected transient final BigDecimal BigDecimal99 = new BigDecimal(100.15); protected transient volatile BigDecimal BigDecimal100; protected transient volatile BigDecimal BigDecimal101; protected transient volatile BigDecimal BigDecimal102; protected transient volatile BigDecimal BigDecimal103; protected transient volatile BigDecimal BigDecimal104; protected transient volatile BigDecimal BigDecimal105; protected static transient final BigDecimal BigDecimal106 = new BigDecimal(100.15); protected static transient volatile BigDecimal BigDecimal107; BigDecimal BigDecimal108; BigDecimal BigDecimal109; BigDecimal BigDecimal110; BigDecimal BigDecimal111; BigDecimal BigDecimal112; BigDecimal BigDecimal113; BigDecimal BigDecimal114; BigDecimal BigDecimal115; static BigDecimal BigDecimal116; transient BigDecimal BigDecimal117; transient BigDecimal BigDecimal118; transient BigDecimal BigDecimal119; transient BigDecimal BigDecimal120; transient BigDecimal BigDecimal121; transient BigDecimal BigDecimal122; final BigDecimal BigDecimal123 = new BigDecimal(100.15); volatile BigDecimal BigDecimal124; volatile BigDecimal BigDecimal125; volatile BigDecimal BigDecimal126; volatile BigDecimal BigDecimal127; volatile BigDecimal BigDecimal128; volatile BigDecimal BigDecimal129; volatile BigDecimal BigDecimal130; volatile BigDecimal BigDecimal131; static transient BigDecimal BigDecimal132; static final BigDecimal BigDecimal133 = new BigDecimal(100.15); static volatile BigDecimal BigDecimal134; transient final BigDecimal BigDecimal135 = new BigDecimal(100.15); transient volatile BigDecimal BigDecimal136; transient volatile BigDecimal BigDecimal137; transient volatile BigDecimal BigDecimal138; transient volatile BigDecimal BigDecimal139; transient volatile BigDecimal BigDecimal140; transient volatile BigDecimal BigDecimal141; static transient final BigDecimal BigDecimal142 = new BigDecimal(100.15); static transient volatile BigDecimal BigDecimal143; public static final boolean [] isPersistent = { true,true,true,false,true,true,true,false,false,false, false,true,true,true,false,false,true,true,true,false, true,true,true,false,false,false,false,false,false,false, true,true,true,false,false,false,true,true,true,false, true,true,true,false,false,false,false,true,true,true, false,false,true,true,true,false,true,true,true,false, false,false,false,false,false,false,true,true,true,false, false,false,true,true,true,false,true,true,true,false, false,false,false,true,true,true,false,false,true,true, true,false,true,true,true,false,false,false,false,false, false,false,true,true,true,false,false,false,true,true, true,false,true,true,true,false,false,false,false,true, true,true,false,false,true,true,true,false,true,true, true,false,false,false,false,false,false,false,true,true, true,false,false,false }; public static final boolean [] isStatic = { false,false,false,false,false,false,false,false,true,false, false,false,false,false,false,false,false,false,false,false, false,false,false,false,true,true,true,false,false,false, false,false,false,false,true,true,false,false,false,false, false,false,false,false,true,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, true,true,true,false,false,false,false,false,false,false, true,true,false,false,false,false,false,false,false,false, true,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,true,true,true,false, false,false,false,false,false,false,true,true,false,false, false,false,false,false,false,false,true,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,true,true,true,false,false,false,false,false, false,false,true,true }; public static final boolean [] isFinal = { false,false,false,false,false,false,false,false,false,false, false,false,false,false,false,true,false,false,false,false, false,false,false,false,false,true,false,true,false,false, false,false,false,false,true,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, false,true,false,false,false,false,false,false,false,false, false,true,false,true,false,false,false,false,false,false, true,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,false,true,false,false, false,false,false,false,false,false,false,true,false,true, false,false,false,false,false,false,true,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,false,true,false,false,false,false,false,false, false,false,false,true,false,true,false,false,false,false, false,false,true,false }; public static final String [] fieldSpecs = { "private BigDecimal BigDecimal0", "embedded= true private BigDecimal BigDecimal1", "embedded= false private BigDecimal BigDecimal2", "persistence-modifier= none private BigDecimal BigDecimal3", "persistence-modifier= persistent private BigDecimal BigDecimal4", "persistence-modifier= persistent embedded= true private BigDecimal BigDecimal5", "persistence-modifier= persistent embedded= false private BigDecimal BigDecimal6", "persistence-modifier= transactional private BigDecimal BigDecimal7", "private static BigDecimal BigDecimal8", "private transient BigDecimal BigDecimal9", "persistence-modifier= none private transient BigDecimal BigDecimal10", "persistence-modifier= persistent private transient BigDecimal BigDecimal11", "persistence-modifier= persistent embedded= true private transient BigDecimal BigDecimal12", "persistence-modifier= persistent embedded= false private transient BigDecimal BigDecimal13", "persistence-modifier= transactional private transient BigDecimal BigDecimal14", "private final BigDecimal BigDecimal15", "private volatile BigDecimal BigDecimal16", "embedded= true private volatile BigDecimal BigDecimal17", "embedded= false private volatile BigDecimal BigDecimal18", "persistence-modifier= none private volatile BigDecimal BigDecimal19", "persistence-modifier= persistent private volatile BigDecimal BigDecimal20", "persistence-modifier= persistent embedded= true private volatile BigDecimal BigDecimal21", "persistence-modifier= persistent embedded= false private volatile BigDecimal BigDecimal22", "persistence-modifier= transactional private volatile BigDecimal BigDecimal23", "private static transient BigDecimal BigDecimal24", "private static final BigDecimal BigDecimal25", "private static volatile BigDecimal BigDecimal26", "private transient final BigDecimal BigDecimal27", "private transient volatile BigDecimal BigDecimal28", "persistence-modifier= none private transient volatile BigDecimal BigDecimal29", "persistence-modifier= persistent private transient volatile BigDecimal BigDecimal30", "persistence-modifier= persistent embedded= true private transient volatile BigDecimal BigDecimal31", "persistence-modifier= persistent embedded= false private transient volatile BigDecimal BigDecimal32", "persistence-modifier= transactional private transient volatile BigDecimal BigDecimal33", "private static transient final BigDecimal BigDecimal34", "private static transient volatile BigDecimal BigDecimal35", "public BigDecimal BigDecimal36", "embedded= true public BigDecimal BigDecimal37", "embedded= false public BigDecimal BigDecimal38", "persistence-modifier= none public BigDecimal BigDecimal39", "persistence-modifier= persistent public BigDecimal BigDecimal40", "persistence-modifier= persistent embedded= true public BigDecimal BigDecimal41", "persistence-modifier= persistent embedded= false public BigDecimal BigDecimal42", "persistence-modifier= transactional public BigDecimal BigDecimal43", "public static BigDecimal BigDecimal44", "public transient BigDecimal BigDecimal45", "persistence-modifier= none public transient BigDecimal BigDecimal46", "persistence-modifier= persistent public transient BigDecimal BigDecimal47", "persistence-modifier= persistent embedded= true public transient BigDecimal BigDecimal48", "persistence-modifier= persistent embedded= false public transient BigDecimal BigDecimal49", "persistence-modifier= transactional public transient BigDecimal BigDecimal50", "public final BigDecimal BigDecimal51", "public volatile BigDecimal BigDecimal52", "embedded= true public volatile BigDecimal BigDecimal53", "embedded= false public volatile BigDecimal BigDecimal54", "persistence-modifier= none public volatile BigDecimal BigDecimal55", "persistence-modifier= persistent public volatile BigDecimal BigDecimal56", "persistence-modifier= persistent embedded= true public volatile BigDecimal BigDecimal57", "persistence-modifier= persistent embedded= false public volatile BigDecimal BigDecimal58", "persistence-modifier= transactional public volatile BigDecimal BigDecimal59", "public static transient BigDecimal BigDecimal60", "public static final BigDecimal BigDecimal61", "public static volatile BigDecimal BigDecimal62", "public transient final BigDecimal BigDecimal63", "public transient volatile BigDecimal BigDecimal64", "persistence-modifier= none public transient volatile BigDecimal BigDecimal65", "persistence-modifier= persistent public transient volatile BigDecimal BigDecimal66", "persistence-modifier= persistent embedded= true public transient volatile BigDecimal BigDecimal67", "persistence-modifier= persistent embedded= false public transient volatile BigDecimal BigDecimal68", "persistence-modifier= transactional public transient volatile BigDecimal BigDecimal69", "public static transient final BigDecimal BigDecimal70", "public static transient volatile BigDecimal BigDecimal71", "protected BigDecimal BigDecimal72", "embedded= true protected BigDecimal BigDecimal73", "embedded= false protected BigDecimal BigDecimal74", "persistence-modifier= none protected BigDecimal BigDecimal75", "persistence-modifier= persistent protected BigDecimal BigDecimal76", "persistence-modifier= persistent embedded= true protected BigDecimal BigDecimal77", "persistence-modifier= persistent embedded= false protected BigDecimal BigDecimal78", "persistence-modifier= transactional protected BigDecimal BigDecimal79", "protected static BigDecimal BigDecimal80", "protected transient BigDecimal BigDecimal81", "persistence-modifier= none protected transient BigDecimal BigDecimal82", "persistence-modifier= persistent protected transient BigDecimal BigDecimal83", "persistence-modifier= persistent embedded= true protected transient BigDecimal BigDecimal84", "persistence-modifier= persistent embedded= false protected transient BigDecimal BigDecimal85", "persistence-modifier= transactional protected transient BigDecimal BigDecimal86", "protected final BigDecimal BigDecimal87", "protected volatile BigDecimal BigDecimal88", "embedded= true protected volatile BigDecimal BigDecimal89", "embedded= false protected volatile BigDecimal BigDecimal90", "persistence-modifier= none protected volatile BigDecimal BigDecimal91", "persistence-modifier= persistent protected volatile BigDecimal BigDecimal92", "persistence-modifier= persistent embedded= true protected volatile BigDecimal BigDecimal93", "persistence-modifier= persistent embedded= false protected volatile BigDecimal BigDecimal94", "persistence-modifier= transactional protected volatile BigDecimal BigDecimal95", "protected static transient BigDecimal BigDecimal96", "protected static final BigDecimal BigDecimal97", "protected static volatile BigDecimal BigDecimal98", "protected transient final BigDecimal BigDecimal99", "protected transient volatile BigDecimal BigDecimal100", "persistence-modifier= none protected transient volatile BigDecimal BigDecimal101", "persistence-modifier= persistent protected transient volatile BigDecimal BigDecimal102", "persistence-modifier= persistent embedded= true protected transient volatile BigDecimal BigDecimal103", "persistence-modifier= persistent embedded= false protected transient volatile BigDecimal BigDecimal104", "persistence-modifier= transactional protected transient volatile BigDecimal BigDecimal105", "protected static transient final BigDecimal BigDecimal106", "protected static transient volatile BigDecimal BigDecimal107", "BigDecimal BigDecimal108", "embedded= true BigDecimal BigDecimal109", "embedded= false BigDecimal BigDecimal110", "persistence-modifier= none BigDecimal BigDecimal111", "persistence-modifier= persistent BigDecimal BigDecimal112", "persistence-modifier= persistent embedded= true BigDecimal BigDecimal113", "persistence-modifier= persistent embedded= false BigDecimal BigDecimal114", "persistence-modifier= transactional BigDecimal BigDecimal115", "static BigDecimal BigDecimal116", "transient BigDecimal BigDecimal117", "persistence-modifier= none transient BigDecimal BigDecimal118", "persistence-modifier= persistent transient BigDecimal BigDecimal119", "persistence-modifier= persistent embedded= true transient BigDecimal BigDecimal120", "persistence-modifier= persistent embedded= false transient BigDecimal BigDecimal121", "persistence-modifier= transactional transient BigDecimal BigDecimal122", "final BigDecimal BigDecimal123", "volatile BigDecimal BigDecimal124", "embedded= true volatile BigDecimal BigDecimal125", "embedded= false volatile BigDecimal BigDecimal126", "persistence-modifier= none volatile BigDecimal BigDecimal127", "persistence-modifier= persistent volatile BigDecimal BigDecimal128", "persistence-modifier= persistent embedded= true volatile BigDecimal BigDecimal129", "persistence-modifier= persistent embedded= false volatile BigDecimal BigDecimal130", "persistence-modifier= transactional volatile BigDecimal BigDecimal131", "static transient BigDecimal BigDecimal132", "static final BigDecimal BigDecimal133", "static volatile BigDecimal BigDecimal134", "transient final BigDecimal BigDecimal135", "transient volatile BigDecimal BigDecimal136", "persistence-modifier= none transient volatile BigDecimal BigDecimal137", "persistence-modifier= persistent transient volatile BigDecimal BigDecimal138", "persistence-modifier= persistent embedded= true transient volatile BigDecimal BigDecimal139", "persistence-modifier= persistent embedded= false transient volatile BigDecimal BigDecimal140", "persistence-modifier= transactional transient volatile BigDecimal BigDecimal141", "static transient final BigDecimal BigDecimal142", "static transient volatile BigDecimal BigDecimal143" }; public int getLength() { return fieldSpecs.length; } public BigDecimal get(int index) { switch (index) { case(0): return BigDecimal0; case(1): return BigDecimal1; case(2): return BigDecimal2; case(3): return BigDecimal3; case(4): return BigDecimal4; case(5): return BigDecimal5; case(6): return BigDecimal6; case(7): return BigDecimal7; case(8): return BigDecimal8; case(9): return BigDecimal9; case(10): return BigDecimal10; case(11): return BigDecimal11; case(12): return BigDecimal12; case(13): return BigDecimal13; case(14): return BigDecimal14; case(15): return BigDecimal15; case(16): return BigDecimal16; case(17): return BigDecimal17; case(18): return BigDecimal18; case(19): return BigDecimal19; case(20): return BigDecimal20; case(21): return BigDecimal21; case(22): return BigDecimal22; case(23): return BigDecimal23; case(24): return BigDecimal24; case(25): return BigDecimal25; case(26): return BigDecimal26; case(27): return BigDecimal27; case(28): return BigDecimal28; case(29): return BigDecimal29; case(30): return BigDecimal30; case(31): return BigDecimal31; case(32): return BigDecimal32; case(33): return BigDecimal33; case(34): return BigDecimal34; case(35): return BigDecimal35; case(36): return BigDecimal36; case(37): return BigDecimal37; case(38): return BigDecimal38; case(39): return BigDecimal39; case(40): return BigDecimal40; case(41): return BigDecimal41; case(42): return BigDecimal42; case(43): return BigDecimal43; case(44): return BigDecimal44; case(45): return BigDecimal45; case(46): return BigDecimal46; case(47): return BigDecimal47; case(48): return BigDecimal48; case(49): return BigDecimal49; case(50): return BigDecimal50; case(51): return BigDecimal51; case(52): return BigDecimal52; case(53): return BigDecimal53; case(54): return BigDecimal54; case(55): return BigDecimal55; case(56): return BigDecimal56; case(57): return BigDecimal57; case(58): return BigDecimal58; case(59): return BigDecimal59; case(60): return BigDecimal60; case(61): return BigDecimal61; case(62): return BigDecimal62; case(63): return BigDecimal63; case(64): return BigDecimal64; case(65): return BigDecimal65; case(66): return BigDecimal66; case(67): return BigDecimal67; case(68): return BigDecimal68; case(69): return BigDecimal69; case(70): return BigDecimal70; case(71): return BigDecimal71; case(72): return BigDecimal72; case(73): return BigDecimal73; case(74): return BigDecimal74; case(75): return BigDecimal75; case(76): return BigDecimal76; case(77): return BigDecimal77; case(78): return BigDecimal78; case(79): return BigDecimal79; case(80): return BigDecimal80; case(81): return BigDecimal81; case(82): return BigDecimal82; case(83): return BigDecimal83; case(84): return BigDecimal84; case(85): return BigDecimal85; case(86): return BigDecimal86; case(87): return BigDecimal87; case(88): return BigDecimal88; case(89): return BigDecimal89; case(90): return BigDecimal90; case(91): return BigDecimal91; case(92): return BigDecimal92; case(93): return BigDecimal93; case(94): return BigDecimal94; case(95): return BigDecimal95; case(96): return BigDecimal96; case(97): return BigDecimal97; case(98): return BigDecimal98; case(99): return BigDecimal99; case(100): return BigDecimal100; case(101): return BigDecimal101; case(102): return BigDecimal102; case(103): return BigDecimal103; case(104): return BigDecimal104; case(105): return BigDecimal105; case(106): return BigDecimal106; case(107): return BigDecimal107; case(108): return BigDecimal108; case(109): return BigDecimal109; case(110): return BigDecimal110; case(111): return BigDecimal111; case(112): return BigDecimal112; case(113): return BigDecimal113; case(114): return BigDecimal114; case(115): return BigDecimal115; case(116): return BigDecimal116; case(117): return BigDecimal117; case(118): return BigDecimal118; case(119): return BigDecimal119; case(120): return BigDecimal120; case(121): return BigDecimal121; case(122): return BigDecimal122; case(123): return BigDecimal123; case(124): return BigDecimal124; case(125): return BigDecimal125; case(126): return BigDecimal126; case(127): return BigDecimal127; case(128): return BigDecimal128; case(129): return BigDecimal129; case(130): return BigDecimal130; case(131): return BigDecimal131; case(132): return BigDecimal132; case(133): return BigDecimal133; case(134): return BigDecimal134; case(135): return BigDecimal135; case(136): return BigDecimal136; case(137): return BigDecimal137; case(138): return BigDecimal138; case(139): return BigDecimal139; case(140): return BigDecimal140; case(141): return BigDecimal141; case(142): return BigDecimal142; case(143): return BigDecimal143; default: throw new IndexOutOfBoundsException(); } } public boolean set(int index,BigDecimal value) { if(fieldSpecs[index].indexOf("final") != -1) return false; switch (index) { case(0): BigDecimal0= value; break; case(1): BigDecimal1= value; break; case(2): BigDecimal2= value; break; case(3): BigDecimal3= value; break; case(4): BigDecimal4= value; break; case(5): BigDecimal5= value; break; case(6): BigDecimal6= value; break; case(7): BigDecimal7= value; break; case(8): BigDecimal8= value; break; case(9): BigDecimal9= value; break; case(10): BigDecimal10= value; break; case(11): BigDecimal11= value; break; case(12): BigDecimal12= value; break; case(13): BigDecimal13= value; break; case(14): BigDecimal14= value; break; case(16): BigDecimal16= value; break; case(17): BigDecimal17= value; break; case(18): BigDecimal18= value; break; case(19): BigDecimal19= value; break; case(20): BigDecimal20= value; break; case(21): BigDecimal21= value; break; case(22): BigDecimal22= value; break; case(23): BigDecimal23= value; break; case(24): BigDecimal24= value; break; case(26): BigDecimal26= value; break; case(28): BigDecimal28= value; break; case(29): BigDecimal29= value; break; case(30): BigDecimal30= value; break; case(31): BigDecimal31= value; break; case(32): BigDecimal32= value; break; case(33): BigDecimal33= value; break; case(35): BigDecimal35= value; break; case(36): BigDecimal36= value; break; case(37): BigDecimal37= value; break; case(38): BigDecimal38= value; break; case(39): BigDecimal39= value; break; case(40): BigDecimal40= value; break; case(41): BigDecimal41= value; break; case(42): BigDecimal42= value; break; case(43): BigDecimal43= value; break; case(44): BigDecimal44= value; break; case(45): BigDecimal45= value; break; case(46): BigDecimal46= value; break; case(47): BigDecimal47= value; break; case(48): BigDecimal48= value; break; case(49): BigDecimal49= value; break; case(50): BigDecimal50= value; break; case(52): BigDecimal52= value; break; case(53): BigDecimal53= value; break; case(54): BigDecimal54= value; break; case(55): BigDecimal55= value; break; case(56): BigDecimal56= value; break; case(57): BigDecimal57= value; break; case(58): BigDecimal58= value; break; case(59): BigDecimal59= value; break; case(60): BigDecimal60= value; break; case(62): BigDecimal62= value; break; case(64): BigDecimal64= value; break; case(65): BigDecimal65= value; break; case(66): BigDecimal66= value; break; case(67): BigDecimal67= value; break; case(68): BigDecimal68= value; break; case(69): BigDecimal69= value; break; case(71): BigDecimal71= value; break; case(72): BigDecimal72= value; break; case(73): BigDecimal73= value; break; case(74): BigDecimal74= value; break; case(75): BigDecimal75= value; break; case(76): BigDecimal76= value; break; case(77): BigDecimal77= value; break; case(78): BigDecimal78= value; break; case(79): BigDecimal79= value; break; case(80): BigDecimal80= value; break; case(81): BigDecimal81= value; break; case(82): BigDecimal82= value; break; case(83): BigDecimal83= value; break; case(84): BigDecimal84= value; break; case(85): BigDecimal85= value; break; case(86): BigDecimal86= value; break; case(88): BigDecimal88= value; break; case(89): BigDecimal89= value; break; case(90): BigDecimal90= value; break; case(91): BigDecimal91= value; break; case(92): BigDecimal92= value; break; case(93): BigDecimal93= value; break; case(94): BigDecimal94= value; break; case(95): BigDecimal95= value; break; case(96): BigDecimal96= value; break; case(98): BigDecimal98= value; break; case(100): BigDecimal100= value; break; case(101): BigDecimal101= value; break; case(102): BigDecimal102= value; break; case(103): BigDecimal103= value; break; case(104): BigDecimal104= value; break; case(105): BigDecimal105= value; break; case(107): BigDecimal107= value; break; case(108): BigDecimal108= value; break; case(109): BigDecimal109= value; break; case(110): BigDecimal110= value; break; case(111): BigDecimal111= value; break; case(112): BigDecimal112= value; break; case(113): BigDecimal113= value; break; case(114): BigDecimal114= value; break; case(115): BigDecimal115= value; break; case(116): BigDecimal116= value; break; case(117): BigDecimal117= value; break; case(118): BigDecimal118= value; break; case(119): BigDecimal119= value; break; case(120): BigDecimal120= value; break; case(121): BigDecimal121= value; break; case(122): BigDecimal122= value; break; case(124): BigDecimal124= value; break; case(125): BigDecimal125= value; break; case(126): BigDecimal126= value; break; case(127): BigDecimal127= value; break; case(128): BigDecimal128= value; break; case(129): BigDecimal129= value; break; case(130): BigDecimal130= value; break; case(131): BigDecimal131= value; break; case(132): BigDecimal132= value; break; case(134): BigDecimal134= value; break; case(136): BigDecimal136= value; break; case(137): BigDecimal137= value; break; case(138): BigDecimal138= value; break; case(139): BigDecimal139= value; break; case(140): BigDecimal140= value; break; case(141): BigDecimal141= value; break; case(143): BigDecimal143= value; break; default: throw new IndexOutOfBoundsException(); } return true; } public static class Oid implements Serializable { public int identifier; public Oid() { } public Oid(String s) { identifier = Integer.parseInt(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + identifier;} public int hashCode() { return (int)identifier ; } public boolean equals(Object other) { if (other != null && (other instanceof Oid)) { Oid k = (Oid)other; return k.identifier == this.identifier; } return false; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } } } tck/src/java/org/apache/jdo/tck/pc/fieldtypes/FieldsOfBigInteger.java100664 106506 12500110373 26045 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.io.Serializable; import java.math.*; public class FieldsOfBigInteger { public int identifier; private BigInteger BigInteger0; private BigInteger BigInteger1; private BigInteger BigInteger2; private BigInteger BigInteger3; private BigInteger BigInteger4; private BigInteger BigInteger5; private BigInteger BigInteger6; private BigInteger BigInteger7; private static BigInteger BigInteger8; private transient BigInteger BigInteger9; private transient BigInteger BigInteger10; private transient BigInteger BigInteger11; private transient BigInteger BigInteger12; private transient BigInteger BigInteger13; private transient BigInteger BigInteger14; private final BigInteger BigInteger15 = new BigInteger("100"); private volatile BigInteger BigInteger16; private volatile BigInteger BigInteger17; private volatile BigInteger BigInteger18; private volatile BigInteger BigInteger19; private volatile BigInteger BigInteger20; private volatile BigInteger BigInteger21; private volatile BigInteger BigInteger22; private volatile BigInteger BigInteger23; private static transient BigInteger BigInteger24; private static final BigInteger BigInteger25 = new BigInteger("100"); private static volatile BigInteger BigInteger26; private transient final BigInteger BigInteger27 = new BigInteger("100"); private transient volatile BigInteger BigInteger28; private transient volatile BigInteger BigInteger29; private transient volatile BigInteger BigInteger30; private transient volatile BigInteger BigInteger31; private transient volatile BigInteger BigInteger32; private transient volatile BigInteger BigInteger33; private static transient final BigInteger BigInteger34 = new BigInteger("100"); private static transient volatile BigInteger BigInteger35; public BigInteger BigInteger36; public BigInteger BigInteger37; public BigInteger BigInteger38; public BigInteger BigInteger39; public BigInteger BigInteger40; public BigInteger BigInteger41; public BigInteger BigInteger42; public BigInteger BigInteger43; public static BigInteger BigInteger44; public transient BigInteger BigInteger45; public transient BigInteger BigInteger46; public transient BigInteger BigInteger47; public transient BigInteger BigInteger48; public transient BigInteger BigInteger49; public transient BigInteger BigInteger50; public final BigInteger BigInteger51 = new BigInteger("100"); public volatile BigInteger BigInteger52; public volatile BigInteger BigInteger53; public volatile BigInteger BigInteger54; public volatile BigInteger BigInteger55; public volatile BigInteger BigInteger56; public volatile BigInteger BigInteger57; public volatile BigInteger BigInteger58; public volatile BigInteger BigInteger59; public static transient BigInteger BigInteger60; public static final BigInteger BigInteger61 = new BigInteger("100"); public static volatile BigInteger BigInteger62; public transient final BigInteger BigInteger63 = new BigInteger("100"); public transient volatile BigInteger BigInteger64; public transient volatile BigInteger BigInteger65; public transient volatile BigInteger BigInteger66; public transient volatile BigInteger BigInteger67; public transient volatile BigInteger BigInteger68; public transient volatile BigInteger BigInteger69; public static transient final BigInteger BigInteger70 = new BigInteger("100"); public static transient volatile BigInteger BigInteger71; protected BigInteger BigInteger72; protected BigInteger BigInteger73; protected BigInteger BigInteger74; protected BigInteger BigInteger75; protected BigInteger BigInteger76; protected BigInteger BigInteger77; protected BigInteger BigInteger78; protected BigInteger BigInteger79; protected static BigInteger BigInteger80; protected transient BigInteger BigInteger81; protected transient BigInteger BigInteger82; protected transient BigInteger BigInteger83; protected transient BigInteger BigInteger84; protected transient BigInteger BigInteger85; protected transient BigInteger BigInteger86; protected final BigInteger BigInteger87 = new BigInteger("100"); protected volatile BigInteger BigInteger88; protected volatile BigInteger BigInteger89; protected volatile BigInteger BigInteger90; protected volatile BigInteger BigInteger91; protected volatile BigInteger BigInteger92; protected volatile BigInteger BigInteger93; protected volatile BigInteger BigInteger94; protected volatile BigInteger BigInteger95; protected static transient BigInteger BigInteger96; protected static final BigInteger BigInteger97 = new BigInteger("100"); protected static volatile BigInteger BigInteger98; protected transient final BigInteger BigInteger99 = new BigInteger("100"); protected transient volatile BigInteger BigInteger100; protected transient volatile BigInteger BigInteger101; protected transient volatile BigInteger BigInteger102; protected transient volatile BigInteger BigInteger103; protected transient volatile BigInteger BigInteger104; protected transient volatile BigInteger BigInteger105; protected static transient final BigInteger BigInteger106 = new BigInteger("100"); protected static transient volatile BigInteger BigInteger107; BigInteger BigInteger108; BigInteger BigInteger109; BigInteger BigInteger110; BigInteger BigInteger111; BigInteger BigInteger112; BigInteger BigInteger113; BigInteger BigInteger114; BigInteger BigInteger115; static BigInteger BigInteger116; transient BigInteger BigInteger117; transient BigInteger BigInteger118; transient BigInteger BigInteger119; transient BigInteger BigInteger120; transient BigInteger BigInteger121; transient BigInteger BigInteger122; final BigInteger BigInteger123 = new BigInteger("100"); volatile BigInteger BigInteger124; volatile BigInteger BigInteger125; volatile BigInteger BigInteger126; volatile BigInteger BigInteger127; volatile BigInteger BigInteger128; volatile BigInteger BigInteger129; volatile BigInteger BigInteger130; volatile BigInteger BigInteger131; static transient BigInteger BigInteger132; static final BigInteger BigInteger133 = new BigInteger("100"); static volatile BigInteger BigInteger134; transient final BigInteger BigInteger135 = new BigInteger("100"); transient volatile BigInteger BigInteger136; transient volatile BigInteger BigInteger137; transient volatile BigInteger BigInteger138; transient volatile BigInteger BigInteger139; transient volatile BigInteger BigInteger140; transient volatile BigInteger BigInteger141; static transient final BigInteger BigInteger142 = new BigInteger("100"); static transient volatile BigInteger BigInteger143; public static final boolean [] isPersistent = { true,true,true,false,true,true,true,false,false,false, false,true,true,true,false,false,true,true,true,false, true,true,true,false,false,false,false,false,false,false, true,true,true,false,false,false,true,true,true,false, true,true,true,false,false,false,false,true,true,true, false,false,true,true,true,false,true,true,true,false, false,false,false,false,false,false,true,true,true,false, false,false,true,true,true,false,true,true,true,false, false,false,false,true,true,true,false,false,true,true, true,false,true,true,true,false,false,false,false,false, false,false,true,true,true,false,false,false,true,true, true,false,true,true,true,false,false,false,false,true, true,true,false,false,true,true,true,false,true,true, true,false,false,false,false,false,false,false,true,true, true,false,false,false }; public static final boolean [] isStatic = { false,false,false,false,false,false,false,false,true,false, false,false,false,false,false,false,false,false,false,false, false,false,false,false,true,true,true,false,false,false, false,false,false,false,true,true,false,false,false,false, false,false,false,false,true,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, true,true,true,false,false,false,false,false,false,false, true,true,false,false,false,false,false,false,false,false, true,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,true,true,true,false, false,false,false,false,false,false,true,true,false,false, false,false,false,false,false,false,true,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,true,true,true,false,false,false,false,false, false,false,true,true }; public static final boolean [] isFinal = { false,false,false,false,false,false,false,false,false,false, false,false,false,false,false,true,false,false,false,false, false,false,false,false,false,true,false,true,false,false, false,false,false,false,true,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, false,true,false,false,false,false,false,false,false,false, false,true,false,true,false,false,false,false,false,false, true,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,false,true,false,false, false,false,false,false,false,false,false,true,false,true, false,false,false,false,false,false,true,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,false,true,false,false,false,false,false,false, false,false,false,true,false,true,false,false,false,false, false,false,true,false }; public static final String [] fieldSpecs = { "private BigInteger BigInteger0", "embedded= true private BigInteger BigInteger1", "embedded= false private BigInteger BigInteger2", "persistence-modifier= none private BigInteger BigInteger3", "persistence-modifier= persistent private BigInteger BigInteger4", "persistence-modifier= persistent embedded= true private BigInteger BigInteger5", "persistence-modifier= persistent embedded= false private BigInteger BigInteger6", "persistence-modifier= transactional private BigInteger BigInteger7", "private static BigInteger BigInteger8", "private transient BigInteger BigInteger9", "persistence-modifier= none private transient BigInteger BigInteger10", "persistence-modifier= persistent private transient BigInteger BigInteger11", "persistence-modifier= persistent embedded= true private transient BigInteger BigInteger12", "persistence-modifier= persistent embedded= false private transient BigInteger BigInteger13", "persistence-modifier= transactional private transient BigInteger BigInteger14", "private final BigInteger BigInteger15", "private volatile BigInteger BigInteger16", "embedded= true private volatile BigInteger BigInteger17", "embedded= false private volatile BigInteger BigInteger18", "persistence-modifier= none private volatile BigInteger BigInteger19", "persistence-modifier= persistent private volatile BigInteger BigInteger20", "persistence-modifier= persistent embedded= true private volatile BigInteger BigInteger21", "persistence-modifier= persistent embedded= false private volatile BigInteger BigInteger22", "persistence-modifier= transactional private volatile BigInteger BigInteger23", "private static transient BigInteger BigInteger24", "private static final BigInteger BigInteger25", "private static volatile BigInteger BigInteger26", "private transient final BigInteger BigInteger27", "private transient volatile BigInteger BigInteger28", "persistence-modifier= none private transient volatile BigInteger BigInteger29", "persistence-modifier= persistent private transient volatile BigInteger BigInteger30", "persistence-modifier= persistent embedded= true private transient volatile BigInteger BigInteger31", "persistence-modifier= persistent embedded= false private transient volatile BigInteger BigInteger32", "persistence-modifier= transactional private transient volatile BigInteger BigInteger33", "private static transient final BigInteger BigInteger34", "private static transient volatile BigInteger BigInteger35", "public BigInteger BigInteger36", "embedded= true public BigInteger BigInteger37", "embedded= false public BigInteger BigInteger38", "persistence-modifier= none public BigInteger BigInteger39", "persistence-modifier= persistent public BigInteger BigInteger40", "persistence-modifier= persistent embedded= true public BigInteger BigInteger41", "persistence-modifier= persistent embedded= false public BigInteger BigInteger42", "persistence-modifier= transactional public BigInteger BigInteger43", "public static BigInteger BigInteger44", "public transient BigInteger BigInteger45", "persistence-modifier= none public transient BigInteger BigInteger46", "persistence-modifier= persistent public transient BigInteger BigInteger47", "persistence-modifier= persistent embedded= true public transient BigInteger BigInteger48", "persistence-modifier= persistent embedded= false public transient BigInteger BigInteger49", "persistence-modifier= transactional public transient BigInteger BigInteger50", "public final BigInteger BigInteger51", "public volatile BigInteger BigInteger52", "embedded= true public volatile BigInteger BigInteger53", "embedded= false public volatile BigInteger BigInteger54", "persistence-modifier= none public volatile BigInteger BigInteger55", "persistence-modifier= persistent public volatile BigInteger BigInteger56", "persistence-modifier= persistent embedded= true public volatile BigInteger BigInteger57", "persistence-modifier= persistent embedded= false public volatile BigInteger BigInteger58", "persistence-modifier= transactional public volatile BigInteger BigInteger59", "public static transient BigInteger BigInteger60", "public static final BigInteger BigInteger61", "public static volatile BigInteger BigInteger62", "public transient final BigInteger BigInteger63", "public transient volatile BigInteger BigInteger64", "persistence-modifier= none public transient volatile BigInteger BigInteger65", "persistence-modifier= persistent public transient volatile BigInteger BigInteger66", "persistence-modifier= persistent embedded= true public transient volatile BigInteger BigInteger67", "persistence-modifier= persistent embedded= false public transient volatile BigInteger BigInteger68", "persistence-modifier= transactional public transient volatile BigInteger BigInteger69", "public static transient final BigInteger BigInteger70", "public static transient volatile BigInteger BigInteger71", "protected BigInteger BigInteger72", "embedded= true protected BigInteger BigInteger73", "embedded= false protected BigInteger BigInteger74", "persistence-modifier= none protected BigInteger BigInteger75", "persistence-modifier= persistent protected BigInteger BigInteger76", "persistence-modifier= persistent embedded= true protected BigInteger BigInteger77", "persistence-modifier= persistent embedded= false protected BigInteger BigInteger78", "persistence-modifier= transactional protected BigInteger BigInteger79", "protected static BigInteger BigInteger80", "protected transient BigInteger BigInteger81", "persistence-modifier= none protected transient BigInteger BigInteger82", "persistence-modifier= persistent protected transient BigInteger BigInteger83", "persistence-modifier= persistent embedded= true protected transient BigInteger BigInteger84", "persistence-modifier= persistent embedded= false protected transient BigInteger BigInteger85", "persistence-modifier= transactional protected transient BigInteger BigInteger86", "protected final BigInteger BigInteger87", "protected volatile BigInteger BigInteger88", "embedded= true protected volatile BigInteger BigInteger89", "embedded= false protected volatile BigInteger BigInteger90", "persistence-modifier= none protected volatile BigInteger BigInteger91", "persistence-modifier= persistent protected volatile BigInteger BigInteger92", "persistence-modifier= persistent embedded= true protected volatile BigInteger BigInteger93", "persistence-modifier= persistent embedded= false protected volatile BigInteger BigInteger94", "persistence-modifier= transactional protected volatile BigInteger BigInteger95", "protected static transient BigInteger BigInteger96", "protected static final BigInteger BigInteger97", "protected static volatile BigInteger BigInteger98", "protected transient final BigInteger BigInteger99", "protected transient volatile BigInteger BigInteger100", "persistence-modifier= none protected transient volatile BigInteger BigInteger101", "persistence-modifier= persistent protected transient volatile BigInteger BigInteger102", "persistence-modifier= persistent embedded= true protected transient volatile BigInteger BigInteger103", "persistence-modifier= persistent embedded= false protected transient volatile BigInteger BigInteger104", "persistence-modifier= transactional protected transient volatile BigInteger BigInteger105", "protected static transient final BigInteger BigInteger106", "protected static transient volatile BigInteger BigInteger107", "BigInteger BigInteger108", "embedded= true BigInteger BigInteger109", "embedded= false BigInteger BigInteger110", "persistence-modifier= none BigInteger BigInteger111", "persistence-modifier= persistent BigInteger BigInteger112", "persistence-modifier= persistent embedded= true BigInteger BigInteger113", "persistence-modifier= persistent embedded= false BigInteger BigInteger114", "persistence-modifier= transactional BigInteger BigInteger115", "static BigInteger BigInteger116", "transient BigInteger BigInteger117", "persistence-modifier= none transient BigInteger BigInteger118", "persistence-modifier= persistent transient BigInteger BigInteger119", "persistence-modifier= persistent embedded= true transient BigInteger BigInteger120", "persistence-modifier= persistent embedded= false transient BigInteger BigInteger121", "persistence-modifier= transactional transient BigInteger BigInteger122", "final BigInteger BigInteger123", "volatile BigInteger BigInteger124", "embedded= true volatile BigInteger BigInteger125", "embedded= false volatile BigInteger BigInteger126", "persistence-modifier= none volatile BigInteger BigInteger127", "persistence-modifier= persistent volatile BigInteger BigInteger128", "persistence-modifier= persistent embedded= true volatile BigInteger BigInteger129", "persistence-modifier= persistent embedded= false volatile BigInteger BigInteger130", "persistence-modifier= transactional volatile BigInteger BigInteger131", "static transient BigInteger BigInteger132", "static final BigInteger BigInteger133", "static volatile BigInteger BigInteger134", "transient final BigInteger BigInteger135", "transient volatile BigInteger BigInteger136", "persistence-modifier= none transient volatile BigInteger BigInteger137", "persistence-modifier= persistent transient volatile BigInteger BigInteger138", "persistence-modifier= persistent embedded= true transient volatile BigInteger BigInteger139", "persistence-modifier= persistent embedded= false transient volatile BigInteger BigInteger140", "persistence-modifier= transactional transient volatile BigInteger BigInteger141", "static transient final BigInteger BigInteger142", "static transient volatile BigInteger BigInteger143" }; public int getLength() { return fieldSpecs.length; } public BigInteger get(int index) { switch (index) { case(0): return BigInteger0; case(1): return BigInteger1; case(2): return BigInteger2; case(3): return BigInteger3; case(4): return BigInteger4; case(5): return BigInteger5; case(6): return BigInteger6; case(7): return BigInteger7; case(8): return BigInteger8; case(9): return BigInteger9; case(10): return BigInteger10; case(11): return BigInteger11; case(12): return BigInteger12; case(13): return BigInteger13; case(14): return BigInteger14; case(15): return BigInteger15; case(16): return BigInteger16; case(17): return BigInteger17; case(18): return BigInteger18; case(19): return BigInteger19; case(20): return BigInteger20; case(21): return BigInteger21; case(22): return BigInteger22; case(23): return BigInteger23; case(24): return BigInteger24; case(25): return BigInteger25; case(26): return BigInteger26; case(27): return BigInteger27; case(28): return BigInteger28; case(29): return BigInteger29; case(30): return BigInteger30; case(31): return BigInteger31; case(32): return BigInteger32; case(33): return BigInteger33; case(34): return BigInteger34; case(35): return BigInteger35; case(36): return BigInteger36; case(37): return BigInteger37; case(38): return BigInteger38; case(39): return BigInteger39; case(40): return BigInteger40; case(41): return BigInteger41; case(42): return BigInteger42; case(43): return BigInteger43; case(44): return BigInteger44; case(45): return BigInteger45; case(46): return BigInteger46; case(47): return BigInteger47; case(48): return BigInteger48; case(49): return BigInteger49; case(50): return BigInteger50; case(51): return BigInteger51; case(52): return BigInteger52; case(53): return BigInteger53; case(54): return BigInteger54; case(55): return BigInteger55; case(56): return BigInteger56; case(57): return BigInteger57; case(58): return BigInteger58; case(59): return BigInteger59; case(60): return BigInteger60; case(61): return BigInteger61; case(62): return BigInteger62; case(63): return BigInteger63; case(64): return BigInteger64; case(65): return BigInteger65; case(66): return BigInteger66; case(67): return BigInteger67; case(68): return BigInteger68; case(69): return BigInteger69; case(70): return BigInteger70; case(71): return BigInteger71; case(72): return BigInteger72; case(73): return BigInteger73; case(74): return BigInteger74; case(75): return BigInteger75; case(76): return BigInteger76; case(77): return BigInteger77; case(78): return BigInteger78; case(79): return BigInteger79; case(80): return BigInteger80; case(81): return BigInteger81; case(82): return BigInteger82; case(83): return BigInteger83; case(84): return BigInteger84; case(85): return BigInteger85; case(86): return BigInteger86; case(87): return BigInteger87; case(88): return BigInteger88; case(89): return BigInteger89; case(90): return BigInteger90; case(91): return BigInteger91; case(92): return BigInteger92; case(93): return BigInteger93; case(94): return BigInteger94; case(95): return BigInteger95; case(96): return BigInteger96; case(97): return BigInteger97; case(98): return BigInteger98; case(99): return BigInteger99; case(100): return BigInteger100; case(101): return BigInteger101; case(102): return BigInteger102; case(103): return BigInteger103; case(104): return BigInteger104; case(105): return BigInteger105; case(106): return BigInteger106; case(107): return BigInteger107; case(108): return BigInteger108; case(109): return BigInteger109; case(110): return BigInteger110; case(111): return BigInteger111; case(112): return BigInteger112; case(113): return BigInteger113; case(114): return BigInteger114; case(115): return BigInteger115; case(116): return BigInteger116; case(117): return BigInteger117; case(118): return BigInteger118; case(119): return BigInteger119; case(120): return BigInteger120; case(121): return BigInteger121; case(122): return BigInteger122; case(123): return BigInteger123; case(124): return BigInteger124; case(125): return BigInteger125; case(126): return BigInteger126; case(127): return BigInteger127; case(128): return BigInteger128; case(129): return BigInteger129; case(130): return BigInteger130; case(131): return BigInteger131; case(132): return BigInteger132; case(133): return BigInteger133; case(134): return BigInteger134; case(135): return BigInteger135; case(136): return BigInteger136; case(137): return BigInteger137; case(138): return BigInteger138; case(139): return BigInteger139; case(140): return BigInteger140; case(141): return BigInteger141; case(142): return BigInteger142; case(143): return BigInteger143; default: throw new IndexOutOfBoundsException(); } } public boolean set(int index,BigInteger value) { if(fieldSpecs[index].indexOf("final") != -1) return false; switch (index) { case(0): BigInteger0= value; break; case(1): BigInteger1= value; break; case(2): BigInteger2= value; break; case(3): BigInteger3= value; break; case(4): BigInteger4= value; break; case(5): BigInteger5= value; break; case(6): BigInteger6= value; break; case(7): BigInteger7= value; break; case(8): BigInteger8= value; break; case(9): BigInteger9= value; break; case(10): BigInteger10= value; break; case(11): BigInteger11= value; break; case(12): BigInteger12= value; break; case(13): BigInteger13= value; break; case(14): BigInteger14= value; break; case(16): BigInteger16= value; break; case(17): BigInteger17= value; break; case(18): BigInteger18= value; break; case(19): BigInteger19= value; break; case(20): BigInteger20= value; break; case(21): BigInteger21= value; break; case(22): BigInteger22= value; break; case(23): BigInteger23= value; break; case(24): BigInteger24= value; break; case(26): BigInteger26= value; break; case(28): BigInteger28= value; break; case(29): BigInteger29= value; break; case(30): BigInteger30= value; break; case(31): BigInteger31= value; break; case(32): BigInteger32= value; break; case(33): BigInteger33= value; break; case(35): BigInteger35= value; break; case(36): BigInteger36= value; break; case(37): BigInteger37= value; break; case(38): BigInteger38= value; break; case(39): BigInteger39= value; break; case(40): BigInteger40= value; break; case(41): BigInteger41= value; break; case(42): BigInteger42= value; break; case(43): BigInteger43= value; break; case(44): BigInteger44= value; break; case(45): BigInteger45= value; break; case(46): BigInteger46= value; break; case(47): BigInteger47= value; break; case(48): BigInteger48= value; break; case(49): BigInteger49= value; break; case(50): BigInteger50= value; break; case(52): BigInteger52= value; break; case(53): BigInteger53= value; break; case(54): BigInteger54= value; break; case(55): BigInteger55= value; break; case(56): BigInteger56= value; break; case(57): BigInteger57= value; break; case(58): BigInteger58= value; break; case(59): BigInteger59= value; break; case(60): BigInteger60= value; break; case(62): BigInteger62= value; break; case(64): BigInteger64= value; break; case(65): BigInteger65= value; break; case(66): BigInteger66= value; break; case(67): BigInteger67= value; break; case(68): BigInteger68= value; break; case(69): BigInteger69= value; break; case(71): BigInteger71= value; break; case(72): BigInteger72= value; break; case(73): BigInteger73= value; break; case(74): BigInteger74= value; break; case(75): BigInteger75= value; break; case(76): BigInteger76= value; break; case(77): BigInteger77= value; break; case(78): BigInteger78= value; break; case(79): BigInteger79= value; break; case(80): BigInteger80= value; break; case(81): BigInteger81= value; break; case(82): BigInteger82= value; break; case(83): BigInteger83= value; break; case(84): BigInteger84= value; break; case(85): BigInteger85= value; break; case(86): BigInteger86= value; break; case(88): BigInteger88= value; break; case(89): BigInteger89= value; break; case(90): BigInteger90= value; break; case(91): BigInteger91= value; break; case(92): BigInteger92= value; break; case(93): BigInteger93= value; break; case(94): BigInteger94= value; break; case(95): BigInteger95= value; break; case(96): BigInteger96= value; break; case(98): BigInteger98= value; break; case(100): BigInteger100= value; break; case(101): BigInteger101= value; break; case(102): BigInteger102= value; break; case(103): BigInteger103= value; break; case(104): BigInteger104= value; break; case(105): BigInteger105= value; break; case(107): BigInteger107= value; break; case(108): BigInteger108= value; break; case(109): BigInteger109= value; break; case(110): BigInteger110= value; break; case(111): BigInteger111= value; break; case(112): BigInteger112= value; break; case(113): BigInteger113= value; break; case(114): BigInteger114= value; break; case(115): BigInteger115= value; break; case(116): BigInteger116= value; break; case(117): BigInteger117= value; break; case(118): BigInteger118= value; break; case(119): BigInteger119= value; break; case(120): BigInteger120= value; break; case(121): BigInteger121= value; break; case(122): BigInteger122= value; break; case(124): BigInteger124= value; break; case(125): BigInteger125= value; break; case(126): BigInteger126= value; break; case(127): BigInteger127= value; break; case(128): BigInteger128= value; break; case(129): BigInteger129= value; break; case(130): BigInteger130= value; break; case(131): BigInteger131= value; break; case(132): BigInteger132= value; break; case(134): BigInteger134= value; break; case(136): BigInteger136= value; break; case(137): BigInteger137= value; break; case(138): BigInteger138= value; break; case(139): BigInteger139= value; break; case(140): BigInteger140= value; break; case(141): BigInteger141= value; break; case(143): BigInteger143= value; break; default: throw new IndexOutOfBoundsException(); } return true; } public static class Oid implements Serializable { public int identifier; public Oid() { } public Oid(String s) { identifier = Integer.parseInt(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + identifier;} public int hashCode() { return (int)identifier ; } public boolean equals(Object other) { if (other != null && (other instanceof Oid)) { Oid k = (Oid)other; return k.identifier == this.identifier; } return false; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } } } tck/src/java/org/apache/jdo/tck/pc/fieldtypes/FieldsOfBoolean.java100664 101411 12500110373 25373 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.io.Serializable; public class FieldsOfBoolean { public int identifier; private Boolean Boolean0; private Boolean Boolean1; private Boolean Boolean2; private Boolean Boolean3; private Boolean Boolean4; private Boolean Boolean5; private Boolean Boolean6; private Boolean Boolean7; private static Boolean Boolean8; private transient Boolean Boolean9; private transient Boolean Boolean10; private transient Boolean Boolean11; private transient Boolean Boolean12; private transient Boolean Boolean13; private transient Boolean Boolean14; private final Boolean Boolean15 = new Boolean(false); private volatile Boolean Boolean16; private volatile Boolean Boolean17; private volatile Boolean Boolean18; private volatile Boolean Boolean19; private volatile Boolean Boolean20; private volatile Boolean Boolean21; private volatile Boolean Boolean22; private volatile Boolean Boolean23; private static transient Boolean Boolean24; private static final Boolean Boolean25 = new Boolean(false); private static volatile Boolean Boolean26; private transient final Boolean Boolean27 = new Boolean(false); private transient volatile Boolean Boolean28; private transient volatile Boolean Boolean29; private transient volatile Boolean Boolean30; private transient volatile Boolean Boolean31; private transient volatile Boolean Boolean32; private transient volatile Boolean Boolean33; private static transient final Boolean Boolean34 = new Boolean(false); private static transient volatile Boolean Boolean35; public Boolean Boolean36; public Boolean Boolean37; public Boolean Boolean38; public Boolean Boolean39; public Boolean Boolean40; public Boolean Boolean41; public Boolean Boolean42; public Boolean Boolean43; public static Boolean Boolean44; public transient Boolean Boolean45; public transient Boolean Boolean46; public transient Boolean Boolean47; public transient Boolean Boolean48; public transient Boolean Boolean49; public transient Boolean Boolean50; public final Boolean Boolean51 = new Boolean(false); public volatile Boolean Boolean52; public volatile Boolean Boolean53; public volatile Boolean Boolean54; public volatile Boolean Boolean55; public volatile Boolean Boolean56; public volatile Boolean Boolean57; public volatile Boolean Boolean58; public volatile Boolean Boolean59; public static transient Boolean Boolean60; public static final Boolean Boolean61 = new Boolean(false); public static volatile Boolean Boolean62; public transient final Boolean Boolean63 = new Boolean(false); public transient volatile Boolean Boolean64; public transient volatile Boolean Boolean65; public transient volatile Boolean Boolean66; public transient volatile Boolean Boolean67; public transient volatile Boolean Boolean68; public transient volatile Boolean Boolean69; public static transient final Boolean Boolean70 = new Boolean(false); public static transient volatile Boolean Boolean71; protected Boolean Boolean72; protected Boolean Boolean73; protected Boolean Boolean74; protected Boolean Boolean75; protected Boolean Boolean76; protected Boolean Boolean77; protected Boolean Boolean78; protected Boolean Boolean79; protected static Boolean Boolean80; protected transient Boolean Boolean81; protected transient Boolean Boolean82; protected transient Boolean Boolean83; protected transient Boolean Boolean84; protected transient Boolean Boolean85; protected transient Boolean Boolean86; protected final Boolean Boolean87 = new Boolean(false); protected volatile Boolean Boolean88; protected volatile Boolean Boolean89; protected volatile Boolean Boolean90; protected volatile Boolean Boolean91; protected volatile Boolean Boolean92; protected volatile Boolean Boolean93; protected volatile Boolean Boolean94; protected volatile Boolean Boolean95; protected static transient Boolean Boolean96; protected static final Boolean Boolean97 = new Boolean(false); protected static volatile Boolean Boolean98; protected transient final Boolean Boolean99 = new Boolean(false); protected transient volatile Boolean Boolean100; protected transient volatile Boolean Boolean101; protected transient volatile Boolean Boolean102; protected transient volatile Boolean Boolean103; protected transient volatile Boolean Boolean104; protected transient volatile Boolean Boolean105; protected static transient final Boolean Boolean106 = new Boolean(false); protected static transient volatile Boolean Boolean107; Boolean Boolean108; Boolean Boolean109; Boolean Boolean110; Boolean Boolean111; Boolean Boolean112; Boolean Boolean113; Boolean Boolean114; Boolean Boolean115; static Boolean Boolean116; transient Boolean Boolean117; transient Boolean Boolean118; transient Boolean Boolean119; transient Boolean Boolean120; transient Boolean Boolean121; transient Boolean Boolean122; final Boolean Boolean123 = new Boolean(false); volatile Boolean Boolean124; volatile Boolean Boolean125; volatile Boolean Boolean126; volatile Boolean Boolean127; volatile Boolean Boolean128; volatile Boolean Boolean129; volatile Boolean Boolean130; volatile Boolean Boolean131; static transient Boolean Boolean132; static final Boolean Boolean133 = new Boolean(false); static volatile Boolean Boolean134; transient final Boolean Boolean135 = new Boolean(false); transient volatile Boolean Boolean136; transient volatile Boolean Boolean137; transient volatile Boolean Boolean138; transient volatile Boolean Boolean139; transient volatile Boolean Boolean140; transient volatile Boolean Boolean141; static transient final Boolean Boolean142 = new Boolean(false); static transient volatile Boolean Boolean143; public static final boolean [] isPersistent = { true,true,true,false,true,true,true,false,false,false, false,true,true,true,false,false,true,true,true,false, true,true,true,false,false,false,false,false,false,false, true,true,true,false,false,false,true,true,true,false, true,true,true,false,false,false,false,true,true,true, false,false,true,true,true,false,true,true,true,false, false,false,false,false,false,false,true,true,true,false, false,false,true,true,true,false,true,true,true,false, false,false,false,true,true,true,false,false,true,true, true,false,true,true,true,false,false,false,false,false, false,false,true,true,true,false,false,false,true,true, true,false,true,true,true,false,false,false,false,true, true,true,false,false,true,true,true,false,true,true, true,false,false,false,false,false,false,false,true,true, true,false,false,false }; public static final boolean [] isStatic = { false,false,false,false,false,false,false,false,true,false, false,false,false,false,false,false,false,false,false,false, false,false,false,false,true,true,true,false,false,false, false,false,false,false,true,true,false,false,false,false, false,false,false,false,true,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, true,true,true,false,false,false,false,false,false,false, true,true,false,false,false,false,false,false,false,false, true,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,true,true,true,false, false,false,false,false,false,false,true,true,false,false, false,false,false,false,false,false,true,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,true,true,true,false,false,false,false,false, false,false,true,true }; public static final boolean [] isFinal = { false,false,false,false,false,false,false,false,false,false, false,false,false,false,false,true,false,false,false,false, false,false,false,false,false,true,false,true,false,false, false,false,false,false,true,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, false,true,false,false,false,false,false,false,false,false, false,true,false,true,false,false,false,false,false,false, true,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,false,true,false,false, false,false,false,false,false,false,false,true,false,true, false,false,false,false,false,false,true,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,false,true,false,false,false,false,false,false, false,false,false,true,false,true,false,false,false,false, false,false,true,false }; public static final String [] fieldSpecs = { "private Boolean Boolean0", "embedded= true private Boolean Boolean1", "embedded= false private Boolean Boolean2", "persistence-modifier= none private Boolean Boolean3", "persistence-modifier= persistent private Boolean Boolean4", "persistence-modifier= persistent embedded= true private Boolean Boolean5", "persistence-modifier= persistent embedded= false private Boolean Boolean6", "persistence-modifier= transactional private Boolean Boolean7", "private static Boolean Boolean8", "private transient Boolean Boolean9", "persistence-modifier= none private transient Boolean Boolean10", "persistence-modifier= persistent private transient Boolean Boolean11", "persistence-modifier= persistent embedded= true private transient Boolean Boolean12", "persistence-modifier= persistent embedded= false private transient Boolean Boolean13", "persistence-modifier= transactional private transient Boolean Boolean14", "private final Boolean Boolean15", "private volatile Boolean Boolean16", "embedded= true private volatile Boolean Boolean17", "embedded= false private volatile Boolean Boolean18", "persistence-modifier= none private volatile Boolean Boolean19", "persistence-modifier= persistent private volatile Boolean Boolean20", "persistence-modifier= persistent embedded= true private volatile Boolean Boolean21", "persistence-modifier= persistent embedded= false private volatile Boolean Boolean22", "persistence-modifier= transactional private volatile Boolean Boolean23", "private static transient Boolean Boolean24", "private static final Boolean Boolean25", "private static volatile Boolean Boolean26", "private transient final Boolean Boolean27", "private transient volatile Boolean Boolean28", "persistence-modifier= none private transient volatile Boolean Boolean29", "persistence-modifier= persistent private transient volatile Boolean Boolean30", "persistence-modifier= persistent embedded= true private transient volatile Boolean Boolean31", "persistence-modifier= persistent embedded= false private transient volatile Boolean Boolean32", "persistence-modifier= transactional private transient volatile Boolean Boolean33", "private static transient final Boolean Boolean34", "private static transient volatile Boolean Boolean35", "public Boolean Boolean36", "embedded= true public Boolean Boolean37", "embedded= false public Boolean Boolean38", "persistence-modifier= none public Boolean Boolean39", "persistence-modifier= persistent public Boolean Boolean40", "persistence-modifier= persistent embedded= true public Boolean Boolean41", "persistence-modifier= persistent embedded= false public Boolean Boolean42", "persistence-modifier= transactional public Boolean Boolean43", "public static Boolean Boolean44", "public transient Boolean Boolean45", "persistence-modifier= none public transient Boolean Boolean46", "persistence-modifier= persistent public transient Boolean Boolean47", "persistence-modifier= persistent embedded= true public transient Boolean Boolean48", "persistence-modifier= persistent embedded= false public transient Boolean Boolean49", "persistence-modifier= transactional public transient Boolean Boolean50", "public final Boolean Boolean51", "public volatile Boolean Boolean52", "embedded= true public volatile Boolean Boolean53", "embedded= false public volatile Boolean Boolean54", "persistence-modifier= none public volatile Boolean Boolean55", "persistence-modifier= persistent public volatile Boolean Boolean56", "persistence-modifier= persistent embedded= true public volatile Boolean Boolean57", "persistence-modifier= persistent embedded= false public volatile Boolean Boolean58", "persistence-modifier= transactional public volatile Boolean Boolean59", "public static transient Boolean Boolean60", "public static final Boolean Boolean61", "public static volatile Boolean Boolean62", "public transient final Boolean Boolean63", "public transient volatile Boolean Boolean64", "persistence-modifier= none public transient volatile Boolean Boolean65", "persistence-modifier= persistent public transient volatile Boolean Boolean66", "persistence-modifier= persistent embedded= true public transient volatile Boolean Boolean67", "persistence-modifier= persistent embedded= false public transient volatile Boolean Boolean68", "persistence-modifier= transactional public transient volatile Boolean Boolean69", "public static transient final Boolean Boolean70", "public static transient volatile Boolean Boolean71", "protected Boolean Boolean72", "embedded= true protected Boolean Boolean73", "embedded= false protected Boolean Boolean74", "persistence-modifier= none protected Boolean Boolean75", "persistence-modifier= persistent protected Boolean Boolean76", "persistence-modifier= persistent embedded= true protected Boolean Boolean77", "persistence-modifier= persistent embedded= false protected Boolean Boolean78", "persistence-modifier= transactional protected Boolean Boolean79", "protected static Boolean Boolean80", "protected transient Boolean Boolean81", "persistence-modifier= none protected transient Boolean Boolean82", "persistence-modifier= persistent protected transient Boolean Boolean83", "persistence-modifier= persistent embedded= true protected transient Boolean Boolean84", "persistence-modifier= persistent embedded= false protected transient Boolean Boolean85", "persistence-modifier= transactional protected transient Boolean Boolean86", "protected final Boolean Boolean87", "protected volatile Boolean Boolean88", "embedded= true protected volatile Boolean Boolean89", "embedded= false protected volatile Boolean Boolean90", "persistence-modifier= none protected volatile Boolean Boolean91", "persistence-modifier= persistent protected volatile Boolean Boolean92", "persistence-modifier= persistent embedded= true protected volatile Boolean Boolean93", "persistence-modifier= persistent embedded= false protected volatile Boolean Boolean94", "persistence-modifier= transactional protected volatile Boolean Boolean95", "protected static transient Boolean Boolean96", "protected static final Boolean Boolean97", "protected static volatile Boolean Boolean98", "protected transient final Boolean Boolean99", "protected transient volatile Boolean Boolean100", "persistence-modifier= none protected transient volatile Boolean Boolean101", "persistence-modifier= persistent protected transient volatile Boolean Boolean102", "persistence-modifier= persistent embedded= true protected transient volatile Boolean Boolean103", "persistence-modifier= persistent embedded= false protected transient volatile Boolean Boolean104", "persistence-modifier= transactional protected transient volatile Boolean Boolean105", "protected static transient final Boolean Boolean106", "protected static transient volatile Boolean Boolean107", "Boolean Boolean108", "embedded= true Boolean Boolean109", "embedded= false Boolean Boolean110", "persistence-modifier= none Boolean Boolean111", "persistence-modifier= persistent Boolean Boolean112", "persistence-modifier= persistent embedded= true Boolean Boolean113", "persistence-modifier= persistent embedded= false Boolean Boolean114", "persistence-modifier= transactional Boolean Boolean115", "static Boolean Boolean116", "transient Boolean Boolean117", "persistence-modifier= none transient Boolean Boolean118", "persistence-modifier= persistent transient Boolean Boolean119", "persistence-modifier= persistent embedded= true transient Boolean Boolean120", "persistence-modifier= persistent embedded= false transient Boolean Boolean121", "persistence-modifier= transactional transient Boolean Boolean122", "final Boolean Boolean123", "volatile Boolean Boolean124", "embedded= true volatile Boolean Boolean125", "embedded= false volatile Boolean Boolean126", "persistence-modifier= none volatile Boolean Boolean127", "persistence-modifier= persistent volatile Boolean Boolean128", "persistence-modifier= persistent embedded= true volatile Boolean Boolean129", "persistence-modifier= persistent embedded= false volatile Boolean Boolean130", "persistence-modifier= transactional volatile Boolean Boolean131", "static transient Boolean Boolean132", "static final Boolean Boolean133", "static volatile Boolean Boolean134", "transient final Boolean Boolean135", "transient volatile Boolean Boolean136", "persistence-modifier= none transient volatile Boolean Boolean137", "persistence-modifier= persistent transient volatile Boolean Boolean138", "persistence-modifier= persistent embedded= true transient volatile Boolean Boolean139", "persistence-modifier= persistent embedded= false transient volatile Boolean Boolean140", "persistence-modifier= transactional transient volatile Boolean Boolean141", "static transient final Boolean Boolean142", "static transient volatile Boolean Boolean143" }; public int getLength() { return fieldSpecs.length; } public Boolean get(int index) { switch (index) { case(0): return Boolean0; case(1): return Boolean1; case(2): return Boolean2; case(3): return Boolean3; case(4): return Boolean4; case(5): return Boolean5; case(6): return Boolean6; case(7): return Boolean7; case(8): return Boolean8; case(9): return Boolean9; case(10): return Boolean10; case(11): return Boolean11; case(12): return Boolean12; case(13): return Boolean13; case(14): return Boolean14; case(15): return Boolean15; case(16): return Boolean16; case(17): return Boolean17; case(18): return Boolean18; case(19): return Boolean19; case(20): return Boolean20; case(21): return Boolean21; case(22): return Boolean22; case(23): return Boolean23; case(24): return Boolean24; case(25): return Boolean25; case(26): return Boolean26; case(27): return Boolean27; case(28): return Boolean28; case(29): return Boolean29; case(30): return Boolean30; case(31): return Boolean31; case(32): return Boolean32; case(33): return Boolean33; case(34): return Boolean34; case(35): return Boolean35; case(36): return Boolean36; case(37): return Boolean37; case(38): return Boolean38; case(39): return Boolean39; case(40): return Boolean40; case(41): return Boolean41; case(42): return Boolean42; case(43): return Boolean43; case(44): return Boolean44; case(45): return Boolean45; case(46): return Boolean46; case(47): return Boolean47; case(48): return Boolean48; case(49): return Boolean49; case(50): return Boolean50; case(51): return Boolean51; case(52): return Boolean52; case(53): return Boolean53; case(54): return Boolean54; case(55): return Boolean55; case(56): return Boolean56; case(57): return Boolean57; case(58): return Boolean58; case(59): return Boolean59; case(60): return Boolean60; case(61): return Boolean61; case(62): return Boolean62; case(63): return Boolean63; case(64): return Boolean64; case(65): return Boolean65; case(66): return Boolean66; case(67): return Boolean67; case(68): return Boolean68; case(69): return Boolean69; case(70): return Boolean70; case(71): return Boolean71; case(72): return Boolean72; case(73): return Boolean73; case(74): return Boolean74; case(75): return Boolean75; case(76): return Boolean76; case(77): return Boolean77; case(78): return Boolean78; case(79): return Boolean79; case(80): return Boolean80; case(81): return Boolean81; case(82): return Boolean82; case(83): return Boolean83; case(84): return Boolean84; case(85): return Boolean85; case(86): return Boolean86; case(87): return Boolean87; case(88): return Boolean88; case(89): return Boolean89; case(90): return Boolean90; case(91): return Boolean91; case(92): return Boolean92; case(93): return Boolean93; case(94): return Boolean94; case(95): return Boolean95; case(96): return Boolean96; case(97): return Boolean97; case(98): return Boolean98; case(99): return Boolean99; case(100): return Boolean100; case(101): return Boolean101; case(102): return Boolean102; case(103): return Boolean103; case(104): return Boolean104; case(105): return Boolean105; case(106): return Boolean106; case(107): return Boolean107; case(108): return Boolean108; case(109): return Boolean109; case(110): return Boolean110; case(111): return Boolean111; case(112): return Boolean112; case(113): return Boolean113; case(114): return Boolean114; case(115): return Boolean115; case(116): return Boolean116; case(117): return Boolean117; case(118): return Boolean118; case(119): return Boolean119; case(120): return Boolean120; case(121): return Boolean121; case(122): return Boolean122; case(123): return Boolean123; case(124): return Boolean124; case(125): return Boolean125; case(126): return Boolean126; case(127): return Boolean127; case(128): return Boolean128; case(129): return Boolean129; case(130): return Boolean130; case(131): return Boolean131; case(132): return Boolean132; case(133): return Boolean133; case(134): return Boolean134; case(135): return Boolean135; case(136): return Boolean136; case(137): return Boolean137; case(138): return Boolean138; case(139): return Boolean139; case(140): return Boolean140; case(141): return Boolean141; case(142): return Boolean142; case(143): return Boolean143; default: throw new IndexOutOfBoundsException(); } } public boolean set(int index,Boolean value) { if(fieldSpecs[index].indexOf("final") != -1) return false; switch (index) { case(0): Boolean0= value; break; case(1): Boolean1= value; break; case(2): Boolean2= value; break; case(3): Boolean3= value; break; case(4): Boolean4= value; break; case(5): Boolean5= value; break; case(6): Boolean6= value; break; case(7): Boolean7= value; break; case(8): Boolean8= value; break; case(9): Boolean9= value; break; case(10): Boolean10= value; break; case(11): Boolean11= value; break; case(12): Boolean12= value; break; case(13): Boolean13= value; break; case(14): Boolean14= value; break; case(16): Boolean16= value; break; case(17): Boolean17= value; break; case(18): Boolean18= value; break; case(19): Boolean19= value; break; case(20): Boolean20= value; break; case(21): Boolean21= value; break; case(22): Boolean22= value; break; case(23): Boolean23= value; break; case(24): Boolean24= value; break; case(26): Boolean26= value; break; case(28): Boolean28= value; break; case(29): Boolean29= value; break; case(30): Boolean30= value; break; case(31): Boolean31= value; break; case(32): Boolean32= value; break; case(33): Boolean33= value; break; case(35): Boolean35= value; break; case(36): Boolean36= value; break; case(37): Boolean37= value; break; case(38): Boolean38= value; break; case(39): Boolean39= value; break; case(40): Boolean40= value; break; case(41): Boolean41= value; break; case(42): Boolean42= value; break; case(43): Boolean43= value; break; case(44): Boolean44= value; break; case(45): Boolean45= value; break; case(46): Boolean46= value; break; case(47): Boolean47= value; break; case(48): Boolean48= value; break; case(49): Boolean49= value; break; case(50): Boolean50= value; break; case(52): Boolean52= value; break; case(53): Boolean53= value; break; case(54): Boolean54= value; break; case(55): Boolean55= value; break; case(56): Boolean56= value; break; case(57): Boolean57= value; break; case(58): Boolean58= value; break; case(59): Boolean59= value; break; case(60): Boolean60= value; break; case(62): Boolean62= value; break; case(64): Boolean64= value; break; case(65): Boolean65= value; break; case(66): Boolean66= value; break; case(67): Boolean67= value; break; case(68): Boolean68= value; break; case(69): Boolean69= value; break; case(71): Boolean71= value; break; case(72): Boolean72= value; break; case(73): Boolean73= value; break; case(74): Boolean74= value; break; case(75): Boolean75= value; break; case(76): Boolean76= value; break; case(77): Boolean77= value; break; case(78): Boolean78= value; break; case(79): Boolean79= value; break; case(80): Boolean80= value; break; case(81): Boolean81= value; break; case(82): Boolean82= value; break; case(83): Boolean83= value; break; case(84): Boolean84= value; break; case(85): Boolean85= value; break; case(86): Boolean86= value; break; case(88): Boolean88= value; break; case(89): Boolean89= value; break; case(90): Boolean90= value; break; case(91): Boolean91= value; break; case(92): Boolean92= value; break; case(93): Boolean93= value; break; case(94): Boolean94= value; break; case(95): Boolean95= value; break; case(96): Boolean96= value; break; case(98): Boolean98= value; break; case(100): Boolean100= value; break; case(101): Boolean101= value; break; case(102): Boolean102= value; break; case(103): Boolean103= value; break; case(104): Boolean104= value; break; case(105): Boolean105= value; break; case(107): Boolean107= value; break; case(108): Boolean108= value; break; case(109): Boolean109= value; break; case(110): Boolean110= value; break; case(111): Boolean111= value; break; case(112): Boolean112= value; break; case(113): Boolean113= value; break; case(114): Boolean114= value; break; case(115): Boolean115= value; break; case(116): Boolean116= value; break; case(117): Boolean117= value; break; case(118): Boolean118= value; break; case(119): Boolean119= value; break; case(120): Boolean120= value; break; case(121): Boolean121= value; break; case(122): Boolean122= value; break; case(124): Boolean124= value; break; case(125): Boolean125= value; break; case(126): Boolean126= value; break; case(127): Boolean127= value; break; case(128): Boolean128= value; break; case(129): Boolean129= value; break; case(130): Boolean130= value; break; case(131): Boolean131= value; break; case(132): Boolean132= value; break; case(134): Boolean134= value; break; case(136): Boolean136= value; break; case(137): Boolean137= value; break; case(138): Boolean138= value; break; case(139): Boolean139= value; break; case(140): Boolean140= value; break; case(141): Boolean141= value; break; case(143): Boolean143= value; break; default: throw new IndexOutOfBoundsException(); } return true; } public static class Oid implements Serializable { public int identifier; public Oid() { } public Oid(String s) { identifier = Integer.parseInt(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + identifier;} public int hashCode() { return (int)identifier ; } public boolean equals(Object other) { if (other != null && (other instanceof Oid)) { Oid k = (Oid)other; return k.identifier == this.identifier; } return false; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } } } tck/src/java/org/apache/jdo/tck/pc/fieldtypes/FieldsOfByte.java100664 74401 12500110373 24707 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.io.Serializable; public class FieldsOfByte { public int identifier; private Byte Byte0; private Byte Byte1; private Byte Byte2; private Byte Byte3; private Byte Byte4; private Byte Byte5; private Byte Byte6; private Byte Byte7; private static Byte Byte8; private transient Byte Byte9; private transient Byte Byte10; private transient Byte Byte11; private transient Byte Byte12; private transient Byte Byte13; private transient Byte Byte14; private final Byte Byte15 = new Byte((byte)5); private volatile Byte Byte16; private volatile Byte Byte17; private volatile Byte Byte18; private volatile Byte Byte19; private volatile Byte Byte20; private volatile Byte Byte21; private volatile Byte Byte22; private volatile Byte Byte23; private static transient Byte Byte24; private static final Byte Byte25 = new Byte((byte)5); private static volatile Byte Byte26; private transient final Byte Byte27 = new Byte((byte)5); private transient volatile Byte Byte28; private transient volatile Byte Byte29; private transient volatile Byte Byte30; private transient volatile Byte Byte31; private transient volatile Byte Byte32; private transient volatile Byte Byte33; private static transient final Byte Byte34 = new Byte((byte)5); private static transient volatile Byte Byte35; public Byte Byte36; public Byte Byte37; public Byte Byte38; public Byte Byte39; public Byte Byte40; public Byte Byte41; public Byte Byte42; public Byte Byte43; public static Byte Byte44; public transient Byte Byte45; public transient Byte Byte46; public transient Byte Byte47; public transient Byte Byte48; public transient Byte Byte49; public transient Byte Byte50; public final Byte Byte51 = new Byte((byte)5); public volatile Byte Byte52; public volatile Byte Byte53; public volatile Byte Byte54; public volatile Byte Byte55; public volatile Byte Byte56; public volatile Byte Byte57; public volatile Byte Byte58; public volatile Byte Byte59; public static transient Byte Byte60; public static final Byte Byte61 = new Byte((byte)5); public static volatile Byte Byte62; public transient final Byte Byte63 = new Byte((byte)5); public transient volatile Byte Byte64; public transient volatile Byte Byte65; public transient volatile Byte Byte66; public transient volatile Byte Byte67; public transient volatile Byte Byte68; public transient volatile Byte Byte69; public static transient final Byte Byte70 = new Byte((byte)5); public static transient volatile Byte Byte71; protected Byte Byte72; protected Byte Byte73; protected Byte Byte74; protected Byte Byte75; protected Byte Byte76; protected Byte Byte77; protected Byte Byte78; protected Byte Byte79; protected static Byte Byte80; protected transient Byte Byte81; protected transient Byte Byte82; protected transient Byte Byte83; protected transient Byte Byte84; protected transient Byte Byte85; protected transient Byte Byte86; protected final Byte Byte87 = new Byte((byte)5); protected volatile Byte Byte88; protected volatile Byte Byte89; protected volatile Byte Byte90; protected volatile Byte Byte91; protected volatile Byte Byte92; protected volatile Byte Byte93; protected volatile Byte Byte94; protected volatile Byte Byte95; protected static transient Byte Byte96; protected static final Byte Byte97 = new Byte((byte)5); protected static volatile Byte Byte98; protected transient final Byte Byte99 = new Byte((byte)5); protected transient volatile Byte Byte100; protected transient volatile Byte Byte101; protected transient volatile Byte Byte102; protected transient volatile Byte Byte103; protected transient volatile Byte Byte104; protected transient volatile Byte Byte105; protected static transient final Byte Byte106 = new Byte((byte)5); protected static transient volatile Byte Byte107; Byte Byte108; Byte Byte109; Byte Byte110; Byte Byte111; Byte Byte112; Byte Byte113; Byte Byte114; Byte Byte115; static Byte Byte116; transient Byte Byte117; transient Byte Byte118; transient Byte Byte119; transient Byte Byte120; transient Byte Byte121; transient Byte Byte122; final Byte Byte123 = new Byte((byte)5); volatile Byte Byte124; volatile Byte Byte125; volatile Byte Byte126; volatile Byte Byte127; volatile Byte Byte128; volatile Byte Byte129; volatile Byte Byte130; volatile Byte Byte131; static transient Byte Byte132; static final Byte Byte133 = new Byte((byte)5); static volatile Byte Byte134; transient final Byte Byte135 = new Byte((byte)5); transient volatile Byte Byte136; transient volatile Byte Byte137; transient volatile Byte Byte138; transient volatile Byte Byte139; transient volatile Byte Byte140; transient volatile Byte Byte141; static transient final Byte Byte142 = new Byte((byte)5); static transient volatile Byte Byte143; public static final boolean [] isPersistent = { true,true,true,false,true,true,true,false,false,false, false,true,true,true,false,false,true,true,true,false, true,true,true,false,false,false,false,false,false,false, true,true,true,false,false,false,true,true,true,false, true,true,true,false,false,false,false,true,true,true, false,false,true,true,true,false,true,true,true,false, false,false,false,false,false,false,true,true,true,false, false,false,true,true,true,false,true,true,true,false, false,false,false,true,true,true,false,false,true,true, true,false,true,true,true,false,false,false,false,false, false,false,true,true,true,false,false,false,true,true, true,false,true,true,true,false,false,false,false,true, true,true,false,false,true,true,true,false,true,true, true,false,false,false,false,false,false,false,true,true, true,false,false,false }; public static final boolean [] isStatic = { false,false,false,false,false,false,false,false,true,false, false,false,false,false,false,false,false,false,false,false, false,false,false,false,true,true,true,false,false,false, false,false,false,false,true,true,false,false,false,false, false,false,false,false,true,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, true,true,true,false,false,false,false,false,false,false, true,true,false,false,false,false,false,false,false,false, true,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,true,true,true,false, false,false,false,false,false,false,true,true,false,false, false,false,false,false,false,false,true,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,true,true,true,false,false,false,false,false, false,false,true,true }; public static final boolean [] isFinal = { false,false,false,false,false,false,false,false,false,false, false,false,false,false,false,true,false,false,false,false, false,false,false,false,false,true,false,true,false,false, false,false,false,false,true,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, false,true,false,false,false,false,false,false,false,false, false,true,false,true,false,false,false,false,false,false, true,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,false,true,false,false, false,false,false,false,false,false,false,true,false,true, false,false,false,false,false,false,true,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,false,true,false,false,false,false,false,false, false,false,false,true,false,true,false,false,false,false, false,false,true,false }; public static final String [] fieldSpecs = { "private Byte Byte0", "embedded= true private Byte Byte1", "embedded= false private Byte Byte2", "persistence-modifier= none private Byte Byte3", "persistence-modifier= persistent private Byte Byte4", "persistence-modifier= persistent embedded= true private Byte Byte5", "persistence-modifier= persistent embedded= false private Byte Byte6", "persistence-modifier= transactional private Byte Byte7", "private static Byte Byte8", "private transient Byte Byte9", "persistence-modifier= none private transient Byte Byte10", "persistence-modifier= persistent private transient Byte Byte11", "persistence-modifier= persistent embedded= true private transient Byte Byte12", "persistence-modifier= persistent embedded= false private transient Byte Byte13", "persistence-modifier= transactional private transient Byte Byte14", "private final Byte Byte15", "private volatile Byte Byte16", "embedded= true private volatile Byte Byte17", "embedded= false private volatile Byte Byte18", "persistence-modifier= none private volatile Byte Byte19", "persistence-modifier= persistent private volatile Byte Byte20", "persistence-modifier= persistent embedded= true private volatile Byte Byte21", "persistence-modifier= persistent embedded= false private volatile Byte Byte22", "persistence-modifier= transactional private volatile Byte Byte23", "private static transient Byte Byte24", "private static final Byte Byte25", "private static volatile Byte Byte26", "private transient final Byte Byte27", "private transient volatile Byte Byte28", "persistence-modifier= none private transient volatile Byte Byte29", "persistence-modifier= persistent private transient volatile Byte Byte30", "persistence-modifier= persistent embedded= true private transient volatile Byte Byte31", "persistence-modifier= persistent embedded= false private transient volatile Byte Byte32", "persistence-modifier= transactional private transient volatile Byte Byte33", "private static transient final Byte Byte34", "private static transient volatile Byte Byte35", "public Byte Byte36", "embedded= true public Byte Byte37", "embedded= false public Byte Byte38", "persistence-modifier= none public Byte Byte39", "persistence-modifier= persistent public Byte Byte40", "persistence-modifier= persistent embedded= true public Byte Byte41", "persistence-modifier= persistent embedded= false public Byte Byte42", "persistence-modifier= transactional public Byte Byte43", "public static Byte Byte44", "public transient Byte Byte45", "persistence-modifier= none public transient Byte Byte46", "persistence-modifier= persistent public transient Byte Byte47", "persistence-modifier= persistent embedded= true public transient Byte Byte48", "persistence-modifier= persistent embedded= false public transient Byte Byte49", "persistence-modifier= transactional public transient Byte Byte50", "public final Byte Byte51", "public volatile Byte Byte52", "embedded= true public volatile Byte Byte53", "embedded= false public volatile Byte Byte54", "persistence-modifier= none public volatile Byte Byte55", "persistence-modifier= persistent public volatile Byte Byte56", "persistence-modifier= persistent embedded= true public volatile Byte Byte57", "persistence-modifier= persistent embedded= false public volatile Byte Byte58", "persistence-modifier= transactional public volatile Byte Byte59", "public static transient Byte Byte60", "public static final Byte Byte61", "public static volatile Byte Byte62", "public transient final Byte Byte63", "public transient volatile Byte Byte64", "persistence-modifier= none public transient volatile Byte Byte65", "persistence-modifier= persistent public transient volatile Byte Byte66", "persistence-modifier= persistent embedded= true public transient volatile Byte Byte67", "persistence-modifier= persistent embedded= false public transient volatile Byte Byte68", "persistence-modifier= transactional public transient volatile Byte Byte69", "public static transient final Byte Byte70", "public static transient volatile Byte Byte71", "protected Byte Byte72", "embedded= true protected Byte Byte73", "embedded= false protected Byte Byte74", "persistence-modifier= none protected Byte Byte75", "persistence-modifier= persistent protected Byte Byte76", "persistence-modifier= persistent embedded= true protected Byte Byte77", "persistence-modifier= persistent embedded= false protected Byte Byte78", "persistence-modifier= transactional protected Byte Byte79", "protected static Byte Byte80", "protected transient Byte Byte81", "persistence-modifier= none protected transient Byte Byte82", "persistence-modifier= persistent protected transient Byte Byte83", "persistence-modifier= persistent embedded= true protected transient Byte Byte84", "persistence-modifier= persistent embedded= false protected transient Byte Byte85", "persistence-modifier= transactional protected transient Byte Byte86", "protected final Byte Byte87", "protected volatile Byte Byte88", "embedded= true protected volatile Byte Byte89", "embedded= false protected volatile Byte Byte90", "persistence-modifier= none protected volatile Byte Byte91", "persistence-modifier= persistent protected volatile Byte Byte92", "persistence-modifier= persistent embedded= true protected volatile Byte Byte93", "persistence-modifier= persistent embedded= false protected volatile Byte Byte94", "persistence-modifier= transactional protected volatile Byte Byte95", "protected static transient Byte Byte96", "protected static final Byte Byte97", "protected static volatile Byte Byte98", "protected transient final Byte Byte99", "protected transient volatile Byte Byte100", "persistence-modifier= none protected transient volatile Byte Byte101", "persistence-modifier= persistent protected transient volatile Byte Byte102", "persistence-modifier= persistent embedded= true protected transient volatile Byte Byte103", "persistence-modifier= persistent embedded= false protected transient volatile Byte Byte104", "persistence-modifier= transactional protected transient volatile Byte Byte105", "protected static transient final Byte Byte106", "protected static transient volatile Byte Byte107", "Byte Byte108", "embedded= true Byte Byte109", "embedded= false Byte Byte110", "persistence-modifier= none Byte Byte111", "persistence-modifier= persistent Byte Byte112", "persistence-modifier= persistent embedded= true Byte Byte113", "persistence-modifier= persistent embedded= false Byte Byte114", "persistence-modifier= transactional Byte Byte115", "static Byte Byte116", "transient Byte Byte117", "persistence-modifier= none transient Byte Byte118", "persistence-modifier= persistent transient Byte Byte119", "persistence-modifier= persistent embedded= true transient Byte Byte120", "persistence-modifier= persistent embedded= false transient Byte Byte121", "persistence-modifier= transactional transient Byte Byte122", "final Byte Byte123", "volatile Byte Byte124", "embedded= true volatile Byte Byte125", "embedded= false volatile Byte Byte126", "persistence-modifier= none volatile Byte Byte127", "persistence-modifier= persistent volatile Byte Byte128", "persistence-modifier= persistent embedded= true volatile Byte Byte129", "persistence-modifier= persistent embedded= false volatile Byte Byte130", "persistence-modifier= transactional volatile Byte Byte131", "static transient Byte Byte132", "static final Byte Byte133", "static volatile Byte Byte134", "transient final Byte Byte135", "transient volatile Byte Byte136", "persistence-modifier= none transient volatile Byte Byte137", "persistence-modifier= persistent transient volatile Byte Byte138", "persistence-modifier= persistent embedded= true transient volatile Byte Byte139", "persistence-modifier= persistent embedded= false transient volatile Byte Byte140", "persistence-modifier= transactional transient volatile Byte Byte141", "static transient final Byte Byte142", "static transient volatile Byte Byte143" }; public int getLength() { return fieldSpecs.length; } public Byte get(int index) { switch (index) { case(0): return Byte0; case(1): return Byte1; case(2): return Byte2; case(3): return Byte3; case(4): return Byte4; case(5): return Byte5; case(6): return Byte6; case(7): return Byte7; case(8): return Byte8; case(9): return Byte9; case(10): return Byte10; case(11): return Byte11; case(12): return Byte12; case(13): return Byte13; case(14): return Byte14; case(15): return Byte15; case(16): return Byte16; case(17): return Byte17; case(18): return Byte18; case(19): return Byte19; case(20): return Byte20; case(21): return Byte21; case(22): return Byte22; case(23): return Byte23; case(24): return Byte24; case(25): return Byte25; case(26): return Byte26; case(27): return Byte27; case(28): return Byte28; case(29): return Byte29; case(30): return Byte30; case(31): return Byte31; case(32): return Byte32; case(33): return Byte33; case(34): return Byte34; case(35): return Byte35; case(36): return Byte36; case(37): return Byte37; case(38): return Byte38; case(39): return Byte39; case(40): return Byte40; case(41): return Byte41; case(42): return Byte42; case(43): return Byte43; case(44): return Byte44; case(45): return Byte45; case(46): return Byte46; case(47): return Byte47; case(48): return Byte48; case(49): return Byte49; case(50): return Byte50; case(51): return Byte51; case(52): return Byte52; case(53): return Byte53; case(54): return Byte54; case(55): return Byte55; case(56): return Byte56; case(57): return Byte57; case(58): return Byte58; case(59): return Byte59; case(60): return Byte60; case(61): return Byte61; case(62): return Byte62; case(63): return Byte63; case(64): return Byte64; case(65): return Byte65; case(66): return Byte66; case(67): return Byte67; case(68): return Byte68; case(69): return Byte69; case(70): return Byte70; case(71): return Byte71; case(72): return Byte72; case(73): return Byte73; case(74): return Byte74; case(75): return Byte75; case(76): return Byte76; case(77): return Byte77; case(78): return Byte78; case(79): return Byte79; case(80): return Byte80; case(81): return Byte81; case(82): return Byte82; case(83): return Byte83; case(84): return Byte84; case(85): return Byte85; case(86): return Byte86; case(87): return Byte87; case(88): return Byte88; case(89): return Byte89; case(90): return Byte90; case(91): return Byte91; case(92): return Byte92; case(93): return Byte93; case(94): return Byte94; case(95): return Byte95; case(96): return Byte96; case(97): return Byte97; case(98): return Byte98; case(99): return Byte99; case(100): return Byte100; case(101): return Byte101; case(102): return Byte102; case(103): return Byte103; case(104): return Byte104; case(105): return Byte105; case(106): return Byte106; case(107): return Byte107; case(108): return Byte108; case(109): return Byte109; case(110): return Byte110; case(111): return Byte111; case(112): return Byte112; case(113): return Byte113; case(114): return Byte114; case(115): return Byte115; case(116): return Byte116; case(117): return Byte117; case(118): return Byte118; case(119): return Byte119; case(120): return Byte120; case(121): return Byte121; case(122): return Byte122; case(123): return Byte123; case(124): return Byte124; case(125): return Byte125; case(126): return Byte126; case(127): return Byte127; case(128): return Byte128; case(129): return Byte129; case(130): return Byte130; case(131): return Byte131; case(132): return Byte132; case(133): return Byte133; case(134): return Byte134; case(135): return Byte135; case(136): return Byte136; case(137): return Byte137; case(138): return Byte138; case(139): return Byte139; case(140): return Byte140; case(141): return Byte141; case(142): return Byte142; case(143): return Byte143; default: throw new IndexOutOfBoundsException(); } } public boolean set(int index,Byte value) { if(fieldSpecs[index].indexOf("final") != -1) return false; switch (index) { case(0): Byte0= value; break; case(1): Byte1= value; break; case(2): Byte2= value; break; case(3): Byte3= value; break; case(4): Byte4= value; break; case(5): Byte5= value; break; case(6): Byte6= value; break; case(7): Byte7= value; break; case(8): Byte8= value; break; case(9): Byte9= value; break; case(10): Byte10= value; break; case(11): Byte11= value; break; case(12): Byte12= value; break; case(13): Byte13= value; break; case(14): Byte14= value; break; case(16): Byte16= value; break; case(17): Byte17= value; break; case(18): Byte18= value; break; case(19): Byte19= value; break; case(20): Byte20= value; break; case(21): Byte21= value; break; case(22): Byte22= value; break; case(23): Byte23= value; break; case(24): Byte24= value; break; case(26): Byte26= value; break; case(28): Byte28= value; break; case(29): Byte29= value; break; case(30): Byte30= value; break; case(31): Byte31= value; break; case(32): Byte32= value; break; case(33): Byte33= value; break; case(35): Byte35= value; break; case(36): Byte36= value; break; case(37): Byte37= value; break; case(38): Byte38= value; break; case(39): Byte39= value; break; case(40): Byte40= value; break; case(41): Byte41= value; break; case(42): Byte42= value; break; case(43): Byte43= value; break; case(44): Byte44= value; break; case(45): Byte45= value; break; case(46): Byte46= value; break; case(47): Byte47= value; break; case(48): Byte48= value; break; case(49): Byte49= value; break; case(50): Byte50= value; break; case(52): Byte52= value; break; case(53): Byte53= value; break; case(54): Byte54= value; break; case(55): Byte55= value; break; case(56): Byte56= value; break; case(57): Byte57= value; break; case(58): Byte58= value; break; case(59): Byte59= value; break; case(60): Byte60= value; break; case(62): Byte62= value; break; case(64): Byte64= value; break; case(65): Byte65= value; break; case(66): Byte66= value; break; case(67): Byte67= value; break; case(68): Byte68= value; break; case(69): Byte69= value; break; case(71): Byte71= value; break; case(72): Byte72= value; break; case(73): Byte73= value; break; case(74): Byte74= value; break; case(75): Byte75= value; break; case(76): Byte76= value; break; case(77): Byte77= value; break; case(78): Byte78= value; break; case(79): Byte79= value; break; case(80): Byte80= value; break; case(81): Byte81= value; break; case(82): Byte82= value; break; case(83): Byte83= value; break; case(84): Byte84= value; break; case(85): Byte85= value; break; case(86): Byte86= value; break; case(88): Byte88= value; break; case(89): Byte89= value; break; case(90): Byte90= value; break; case(91): Byte91= value; break; case(92): Byte92= value; break; case(93): Byte93= value; break; case(94): Byte94= value; break; case(95): Byte95= value; break; case(96): Byte96= value; break; case(98): Byte98= value; break; case(100): Byte100= value; break; case(101): Byte101= value; break; case(102): Byte102= value; break; case(103): Byte103= value; break; case(104): Byte104= value; break; case(105): Byte105= value; break; case(107): Byte107= value; break; case(108): Byte108= value; break; case(109): Byte109= value; break; case(110): Byte110= value; break; case(111): Byte111= value; break; case(112): Byte112= value; break; case(113): Byte113= value; break; case(114): Byte114= value; break; case(115): Byte115= value; break; case(116): Byte116= value; break; case(117): Byte117= value; break; case(118): Byte118= value; break; case(119): Byte119= value; break; case(120): Byte120= value; break; case(121): Byte121= value; break; case(122): Byte122= value; break; case(124): Byte124= value; break; case(125): Byte125= value; break; case(126): Byte126= value; break; case(127): Byte127= value; break; case(128): Byte128= value; break; case(129): Byte129= value; break; case(130): Byte130= value; break; case(131): Byte131= value; break; case(132): Byte132= value; break; case(134): Byte134= value; break; case(136): Byte136= value; break; case(137): Byte137= value; break; case(138): Byte138= value; break; case(139): Byte139= value; break; case(140): Byte140= value; break; case(141): Byte141= value; break; case(143): Byte143= value; break; default: throw new IndexOutOfBoundsException(); } return true; } public static class Oid implements Serializable { public int identifier; public Oid() { } public Oid(String s) { identifier = Integer.parseInt(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + identifier;} public int hashCode() { return (int)identifier ; } public boolean equals(Object other) { if (other != null && (other instanceof Oid)) { Oid k = (Oid)other; return k.identifier == this.identifier; } return false; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } } } tck/src/java/org/apache/jdo/tck/pc/fieldtypes/FieldsOfCharacter.java100664 104657 12500110373 25727 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.io.Serializable; public class FieldsOfCharacter { public int identifier; private Character Character0; private Character Character1; private Character Character2; private Character Character3; private Character Character4; private Character Character5; private Character Character6; private Character Character7; private static Character Character8; private transient Character Character9; private transient Character Character10; private transient Character Character11; private transient Character Character12; private transient Character Character13; private transient Character Character14; private final Character Character15 = new Character('a'); private volatile Character Character16; private volatile Character Character17; private volatile Character Character18; private volatile Character Character19; private volatile Character Character20; private volatile Character Character21; private volatile Character Character22; private volatile Character Character23; private static transient Character Character24; private static final Character Character25 = new Character('a'); private static volatile Character Character26; private transient final Character Character27 = new Character('a'); private transient volatile Character Character28; private transient volatile Character Character29; private transient volatile Character Character30; private transient volatile Character Character31; private transient volatile Character Character32; private transient volatile Character Character33; private static transient final Character Character34 = new Character('a'); private static transient volatile Character Character35; public Character Character36; public Character Character37; public Character Character38; public Character Character39; public Character Character40; public Character Character41; public Character Character42; public Character Character43; public static Character Character44; public transient Character Character45; public transient Character Character46; public transient Character Character47; public transient Character Character48; public transient Character Character49; public transient Character Character50; public final Character Character51 = new Character('a'); public volatile Character Character52; public volatile Character Character53; public volatile Character Character54; public volatile Character Character55; public volatile Character Character56; public volatile Character Character57; public volatile Character Character58; public volatile Character Character59; public static transient Character Character60; public static final Character Character61 = new Character('a'); public static volatile Character Character62; public transient final Character Character63 = new Character('a'); public transient volatile Character Character64; public transient volatile Character Character65; public transient volatile Character Character66; public transient volatile Character Character67; public transient volatile Character Character68; public transient volatile Character Character69; public static transient final Character Character70 = new Character('a'); public static transient volatile Character Character71; protected Character Character72; protected Character Character73; protected Character Character74; protected Character Character75; protected Character Character76; protected Character Character77; protected Character Character78; protected Character Character79; protected static Character Character80; protected transient Character Character81; protected transient Character Character82; protected transient Character Character83; protected transient Character Character84; protected transient Character Character85; protected transient Character Character86; protected final Character Character87 = new Character('a'); protected volatile Character Character88; protected volatile Character Character89; protected volatile Character Character90; protected volatile Character Character91; protected volatile Character Character92; protected volatile Character Character93; protected volatile Character Character94; protected volatile Character Character95; protected static transient Character Character96; protected static final Character Character97 = new Character('a'); protected static volatile Character Character98; protected transient final Character Character99 = new Character('a'); protected transient volatile Character Character100; protected transient volatile Character Character101; protected transient volatile Character Character102; protected transient volatile Character Character103; protected transient volatile Character Character104; protected transient volatile Character Character105; protected static transient final Character Character106 = new Character('a'); protected static transient volatile Character Character107; Character Character108; Character Character109; Character Character110; Character Character111; Character Character112; Character Character113; Character Character114; Character Character115; static Character Character116; transient Character Character117; transient Character Character118; transient Character Character119; transient Character Character120; transient Character Character121; transient Character Character122; final Character Character123 = new Character('a'); volatile Character Character124; volatile Character Character125; volatile Character Character126; volatile Character Character127; volatile Character Character128; volatile Character Character129; volatile Character Character130; volatile Character Character131; static transient Character Character132; static final Character Character133 = new Character('a'); static volatile Character Character134; transient final Character Character135 = new Character('a'); transient volatile Character Character136; transient volatile Character Character137; transient volatile Character Character138; transient volatile Character Character139; transient volatile Character Character140; transient volatile Character Character141; static transient final Character Character142 = new Character('a'); static transient volatile Character Character143; public static final boolean [] isPersistent = { true,true,true,false,true,true,true,false,false,false, false,true,true,true,false,false,true,true,true,false, true,true,true,false,false,false,false,false,false,false, true,true,true,false,false,false,true,true,true,false, true,true,true,false,false,false,false,true,true,true, false,false,true,true,true,false,true,true,true,false, false,false,false,false,false,false,true,true,true,false, false,false,true,true,true,false,true,true,true,false, false,false,false,true,true,true,false,false,true,true, true,false,true,true,true,false,false,false,false,false, false,false,true,true,true,false,false,false,true,true, true,false,true,true,true,false,false,false,false,true, true,true,false,false,true,true,true,false,true,true, true,false,false,false,false,false,false,false,true,true, true,false,false,false }; public static final boolean [] isStatic = { false,false,false,false,false,false,false,false,true,false, false,false,false,false,false,false,false,false,false,false, false,false,false,false,true,true,true,false,false,false, false,false,false,false,true,true,false,false,false,false, false,false,false,false,true,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, true,true,true,false,false,false,false,false,false,false, true,true,false,false,false,false,false,false,false,false, true,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,true,true,true,false, false,false,false,false,false,false,true,true,false,false, false,false,false,false,false,false,true,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,true,true,true,false,false,false,false,false, false,false,true,true }; public static final boolean [] isFinal = { false,false,false,false,false,false,false,false,false,false, false,false,false,false,false,true,false,false,false,false, false,false,false,false,false,true,false,true,false,false, false,false,false,false,true,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, false,true,false,false,false,false,false,false,false,false, false,true,false,true,false,false,false,false,false,false, true,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,false,true,false,false, false,false,false,false,false,false,false,true,false,true, false,false,false,false,false,false,true,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,false,true,false,false,false,false,false,false, false,false,false,true,false,true,false,false,false,false, false,false,true,false }; public static final String [] fieldSpecs = { "private Character Character0", "embedded= true private Character Character1", "embedded= false private Character Character2", "persistence-modifier= none private Character Character3", "persistence-modifier= persistent private Character Character4", "persistence-modifier= persistent embedded= true private Character Character5", "persistence-modifier= persistent embedded= false private Character Character6", "persistence-modifier= transactional private Character Character7", "private static Character Character8", "private transient Character Character9", "persistence-modifier= none private transient Character Character10", "persistence-modifier= persistent private transient Character Character11", "persistence-modifier= persistent embedded= true private transient Character Character12", "persistence-modifier= persistent embedded= false private transient Character Character13", "persistence-modifier= transactional private transient Character Character14", "private final Character Character15", "private volatile Character Character16", "embedded= true private volatile Character Character17", "embedded= false private volatile Character Character18", "persistence-modifier= none private volatile Character Character19", "persistence-modifier= persistent private volatile Character Character20", "persistence-modifier= persistent embedded= true private volatile Character Character21", "persistence-modifier= persistent embedded= false private volatile Character Character22", "persistence-modifier= transactional private volatile Character Character23", "private static transient Character Character24", "private static final Character Character25", "private static volatile Character Character26", "private transient final Character Character27", "private transient volatile Character Character28", "persistence-modifier= none private transient volatile Character Character29", "persistence-modifier= persistent private transient volatile Character Character30", "persistence-modifier= persistent embedded= true private transient volatile Character Character31", "persistence-modifier= persistent embedded= false private transient volatile Character Character32", "persistence-modifier= transactional private transient volatile Character Character33", "private static transient final Character Character34", "private static transient volatile Character Character35", "public Character Character36", "embedded= true public Character Character37", "embedded= false public Character Character38", "persistence-modifier= none public Character Character39", "persistence-modifier= persistent public Character Character40", "persistence-modifier= persistent embedded= true public Character Character41", "persistence-modifier= persistent embedded= false public Character Character42", "persistence-modifier= transactional public Character Character43", "public static Character Character44", "public transient Character Character45", "persistence-modifier= none public transient Character Character46", "persistence-modifier= persistent public transient Character Character47", "persistence-modifier= persistent embedded= true public transient Character Character48", "persistence-modifier= persistent embedded= false public transient Character Character49", "persistence-modifier= transactional public transient Character Character50", "public final Character Character51", "public volatile Character Character52", "embedded= true public volatile Character Character53", "embedded= false public volatile Character Character54", "persistence-modifier= none public volatile Character Character55", "persistence-modifier= persistent public volatile Character Character56", "persistence-modifier= persistent embedded= true public volatile Character Character57", "persistence-modifier= persistent embedded= false public volatile Character Character58", "persistence-modifier= transactional public volatile Character Character59", "public static transient Character Character60", "public static final Character Character61", "public static volatile Character Character62", "public transient final Character Character63", "public transient volatile Character Character64", "persistence-modifier= none public transient volatile Character Character65", "persistence-modifier= persistent public transient volatile Character Character66", "persistence-modifier= persistent embedded= true public transient volatile Character Character67", "persistence-modifier= persistent embedded= false public transient volatile Character Character68", "persistence-modifier= transactional public transient volatile Character Character69", "public static transient final Character Character70", "public static transient volatile Character Character71", "protected Character Character72", "embedded= true protected Character Character73", "embedded= false protected Character Character74", "persistence-modifier= none protected Character Character75", "persistence-modifier= persistent protected Character Character76", "persistence-modifier= persistent embedded= true protected Character Character77", "persistence-modifier= persistent embedded= false protected Character Character78", "persistence-modifier= transactional protected Character Character79", "protected static Character Character80", "protected transient Character Character81", "persistence-modifier= none protected transient Character Character82", "persistence-modifier= persistent protected transient Character Character83", "persistence-modifier= persistent embedded= true protected transient Character Character84", "persistence-modifier= persistent embedded= false protected transient Character Character85", "persistence-modifier= transactional protected transient Character Character86", "protected final Character Character87", "protected volatile Character Character88", "embedded= true protected volatile Character Character89", "embedded= false protected volatile Character Character90", "persistence-modifier= none protected volatile Character Character91", "persistence-modifier= persistent protected volatile Character Character92", "persistence-modifier= persistent embedded= true protected volatile Character Character93", "persistence-modifier= persistent embedded= false protected volatile Character Character94", "persistence-modifier= transactional protected volatile Character Character95", "protected static transient Character Character96", "protected static final Character Character97", "protected static volatile Character Character98", "protected transient final Character Character99", "protected transient volatile Character Character100", "persistence-modifier= none protected transient volatile Character Character101", "persistence-modifier= persistent protected transient volatile Character Character102", "persistence-modifier= persistent embedded= true protected transient volatile Character Character103", "persistence-modifier= persistent embedded= false protected transient volatile Character Character104", "persistence-modifier= transactional protected transient volatile Character Character105", "protected static transient final Character Character106", "protected static transient volatile Character Character107", "Character Character108", "embedded= true Character Character109", "embedded= false Character Character110", "persistence-modifier= none Character Character111", "persistence-modifier= persistent Character Character112", "persistence-modifier= persistent embedded= true Character Character113", "persistence-modifier= persistent embedded= false Character Character114", "persistence-modifier= transactional Character Character115", "static Character Character116", "transient Character Character117", "persistence-modifier= none transient Character Character118", "persistence-modifier= persistent transient Character Character119", "persistence-modifier= persistent embedded= true transient Character Character120", "persistence-modifier= persistent embedded= false transient Character Character121", "persistence-modifier= transactional transient Character Character122", "final Character Character123", "volatile Character Character124", "embedded= true volatile Character Character125", "embedded= false volatile Character Character126", "persistence-modifier= none volatile Character Character127", "persistence-modifier= persistent volatile Character Character128", "persistence-modifier= persistent embedded= true volatile Character Character129", "persistence-modifier= persistent embedded= false volatile Character Character130", "persistence-modifier= transactional volatile Character Character131", "static transient Character Character132", "static final Character Character133", "static volatile Character Character134", "transient final Character Character135", "transient volatile Character Character136", "persistence-modifier= none transient volatile Character Character137", "persistence-modifier= persistent transient volatile Character Character138", "persistence-modifier= persistent embedded= true transient volatile Character Character139", "persistence-modifier= persistent embedded= false transient volatile Character Character140", "persistence-modifier= transactional transient volatile Character Character141", "static transient final Character Character142", "static transient volatile Character Character143" }; public int getLength() { return fieldSpecs.length; } public Character get(int index) { switch (index) { case(0): return Character0; case(1): return Character1; case(2): return Character2; case(3): return Character3; case(4): return Character4; case(5): return Character5; case(6): return Character6; case(7): return Character7; case(8): return Character8; case(9): return Character9; case(10): return Character10; case(11): return Character11; case(12): return Character12; case(13): return Character13; case(14): return Character14; case(15): return Character15; case(16): return Character16; case(17): return Character17; case(18): return Character18; case(19): return Character19; case(20): return Character20; case(21): return Character21; case(22): return Character22; case(23): return Character23; case(24): return Character24; case(25): return Character25; case(26): return Character26; case(27): return Character27; case(28): return Character28; case(29): return Character29; case(30): return Character30; case(31): return Character31; case(32): return Character32; case(33): return Character33; case(34): return Character34; case(35): return Character35; case(36): return Character36; case(37): return Character37; case(38): return Character38; case(39): return Character39; case(40): return Character40; case(41): return Character41; case(42): return Character42; case(43): return Character43; case(44): return Character44; case(45): return Character45; case(46): return Character46; case(47): return Character47; case(48): return Character48; case(49): return Character49; case(50): return Character50; case(51): return Character51; case(52): return Character52; case(53): return Character53; case(54): return Character54; case(55): return Character55; case(56): return Character56; case(57): return Character57; case(58): return Character58; case(59): return Character59; case(60): return Character60; case(61): return Character61; case(62): return Character62; case(63): return Character63; case(64): return Character64; case(65): return Character65; case(66): return Character66; case(67): return Character67; case(68): return Character68; case(69): return Character69; case(70): return Character70; case(71): return Character71; case(72): return Character72; case(73): return Character73; case(74): return Character74; case(75): return Character75; case(76): return Character76; case(77): return Character77; case(78): return Character78; case(79): return Character79; case(80): return Character80; case(81): return Character81; case(82): return Character82; case(83): return Character83; case(84): return Character84; case(85): return Character85; case(86): return Character86; case(87): return Character87; case(88): return Character88; case(89): return Character89; case(90): return Character90; case(91): return Character91; case(92): return Character92; case(93): return Character93; case(94): return Character94; case(95): return Character95; case(96): return Character96; case(97): return Character97; case(98): return Character98; case(99): return Character99; case(100): return Character100; case(101): return Character101; case(102): return Character102; case(103): return Character103; case(104): return Character104; case(105): return Character105; case(106): return Character106; case(107): return Character107; case(108): return Character108; case(109): return Character109; case(110): return Character110; case(111): return Character111; case(112): return Character112; case(113): return Character113; case(114): return Character114; case(115): return Character115; case(116): return Character116; case(117): return Character117; case(118): return Character118; case(119): return Character119; case(120): return Character120; case(121): return Character121; case(122): return Character122; case(123): return Character123; case(124): return Character124; case(125): return Character125; case(126): return Character126; case(127): return Character127; case(128): return Character128; case(129): return Character129; case(130): return Character130; case(131): return Character131; case(132): return Character132; case(133): return Character133; case(134): return Character134; case(135): return Character135; case(136): return Character136; case(137): return Character137; case(138): return Character138; case(139): return Character139; case(140): return Character140; case(141): return Character141; case(142): return Character142; case(143): return Character143; default: throw new IndexOutOfBoundsException(); } } public boolean set(int index,Character value) { if(fieldSpecs[index].indexOf("final") != -1) return false; switch (index) { case(0): Character0= value; break; case(1): Character1= value; break; case(2): Character2= value; break; case(3): Character3= value; break; case(4): Character4= value; break; case(5): Character5= value; break; case(6): Character6= value; break; case(7): Character7= value; break; case(8): Character8= value; break; case(9): Character9= value; break; case(10): Character10= value; break; case(11): Character11= value; break; case(12): Character12= value; break; case(13): Character13= value; break; case(14): Character14= value; break; case(16): Character16= value; break; case(17): Character17= value; break; case(18): Character18= value; break; case(19): Character19= value; break; case(20): Character20= value; break; case(21): Character21= value; break; case(22): Character22= value; break; case(23): Character23= value; break; case(24): Character24= value; break; case(26): Character26= value; break; case(28): Character28= value; break; case(29): Character29= value; break; case(30): Character30= value; break; case(31): Character31= value; break; case(32): Character32= value; break; case(33): Character33= value; break; case(35): Character35= value; break; case(36): Character36= value; break; case(37): Character37= value; break; case(38): Character38= value; break; case(39): Character39= value; break; case(40): Character40= value; break; case(41): Character41= value; break; case(42): Character42= value; break; case(43): Character43= value; break; case(44): Character44= value; break; case(45): Character45= value; break; case(46): Character46= value; break; case(47): Character47= value; break; case(48): Character48= value; break; case(49): Character49= value; break; case(50): Character50= value; break; case(52): Character52= value; break; case(53): Character53= value; break; case(54): Character54= value; break; case(55): Character55= value; break; case(56): Character56= value; break; case(57): Character57= value; break; case(58): Character58= value; break; case(59): Character59= value; break; case(60): Character60= value; break; case(62): Character62= value; break; case(64): Character64= value; break; case(65): Character65= value; break; case(66): Character66= value; break; case(67): Character67= value; break; case(68): Character68= value; break; case(69): Character69= value; break; case(71): Character71= value; break; case(72): Character72= value; break; case(73): Character73= value; break; case(74): Character74= value; break; case(75): Character75= value; break; case(76): Character76= value; break; case(77): Character77= value; break; case(78): Character78= value; break; case(79): Character79= value; break; case(80): Character80= value; break; case(81): Character81= value; break; case(82): Character82= value; break; case(83): Character83= value; break; case(84): Character84= value; break; case(85): Character85= value; break; case(86): Character86= value; break; case(88): Character88= value; break; case(89): Character89= value; break; case(90): Character90= value; break; case(91): Character91= value; break; case(92): Character92= value; break; case(93): Character93= value; break; case(94): Character94= value; break; case(95): Character95= value; break; case(96): Character96= value; break; case(98): Character98= value; break; case(100): Character100= value; break; case(101): Character101= value; break; case(102): Character102= value; break; case(103): Character103= value; break; case(104): Character104= value; break; case(105): Character105= value; break; case(107): Character107= value; break; case(108): Character108= value; break; case(109): Character109= value; break; case(110): Character110= value; break; case(111): Character111= value; break; case(112): Character112= value; break; case(113): Character113= value; break; case(114): Character114= value; break; case(115): Character115= value; break; case(116): Character116= value; break; case(117): Character117= value; break; case(118): Character118= value; break; case(119): Character119= value; break; case(120): Character120= value; break; case(121): Character121= value; break; case(122): Character122= value; break; case(124): Character124= value; break; case(125): Character125= value; break; case(126): Character126= value; break; case(127): Character127= value; break; case(128): Character128= value; break; case(129): Character129= value; break; case(130): Character130= value; break; case(131): Character131= value; break; case(132): Character132= value; break; case(134): Character134= value; break; case(136): Character136= value; break; case(137): Character137= value; break; case(138): Character138= value; break; case(139): Character139= value; break; case(140): Character140= value; break; case(141): Character141= value; break; case(143): Character143= value; break; default: throw new IndexOutOfBoundsException(); } return true; } public static class Oid implements Serializable { public int identifier; public Oid() { } public Oid(String s) { identifier = Integer.parseInt(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + identifier;} public int hashCode() { return (int)identifier ; } public boolean equals(Object other) { if (other != null && (other instanceof Oid)) { Oid k = (Oid)other; return k.identifier == this.identifier; } return false; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } } } tck/src/java/org/apache/jdo/tck/pc/fieldtypes/FieldsOfDate.java100664 74244 12500110373 24666 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.io.Serializable; import java.util.*; public class FieldsOfDate { public int identifier; private Date Date0; private Date Date1; private Date Date2; private Date Date3; private Date Date4; private Date Date5; private Date Date6; private Date Date7; private static Date Date8; private transient Date Date9; private transient Date Date10; private transient Date Date11; private transient Date Date12; private transient Date Date13; private transient Date Date14; private final Date Date15 = new Date(); private volatile Date Date16; private volatile Date Date17; private volatile Date Date18; private volatile Date Date19; private volatile Date Date20; private volatile Date Date21; private volatile Date Date22; private volatile Date Date23; private static transient Date Date24; private static final Date Date25 = new Date(); private static volatile Date Date26; private transient final Date Date27 = new Date(); private transient volatile Date Date28; private transient volatile Date Date29; private transient volatile Date Date30; private transient volatile Date Date31; private transient volatile Date Date32; private transient volatile Date Date33; private static transient final Date Date34 = new Date(); private static transient volatile Date Date35; public Date Date36; public Date Date37; public Date Date38; public Date Date39; public Date Date40; public Date Date41; public Date Date42; public Date Date43; public static Date Date44; public transient Date Date45; public transient Date Date46; public transient Date Date47; public transient Date Date48; public transient Date Date49; public transient Date Date50; public final Date Date51 = new Date(); public volatile Date Date52; public volatile Date Date53; public volatile Date Date54; public volatile Date Date55; public volatile Date Date56; public volatile Date Date57; public volatile Date Date58; public volatile Date Date59; public static transient Date Date60; public static final Date Date61 = new Date(); public static volatile Date Date62; public transient final Date Date63 = new Date(); public transient volatile Date Date64; public transient volatile Date Date65; public transient volatile Date Date66; public transient volatile Date Date67; public transient volatile Date Date68; public transient volatile Date Date69; public static transient final Date Date70 = new Date(); public static transient volatile Date Date71; protected Date Date72; protected Date Date73; protected Date Date74; protected Date Date75; protected Date Date76; protected Date Date77; protected Date Date78; protected Date Date79; protected static Date Date80; protected transient Date Date81; protected transient Date Date82; protected transient Date Date83; protected transient Date Date84; protected transient Date Date85; protected transient Date Date86; protected final Date Date87 = new Date(); protected volatile Date Date88; protected volatile Date Date89; protected volatile Date Date90; protected volatile Date Date91; protected volatile Date Date92; protected volatile Date Date93; protected volatile Date Date94; protected volatile Date Date95; protected static transient Date Date96; protected static final Date Date97 = new Date(); protected static volatile Date Date98; protected transient final Date Date99 = new Date(); protected transient volatile Date Date100; protected transient volatile Date Date101; protected transient volatile Date Date102; protected transient volatile Date Date103; protected transient volatile Date Date104; protected transient volatile Date Date105; protected static transient final Date Date106 = new Date(); protected static transient volatile Date Date107; Date Date108; Date Date109; Date Date110; Date Date111; Date Date112; Date Date113; Date Date114; Date Date115; static Date Date116; transient Date Date117; transient Date Date118; transient Date Date119; transient Date Date120; transient Date Date121; transient Date Date122; final Date Date123 = new Date(); volatile Date Date124; volatile Date Date125; volatile Date Date126; volatile Date Date127; volatile Date Date128; volatile Date Date129; volatile Date Date130; volatile Date Date131; static transient Date Date132; static final Date Date133 = new Date(); static volatile Date Date134; transient final Date Date135 = new Date(); transient volatile Date Date136; transient volatile Date Date137; transient volatile Date Date138; transient volatile Date Date139; transient volatile Date Date140; transient volatile Date Date141; static transient final Date Date142 = new Date(); static transient volatile Date Date143; public static final boolean [] isPersistent = { true,true,true,false,true,true,true,false,false,false, false,true,true,true,false,false,true,true,true,false, true,true,true,false,false,false,false,false,false,false, true,true,true,false,false,false,true,true,true,false, true,true,true,false,false,false,false,true,true,true, false,false,true,true,true,false,true,true,true,false, false,false,false,false,false,false,true,true,true,false, false,false,true,true,true,false,true,true,true,false, false,false,false,true,true,true,false,false,true,true, true,false,true,true,true,false,false,false,false,false, false,false,true,true,true,false,false,false,true,true, true,false,true,true,true,false,false,false,false,true, true,true,false,false,true,true,true,false,true,true, true,false,false,false,false,false,false,false,true,true, true,false,false,false }; public static final boolean [] isStatic = { false,false,false,false,false,false,false,false,true,false, false,false,false,false,false,false,false,false,false,false, false,false,false,false,true,true,true,false,false,false, false,false,false,false,true,true,false,false,false,false, false,false,false,false,true,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, true,true,true,false,false,false,false,false,false,false, true,true,false,false,false,false,false,false,false,false, true,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,true,true,true,false, false,false,false,false,false,false,true,true,false,false, false,false,false,false,false,false,true,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,true,true,true,false,false,false,false,false, false,false,true,true }; public static final boolean [] isFinal = { false,false,false,false,false,false,false,false,false,false, false,false,false,false,false,true,false,false,false,false, false,false,false,false,false,true,false,true,false,false, false,false,false,false,true,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, false,true,false,false,false,false,false,false,false,false, false,true,false,true,false,false,false,false,false,false, true,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,false,true,false,false, false,false,false,false,false,false,false,true,false,true, false,false,false,false,false,false,true,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,false,true,false,false,false,false,false,false, false,false,false,true,false,true,false,false,false,false, false,false,true,false }; public static final String [] fieldSpecs = { "private Date Date0", "embedded= true private Date Date1", "embedded= false private Date Date2", "persistence-modifier= none private Date Date3", "persistence-modifier= persistent private Date Date4", "persistence-modifier= persistent embedded= true private Date Date5", "persistence-modifier= persistent embedded= false private Date Date6", "persistence-modifier= transactional private Date Date7", "private static Date Date8", "private transient Date Date9", "persistence-modifier= none private transient Date Date10", "persistence-modifier= persistent private transient Date Date11", "persistence-modifier= persistent embedded= true private transient Date Date12", "persistence-modifier= persistent embedded= false private transient Date Date13", "persistence-modifier= transactional private transient Date Date14", "private final Date Date15", "private volatile Date Date16", "embedded= true private volatile Date Date17", "embedded= false private volatile Date Date18", "persistence-modifier= none private volatile Date Date19", "persistence-modifier= persistent private volatile Date Date20", "persistence-modifier= persistent embedded= true private volatile Date Date21", "persistence-modifier= persistent embedded= false private volatile Date Date22", "persistence-modifier= transactional private volatile Date Date23", "private static transient Date Date24", "private static final Date Date25", "private static volatile Date Date26", "private transient final Date Date27", "private transient volatile Date Date28", "persistence-modifier= none private transient volatile Date Date29", "persistence-modifier= persistent private transient volatile Date Date30", "persistence-modifier= persistent embedded= true private transient volatile Date Date31", "persistence-modifier= persistent embedded= false private transient volatile Date Date32", "persistence-modifier= transactional private transient volatile Date Date33", "private static transient final Date Date34", "private static transient volatile Date Date35", "public Date Date36", "embedded= true public Date Date37", "embedded= false public Date Date38", "persistence-modifier= none public Date Date39", "persistence-modifier= persistent public Date Date40", "persistence-modifier= persistent embedded= true public Date Date41", "persistence-modifier= persistent embedded= false public Date Date42", "persistence-modifier= transactional public Date Date43", "public static Date Date44", "public transient Date Date45", "persistence-modifier= none public transient Date Date46", "persistence-modifier= persistent public transient Date Date47", "persistence-modifier= persistent embedded= true public transient Date Date48", "persistence-modifier= persistent embedded= false public transient Date Date49", "persistence-modifier= transactional public transient Date Date50", "public final Date Date51", "public volatile Date Date52", "embedded= true public volatile Date Date53", "embedded= false public volatile Date Date54", "persistence-modifier= none public volatile Date Date55", "persistence-modifier= persistent public volatile Date Date56", "persistence-modifier= persistent embedded= true public volatile Date Date57", "persistence-modifier= persistent embedded= false public volatile Date Date58", "persistence-modifier= transactional public volatile Date Date59", "public static transient Date Date60", "public static final Date Date61", "public static volatile Date Date62", "public transient final Date Date63", "public transient volatile Date Date64", "persistence-modifier= none public transient volatile Date Date65", "persistence-modifier= persistent public transient volatile Date Date66", "persistence-modifier= persistent embedded= true public transient volatile Date Date67", "persistence-modifier= persistent embedded= false public transient volatile Date Date68", "persistence-modifier= transactional public transient volatile Date Date69", "public static transient final Date Date70", "public static transient volatile Date Date71", "protected Date Date72", "embedded= true protected Date Date73", "embedded= false protected Date Date74", "persistence-modifier= none protected Date Date75", "persistence-modifier= persistent protected Date Date76", "persistence-modifier= persistent embedded= true protected Date Date77", "persistence-modifier= persistent embedded= false protected Date Date78", "persistence-modifier= transactional protected Date Date79", "protected static Date Date80", "protected transient Date Date81", "persistence-modifier= none protected transient Date Date82", "persistence-modifier= persistent protected transient Date Date83", "persistence-modifier= persistent embedded= true protected transient Date Date84", "persistence-modifier= persistent embedded= false protected transient Date Date85", "persistence-modifier= transactional protected transient Date Date86", "protected final Date Date87", "protected volatile Date Date88", "embedded= true protected volatile Date Date89", "embedded= false protected volatile Date Date90", "persistence-modifier= none protected volatile Date Date91", "persistence-modifier= persistent protected volatile Date Date92", "persistence-modifier= persistent embedded= true protected volatile Date Date93", "persistence-modifier= persistent embedded= false protected volatile Date Date94", "persistence-modifier= transactional protected volatile Date Date95", "protected static transient Date Date96", "protected static final Date Date97", "protected static volatile Date Date98", "protected transient final Date Date99", "protected transient volatile Date Date100", "persistence-modifier= none protected transient volatile Date Date101", "persistence-modifier= persistent protected transient volatile Date Date102", "persistence-modifier= persistent embedded= true protected transient volatile Date Date103", "persistence-modifier= persistent embedded= false protected transient volatile Date Date104", "persistence-modifier= transactional protected transient volatile Date Date105", "protected static transient final Date Date106", "protected static transient volatile Date Date107", "Date Date108", "embedded= true Date Date109", "embedded= false Date Date110", "persistence-modifier= none Date Date111", "persistence-modifier= persistent Date Date112", "persistence-modifier= persistent embedded= true Date Date113", "persistence-modifier= persistent embedded= false Date Date114", "persistence-modifier= transactional Date Date115", "static Date Date116", "transient Date Date117", "persistence-modifier= none transient Date Date118", "persistence-modifier= persistent transient Date Date119", "persistence-modifier= persistent embedded= true transient Date Date120", "persistence-modifier= persistent embedded= false transient Date Date121", "persistence-modifier= transactional transient Date Date122", "final Date Date123", "volatile Date Date124", "embedded= true volatile Date Date125", "embedded= false volatile Date Date126", "persistence-modifier= none volatile Date Date127", "persistence-modifier= persistent volatile Date Date128", "persistence-modifier= persistent embedded= true volatile Date Date129", "persistence-modifier= persistent embedded= false volatile Date Date130", "persistence-modifier= transactional volatile Date Date131", "static transient Date Date132", "static final Date Date133", "static volatile Date Date134", "transient final Date Date135", "transient volatile Date Date136", "persistence-modifier= none transient volatile Date Date137", "persistence-modifier= persistent transient volatile Date Date138", "persistence-modifier= persistent embedded= true transient volatile Date Date139", "persistence-modifier= persistent embedded= false transient volatile Date Date140", "persistence-modifier= transactional transient volatile Date Date141", "static transient final Date Date142", "static transient volatile Date Date143" }; public int getLength() { return fieldSpecs.length; } public Date get(int index) { switch (index) { case(0): return Date0; case(1): return Date1; case(2): return Date2; case(3): return Date3; case(4): return Date4; case(5): return Date5; case(6): return Date6; case(7): return Date7; case(8): return Date8; case(9): return Date9; case(10): return Date10; case(11): return Date11; case(12): return Date12; case(13): return Date13; case(14): return Date14; case(15): return Date15; case(16): return Date16; case(17): return Date17; case(18): return Date18; case(19): return Date19; case(20): return Date20; case(21): return Date21; case(22): return Date22; case(23): return Date23; case(24): return Date24; case(25): return Date25; case(26): return Date26; case(27): return Date27; case(28): return Date28; case(29): return Date29; case(30): return Date30; case(31): return Date31; case(32): return Date32; case(33): return Date33; case(34): return Date34; case(35): return Date35; case(36): return Date36; case(37): return Date37; case(38): return Date38; case(39): return Date39; case(40): return Date40; case(41): return Date41; case(42): return Date42; case(43): return Date43; case(44): return Date44; case(45): return Date45; case(46): return Date46; case(47): return Date47; case(48): return Date48; case(49): return Date49; case(50): return Date50; case(51): return Date51; case(52): return Date52; case(53): return Date53; case(54): return Date54; case(55): return Date55; case(56): return Date56; case(57): return Date57; case(58): return Date58; case(59): return Date59; case(60): return Date60; case(61): return Date61; case(62): return Date62; case(63): return Date63; case(64): return Date64; case(65): return Date65; case(66): return Date66; case(67): return Date67; case(68): return Date68; case(69): return Date69; case(70): return Date70; case(71): return Date71; case(72): return Date72; case(73): return Date73; case(74): return Date74; case(75): return Date75; case(76): return Date76; case(77): return Date77; case(78): return Date78; case(79): return Date79; case(80): return Date80; case(81): return Date81; case(82): return Date82; case(83): return Date83; case(84): return Date84; case(85): return Date85; case(86): return Date86; case(87): return Date87; case(88): return Date88; case(89): return Date89; case(90): return Date90; case(91): return Date91; case(92): return Date92; case(93): return Date93; case(94): return Date94; case(95): return Date95; case(96): return Date96; case(97): return Date97; case(98): return Date98; case(99): return Date99; case(100): return Date100; case(101): return Date101; case(102): return Date102; case(103): return Date103; case(104): return Date104; case(105): return Date105; case(106): return Date106; case(107): return Date107; case(108): return Date108; case(109): return Date109; case(110): return Date110; case(111): return Date111; case(112): return Date112; case(113): return Date113; case(114): return Date114; case(115): return Date115; case(116): return Date116; case(117): return Date117; case(118): return Date118; case(119): return Date119; case(120): return Date120; case(121): return Date121; case(122): return Date122; case(123): return Date123; case(124): return Date124; case(125): return Date125; case(126): return Date126; case(127): return Date127; case(128): return Date128; case(129): return Date129; case(130): return Date130; case(131): return Date131; case(132): return Date132; case(133): return Date133; case(134): return Date134; case(135): return Date135; case(136): return Date136; case(137): return Date137; case(138): return Date138; case(139): return Date139; case(140): return Date140; case(141): return Date141; case(142): return Date142; case(143): return Date143; default: throw new IndexOutOfBoundsException(); } } public boolean set(int index,Date value) { if(fieldSpecs[index].indexOf("final") != -1) return false; switch (index) { case(0): Date0= value; break; case(1): Date1= value; break; case(2): Date2= value; break; case(3): Date3= value; break; case(4): Date4= value; break; case(5): Date5= value; break; case(6): Date6= value; break; case(7): Date7= value; break; case(8): Date8= value; break; case(9): Date9= value; break; case(10): Date10= value; break; case(11): Date11= value; break; case(12): Date12= value; break; case(13): Date13= value; break; case(14): Date14= value; break; case(16): Date16= value; break; case(17): Date17= value; break; case(18): Date18= value; break; case(19): Date19= value; break; case(20): Date20= value; break; case(21): Date21= value; break; case(22): Date22= value; break; case(23): Date23= value; break; case(24): Date24= value; break; case(26): Date26= value; break; case(28): Date28= value; break; case(29): Date29= value; break; case(30): Date30= value; break; case(31): Date31= value; break; case(32): Date32= value; break; case(33): Date33= value; break; case(35): Date35= value; break; case(36): Date36= value; break; case(37): Date37= value; break; case(38): Date38= value; break; case(39): Date39= value; break; case(40): Date40= value; break; case(41): Date41= value; break; case(42): Date42= value; break; case(43): Date43= value; break; case(44): Date44= value; break; case(45): Date45= value; break; case(46): Date46= value; break; case(47): Date47= value; break; case(48): Date48= value; break; case(49): Date49= value; break; case(50): Date50= value; break; case(52): Date52= value; break; case(53): Date53= value; break; case(54): Date54= value; break; case(55): Date55= value; break; case(56): Date56= value; break; case(57): Date57= value; break; case(58): Date58= value; break; case(59): Date59= value; break; case(60): Date60= value; break; case(62): Date62= value; break; case(64): Date64= value; break; case(65): Date65= value; break; case(66): Date66= value; break; case(67): Date67= value; break; case(68): Date68= value; break; case(69): Date69= value; break; case(71): Date71= value; break; case(72): Date72= value; break; case(73): Date73= value; break; case(74): Date74= value; break; case(75): Date75= value; break; case(76): Date76= value; break; case(77): Date77= value; break; case(78): Date78= value; break; case(79): Date79= value; break; case(80): Date80= value; break; case(81): Date81= value; break; case(82): Date82= value; break; case(83): Date83= value; break; case(84): Date84= value; break; case(85): Date85= value; break; case(86): Date86= value; break; case(88): Date88= value; break; case(89): Date89= value; break; case(90): Date90= value; break; case(91): Date91= value; break; case(92): Date92= value; break; case(93): Date93= value; break; case(94): Date94= value; break; case(95): Date95= value; break; case(96): Date96= value; break; case(98): Date98= value; break; case(100): Date100= value; break; case(101): Date101= value; break; case(102): Date102= value; break; case(103): Date103= value; break; case(104): Date104= value; break; case(105): Date105= value; break; case(107): Date107= value; break; case(108): Date108= value; break; case(109): Date109= value; break; case(110): Date110= value; break; case(111): Date111= value; break; case(112): Date112= value; break; case(113): Date113= value; break; case(114): Date114= value; break; case(115): Date115= value; break; case(116): Date116= value; break; case(117): Date117= value; break; case(118): Date118= value; break; case(119): Date119= value; break; case(120): Date120= value; break; case(121): Date121= value; break; case(122): Date122= value; break; case(124): Date124= value; break; case(125): Date125= value; break; case(126): Date126= value; break; case(127): Date127= value; break; case(128): Date128= value; break; case(129): Date129= value; break; case(130): Date130= value; break; case(131): Date131= value; break; case(132): Date132= value; break; case(134): Date134= value; break; case(136): Date136= value; break; case(137): Date137= value; break; case(138): Date138= value; break; case(139): Date139= value; break; case(140): Date140= value; break; case(141): Date141= value; break; case(143): Date143= value; break; default: throw new IndexOutOfBoundsException(); } return true; } public static class Oid implements Serializable { public int identifier; public Oid() { } public Oid(String s) { identifier = Integer.parseInt(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + identifier;} public int hashCode() { return (int)identifier ; } public boolean equals(Object other) { if (other != null && (other instanceof Oid)) { Oid k = (Oid)other; return k.identifier == this.identifier; } return false; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } } } tck/src/java/org/apache/jdo/tck/pc/fieldtypes/FieldsOfDouble.java100664 77746 12500110373 25235 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.io.Serializable; public class FieldsOfDouble { public int identifier; private Double Double0; private Double Double1; private Double Double2; private Double Double3; private Double Double4; private Double Double5; private Double Double6; private Double Double7; private static Double Double8; private transient Double Double9; private transient Double Double10; private transient Double Double11; private transient Double Double12; private transient Double Double13; private transient Double Double14; private final Double Double15 = new Double((double)5); private volatile Double Double16; private volatile Double Double17; private volatile Double Double18; private volatile Double Double19; private volatile Double Double20; private volatile Double Double21; private volatile Double Double22; private volatile Double Double23; private static transient Double Double24; private static final Double Double25 = new Double((double)5); private static volatile Double Double26; private transient final Double Double27 = new Double((double)5); private transient volatile Double Double28; private transient volatile Double Double29; private transient volatile Double Double30; private transient volatile Double Double31; private transient volatile Double Double32; private transient volatile Double Double33; private static transient final Double Double34 = new Double((double)5); private static transient volatile Double Double35; public Double Double36; public Double Double37; public Double Double38; public Double Double39; public Double Double40; public Double Double41; public Double Double42; public Double Double43; public static Double Double44; public transient Double Double45; public transient Double Double46; public transient Double Double47; public transient Double Double48; public transient Double Double49; public transient Double Double50; public final Double Double51 = new Double((double)5); public volatile Double Double52; public volatile Double Double53; public volatile Double Double54; public volatile Double Double55; public volatile Double Double56; public volatile Double Double57; public volatile Double Double58; public volatile Double Double59; public static transient Double Double60; public static final Double Double61 = new Double((double)5); public static volatile Double Double62; public transient final Double Double63 = new Double((double)5); public transient volatile Double Double64; public transient volatile Double Double65; public transient volatile Double Double66; public transient volatile Double Double67; public transient volatile Double Double68; public transient volatile Double Double69; public static transient final Double Double70 = new Double((double)5); public static transient volatile Double Double71; protected Double Double72; protected Double Double73; protected Double Double74; protected Double Double75; protected Double Double76; protected Double Double77; protected Double Double78; protected Double Double79; protected static Double Double80; protected transient Double Double81; protected transient Double Double82; protected transient Double Double83; protected transient Double Double84; protected transient Double Double85; protected transient Double Double86; protected final Double Double87 = new Double((double)5); protected volatile Double Double88; protected volatile Double Double89; protected volatile Double Double90; protected volatile Double Double91; protected volatile Double Double92; protected volatile Double Double93; protected volatile Double Double94; protected volatile Double Double95; protected static transient Double Double96; protected static final Double Double97 = new Double((double)5); protected static volatile Double Double98; protected transient final Double Double99 = new Double((double)5); protected transient volatile Double Double100; protected transient volatile Double Double101; protected transient volatile Double Double102; protected transient volatile Double Double103; protected transient volatile Double Double104; protected transient volatile Double Double105; protected static transient final Double Double106 = new Double((double)5); protected static transient volatile Double Double107; Double Double108; Double Double109; Double Double110; Double Double111; Double Double112; Double Double113; Double Double114; Double Double115; static Double Double116; transient Double Double117; transient Double Double118; transient Double Double119; transient Double Double120; transient Double Double121; transient Double Double122; final Double Double123 = new Double((double)5); volatile Double Double124; volatile Double Double125; volatile Double Double126; volatile Double Double127; volatile Double Double128; volatile Double Double129; volatile Double Double130; volatile Double Double131; static transient Double Double132; static final Double Double133 = new Double((double)5); static volatile Double Double134; transient final Double Double135 = new Double((double)5); transient volatile Double Double136; transient volatile Double Double137; transient volatile Double Double138; transient volatile Double Double139; transient volatile Double Double140; transient volatile Double Double141; static transient final Double Double142 = new Double((double)5); static transient volatile Double Double143; public static final boolean [] isPersistent = { true,true,true,false,true,true,true,false,false,false, false,true,true,true,false,false,true,true,true,false, true,true,true,false,false,false,false,false,false,false, true,true,true,false,false,false,true,true,true,false, true,true,true,false,false,false,false,true,true,true, false,false,true,true,true,false,true,true,true,false, false,false,false,false,false,false,true,true,true,false, false,false,true,true,true,false,true,true,true,false, false,false,false,true,true,true,false,false,true,true, true,false,true,true,true,false,false,false,false,false, false,false,true,true,true,false,false,false,true,true, true,false,true,true,true,false,false,false,false,true, true,true,false,false,true,true,true,false,true,true, true,false,false,false,false,false,false,false,true,true, true,false,false,false }; public static final boolean [] isStatic = { false,false,false,false,false,false,false,false,true,false, false,false,false,false,false,false,false,false,false,false, false,false,false,false,true,true,true,false,false,false, false,false,false,false,true,true,false,false,false,false, false,false,false,false,true,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, true,true,true,false,false,false,false,false,false,false, true,true,false,false,false,false,false,false,false,false, true,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,true,true,true,false, false,false,false,false,false,false,true,true,false,false, false,false,false,false,false,false,true,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,true,true,true,false,false,false,false,false, false,false,true,true }; public static final boolean [] isFinal = { false,false,false,false,false,false,false,false,false,false, false,false,false,false,false,true,false,false,false,false, false,false,false,false,false,true,false,true,false,false, false,false,false,false,true,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, false,true,false,false,false,false,false,false,false,false, false,true,false,true,false,false,false,false,false,false, true,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,false,true,false,false, false,false,false,false,false,false,false,true,false,true, false,false,false,false,false,false,true,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,false,true,false,false,false,false,false,false, false,false,false,true,false,true,false,false,false,false, false,false,true,false }; public static final String [] fieldSpecs = { "private Double Double0", "embedded= true private Double Double1", "embedded= false private Double Double2", "persistence-modifier= none private Double Double3", "persistence-modifier= persistent private Double Double4", "persistence-modifier= persistent embedded= true private Double Double5", "persistence-modifier= persistent embedded= false private Double Double6", "persistence-modifier= transactional private Double Double7", "private static Double Double8", "private transient Double Double9", "persistence-modifier= none private transient Double Double10", "persistence-modifier= persistent private transient Double Double11", "persistence-modifier= persistent embedded= true private transient Double Double12", "persistence-modifier= persistent embedded= false private transient Double Double13", "persistence-modifier= transactional private transient Double Double14", "private final Double Double15", "private volatile Double Double16", "embedded= true private volatile Double Double17", "embedded= false private volatile Double Double18", "persistence-modifier= none private volatile Double Double19", "persistence-modifier= persistent private volatile Double Double20", "persistence-modifier= persistent embedded= true private volatile Double Double21", "persistence-modifier= persistent embedded= false private volatile Double Double22", "persistence-modifier= transactional private volatile Double Double23", "private static transient Double Double24", "private static final Double Double25", "private static volatile Double Double26", "private transient final Double Double27", "private transient volatile Double Double28", "persistence-modifier= none private transient volatile Double Double29", "persistence-modifier= persistent private transient volatile Double Double30", "persistence-modifier= persistent embedded= true private transient volatile Double Double31", "persistence-modifier= persistent embedded= false private transient volatile Double Double32", "persistence-modifier= transactional private transient volatile Double Double33", "private static transient final Double Double34", "private static transient volatile Double Double35", "public Double Double36", "embedded= true public Double Double37", "embedded= false public Double Double38", "persistence-modifier= none public Double Double39", "persistence-modifier= persistent public Double Double40", "persistence-modifier= persistent embedded= true public Double Double41", "persistence-modifier= persistent embedded= false public Double Double42", "persistence-modifier= transactional public Double Double43", "public static Double Double44", "public transient Double Double45", "persistence-modifier= none public transient Double Double46", "persistence-modifier= persistent public transient Double Double47", "persistence-modifier= persistent embedded= true public transient Double Double48", "persistence-modifier= persistent embedded= false public transient Double Double49", "persistence-modifier= transactional public transient Double Double50", "public final Double Double51", "public volatile Double Double52", "embedded= true public volatile Double Double53", "embedded= false public volatile Double Double54", "persistence-modifier= none public volatile Double Double55", "persistence-modifier= persistent public volatile Double Double56", "persistence-modifier= persistent embedded= true public volatile Double Double57", "persistence-modifier= persistent embedded= false public volatile Double Double58", "persistence-modifier= transactional public volatile Double Double59", "public static transient Double Double60", "public static final Double Double61", "public static volatile Double Double62", "public transient final Double Double63", "public transient volatile Double Double64", "persistence-modifier= none public transient volatile Double Double65", "persistence-modifier= persistent public transient volatile Double Double66", "persistence-modifier= persistent embedded= true public transient volatile Double Double67", "persistence-modifier= persistent embedded= false public transient volatile Double Double68", "persistence-modifier= transactional public transient volatile Double Double69", "public static transient final Double Double70", "public static transient volatile Double Double71", "protected Double Double72", "embedded= true protected Double Double73", "embedded= false protected Double Double74", "persistence-modifier= none protected Double Double75", "persistence-modifier= persistent protected Double Double76", "persistence-modifier= persistent embedded= true protected Double Double77", "persistence-modifier= persistent embedded= false protected Double Double78", "persistence-modifier= transactional protected Double Double79", "protected static Double Double80", "protected transient Double Double81", "persistence-modifier= none protected transient Double Double82", "persistence-modifier= persistent protected transient Double Double83", "persistence-modifier= persistent embedded= true protected transient Double Double84", "persistence-modifier= persistent embedded= false protected transient Double Double85", "persistence-modifier= transactional protected transient Double Double86", "protected final Double Double87", "protected volatile Double Double88", "embedded= true protected volatile Double Double89", "embedded= false protected volatile Double Double90", "persistence-modifier= none protected volatile Double Double91", "persistence-modifier= persistent protected volatile Double Double92", "persistence-modifier= persistent embedded= true protected volatile Double Double93", "persistence-modifier= persistent embedded= false protected volatile Double Double94", "persistence-modifier= transactional protected volatile Double Double95", "protected static transient Double Double96", "protected static final Double Double97", "protected static volatile Double Double98", "protected transient final Double Double99", "protected transient volatile Double Double100", "persistence-modifier= none protected transient volatile Double Double101", "persistence-modifier= persistent protected transient volatile Double Double102", "persistence-modifier= persistent embedded= true protected transient volatile Double Double103", "persistence-modifier= persistent embedded= false protected transient volatile Double Double104", "persistence-modifier= transactional protected transient volatile Double Double105", "protected static transient final Double Double106", "protected static transient volatile Double Double107", "Double Double108", "embedded= true Double Double109", "embedded= false Double Double110", "persistence-modifier= none Double Double111", "persistence-modifier= persistent Double Double112", "persistence-modifier= persistent embedded= true Double Double113", "persistence-modifier= persistent embedded= false Double Double114", "persistence-modifier= transactional Double Double115", "static Double Double116", "transient Double Double117", "persistence-modifier= none transient Double Double118", "persistence-modifier= persistent transient Double Double119", "persistence-modifier= persistent embedded= true transient Double Double120", "persistence-modifier= persistent embedded= false transient Double Double121", "persistence-modifier= transactional transient Double Double122", "final Double Double123", "volatile Double Double124", "embedded= true volatile Double Double125", "embedded= false volatile Double Double126", "persistence-modifier= none volatile Double Double127", "persistence-modifier= persistent volatile Double Double128", "persistence-modifier= persistent embedded= true volatile Double Double129", "persistence-modifier= persistent embedded= false volatile Double Double130", "persistence-modifier= transactional volatile Double Double131", "static transient Double Double132", "static final Double Double133", "static volatile Double Double134", "transient final Double Double135", "transient volatile Double Double136", "persistence-modifier= none transient volatile Double Double137", "persistence-modifier= persistent transient volatile Double Double138", "persistence-modifier= persistent embedded= true transient volatile Double Double139", "persistence-modifier= persistent embedded= false transient volatile Double Double140", "persistence-modifier= transactional transient volatile Double Double141", "static transient final Double Double142", "static transient volatile Double Double143" }; public int getLength() { return fieldSpecs.length; } public Double get(int index) { switch (index) { case(0): return Double0; case(1): return Double1; case(2): return Double2; case(3): return Double3; case(4): return Double4; case(5): return Double5; case(6): return Double6; case(7): return Double7; case(8): return Double8; case(9): return Double9; case(10): return Double10; case(11): return Double11; case(12): return Double12; case(13): return Double13; case(14): return Double14; case(15): return Double15; case(16): return Double16; case(17): return Double17; case(18): return Double18; case(19): return Double19; case(20): return Double20; case(21): return Double21; case(22): return Double22; case(23): return Double23; case(24): return Double24; case(25): return Double25; case(26): return Double26; case(27): return Double27; case(28): return Double28; case(29): return Double29; case(30): return Double30; case(31): return Double31; case(32): return Double32; case(33): return Double33; case(34): return Double34; case(35): return Double35; case(36): return Double36; case(37): return Double37; case(38): return Double38; case(39): return Double39; case(40): return Double40; case(41): return Double41; case(42): return Double42; case(43): return Double43; case(44): return Double44; case(45): return Double45; case(46): return Double46; case(47): return Double47; case(48): return Double48; case(49): return Double49; case(50): return Double50; case(51): return Double51; case(52): return Double52; case(53): return Double53; case(54): return Double54; case(55): return Double55; case(56): return Double56; case(57): return Double57; case(58): return Double58; case(59): return Double59; case(60): return Double60; case(61): return Double61; case(62): return Double62; case(63): return Double63; case(64): return Double64; case(65): return Double65; case(66): return Double66; case(67): return Double67; case(68): return Double68; case(69): return Double69; case(70): return Double70; case(71): return Double71; case(72): return Double72; case(73): return Double73; case(74): return Double74; case(75): return Double75; case(76): return Double76; case(77): return Double77; case(78): return Double78; case(79): return Double79; case(80): return Double80; case(81): return Double81; case(82): return Double82; case(83): return Double83; case(84): return Double84; case(85): return Double85; case(86): return Double86; case(87): return Double87; case(88): return Double88; case(89): return Double89; case(90): return Double90; case(91): return Double91; case(92): return Double92; case(93): return Double93; case(94): return Double94; case(95): return Double95; case(96): return Double96; case(97): return Double97; case(98): return Double98; case(99): return Double99; case(100): return Double100; case(101): return Double101; case(102): return Double102; case(103): return Double103; case(104): return Double104; case(105): return Double105; case(106): return Double106; case(107): return Double107; case(108): return Double108; case(109): return Double109; case(110): return Double110; case(111): return Double111; case(112): return Double112; case(113): return Double113; case(114): return Double114; case(115): return Double115; case(116): return Double116; case(117): return Double117; case(118): return Double118; case(119): return Double119; case(120): return Double120; case(121): return Double121; case(122): return Double122; case(123): return Double123; case(124): return Double124; case(125): return Double125; case(126): return Double126; case(127): return Double127; case(128): return Double128; case(129): return Double129; case(130): return Double130; case(131): return Double131; case(132): return Double132; case(133): return Double133; case(134): return Double134; case(135): return Double135; case(136): return Double136; case(137): return Double137; case(138): return Double138; case(139): return Double139; case(140): return Double140; case(141): return Double141; case(142): return Double142; case(143): return Double143; default: throw new IndexOutOfBoundsException(); } } public boolean set(int index,Double value) { if(fieldSpecs[index].indexOf("final") != -1) return false; switch (index) { case(0): Double0= value; break; case(1): Double1= value; break; case(2): Double2= value; break; case(3): Double3= value; break; case(4): Double4= value; break; case(5): Double5= value; break; case(6): Double6= value; break; case(7): Double7= value; break; case(8): Double8= value; break; case(9): Double9= value; break; case(10): Double10= value; break; case(11): Double11= value; break; case(12): Double12= value; break; case(13): Double13= value; break; case(14): Double14= value; break; case(16): Double16= value; break; case(17): Double17= value; break; case(18): Double18= value; break; case(19): Double19= value; break; case(20): Double20= value; break; case(21): Double21= value; break; case(22): Double22= value; break; case(23): Double23= value; break; case(24): Double24= value; break; case(26): Double26= value; break; case(28): Double28= value; break; case(29): Double29= value; break; case(30): Double30= value; break; case(31): Double31= value; break; case(32): Double32= value; break; case(33): Double33= value; break; case(35): Double35= value; break; case(36): Double36= value; break; case(37): Double37= value; break; case(38): Double38= value; break; case(39): Double39= value; break; case(40): Double40= value; break; case(41): Double41= value; break; case(42): Double42= value; break; case(43): Double43= value; break; case(44): Double44= value; break; case(45): Double45= value; break; case(46): Double46= value; break; case(47): Double47= value; break; case(48): Double48= value; break; case(49): Double49= value; break; case(50): Double50= value; break; case(52): Double52= value; break; case(53): Double53= value; break; case(54): Double54= value; break; case(55): Double55= value; break; case(56): Double56= value; break; case(57): Double57= value; break; case(58): Double58= value; break; case(59): Double59= value; break; case(60): Double60= value; break; case(62): Double62= value; break; case(64): Double64= value; break; case(65): Double65= value; break; case(66): Double66= value; break; case(67): Double67= value; break; case(68): Double68= value; break; case(69): Double69= value; break; case(71): Double71= value; break; case(72): Double72= value; break; case(73): Double73= value; break; case(74): Double74= value; break; case(75): Double75= value; break; case(76): Double76= value; break; case(77): Double77= value; break; case(78): Double78= value; break; case(79): Double79= value; break; case(80): Double80= value; break; case(81): Double81= value; break; case(82): Double82= value; break; case(83): Double83= value; break; case(84): Double84= value; break; case(85): Double85= value; break; case(86): Double86= value; break; case(88): Double88= value; break; case(89): Double89= value; break; case(90): Double90= value; break; case(91): Double91= value; break; case(92): Double92= value; break; case(93): Double93= value; break; case(94): Double94= value; break; case(95): Double95= value; break; case(96): Double96= value; break; case(98): Double98= value; break; case(100): Double100= value; break; case(101): Double101= value; break; case(102): Double102= value; break; case(103): Double103= value; break; case(104): Double104= value; break; case(105): Double105= value; break; case(107): Double107= value; break; case(108): Double108= value; break; case(109): Double109= value; break; case(110): Double110= value; break; case(111): Double111= value; break; case(112): Double112= value; break; case(113): Double113= value; break; case(114): Double114= value; break; case(115): Double115= value; break; case(116): Double116= value; break; case(117): Double117= value; break; case(118): Double118= value; break; case(119): Double119= value; break; case(120): Double120= value; break; case(121): Double121= value; break; case(122): Double122= value; break; case(124): Double124= value; break; case(125): Double125= value; break; case(126): Double126= value; break; case(127): Double127= value; break; case(128): Double128= value; break; case(129): Double129= value; break; case(130): Double130= value; break; case(131): Double131= value; break; case(132): Double132= value; break; case(134): Double134= value; break; case(136): Double136= value; break; case(137): Double137= value; break; case(138): Double138= value; break; case(139): Double139= value; break; case(140): Double140= value; break; case(141): Double141= value; break; case(143): Double143= value; break; default: throw new IndexOutOfBoundsException(); } return true; } public static class Oid implements Serializable { public int identifier; public Oid() { } public Oid(String s) { identifier = Integer.parseInt(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + identifier;} public int hashCode() { return (int)identifier ; } public boolean equals(Object other) { if (other != null && (other instanceof Oid)) { Oid k = (Oid)other; return k.identifier == this.identifier; } return false; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } } } tck/src/java/org/apache/jdo/tck/pc/fieldtypes/FieldsOfFloat.java100664 76163 12500110373 25060 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.io.Serializable; public class FieldsOfFloat { public int identifier; private Float Float0; private Float Float1; private Float Float2; private Float Float3; private Float Float4; private Float Float5; private Float Float6; private Float Float7; private static Float Float8; private transient Float Float9; private transient Float Float10; private transient Float Float11; private transient Float Float12; private transient Float Float13; private transient Float Float14; private final Float Float15 = new Float((float)5); private volatile Float Float16; private volatile Float Float17; private volatile Float Float18; private volatile Float Float19; private volatile Float Float20; private volatile Float Float21; private volatile Float Float22; private volatile Float Float23; private static transient Float Float24; private static final Float Float25 = new Float((float)5); private static volatile Float Float26; private transient final Float Float27 = new Float((float)5); private transient volatile Float Float28; private transient volatile Float Float29; private transient volatile Float Float30; private transient volatile Float Float31; private transient volatile Float Float32; private transient volatile Float Float33; private static transient final Float Float34 = new Float((float)5); private static transient volatile Float Float35; public Float Float36; public Float Float37; public Float Float38; public Float Float39; public Float Float40; public Float Float41; public Float Float42; public Float Float43; public static Float Float44; public transient Float Float45; public transient Float Float46; public transient Float Float47; public transient Float Float48; public transient Float Float49; public transient Float Float50; public final Float Float51 = new Float((float)5); public volatile Float Float52; public volatile Float Float53; public volatile Float Float54; public volatile Float Float55; public volatile Float Float56; public volatile Float Float57; public volatile Float Float58; public volatile Float Float59; public static transient Float Float60; public static final Float Float61 = new Float((float)5); public static volatile Float Float62; public transient final Float Float63 = new Float((float)5); public transient volatile Float Float64; public transient volatile Float Float65; public transient volatile Float Float66; public transient volatile Float Float67; public transient volatile Float Float68; public transient volatile Float Float69; public static transient final Float Float70 = new Float((float)5); public static transient volatile Float Float71; protected Float Float72; protected Float Float73; protected Float Float74; protected Float Float75; protected Float Float76; protected Float Float77; protected Float Float78; protected Float Float79; protected static Float Float80; protected transient Float Float81; protected transient Float Float82; protected transient Float Float83; protected transient Float Float84; protected transient Float Float85; protected transient Float Float86; protected final Float Float87 = new Float((float)5); protected volatile Float Float88; protected volatile Float Float89; protected volatile Float Float90; protected volatile Float Float91; protected volatile Float Float92; protected volatile Float Float93; protected volatile Float Float94; protected volatile Float Float95; protected static transient Float Float96; protected static final Float Float97 = new Float((float)5); protected static volatile Float Float98; protected transient final Float Float99 = new Float((float)5); protected transient volatile Float Float100; protected transient volatile Float Float101; protected transient volatile Float Float102; protected transient volatile Float Float103; protected transient volatile Float Float104; protected transient volatile Float Float105; protected static transient final Float Float106 = new Float((float)5); protected static transient volatile Float Float107; Float Float108; Float Float109; Float Float110; Float Float111; Float Float112; Float Float113; Float Float114; Float Float115; static Float Float116; transient Float Float117; transient Float Float118; transient Float Float119; transient Float Float120; transient Float Float121; transient Float Float122; final Float Float123 = new Float((float)5); volatile Float Float124; volatile Float Float125; volatile Float Float126; volatile Float Float127; volatile Float Float128; volatile Float Float129; volatile Float Float130; volatile Float Float131; static transient Float Float132; static final Float Float133 = new Float((float)5); static volatile Float Float134; transient final Float Float135 = new Float((float)5); transient volatile Float Float136; transient volatile Float Float137; transient volatile Float Float138; transient volatile Float Float139; transient volatile Float Float140; transient volatile Float Float141; static transient final Float Float142 = new Float((float)5); static transient volatile Float Float143; public static final boolean [] isPersistent = { true,true,true,false,true,true,true,false,false,false, false,true,true,true,false,false,true,true,true,false, true,true,true,false,false,false,false,false,false,false, true,true,true,false,false,false,true,true,true,false, true,true,true,false,false,false,false,true,true,true, false,false,true,true,true,false,true,true,true,false, false,false,false,false,false,false,true,true,true,false, false,false,true,true,true,false,true,true,true,false, false,false,false,true,true,true,false,false,true,true, true,false,true,true,true,false,false,false,false,false, false,false,true,true,true,false,false,false,true,true, true,false,true,true,true,false,false,false,false,true, true,true,false,false,true,true,true,false,true,true, true,false,false,false,false,false,false,false,true,true, true,false,false,false }; public static final boolean [] isStatic = { false,false,false,false,false,false,false,false,true,false, false,false,false,false,false,false,false,false,false,false, false,false,false,false,true,true,true,false,false,false, false,false,false,false,true,true,false,false,false,false, false,false,false,false,true,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, true,true,true,false,false,false,false,false,false,false, true,true,false,false,false,false,false,false,false,false, true,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,true,true,true,false, false,false,false,false,false,false,true,true,false,false, false,false,false,false,false,false,true,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,true,true,true,false,false,false,false,false, false,false,true,true }; public static final boolean [] isFinal = { false,false,false,false,false,false,false,false,false,false, false,false,false,false,false,true,false,false,false,false, false,false,false,false,false,true,false,true,false,false, false,false,false,false,true,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, false,true,false,false,false,false,false,false,false,false, false,true,false,true,false,false,false,false,false,false, true,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,false,true,false,false, false,false,false,false,false,false,false,true,false,true, false,false,false,false,false,false,true,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,false,true,false,false,false,false,false,false, false,false,false,true,false,true,false,false,false,false, false,false,true,false }; public static final String [] fieldSpecs = { "private Float Float0", "embedded= true private Float Float1", "embedded= false private Float Float2", "persistence-modifier= none private Float Float3", "persistence-modifier= persistent private Float Float4", "persistence-modifier= persistent embedded= true private Float Float5", "persistence-modifier= persistent embedded= false private Float Float6", "persistence-modifier= transactional private Float Float7", "private static Float Float8", "private transient Float Float9", "persistence-modifier= none private transient Float Float10", "persistence-modifier= persistent private transient Float Float11", "persistence-modifier= persistent embedded= true private transient Float Float12", "persistence-modifier= persistent embedded= false private transient Float Float13", "persistence-modifier= transactional private transient Float Float14", "private final Float Float15", "private volatile Float Float16", "embedded= true private volatile Float Float17", "embedded= false private volatile Float Float18", "persistence-modifier= none private volatile Float Float19", "persistence-modifier= persistent private volatile Float Float20", "persistence-modifier= persistent embedded= true private volatile Float Float21", "persistence-modifier= persistent embedded= false private volatile Float Float22", "persistence-modifier= transactional private volatile Float Float23", "private static transient Float Float24", "private static final Float Float25", "private static volatile Float Float26", "private transient final Float Float27", "private transient volatile Float Float28", "persistence-modifier= none private transient volatile Float Float29", "persistence-modifier= persistent private transient volatile Float Float30", "persistence-modifier= persistent embedded= true private transient volatile Float Float31", "persistence-modifier= persistent embedded= false private transient volatile Float Float32", "persistence-modifier= transactional private transient volatile Float Float33", "private static transient final Float Float34", "private static transient volatile Float Float35", "public Float Float36", "embedded= true public Float Float37", "embedded= false public Float Float38", "persistence-modifier= none public Float Float39", "persistence-modifier= persistent public Float Float40", "persistence-modifier= persistent embedded= true public Float Float41", "persistence-modifier= persistent embedded= false public Float Float42", "persistence-modifier= transactional public Float Float43", "public static Float Float44", "public transient Float Float45", "persistence-modifier= none public transient Float Float46", "persistence-modifier= persistent public transient Float Float47", "persistence-modifier= persistent embedded= true public transient Float Float48", "persistence-modifier= persistent embedded= false public transient Float Float49", "persistence-modifier= transactional public transient Float Float50", "public final Float Float51", "public volatile Float Float52", "embedded= true public volatile Float Float53", "embedded= false public volatile Float Float54", "persistence-modifier= none public volatile Float Float55", "persistence-modifier= persistent public volatile Float Float56", "persistence-modifier= persistent embedded= true public volatile Float Float57", "persistence-modifier= persistent embedded= false public volatile Float Float58", "persistence-modifier= transactional public volatile Float Float59", "public static transient Float Float60", "public static final Float Float61", "public static volatile Float Float62", "public transient final Float Float63", "public transient volatile Float Float64", "persistence-modifier= none public transient volatile Float Float65", "persistence-modifier= persistent public transient volatile Float Float66", "persistence-modifier= persistent embedded= true public transient volatile Float Float67", "persistence-modifier= persistent embedded= false public transient volatile Float Float68", "persistence-modifier= transactional public transient volatile Float Float69", "public static transient final Float Float70", "public static transient volatile Float Float71", "protected Float Float72", "embedded= true protected Float Float73", "embedded= false protected Float Float74", "persistence-modifier= none protected Float Float75", "persistence-modifier= persistent protected Float Float76", "persistence-modifier= persistent embedded= true protected Float Float77", "persistence-modifier= persistent embedded= false protected Float Float78", "persistence-modifier= transactional protected Float Float79", "protected static Float Float80", "protected transient Float Float81", "persistence-modifier= none protected transient Float Float82", "persistence-modifier= persistent protected transient Float Float83", "persistence-modifier= persistent embedded= true protected transient Float Float84", "persistence-modifier= persistent embedded= false protected transient Float Float85", "persistence-modifier= transactional protected transient Float Float86", "protected final Float Float87", "protected volatile Float Float88", "embedded= true protected volatile Float Float89", "embedded= false protected volatile Float Float90", "persistence-modifier= none protected volatile Float Float91", "persistence-modifier= persistent protected volatile Float Float92", "persistence-modifier= persistent embedded= true protected volatile Float Float93", "persistence-modifier= persistent embedded= false protected volatile Float Float94", "persistence-modifier= transactional protected volatile Float Float95", "protected static transient Float Float96", "protected static final Float Float97", "protected static volatile Float Float98", "protected transient final Float Float99", "protected transient volatile Float Float100", "persistence-modifier= none protected transient volatile Float Float101", "persistence-modifier= persistent protected transient volatile Float Float102", "persistence-modifier= persistent embedded= true protected transient volatile Float Float103", "persistence-modifier= persistent embedded= false protected transient volatile Float Float104", "persistence-modifier= transactional protected transient volatile Float Float105", "protected static transient final Float Float106", "protected static transient volatile Float Float107", "Float Float108", "embedded= true Float Float109", "embedded= false Float Float110", "persistence-modifier= none Float Float111", "persistence-modifier= persistent Float Float112", "persistence-modifier= persistent embedded= true Float Float113", "persistence-modifier= persistent embedded= false Float Float114", "persistence-modifier= transactional Float Float115", "static Float Float116", "transient Float Float117", "persistence-modifier= none transient Float Float118", "persistence-modifier= persistent transient Float Float119", "persistence-modifier= persistent embedded= true transient Float Float120", "persistence-modifier= persistent embedded= false transient Float Float121", "persistence-modifier= transactional transient Float Float122", "final Float Float123", "volatile Float Float124", "embedded= true volatile Float Float125", "embedded= false volatile Float Float126", "persistence-modifier= none volatile Float Float127", "persistence-modifier= persistent volatile Float Float128", "persistence-modifier= persistent embedded= true volatile Float Float129", "persistence-modifier= persistent embedded= false volatile Float Float130", "persistence-modifier= transactional volatile Float Float131", "static transient Float Float132", "static final Float Float133", "static volatile Float Float134", "transient final Float Float135", "transient volatile Float Float136", "persistence-modifier= none transient volatile Float Float137", "persistence-modifier= persistent transient volatile Float Float138", "persistence-modifier= persistent embedded= true transient volatile Float Float139", "persistence-modifier= persistent embedded= false transient volatile Float Float140", "persistence-modifier= transactional transient volatile Float Float141", "static transient final Float Float142", "static transient volatile Float Float143" }; public int getLength() { return fieldSpecs.length; } public Float get(int index) { switch (index) { case(0): return Float0; case(1): return Float1; case(2): return Float2; case(3): return Float3; case(4): return Float4; case(5): return Float5; case(6): return Float6; case(7): return Float7; case(8): return Float8; case(9): return Float9; case(10): return Float10; case(11): return Float11; case(12): return Float12; case(13): return Float13; case(14): return Float14; case(15): return Float15; case(16): return Float16; case(17): return Float17; case(18): return Float18; case(19): return Float19; case(20): return Float20; case(21): return Float21; case(22): return Float22; case(23): return Float23; case(24): return Float24; case(25): return Float25; case(26): return Float26; case(27): return Float27; case(28): return Float28; case(29): return Float29; case(30): return Float30; case(31): return Float31; case(32): return Float32; case(33): return Float33; case(34): return Float34; case(35): return Float35; case(36): return Float36; case(37): return Float37; case(38): return Float38; case(39): return Float39; case(40): return Float40; case(41): return Float41; case(42): return Float42; case(43): return Float43; case(44): return Float44; case(45): return Float45; case(46): return Float46; case(47): return Float47; case(48): return Float48; case(49): return Float49; case(50): return Float50; case(51): return Float51; case(52): return Float52; case(53): return Float53; case(54): return Float54; case(55): return Float55; case(56): return Float56; case(57): return Float57; case(58): return Float58; case(59): return Float59; case(60): return Float60; case(61): return Float61; case(62): return Float62; case(63): return Float63; case(64): return Float64; case(65): return Float65; case(66): return Float66; case(67): return Float67; case(68): return Float68; case(69): return Float69; case(70): return Float70; case(71): return Float71; case(72): return Float72; case(73): return Float73; case(74): return Float74; case(75): return Float75; case(76): return Float76; case(77): return Float77; case(78): return Float78; case(79): return Float79; case(80): return Float80; case(81): return Float81; case(82): return Float82; case(83): return Float83; case(84): return Float84; case(85): return Float85; case(86): return Float86; case(87): return Float87; case(88): return Float88; case(89): return Float89; case(90): return Float90; case(91): return Float91; case(92): return Float92; case(93): return Float93; case(94): return Float94; case(95): return Float95; case(96): return Float96; case(97): return Float97; case(98): return Float98; case(99): return Float99; case(100): return Float100; case(101): return Float101; case(102): return Float102; case(103): return Float103; case(104): return Float104; case(105): return Float105; case(106): return Float106; case(107): return Float107; case(108): return Float108; case(109): return Float109; case(110): return Float110; case(111): return Float111; case(112): return Float112; case(113): return Float113; case(114): return Float114; case(115): return Float115; case(116): return Float116; case(117): return Float117; case(118): return Float118; case(119): return Float119; case(120): return Float120; case(121): return Float121; case(122): return Float122; case(123): return Float123; case(124): return Float124; case(125): return Float125; case(126): return Float126; case(127): return Float127; case(128): return Float128; case(129): return Float129; case(130): return Float130; case(131): return Float131; case(132): return Float132; case(133): return Float133; case(134): return Float134; case(135): return Float135; case(136): return Float136; case(137): return Float137; case(138): return Float138; case(139): return Float139; case(140): return Float140; case(141): return Float141; case(142): return Float142; case(143): return Float143; default: throw new IndexOutOfBoundsException(); } } public boolean set(int index,Float value) { if(fieldSpecs[index].indexOf("final") != -1) return false; switch (index) { case(0): Float0= value; break; case(1): Float1= value; break; case(2): Float2= value; break; case(3): Float3= value; break; case(4): Float4= value; break; case(5): Float5= value; break; case(6): Float6= value; break; case(7): Float7= value; break; case(8): Float8= value; break; case(9): Float9= value; break; case(10): Float10= value; break; case(11): Float11= value; break; case(12): Float12= value; break; case(13): Float13= value; break; case(14): Float14= value; break; case(16): Float16= value; break; case(17): Float17= value; break; case(18): Float18= value; break; case(19): Float19= value; break; case(20): Float20= value; break; case(21): Float21= value; break; case(22): Float22= value; break; case(23): Float23= value; break; case(24): Float24= value; break; case(26): Float26= value; break; case(28): Float28= value; break; case(29): Float29= value; break; case(30): Float30= value; break; case(31): Float31= value; break; case(32): Float32= value; break; case(33): Float33= value; break; case(35): Float35= value; break; case(36): Float36= value; break; case(37): Float37= value; break; case(38): Float38= value; break; case(39): Float39= value; break; case(40): Float40= value; break; case(41): Float41= value; break; case(42): Float42= value; break; case(43): Float43= value; break; case(44): Float44= value; break; case(45): Float45= value; break; case(46): Float46= value; break; case(47): Float47= value; break; case(48): Float48= value; break; case(49): Float49= value; break; case(50): Float50= value; break; case(52): Float52= value; break; case(53): Float53= value; break; case(54): Float54= value; break; case(55): Float55= value; break; case(56): Float56= value; break; case(57): Float57= value; break; case(58): Float58= value; break; case(59): Float59= value; break; case(60): Float60= value; break; case(62): Float62= value; break; case(64): Float64= value; break; case(65): Float65= value; break; case(66): Float66= value; break; case(67): Float67= value; break; case(68): Float68= value; break; case(69): Float69= value; break; case(71): Float71= value; break; case(72): Float72= value; break; case(73): Float73= value; break; case(74): Float74= value; break; case(75): Float75= value; break; case(76): Float76= value; break; case(77): Float77= value; break; case(78): Float78= value; break; case(79): Float79= value; break; case(80): Float80= value; break; case(81): Float81= value; break; case(82): Float82= value; break; case(83): Float83= value; break; case(84): Float84= value; break; case(85): Float85= value; break; case(86): Float86= value; break; case(88): Float88= value; break; case(89): Float89= value; break; case(90): Float90= value; break; case(91): Float91= value; break; case(92): Float92= value; break; case(93): Float93= value; break; case(94): Float94= value; break; case(95): Float95= value; break; case(96): Float96= value; break; case(98): Float98= value; break; case(100): Float100= value; break; case(101): Float101= value; break; case(102): Float102= value; break; case(103): Float103= value; break; case(104): Float104= value; break; case(105): Float105= value; break; case(107): Float107= value; break; case(108): Float108= value; break; case(109): Float109= value; break; case(110): Float110= value; break; case(111): Float111= value; break; case(112): Float112= value; break; case(113): Float113= value; break; case(114): Float114= value; break; case(115): Float115= value; break; case(116): Float116= value; break; case(117): Float117= value; break; case(118): Float118= value; break; case(119): Float119= value; break; case(120): Float120= value; break; case(121): Float121= value; break; case(122): Float122= value; break; case(124): Float124= value; break; case(125): Float125= value; break; case(126): Float126= value; break; case(127): Float127= value; break; case(128): Float128= value; break; case(129): Float129= value; break; case(130): Float130= value; break; case(131): Float131= value; break; case(132): Float132= value; break; case(134): Float134= value; break; case(136): Float136= value; break; case(137): Float137= value; break; case(138): Float138= value; break; case(139): Float139= value; break; case(140): Float140= value; break; case(141): Float141= value; break; case(143): Float143= value; break; default: throw new IndexOutOfBoundsException(); } return true; } public static class Oid implements Serializable { public int identifier; public Oid() { } public Oid(String s) { identifier = Integer.parseInt(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + identifier;} public int hashCode() { return (int)identifier ; } public boolean equals(Object other) { if (other != null && (other instanceof Oid)) { Oid k = (Oid)other; return k.identifier == this.identifier; } return false; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } } } tck/src/java/org/apache/jdo/tck/pc/fieldtypes/FieldsOfInteger.java100664 101430 12500110373 25412 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.io.Serializable; public class FieldsOfInteger { public int identifier; private Integer Integer0; private Integer Integer1; private Integer Integer2; private Integer Integer3; private Integer Integer4; private Integer Integer5; private Integer Integer6; private Integer Integer7; private static Integer Integer8; private transient Integer Integer9; private transient Integer Integer10; private transient Integer Integer11; private transient Integer Integer12; private transient Integer Integer13; private transient Integer Integer14; private final Integer Integer15 = new Integer((int)5); private volatile Integer Integer16; private volatile Integer Integer17; private volatile Integer Integer18; private volatile Integer Integer19; private volatile Integer Integer20; private volatile Integer Integer21; private volatile Integer Integer22; private volatile Integer Integer23; private static transient Integer Integer24; private static final Integer Integer25 = new Integer((int)5); private static volatile Integer Integer26; private transient final Integer Integer27 = new Integer((int)5); private transient volatile Integer Integer28; private transient volatile Integer Integer29; private transient volatile Integer Integer30; private transient volatile Integer Integer31; private transient volatile Integer Integer32; private transient volatile Integer Integer33; private static transient final Integer Integer34 = new Integer((int)5); private static transient volatile Integer Integer35; public Integer Integer36; public Integer Integer37; public Integer Integer38; public Integer Integer39; public Integer Integer40; public Integer Integer41; public Integer Integer42; public Integer Integer43; public static Integer Integer44; public transient Integer Integer45; public transient Integer Integer46; public transient Integer Integer47; public transient Integer Integer48; public transient Integer Integer49; public transient Integer Integer50; public final Integer Integer51 = new Integer((int)5); public volatile Integer Integer52; public volatile Integer Integer53; public volatile Integer Integer54; public volatile Integer Integer55; public volatile Integer Integer56; public volatile Integer Integer57; public volatile Integer Integer58; public volatile Integer Integer59; public static transient Integer Integer60; public static final Integer Integer61 = new Integer((int)5); public static volatile Integer Integer62; public transient final Integer Integer63 = new Integer((int)5); public transient volatile Integer Integer64; public transient volatile Integer Integer65; public transient volatile Integer Integer66; public transient volatile Integer Integer67; public transient volatile Integer Integer68; public transient volatile Integer Integer69; public static transient final Integer Integer70 = new Integer((int)5); public static transient volatile Integer Integer71; protected Integer Integer72; protected Integer Integer73; protected Integer Integer74; protected Integer Integer75; protected Integer Integer76; protected Integer Integer77; protected Integer Integer78; protected Integer Integer79; protected static Integer Integer80; protected transient Integer Integer81; protected transient Integer Integer82; protected transient Integer Integer83; protected transient Integer Integer84; protected transient Integer Integer85; protected transient Integer Integer86; protected final Integer Integer87 = new Integer((int)5); protected volatile Integer Integer88; protected volatile Integer Integer89; protected volatile Integer Integer90; protected volatile Integer Integer91; protected volatile Integer Integer92; protected volatile Integer Integer93; protected volatile Integer Integer94; protected volatile Integer Integer95; protected static transient Integer Integer96; protected static final Integer Integer97 = new Integer((int)5); protected static volatile Integer Integer98; protected transient final Integer Integer99 = new Integer((int)5); protected transient volatile Integer Integer100; protected transient volatile Integer Integer101; protected transient volatile Integer Integer102; protected transient volatile Integer Integer103; protected transient volatile Integer Integer104; protected transient volatile Integer Integer105; protected static transient final Integer Integer106 = new Integer((int)5); protected static transient volatile Integer Integer107; Integer Integer108; Integer Integer109; Integer Integer110; Integer Integer111; Integer Integer112; Integer Integer113; Integer Integer114; Integer Integer115; static Integer Integer116; transient Integer Integer117; transient Integer Integer118; transient Integer Integer119; transient Integer Integer120; transient Integer Integer121; transient Integer Integer122; final Integer Integer123 = new Integer((int)5); volatile Integer Integer124; volatile Integer Integer125; volatile Integer Integer126; volatile Integer Integer127; volatile Integer Integer128; volatile Integer Integer129; volatile Integer Integer130; volatile Integer Integer131; static transient Integer Integer132; static final Integer Integer133 = new Integer((int)5); static volatile Integer Integer134; transient final Integer Integer135 = new Integer((int)5); transient volatile Integer Integer136; transient volatile Integer Integer137; transient volatile Integer Integer138; transient volatile Integer Integer139; transient volatile Integer Integer140; transient volatile Integer Integer141; static transient final Integer Integer142 = new Integer((int)5); static transient volatile Integer Integer143; public static final boolean [] isPersistent = { true,true,true,false,true,true,true,false,false,false, false,true,true,true,false,false,true,true,true,false, true,true,true,false,false,false,false,false,false,false, true,true,true,false,false,false,true,true,true,false, true,true,true,false,false,false,false,true,true,true, false,false,true,true,true,false,true,true,true,false, false,false,false,false,false,false,true,true,true,false, false,false,true,true,true,false,true,true,true,false, false,false,false,true,true,true,false,false,true,true, true,false,true,true,true,false,false,false,false,false, false,false,true,true,true,false,false,false,true,true, true,false,true,true,true,false,false,false,false,true, true,true,false,false,true,true,true,false,true,true, true,false,false,false,false,false,false,false,true,true, true,false,false,false }; public static final boolean [] isStatic = { false,false,false,false,false,false,false,false,true,false, false,false,false,false,false,false,false,false,false,false, false,false,false,false,true,true,true,false,false,false, false,false,false,false,true,true,false,false,false,false, false,false,false,false,true,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, true,true,true,false,false,false,false,false,false,false, true,true,false,false,false,false,false,false,false,false, true,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,true,true,true,false, false,false,false,false,false,false,true,true,false,false, false,false,false,false,false,false,true,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,true,true,true,false,false,false,false,false, false,false,true,true }; public static final boolean [] isFinal = { false,false,false,false,false,false,false,false,false,false, false,false,false,false,false,true,false,false,false,false, false,false,false,false,false,true,false,true,false,false, false,false,false,false,true,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, false,true,false,false,false,false,false,false,false,false, false,true,false,true,false,false,false,false,false,false, true,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,false,true,false,false, false,false,false,false,false,false,false,true,false,true, false,false,false,false,false,false,true,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,false,true,false,false,false,false,false,false, false,false,false,true,false,true,false,false,false,false, false,false,true,false }; public static final String [] fieldSpecs = { "private Integer Integer0", "embedded= true private Integer Integer1", "embedded= false private Integer Integer2", "persistence-modifier= none private Integer Integer3", "persistence-modifier= persistent private Integer Integer4", "persistence-modifier= persistent embedded= true private Integer Integer5", "persistence-modifier= persistent embedded= false private Integer Integer6", "persistence-modifier= transactional private Integer Integer7", "private static Integer Integer8", "private transient Integer Integer9", "persistence-modifier= none private transient Integer Integer10", "persistence-modifier= persistent private transient Integer Integer11", "persistence-modifier= persistent embedded= true private transient Integer Integer12", "persistence-modifier= persistent embedded= false private transient Integer Integer13", "persistence-modifier= transactional private transient Integer Integer14", "private final Integer Integer15", "private volatile Integer Integer16", "embedded= true private volatile Integer Integer17", "embedded= false private volatile Integer Integer18", "persistence-modifier= none private volatile Integer Integer19", "persistence-modifier= persistent private volatile Integer Integer20", "persistence-modifier= persistent embedded= true private volatile Integer Integer21", "persistence-modifier= persistent embedded= false private volatile Integer Integer22", "persistence-modifier= transactional private volatile Integer Integer23", "private static transient Integer Integer24", "private static final Integer Integer25", "private static volatile Integer Integer26", "private transient final Integer Integer27", "private transient volatile Integer Integer28", "persistence-modifier= none private transient volatile Integer Integer29", "persistence-modifier= persistent private transient volatile Integer Integer30", "persistence-modifier= persistent embedded= true private transient volatile Integer Integer31", "persistence-modifier= persistent embedded= false private transient volatile Integer Integer32", "persistence-modifier= transactional private transient volatile Integer Integer33", "private static transient final Integer Integer34", "private static transient volatile Integer Integer35", "public Integer Integer36", "embedded= true public Integer Integer37", "embedded= false public Integer Integer38", "persistence-modifier= none public Integer Integer39", "persistence-modifier= persistent public Integer Integer40", "persistence-modifier= persistent embedded= true public Integer Integer41", "persistence-modifier= persistent embedded= false public Integer Integer42", "persistence-modifier= transactional public Integer Integer43", "public static Integer Integer44", "public transient Integer Integer45", "persistence-modifier= none public transient Integer Integer46", "persistence-modifier= persistent public transient Integer Integer47", "persistence-modifier= persistent embedded= true public transient Integer Integer48", "persistence-modifier= persistent embedded= false public transient Integer Integer49", "persistence-modifier= transactional public transient Integer Integer50", "public final Integer Integer51", "public volatile Integer Integer52", "embedded= true public volatile Integer Integer53", "embedded= false public volatile Integer Integer54", "persistence-modifier= none public volatile Integer Integer55", "persistence-modifier= persistent public volatile Integer Integer56", "persistence-modifier= persistent embedded= true public volatile Integer Integer57", "persistence-modifier= persistent embedded= false public volatile Integer Integer58", "persistence-modifier= transactional public volatile Integer Integer59", "public static transient Integer Integer60", "public static final Integer Integer61", "public static volatile Integer Integer62", "public transient final Integer Integer63", "public transient volatile Integer Integer64", "persistence-modifier= none public transient volatile Integer Integer65", "persistence-modifier= persistent public transient volatile Integer Integer66", "persistence-modifier= persistent embedded= true public transient volatile Integer Integer67", "persistence-modifier= persistent embedded= false public transient volatile Integer Integer68", "persistence-modifier= transactional public transient volatile Integer Integer69", "public static transient final Integer Integer70", "public static transient volatile Integer Integer71", "protected Integer Integer72", "embedded= true protected Integer Integer73", "embedded= false protected Integer Integer74", "persistence-modifier= none protected Integer Integer75", "persistence-modifier= persistent protected Integer Integer76", "persistence-modifier= persistent embedded= true protected Integer Integer77", "persistence-modifier= persistent embedded= false protected Integer Integer78", "persistence-modifier= transactional protected Integer Integer79", "protected static Integer Integer80", "protected transient Integer Integer81", "persistence-modifier= none protected transient Integer Integer82", "persistence-modifier= persistent protected transient Integer Integer83", "persistence-modifier= persistent embedded= true protected transient Integer Integer84", "persistence-modifier= persistent embedded= false protected transient Integer Integer85", "persistence-modifier= transactional protected transient Integer Integer86", "protected final Integer Integer87", "protected volatile Integer Integer88", "embedded= true protected volatile Integer Integer89", "embedded= false protected volatile Integer Integer90", "persistence-modifier= none protected volatile Integer Integer91", "persistence-modifier= persistent protected volatile Integer Integer92", "persistence-modifier= persistent embedded= true protected volatile Integer Integer93", "persistence-modifier= persistent embedded= false protected volatile Integer Integer94", "persistence-modifier= transactional protected volatile Integer Integer95", "protected static transient Integer Integer96", "protected static final Integer Integer97", "protected static volatile Integer Integer98", "protected transient final Integer Integer99", "protected transient volatile Integer Integer100", "persistence-modifier= none protected transient volatile Integer Integer101", "persistence-modifier= persistent protected transient volatile Integer Integer102", "persistence-modifier= persistent embedded= true protected transient volatile Integer Integer103", "persistence-modifier= persistent embedded= false protected transient volatile Integer Integer104", "persistence-modifier= transactional protected transient volatile Integer Integer105", "protected static transient final Integer Integer106", "protected static transient volatile Integer Integer107", "Integer Integer108", "embedded= true Integer Integer109", "embedded= false Integer Integer110", "persistence-modifier= none Integer Integer111", "persistence-modifier= persistent Integer Integer112", "persistence-modifier= persistent embedded= true Integer Integer113", "persistence-modifier= persistent embedded= false Integer Integer114", "persistence-modifier= transactional Integer Integer115", "static Integer Integer116", "transient Integer Integer117", "persistence-modifier= none transient Integer Integer118", "persistence-modifier= persistent transient Integer Integer119", "persistence-modifier= persistent embedded= true transient Integer Integer120", "persistence-modifier= persistent embedded= false transient Integer Integer121", "persistence-modifier= transactional transient Integer Integer122", "final Integer Integer123", "volatile Integer Integer124", "embedded= true volatile Integer Integer125", "embedded= false volatile Integer Integer126", "persistence-modifier= none volatile Integer Integer127", "persistence-modifier= persistent volatile Integer Integer128", "persistence-modifier= persistent embedded= true volatile Integer Integer129", "persistence-modifier= persistent embedded= false volatile Integer Integer130", "persistence-modifier= transactional volatile Integer Integer131", "static transient Integer Integer132", "static final Integer Integer133", "static volatile Integer Integer134", "transient final Integer Integer135", "transient volatile Integer Integer136", "persistence-modifier= none transient volatile Integer Integer137", "persistence-modifier= persistent transient volatile Integer Integer138", "persistence-modifier= persistent embedded= true transient volatile Integer Integer139", "persistence-modifier= persistent embedded= false transient volatile Integer Integer140", "persistence-modifier= transactional transient volatile Integer Integer141", "static transient final Integer Integer142", "static transient volatile Integer Integer143" }; public int getLength() { return fieldSpecs.length; } public Integer get(int index) { switch (index) { case(0): return Integer0; case(1): return Integer1; case(2): return Integer2; case(3): return Integer3; case(4): return Integer4; case(5): return Integer5; case(6): return Integer6; case(7): return Integer7; case(8): return Integer8; case(9): return Integer9; case(10): return Integer10; case(11): return Integer11; case(12): return Integer12; case(13): return Integer13; case(14): return Integer14; case(15): return Integer15; case(16): return Integer16; case(17): return Integer17; case(18): return Integer18; case(19): return Integer19; case(20): return Integer20; case(21): return Integer21; case(22): return Integer22; case(23): return Integer23; case(24): return Integer24; case(25): return Integer25; case(26): return Integer26; case(27): return Integer27; case(28): return Integer28; case(29): return Integer29; case(30): return Integer30; case(31): return Integer31; case(32): return Integer32; case(33): return Integer33; case(34): return Integer34; case(35): return Integer35; case(36): return Integer36; case(37): return Integer37; case(38): return Integer38; case(39): return Integer39; case(40): return Integer40; case(41): return Integer41; case(42): return Integer42; case(43): return Integer43; case(44): return Integer44; case(45): return Integer45; case(46): return Integer46; case(47): return Integer47; case(48): return Integer48; case(49): return Integer49; case(50): return Integer50; case(51): return Integer51; case(52): return Integer52; case(53): return Integer53; case(54): return Integer54; case(55): return Integer55; case(56): return Integer56; case(57): return Integer57; case(58): return Integer58; case(59): return Integer59; case(60): return Integer60; case(61): return Integer61; case(62): return Integer62; case(63): return Integer63; case(64): return Integer64; case(65): return Integer65; case(66): return Integer66; case(67): return Integer67; case(68): return Integer68; case(69): return Integer69; case(70): return Integer70; case(71): return Integer71; case(72): return Integer72; case(73): return Integer73; case(74): return Integer74; case(75): return Integer75; case(76): return Integer76; case(77): return Integer77; case(78): return Integer78; case(79): return Integer79; case(80): return Integer80; case(81): return Integer81; case(82): return Integer82; case(83): return Integer83; case(84): return Integer84; case(85): return Integer85; case(86): return Integer86; case(87): return Integer87; case(88): return Integer88; case(89): return Integer89; case(90): return Integer90; case(91): return Integer91; case(92): return Integer92; case(93): return Integer93; case(94): return Integer94; case(95): return Integer95; case(96): return Integer96; case(97): return Integer97; case(98): return Integer98; case(99): return Integer99; case(100): return Integer100; case(101): return Integer101; case(102): return Integer102; case(103): return Integer103; case(104): return Integer104; case(105): return Integer105; case(106): return Integer106; case(107): return Integer107; case(108): return Integer108; case(109): return Integer109; case(110): return Integer110; case(111): return Integer111; case(112): return Integer112; case(113): return Integer113; case(114): return Integer114; case(115): return Integer115; case(116): return Integer116; case(117): return Integer117; case(118): return Integer118; case(119): return Integer119; case(120): return Integer120; case(121): return Integer121; case(122): return Integer122; case(123): return Integer123; case(124): return Integer124; case(125): return Integer125; case(126): return Integer126; case(127): return Integer127; case(128): return Integer128; case(129): return Integer129; case(130): return Integer130; case(131): return Integer131; case(132): return Integer132; case(133): return Integer133; case(134): return Integer134; case(135): return Integer135; case(136): return Integer136; case(137): return Integer137; case(138): return Integer138; case(139): return Integer139; case(140): return Integer140; case(141): return Integer141; case(142): return Integer142; case(143): return Integer143; default: throw new IndexOutOfBoundsException(); } } public boolean set(int index,Integer value) { if(fieldSpecs[index].indexOf("final") != -1) return false; switch (index) { case(0): Integer0= value; break; case(1): Integer1= value; break; case(2): Integer2= value; break; case(3): Integer3= value; break; case(4): Integer4= value; break; case(5): Integer5= value; break; case(6): Integer6= value; break; case(7): Integer7= value; break; case(8): Integer8= value; break; case(9): Integer9= value; break; case(10): Integer10= value; break; case(11): Integer11= value; break; case(12): Integer12= value; break; case(13): Integer13= value; break; case(14): Integer14= value; break; case(16): Integer16= value; break; case(17): Integer17= value; break; case(18): Integer18= value; break; case(19): Integer19= value; break; case(20): Integer20= value; break; case(21): Integer21= value; break; case(22): Integer22= value; break; case(23): Integer23= value; break; case(24): Integer24= value; break; case(26): Integer26= value; break; case(28): Integer28= value; break; case(29): Integer29= value; break; case(30): Integer30= value; break; case(31): Integer31= value; break; case(32): Integer32= value; break; case(33): Integer33= value; break; case(35): Integer35= value; break; case(36): Integer36= value; break; case(37): Integer37= value; break; case(38): Integer38= value; break; case(39): Integer39= value; break; case(40): Integer40= value; break; case(41): Integer41= value; break; case(42): Integer42= value; break; case(43): Integer43= value; break; case(44): Integer44= value; break; case(45): Integer45= value; break; case(46): Integer46= value; break; case(47): Integer47= value; break; case(48): Integer48= value; break; case(49): Integer49= value; break; case(50): Integer50= value; break; case(52): Integer52= value; break; case(53): Integer53= value; break; case(54): Integer54= value; break; case(55): Integer55= value; break; case(56): Integer56= value; break; case(57): Integer57= value; break; case(58): Integer58= value; break; case(59): Integer59= value; break; case(60): Integer60= value; break; case(62): Integer62= value; break; case(64): Integer64= value; break; case(65): Integer65= value; break; case(66): Integer66= value; break; case(67): Integer67= value; break; case(68): Integer68= value; break; case(69): Integer69= value; break; case(71): Integer71= value; break; case(72): Integer72= value; break; case(73): Integer73= value; break; case(74): Integer74= value; break; case(75): Integer75= value; break; case(76): Integer76= value; break; case(77): Integer77= value; break; case(78): Integer78= value; break; case(79): Integer79= value; break; case(80): Integer80= value; break; case(81): Integer81= value; break; case(82): Integer82= value; break; case(83): Integer83= value; break; case(84): Integer84= value; break; case(85): Integer85= value; break; case(86): Integer86= value; break; case(88): Integer88= value; break; case(89): Integer89= value; break; case(90): Integer90= value; break; case(91): Integer91= value; break; case(92): Integer92= value; break; case(93): Integer93= value; break; case(94): Integer94= value; break; case(95): Integer95= value; break; case(96): Integer96= value; break; case(98): Integer98= value; break; case(100): Integer100= value; break; case(101): Integer101= value; break; case(102): Integer102= value; break; case(103): Integer103= value; break; case(104): Integer104= value; break; case(105): Integer105= value; break; case(107): Integer107= value; break; case(108): Integer108= value; break; case(109): Integer109= value; break; case(110): Integer110= value; break; case(111): Integer111= value; break; case(112): Integer112= value; break; case(113): Integer113= value; break; case(114): Integer114= value; break; case(115): Integer115= value; break; case(116): Integer116= value; break; case(117): Integer117= value; break; case(118): Integer118= value; break; case(119): Integer119= value; break; case(120): Integer120= value; break; case(121): Integer121= value; break; case(122): Integer122= value; break; case(124): Integer124= value; break; case(125): Integer125= value; break; case(126): Integer126= value; break; case(127): Integer127= value; break; case(128): Integer128= value; break; case(129): Integer129= value; break; case(130): Integer130= value; break; case(131): Integer131= value; break; case(132): Integer132= value; break; case(134): Integer134= value; break; case(136): Integer136= value; break; case(137): Integer137= value; break; case(138): Integer138= value; break; case(139): Integer139= value; break; case(140): Integer140= value; break; case(141): Integer141= value; break; case(143): Integer143= value; break; default: throw new IndexOutOfBoundsException(); } return true; } public static class Oid implements Serializable { public int identifier; public Oid() { } public Oid(String s) { identifier = Integer.parseInt(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + identifier;} public int hashCode() { return (int)identifier ; } public boolean equals(Object other) { if (other != null && (other instanceof Oid)) { Oid k = (Oid)other; return k.identifier == this.identifier; } return false; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } } } tck/src/java/org/apache/jdo/tck/pc/fieldtypes/FieldsOfLocale.java100664 77472 12500110373 25216 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.io.Serializable; import java.util.*; public class FieldsOfLocale { public int identifier; private Locale Locale0; private Locale Locale1; private Locale Locale2; private Locale Locale3; private Locale Locale4; private Locale Locale5; private Locale Locale6; private Locale Locale7; private static Locale Locale8; private transient Locale Locale9; private transient Locale Locale10; private transient Locale Locale11; private transient Locale Locale12; private transient Locale Locale13; private transient Locale Locale14; private final Locale Locale15 = Locale.US; private volatile Locale Locale16; private volatile Locale Locale17; private volatile Locale Locale18; private volatile Locale Locale19; private volatile Locale Locale20; private volatile Locale Locale21; private volatile Locale Locale22; private volatile Locale Locale23; private static transient Locale Locale24; private static final Locale Locale25 = Locale.US; private static volatile Locale Locale26; private transient final Locale Locale27 = Locale.US; private transient volatile Locale Locale28; private transient volatile Locale Locale29; private transient volatile Locale Locale30; private transient volatile Locale Locale31; private transient volatile Locale Locale32; private transient volatile Locale Locale33; private static transient final Locale Locale34 = Locale.US; private static transient volatile Locale Locale35; public Locale Locale36; public Locale Locale37; public Locale Locale38; public Locale Locale39; public Locale Locale40; public Locale Locale41; public Locale Locale42; public Locale Locale43; public static Locale Locale44; public transient Locale Locale45; public transient Locale Locale46; public transient Locale Locale47; public transient Locale Locale48; public transient Locale Locale49; public transient Locale Locale50; public final Locale Locale51 = Locale.US; public volatile Locale Locale52; public volatile Locale Locale53; public volatile Locale Locale54; public volatile Locale Locale55; public volatile Locale Locale56; public volatile Locale Locale57; public volatile Locale Locale58; public volatile Locale Locale59; public static transient Locale Locale60; public static final Locale Locale61 = Locale.US; public static volatile Locale Locale62; public transient final Locale Locale63 = Locale.US; public transient volatile Locale Locale64; public transient volatile Locale Locale65; public transient volatile Locale Locale66; public transient volatile Locale Locale67; public transient volatile Locale Locale68; public transient volatile Locale Locale69; public static transient final Locale Locale70 = Locale.US; public static transient volatile Locale Locale71; protected Locale Locale72; protected Locale Locale73; protected Locale Locale74; protected Locale Locale75; protected Locale Locale76; protected Locale Locale77; protected Locale Locale78; protected Locale Locale79; protected static Locale Locale80; protected transient Locale Locale81; protected transient Locale Locale82; protected transient Locale Locale83; protected transient Locale Locale84; protected transient Locale Locale85; protected transient Locale Locale86; protected final Locale Locale87 = Locale.US; protected volatile Locale Locale88; protected volatile Locale Locale89; protected volatile Locale Locale90; protected volatile Locale Locale91; protected volatile Locale Locale92; protected volatile Locale Locale93; protected volatile Locale Locale94; protected volatile Locale Locale95; protected static transient Locale Locale96; protected static final Locale Locale97 = Locale.US; protected static volatile Locale Locale98; protected transient final Locale Locale99 = Locale.US; protected transient volatile Locale Locale100; protected transient volatile Locale Locale101; protected transient volatile Locale Locale102; protected transient volatile Locale Locale103; protected transient volatile Locale Locale104; protected transient volatile Locale Locale105; protected static transient final Locale Locale106 = Locale.US; protected static transient volatile Locale Locale107; Locale Locale108; Locale Locale109; Locale Locale110; Locale Locale111; Locale Locale112; Locale Locale113; Locale Locale114; Locale Locale115; static Locale Locale116; transient Locale Locale117; transient Locale Locale118; transient Locale Locale119; transient Locale Locale120; transient Locale Locale121; transient Locale Locale122; final Locale Locale123 = Locale.US; volatile Locale Locale124; volatile Locale Locale125; volatile Locale Locale126; volatile Locale Locale127; volatile Locale Locale128; volatile Locale Locale129; volatile Locale Locale130; volatile Locale Locale131; static transient Locale Locale132; static final Locale Locale133 = Locale.US; static volatile Locale Locale134; transient final Locale Locale135 = Locale.US; transient volatile Locale Locale136; transient volatile Locale Locale137; transient volatile Locale Locale138; transient volatile Locale Locale139; transient volatile Locale Locale140; transient volatile Locale Locale141; static transient final Locale Locale142 = Locale.US; static transient volatile Locale Locale143; public static final boolean [] isPersistent = { true,true,true,false,true,true,true,false,false,false, false,true,true,true,false,false,true,true,true,false, true,true,true,false,false,false,false,false,false,false, true,true,true,false,false,false,true,true,true,false, true,true,true,false,false,false,false,true,true,true, false,false,true,true,true,false,true,true,true,false, false,false,false,false,false,false,true,true,true,false, false,false,true,true,true,false,true,true,true,false, false,false,false,true,true,true,false,false,true,true, true,false,true,true,true,false,false,false,false,false, false,false,true,true,true,false,false,false,true,true, true,false,true,true,true,false,false,false,false,true, true,true,false,false,true,true,true,false,true,true, true,false,false,false,false,false,false,false,true,true, true,false,false,false }; public static final boolean [] isStatic = { false,false,false,false,false,false,false,false,true,false, false,false,false,false,false,false,false,false,false,false, false,false,false,false,true,true,true,false,false,false, false,false,false,false,true,true,false,false,false,false, false,false,false,false,true,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, true,true,true,false,false,false,false,false,false,false, true,true,false,false,false,false,false,false,false,false, true,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,true,true,true,false, false,false,false,false,false,false,true,true,false,false, false,false,false,false,false,false,true,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,true,true,true,false,false,false,false,false, false,false,true,true }; public static final boolean [] isFinal = { false,false,false,false,false,false,false,false,false,false, false,false,false,false,false,true,false,false,false,false, false,false,false,false,false,true,false,true,false,false, false,false,false,false,true,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, false,true,false,false,false,false,false,false,false,false, false,true,false,true,false,false,false,false,false,false, true,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,false,true,false,false, false,false,false,false,false,false,false,true,false,true, false,false,false,false,false,false,true,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,false,true,false,false,false,false,false,false, false,false,false,true,false,true,false,false,false,false, false,false,true,false }; public static final String [] fieldSpecs = { "private Locale Locale0", "embedded= true private Locale Locale1", "embedded= false private Locale Locale2", "persistence-modifier= none private Locale Locale3", "persistence-modifier= persistent private Locale Locale4", "persistence-modifier= persistent embedded= true private Locale Locale5", "persistence-modifier= persistent embedded= false private Locale Locale6", "persistence-modifier= transactional private Locale Locale7", "private static Locale Locale8", "private transient Locale Locale9", "persistence-modifier= none private transient Locale Locale10", "persistence-modifier= persistent private transient Locale Locale11", "persistence-modifier= persistent embedded= true private transient Locale Locale12", "persistence-modifier= persistent embedded= false private transient Locale Locale13", "persistence-modifier= transactional private transient Locale Locale14", "private final Locale Locale15", "private volatile Locale Locale16", "embedded= true private volatile Locale Locale17", "embedded= false private volatile Locale Locale18", "persistence-modifier= none private volatile Locale Locale19", "persistence-modifier= persistent private volatile Locale Locale20", "persistence-modifier= persistent embedded= true private volatile Locale Locale21", "persistence-modifier= persistent embedded= false private volatile Locale Locale22", "persistence-modifier= transactional private volatile Locale Locale23", "private static transient Locale Locale24", "private static final Locale Locale25", "private static volatile Locale Locale26", "private transient final Locale Locale27", "private transient volatile Locale Locale28", "persistence-modifier= none private transient volatile Locale Locale29", "persistence-modifier= persistent private transient volatile Locale Locale30", "persistence-modifier= persistent embedded= true private transient volatile Locale Locale31", "persistence-modifier= persistent embedded= false private transient volatile Locale Locale32", "persistence-modifier= transactional private transient volatile Locale Locale33", "private static transient final Locale Locale34", "private static transient volatile Locale Locale35", "public Locale Locale36", "embedded= true public Locale Locale37", "embedded= false public Locale Locale38", "persistence-modifier= none public Locale Locale39", "persistence-modifier= persistent public Locale Locale40", "persistence-modifier= persistent embedded= true public Locale Locale41", "persistence-modifier= persistent embedded= false public Locale Locale42", "persistence-modifier= transactional public Locale Locale43", "public static Locale Locale44", "public transient Locale Locale45", "persistence-modifier= none public transient Locale Locale46", "persistence-modifier= persistent public transient Locale Locale47", "persistence-modifier= persistent embedded= true public transient Locale Locale48", "persistence-modifier= persistent embedded= false public transient Locale Locale49", "persistence-modifier= transactional public transient Locale Locale50", "public final Locale Locale51", "public volatile Locale Locale52", "embedded= true public volatile Locale Locale53", "embedded= false public volatile Locale Locale54", "persistence-modifier= none public volatile Locale Locale55", "persistence-modifier= persistent public volatile Locale Locale56", "persistence-modifier= persistent embedded= true public volatile Locale Locale57", "persistence-modifier= persistent embedded= false public volatile Locale Locale58", "persistence-modifier= transactional public volatile Locale Locale59", "public static transient Locale Locale60", "public static final Locale Locale61", "public static volatile Locale Locale62", "public transient final Locale Locale63", "public transient volatile Locale Locale64", "persistence-modifier= none public transient volatile Locale Locale65", "persistence-modifier= persistent public transient volatile Locale Locale66", "persistence-modifier= persistent embedded= true public transient volatile Locale Locale67", "persistence-modifier= persistent embedded= false public transient volatile Locale Locale68", "persistence-modifier= transactional public transient volatile Locale Locale69", "public static transient final Locale Locale70", "public static transient volatile Locale Locale71", "protected Locale Locale72", "embedded= true protected Locale Locale73", "embedded= false protected Locale Locale74", "persistence-modifier= none protected Locale Locale75", "persistence-modifier= persistent protected Locale Locale76", "persistence-modifier= persistent embedded= true protected Locale Locale77", "persistence-modifier= persistent embedded= false protected Locale Locale78", "persistence-modifier= transactional protected Locale Locale79", "protected static Locale Locale80", "protected transient Locale Locale81", "persistence-modifier= none protected transient Locale Locale82", "persistence-modifier= persistent protected transient Locale Locale83", "persistence-modifier= persistent embedded= true protected transient Locale Locale84", "persistence-modifier= persistent embedded= false protected transient Locale Locale85", "persistence-modifier= transactional protected transient Locale Locale86", "protected final Locale Locale87", "protected volatile Locale Locale88", "embedded= true protected volatile Locale Locale89", "embedded= false protected volatile Locale Locale90", "persistence-modifier= none protected volatile Locale Locale91", "persistence-modifier= persistent protected volatile Locale Locale92", "persistence-modifier= persistent embedded= true protected volatile Locale Locale93", "persistence-modifier= persistent embedded= false protected volatile Locale Locale94", "persistence-modifier= transactional protected volatile Locale Locale95", "protected static transient Locale Locale96", "protected static final Locale Locale97", "protected static volatile Locale Locale98", "protected transient final Locale Locale99", "protected transient volatile Locale Locale100", "persistence-modifier= none protected transient volatile Locale Locale101", "persistence-modifier= persistent protected transient volatile Locale Locale102", "persistence-modifier= persistent embedded= true protected transient volatile Locale Locale103", "persistence-modifier= persistent embedded= false protected transient volatile Locale Locale104", "persistence-modifier= transactional protected transient volatile Locale Locale105", "protected static transient final Locale Locale106", "protected static transient volatile Locale Locale107", "Locale Locale108", "embedded= true Locale Locale109", "embedded= false Locale Locale110", "persistence-modifier= none Locale Locale111", "persistence-modifier= persistent Locale Locale112", "persistence-modifier= persistent embedded= true Locale Locale113", "persistence-modifier= persistent embedded= false Locale Locale114", "persistence-modifier= transactional Locale Locale115", "static Locale Locale116", "transient Locale Locale117", "persistence-modifier= none transient Locale Locale118", "persistence-modifier= persistent transient Locale Locale119", "persistence-modifier= persistent embedded= true transient Locale Locale120", "persistence-modifier= persistent embedded= false transient Locale Locale121", "persistence-modifier= transactional transient Locale Locale122", "final Locale Locale123", "volatile Locale Locale124", "embedded= true volatile Locale Locale125", "embedded= false volatile Locale Locale126", "persistence-modifier= none volatile Locale Locale127", "persistence-modifier= persistent volatile Locale Locale128", "persistence-modifier= persistent embedded= true volatile Locale Locale129", "persistence-modifier= persistent embedded= false volatile Locale Locale130", "persistence-modifier= transactional volatile Locale Locale131", "static transient Locale Locale132", "static final Locale Locale133", "static volatile Locale Locale134", "transient final Locale Locale135", "transient volatile Locale Locale136", "persistence-modifier= none transient volatile Locale Locale137", "persistence-modifier= persistent transient volatile Locale Locale138", "persistence-modifier= persistent embedded= true transient volatile Locale Locale139", "persistence-modifier= persistent embedded= false transient volatile Locale Locale140", "persistence-modifier= transactional transient volatile Locale Locale141", "static transient final Locale Locale142", "static transient volatile Locale Locale143" }; public int getLength() { return fieldSpecs.length; } public Locale get(int index) { switch (index) { case(0): return Locale0; case(1): return Locale1; case(2): return Locale2; case(3): return Locale3; case(4): return Locale4; case(5): return Locale5; case(6): return Locale6; case(7): return Locale7; case(8): return Locale8; case(9): return Locale9; case(10): return Locale10; case(11): return Locale11; case(12): return Locale12; case(13): return Locale13; case(14): return Locale14; case(15): return Locale15; case(16): return Locale16; case(17): return Locale17; case(18): return Locale18; case(19): return Locale19; case(20): return Locale20; case(21): return Locale21; case(22): return Locale22; case(23): return Locale23; case(24): return Locale24; case(25): return Locale25; case(26): return Locale26; case(27): return Locale27; case(28): return Locale28; case(29): return Locale29; case(30): return Locale30; case(31): return Locale31; case(32): return Locale32; case(33): return Locale33; case(34): return Locale34; case(35): return Locale35; case(36): return Locale36; case(37): return Locale37; case(38): return Locale38; case(39): return Locale39; case(40): return Locale40; case(41): return Locale41; case(42): return Locale42; case(43): return Locale43; case(44): return Locale44; case(45): return Locale45; case(46): return Locale46; case(47): return Locale47; case(48): return Locale48; case(49): return Locale49; case(50): return Locale50; case(51): return Locale51; case(52): return Locale52; case(53): return Locale53; case(54): return Locale54; case(55): return Locale55; case(56): return Locale56; case(57): return Locale57; case(58): return Locale58; case(59): return Locale59; case(60): return Locale60; case(61): return Locale61; case(62): return Locale62; case(63): return Locale63; case(64): return Locale64; case(65): return Locale65; case(66): return Locale66; case(67): return Locale67; case(68): return Locale68; case(69): return Locale69; case(70): return Locale70; case(71): return Locale71; case(72): return Locale72; case(73): return Locale73; case(74): return Locale74; case(75): return Locale75; case(76): return Locale76; case(77): return Locale77; case(78): return Locale78; case(79): return Locale79; case(80): return Locale80; case(81): return Locale81; case(82): return Locale82; case(83): return Locale83; case(84): return Locale84; case(85): return Locale85; case(86): return Locale86; case(87): return Locale87; case(88): return Locale88; case(89): return Locale89; case(90): return Locale90; case(91): return Locale91; case(92): return Locale92; case(93): return Locale93; case(94): return Locale94; case(95): return Locale95; case(96): return Locale96; case(97): return Locale97; case(98): return Locale98; case(99): return Locale99; case(100): return Locale100; case(101): return Locale101; case(102): return Locale102; case(103): return Locale103; case(104): return Locale104; case(105): return Locale105; case(106): return Locale106; case(107): return Locale107; case(108): return Locale108; case(109): return Locale109; case(110): return Locale110; case(111): return Locale111; case(112): return Locale112; case(113): return Locale113; case(114): return Locale114; case(115): return Locale115; case(116): return Locale116; case(117): return Locale117; case(118): return Locale118; case(119): return Locale119; case(120): return Locale120; case(121): return Locale121; case(122): return Locale122; case(123): return Locale123; case(124): return Locale124; case(125): return Locale125; case(126): return Locale126; case(127): return Locale127; case(128): return Locale128; case(129): return Locale129; case(130): return Locale130; case(131): return Locale131; case(132): return Locale132; case(133): return Locale133; case(134): return Locale134; case(135): return Locale135; case(136): return Locale136; case(137): return Locale137; case(138): return Locale138; case(139): return Locale139; case(140): return Locale140; case(141): return Locale141; case(142): return Locale142; case(143): return Locale143; default: throw new IndexOutOfBoundsException(); } } public boolean set(int index,Locale value) { if(fieldSpecs[index].indexOf("final") != -1) return false; switch (index) { case(0): Locale0= value; break; case(1): Locale1= value; break; case(2): Locale2= value; break; case(3): Locale3= value; break; case(4): Locale4= value; break; case(5): Locale5= value; break; case(6): Locale6= value; break; case(7): Locale7= value; break; case(8): Locale8= value; break; case(9): Locale9= value; break; case(10): Locale10= value; break; case(11): Locale11= value; break; case(12): Locale12= value; break; case(13): Locale13= value; break; case(14): Locale14= value; break; case(16): Locale16= value; break; case(17): Locale17= value; break; case(18): Locale18= value; break; case(19): Locale19= value; break; case(20): Locale20= value; break; case(21): Locale21= value; break; case(22): Locale22= value; break; case(23): Locale23= value; break; case(24): Locale24= value; break; case(26): Locale26= value; break; case(28): Locale28= value; break; case(29): Locale29= value; break; case(30): Locale30= value; break; case(31): Locale31= value; break; case(32): Locale32= value; break; case(33): Locale33= value; break; case(35): Locale35= value; break; case(36): Locale36= value; break; case(37): Locale37= value; break; case(38): Locale38= value; break; case(39): Locale39= value; break; case(40): Locale40= value; break; case(41): Locale41= value; break; case(42): Locale42= value; break; case(43): Locale43= value; break; case(44): Locale44= value; break; case(45): Locale45= value; break; case(46): Locale46= value; break; case(47): Locale47= value; break; case(48): Locale48= value; break; case(49): Locale49= value; break; case(50): Locale50= value; break; case(52): Locale52= value; break; case(53): Locale53= value; break; case(54): Locale54= value; break; case(55): Locale55= value; break; case(56): Locale56= value; break; case(57): Locale57= value; break; case(58): Locale58= value; break; case(59): Locale59= value; break; case(60): Locale60= value; break; case(62): Locale62= value; break; case(64): Locale64= value; break; case(65): Locale65= value; break; case(66): Locale66= value; break; case(67): Locale67= value; break; case(68): Locale68= value; break; case(69): Locale69= value; break; case(71): Locale71= value; break; case(72): Locale72= value; break; case(73): Locale73= value; break; case(74): Locale74= value; break; case(75): Locale75= value; break; case(76): Locale76= value; break; case(77): Locale77= value; break; case(78): Locale78= value; break; case(79): Locale79= value; break; case(80): Locale80= value; break; case(81): Locale81= value; break; case(82): Locale82= value; break; case(83): Locale83= value; break; case(84): Locale84= value; break; case(85): Locale85= value; break; case(86): Locale86= value; break; case(88): Locale88= value; break; case(89): Locale89= value; break; case(90): Locale90= value; break; case(91): Locale91= value; break; case(92): Locale92= value; break; case(93): Locale93= value; break; case(94): Locale94= value; break; case(95): Locale95= value; break; case(96): Locale96= value; break; case(98): Locale98= value; break; case(100): Locale100= value; break; case(101): Locale101= value; break; case(102): Locale102= value; break; case(103): Locale103= value; break; case(104): Locale104= value; break; case(105): Locale105= value; break; case(107): Locale107= value; break; case(108): Locale108= value; break; case(109): Locale109= value; break; case(110): Locale110= value; break; case(111): Locale111= value; break; case(112): Locale112= value; break; case(113): Locale113= value; break; case(114): Locale114= value; break; case(115): Locale115= value; break; case(116): Locale116= value; break; case(117): Locale117= value; break; case(118): Locale118= value; break; case(119): Locale119= value; break; case(120): Locale120= value; break; case(121): Locale121= value; break; case(122): Locale122= value; break; case(124): Locale124= value; break; case(125): Locale125= value; break; case(126): Locale126= value; break; case(127): Locale127= value; break; case(128): Locale128= value; break; case(129): Locale129= value; break; case(130): Locale130= value; break; case(131): Locale131= value; break; case(132): Locale132= value; break; case(134): Locale134= value; break; case(136): Locale136= value; break; case(137): Locale137= value; break; case(138): Locale138= value; break; case(139): Locale139= value; break; case(140): Locale140= value; break; case(141): Locale141= value; break; case(143): Locale143= value; break; default: throw new IndexOutOfBoundsException(); } return true; } public static class Oid implements Serializable { public int identifier; public Oid() { } public Oid(String s) { identifier = Integer.parseInt(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + identifier;} public int hashCode() { return (int)identifier ; } public boolean equals(Object other) { if (other != null && (other instanceof Oid)) { Oid k = (Oid)other; return k.identifier == this.identifier; } return false; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } } } tck/src/java/org/apache/jdo/tck/pc/fieldtypes/FieldsOfLong.java100664 74400 12500110373 24702 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.io.Serializable; public class FieldsOfLong { public int identifier; private Long Long0; private Long Long1; private Long Long2; private Long Long3; private Long Long4; private Long Long5; private Long Long6; private Long Long7; private static Long Long8; private transient Long Long9; private transient Long Long10; private transient Long Long11; private transient Long Long12; private transient Long Long13; private transient Long Long14; private final Long Long15 = new Long((long)5); private volatile Long Long16; private volatile Long Long17; private volatile Long Long18; private volatile Long Long19; private volatile Long Long20; private volatile Long Long21; private volatile Long Long22; private volatile Long Long23; private static transient Long Long24; private static final Long Long25 = new Long((long)5); private static volatile Long Long26; private transient final Long Long27 = new Long((long)5); private transient volatile Long Long28; private transient volatile Long Long29; private transient volatile Long Long30; private transient volatile Long Long31; private transient volatile Long Long32; private transient volatile Long Long33; private static transient final Long Long34 = new Long((long)5); private static transient volatile Long Long35; public Long Long36; public Long Long37; public Long Long38; public Long Long39; public Long Long40; public Long Long41; public Long Long42; public Long Long43; public static Long Long44; public transient Long Long45; public transient Long Long46; public transient Long Long47; public transient Long Long48; public transient Long Long49; public transient Long Long50; public final Long Long51 = new Long((long)5); public volatile Long Long52; public volatile Long Long53; public volatile Long Long54; public volatile Long Long55; public volatile Long Long56; public volatile Long Long57; public volatile Long Long58; public volatile Long Long59; public static transient Long Long60; public static final Long Long61 = new Long((long)5); public static volatile Long Long62; public transient final Long Long63 = new Long((long)5); public transient volatile Long Long64; public transient volatile Long Long65; public transient volatile Long Long66; public transient volatile Long Long67; public transient volatile Long Long68; public transient volatile Long Long69; public static transient final Long Long70 = new Long((long)5); public static transient volatile Long Long71; protected Long Long72; protected Long Long73; protected Long Long74; protected Long Long75; protected Long Long76; protected Long Long77; protected Long Long78; protected Long Long79; protected static Long Long80; protected transient Long Long81; protected transient Long Long82; protected transient Long Long83; protected transient Long Long84; protected transient Long Long85; protected transient Long Long86; protected final Long Long87 = new Long((long)5); protected volatile Long Long88; protected volatile Long Long89; protected volatile Long Long90; protected volatile Long Long91; protected volatile Long Long92; protected volatile Long Long93; protected volatile Long Long94; protected volatile Long Long95; protected static transient Long Long96; protected static final Long Long97 = new Long((long)5); protected static volatile Long Long98; protected transient final Long Long99 = new Long((long)5); protected transient volatile Long Long100; protected transient volatile Long Long101; protected transient volatile Long Long102; protected transient volatile Long Long103; protected transient volatile Long Long104; protected transient volatile Long Long105; protected static transient final Long Long106 = new Long((long)5); protected static transient volatile Long Long107; Long Long108; Long Long109; Long Long110; Long Long111; Long Long112; Long Long113; Long Long114; Long Long115; static Long Long116; transient Long Long117; transient Long Long118; transient Long Long119; transient Long Long120; transient Long Long121; transient Long Long122; final Long Long123 = new Long((long)5); volatile Long Long124; volatile Long Long125; volatile Long Long126; volatile Long Long127; volatile Long Long128; volatile Long Long129; volatile Long Long130; volatile Long Long131; static transient Long Long132; static final Long Long133 = new Long((long)5); static volatile Long Long134; transient final Long Long135 = new Long((long)5); transient volatile Long Long136; transient volatile Long Long137; transient volatile Long Long138; transient volatile Long Long139; transient volatile Long Long140; transient volatile Long Long141; static transient final Long Long142 = new Long((long)5); static transient volatile Long Long143; public static final boolean [] isPersistent = { true,true,true,false,true,true,true,false,false,false, false,true,true,true,false,false,true,true,true,false, true,true,true,false,false,false,false,false,false,false, true,true,true,false,false,false,true,true,true,false, true,true,true,false,false,false,false,true,true,true, false,false,true,true,true,false,true,true,true,false, false,false,false,false,false,false,true,true,true,false, false,false,true,true,true,false,true,true,true,false, false,false,false,true,true,true,false,false,true,true, true,false,true,true,true,false,false,false,false,false, false,false,true,true,true,false,false,false,true,true, true,false,true,true,true,false,false,false,false,true, true,true,false,false,true,true,true,false,true,true, true,false,false,false,false,false,false,false,true,true, true,false,false,false }; public static final boolean [] isStatic = { false,false,false,false,false,false,false,false,true,false, false,false,false,false,false,false,false,false,false,false, false,false,false,false,true,true,true,false,false,false, false,false,false,false,true,true,false,false,false,false, false,false,false,false,true,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, true,true,true,false,false,false,false,false,false,false, true,true,false,false,false,false,false,false,false,false, true,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,true,true,true,false, false,false,false,false,false,false,true,true,false,false, false,false,false,false,false,false,true,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,true,true,true,false,false,false,false,false, false,false,true,true }; public static final boolean [] isFinal = { false,false,false,false,false,false,false,false,false,false, false,false,false,false,false,true,false,false,false,false, false,false,false,false,false,true,false,true,false,false, false,false,false,false,true,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, false,true,false,false,false,false,false,false,false,false, false,true,false,true,false,false,false,false,false,false, true,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,false,true,false,false, false,false,false,false,false,false,false,true,false,true, false,false,false,false,false,false,true,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,false,true,false,false,false,false,false,false, false,false,false,true,false,true,false,false,false,false, false,false,true,false }; public static final String [] fieldSpecs = { "private Long Long0", "embedded= true private Long Long1", "embedded= false private Long Long2", "persistence-modifier= none private Long Long3", "persistence-modifier= persistent private Long Long4", "persistence-modifier= persistent embedded= true private Long Long5", "persistence-modifier= persistent embedded= false private Long Long6", "persistence-modifier= transactional private Long Long7", "private static Long Long8", "private transient Long Long9", "persistence-modifier= none private transient Long Long10", "persistence-modifier= persistent private transient Long Long11", "persistence-modifier= persistent embedded= true private transient Long Long12", "persistence-modifier= persistent embedded= false private transient Long Long13", "persistence-modifier= transactional private transient Long Long14", "private final Long Long15", "private volatile Long Long16", "embedded= true private volatile Long Long17", "embedded= false private volatile Long Long18", "persistence-modifier= none private volatile Long Long19", "persistence-modifier= persistent private volatile Long Long20", "persistence-modifier= persistent embedded= true private volatile Long Long21", "persistence-modifier= persistent embedded= false private volatile Long Long22", "persistence-modifier= transactional private volatile Long Long23", "private static transient Long Long24", "private static final Long Long25", "private static volatile Long Long26", "private transient final Long Long27", "private transient volatile Long Long28", "persistence-modifier= none private transient volatile Long Long29", "persistence-modifier= persistent private transient volatile Long Long30", "persistence-modifier= persistent embedded= true private transient volatile Long Long31", "persistence-modifier= persistent embedded= false private transient volatile Long Long32", "persistence-modifier= transactional private transient volatile Long Long33", "private static transient final Long Long34", "private static transient volatile Long Long35", "public Long Long36", "embedded= true public Long Long37", "embedded= false public Long Long38", "persistence-modifier= none public Long Long39", "persistence-modifier= persistent public Long Long40", "persistence-modifier= persistent embedded= true public Long Long41", "persistence-modifier= persistent embedded= false public Long Long42", "persistence-modifier= transactional public Long Long43", "public static Long Long44", "public transient Long Long45", "persistence-modifier= none public transient Long Long46", "persistence-modifier= persistent public transient Long Long47", "persistence-modifier= persistent embedded= true public transient Long Long48", "persistence-modifier= persistent embedded= false public transient Long Long49", "persistence-modifier= transactional public transient Long Long50", "public final Long Long51", "public volatile Long Long52", "embedded= true public volatile Long Long53", "embedded= false public volatile Long Long54", "persistence-modifier= none public volatile Long Long55", "persistence-modifier= persistent public volatile Long Long56", "persistence-modifier= persistent embedded= true public volatile Long Long57", "persistence-modifier= persistent embedded= false public volatile Long Long58", "persistence-modifier= transactional public volatile Long Long59", "public static transient Long Long60", "public static final Long Long61", "public static volatile Long Long62", "public transient final Long Long63", "public transient volatile Long Long64", "persistence-modifier= none public transient volatile Long Long65", "persistence-modifier= persistent public transient volatile Long Long66", "persistence-modifier= persistent embedded= true public transient volatile Long Long67", "persistence-modifier= persistent embedded= false public transient volatile Long Long68", "persistence-modifier= transactional public transient volatile Long Long69", "public static transient final Long Long70", "public static transient volatile Long Long71", "protected Long Long72", "embedded= true protected Long Long73", "embedded= false protected Long Long74", "persistence-modifier= none protected Long Long75", "persistence-modifier= persistent protected Long Long76", "persistence-modifier= persistent embedded= true protected Long Long77", "persistence-modifier= persistent embedded= false protected Long Long78", "persistence-modifier= transactional protected Long Long79", "protected static Long Long80", "protected transient Long Long81", "persistence-modifier= none protected transient Long Long82", "persistence-modifier= persistent protected transient Long Long83", "persistence-modifier= persistent embedded= true protected transient Long Long84", "persistence-modifier= persistent embedded= false protected transient Long Long85", "persistence-modifier= transactional protected transient Long Long86", "protected final Long Long87", "protected volatile Long Long88", "embedded= true protected volatile Long Long89", "embedded= false protected volatile Long Long90", "persistence-modifier= none protected volatile Long Long91", "persistence-modifier= persistent protected volatile Long Long92", "persistence-modifier= persistent embedded= true protected volatile Long Long93", "persistence-modifier= persistent embedded= false protected volatile Long Long94", "persistence-modifier= transactional protected volatile Long Long95", "protected static transient Long Long96", "protected static final Long Long97", "protected static volatile Long Long98", "protected transient final Long Long99", "protected transient volatile Long Long100", "persistence-modifier= none protected transient volatile Long Long101", "persistence-modifier= persistent protected transient volatile Long Long102", "persistence-modifier= persistent embedded= true protected transient volatile Long Long103", "persistence-modifier= persistent embedded= false protected transient volatile Long Long104", "persistence-modifier= transactional protected transient volatile Long Long105", "protected static transient final Long Long106", "protected static transient volatile Long Long107", "Long Long108", "embedded= true Long Long109", "embedded= false Long Long110", "persistence-modifier= none Long Long111", "persistence-modifier= persistent Long Long112", "persistence-modifier= persistent embedded= true Long Long113", "persistence-modifier= persistent embedded= false Long Long114", "persistence-modifier= transactional Long Long115", "static Long Long116", "transient Long Long117", "persistence-modifier= none transient Long Long118", "persistence-modifier= persistent transient Long Long119", "persistence-modifier= persistent embedded= true transient Long Long120", "persistence-modifier= persistent embedded= false transient Long Long121", "persistence-modifier= transactional transient Long Long122", "final Long Long123", "volatile Long Long124", "embedded= true volatile Long Long125", "embedded= false volatile Long Long126", "persistence-modifier= none volatile Long Long127", "persistence-modifier= persistent volatile Long Long128", "persistence-modifier= persistent embedded= true volatile Long Long129", "persistence-modifier= persistent embedded= false volatile Long Long130", "persistence-modifier= transactional volatile Long Long131", "static transient Long Long132", "static final Long Long133", "static volatile Long Long134", "transient final Long Long135", "transient volatile Long Long136", "persistence-modifier= none transient volatile Long Long137", "persistence-modifier= persistent transient volatile Long Long138", "persistence-modifier= persistent embedded= true transient volatile Long Long139", "persistence-modifier= persistent embedded= false transient volatile Long Long140", "persistence-modifier= transactional transient volatile Long Long141", "static transient final Long Long142", "static transient volatile Long Long143" }; public int getLength() { return fieldSpecs.length; } public Long get(int index) { switch (index) { case(0): return Long0; case(1): return Long1; case(2): return Long2; case(3): return Long3; case(4): return Long4; case(5): return Long5; case(6): return Long6; case(7): return Long7; case(8): return Long8; case(9): return Long9; case(10): return Long10; case(11): return Long11; case(12): return Long12; case(13): return Long13; case(14): return Long14; case(15): return Long15; case(16): return Long16; case(17): return Long17; case(18): return Long18; case(19): return Long19; case(20): return Long20; case(21): return Long21; case(22): return Long22; case(23): return Long23; case(24): return Long24; case(25): return Long25; case(26): return Long26; case(27): return Long27; case(28): return Long28; case(29): return Long29; case(30): return Long30; case(31): return Long31; case(32): return Long32; case(33): return Long33; case(34): return Long34; case(35): return Long35; case(36): return Long36; case(37): return Long37; case(38): return Long38; case(39): return Long39; case(40): return Long40; case(41): return Long41; case(42): return Long42; case(43): return Long43; case(44): return Long44; case(45): return Long45; case(46): return Long46; case(47): return Long47; case(48): return Long48; case(49): return Long49; case(50): return Long50; case(51): return Long51; case(52): return Long52; case(53): return Long53; case(54): return Long54; case(55): return Long55; case(56): return Long56; case(57): return Long57; case(58): return Long58; case(59): return Long59; case(60): return Long60; case(61): return Long61; case(62): return Long62; case(63): return Long63; case(64): return Long64; case(65): return Long65; case(66): return Long66; case(67): return Long67; case(68): return Long68; case(69): return Long69; case(70): return Long70; case(71): return Long71; case(72): return Long72; case(73): return Long73; case(74): return Long74; case(75): return Long75; case(76): return Long76; case(77): return Long77; case(78): return Long78; case(79): return Long79; case(80): return Long80; case(81): return Long81; case(82): return Long82; case(83): return Long83; case(84): return Long84; case(85): return Long85; case(86): return Long86; case(87): return Long87; case(88): return Long88; case(89): return Long89; case(90): return Long90; case(91): return Long91; case(92): return Long92; case(93): return Long93; case(94): return Long94; case(95): return Long95; case(96): return Long96; case(97): return Long97; case(98): return Long98; case(99): return Long99; case(100): return Long100; case(101): return Long101; case(102): return Long102; case(103): return Long103; case(104): return Long104; case(105): return Long105; case(106): return Long106; case(107): return Long107; case(108): return Long108; case(109): return Long109; case(110): return Long110; case(111): return Long111; case(112): return Long112; case(113): return Long113; case(114): return Long114; case(115): return Long115; case(116): return Long116; case(117): return Long117; case(118): return Long118; case(119): return Long119; case(120): return Long120; case(121): return Long121; case(122): return Long122; case(123): return Long123; case(124): return Long124; case(125): return Long125; case(126): return Long126; case(127): return Long127; case(128): return Long128; case(129): return Long129; case(130): return Long130; case(131): return Long131; case(132): return Long132; case(133): return Long133; case(134): return Long134; case(135): return Long135; case(136): return Long136; case(137): return Long137; case(138): return Long138; case(139): return Long139; case(140): return Long140; case(141): return Long141; case(142): return Long142; case(143): return Long143; default: throw new IndexOutOfBoundsException(); } } public boolean set(int index,Long value) { if(fieldSpecs[index].indexOf("final") != -1) return false; switch (index) { case(0): Long0= value; break; case(1): Long1= value; break; case(2): Long2= value; break; case(3): Long3= value; break; case(4): Long4= value; break; case(5): Long5= value; break; case(6): Long6= value; break; case(7): Long7= value; break; case(8): Long8= value; break; case(9): Long9= value; break; case(10): Long10= value; break; case(11): Long11= value; break; case(12): Long12= value; break; case(13): Long13= value; break; case(14): Long14= value; break; case(16): Long16= value; break; case(17): Long17= value; break; case(18): Long18= value; break; case(19): Long19= value; break; case(20): Long20= value; break; case(21): Long21= value; break; case(22): Long22= value; break; case(23): Long23= value; break; case(24): Long24= value; break; case(26): Long26= value; break; case(28): Long28= value; break; case(29): Long29= value; break; case(30): Long30= value; break; case(31): Long31= value; break; case(32): Long32= value; break; case(33): Long33= value; break; case(35): Long35= value; break; case(36): Long36= value; break; case(37): Long37= value; break; case(38): Long38= value; break; case(39): Long39= value; break; case(40): Long40= value; break; case(41): Long41= value; break; case(42): Long42= value; break; case(43): Long43= value; break; case(44): Long44= value; break; case(45): Long45= value; break; case(46): Long46= value; break; case(47): Long47= value; break; case(48): Long48= value; break; case(49): Long49= value; break; case(50): Long50= value; break; case(52): Long52= value; break; case(53): Long53= value; break; case(54): Long54= value; break; case(55): Long55= value; break; case(56): Long56= value; break; case(57): Long57= value; break; case(58): Long58= value; break; case(59): Long59= value; break; case(60): Long60= value; break; case(62): Long62= value; break; case(64): Long64= value; break; case(65): Long65= value; break; case(66): Long66= value; break; case(67): Long67= value; break; case(68): Long68= value; break; case(69): Long69= value; break; case(71): Long71= value; break; case(72): Long72= value; break; case(73): Long73= value; break; case(74): Long74= value; break; case(75): Long75= value; break; case(76): Long76= value; break; case(77): Long77= value; break; case(78): Long78= value; break; case(79): Long79= value; break; case(80): Long80= value; break; case(81): Long81= value; break; case(82): Long82= value; break; case(83): Long83= value; break; case(84): Long84= value; break; case(85): Long85= value; break; case(86): Long86= value; break; case(88): Long88= value; break; case(89): Long89= value; break; case(90): Long90= value; break; case(91): Long91= value; break; case(92): Long92= value; break; case(93): Long93= value; break; case(94): Long94= value; break; case(95): Long95= value; break; case(96): Long96= value; break; case(98): Long98= value; break; case(100): Long100= value; break; case(101): Long101= value; break; case(102): Long102= value; break; case(103): Long103= value; break; case(104): Long104= value; break; case(105): Long105= value; break; case(107): Long107= value; break; case(108): Long108= value; break; case(109): Long109= value; break; case(110): Long110= value; break; case(111): Long111= value; break; case(112): Long112= value; break; case(113): Long113= value; break; case(114): Long114= value; break; case(115): Long115= value; break; case(116): Long116= value; break; case(117): Long117= value; break; case(118): Long118= value; break; case(119): Long119= value; break; case(120): Long120= value; break; case(121): Long121= value; break; case(122): Long122= value; break; case(124): Long124= value; break; case(125): Long125= value; break; case(126): Long126= value; break; case(127): Long127= value; break; case(128): Long128= value; break; case(129): Long129= value; break; case(130): Long130= value; break; case(131): Long131= value; break; case(132): Long132= value; break; case(134): Long134= value; break; case(136): Long136= value; break; case(137): Long137= value; break; case(138): Long138= value; break; case(139): Long139= value; break; case(140): Long140= value; break; case(141): Long141= value; break; case(143): Long143= value; break; default: throw new IndexOutOfBoundsException(); } return true; } public static class Oid implements Serializable { public int identifier; public Oid() { } public Oid(String s) { identifier = Integer.parseInt(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + identifier;} public int hashCode() { return (int)identifier ; } public boolean equals(Object other) { if (other != null && (other instanceof Oid)) { Oid k = (Oid)other; return k.identifier == this.identifier; } return false; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } } } tck/src/java/org/apache/jdo/tck/pc/fieldtypes/FieldsOfObject.java100664 77616 12500110373 25225 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.io.Serializable; public class FieldsOfObject { public int identifier; private Object Object0; private Object Object1; private Object Object2; private Object Object3; private Object Object4; private Object Object5; private Object Object6; private Object Object7; private static Object Object8; private transient Object Object9; private transient Object Object10; private transient Object Object11; private transient Object Object12; private transient Object Object13; private transient Object Object14; private final Object Object15 = new Object(); private volatile Object Object16; private volatile Object Object17; private volatile Object Object18; private volatile Object Object19; private volatile Object Object20; private volatile Object Object21; private volatile Object Object22; private volatile Object Object23; private static transient Object Object24; private static final Object Object25 = new Object(); private static volatile Object Object26; private transient final Object Object27 = new Object(); private transient volatile Object Object28; private transient volatile Object Object29; private transient volatile Object Object30; private transient volatile Object Object31; private transient volatile Object Object32; private transient volatile Object Object33; private static transient final Object Object34 = new Object(); private static transient volatile Object Object35; public Object Object36; public Object Object37; public Object Object38; public Object Object39; public Object Object40; public Object Object41; public Object Object42; public Object Object43; public static Object Object44; public transient Object Object45; public transient Object Object46; public transient Object Object47; public transient Object Object48; public transient Object Object49; public transient Object Object50; public final Object Object51 = new Object(); public volatile Object Object52; public volatile Object Object53; public volatile Object Object54; public volatile Object Object55; public volatile Object Object56; public volatile Object Object57; public volatile Object Object58; public volatile Object Object59; public static transient Object Object60; public static final Object Object61 = new Object(); public static volatile Object Object62; public transient final Object Object63 = new Object(); public transient volatile Object Object64; public transient volatile Object Object65; public transient volatile Object Object66; public transient volatile Object Object67; public transient volatile Object Object68; public transient volatile Object Object69; public static transient final Object Object70 = new Object(); public static transient volatile Object Object71; protected Object Object72; protected Object Object73; protected Object Object74; protected Object Object75; protected Object Object76; protected Object Object77; protected Object Object78; protected Object Object79; protected static Object Object80; protected transient Object Object81; protected transient Object Object82; protected transient Object Object83; protected transient Object Object84; protected transient Object Object85; protected transient Object Object86; protected final Object Object87 = new Object(); protected volatile Object Object88; protected volatile Object Object89; protected volatile Object Object90; protected volatile Object Object91; protected volatile Object Object92; protected volatile Object Object93; protected volatile Object Object94; protected volatile Object Object95; protected static transient Object Object96; protected static final Object Object97 = new Object(); protected static volatile Object Object98; protected transient final Object Object99 = new Object(); protected transient volatile Object Object100; protected transient volatile Object Object101; protected transient volatile Object Object102; protected transient volatile Object Object103; protected transient volatile Object Object104; protected transient volatile Object Object105; protected static transient final Object Object106 = new Object(); protected static transient volatile Object Object107; Object Object108; Object Object109; Object Object110; Object Object111; Object Object112; Object Object113; Object Object114; Object Object115; static Object Object116; transient Object Object117; transient Object Object118; transient Object Object119; transient Object Object120; transient Object Object121; transient Object Object122; final Object Object123 = new Object(); volatile Object Object124; volatile Object Object125; volatile Object Object126; volatile Object Object127; volatile Object Object128; volatile Object Object129; volatile Object Object130; volatile Object Object131; static transient Object Object132; static final Object Object133 = new Object(); static volatile Object Object134; transient final Object Object135 = new Object(); transient volatile Object Object136; transient volatile Object Object137; transient volatile Object Object138; transient volatile Object Object139; transient volatile Object Object140; transient volatile Object Object141; static transient final Object Object142 = new Object(); static transient volatile Object Object143; public static final boolean [] isPersistent = { false,true,true,false,true,true,true,false,false,false, false,true,true,true,false,false,false,true,true,false, true,true,true,false,false,false,false,false,false,false, true,true,true,false,false,false,false,true,true,false, true,true,true,false,false,false,false,true,true,true, false,false,false,true,true,false,true,true,true,false, false,false,false,false,false,false,true,true,true,false, false,false,false,true,true,false,true,true,true,false, false,false,false,true,true,true,false,false,false,true, true,false,true,true,true,false,false,false,false,false, false,false,true,true,true,false,false,false,false,true, true,false,true,true,true,false,false,false,false,true, true,true,false,false,false,true,true,false,true,true, true,false,false,false,false,false,false,false,true,true, true,false,false,false }; public static final boolean [] isStatic = { false,false,false,false,false,false,false,false,true,false, false,false,false,false,false,false,false,false,false,false, false,false,false,false,true,true,true,false,false,false, false,false,false,false,true,true,false,false,false,false, false,false,false,false,true,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, true,true,true,false,false,false,false,false,false,false, true,true,false,false,false,false,false,false,false,false, true,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,true,true,true,false, false,false,false,false,false,false,true,true,false,false, false,false,false,false,false,false,true,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,true,true,true,false,false,false,false,false, false,false,true,true }; public static final boolean [] isFinal = { false,false,false,false,false,false,false,false,false,false, false,false,false,false,false,true,false,false,false,false, false,false,false,false,false,true,false,true,false,false, false,false,false,false,true,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, false,true,false,false,false,false,false,false,false,false, false,true,false,true,false,false,false,false,false,false, true,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,false,true,false,false, false,false,false,false,false,false,false,true,false,true, false,false,false,false,false,false,true,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,false,true,false,false,false,false,false,false, false,false,false,true,false,true,false,false,false,false, false,false,true,false }; public static final String [] fieldSpecs = { "private Object Object0", "serialized= true private Object Object1", "embedded= false private Object Object2", "persistence-modifier= none private Object Object3", "persistence-modifier= persistent private Object Object4", "persistence-modifier= persistent serialized= true private Object Object5", "persistence-modifier= persistent embedded= false private Object Object6", "persistence-modifier= transactional private Object Object7", "private static Object Object8", "private transient Object Object9", "persistence-modifier= none private transient Object Object10", "persistence-modifier= persistent private transient Object Object11", "persistence-modifier= persistent serialized= true private transient Object Object12", "persistence-modifier= persistent embedded= false private transient Object Object13", "persistence-modifier= transactional private transient Object Object14", "private final Object Object15", "private volatile Object Object16", "serialized= true private volatile Object Object17", "embedded= false private volatile Object Object18", "persistence-modifier= none private volatile Object Object19", "persistence-modifier= persistent private volatile Object Object20", "persistence-modifier= persistent serialized= true private volatile Object Object21", "persistence-modifier= persistent embedded= false private volatile Object Object22", "persistence-modifier= transactional private volatile Object Object23", "private static transient Object Object24", "private static final Object Object25", "private static volatile Object Object26", "private transient final Object Object27", "private transient volatile Object Object28", "persistence-modifier= none private transient volatile Object Object29", "persistence-modifier= persistent private transient volatile Object Object30", "persistence-modifier= persistent serialized= true private transient volatile Object Object31", "persistence-modifier= persistent embedded= false private transient volatile Object Object32", "persistence-modifier= transactional private transient volatile Object Object33", "private static transient final Object Object34", "private static transient volatile Object Object35", "public Object Object36", "serialized= true public Object Object37", "embedded= false public Object Object38", "persistence-modifier= none public Object Object39", "persistence-modifier= persistent public Object Object40", "persistence-modifier= persistent serialized= true public Object Object41", "persistence-modifier= persistent embedded= false public Object Object42", "persistence-modifier= transactional public Object Object43", "public static Object Object44", "public transient Object Object45", "persistence-modifier= none public transient Object Object46", "persistence-modifier= persistent public transient Object Object47", "persistence-modifier= persistent serialized= true public transient Object Object48", "persistence-modifier= persistent embedded= false public transient Object Object49", "persistence-modifier= transactional public transient Object Object50", "public final Object Object51", "public volatile Object Object52", "serialized= true public volatile Object Object53", "embedded= false public volatile Object Object54", "persistence-modifier= none public volatile Object Object55", "persistence-modifier= persistent public volatile Object Object56", "persistence-modifier= persistent serialized= true public volatile Object Object57", "persistence-modifier= persistent embedded= false public volatile Object Object58", "persistence-modifier= transactional public volatile Object Object59", "public static transient Object Object60", "public static final Object Object61", "public static volatile Object Object62", "public transient final Object Object63", "public transient volatile Object Object64", "persistence-modifier= none public transient volatile Object Object65", "persistence-modifier= persistent public transient volatile Object Object66", "persistence-modifier= persistent serialized= true public transient volatile Object Object67", "persistence-modifier= persistent embedded= false public transient volatile Object Object68", "persistence-modifier= transactional public transient volatile Object Object69", "public static transient final Object Object70", "public static transient volatile Object Object71", "protected Object Object72", "serialized= true protected Object Object73", "embedded= false protected Object Object74", "persistence-modifier= none protected Object Object75", "persistence-modifier= persistent protected Object Object76", "persistence-modifier= persistent serialized= true protected Object Object77", "persistence-modifier= persistent embedded= false protected Object Object78", "persistence-modifier= transactional protected Object Object79", "protected static Object Object80", "protected transient Object Object81", "persistence-modifier= none protected transient Object Object82", "persistence-modifier= persistent protected transient Object Object83", "persistence-modifier= persistent serialized= true protected transient Object Object84", "persistence-modifier= persistent embedded= false protected transient Object Object85", "persistence-modifier= transactional protected transient Object Object86", "protected final Object Object87", "protected volatile Object Object88", "serialized= true protected volatile Object Object89", "embedded= false protected volatile Object Object90", "persistence-modifier= none protected volatile Object Object91", "persistence-modifier= persistent protected volatile Object Object92", "persistence-modifier= persistent serialized= true protected volatile Object Object93", "persistence-modifier= persistent embedded= false protected volatile Object Object94", "persistence-modifier= transactional protected volatile Object Object95", "protected static transient Object Object96", "protected static final Object Object97", "protected static volatile Object Object98", "protected transient final Object Object99", "protected transient volatile Object Object100", "persistence-modifier= none protected transient volatile Object Object101", "persistence-modifier= persistent protected transient volatile Object Object102", "persistence-modifier= persistent serialized= true protected transient volatile Object Object103", "persistence-modifier= persistent embedded= false protected transient volatile Object Object104", "persistence-modifier= transactional protected transient volatile Object Object105", "protected static transient final Object Object106", "protected static transient volatile Object Object107", "Object Object108", "serialized= true Object Object109", "embedded= false Object Object110", "persistence-modifier= none Object Object111", "persistence-modifier= persistent Object Object112", "persistence-modifier= persistent serialized= true Object Object113", "persistence-modifier= persistent embedded= false Object Object114", "persistence-modifier= transactional Object Object115", "static Object Object116", "transient Object Object117", "persistence-modifier= none transient Object Object118", "persistence-modifier= persistent transient Object Object119", "persistence-modifier= persistent serialized= true transient Object Object120", "persistence-modifier= persistent embedded= false transient Object Object121", "persistence-modifier= transactional transient Object Object122", "final Object Object123", "volatile Object Object124", "serialized= true volatile Object Object125", "embedded= false volatile Object Object126", "persistence-modifier= none volatile Object Object127", "persistence-modifier= persistent volatile Object Object128", "persistence-modifier= persistent serialized= true volatile Object Object129", "persistence-modifier= persistent embedded= false volatile Object Object130", "persistence-modifier= transactional volatile Object Object131", "static transient Object Object132", "static final Object Object133", "static volatile Object Object134", "transient final Object Object135", "transient volatile Object Object136", "persistence-modifier= none transient volatile Object Object137", "persistence-modifier= persistent transient volatile Object Object138", "persistence-modifier= persistent serialized= true transient volatile Object Object139", "persistence-modifier= persistent embedded= false transient volatile Object Object140", "persistence-modifier= transactional transient volatile Object Object141", "static transient final Object Object142", "static transient volatile Object Object143" }; public int getLength() { return fieldSpecs.length; } public Object get(int index) { switch (index) { case(0): return Object0; case(1): return Object1; case(2): return Object2; case(3): return Object3; case(4): return Object4; case(5): return Object5; case(6): return Object6; case(7): return Object7; case(8): return Object8; case(9): return Object9; case(10): return Object10; case(11): return Object11; case(12): return Object12; case(13): return Object13; case(14): return Object14; case(15): return Object15; case(16): return Object16; case(17): return Object17; case(18): return Object18; case(19): return Object19; case(20): return Object20; case(21): return Object21; case(22): return Object22; case(23): return Object23; case(24): return Object24; case(25): return Object25; case(26): return Object26; case(27): return Object27; case(28): return Object28; case(29): return Object29; case(30): return Object30; case(31): return Object31; case(32): return Object32; case(33): return Object33; case(34): return Object34; case(35): return Object35; case(36): return Object36; case(37): return Object37; case(38): return Object38; case(39): return Object39; case(40): return Object40; case(41): return Object41; case(42): return Object42; case(43): return Object43; case(44): return Object44; case(45): return Object45; case(46): return Object46; case(47): return Object47; case(48): return Object48; case(49): return Object49; case(50): return Object50; case(51): return Object51; case(52): return Object52; case(53): return Object53; case(54): return Object54; case(55): return Object55; case(56): return Object56; case(57): return Object57; case(58): return Object58; case(59): return Object59; case(60): return Object60; case(61): return Object61; case(62): return Object62; case(63): return Object63; case(64): return Object64; case(65): return Object65; case(66): return Object66; case(67): return Object67; case(68): return Object68; case(69): return Object69; case(70): return Object70; case(71): return Object71; case(72): return Object72; case(73): return Object73; case(74): return Object74; case(75): return Object75; case(76): return Object76; case(77): return Object77; case(78): return Object78; case(79): return Object79; case(80): return Object80; case(81): return Object81; case(82): return Object82; case(83): return Object83; case(84): return Object84; case(85): return Object85; case(86): return Object86; case(87): return Object87; case(88): return Object88; case(89): return Object89; case(90): return Object90; case(91): return Object91; case(92): return Object92; case(93): return Object93; case(94): return Object94; case(95): return Object95; case(96): return Object96; case(97): return Object97; case(98): return Object98; case(99): return Object99; case(100): return Object100; case(101): return Object101; case(102): return Object102; case(103): return Object103; case(104): return Object104; case(105): return Object105; case(106): return Object106; case(107): return Object107; case(108): return Object108; case(109): return Object109; case(110): return Object110; case(111): return Object111; case(112): return Object112; case(113): return Object113; case(114): return Object114; case(115): return Object115; case(116): return Object116; case(117): return Object117; case(118): return Object118; case(119): return Object119; case(120): return Object120; case(121): return Object121; case(122): return Object122; case(123): return Object123; case(124): return Object124; case(125): return Object125; case(126): return Object126; case(127): return Object127; case(128): return Object128; case(129): return Object129; case(130): return Object130; case(131): return Object131; case(132): return Object132; case(133): return Object133; case(134): return Object134; case(135): return Object135; case(136): return Object136; case(137): return Object137; case(138): return Object138; case(139): return Object139; case(140): return Object140; case(141): return Object141; case(142): return Object142; case(143): return Object143; default: throw new IndexOutOfBoundsException(); } } public boolean set(int index,Object value) { if(fieldSpecs[index].indexOf("final") != -1) return false; switch (index) { case(0): Object0= value; break; case(1): Object1= value; break; case(2): Object2= value; break; case(3): Object3= value; break; case(4): Object4= value; break; case(5): Object5= value; break; case(6): Object6= value; break; case(7): Object7= value; break; case(8): Object8= value; break; case(9): Object9= value; break; case(10): Object10= value; break; case(11): Object11= value; break; case(12): Object12= value; break; case(13): Object13= value; break; case(14): Object14= value; break; case(16): Object16= value; break; case(17): Object17= value; break; case(18): Object18= value; break; case(19): Object19= value; break; case(20): Object20= value; break; case(21): Object21= value; break; case(22): Object22= value; break; case(23): Object23= value; break; case(24): Object24= value; break; case(26): Object26= value; break; case(28): Object28= value; break; case(29): Object29= value; break; case(30): Object30= value; break; case(31): Object31= value; break; case(32): Object32= value; break; case(33): Object33= value; break; case(35): Object35= value; break; case(36): Object36= value; break; case(37): Object37= value; break; case(38): Object38= value; break; case(39): Object39= value; break; case(40): Object40= value; break; case(41): Object41= value; break; case(42): Object42= value; break; case(43): Object43= value; break; case(44): Object44= value; break; case(45): Object45= value; break; case(46): Object46= value; break; case(47): Object47= value; break; case(48): Object48= value; break; case(49): Object49= value; break; case(50): Object50= value; break; case(52): Object52= value; break; case(53): Object53= value; break; case(54): Object54= value; break; case(55): Object55= value; break; case(56): Object56= value; break; case(57): Object57= value; break; case(58): Object58= value; break; case(59): Object59= value; break; case(60): Object60= value; break; case(62): Object62= value; break; case(64): Object64= value; break; case(65): Object65= value; break; case(66): Object66= value; break; case(67): Object67= value; break; case(68): Object68= value; break; case(69): Object69= value; break; case(71): Object71= value; break; case(72): Object72= value; break; case(73): Object73= value; break; case(74): Object74= value; break; case(75): Object75= value; break; case(76): Object76= value; break; case(77): Object77= value; break; case(78): Object78= value; break; case(79): Object79= value; break; case(80): Object80= value; break; case(81): Object81= value; break; case(82): Object82= value; break; case(83): Object83= value; break; case(84): Object84= value; break; case(85): Object85= value; break; case(86): Object86= value; break; case(88): Object88= value; break; case(89): Object89= value; break; case(90): Object90= value; break; case(91): Object91= value; break; case(92): Object92= value; break; case(93): Object93= value; break; case(94): Object94= value; break; case(95): Object95= value; break; case(96): Object96= value; break; case(98): Object98= value; break; case(100): Object100= value; break; case(101): Object101= value; break; case(102): Object102= value; break; case(103): Object103= value; break; case(104): Object104= value; break; case(105): Object105= value; break; case(107): Object107= value; break; case(108): Object108= value; break; case(109): Object109= value; break; case(110): Object110= value; break; case(111): Object111= value; break; case(112): Object112= value; break; case(113): Object113= value; break; case(114): Object114= value; break; case(115): Object115= value; break; case(116): Object116= value; break; case(117): Object117= value; break; case(118): Object118= value; break; case(119): Object119= value; break; case(120): Object120= value; break; case(121): Object121= value; break; case(122): Object122= value; break; case(124): Object124= value; break; case(125): Object125= value; break; case(126): Object126= value; break; case(127): Object127= value; break; case(128): Object128= value; break; case(129): Object129= value; break; case(130): Object130= value; break; case(131): Object131= value; break; case(132): Object132= value; break; case(134): Object134= value; break; case(136): Object136= value; break; case(137): Object137= value; break; case(138): Object138= value; break; case(139): Object139= value; break; case(140): Object140= value; break; case(141): Object141= value; break; case(143): Object143= value; break; default: throw new IndexOutOfBoundsException(); } return true; } public static class Oid implements Serializable { public int identifier; public Oid() { } public Oid(String s) { identifier = Integer.parseInt(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + identifier;} public int hashCode() { return (int)identifier ; } public boolean equals(Object other) { if (other != null && (other instanceof Oid)) { Oid k = (Oid)other; return k.identifier == this.identifier; } return false; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } } } tck/src/java/org/apache/jdo/tck/pc/fieldtypes/FieldsOfPrimitiveboolean.java100664 101102 12500110373 27321 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.io.Serializable; public class FieldsOfPrimitiveboolean { public int identifier; private boolean boolean0; private boolean boolean1; private boolean boolean2; private boolean boolean3; private boolean boolean4; private boolean boolean5; private boolean boolean6; private boolean boolean7; private static boolean boolean8; private transient boolean boolean9; private transient boolean boolean10; private transient boolean boolean11; private transient boolean boolean12; private transient boolean boolean13; private transient boolean boolean14; private final boolean boolean15 = false; private volatile boolean boolean16; private volatile boolean boolean17; private volatile boolean boolean18; private volatile boolean boolean19; private volatile boolean boolean20; private volatile boolean boolean21; private volatile boolean boolean22; private volatile boolean boolean23; private static transient boolean boolean24; private static final boolean boolean25 = false; private static volatile boolean boolean26; private transient final boolean boolean27 = false; private transient volatile boolean boolean28; private transient volatile boolean boolean29; private transient volatile boolean boolean30; private transient volatile boolean boolean31; private transient volatile boolean boolean32; private transient volatile boolean boolean33; private static transient final boolean boolean34 = false; private static transient volatile boolean boolean35; public boolean boolean36; public boolean boolean37; public boolean boolean38; public boolean boolean39; public boolean boolean40; public boolean boolean41; public boolean boolean42; public boolean boolean43; public static boolean boolean44; public transient boolean boolean45; public transient boolean boolean46; public transient boolean boolean47; public transient boolean boolean48; public transient boolean boolean49; public transient boolean boolean50; public final boolean boolean51 = false; public volatile boolean boolean52; public volatile boolean boolean53; public volatile boolean boolean54; public volatile boolean boolean55; public volatile boolean boolean56; public volatile boolean boolean57; public volatile boolean boolean58; public volatile boolean boolean59; public static transient boolean boolean60; public static final boolean boolean61 = false; public static volatile boolean boolean62; public transient final boolean boolean63 = false; public transient volatile boolean boolean64; public transient volatile boolean boolean65; public transient volatile boolean boolean66; public transient volatile boolean boolean67; public transient volatile boolean boolean68; public transient volatile boolean boolean69; public static transient final boolean boolean70 = false; public static transient volatile boolean boolean71; protected boolean boolean72; protected boolean boolean73; protected boolean boolean74; protected boolean boolean75; protected boolean boolean76; protected boolean boolean77; protected boolean boolean78; protected boolean boolean79; protected static boolean boolean80; protected transient boolean boolean81; protected transient boolean boolean82; protected transient boolean boolean83; protected transient boolean boolean84; protected transient boolean boolean85; protected transient boolean boolean86; protected final boolean boolean87 = false; protected volatile boolean boolean88; protected volatile boolean boolean89; protected volatile boolean boolean90; protected volatile boolean boolean91; protected volatile boolean boolean92; protected volatile boolean boolean93; protected volatile boolean boolean94; protected volatile boolean boolean95; protected static transient boolean boolean96; protected static final boolean boolean97 = false; protected static volatile boolean boolean98; protected transient final boolean boolean99 = false; protected transient volatile boolean boolean100; protected transient volatile boolean boolean101; protected transient volatile boolean boolean102; protected transient volatile boolean boolean103; protected transient volatile boolean boolean104; protected transient volatile boolean boolean105; protected static transient final boolean boolean106 = false; protected static transient volatile boolean boolean107; boolean boolean108; boolean boolean109; boolean boolean110; boolean boolean111; boolean boolean112; boolean boolean113; boolean boolean114; boolean boolean115; static boolean boolean116; transient boolean boolean117; transient boolean boolean118; transient boolean boolean119; transient boolean boolean120; transient boolean boolean121; transient boolean boolean122; final boolean boolean123 = false; volatile boolean boolean124; volatile boolean boolean125; volatile boolean boolean126; volatile boolean boolean127; volatile boolean boolean128; volatile boolean boolean129; volatile boolean boolean130; volatile boolean boolean131; static transient boolean boolean132; static final boolean boolean133 = false; static volatile boolean boolean134; transient final boolean boolean135 = false; transient volatile boolean boolean136; transient volatile boolean boolean137; transient volatile boolean boolean138; transient volatile boolean boolean139; transient volatile boolean boolean140; transient volatile boolean boolean141; static transient final boolean boolean142 = false; static transient volatile boolean boolean143; public static final boolean [] isPersistent = { true,true,true,false,true,true,true,false,false,false, false,true,true,true,false,false,true,true,true,false, true,true,true,false,false,false,false,false,false,false, true,true,true,false,false,false,true,true,true,false, true,true,true,false,false,false,false,true,true,true, false,false,true,true,true,false,true,true,true,false, false,false,false,false,false,false,true,true,true,false, false,false,true,true,true,false,true,true,true,false, false,false,false,true,true,true,false,false,true,true, true,false,true,true,true,false,false,false,false,false, false,false,true,true,true,false,false,false,true,true, true,false,true,true,true,false,false,false,false,true, true,true,false,false,true,true,true,false,true,true, true,false,false,false,false,false,false,false,true,true, true,false,false,false }; public static final boolean [] isStatic = { false,false,false,false,false,false,false,false,true,false, false,false,false,false,false,false,false,false,false,false, false,false,false,false,true,true,true,false,false,false, false,false,false,false,true,true,false,false,false,false, false,false,false,false,true,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, true,true,true,false,false,false,false,false,false,false, true,true,false,false,false,false,false,false,false,false, true,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,true,true,true,false, false,false,false,false,false,false,true,true,false,false, false,false,false,false,false,false,true,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,true,true,true,false,false,false,false,false, false,false,true,true }; public static final boolean [] isFinal = { false,false,false,false,false,false,false,false,false,false, false,false,false,false,false,true,false,false,false,false, false,false,false,false,false,true,false,true,false,false, false,false,false,false,true,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, false,true,false,false,false,false,false,false,false,false, false,true,false,true,false,false,false,false,false,false, true,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,false,true,false,false, false,false,false,false,false,false,false,true,false,true, false,false,false,false,false,false,true,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,false,true,false,false,false,false,false,false, false,false,false,true,false,true,false,false,false,false, false,false,true,false }; public static final String [] fieldSpecs = { "private boolean boolean0", "embedded= true private boolean boolean1", "embedded= false private boolean boolean2", "persistence-modifier= none private boolean boolean3", "persistence-modifier= persistent private boolean boolean4", "persistence-modifier= persistent embedded= true private boolean boolean5", "persistence-modifier= persistent embedded= false private boolean boolean6", "persistence-modifier= transactional private boolean boolean7", "private static boolean boolean8", "private transient boolean boolean9", "persistence-modifier= none private transient boolean boolean10", "persistence-modifier= persistent private transient boolean boolean11", "persistence-modifier= persistent embedded= true private transient boolean boolean12", "persistence-modifier= persistent embedded= false private transient boolean boolean13", "persistence-modifier= transactional private transient boolean boolean14", "private final boolean boolean15", "private volatile boolean boolean16", "embedded= true private volatile boolean boolean17", "embedded= false private volatile boolean boolean18", "persistence-modifier= none private volatile boolean boolean19", "persistence-modifier= persistent private volatile boolean boolean20", "persistence-modifier= persistent embedded= true private volatile boolean boolean21", "persistence-modifier= persistent embedded= false private volatile boolean boolean22", "persistence-modifier= transactional private volatile boolean boolean23", "private static transient boolean boolean24", "private static final boolean boolean25", "private static volatile boolean boolean26", "private transient final boolean boolean27", "private transient volatile boolean boolean28", "persistence-modifier= none private transient volatile boolean boolean29", "persistence-modifier= persistent private transient volatile boolean boolean30", "persistence-modifier= persistent embedded= true private transient volatile boolean boolean31", "persistence-modifier= persistent embedded= false private transient volatile boolean boolean32", "persistence-modifier= transactional private transient volatile boolean boolean33", "private static transient final boolean boolean34", "private static transient volatile boolean boolean35", "public boolean boolean36", "embedded= true public boolean boolean37", "embedded= false public boolean boolean38", "persistence-modifier= none public boolean boolean39", "persistence-modifier= persistent public boolean boolean40", "persistence-modifier= persistent embedded= true public boolean boolean41", "persistence-modifier= persistent embedded= false public boolean boolean42", "persistence-modifier= transactional public boolean boolean43", "public static boolean boolean44", "public transient boolean boolean45", "persistence-modifier= none public transient boolean boolean46", "persistence-modifier= persistent public transient boolean boolean47", "persistence-modifier= persistent embedded= true public transient boolean boolean48", "persistence-modifier= persistent embedded= false public transient boolean boolean49", "persistence-modifier= transactional public transient boolean boolean50", "public final boolean boolean51", "public volatile boolean boolean52", "embedded= true public volatile boolean boolean53", "embedded= false public volatile boolean boolean54", "persistence-modifier= none public volatile boolean boolean55", "persistence-modifier= persistent public volatile boolean boolean56", "persistence-modifier= persistent embedded= true public volatile boolean boolean57", "persistence-modifier= persistent embedded= false public volatile boolean boolean58", "persistence-modifier= transactional public volatile boolean boolean59", "public static transient boolean boolean60", "public static final boolean boolean61", "public static volatile boolean boolean62", "public transient final boolean boolean63", "public transient volatile boolean boolean64", "persistence-modifier= none public transient volatile boolean boolean65", "persistence-modifier= persistent public transient volatile boolean boolean66", "persistence-modifier= persistent embedded= true public transient volatile boolean boolean67", "persistence-modifier= persistent embedded= false public transient volatile boolean boolean68", "persistence-modifier= transactional public transient volatile boolean boolean69", "public static transient final boolean boolean70", "public static transient volatile boolean boolean71", "protected boolean boolean72", "embedded= true protected boolean boolean73", "embedded= false protected boolean boolean74", "persistence-modifier= none protected boolean boolean75", "persistence-modifier= persistent protected boolean boolean76", "persistence-modifier= persistent embedded= true protected boolean boolean77", "persistence-modifier= persistent embedded= false protected boolean boolean78", "persistence-modifier= transactional protected boolean boolean79", "protected static boolean boolean80", "protected transient boolean boolean81", "persistence-modifier= none protected transient boolean boolean82", "persistence-modifier= persistent protected transient boolean boolean83", "persistence-modifier= persistent embedded= true protected transient boolean boolean84", "persistence-modifier= persistent embedded= false protected transient boolean boolean85", "persistence-modifier= transactional protected transient boolean boolean86", "protected final boolean boolean87", "protected volatile boolean boolean88", "embedded= true protected volatile boolean boolean89", "embedded= false protected volatile boolean boolean90", "persistence-modifier= none protected volatile boolean boolean91", "persistence-modifier= persistent protected volatile boolean boolean92", "persistence-modifier= persistent embedded= true protected volatile boolean boolean93", "persistence-modifier= persistent embedded= false protected volatile boolean boolean94", "persistence-modifier= transactional protected volatile boolean boolean95", "protected static transient boolean boolean96", "protected static final boolean boolean97", "protected static volatile boolean boolean98", "protected transient final boolean boolean99", "protected transient volatile boolean boolean100", "persistence-modifier= none protected transient volatile boolean boolean101", "persistence-modifier= persistent protected transient volatile boolean boolean102", "persistence-modifier= persistent embedded= true protected transient volatile boolean boolean103", "persistence-modifier= persistent embedded= false protected transient volatile boolean boolean104", "persistence-modifier= transactional protected transient volatile boolean boolean105", "protected static transient final boolean boolean106", "protected static transient volatile boolean boolean107", "boolean boolean108", "embedded= true boolean boolean109", "embedded= false boolean boolean110", "persistence-modifier= none boolean boolean111", "persistence-modifier= persistent boolean boolean112", "persistence-modifier= persistent embedded= true boolean boolean113", "persistence-modifier= persistent embedded= false boolean boolean114", "persistence-modifier= transactional boolean boolean115", "static boolean boolean116", "transient boolean boolean117", "persistence-modifier= none transient boolean boolean118", "persistence-modifier= persistent transient boolean boolean119", "persistence-modifier= persistent embedded= true transient boolean boolean120", "persistence-modifier= persistent embedded= false transient boolean boolean121", "persistence-modifier= transactional transient boolean boolean122", "final boolean boolean123", "volatile boolean boolean124", "embedded= true volatile boolean boolean125", "embedded= false volatile boolean boolean126", "persistence-modifier= none volatile boolean boolean127", "persistence-modifier= persistent volatile boolean boolean128", "persistence-modifier= persistent embedded= true volatile boolean boolean129", "persistence-modifier= persistent embedded= false volatile boolean boolean130", "persistence-modifier= transactional volatile boolean boolean131", "static transient boolean boolean132", "static final boolean boolean133", "static volatile boolean boolean134", "transient final boolean boolean135", "transient volatile boolean boolean136", "persistence-modifier= none transient volatile boolean boolean137", "persistence-modifier= persistent transient volatile boolean boolean138", "persistence-modifier= persistent embedded= true transient volatile boolean boolean139", "persistence-modifier= persistent embedded= false transient volatile boolean boolean140", "persistence-modifier= transactional transient volatile boolean boolean141", "static transient final boolean boolean142", "static transient volatile boolean boolean143" }; public int getLength() { return fieldSpecs.length; } public boolean get(int index) { switch (index) { case(0): return boolean0; case(1): return boolean1; case(2): return boolean2; case(3): return boolean3; case(4): return boolean4; case(5): return boolean5; case(6): return boolean6; case(7): return boolean7; case(8): return boolean8; case(9): return boolean9; case(10): return boolean10; case(11): return boolean11; case(12): return boolean12; case(13): return boolean13; case(14): return boolean14; case(15): return boolean15; case(16): return boolean16; case(17): return boolean17; case(18): return boolean18; case(19): return boolean19; case(20): return boolean20; case(21): return boolean21; case(22): return boolean22; case(23): return boolean23; case(24): return boolean24; case(25): return boolean25; case(26): return boolean26; case(27): return boolean27; case(28): return boolean28; case(29): return boolean29; case(30): return boolean30; case(31): return boolean31; case(32): return boolean32; case(33): return boolean33; case(34): return boolean34; case(35): return boolean35; case(36): return boolean36; case(37): return boolean37; case(38): return boolean38; case(39): return boolean39; case(40): return boolean40; case(41): return boolean41; case(42): return boolean42; case(43): return boolean43; case(44): return boolean44; case(45): return boolean45; case(46): return boolean46; case(47): return boolean47; case(48): return boolean48; case(49): return boolean49; case(50): return boolean50; case(51): return boolean51; case(52): return boolean52; case(53): return boolean53; case(54): return boolean54; case(55): return boolean55; case(56): return boolean56; case(57): return boolean57; case(58): return boolean58; case(59): return boolean59; case(60): return boolean60; case(61): return boolean61; case(62): return boolean62; case(63): return boolean63; case(64): return boolean64; case(65): return boolean65; case(66): return boolean66; case(67): return boolean67; case(68): return boolean68; case(69): return boolean69; case(70): return boolean70; case(71): return boolean71; case(72): return boolean72; case(73): return boolean73; case(74): return boolean74; case(75): return boolean75; case(76): return boolean76; case(77): return boolean77; case(78): return boolean78; case(79): return boolean79; case(80): return boolean80; case(81): return boolean81; case(82): return boolean82; case(83): return boolean83; case(84): return boolean84; case(85): return boolean85; case(86): return boolean86; case(87): return boolean87; case(88): return boolean88; case(89): return boolean89; case(90): return boolean90; case(91): return boolean91; case(92): return boolean92; case(93): return boolean93; case(94): return boolean94; case(95): return boolean95; case(96): return boolean96; case(97): return boolean97; case(98): return boolean98; case(99): return boolean99; case(100): return boolean100; case(101): return boolean101; case(102): return boolean102; case(103): return boolean103; case(104): return boolean104; case(105): return boolean105; case(106): return boolean106; case(107): return boolean107; case(108): return boolean108; case(109): return boolean109; case(110): return boolean110; case(111): return boolean111; case(112): return boolean112; case(113): return boolean113; case(114): return boolean114; case(115): return boolean115; case(116): return boolean116; case(117): return boolean117; case(118): return boolean118; case(119): return boolean119; case(120): return boolean120; case(121): return boolean121; case(122): return boolean122; case(123): return boolean123; case(124): return boolean124; case(125): return boolean125; case(126): return boolean126; case(127): return boolean127; case(128): return boolean128; case(129): return boolean129; case(130): return boolean130; case(131): return boolean131; case(132): return boolean132; case(133): return boolean133; case(134): return boolean134; case(135): return boolean135; case(136): return boolean136; case(137): return boolean137; case(138): return boolean138; case(139): return boolean139; case(140): return boolean140; case(141): return boolean141; case(142): return boolean142; case(143): return boolean143; default: throw new IndexOutOfBoundsException(); } } public boolean set(int index,boolean value) { if(fieldSpecs[index].indexOf("final") != -1) return false; switch (index) { case(0): boolean0= value; break; case(1): boolean1= value; break; case(2): boolean2= value; break; case(3): boolean3= value; break; case(4): boolean4= value; break; case(5): boolean5= value; break; case(6): boolean6= value; break; case(7): boolean7= value; break; case(8): boolean8= value; break; case(9): boolean9= value; break; case(10): boolean10= value; break; case(11): boolean11= value; break; case(12): boolean12= value; break; case(13): boolean13= value; break; case(14): boolean14= value; break; case(16): boolean16= value; break; case(17): boolean17= value; break; case(18): boolean18= value; break; case(19): boolean19= value; break; case(20): boolean20= value; break; case(21): boolean21= value; break; case(22): boolean22= value; break; case(23): boolean23= value; break; case(24): boolean24= value; break; case(26): boolean26= value; break; case(28): boolean28= value; break; case(29): boolean29= value; break; case(30): boolean30= value; break; case(31): boolean31= value; break; case(32): boolean32= value; break; case(33): boolean33= value; break; case(35): boolean35= value; break; case(36): boolean36= value; break; case(37): boolean37= value; break; case(38): boolean38= value; break; case(39): boolean39= value; break; case(40): boolean40= value; break; case(41): boolean41= value; break; case(42): boolean42= value; break; case(43): boolean43= value; break; case(44): boolean44= value; break; case(45): boolean45= value; break; case(46): boolean46= value; break; case(47): boolean47= value; break; case(48): boolean48= value; break; case(49): boolean49= value; break; case(50): boolean50= value; break; case(52): boolean52= value; break; case(53): boolean53= value; break; case(54): boolean54= value; break; case(55): boolean55= value; break; case(56): boolean56= value; break; case(57): boolean57= value; break; case(58): boolean58= value; break; case(59): boolean59= value; break; case(60): boolean60= value; break; case(62): boolean62= value; break; case(64): boolean64= value; break; case(65): boolean65= value; break; case(66): boolean66= value; break; case(67): boolean67= value; break; case(68): boolean68= value; break; case(69): boolean69= value; break; case(71): boolean71= value; break; case(72): boolean72= value; break; case(73): boolean73= value; break; case(74): boolean74= value; break; case(75): boolean75= value; break; case(76): boolean76= value; break; case(77): boolean77= value; break; case(78): boolean78= value; break; case(79): boolean79= value; break; case(80): boolean80= value; break; case(81): boolean81= value; break; case(82): boolean82= value; break; case(83): boolean83= value; break; case(84): boolean84= value; break; case(85): boolean85= value; break; case(86): boolean86= value; break; case(88): boolean88= value; break; case(89): boolean89= value; break; case(90): boolean90= value; break; case(91): boolean91= value; break; case(92): boolean92= value; break; case(93): boolean93= value; break; case(94): boolean94= value; break; case(95): boolean95= value; break; case(96): boolean96= value; break; case(98): boolean98= value; break; case(100): boolean100= value; break; case(101): boolean101= value; break; case(102): boolean102= value; break; case(103): boolean103= value; break; case(104): boolean104= value; break; case(105): boolean105= value; break; case(107): boolean107= value; break; case(108): boolean108= value; break; case(109): boolean109= value; break; case(110): boolean110= value; break; case(111): boolean111= value; break; case(112): boolean112= value; break; case(113): boolean113= value; break; case(114): boolean114= value; break; case(115): boolean115= value; break; case(116): boolean116= value; break; case(117): boolean117= value; break; case(118): boolean118= value; break; case(119): boolean119= value; break; case(120): boolean120= value; break; case(121): boolean121= value; break; case(122): boolean122= value; break; case(124): boolean124= value; break; case(125): boolean125= value; break; case(126): boolean126= value; break; case(127): boolean127= value; break; case(128): boolean128= value; break; case(129): boolean129= value; break; case(130): boolean130= value; break; case(131): boolean131= value; break; case(132): boolean132= value; break; case(134): boolean134= value; break; case(136): boolean136= value; break; case(137): boolean137= value; break; case(138): boolean138= value; break; case(139): boolean139= value; break; case(140): boolean140= value; break; case(141): boolean141= value; break; case(143): boolean143= value; break; default: throw new IndexOutOfBoundsException(); } return true; } public static class Oid implements Serializable { public int identifier; public Oid() { } public Oid(String s) { identifier = Integer.parseInt(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + identifier;} public int hashCode() { return (int)identifier ; } public boolean equals(Object other) { if (other != null && (other instanceof Oid)) { Oid k = (Oid)other; return k.identifier == this.identifier; } return false; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } } } tck/src/java/org/apache/jdo/tck/pc/fieldtypes/FieldsOfPrimitivebyte.java100664 74007 12500110373 26642 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.io.Serializable; public class FieldsOfPrimitivebyte { public int identifier; private byte byte0; private byte byte1; private byte byte2; private byte byte3; private byte byte4; private byte byte5; private byte byte6; private byte byte7; private static byte byte8; private transient byte byte9; private transient byte byte10; private transient byte byte11; private transient byte byte12; private transient byte byte13; private transient byte byte14; private final byte byte15 = 5; private volatile byte byte16; private volatile byte byte17; private volatile byte byte18; private volatile byte byte19; private volatile byte byte20; private volatile byte byte21; private volatile byte byte22; private volatile byte byte23; private static transient byte byte24; private static final byte byte25 = 5; private static volatile byte byte26; private transient final byte byte27 = 5; private transient volatile byte byte28; private transient volatile byte byte29; private transient volatile byte byte30; private transient volatile byte byte31; private transient volatile byte byte32; private transient volatile byte byte33; private static transient final byte byte34 = 5; private static transient volatile byte byte35; public byte byte36; public byte byte37; public byte byte38; public byte byte39; public byte byte40; public byte byte41; public byte byte42; public byte byte43; public static byte byte44; public transient byte byte45; public transient byte byte46; public transient byte byte47; public transient byte byte48; public transient byte byte49; public transient byte byte50; public final byte byte51 = 5; public volatile byte byte52; public volatile byte byte53; public volatile byte byte54; public volatile byte byte55; public volatile byte byte56; public volatile byte byte57; public volatile byte byte58; public volatile byte byte59; public static transient byte byte60; public static final byte byte61 = 5; public static volatile byte byte62; public transient final byte byte63 = 5; public transient volatile byte byte64; public transient volatile byte byte65; public transient volatile byte byte66; public transient volatile byte byte67; public transient volatile byte byte68; public transient volatile byte byte69; public static transient final byte byte70 = 5; public static transient volatile byte byte71; protected byte byte72; protected byte byte73; protected byte byte74; protected byte byte75; protected byte byte76; protected byte byte77; protected byte byte78; protected byte byte79; protected static byte byte80; protected transient byte byte81; protected transient byte byte82; protected transient byte byte83; protected transient byte byte84; protected transient byte byte85; protected transient byte byte86; protected final byte byte87 = 5; protected volatile byte byte88; protected volatile byte byte89; protected volatile byte byte90; protected volatile byte byte91; protected volatile byte byte92; protected volatile byte byte93; protected volatile byte byte94; protected volatile byte byte95; protected static transient byte byte96; protected static final byte byte97 = 5; protected static volatile byte byte98; protected transient final byte byte99 = 5; protected transient volatile byte byte100; protected transient volatile byte byte101; protected transient volatile byte byte102; protected transient volatile byte byte103; protected transient volatile byte byte104; protected transient volatile byte byte105; protected static transient final byte byte106 = 5; protected static transient volatile byte byte107; byte byte108; byte byte109; byte byte110; byte byte111; byte byte112; byte byte113; byte byte114; byte byte115; static byte byte116; transient byte byte117; transient byte byte118; transient byte byte119; transient byte byte120; transient byte byte121; transient byte byte122; final byte byte123 = 5; volatile byte byte124; volatile byte byte125; volatile byte byte126; volatile byte byte127; volatile byte byte128; volatile byte byte129; volatile byte byte130; volatile byte byte131; static transient byte byte132; static final byte byte133 = 5; static volatile byte byte134; transient final byte byte135 = 5; transient volatile byte byte136; transient volatile byte byte137; transient volatile byte byte138; transient volatile byte byte139; transient volatile byte byte140; transient volatile byte byte141; static transient final byte byte142 = 5; static transient volatile byte byte143; public static final boolean [] isPersistent = { true,true,true,false,true,true,true,false,false,false, false,true,true,true,false,false,true,true,true,false, true,true,true,false,false,false,false,false,false,false, true,true,true,false,false,false,true,true,true,false, true,true,true,false,false,false,false,true,true,true, false,false,true,true,true,false,true,true,true,false, false,false,false,false,false,false,true,true,true,false, false,false,true,true,true,false,true,true,true,false, false,false,false,true,true,true,false,false,true,true, true,false,true,true,true,false,false,false,false,false, false,false,true,true,true,false,false,false,true,true, true,false,true,true,true,false,false,false,false,true, true,true,false,false,true,true,true,false,true,true, true,false,false,false,false,false,false,false,true,true, true,false,false,false }; public static final boolean [] isStatic = { false,false,false,false,false,false,false,false,true,false, false,false,false,false,false,false,false,false,false,false, false,false,false,false,true,true,true,false,false,false, false,false,false,false,true,true,false,false,false,false, false,false,false,false,true,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, true,true,true,false,false,false,false,false,false,false, true,true,false,false,false,false,false,false,false,false, true,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,true,true,true,false, false,false,false,false,false,false,true,true,false,false, false,false,false,false,false,false,true,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,true,true,true,false,false,false,false,false, false,false,true,true }; public static final boolean [] isFinal = { false,false,false,false,false,false,false,false,false,false, false,false,false,false,false,true,false,false,false,false, false,false,false,false,false,true,false,true,false,false, false,false,false,false,true,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, false,true,false,false,false,false,false,false,false,false, false,true,false,true,false,false,false,false,false,false, true,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,false,true,false,false, false,false,false,false,false,false,false,true,false,true, false,false,false,false,false,false,true,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,false,true,false,false,false,false,false,false, false,false,false,true,false,true,false,false,false,false, false,false,true,false }; public static final String [] fieldSpecs = { "private byte byte0", "embedded= true private byte byte1", "embedded= false private byte byte2", "persistence-modifier= none private byte byte3", "persistence-modifier= persistent private byte byte4", "persistence-modifier= persistent embedded= true private byte byte5", "persistence-modifier= persistent embedded= false private byte byte6", "persistence-modifier= transactional private byte byte7", "private static byte byte8", "private transient byte byte9", "persistence-modifier= none private transient byte byte10", "persistence-modifier= persistent private transient byte byte11", "persistence-modifier= persistent embedded= true private transient byte byte12", "persistence-modifier= persistent embedded= false private transient byte byte13", "persistence-modifier= transactional private transient byte byte14", "private final byte byte15", "private volatile byte byte16", "embedded= true private volatile byte byte17", "embedded= false private volatile byte byte18", "persistence-modifier= none private volatile byte byte19", "persistence-modifier= persistent private volatile byte byte20", "persistence-modifier= persistent embedded= true private volatile byte byte21", "persistence-modifier= persistent embedded= false private volatile byte byte22", "persistence-modifier= transactional private volatile byte byte23", "private static transient byte byte24", "private static final byte byte25", "private static volatile byte byte26", "private transient final byte byte27", "private transient volatile byte byte28", "persistence-modifier= none private transient volatile byte byte29", "persistence-modifier= persistent private transient volatile byte byte30", "persistence-modifier= persistent embedded= true private transient volatile byte byte31", "persistence-modifier= persistent embedded= false private transient volatile byte byte32", "persistence-modifier= transactional private transient volatile byte byte33", "private static transient final byte byte34", "private static transient volatile byte byte35", "public byte byte36", "embedded= true public byte byte37", "embedded= false public byte byte38", "persistence-modifier= none public byte byte39", "persistence-modifier= persistent public byte byte40", "persistence-modifier= persistent embedded= true public byte byte41", "persistence-modifier= persistent embedded= false public byte byte42", "persistence-modifier= transactional public byte byte43", "public static byte byte44", "public transient byte byte45", "persistence-modifier= none public transient byte byte46", "persistence-modifier= persistent public transient byte byte47", "persistence-modifier= persistent embedded= true public transient byte byte48", "persistence-modifier= persistent embedded= false public transient byte byte49", "persistence-modifier= transactional public transient byte byte50", "public final byte byte51", "public volatile byte byte52", "embedded= true public volatile byte byte53", "embedded= false public volatile byte byte54", "persistence-modifier= none public volatile byte byte55", "persistence-modifier= persistent public volatile byte byte56", "persistence-modifier= persistent embedded= true public volatile byte byte57", "persistence-modifier= persistent embedded= false public volatile byte byte58", "persistence-modifier= transactional public volatile byte byte59", "public static transient byte byte60", "public static final byte byte61", "public static volatile byte byte62", "public transient final byte byte63", "public transient volatile byte byte64", "persistence-modifier= none public transient volatile byte byte65", "persistence-modifier= persistent public transient volatile byte byte66", "persistence-modifier= persistent embedded= true public transient volatile byte byte67", "persistence-modifier= persistent embedded= false public transient volatile byte byte68", "persistence-modifier= transactional public transient volatile byte byte69", "public static transient final byte byte70", "public static transient volatile byte byte71", "protected byte byte72", "embedded= true protected byte byte73", "embedded= false protected byte byte74", "persistence-modifier= none protected byte byte75", "persistence-modifier= persistent protected byte byte76", "persistence-modifier= persistent embedded= true protected byte byte77", "persistence-modifier= persistent embedded= false protected byte byte78", "persistence-modifier= transactional protected byte byte79", "protected static byte byte80", "protected transient byte byte81", "persistence-modifier= none protected transient byte byte82", "persistence-modifier= persistent protected transient byte byte83", "persistence-modifier= persistent embedded= true protected transient byte byte84", "persistence-modifier= persistent embedded= false protected transient byte byte85", "persistence-modifier= transactional protected transient byte byte86", "protected final byte byte87", "protected volatile byte byte88", "embedded= true protected volatile byte byte89", "embedded= false protected volatile byte byte90", "persistence-modifier= none protected volatile byte byte91", "persistence-modifier= persistent protected volatile byte byte92", "persistence-modifier= persistent embedded= true protected volatile byte byte93", "persistence-modifier= persistent embedded= false protected volatile byte byte94", "persistence-modifier= transactional protected volatile byte byte95", "protected static transient byte byte96", "protected static final byte byte97", "protected static volatile byte byte98", "protected transient final byte byte99", "protected transient volatile byte byte100", "persistence-modifier= none protected transient volatile byte byte101", "persistence-modifier= persistent protected transient volatile byte byte102", "persistence-modifier= persistent embedded= true protected transient volatile byte byte103", "persistence-modifier= persistent embedded= false protected transient volatile byte byte104", "persistence-modifier= transactional protected transient volatile byte byte105", "protected static transient final byte byte106", "protected static transient volatile byte byte107", "byte byte108", "embedded= true byte byte109", "embedded= false byte byte110", "persistence-modifier= none byte byte111", "persistence-modifier= persistent byte byte112", "persistence-modifier= persistent embedded= true byte byte113", "persistence-modifier= persistent embedded= false byte byte114", "persistence-modifier= transactional byte byte115", "static byte byte116", "transient byte byte117", "persistence-modifier= none transient byte byte118", "persistence-modifier= persistent transient byte byte119", "persistence-modifier= persistent embedded= true transient byte byte120", "persistence-modifier= persistent embedded= false transient byte byte121", "persistence-modifier= transactional transient byte byte122", "final byte byte123", "volatile byte byte124", "embedded= true volatile byte byte125", "embedded= false volatile byte byte126", "persistence-modifier= none volatile byte byte127", "persistence-modifier= persistent volatile byte byte128", "persistence-modifier= persistent embedded= true volatile byte byte129", "persistence-modifier= persistent embedded= false volatile byte byte130", "persistence-modifier= transactional volatile byte byte131", "static transient byte byte132", "static final byte byte133", "static volatile byte byte134", "transient final byte byte135", "transient volatile byte byte136", "persistence-modifier= none transient volatile byte byte137", "persistence-modifier= persistent transient volatile byte byte138", "persistence-modifier= persistent embedded= true transient volatile byte byte139", "persistence-modifier= persistent embedded= false transient volatile byte byte140", "persistence-modifier= transactional transient volatile byte byte141", "static transient final byte byte142", "static transient volatile byte byte143" }; public int getLength() { return fieldSpecs.length; } public byte get(int index) { switch (index) { case(0): return byte0; case(1): return byte1; case(2): return byte2; case(3): return byte3; case(4): return byte4; case(5): return byte5; case(6): return byte6; case(7): return byte7; case(8): return byte8; case(9): return byte9; case(10): return byte10; case(11): return byte11; case(12): return byte12; case(13): return byte13; case(14): return byte14; case(15): return byte15; case(16): return byte16; case(17): return byte17; case(18): return byte18; case(19): return byte19; case(20): return byte20; case(21): return byte21; case(22): return byte22; case(23): return byte23; case(24): return byte24; case(25): return byte25; case(26): return byte26; case(27): return byte27; case(28): return byte28; case(29): return byte29; case(30): return byte30; case(31): return byte31; case(32): return byte32; case(33): return byte33; case(34): return byte34; case(35): return byte35; case(36): return byte36; case(37): return byte37; case(38): return byte38; case(39): return byte39; case(40): return byte40; case(41): return byte41; case(42): return byte42; case(43): return byte43; case(44): return byte44; case(45): return byte45; case(46): return byte46; case(47): return byte47; case(48): return byte48; case(49): return byte49; case(50): return byte50; case(51): return byte51; case(52): return byte52; case(53): return byte53; case(54): return byte54; case(55): return byte55; case(56): return byte56; case(57): return byte57; case(58): return byte58; case(59): return byte59; case(60): return byte60; case(61): return byte61; case(62): return byte62; case(63): return byte63; case(64): return byte64; case(65): return byte65; case(66): return byte66; case(67): return byte67; case(68): return byte68; case(69): return byte69; case(70): return byte70; case(71): return byte71; case(72): return byte72; case(73): return byte73; case(74): return byte74; case(75): return byte75; case(76): return byte76; case(77): return byte77; case(78): return byte78; case(79): return byte79; case(80): return byte80; case(81): return byte81; case(82): return byte82; case(83): return byte83; case(84): return byte84; case(85): return byte85; case(86): return byte86; case(87): return byte87; case(88): return byte88; case(89): return byte89; case(90): return byte90; case(91): return byte91; case(92): return byte92; case(93): return byte93; case(94): return byte94; case(95): return byte95; case(96): return byte96; case(97): return byte97; case(98): return byte98; case(99): return byte99; case(100): return byte100; case(101): return byte101; case(102): return byte102; case(103): return byte103; case(104): return byte104; case(105): return byte105; case(106): return byte106; case(107): return byte107; case(108): return byte108; case(109): return byte109; case(110): return byte110; case(111): return byte111; case(112): return byte112; case(113): return byte113; case(114): return byte114; case(115): return byte115; case(116): return byte116; case(117): return byte117; case(118): return byte118; case(119): return byte119; case(120): return byte120; case(121): return byte121; case(122): return byte122; case(123): return byte123; case(124): return byte124; case(125): return byte125; case(126): return byte126; case(127): return byte127; case(128): return byte128; case(129): return byte129; case(130): return byte130; case(131): return byte131; case(132): return byte132; case(133): return byte133; case(134): return byte134; case(135): return byte135; case(136): return byte136; case(137): return byte137; case(138): return byte138; case(139): return byte139; case(140): return byte140; case(141): return byte141; case(142): return byte142; case(143): return byte143; default: throw new IndexOutOfBoundsException(); } } public boolean set(int index,byte value) { if(fieldSpecs[index].indexOf("final") != -1) return false; switch (index) { case(0): byte0= value; break; case(1): byte1= value; break; case(2): byte2= value; break; case(3): byte3= value; break; case(4): byte4= value; break; case(5): byte5= value; break; case(6): byte6= value; break; case(7): byte7= value; break; case(8): byte8= value; break; case(9): byte9= value; break; case(10): byte10= value; break; case(11): byte11= value; break; case(12): byte12= value; break; case(13): byte13= value; break; case(14): byte14= value; break; case(16): byte16= value; break; case(17): byte17= value; break; case(18): byte18= value; break; case(19): byte19= value; break; case(20): byte20= value; break; case(21): byte21= value; break; case(22): byte22= value; break; case(23): byte23= value; break; case(24): byte24= value; break; case(26): byte26= value; break; case(28): byte28= value; break; case(29): byte29= value; break; case(30): byte30= value; break; case(31): byte31= value; break; case(32): byte32= value; break; case(33): byte33= value; break; case(35): byte35= value; break; case(36): byte36= value; break; case(37): byte37= value; break; case(38): byte38= value; break; case(39): byte39= value; break; case(40): byte40= value; break; case(41): byte41= value; break; case(42): byte42= value; break; case(43): byte43= value; break; case(44): byte44= value; break; case(45): byte45= value; break; case(46): byte46= value; break; case(47): byte47= value; break; case(48): byte48= value; break; case(49): byte49= value; break; case(50): byte50= value; break; case(52): byte52= value; break; case(53): byte53= value; break; case(54): byte54= value; break; case(55): byte55= value; break; case(56): byte56= value; break; case(57): byte57= value; break; case(58): byte58= value; break; case(59): byte59= value; break; case(60): byte60= value; break; case(62): byte62= value; break; case(64): byte64= value; break; case(65): byte65= value; break; case(66): byte66= value; break; case(67): byte67= value; break; case(68): byte68= value; break; case(69): byte69= value; break; case(71): byte71= value; break; case(72): byte72= value; break; case(73): byte73= value; break; case(74): byte74= value; break; case(75): byte75= value; break; case(76): byte76= value; break; case(77): byte77= value; break; case(78): byte78= value; break; case(79): byte79= value; break; case(80): byte80= value; break; case(81): byte81= value; break; case(82): byte82= value; break; case(83): byte83= value; break; case(84): byte84= value; break; case(85): byte85= value; break; case(86): byte86= value; break; case(88): byte88= value; break; case(89): byte89= value; break; case(90): byte90= value; break; case(91): byte91= value; break; case(92): byte92= value; break; case(93): byte93= value; break; case(94): byte94= value; break; case(95): byte95= value; break; case(96): byte96= value; break; case(98): byte98= value; break; case(100): byte100= value; break; case(101): byte101= value; break; case(102): byte102= value; break; case(103): byte103= value; break; case(104): byte104= value; break; case(105): byte105= value; break; case(107): byte107= value; break; case(108): byte108= value; break; case(109): byte109= value; break; case(110): byte110= value; break; case(111): byte111= value; break; case(112): byte112= value; break; case(113): byte113= value; break; case(114): byte114= value; break; case(115): byte115= value; break; case(116): byte116= value; break; case(117): byte117= value; break; case(118): byte118= value; break; case(119): byte119= value; break; case(120): byte120= value; break; case(121): byte121= value; break; case(122): byte122= value; break; case(124): byte124= value; break; case(125): byte125= value; break; case(126): byte126= value; break; case(127): byte127= value; break; case(128): byte128= value; break; case(129): byte129= value; break; case(130): byte130= value; break; case(131): byte131= value; break; case(132): byte132= value; break; case(134): byte134= value; break; case(136): byte136= value; break; case(137): byte137= value; break; case(138): byte138= value; break; case(139): byte139= value; break; case(140): byte140= value; break; case(141): byte141= value; break; case(143): byte143= value; break; default: throw new IndexOutOfBoundsException(); } return true; } public static class Oid implements Serializable { public int identifier; public Oid() { } public Oid(String s) { identifier = Integer.parseInt(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + identifier;} public int hashCode() { return (int)identifier ; } public boolean equals(Object other) { if (other != null && (other instanceof Oid)) { Oid k = (Oid)other; return k.identifier == this.identifier; } return false; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } } } tck/src/java/org/apache/jdo/tck/pc/fieldtypes/FieldsOfPrimitivechar.java100664 74051 12500110373 26613 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.io.Serializable; public class FieldsOfPrimitivechar { public int identifier; private char char0; private char char1; private char char2; private char char3; private char char4; private char char5; private char char6; private char char7; private static char char8; private transient char char9; private transient char char10; private transient char char11; private transient char char12; private transient char char13; private transient char char14; private final char char15 = 'a'; private volatile char char16; private volatile char char17; private volatile char char18; private volatile char char19; private volatile char char20; private volatile char char21; private volatile char char22; private volatile char char23; private static transient char char24; private static final char char25 = 'a'; private static volatile char char26; private transient final char char27 = 'a'; private transient volatile char char28; private transient volatile char char29; private transient volatile char char30; private transient volatile char char31; private transient volatile char char32; private transient volatile char char33; private static transient final char char34 = 'a'; private static transient volatile char char35; public char char36; public char char37; public char char38; public char char39; public char char40; public char char41; public char char42; public char char43; public static char char44; public transient char char45; public transient char char46; public transient char char47; public transient char char48; public transient char char49; public transient char char50; public final char char51 = 'a'; public volatile char char52; public volatile char char53; public volatile char char54; public volatile char char55; public volatile char char56; public volatile char char57; public volatile char char58; public volatile char char59; public static transient char char60; public static final char char61 = 'a'; public static volatile char char62; public transient final char char63 = 'a'; public transient volatile char char64; public transient volatile char char65; public transient volatile char char66; public transient volatile char char67; public transient volatile char char68; public transient volatile char char69; public static transient final char char70 = 'a'; public static transient volatile char char71; protected char char72; protected char char73; protected char char74; protected char char75; protected char char76; protected char char77; protected char char78; protected char char79; protected static char char80; protected transient char char81; protected transient char char82; protected transient char char83; protected transient char char84; protected transient char char85; protected transient char char86; protected final char char87 = 'a'; protected volatile char char88; protected volatile char char89; protected volatile char char90; protected volatile char char91; protected volatile char char92; protected volatile char char93; protected volatile char char94; protected volatile char char95; protected static transient char char96; protected static final char char97 = 'a'; protected static volatile char char98; protected transient final char char99 = 'a'; protected transient volatile char char100; protected transient volatile char char101; protected transient volatile char char102; protected transient volatile char char103; protected transient volatile char char104; protected transient volatile char char105; protected static transient final char char106 = 'a'; protected static transient volatile char char107; char char108; char char109; char char110; char char111; char char112; char char113; char char114; char char115; static char char116; transient char char117; transient char char118; transient char char119; transient char char120; transient char char121; transient char char122; final char char123 = 'a'; volatile char char124; volatile char char125; volatile char char126; volatile char char127; volatile char char128; volatile char char129; volatile char char130; volatile char char131; static transient char char132; static final char char133 = 'a'; static volatile char char134; transient final char char135 = 'a'; transient volatile char char136; transient volatile char char137; transient volatile char char138; transient volatile char char139; transient volatile char char140; transient volatile char char141; static transient final char char142 = 'a'; static transient volatile char char143; public static final boolean [] isPersistent = { true,true,true,false,true,true,true,false,false,false, false,true,true,true,false,false,true,true,true,false, true,true,true,false,false,false,false,false,false,false, true,true,true,false,false,false,true,true,true,false, true,true,true,false,false,false,false,true,true,true, false,false,true,true,true,false,true,true,true,false, false,false,false,false,false,false,true,true,true,false, false,false,true,true,true,false,true,true,true,false, false,false,false,true,true,true,false,false,true,true, true,false,true,true,true,false,false,false,false,false, false,false,true,true,true,false,false,false,true,true, true,false,true,true,true,false,false,false,false,true, true,true,false,false,true,true,true,false,true,true, true,false,false,false,false,false,false,false,true,true, true,false,false,false }; public static final boolean [] isStatic = { false,false,false,false,false,false,false,false,true,false, false,false,false,false,false,false,false,false,false,false, false,false,false,false,true,true,true,false,false,false, false,false,false,false,true,true,false,false,false,false, false,false,false,false,true,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, true,true,true,false,false,false,false,false,false,false, true,true,false,false,false,false,false,false,false,false, true,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,true,true,true,false, false,false,false,false,false,false,true,true,false,false, false,false,false,false,false,false,true,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,true,true,true,false,false,false,false,false, false,false,true,true }; public static final boolean [] isFinal = { false,false,false,false,false,false,false,false,false,false, false,false,false,false,false,true,false,false,false,false, false,false,false,false,false,true,false,true,false,false, false,false,false,false,true,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, false,true,false,false,false,false,false,false,false,false, false,true,false,true,false,false,false,false,false,false, true,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,false,true,false,false, false,false,false,false,false,false,false,true,false,true, false,false,false,false,false,false,true,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,false,true,false,false,false,false,false,false, false,false,false,true,false,true,false,false,false,false, false,false,true,false }; public static final String [] fieldSpecs = { "private char char0", "embedded= true private char char1", "embedded= false private char char2", "persistence-modifier= none private char char3", "persistence-modifier= persistent private char char4", "persistence-modifier= persistent embedded= true private char char5", "persistence-modifier= persistent embedded= false private char char6", "persistence-modifier= transactional private char char7", "private static char char8", "private transient char char9", "persistence-modifier= none private transient char char10", "persistence-modifier= persistent private transient char char11", "persistence-modifier= persistent embedded= true private transient char char12", "persistence-modifier= persistent embedded= false private transient char char13", "persistence-modifier= transactional private transient char char14", "private final char char15", "private volatile char char16", "embedded= true private volatile char char17", "embedded= false private volatile char char18", "persistence-modifier= none private volatile char char19", "persistence-modifier= persistent private volatile char char20", "persistence-modifier= persistent embedded= true private volatile char char21", "persistence-modifier= persistent embedded= false private volatile char char22", "persistence-modifier= transactional private volatile char char23", "private static transient char char24", "private static final char char25", "private static volatile char char26", "private transient final char char27", "private transient volatile char char28", "persistence-modifier= none private transient volatile char char29", "persistence-modifier= persistent private transient volatile char char30", "persistence-modifier= persistent embedded= true private transient volatile char char31", "persistence-modifier= persistent embedded= false private transient volatile char char32", "persistence-modifier= transactional private transient volatile char char33", "private static transient final char char34", "private static transient volatile char char35", "public char char36", "embedded= true public char char37", "embedded= false public char char38", "persistence-modifier= none public char char39", "persistence-modifier= persistent public char char40", "persistence-modifier= persistent embedded= true public char char41", "persistence-modifier= persistent embedded= false public char char42", "persistence-modifier= transactional public char char43", "public static char char44", "public transient char char45", "persistence-modifier= none public transient char char46", "persistence-modifier= persistent public transient char char47", "persistence-modifier= persistent embedded= true public transient char char48", "persistence-modifier= persistent embedded= false public transient char char49", "persistence-modifier= transactional public transient char char50", "public final char char51", "public volatile char char52", "embedded= true public volatile char char53", "embedded= false public volatile char char54", "persistence-modifier= none public volatile char char55", "persistence-modifier= persistent public volatile char char56", "persistence-modifier= persistent embedded= true public volatile char char57", "persistence-modifier= persistent embedded= false public volatile char char58", "persistence-modifier= transactional public volatile char char59", "public static transient char char60", "public static final char char61", "public static volatile char char62", "public transient final char char63", "public transient volatile char char64", "persistence-modifier= none public transient volatile char char65", "persistence-modifier= persistent public transient volatile char char66", "persistence-modifier= persistent embedded= true public transient volatile char char67", "persistence-modifier= persistent embedded= false public transient volatile char char68", "persistence-modifier= transactional public transient volatile char char69", "public static transient final char char70", "public static transient volatile char char71", "protected char char72", "embedded= true protected char char73", "embedded= false protected char char74", "persistence-modifier= none protected char char75", "persistence-modifier= persistent protected char char76", "persistence-modifier= persistent embedded= true protected char char77", "persistence-modifier= persistent embedded= false protected char char78", "persistence-modifier= transactional protected char char79", "protected static char char80", "protected transient char char81", "persistence-modifier= none protected transient char char82", "persistence-modifier= persistent protected transient char char83", "persistence-modifier= persistent embedded= true protected transient char char84", "persistence-modifier= persistent embedded= false protected transient char char85", "persistence-modifier= transactional protected transient char char86", "protected final char char87", "protected volatile char char88", "embedded= true protected volatile char char89", "embedded= false protected volatile char char90", "persistence-modifier= none protected volatile char char91", "persistence-modifier= persistent protected volatile char char92", "persistence-modifier= persistent embedded= true protected volatile char char93", "persistence-modifier= persistent embedded= false protected volatile char char94", "persistence-modifier= transactional protected volatile char char95", "protected static transient char char96", "protected static final char char97", "protected static volatile char char98", "protected transient final char char99", "protected transient volatile char char100", "persistence-modifier= none protected transient volatile char char101", "persistence-modifier= persistent protected transient volatile char char102", "persistence-modifier= persistent embedded= true protected transient volatile char char103", "persistence-modifier= persistent embedded= false protected transient volatile char char104", "persistence-modifier= transactional protected transient volatile char char105", "protected static transient final char char106", "protected static transient volatile char char107", "char char108", "embedded= true char char109", "embedded= false char char110", "persistence-modifier= none char char111", "persistence-modifier= persistent char char112", "persistence-modifier= persistent embedded= true char char113", "persistence-modifier= persistent embedded= false char char114", "persistence-modifier= transactional char char115", "static char char116", "transient char char117", "persistence-modifier= none transient char char118", "persistence-modifier= persistent transient char char119", "persistence-modifier= persistent embedded= true transient char char120", "persistence-modifier= persistent embedded= false transient char char121", "persistence-modifier= transactional transient char char122", "final char char123", "volatile char char124", "embedded= true volatile char char125", "embedded= false volatile char char126", "persistence-modifier= none volatile char char127", "persistence-modifier= persistent volatile char char128", "persistence-modifier= persistent embedded= true volatile char char129", "persistence-modifier= persistent embedded= false volatile char char130", "persistence-modifier= transactional volatile char char131", "static transient char char132", "static final char char133", "static volatile char char134", "transient final char char135", "transient volatile char char136", "persistence-modifier= none transient volatile char char137", "persistence-modifier= persistent transient volatile char char138", "persistence-modifier= persistent embedded= true transient volatile char char139", "persistence-modifier= persistent embedded= false transient volatile char char140", "persistence-modifier= transactional transient volatile char char141", "static transient final char char142", "static transient volatile char char143" }; public int getLength() { return fieldSpecs.length; } public char get(int index) { switch (index) { case(0): return char0; case(1): return char1; case(2): return char2; case(3): return char3; case(4): return char4; case(5): return char5; case(6): return char6; case(7): return char7; case(8): return char8; case(9): return char9; case(10): return char10; case(11): return char11; case(12): return char12; case(13): return char13; case(14): return char14; case(15): return char15; case(16): return char16; case(17): return char17; case(18): return char18; case(19): return char19; case(20): return char20; case(21): return char21; case(22): return char22; case(23): return char23; case(24): return char24; case(25): return char25; case(26): return char26; case(27): return char27; case(28): return char28; case(29): return char29; case(30): return char30; case(31): return char31; case(32): return char32; case(33): return char33; case(34): return char34; case(35): return char35; case(36): return char36; case(37): return char37; case(38): return char38; case(39): return char39; case(40): return char40; case(41): return char41; case(42): return char42; case(43): return char43; case(44): return char44; case(45): return char45; case(46): return char46; case(47): return char47; case(48): return char48; case(49): return char49; case(50): return char50; case(51): return char51; case(52): return char52; case(53): return char53; case(54): return char54; case(55): return char55; case(56): return char56; case(57): return char57; case(58): return char58; case(59): return char59; case(60): return char60; case(61): return char61; case(62): return char62; case(63): return char63; case(64): return char64; case(65): return char65; case(66): return char66; case(67): return char67; case(68): return char68; case(69): return char69; case(70): return char70; case(71): return char71; case(72): return char72; case(73): return char73; case(74): return char74; case(75): return char75; case(76): return char76; case(77): return char77; case(78): return char78; case(79): return char79; case(80): return char80; case(81): return char81; case(82): return char82; case(83): return char83; case(84): return char84; case(85): return char85; case(86): return char86; case(87): return char87; case(88): return char88; case(89): return char89; case(90): return char90; case(91): return char91; case(92): return char92; case(93): return char93; case(94): return char94; case(95): return char95; case(96): return char96; case(97): return char97; case(98): return char98; case(99): return char99; case(100): return char100; case(101): return char101; case(102): return char102; case(103): return char103; case(104): return char104; case(105): return char105; case(106): return char106; case(107): return char107; case(108): return char108; case(109): return char109; case(110): return char110; case(111): return char111; case(112): return char112; case(113): return char113; case(114): return char114; case(115): return char115; case(116): return char116; case(117): return char117; case(118): return char118; case(119): return char119; case(120): return char120; case(121): return char121; case(122): return char122; case(123): return char123; case(124): return char124; case(125): return char125; case(126): return char126; case(127): return char127; case(128): return char128; case(129): return char129; case(130): return char130; case(131): return char131; case(132): return char132; case(133): return char133; case(134): return char134; case(135): return char135; case(136): return char136; case(137): return char137; case(138): return char138; case(139): return char139; case(140): return char140; case(141): return char141; case(142): return char142; case(143): return char143; default: throw new IndexOutOfBoundsException(); } } public boolean set(int index,char value) { if(fieldSpecs[index].indexOf("final") != -1) return false; switch (index) { case(0): char0= value; break; case(1): char1= value; break; case(2): char2= value; break; case(3): char3= value; break; case(4): char4= value; break; case(5): char5= value; break; case(6): char6= value; break; case(7): char7= value; break; case(8): char8= value; break; case(9): char9= value; break; case(10): char10= value; break; case(11): char11= value; break; case(12): char12= value; break; case(13): char13= value; break; case(14): char14= value; break; case(16): char16= value; break; case(17): char17= value; break; case(18): char18= value; break; case(19): char19= value; break; case(20): char20= value; break; case(21): char21= value; break; case(22): char22= value; break; case(23): char23= value; break; case(24): char24= value; break; case(26): char26= value; break; case(28): char28= value; break; case(29): char29= value; break; case(30): char30= value; break; case(31): char31= value; break; case(32): char32= value; break; case(33): char33= value; break; case(35): char35= value; break; case(36): char36= value; break; case(37): char37= value; break; case(38): char38= value; break; case(39): char39= value; break; case(40): char40= value; break; case(41): char41= value; break; case(42): char42= value; break; case(43): char43= value; break; case(44): char44= value; break; case(45): char45= value; break; case(46): char46= value; break; case(47): char47= value; break; case(48): char48= value; break; case(49): char49= value; break; case(50): char50= value; break; case(52): char52= value; break; case(53): char53= value; break; case(54): char54= value; break; case(55): char55= value; break; case(56): char56= value; break; case(57): char57= value; break; case(58): char58= value; break; case(59): char59= value; break; case(60): char60= value; break; case(62): char62= value; break; case(64): char64= value; break; case(65): char65= value; break; case(66): char66= value; break; case(67): char67= value; break; case(68): char68= value; break; case(69): char69= value; break; case(71): char71= value; break; case(72): char72= value; break; case(73): char73= value; break; case(74): char74= value; break; case(75): char75= value; break; case(76): char76= value; break; case(77): char77= value; break; case(78): char78= value; break; case(79): char79= value; break; case(80): char80= value; break; case(81): char81= value; break; case(82): char82= value; break; case(83): char83= value; break; case(84): char84= value; break; case(85): char85= value; break; case(86): char86= value; break; case(88): char88= value; break; case(89): char89= value; break; case(90): char90= value; break; case(91): char91= value; break; case(92): char92= value; break; case(93): char93= value; break; case(94): char94= value; break; case(95): char95= value; break; case(96): char96= value; break; case(98): char98= value; break; case(100): char100= value; break; case(101): char101= value; break; case(102): char102= value; break; case(103): char103= value; break; case(104): char104= value; break; case(105): char105= value; break; case(107): char107= value; break; case(108): char108= value; break; case(109): char109= value; break; case(110): char110= value; break; case(111): char111= value; break; case(112): char112= value; break; case(113): char113= value; break; case(114): char114= value; break; case(115): char115= value; break; case(116): char116= value; break; case(117): char117= value; break; case(118): char118= value; break; case(119): char119= value; break; case(120): char120= value; break; case(121): char121= value; break; case(122): char122= value; break; case(124): char124= value; break; case(125): char125= value; break; case(126): char126= value; break; case(127): char127= value; break; case(128): char128= value; break; case(129): char129= value; break; case(130): char130= value; break; case(131): char131= value; break; case(132): char132= value; break; case(134): char134= value; break; case(136): char136= value; break; case(137): char137= value; break; case(138): char138= value; break; case(139): char139= value; break; case(140): char140= value; break; case(141): char141= value; break; case(143): char143= value; break; default: throw new IndexOutOfBoundsException(); } return true; } public static class Oid implements Serializable { public int identifier; public Oid() { } public Oid(String s) { identifier = Integer.parseInt(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + identifier;} public int hashCode() { return (int)identifier ; } public boolean equals(Object other) { if (other != null && (other instanceof Oid)) { Oid k = (Oid)other; return k.identifier == this.identifier; } return false; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } } } tck/src/java/org/apache/jdo/tck/pc/fieldtypes/FieldsOfPrimitivedouble.java100664 77256 12500110373 27162 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.io.Serializable; public class FieldsOfPrimitivedouble { public int identifier; private double double0; private double double1; private double double2; private double double3; private double double4; private double double5; private double double6; private double double7; private static double double8; private transient double double9; private transient double double10; private transient double double11; private transient double double12; private transient double double13; private transient double double14; private final double double15 = 5; private volatile double double16; private volatile double double17; private volatile double double18; private volatile double double19; private volatile double double20; private volatile double double21; private volatile double double22; private volatile double double23; private static transient double double24; private static final double double25 = 5; private static volatile double double26; private transient final double double27 = 5; private transient volatile double double28; private transient volatile double double29; private transient volatile double double30; private transient volatile double double31; private transient volatile double double32; private transient volatile double double33; private static transient final double double34 = 5; private static transient volatile double double35; public double double36; public double double37; public double double38; public double double39; public double double40; public double double41; public double double42; public double double43; public static double double44; public transient double double45; public transient double double46; public transient double double47; public transient double double48; public transient double double49; public transient double double50; public final double double51 = 5; public volatile double double52; public volatile double double53; public volatile double double54; public volatile double double55; public volatile double double56; public volatile double double57; public volatile double double58; public volatile double double59; public static transient double double60; public static final double double61 = 5; public static volatile double double62; public transient final double double63 = 5; public transient volatile double double64; public transient volatile double double65; public transient volatile double double66; public transient volatile double double67; public transient volatile double double68; public transient volatile double double69; public static transient final double double70 = 5; public static transient volatile double double71; protected double double72; protected double double73; protected double double74; protected double double75; protected double double76; protected double double77; protected double double78; protected double double79; protected static double double80; protected transient double double81; protected transient double double82; protected transient double double83; protected transient double double84; protected transient double double85; protected transient double double86; protected final double double87 = 5; protected volatile double double88; protected volatile double double89; protected volatile double double90; protected volatile double double91; protected volatile double double92; protected volatile double double93; protected volatile double double94; protected volatile double double95; protected static transient double double96; protected static final double double97 = 5; protected static volatile double double98; protected transient final double double99 = 5; protected transient volatile double double100; protected transient volatile double double101; protected transient volatile double double102; protected transient volatile double double103; protected transient volatile double double104; protected transient volatile double double105; protected static transient final double double106 = 5; protected static transient volatile double double107; double double108; double double109; double double110; double double111; double double112; double double113; double double114; double double115; static double double116; transient double double117; transient double double118; transient double double119; transient double double120; transient double double121; transient double double122; final double double123 = 5; volatile double double124; volatile double double125; volatile double double126; volatile double double127; volatile double double128; volatile double double129; volatile double double130; volatile double double131; static transient double double132; static final double double133 = 5; static volatile double double134; transient final double double135 = 5; transient volatile double double136; transient volatile double double137; transient volatile double double138; transient volatile double double139; transient volatile double double140; transient volatile double double141; static transient final double double142 = 5; static transient volatile double double143; public static final boolean [] isPersistent = { true,true,true,false,true,true,true,false,false,false, false,true,true,true,false,false,true,true,true,false, true,true,true,false,false,false,false,false,false,false, true,true,true,false,false,false,true,true,true,false, true,true,true,false,false,false,false,true,true,true, false,false,true,true,true,false,true,true,true,false, false,false,false,false,false,false,true,true,true,false, false,false,true,true,true,false,true,true,true,false, false,false,false,true,true,true,false,false,true,true, true,false,true,true,true,false,false,false,false,false, false,false,true,true,true,false,false,false,true,true, true,false,true,true,true,false,false,false,false,true, true,true,false,false,true,true,true,false,true,true, true,false,false,false,false,false,false,false,true,true, true,false,false,false }; public static final boolean [] isStatic = { false,false,false,false,false,false,false,false,true,false, false,false,false,false,false,false,false,false,false,false, false,false,false,false,true,true,true,false,false,false, false,false,false,false,true,true,false,false,false,false, false,false,false,false,true,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, true,true,true,false,false,false,false,false,false,false, true,true,false,false,false,false,false,false,false,false, true,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,true,true,true,false, false,false,false,false,false,false,true,true,false,false, false,false,false,false,false,false,true,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,true,true,true,false,false,false,false,false, false,false,true,true }; public static final boolean [] isFinal = { false,false,false,false,false,false,false,false,false,false, false,false,false,false,false,true,false,false,false,false, false,false,false,false,false,true,false,true,false,false, false,false,false,false,true,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, false,true,false,false,false,false,false,false,false,false, false,true,false,true,false,false,false,false,false,false, true,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,false,true,false,false, false,false,false,false,false,false,false,true,false,true, false,false,false,false,false,false,true,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,false,true,false,false,false,false,false,false, false,false,false,true,false,true,false,false,false,false, false,false,true,false }; public static final String [] fieldSpecs = { "private double double0", "embedded= true private double double1", "embedded= false private double double2", "persistence-modifier= none private double double3", "persistence-modifier= persistent private double double4", "persistence-modifier= persistent embedded= true private double double5", "persistence-modifier= persistent embedded= false private double double6", "persistence-modifier= transactional private double double7", "private static double double8", "private transient double double9", "persistence-modifier= none private transient double double10", "persistence-modifier= persistent private transient double double11", "persistence-modifier= persistent embedded= true private transient double double12", "persistence-modifier= persistent embedded= false private transient double double13", "persistence-modifier= transactional private transient double double14", "private final double double15", "private volatile double double16", "embedded= true private volatile double double17", "embedded= false private volatile double double18", "persistence-modifier= none private volatile double double19", "persistence-modifier= persistent private volatile double double20", "persistence-modifier= persistent embedded= true private volatile double double21", "persistence-modifier= persistent embedded= false private volatile double double22", "persistence-modifier= transactional private volatile double double23", "private static transient double double24", "private static final double double25", "private static volatile double double26", "private transient final double double27", "private transient volatile double double28", "persistence-modifier= none private transient volatile double double29", "persistence-modifier= persistent private transient volatile double double30", "persistence-modifier= persistent embedded= true private transient volatile double double31", "persistence-modifier= persistent embedded= false private transient volatile double double32", "persistence-modifier= transactional private transient volatile double double33", "private static transient final double double34", "private static transient volatile double double35", "public double double36", "embedded= true public double double37", "embedded= false public double double38", "persistence-modifier= none public double double39", "persistence-modifier= persistent public double double40", "persistence-modifier= persistent embedded= true public double double41", "persistence-modifier= persistent embedded= false public double double42", "persistence-modifier= transactional public double double43", "public static double double44", "public transient double double45", "persistence-modifier= none public transient double double46", "persistence-modifier= persistent public transient double double47", "persistence-modifier= persistent embedded= true public transient double double48", "persistence-modifier= persistent embedded= false public transient double double49", "persistence-modifier= transactional public transient double double50", "public final double double51", "public volatile double double52", "embedded= true public volatile double double53", "embedded= false public volatile double double54", "persistence-modifier= none public volatile double double55", "persistence-modifier= persistent public volatile double double56", "persistence-modifier= persistent embedded= true public volatile double double57", "persistence-modifier= persistent embedded= false public volatile double double58", "persistence-modifier= transactional public volatile double double59", "public static transient double double60", "public static final double double61", "public static volatile double double62", "public transient final double double63", "public transient volatile double double64", "persistence-modifier= none public transient volatile double double65", "persistence-modifier= persistent public transient volatile double double66", "persistence-modifier= persistent embedded= true public transient volatile double double67", "persistence-modifier= persistent embedded= false public transient volatile double double68", "persistence-modifier= transactional public transient volatile double double69", "public static transient final double double70", "public static transient volatile double double71", "protected double double72", "embedded= true protected double double73", "embedded= false protected double double74", "persistence-modifier= none protected double double75", "persistence-modifier= persistent protected double double76", "persistence-modifier= persistent embedded= true protected double double77", "persistence-modifier= persistent embedded= false protected double double78", "persistence-modifier= transactional protected double double79", "protected static double double80", "protected transient double double81", "persistence-modifier= none protected transient double double82", "persistence-modifier= persistent protected transient double double83", "persistence-modifier= persistent embedded= true protected transient double double84", "persistence-modifier= persistent embedded= false protected transient double double85", "persistence-modifier= transactional protected transient double double86", "protected final double double87", "protected volatile double double88", "embedded= true protected volatile double double89", "embedded= false protected volatile double double90", "persistence-modifier= none protected volatile double double91", "persistence-modifier= persistent protected volatile double double92", "persistence-modifier= persistent embedded= true protected volatile double double93", "persistence-modifier= persistent embedded= false protected volatile double double94", "persistence-modifier= transactional protected volatile double double95", "protected static transient double double96", "protected static final double double97", "protected static volatile double double98", "protected transient final double double99", "protected transient volatile double double100", "persistence-modifier= none protected transient volatile double double101", "persistence-modifier= persistent protected transient volatile double double102", "persistence-modifier= persistent embedded= true protected transient volatile double double103", "persistence-modifier= persistent embedded= false protected transient volatile double double104", "persistence-modifier= transactional protected transient volatile double double105", "protected static transient final double double106", "protected static transient volatile double double107", "double double108", "embedded= true double double109", "embedded= false double double110", "persistence-modifier= none double double111", "persistence-modifier= persistent double double112", "persistence-modifier= persistent embedded= true double double113", "persistence-modifier= persistent embedded= false double double114", "persistence-modifier= transactional double double115", "static double double116", "transient double double117", "persistence-modifier= none transient double double118", "persistence-modifier= persistent transient double double119", "persistence-modifier= persistent embedded= true transient double double120", "persistence-modifier= persistent embedded= false transient double double121", "persistence-modifier= transactional transient double double122", "final double double123", "volatile double double124", "embedded= true volatile double double125", "embedded= false volatile double double126", "persistence-modifier= none volatile double double127", "persistence-modifier= persistent volatile double double128", "persistence-modifier= persistent embedded= true volatile double double129", "persistence-modifier= persistent embedded= false volatile double double130", "persistence-modifier= transactional volatile double double131", "static transient double double132", "static final double double133", "static volatile double double134", "transient final double double135", "transient volatile double double136", "persistence-modifier= none transient volatile double double137", "persistence-modifier= persistent transient volatile double double138", "persistence-modifier= persistent embedded= true transient volatile double double139", "persistence-modifier= persistent embedded= false transient volatile double double140", "persistence-modifier= transactional transient volatile double double141", "static transient final double double142", "static transient volatile double double143" }; public int getLength() { return fieldSpecs.length; } public double get(int index) { switch (index) { case(0): return double0; case(1): return double1; case(2): return double2; case(3): return double3; case(4): return double4; case(5): return double5; case(6): return double6; case(7): return double7; case(8): return double8; case(9): return double9; case(10): return double10; case(11): return double11; case(12): return double12; case(13): return double13; case(14): return double14; case(15): return double15; case(16): return double16; case(17): return double17; case(18): return double18; case(19): return double19; case(20): return double20; case(21): return double21; case(22): return double22; case(23): return double23; case(24): return double24; case(25): return double25; case(26): return double26; case(27): return double27; case(28): return double28; case(29): return double29; case(30): return double30; case(31): return double31; case(32): return double32; case(33): return double33; case(34): return double34; case(35): return double35; case(36): return double36; case(37): return double37; case(38): return double38; case(39): return double39; case(40): return double40; case(41): return double41; case(42): return double42; case(43): return double43; case(44): return double44; case(45): return double45; case(46): return double46; case(47): return double47; case(48): return double48; case(49): return double49; case(50): return double50; case(51): return double51; case(52): return double52; case(53): return double53; case(54): return double54; case(55): return double55; case(56): return double56; case(57): return double57; case(58): return double58; case(59): return double59; case(60): return double60; case(61): return double61; case(62): return double62; case(63): return double63; case(64): return double64; case(65): return double65; case(66): return double66; case(67): return double67; case(68): return double68; case(69): return double69; case(70): return double70; case(71): return double71; case(72): return double72; case(73): return double73; case(74): return double74; case(75): return double75; case(76): return double76; case(77): return double77; case(78): return double78; case(79): return double79; case(80): return double80; case(81): return double81; case(82): return double82; case(83): return double83; case(84): return double84; case(85): return double85; case(86): return double86; case(87): return double87; case(88): return double88; case(89): return double89; case(90): return double90; case(91): return double91; case(92): return double92; case(93): return double93; case(94): return double94; case(95): return double95; case(96): return double96; case(97): return double97; case(98): return double98; case(99): return double99; case(100): return double100; case(101): return double101; case(102): return double102; case(103): return double103; case(104): return double104; case(105): return double105; case(106): return double106; case(107): return double107; case(108): return double108; case(109): return double109; case(110): return double110; case(111): return double111; case(112): return double112; case(113): return double113; case(114): return double114; case(115): return double115; case(116): return double116; case(117): return double117; case(118): return double118; case(119): return double119; case(120): return double120; case(121): return double121; case(122): return double122; case(123): return double123; case(124): return double124; case(125): return double125; case(126): return double126; case(127): return double127; case(128): return double128; case(129): return double129; case(130): return double130; case(131): return double131; case(132): return double132; case(133): return double133; case(134): return double134; case(135): return double135; case(136): return double136; case(137): return double137; case(138): return double138; case(139): return double139; case(140): return double140; case(141): return double141; case(142): return double142; case(143): return double143; default: throw new IndexOutOfBoundsException(); } } public boolean set(int index,double value) { if(fieldSpecs[index].indexOf("final") != -1) return false; switch (index) { case(0): double0= value; break; case(1): double1= value; break; case(2): double2= value; break; case(3): double3= value; break; case(4): double4= value; break; case(5): double5= value; break; case(6): double6= value; break; case(7): double7= value; break; case(8): double8= value; break; case(9): double9= value; break; case(10): double10= value; break; case(11): double11= value; break; case(12): double12= value; break; case(13): double13= value; break; case(14): double14= value; break; case(16): double16= value; break; case(17): double17= value; break; case(18): double18= value; break; case(19): double19= value; break; case(20): double20= value; break; case(21): double21= value; break; case(22): double22= value; break; case(23): double23= value; break; case(24): double24= value; break; case(26): double26= value; break; case(28): double28= value; break; case(29): double29= value; break; case(30): double30= value; break; case(31): double31= value; break; case(32): double32= value; break; case(33): double33= value; break; case(35): double35= value; break; case(36): double36= value; break; case(37): double37= value; break; case(38): double38= value; break; case(39): double39= value; break; case(40): double40= value; break; case(41): double41= value; break; case(42): double42= value; break; case(43): double43= value; break; case(44): double44= value; break; case(45): double45= value; break; case(46): double46= value; break; case(47): double47= value; break; case(48): double48= value; break; case(49): double49= value; break; case(50): double50= value; break; case(52): double52= value; break; case(53): double53= value; break; case(54): double54= value; break; case(55): double55= value; break; case(56): double56= value; break; case(57): double57= value; break; case(58): double58= value; break; case(59): double59= value; break; case(60): double60= value; break; case(62): double62= value; break; case(64): double64= value; break; case(65): double65= value; break; case(66): double66= value; break; case(67): double67= value; break; case(68): double68= value; break; case(69): double69= value; break; case(71): double71= value; break; case(72): double72= value; break; case(73): double73= value; break; case(74): double74= value; break; case(75): double75= value; break; case(76): double76= value; break; case(77): double77= value; break; case(78): double78= value; break; case(79): double79= value; break; case(80): double80= value; break; case(81): double81= value; break; case(82): double82= value; break; case(83): double83= value; break; case(84): double84= value; break; case(85): double85= value; break; case(86): double86= value; break; case(88): double88= value; break; case(89): double89= value; break; case(90): double90= value; break; case(91): double91= value; break; case(92): double92= value; break; case(93): double93= value; break; case(94): double94= value; break; case(95): double95= value; break; case(96): double96= value; break; case(98): double98= value; break; case(100): double100= value; break; case(101): double101= value; break; case(102): double102= value; break; case(103): double103= value; break; case(104): double104= value; break; case(105): double105= value; break; case(107): double107= value; break; case(108): double108= value; break; case(109): double109= value; break; case(110): double110= value; break; case(111): double111= value; break; case(112): double112= value; break; case(113): double113= value; break; case(114): double114= value; break; case(115): double115= value; break; case(116): double116= value; break; case(117): double117= value; break; case(118): double118= value; break; case(119): double119= value; break; case(120): double120= value; break; case(121): double121= value; break; case(122): double122= value; break; case(124): double124= value; break; case(125): double125= value; break; case(126): double126= value; break; case(127): double127= value; break; case(128): double128= value; break; case(129): double129= value; break; case(130): double130= value; break; case(131): double131= value; break; case(132): double132= value; break; case(134): double134= value; break; case(136): double136= value; break; case(137): double137= value; break; case(138): double138= value; break; case(139): double139= value; break; case(140): double140= value; break; case(141): double141= value; break; case(143): double143= value; break; default: throw new IndexOutOfBoundsException(); } return true; } public static class Oid implements Serializable { public int identifier; public Oid() { } public Oid(String s) { identifier = Integer.parseInt(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + identifier;} public int hashCode() { return (int)identifier ; } public boolean equals(Object other) { if (other != null && (other instanceof Oid)) { Oid k = (Oid)other; return k.identifier == this.identifier; } return false; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } } } tck/src/java/org/apache/jdo/tck/pc/fieldtypes/FieldsOfPrimitivefloat.java100664 75534 12500110373 27012 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.io.Serializable; public class FieldsOfPrimitivefloat { public int identifier; private float float0; private float float1; private float float2; private float float3; private float float4; private float float5; private float float6; private float float7; private static float float8; private transient float float9; private transient float float10; private transient float float11; private transient float float12; private transient float float13; private transient float float14; private final float float15 = 5; private volatile float float16; private volatile float float17; private volatile float float18; private volatile float float19; private volatile float float20; private volatile float float21; private volatile float float22; private volatile float float23; private static transient float float24; private static final float float25 = 5; private static volatile float float26; private transient final float float27 = 5; private transient volatile float float28; private transient volatile float float29; private transient volatile float float30; private transient volatile float float31; private transient volatile float float32; private transient volatile float float33; private static transient final float float34 = 5; private static transient volatile float float35; public float float36; public float float37; public float float38; public float float39; public float float40; public float float41; public float float42; public float float43; public static float float44; public transient float float45; public transient float float46; public transient float float47; public transient float float48; public transient float float49; public transient float float50; public final float float51 = 5; public volatile float float52; public volatile float float53; public volatile float float54; public volatile float float55; public volatile float float56; public volatile float float57; public volatile float float58; public volatile float float59; public static transient float float60; public static final float float61 = 5; public static volatile float float62; public transient final float float63 = 5; public transient volatile float float64; public transient volatile float float65; public transient volatile float float66; public transient volatile float float67; public transient volatile float float68; public transient volatile float float69; public static transient final float float70 = 5; public static transient volatile float float71; protected float float72; protected float float73; protected float float74; protected float float75; protected float float76; protected float float77; protected float float78; protected float float79; protected static float float80; protected transient float float81; protected transient float float82; protected transient float float83; protected transient float float84; protected transient float float85; protected transient float float86; protected final float float87 = 5; protected volatile float float88; protected volatile float float89; protected volatile float float90; protected volatile float float91; protected volatile float float92; protected volatile float float93; protected volatile float float94; protected volatile float float95; protected static transient float float96; protected static final float float97 = 5; protected static volatile float float98; protected transient final float float99 = 5; protected transient volatile float float100; protected transient volatile float float101; protected transient volatile float float102; protected transient volatile float float103; protected transient volatile float float104; protected transient volatile float float105; protected static transient final float float106 = 5; protected static transient volatile float float107; float float108; float float109; float float110; float float111; float float112; float float113; float float114; float float115; static float float116; transient float float117; transient float float118; transient float float119; transient float float120; transient float float121; transient float float122; final float float123 = 5; volatile float float124; volatile float float125; volatile float float126; volatile float float127; volatile float float128; volatile float float129; volatile float float130; volatile float float131; static transient float float132; static final float float133 = 5; static volatile float float134; transient final float float135 = 5; transient volatile float float136; transient volatile float float137; transient volatile float float138; transient volatile float float139; transient volatile float float140; transient volatile float float141; static transient final float float142 = 5; static transient volatile float float143; public static final boolean [] isPersistent = { true,true,true,false,true,true,true,false,false,false, false,true,true,true,false,false,true,true,true,false, true,true,true,false,false,false,false,false,false,false, true,true,true,false,false,false,true,true,true,false, true,true,true,false,false,false,false,true,true,true, false,false,true,true,true,false,true,true,true,false, false,false,false,false,false,false,true,true,true,false, false,false,true,true,true,false,true,true,true,false, false,false,false,true,true,true,false,false,true,true, true,false,true,true,true,false,false,false,false,false, false,false,true,true,true,false,false,false,true,true, true,false,true,true,true,false,false,false,false,true, true,true,false,false,true,true,true,false,true,true, true,false,false,false,false,false,false,false,true,true, true,false,false,false }; public static final boolean [] isStatic = { false,false,false,false,false,false,false,false,true,false, false,false,false,false,false,false,false,false,false,false, false,false,false,false,true,true,true,false,false,false, false,false,false,false,true,true,false,false,false,false, false,false,false,false,true,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, true,true,true,false,false,false,false,false,false,false, true,true,false,false,false,false,false,false,false,false, true,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,true,true,true,false, false,false,false,false,false,false,true,true,false,false, false,false,false,false,false,false,true,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,true,true,true,false,false,false,false,false, false,false,true,true }; public static final boolean [] isFinal = { false,false,false,false,false,false,false,false,false,false, false,false,false,false,false,true,false,false,false,false, false,false,false,false,false,true,false,true,false,false, false,false,false,false,true,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, false,true,false,false,false,false,false,false,false,false, false,true,false,true,false,false,false,false,false,false, true,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,false,true,false,false, false,false,false,false,false,false,false,true,false,true, false,false,false,false,false,false,true,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,false,true,false,false,false,false,false,false, false,false,false,true,false,true,false,false,false,false, false,false,true,false }; public static final String [] fieldSpecs = { "private float float0", "embedded= true private float float1", "embedded= false private float float2", "persistence-modifier= none private float float3", "persistence-modifier= persistent private float float4", "persistence-modifier= persistent embedded= true private float float5", "persistence-modifier= persistent embedded= false private float float6", "persistence-modifier= transactional private float float7", "private static float float8", "private transient float float9", "persistence-modifier= none private transient float float10", "persistence-modifier= persistent private transient float float11", "persistence-modifier= persistent embedded= true private transient float float12", "persistence-modifier= persistent embedded= false private transient float float13", "persistence-modifier= transactional private transient float float14", "private final float float15", "private volatile float float16", "embedded= true private volatile float float17", "embedded= false private volatile float float18", "persistence-modifier= none private volatile float float19", "persistence-modifier= persistent private volatile float float20", "persistence-modifier= persistent embedded= true private volatile float float21", "persistence-modifier= persistent embedded= false private volatile float float22", "persistence-modifier= transactional private volatile float float23", "private static transient float float24", "private static final float float25", "private static volatile float float26", "private transient final float float27", "private transient volatile float float28", "persistence-modifier= none private transient volatile float float29", "persistence-modifier= persistent private transient volatile float float30", "persistence-modifier= persistent embedded= true private transient volatile float float31", "persistence-modifier= persistent embedded= false private transient volatile float float32", "persistence-modifier= transactional private transient volatile float float33", "private static transient final float float34", "private static transient volatile float float35", "public float float36", "embedded= true public float float37", "embedded= false public float float38", "persistence-modifier= none public float float39", "persistence-modifier= persistent public float float40", "persistence-modifier= persistent embedded= true public float float41", "persistence-modifier= persistent embedded= false public float float42", "persistence-modifier= transactional public float float43", "public static float float44", "public transient float float45", "persistence-modifier= none public transient float float46", "persistence-modifier= persistent public transient float float47", "persistence-modifier= persistent embedded= true public transient float float48", "persistence-modifier= persistent embedded= false public transient float float49", "persistence-modifier= transactional public transient float float50", "public final float float51", "public volatile float float52", "embedded= true public volatile float float53", "embedded= false public volatile float float54", "persistence-modifier= none public volatile float float55", "persistence-modifier= persistent public volatile float float56", "persistence-modifier= persistent embedded= true public volatile float float57", "persistence-modifier= persistent embedded= false public volatile float float58", "persistence-modifier= transactional public volatile float float59", "public static transient float float60", "public static final float float61", "public static volatile float float62", "public transient final float float63", "public transient volatile float float64", "persistence-modifier= none public transient volatile float float65", "persistence-modifier= persistent public transient volatile float float66", "persistence-modifier= persistent embedded= true public transient volatile float float67", "persistence-modifier= persistent embedded= false public transient volatile float float68", "persistence-modifier= transactional public transient volatile float float69", "public static transient final float float70", "public static transient volatile float float71", "protected float float72", "embedded= true protected float float73", "embedded= false protected float float74", "persistence-modifier= none protected float float75", "persistence-modifier= persistent protected float float76", "persistence-modifier= persistent embedded= true protected float float77", "persistence-modifier= persistent embedded= false protected float float78", "persistence-modifier= transactional protected float float79", "protected static float float80", "protected transient float float81", "persistence-modifier= none protected transient float float82", "persistence-modifier= persistent protected transient float float83", "persistence-modifier= persistent embedded= true protected transient float float84", "persistence-modifier= persistent embedded= false protected transient float float85", "persistence-modifier= transactional protected transient float float86", "protected final float float87", "protected volatile float float88", "embedded= true protected volatile float float89", "embedded= false protected volatile float float90", "persistence-modifier= none protected volatile float float91", "persistence-modifier= persistent protected volatile float float92", "persistence-modifier= persistent embedded= true protected volatile float float93", "persistence-modifier= persistent embedded= false protected volatile float float94", "persistence-modifier= transactional protected volatile float float95", "protected static transient float float96", "protected static final float float97", "protected static volatile float float98", "protected transient final float float99", "protected transient volatile float float100", "persistence-modifier= none protected transient volatile float float101", "persistence-modifier= persistent protected transient volatile float float102", "persistence-modifier= persistent embedded= true protected transient volatile float float103", "persistence-modifier= persistent embedded= false protected transient volatile float float104", "persistence-modifier= transactional protected transient volatile float float105", "protected static transient final float float106", "protected static transient volatile float float107", "float float108", "embedded= true float float109", "embedded= false float float110", "persistence-modifier= none float float111", "persistence-modifier= persistent float float112", "persistence-modifier= persistent embedded= true float float113", "persistence-modifier= persistent embedded= false float float114", "persistence-modifier= transactional float float115", "static float float116", "transient float float117", "persistence-modifier= none transient float float118", "persistence-modifier= persistent transient float float119", "persistence-modifier= persistent embedded= true transient float float120", "persistence-modifier= persistent embedded= false transient float float121", "persistence-modifier= transactional transient float float122", "final float float123", "volatile float float124", "embedded= true volatile float float125", "embedded= false volatile float float126", "persistence-modifier= none volatile float float127", "persistence-modifier= persistent volatile float float128", "persistence-modifier= persistent embedded= true volatile float float129", "persistence-modifier= persistent embedded= false volatile float float130", "persistence-modifier= transactional volatile float float131", "static transient float float132", "static final float float133", "static volatile float float134", "transient final float float135", "transient volatile float float136", "persistence-modifier= none transient volatile float float137", "persistence-modifier= persistent transient volatile float float138", "persistence-modifier= persistent embedded= true transient volatile float float139", "persistence-modifier= persistent embedded= false transient volatile float float140", "persistence-modifier= transactional transient volatile float float141", "static transient final float float142", "static transient volatile float float143" }; public int getLength() { return fieldSpecs.length; } public float get(int index) { switch (index) { case(0): return float0; case(1): return float1; case(2): return float2; case(3): return float3; case(4): return float4; case(5): return float5; case(6): return float6; case(7): return float7; case(8): return float8; case(9): return float9; case(10): return float10; case(11): return float11; case(12): return float12; case(13): return float13; case(14): return float14; case(15): return float15; case(16): return float16; case(17): return float17; case(18): return float18; case(19): return float19; case(20): return float20; case(21): return float21; case(22): return float22; case(23): return float23; case(24): return float24; case(25): return float25; case(26): return float26; case(27): return float27; case(28): return float28; case(29): return float29; case(30): return float30; case(31): return float31; case(32): return float32; case(33): return float33; case(34): return float34; case(35): return float35; case(36): return float36; case(37): return float37; case(38): return float38; case(39): return float39; case(40): return float40; case(41): return float41; case(42): return float42; case(43): return float43; case(44): return float44; case(45): return float45; case(46): return float46; case(47): return float47; case(48): return float48; case(49): return float49; case(50): return float50; case(51): return float51; case(52): return float52; case(53): return float53; case(54): return float54; case(55): return float55; case(56): return float56; case(57): return float57; case(58): return float58; case(59): return float59; case(60): return float60; case(61): return float61; case(62): return float62; case(63): return float63; case(64): return float64; case(65): return float65; case(66): return float66; case(67): return float67; case(68): return float68; case(69): return float69; case(70): return float70; case(71): return float71; case(72): return float72; case(73): return float73; case(74): return float74; case(75): return float75; case(76): return float76; case(77): return float77; case(78): return float78; case(79): return float79; case(80): return float80; case(81): return float81; case(82): return float82; case(83): return float83; case(84): return float84; case(85): return float85; case(86): return float86; case(87): return float87; case(88): return float88; case(89): return float89; case(90): return float90; case(91): return float91; case(92): return float92; case(93): return float93; case(94): return float94; case(95): return float95; case(96): return float96; case(97): return float97; case(98): return float98; case(99): return float99; case(100): return float100; case(101): return float101; case(102): return float102; case(103): return float103; case(104): return float104; case(105): return float105; case(106): return float106; case(107): return float107; case(108): return float108; case(109): return float109; case(110): return float110; case(111): return float111; case(112): return float112; case(113): return float113; case(114): return float114; case(115): return float115; case(116): return float116; case(117): return float117; case(118): return float118; case(119): return float119; case(120): return float120; case(121): return float121; case(122): return float122; case(123): return float123; case(124): return float124; case(125): return float125; case(126): return float126; case(127): return float127; case(128): return float128; case(129): return float129; case(130): return float130; case(131): return float131; case(132): return float132; case(133): return float133; case(134): return float134; case(135): return float135; case(136): return float136; case(137): return float137; case(138): return float138; case(139): return float139; case(140): return float140; case(141): return float141; case(142): return float142; case(143): return float143; default: throw new IndexOutOfBoundsException(); } } public boolean set(int index,float value) { if(fieldSpecs[index].indexOf("final") != -1) return false; switch (index) { case(0): float0= value; break; case(1): float1= value; break; case(2): float2= value; break; case(3): float3= value; break; case(4): float4= value; break; case(5): float5= value; break; case(6): float6= value; break; case(7): float7= value; break; case(8): float8= value; break; case(9): float9= value; break; case(10): float10= value; break; case(11): float11= value; break; case(12): float12= value; break; case(13): float13= value; break; case(14): float14= value; break; case(16): float16= value; break; case(17): float17= value; break; case(18): float18= value; break; case(19): float19= value; break; case(20): float20= value; break; case(21): float21= value; break; case(22): float22= value; break; case(23): float23= value; break; case(24): float24= value; break; case(26): float26= value; break; case(28): float28= value; break; case(29): float29= value; break; case(30): float30= value; break; case(31): float31= value; break; case(32): float32= value; break; case(33): float33= value; break; case(35): float35= value; break; case(36): float36= value; break; case(37): float37= value; break; case(38): float38= value; break; case(39): float39= value; break; case(40): float40= value; break; case(41): float41= value; break; case(42): float42= value; break; case(43): float43= value; break; case(44): float44= value; break; case(45): float45= value; break; case(46): float46= value; break; case(47): float47= value; break; case(48): float48= value; break; case(49): float49= value; break; case(50): float50= value; break; case(52): float52= value; break; case(53): float53= value; break; case(54): float54= value; break; case(55): float55= value; break; case(56): float56= value; break; case(57): float57= value; break; case(58): float58= value; break; case(59): float59= value; break; case(60): float60= value; break; case(62): float62= value; break; case(64): float64= value; break; case(65): float65= value; break; case(66): float66= value; break; case(67): float67= value; break; case(68): float68= value; break; case(69): float69= value; break; case(71): float71= value; break; case(72): float72= value; break; case(73): float73= value; break; case(74): float74= value; break; case(75): float75= value; break; case(76): float76= value; break; case(77): float77= value; break; case(78): float78= value; break; case(79): float79= value; break; case(80): float80= value; break; case(81): float81= value; break; case(82): float82= value; break; case(83): float83= value; break; case(84): float84= value; break; case(85): float85= value; break; case(86): float86= value; break; case(88): float88= value; break; case(89): float89= value; break; case(90): float90= value; break; case(91): float91= value; break; case(92): float92= value; break; case(93): float93= value; break; case(94): float94= value; break; case(95): float95= value; break; case(96): float96= value; break; case(98): float98= value; break; case(100): float100= value; break; case(101): float101= value; break; case(102): float102= value; break; case(103): float103= value; break; case(104): float104= value; break; case(105): float105= value; break; case(107): float107= value; break; case(108): float108= value; break; case(109): float109= value; break; case(110): float110= value; break; case(111): float111= value; break; case(112): float112= value; break; case(113): float113= value; break; case(114): float114= value; break; case(115): float115= value; break; case(116): float116= value; break; case(117): float117= value; break; case(118): float118= value; break; case(119): float119= value; break; case(120): float120= value; break; case(121): float121= value; break; case(122): float122= value; break; case(124): float124= value; break; case(125): float125= value; break; case(126): float126= value; break; case(127): float127= value; break; case(128): float128= value; break; case(129): float129= value; break; case(130): float130= value; break; case(131): float131= value; break; case(132): float132= value; break; case(134): float134= value; break; case(136): float136= value; break; case(137): float137= value; break; case(138): float138= value; break; case(139): float139= value; break; case(140): float140= value; break; case(141): float141= value; break; case(143): float143= value; break; default: throw new IndexOutOfBoundsException(); } return true; } public static class Oid implements Serializable { public int identifier; public Oid() { } public Oid(String s) { identifier = Integer.parseInt(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + identifier;} public int hashCode() { return (int)identifier ; } public boolean equals(Object other) { if (other != null && (other instanceof Oid)) { Oid k = (Oid)other; return k.identifier == this.identifier; } return false; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } } } tck/src/java/org/apache/jdo/tck/pc/fieldtypes/FieldsOfPrimitiveint.java100664 72266 12500110373 26476 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.io.Serializable; public class FieldsOfPrimitiveint { public int identifier; private int int0; private int int1; private int int2; private int int3; private int int4; private int int5; private int int6; private int int7; private static int int8; private transient int int9; private transient int int10; private transient int int11; private transient int int12; private transient int int13; private transient int int14; private final int int15 = 5; private volatile int int16; private volatile int int17; private volatile int int18; private volatile int int19; private volatile int int20; private volatile int int21; private volatile int int22; private volatile int int23; private static transient int int24; private static final int int25 = 5; private static volatile int int26; private transient final int int27 = 5; private transient volatile int int28; private transient volatile int int29; private transient volatile int int30; private transient volatile int int31; private transient volatile int int32; private transient volatile int int33; private static transient final int int34 = 5; private static transient volatile int int35; public int int36; public int int37; public int int38; public int int39; public int int40; public int int41; public int int42; public int int43; public static int int44; public transient int int45; public transient int int46; public transient int int47; public transient int int48; public transient int int49; public transient int int50; public final int int51 = 5; public volatile int int52; public volatile int int53; public volatile int int54; public volatile int int55; public volatile int int56; public volatile int int57; public volatile int int58; public volatile int int59; public static transient int int60; public static final int int61 = 5; public static volatile int int62; public transient final int int63 = 5; public transient volatile int int64; public transient volatile int int65; public transient volatile int int66; public transient volatile int int67; public transient volatile int int68; public transient volatile int int69; public static transient final int int70 = 5; public static transient volatile int int71; protected int int72; protected int int73; protected int int74; protected int int75; protected int int76; protected int int77; protected int int78; protected int int79; protected static int int80; protected transient int int81; protected transient int int82; protected transient int int83; protected transient int int84; protected transient int int85; protected transient int int86; protected final int int87 = 5; protected volatile int int88; protected volatile int int89; protected volatile int int90; protected volatile int int91; protected volatile int int92; protected volatile int int93; protected volatile int int94; protected volatile int int95; protected static transient int int96; protected static final int int97 = 5; protected static volatile int int98; protected transient final int int99 = 5; protected transient volatile int int100; protected transient volatile int int101; protected transient volatile int int102; protected transient volatile int int103; protected transient volatile int int104; protected transient volatile int int105; protected static transient final int int106 = 5; protected static transient volatile int int107; int int108; int int109; int int110; int int111; int int112; int int113; int int114; int int115; static int int116; transient int int117; transient int int118; transient int int119; transient int int120; transient int int121; transient int int122; final int int123 = 5; volatile int int124; volatile int int125; volatile int int126; volatile int int127; volatile int int128; volatile int int129; volatile int int130; volatile int int131; static transient int int132; static final int int133 = 5; static volatile int int134; transient final int int135 = 5; transient volatile int int136; transient volatile int int137; transient volatile int int138; transient volatile int int139; transient volatile int int140; transient volatile int int141; static transient final int int142 = 5; static transient volatile int int143; public static final boolean [] isPersistent = { true,true,true,false,true,true,true,false,false,false, false,true,true,true,false,false,true,true,true,false, true,true,true,false,false,false,false,false,false,false, true,true,true,false,false,false,true,true,true,false, true,true,true,false,false,false,false,true,true,true, false,false,true,true,true,false,true,true,true,false, false,false,false,false,false,false,true,true,true,false, false,false,true,true,true,false,true,true,true,false, false,false,false,true,true,true,false,false,true,true, true,false,true,true,true,false,false,false,false,false, false,false,true,true,true,false,false,false,true,true, true,false,true,true,true,false,false,false,false,true, true,true,false,false,true,true,true,false,true,true, true,false,false,false,false,false,false,false,true,true, true,false,false,false }; public static final boolean [] isStatic = { false,false,false,false,false,false,false,false,true,false, false,false,false,false,false,false,false,false,false,false, false,false,false,false,true,true,true,false,false,false, false,false,false,false,true,true,false,false,false,false, false,false,false,false,true,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, true,true,true,false,false,false,false,false,false,false, true,true,false,false,false,false,false,false,false,false, true,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,true,true,true,false, false,false,false,false,false,false,true,true,false,false, false,false,false,false,false,false,true,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,true,true,true,false,false,false,false,false, false,false,true,true }; public static final boolean [] isFinal = { false,false,false,false,false,false,false,false,false,false, false,false,false,false,false,true,false,false,false,false, false,false,false,false,false,true,false,true,false,false, false,false,false,false,true,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, false,true,false,false,false,false,false,false,false,false, false,true,false,true,false,false,false,false,false,false, true,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,false,true,false,false, false,false,false,false,false,false,false,true,false,true, false,false,false,false,false,false,true,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,false,true,false,false,false,false,false,false, false,false,false,true,false,true,false,false,false,false, false,false,true,false }; public static final String [] fieldSpecs = { "private int int0", "embedded= true private int int1", "embedded= false private int int2", "persistence-modifier= none private int int3", "persistence-modifier= persistent private int int4", "persistence-modifier= persistent embedded= true private int int5", "persistence-modifier= persistent embedded= false private int int6", "persistence-modifier= transactional private int int7", "private static int int8", "private transient int int9", "persistence-modifier= none private transient int int10", "persistence-modifier= persistent private transient int int11", "persistence-modifier= persistent embedded= true private transient int int12", "persistence-modifier= persistent embedded= false private transient int int13", "persistence-modifier= transactional private transient int int14", "private final int int15", "private volatile int int16", "embedded= true private volatile int int17", "embedded= false private volatile int int18", "persistence-modifier= none private volatile int int19", "persistence-modifier= persistent private volatile int int20", "persistence-modifier= persistent embedded= true private volatile int int21", "persistence-modifier= persistent embedded= false private volatile int int22", "persistence-modifier= transactional private volatile int int23", "private static transient int int24", "private static final int int25", "private static volatile int int26", "private transient final int int27", "private transient volatile int int28", "persistence-modifier= none private transient volatile int int29", "persistence-modifier= persistent private transient volatile int int30", "persistence-modifier= persistent embedded= true private transient volatile int int31", "persistence-modifier= persistent embedded= false private transient volatile int int32", "persistence-modifier= transactional private transient volatile int int33", "private static transient final int int34", "private static transient volatile int int35", "public int int36", "embedded= true public int int37", "embedded= false public int int38", "persistence-modifier= none public int int39", "persistence-modifier= persistent public int int40", "persistence-modifier= persistent embedded= true public int int41", "persistence-modifier= persistent embedded= false public int int42", "persistence-modifier= transactional public int int43", "public static int int44", "public transient int int45", "persistence-modifier= none public transient int int46", "persistence-modifier= persistent public transient int int47", "persistence-modifier= persistent embedded= true public transient int int48", "persistence-modifier= persistent embedded= false public transient int int49", "persistence-modifier= transactional public transient int int50", "public final int int51", "public volatile int int52", "embedded= true public volatile int int53", "embedded= false public volatile int int54", "persistence-modifier= none public volatile int int55", "persistence-modifier= persistent public volatile int int56", "persistence-modifier= persistent embedded= true public volatile int int57", "persistence-modifier= persistent embedded= false public volatile int int58", "persistence-modifier= transactional public volatile int int59", "public static transient int int60", "public static final int int61", "public static volatile int int62", "public transient final int int63", "public transient volatile int int64", "persistence-modifier= none public transient volatile int int65", "persistence-modifier= persistent public transient volatile int int66", "persistence-modifier= persistent embedded= true public transient volatile int int67", "persistence-modifier= persistent embedded= false public transient volatile int int68", "persistence-modifier= transactional public transient volatile int int69", "public static transient final int int70", "public static transient volatile int int71", "protected int int72", "embedded= true protected int int73", "embedded= false protected int int74", "persistence-modifier= none protected int int75", "persistence-modifier= persistent protected int int76", "persistence-modifier= persistent embedded= true protected int int77", "persistence-modifier= persistent embedded= false protected int int78", "persistence-modifier= transactional protected int int79", "protected static int int80", "protected transient int int81", "persistence-modifier= none protected transient int int82", "persistence-modifier= persistent protected transient int int83", "persistence-modifier= persistent embedded= true protected transient int int84", "persistence-modifier= persistent embedded= false protected transient int int85", "persistence-modifier= transactional protected transient int int86", "protected final int int87", "protected volatile int int88", "embedded= true protected volatile int int89", "embedded= false protected volatile int int90", "persistence-modifier= none protected volatile int int91", "persistence-modifier= persistent protected volatile int int92", "persistence-modifier= persistent embedded= true protected volatile int int93", "persistence-modifier= persistent embedded= false protected volatile int int94", "persistence-modifier= transactional protected volatile int int95", "protected static transient int int96", "protected static final int int97", "protected static volatile int int98", "protected transient final int int99", "protected transient volatile int int100", "persistence-modifier= none protected transient volatile int int101", "persistence-modifier= persistent protected transient volatile int int102", "persistence-modifier= persistent embedded= true protected transient volatile int int103", "persistence-modifier= persistent embedded= false protected transient volatile int int104", "persistence-modifier= transactional protected transient volatile int int105", "protected static transient final int int106", "protected static transient volatile int int107", "int int108", "embedded= true int int109", "embedded= false int int110", "persistence-modifier= none int int111", "persistence-modifier= persistent int int112", "persistence-modifier= persistent embedded= true int int113", "persistence-modifier= persistent embedded= false int int114", "persistence-modifier= transactional int int115", "static int int116", "transient int int117", "persistence-modifier= none transient int int118", "persistence-modifier= persistent transient int int119", "persistence-modifier= persistent embedded= true transient int int120", "persistence-modifier= persistent embedded= false transient int int121", "persistence-modifier= transactional transient int int122", "final int int123", "volatile int int124", "embedded= true volatile int int125", "embedded= false volatile int int126", "persistence-modifier= none volatile int int127", "persistence-modifier= persistent volatile int int128", "persistence-modifier= persistent embedded= true volatile int int129", "persistence-modifier= persistent embedded= false volatile int int130", "persistence-modifier= transactional volatile int int131", "static transient int int132", "static final int int133", "static volatile int int134", "transient final int int135", "transient volatile int int136", "persistence-modifier= none transient volatile int int137", "persistence-modifier= persistent transient volatile int int138", "persistence-modifier= persistent embedded= true transient volatile int int139", "persistence-modifier= persistent embedded= false transient volatile int int140", "persistence-modifier= transactional transient volatile int int141", "static transient final int int142", "static transient volatile int int143" }; public int getLength() { return fieldSpecs.length; } public int get(int index) { switch (index) { case(0): return int0; case(1): return int1; case(2): return int2; case(3): return int3; case(4): return int4; case(5): return int5; case(6): return int6; case(7): return int7; case(8): return int8; case(9): return int9; case(10): return int10; case(11): return int11; case(12): return int12; case(13): return int13; case(14): return int14; case(15): return int15; case(16): return int16; case(17): return int17; case(18): return int18; case(19): return int19; case(20): return int20; case(21): return int21; case(22): return int22; case(23): return int23; case(24): return int24; case(25): return int25; case(26): return int26; case(27): return int27; case(28): return int28; case(29): return int29; case(30): return int30; case(31): return int31; case(32): return int32; case(33): return int33; case(34): return int34; case(35): return int35; case(36): return int36; case(37): return int37; case(38): return int38; case(39): return int39; case(40): return int40; case(41): return int41; case(42): return int42; case(43): return int43; case(44): return int44; case(45): return int45; case(46): return int46; case(47): return int47; case(48): return int48; case(49): return int49; case(50): return int50; case(51): return int51; case(52): return int52; case(53): return int53; case(54): return int54; case(55): return int55; case(56): return int56; case(57): return int57; case(58): return int58; case(59): return int59; case(60): return int60; case(61): return int61; case(62): return int62; case(63): return int63; case(64): return int64; case(65): return int65; case(66): return int66; case(67): return int67; case(68): return int68; case(69): return int69; case(70): return int70; case(71): return int71; case(72): return int72; case(73): return int73; case(74): return int74; case(75): return int75; case(76): return int76; case(77): return int77; case(78): return int78; case(79): return int79; case(80): return int80; case(81): return int81; case(82): return int82; case(83): return int83; case(84): return int84; case(85): return int85; case(86): return int86; case(87): return int87; case(88): return int88; case(89): return int89; case(90): return int90; case(91): return int91; case(92): return int92; case(93): return int93; case(94): return int94; case(95): return int95; case(96): return int96; case(97): return int97; case(98): return int98; case(99): return int99; case(100): return int100; case(101): return int101; case(102): return int102; case(103): return int103; case(104): return int104; case(105): return int105; case(106): return int106; case(107): return int107; case(108): return int108; case(109): return int109; case(110): return int110; case(111): return int111; case(112): return int112; case(113): return int113; case(114): return int114; case(115): return int115; case(116): return int116; case(117): return int117; case(118): return int118; case(119): return int119; case(120): return int120; case(121): return int121; case(122): return int122; case(123): return int123; case(124): return int124; case(125): return int125; case(126): return int126; case(127): return int127; case(128): return int128; case(129): return int129; case(130): return int130; case(131): return int131; case(132): return int132; case(133): return int133; case(134): return int134; case(135): return int135; case(136): return int136; case(137): return int137; case(138): return int138; case(139): return int139; case(140): return int140; case(141): return int141; case(142): return int142; case(143): return int143; default: throw new IndexOutOfBoundsException(); } } public boolean set(int index,int value) { if(fieldSpecs[index].indexOf("final") != -1) return false; switch (index) { case(0): int0= value; break; case(1): int1= value; break; case(2): int2= value; break; case(3): int3= value; break; case(4): int4= value; break; case(5): int5= value; break; case(6): int6= value; break; case(7): int7= value; break; case(8): int8= value; break; case(9): int9= value; break; case(10): int10= value; break; case(11): int11= value; break; case(12): int12= value; break; case(13): int13= value; break; case(14): int14= value; break; case(16): int16= value; break; case(17): int17= value; break; case(18): int18= value; break; case(19): int19= value; break; case(20): int20= value; break; case(21): int21= value; break; case(22): int22= value; break; case(23): int23= value; break; case(24): int24= value; break; case(26): int26= value; break; case(28): int28= value; break; case(29): int29= value; break; case(30): int30= value; break; case(31): int31= value; break; case(32): int32= value; break; case(33): int33= value; break; case(35): int35= value; break; case(36): int36= value; break; case(37): int37= value; break; case(38): int38= value; break; case(39): int39= value; break; case(40): int40= value; break; case(41): int41= value; break; case(42): int42= value; break; case(43): int43= value; break; case(44): int44= value; break; case(45): int45= value; break; case(46): int46= value; break; case(47): int47= value; break; case(48): int48= value; break; case(49): int49= value; break; case(50): int50= value; break; case(52): int52= value; break; case(53): int53= value; break; case(54): int54= value; break; case(55): int55= value; break; case(56): int56= value; break; case(57): int57= value; break; case(58): int58= value; break; case(59): int59= value; break; case(60): int60= value; break; case(62): int62= value; break; case(64): int64= value; break; case(65): int65= value; break; case(66): int66= value; break; case(67): int67= value; break; case(68): int68= value; break; case(69): int69= value; break; case(71): int71= value; break; case(72): int72= value; break; case(73): int73= value; break; case(74): int74= value; break; case(75): int75= value; break; case(76): int76= value; break; case(77): int77= value; break; case(78): int78= value; break; case(79): int79= value; break; case(80): int80= value; break; case(81): int81= value; break; case(82): int82= value; break; case(83): int83= value; break; case(84): int84= value; break; case(85): int85= value; break; case(86): int86= value; break; case(88): int88= value; break; case(89): int89= value; break; case(90): int90= value; break; case(91): int91= value; break; case(92): int92= value; break; case(93): int93= value; break; case(94): int94= value; break; case(95): int95= value; break; case(96): int96= value; break; case(98): int98= value; break; case(100): int100= value; break; case(101): int101= value; break; case(102): int102= value; break; case(103): int103= value; break; case(104): int104= value; break; case(105): int105= value; break; case(107): int107= value; break; case(108): int108= value; break; case(109): int109= value; break; case(110): int110= value; break; case(111): int111= value; break; case(112): int112= value; break; case(113): int113= value; break; case(114): int114= value; break; case(115): int115= value; break; case(116): int116= value; break; case(117): int117= value; break; case(118): int118= value; break; case(119): int119= value; break; case(120): int120= value; break; case(121): int121= value; break; case(122): int122= value; break; case(124): int124= value; break; case(125): int125= value; break; case(126): int126= value; break; case(127): int127= value; break; case(128): int128= value; break; case(129): int129= value; break; case(130): int130= value; break; case(131): int131= value; break; case(132): int132= value; break; case(134): int134= value; break; case(136): int136= value; break; case(137): int137= value; break; case(138): int138= value; break; case(139): int139= value; break; case(140): int140= value; break; case(141): int141= value; break; case(143): int143= value; break; default: throw new IndexOutOfBoundsException(); } return true; } public static class Oid implements Serializable { public int identifier; public Oid() { } public Oid(String s) { identifier = Integer.parseInt(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + identifier;} public int hashCode() { return (int)identifier ; } public boolean equals(Object other) { if (other != null && (other instanceof Oid)) { Oid k = (Oid)other; return k.identifier == this.identifier; } return false; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } } } tck/src/java/org/apache/jdo/tck/pc/fieldtypes/FieldsOfPrimitivelong.java100664 74010 12500110373 26630 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.io.Serializable; public class FieldsOfPrimitivelong { public int identifier; private long long0; private long long1; private long long2; private long long3; private long long4; private long long5; private long long6; private long long7; private static long long8; private transient long long9; private transient long long10; private transient long long11; private transient long long12; private transient long long13; private transient long long14; private final long long15 = 5; private volatile long long16; private volatile long long17; private volatile long long18; private volatile long long19; private volatile long long20; private volatile long long21; private volatile long long22; private volatile long long23; private static transient long long24; private static final long long25 = 5; private static volatile long long26; private transient final long long27 = 5; private transient volatile long long28; private transient volatile long long29; private transient volatile long long30; private transient volatile long long31; private transient volatile long long32; private transient volatile long long33; private static transient final long long34 = 5; private static transient volatile long long35; public long long36; public long long37; public long long38; public long long39; public long long40; public long long41; public long long42; public long long43; public static long long44; public transient long long45; public transient long long46; public transient long long47; public transient long long48; public transient long long49; public transient long long50; public final long long51 = 5; public volatile long long52; public volatile long long53; public volatile long long54; public volatile long long55; public volatile long long56; public volatile long long57; public volatile long long58; public volatile long long59; public static transient long long60; public static final long long61 = 5; public static volatile long long62; public transient final long long63 = 5; public transient volatile long long64; public transient volatile long long65; public transient volatile long long66; public transient volatile long long67; public transient volatile long long68; public transient volatile long long69; public static transient final long long70 = 5; public static transient volatile long long71; protected long long72; protected long long73; protected long long74; protected long long75; protected long long76; protected long long77; protected long long78; protected long long79; protected static long long80; protected transient long long81; protected transient long long82; protected transient long long83; protected transient long long84; protected transient long long85; protected transient long long86; protected final long long87 = 5; protected volatile long long88; protected volatile long long89; protected volatile long long90; protected volatile long long91; protected volatile long long92; protected volatile long long93; protected volatile long long94; protected volatile long long95; protected static transient long long96; protected static final long long97 = 5; protected static volatile long long98; protected transient final long long99 = 5; protected transient volatile long long100; protected transient volatile long long101; protected transient volatile long long102; protected transient volatile long long103; protected transient volatile long long104; protected transient volatile long long105; protected static transient final long long106 = 5; protected static transient volatile long long107; long long108; long long109; long long110; long long111; long long112; long long113; long long114; long long115; static long long116; transient long long117; transient long long118; transient long long119; transient long long120; transient long long121; transient long long122; final long long123 = 5; volatile long long124; volatile long long125; volatile long long126; volatile long long127; volatile long long128; volatile long long129; volatile long long130; volatile long long131; static transient long long132; static final long long133 = 5; static volatile long long134; transient final long long135 = 5; transient volatile long long136; transient volatile long long137; transient volatile long long138; transient volatile long long139; transient volatile long long140; transient volatile long long141; static transient final long long142 = 5; static transient volatile long long143; public static final boolean [] isPersistent = { true,true,true,false,true,true,true,false,false,false, false,true,true,true,false,false,true,true,true,false, true,true,true,false,false,false,false,false,false,false, true,true,true,false,false,false,true,true,true,false, true,true,true,false,false,false,false,true,true,true, false,false,true,true,true,false,true,true,true,false, false,false,false,false,false,false,true,true,true,false, false,false,true,true,true,false,true,true,true,false, false,false,false,true,true,true,false,false,true,true, true,false,true,true,true,false,false,false,false,false, false,false,true,true,true,false,false,false,true,true, true,false,true,true,true,false,false,false,false,true, true,true,false,false,true,true,true,false,true,true, true,false,false,false,false,false,false,false,true,true, true,false,false,false }; public static final boolean [] isStatic = { false,false,false,false,false,false,false,false,true,false, false,false,false,false,false,false,false,false,false,false, false,false,false,false,true,true,true,false,false,false, false,false,false,false,true,true,false,false,false,false, false,false,false,false,true,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, true,true,true,false,false,false,false,false,false,false, true,true,false,false,false,false,false,false,false,false, true,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,true,true,true,false, false,false,false,false,false,false,true,true,false,false, false,false,false,false,false,false,true,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,true,true,true,false,false,false,false,false, false,false,true,true }; public static final boolean [] isFinal = { false,false,false,false,false,false,false,false,false,false, false,false,false,false,false,true,false,false,false,false, false,false,false,false,false,true,false,true,false,false, false,false,false,false,true,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, false,true,false,false,false,false,false,false,false,false, false,true,false,true,false,false,false,false,false,false, true,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,false,true,false,false, false,false,false,false,false,false,false,true,false,true, false,false,false,false,false,false,true,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,false,true,false,false,false,false,false,false, false,false,false,true,false,true,false,false,false,false, false,false,true,false }; public static final String [] fieldSpecs = { "private long long0", "embedded= true private long long1", "embedded= false private long long2", "persistence-modifier= none private long long3", "persistence-modifier= persistent private long long4", "persistence-modifier= persistent embedded= true private long long5", "persistence-modifier= persistent embedded= false private long long6", "persistence-modifier= transactional private long long7", "private static long long8", "private transient long long9", "persistence-modifier= none private transient long long10", "persistence-modifier= persistent private transient long long11", "persistence-modifier= persistent embedded= true private transient long long12", "persistence-modifier= persistent embedded= false private transient long long13", "persistence-modifier= transactional private transient long long14", "private final long long15", "private volatile long long16", "embedded= true private volatile long long17", "embedded= false private volatile long long18", "persistence-modifier= none private volatile long long19", "persistence-modifier= persistent private volatile long long20", "persistence-modifier= persistent embedded= true private volatile long long21", "persistence-modifier= persistent embedded= false private volatile long long22", "persistence-modifier= transactional private volatile long long23", "private static transient long long24", "private static final long long25", "private static volatile long long26", "private transient final long long27", "private transient volatile long long28", "persistence-modifier= none private transient volatile long long29", "persistence-modifier= persistent private transient volatile long long30", "persistence-modifier= persistent embedded= true private transient volatile long long31", "persistence-modifier= persistent embedded= false private transient volatile long long32", "persistence-modifier= transactional private transient volatile long long33", "private static transient final long long34", "private static transient volatile long long35", "public long long36", "embedded= true public long long37", "embedded= false public long long38", "persistence-modifier= none public long long39", "persistence-modifier= persistent public long long40", "persistence-modifier= persistent embedded= true public long long41", "persistence-modifier= persistent embedded= false public long long42", "persistence-modifier= transactional public long long43", "public static long long44", "public transient long long45", "persistence-modifier= none public transient long long46", "persistence-modifier= persistent public transient long long47", "persistence-modifier= persistent embedded= true public transient long long48", "persistence-modifier= persistent embedded= false public transient long long49", "persistence-modifier= transactional public transient long long50", "public final long long51", "public volatile long long52", "embedded= true public volatile long long53", "embedded= false public volatile long long54", "persistence-modifier= none public volatile long long55", "persistence-modifier= persistent public volatile long long56", "persistence-modifier= persistent embedded= true public volatile long long57", "persistence-modifier= persistent embedded= false public volatile long long58", "persistence-modifier= transactional public volatile long long59", "public static transient long long60", "public static final long long61", "public static volatile long long62", "public transient final long long63", "public transient volatile long long64", "persistence-modifier= none public transient volatile long long65", "persistence-modifier= persistent public transient volatile long long66", "persistence-modifier= persistent embedded= true public transient volatile long long67", "persistence-modifier= persistent embedded= false public transient volatile long long68", "persistence-modifier= transactional public transient volatile long long69", "public static transient final long long70", "public static transient volatile long long71", "protected long long72", "embedded= true protected long long73", "embedded= false protected long long74", "persistence-modifier= none protected long long75", "persistence-modifier= persistent protected long long76", "persistence-modifier= persistent embedded= true protected long long77", "persistence-modifier= persistent embedded= false protected long long78", "persistence-modifier= transactional protected long long79", "protected static long long80", "protected transient long long81", "persistence-modifier= none protected transient long long82", "persistence-modifier= persistent protected transient long long83", "persistence-modifier= persistent embedded= true protected transient long long84", "persistence-modifier= persistent embedded= false protected transient long long85", "persistence-modifier= transactional protected transient long long86", "protected final long long87", "protected volatile long long88", "embedded= true protected volatile long long89", "embedded= false protected volatile long long90", "persistence-modifier= none protected volatile long long91", "persistence-modifier= persistent protected volatile long long92", "persistence-modifier= persistent embedded= true protected volatile long long93", "persistence-modifier= persistent embedded= false protected volatile long long94", "persistence-modifier= transactional protected volatile long long95", "protected static transient long long96", "protected static final long long97", "protected static volatile long long98", "protected transient final long long99", "protected transient volatile long long100", "persistence-modifier= none protected transient volatile long long101", "persistence-modifier= persistent protected transient volatile long long102", "persistence-modifier= persistent embedded= true protected transient volatile long long103", "persistence-modifier= persistent embedded= false protected transient volatile long long104", "persistence-modifier= transactional protected transient volatile long long105", "protected static transient final long long106", "protected static transient volatile long long107", "long long108", "embedded= true long long109", "embedded= false long long110", "persistence-modifier= none long long111", "persistence-modifier= persistent long long112", "persistence-modifier= persistent embedded= true long long113", "persistence-modifier= persistent embedded= false long long114", "persistence-modifier= transactional long long115", "static long long116", "transient long long117", "persistence-modifier= none transient long long118", "persistence-modifier= persistent transient long long119", "persistence-modifier= persistent embedded= true transient long long120", "persistence-modifier= persistent embedded= false transient long long121", "persistence-modifier= transactional transient long long122", "final long long123", "volatile long long124", "embedded= true volatile long long125", "embedded= false volatile long long126", "persistence-modifier= none volatile long long127", "persistence-modifier= persistent volatile long long128", "persistence-modifier= persistent embedded= true volatile long long129", "persistence-modifier= persistent embedded= false volatile long long130", "persistence-modifier= transactional volatile long long131", "static transient long long132", "static final long long133", "static volatile long long134", "transient final long long135", "transient volatile long long136", "persistence-modifier= none transient volatile long long137", "persistence-modifier= persistent transient volatile long long138", "persistence-modifier= persistent embedded= true transient volatile long long139", "persistence-modifier= persistent embedded= false transient volatile long long140", "persistence-modifier= transactional transient volatile long long141", "static transient final long long142", "static transient volatile long long143" }; public int getLength() { return fieldSpecs.length; } public long get(int index) { switch (index) { case(0): return long0; case(1): return long1; case(2): return long2; case(3): return long3; case(4): return long4; case(5): return long5; case(6): return long6; case(7): return long7; case(8): return long8; case(9): return long9; case(10): return long10; case(11): return long11; case(12): return long12; case(13): return long13; case(14): return long14; case(15): return long15; case(16): return long16; case(17): return long17; case(18): return long18; case(19): return long19; case(20): return long20; case(21): return long21; case(22): return long22; case(23): return long23; case(24): return long24; case(25): return long25; case(26): return long26; case(27): return long27; case(28): return long28; case(29): return long29; case(30): return long30; case(31): return long31; case(32): return long32; case(33): return long33; case(34): return long34; case(35): return long35; case(36): return long36; case(37): return long37; case(38): return long38; case(39): return long39; case(40): return long40; case(41): return long41; case(42): return long42; case(43): return long43; case(44): return long44; case(45): return long45; case(46): return long46; case(47): return long47; case(48): return long48; case(49): return long49; case(50): return long50; case(51): return long51; case(52): return long52; case(53): return long53; case(54): return long54; case(55): return long55; case(56): return long56; case(57): return long57; case(58): return long58; case(59): return long59; case(60): return long60; case(61): return long61; case(62): return long62; case(63): return long63; case(64): return long64; case(65): return long65; case(66): return long66; case(67): return long67; case(68): return long68; case(69): return long69; case(70): return long70; case(71): return long71; case(72): return long72; case(73): return long73; case(74): return long74; case(75): return long75; case(76): return long76; case(77): return long77; case(78): return long78; case(79): return long79; case(80): return long80; case(81): return long81; case(82): return long82; case(83): return long83; case(84): return long84; case(85): return long85; case(86): return long86; case(87): return long87; case(88): return long88; case(89): return long89; case(90): return long90; case(91): return long91; case(92): return long92; case(93): return long93; case(94): return long94; case(95): return long95; case(96): return long96; case(97): return long97; case(98): return long98; case(99): return long99; case(100): return long100; case(101): return long101; case(102): return long102; case(103): return long103; case(104): return long104; case(105): return long105; case(106): return long106; case(107): return long107; case(108): return long108; case(109): return long109; case(110): return long110; case(111): return long111; case(112): return long112; case(113): return long113; case(114): return long114; case(115): return long115; case(116): return long116; case(117): return long117; case(118): return long118; case(119): return long119; case(120): return long120; case(121): return long121; case(122): return long122; case(123): return long123; case(124): return long124; case(125): return long125; case(126): return long126; case(127): return long127; case(128): return long128; case(129): return long129; case(130): return long130; case(131): return long131; case(132): return long132; case(133): return long133; case(134): return long134; case(135): return long135; case(136): return long136; case(137): return long137; case(138): return long138; case(139): return long139; case(140): return long140; case(141): return long141; case(142): return long142; case(143): return long143; default: throw new IndexOutOfBoundsException(); } } public boolean set(int index,long value) { if(fieldSpecs[index].indexOf("final") != -1) return false; switch (index) { case(0): long0= value; break; case(1): long1= value; break; case(2): long2= value; break; case(3): long3= value; break; case(4): long4= value; break; case(5): long5= value; break; case(6): long6= value; break; case(7): long7= value; break; case(8): long8= value; break; case(9): long9= value; break; case(10): long10= value; break; case(11): long11= value; break; case(12): long12= value; break; case(13): long13= value; break; case(14): long14= value; break; case(16): long16= value; break; case(17): long17= value; break; case(18): long18= value; break; case(19): long19= value; break; case(20): long20= value; break; case(21): long21= value; break; case(22): long22= value; break; case(23): long23= value; break; case(24): long24= value; break; case(26): long26= value; break; case(28): long28= value; break; case(29): long29= value; break; case(30): long30= value; break; case(31): long31= value; break; case(32): long32= value; break; case(33): long33= value; break; case(35): long35= value; break; case(36): long36= value; break; case(37): long37= value; break; case(38): long38= value; break; case(39): long39= value; break; case(40): long40= value; break; case(41): long41= value; break; case(42): long42= value; break; case(43): long43= value; break; case(44): long44= value; break; case(45): long45= value; break; case(46): long46= value; break; case(47): long47= value; break; case(48): long48= value; break; case(49): long49= value; break; case(50): long50= value; break; case(52): long52= value; break; case(53): long53= value; break; case(54): long54= value; break; case(55): long55= value; break; case(56): long56= value; break; case(57): long57= value; break; case(58): long58= value; break; case(59): long59= value; break; case(60): long60= value; break; case(62): long62= value; break; case(64): long64= value; break; case(65): long65= value; break; case(66): long66= value; break; case(67): long67= value; break; case(68): long68= value; break; case(69): long69= value; break; case(71): long71= value; break; case(72): long72= value; break; case(73): long73= value; break; case(74): long74= value; break; case(75): long75= value; break; case(76): long76= value; break; case(77): long77= value; break; case(78): long78= value; break; case(79): long79= value; break; case(80): long80= value; break; case(81): long81= value; break; case(82): long82= value; break; case(83): long83= value; break; case(84): long84= value; break; case(85): long85= value; break; case(86): long86= value; break; case(88): long88= value; break; case(89): long89= value; break; case(90): long90= value; break; case(91): long91= value; break; case(92): long92= value; break; case(93): long93= value; break; case(94): long94= value; break; case(95): long95= value; break; case(96): long96= value; break; case(98): long98= value; break; case(100): long100= value; break; case(101): long101= value; break; case(102): long102= value; break; case(103): long103= value; break; case(104): long104= value; break; case(105): long105= value; break; case(107): long107= value; break; case(108): long108= value; break; case(109): long109= value; break; case(110): long110= value; break; case(111): long111= value; break; case(112): long112= value; break; case(113): long113= value; break; case(114): long114= value; break; case(115): long115= value; break; case(116): long116= value; break; case(117): long117= value; break; case(118): long118= value; break; case(119): long119= value; break; case(120): long120= value; break; case(121): long121= value; break; case(122): long122= value; break; case(124): long124= value; break; case(125): long125= value; break; case(126): long126= value; break; case(127): long127= value; break; case(128): long128= value; break; case(129): long129= value; break; case(130): long130= value; break; case(131): long131= value; break; case(132): long132= value; break; case(134): long134= value; break; case(136): long136= value; break; case(137): long137= value; break; case(138): long138= value; break; case(139): long139= value; break; case(140): long140= value; break; case(141): long141= value; break; case(143): long143= value; break; default: throw new IndexOutOfBoundsException(); } return true; } public static class Oid implements Serializable { public int identifier; public Oid() { } public Oid(String s) { identifier = Integer.parseInt(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + identifier;} public int hashCode() { return (int)identifier ; } public boolean equals(Object other) { if (other != null && (other instanceof Oid)) { Oid k = (Oid)other; return k.identifier == this.identifier; } return false; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } } } tck/src/java/org/apache/jdo/tck/pc/fieldtypes/FieldsOfPrimitiveshort.java100664 75534 12500110373 27044 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.io.Serializable; public class FieldsOfPrimitiveshort { public int identifier; private short short0; private short short1; private short short2; private short short3; private short short4; private short short5; private short short6; private short short7; private static short short8; private transient short short9; private transient short short10; private transient short short11; private transient short short12; private transient short short13; private transient short short14; private final short short15 = 5; private volatile short short16; private volatile short short17; private volatile short short18; private volatile short short19; private volatile short short20; private volatile short short21; private volatile short short22; private volatile short short23; private static transient short short24; private static final short short25 = 5; private static volatile short short26; private transient final short short27 = 5; private transient volatile short short28; private transient volatile short short29; private transient volatile short short30; private transient volatile short short31; private transient volatile short short32; private transient volatile short short33; private static transient final short short34 = 5; private static transient volatile short short35; public short short36; public short short37; public short short38; public short short39; public short short40; public short short41; public short short42; public short short43; public static short short44; public transient short short45; public transient short short46; public transient short short47; public transient short short48; public transient short short49; public transient short short50; public final short short51 = 5; public volatile short short52; public volatile short short53; public volatile short short54; public volatile short short55; public volatile short short56; public volatile short short57; public volatile short short58; public volatile short short59; public static transient short short60; public static final short short61 = 5; public static volatile short short62; public transient final short short63 = 5; public transient volatile short short64; public transient volatile short short65; public transient volatile short short66; public transient volatile short short67; public transient volatile short short68; public transient volatile short short69; public static transient final short short70 = 5; public static transient volatile short short71; protected short short72; protected short short73; protected short short74; protected short short75; protected short short76; protected short short77; protected short short78; protected short short79; protected static short short80; protected transient short short81; protected transient short short82; protected transient short short83; protected transient short short84; protected transient short short85; protected transient short short86; protected final short short87 = 5; protected volatile short short88; protected volatile short short89; protected volatile short short90; protected volatile short short91; protected volatile short short92; protected volatile short short93; protected volatile short short94; protected volatile short short95; protected static transient short short96; protected static final short short97 = 5; protected static volatile short short98; protected transient final short short99 = 5; protected transient volatile short short100; protected transient volatile short short101; protected transient volatile short short102; protected transient volatile short short103; protected transient volatile short short104; protected transient volatile short short105; protected static transient final short short106 = 5; protected static transient volatile short short107; short short108; short short109; short short110; short short111; short short112; short short113; short short114; short short115; static short short116; transient short short117; transient short short118; transient short short119; transient short short120; transient short short121; transient short short122; final short short123 = 5; volatile short short124; volatile short short125; volatile short short126; volatile short short127; volatile short short128; volatile short short129; volatile short short130; volatile short short131; static transient short short132; static final short short133 = 5; static volatile short short134; transient final short short135 = 5; transient volatile short short136; transient volatile short short137; transient volatile short short138; transient volatile short short139; transient volatile short short140; transient volatile short short141; static transient final short short142 = 5; static transient volatile short short143; public static final boolean [] isPersistent = { true,true,true,false,true,true,true,false,false,false, false,true,true,true,false,false,true,true,true,false, true,true,true,false,false,false,false,false,false,false, true,true,true,false,false,false,true,true,true,false, true,true,true,false,false,false,false,true,true,true, false,false,true,true,true,false,true,true,true,false, false,false,false,false,false,false,true,true,true,false, false,false,true,true,true,false,true,true,true,false, false,false,false,true,true,true,false,false,true,true, true,false,true,true,true,false,false,false,false,false, false,false,true,true,true,false,false,false,true,true, true,false,true,true,true,false,false,false,false,true, true,true,false,false,true,true,true,false,true,true, true,false,false,false,false,false,false,false,true,true, true,false,false,false }; public static final boolean [] isStatic = { false,false,false,false,false,false,false,false,true,false, false,false,false,false,false,false,false,false,false,false, false,false,false,false,true,true,true,false,false,false, false,false,false,false,true,true,false,false,false,false, false,false,false,false,true,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, true,true,true,false,false,false,false,false,false,false, true,true,false,false,false,false,false,false,false,false, true,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,true,true,true,false, false,false,false,false,false,false,true,true,false,false, false,false,false,false,false,false,true,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,true,true,true,false,false,false,false,false, false,false,true,true }; public static final boolean [] isFinal = { false,false,false,false,false,false,false,false,false,false, false,false,false,false,false,true,false,false,false,false, false,false,false,false,false,true,false,true,false,false, false,false,false,false,true,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, false,true,false,false,false,false,false,false,false,false, false,true,false,true,false,false,false,false,false,false, true,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,false,true,false,false, false,false,false,false,false,false,false,true,false,true, false,false,false,false,false,false,true,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,false,true,false,false,false,false,false,false, false,false,false,true,false,true,false,false,false,false, false,false,true,false }; public static final String [] fieldSpecs = { "private short short0", "embedded= true private short short1", "embedded= false private short short2", "persistence-modifier= none private short short3", "persistence-modifier= persistent private short short4", "persistence-modifier= persistent embedded= true private short short5", "persistence-modifier= persistent embedded= false private short short6", "persistence-modifier= transactional private short short7", "private static short short8", "private transient short short9", "persistence-modifier= none private transient short short10", "persistence-modifier= persistent private transient short short11", "persistence-modifier= persistent embedded= true private transient short short12", "persistence-modifier= persistent embedded= false private transient short short13", "persistence-modifier= transactional private transient short short14", "private final short short15", "private volatile short short16", "embedded= true private volatile short short17", "embedded= false private volatile short short18", "persistence-modifier= none private volatile short short19", "persistence-modifier= persistent private volatile short short20", "persistence-modifier= persistent embedded= true private volatile short short21", "persistence-modifier= persistent embedded= false private volatile short short22", "persistence-modifier= transactional private volatile short short23", "private static transient short short24", "private static final short short25", "private static volatile short short26", "private transient final short short27", "private transient volatile short short28", "persistence-modifier= none private transient volatile short short29", "persistence-modifier= persistent private transient volatile short short30", "persistence-modifier= persistent embedded= true private transient volatile short short31", "persistence-modifier= persistent embedded= false private transient volatile short short32", "persistence-modifier= transactional private transient volatile short short33", "private static transient final short short34", "private static transient volatile short short35", "public short short36", "embedded= true public short short37", "embedded= false public short short38", "persistence-modifier= none public short short39", "persistence-modifier= persistent public short short40", "persistence-modifier= persistent embedded= true public short short41", "persistence-modifier= persistent embedded= false public short short42", "persistence-modifier= transactional public short short43", "public static short short44", "public transient short short45", "persistence-modifier= none public transient short short46", "persistence-modifier= persistent public transient short short47", "persistence-modifier= persistent embedded= true public transient short short48", "persistence-modifier= persistent embedded= false public transient short short49", "persistence-modifier= transactional public transient short short50", "public final short short51", "public volatile short short52", "embedded= true public volatile short short53", "embedded= false public volatile short short54", "persistence-modifier= none public volatile short short55", "persistence-modifier= persistent public volatile short short56", "persistence-modifier= persistent embedded= true public volatile short short57", "persistence-modifier= persistent embedded= false public volatile short short58", "persistence-modifier= transactional public volatile short short59", "public static transient short short60", "public static final short short61", "public static volatile short short62", "public transient final short short63", "public transient volatile short short64", "persistence-modifier= none public transient volatile short short65", "persistence-modifier= persistent public transient volatile short short66", "persistence-modifier= persistent embedded= true public transient volatile short short67", "persistence-modifier= persistent embedded= false public transient volatile short short68", "persistence-modifier= transactional public transient volatile short short69", "public static transient final short short70", "public static transient volatile short short71", "protected short short72", "embedded= true protected short short73", "embedded= false protected short short74", "persistence-modifier= none protected short short75", "persistence-modifier= persistent protected short short76", "persistence-modifier= persistent embedded= true protected short short77", "persistence-modifier= persistent embedded= false protected short short78", "persistence-modifier= transactional protected short short79", "protected static short short80", "protected transient short short81", "persistence-modifier= none protected transient short short82", "persistence-modifier= persistent protected transient short short83", "persistence-modifier= persistent embedded= true protected transient short short84", "persistence-modifier= persistent embedded= false protected transient short short85", "persistence-modifier= transactional protected transient short short86", "protected final short short87", "protected volatile short short88", "embedded= true protected volatile short short89", "embedded= false protected volatile short short90", "persistence-modifier= none protected volatile short short91", "persistence-modifier= persistent protected volatile short short92", "persistence-modifier= persistent embedded= true protected volatile short short93", "persistence-modifier= persistent embedded= false protected volatile short short94", "persistence-modifier= transactional protected volatile short short95", "protected static transient short short96", "protected static final short short97", "protected static volatile short short98", "protected transient final short short99", "protected transient volatile short short100", "persistence-modifier= none protected transient volatile short short101", "persistence-modifier= persistent protected transient volatile short short102", "persistence-modifier= persistent embedded= true protected transient volatile short short103", "persistence-modifier= persistent embedded= false protected transient volatile short short104", "persistence-modifier= transactional protected transient volatile short short105", "protected static transient final short short106", "protected static transient volatile short short107", "short short108", "embedded= true short short109", "embedded= false short short110", "persistence-modifier= none short short111", "persistence-modifier= persistent short short112", "persistence-modifier= persistent embedded= true short short113", "persistence-modifier= persistent embedded= false short short114", "persistence-modifier= transactional short short115", "static short short116", "transient short short117", "persistence-modifier= none transient short short118", "persistence-modifier= persistent transient short short119", "persistence-modifier= persistent embedded= true transient short short120", "persistence-modifier= persistent embedded= false transient short short121", "persistence-modifier= transactional transient short short122", "final short short123", "volatile short short124", "embedded= true volatile short short125", "embedded= false volatile short short126", "persistence-modifier= none volatile short short127", "persistence-modifier= persistent volatile short short128", "persistence-modifier= persistent embedded= true volatile short short129", "persistence-modifier= persistent embedded= false volatile short short130", "persistence-modifier= transactional volatile short short131", "static transient short short132", "static final short short133", "static volatile short short134", "transient final short short135", "transient volatile short short136", "persistence-modifier= none transient volatile short short137", "persistence-modifier= persistent transient volatile short short138", "persistence-modifier= persistent embedded= true transient volatile short short139", "persistence-modifier= persistent embedded= false transient volatile short short140", "persistence-modifier= transactional transient volatile short short141", "static transient final short short142", "static transient volatile short short143" }; public int getLength() { return fieldSpecs.length; } public short get(int index) { switch (index) { case(0): return short0; case(1): return short1; case(2): return short2; case(3): return short3; case(4): return short4; case(5): return short5; case(6): return short6; case(7): return short7; case(8): return short8; case(9): return short9; case(10): return short10; case(11): return short11; case(12): return short12; case(13): return short13; case(14): return short14; case(15): return short15; case(16): return short16; case(17): return short17; case(18): return short18; case(19): return short19; case(20): return short20; case(21): return short21; case(22): return short22; case(23): return short23; case(24): return short24; case(25): return short25; case(26): return short26; case(27): return short27; case(28): return short28; case(29): return short29; case(30): return short30; case(31): return short31; case(32): return short32; case(33): return short33; case(34): return short34; case(35): return short35; case(36): return short36; case(37): return short37; case(38): return short38; case(39): return short39; case(40): return short40; case(41): return short41; case(42): return short42; case(43): return short43; case(44): return short44; case(45): return short45; case(46): return short46; case(47): return short47; case(48): return short48; case(49): return short49; case(50): return short50; case(51): return short51; case(52): return short52; case(53): return short53; case(54): return short54; case(55): return short55; case(56): return short56; case(57): return short57; case(58): return short58; case(59): return short59; case(60): return short60; case(61): return short61; case(62): return short62; case(63): return short63; case(64): return short64; case(65): return short65; case(66): return short66; case(67): return short67; case(68): return short68; case(69): return short69; case(70): return short70; case(71): return short71; case(72): return short72; case(73): return short73; case(74): return short74; case(75): return short75; case(76): return short76; case(77): return short77; case(78): return short78; case(79): return short79; case(80): return short80; case(81): return short81; case(82): return short82; case(83): return short83; case(84): return short84; case(85): return short85; case(86): return short86; case(87): return short87; case(88): return short88; case(89): return short89; case(90): return short90; case(91): return short91; case(92): return short92; case(93): return short93; case(94): return short94; case(95): return short95; case(96): return short96; case(97): return short97; case(98): return short98; case(99): return short99; case(100): return short100; case(101): return short101; case(102): return short102; case(103): return short103; case(104): return short104; case(105): return short105; case(106): return short106; case(107): return short107; case(108): return short108; case(109): return short109; case(110): return short110; case(111): return short111; case(112): return short112; case(113): return short113; case(114): return short114; case(115): return short115; case(116): return short116; case(117): return short117; case(118): return short118; case(119): return short119; case(120): return short120; case(121): return short121; case(122): return short122; case(123): return short123; case(124): return short124; case(125): return short125; case(126): return short126; case(127): return short127; case(128): return short128; case(129): return short129; case(130): return short130; case(131): return short131; case(132): return short132; case(133): return short133; case(134): return short134; case(135): return short135; case(136): return short136; case(137): return short137; case(138): return short138; case(139): return short139; case(140): return short140; case(141): return short141; case(142): return short142; case(143): return short143; default: throw new IndexOutOfBoundsException(); } } public boolean set(int index,short value) { if(fieldSpecs[index].indexOf("final") != -1) return false; switch (index) { case(0): short0= value; break; case(1): short1= value; break; case(2): short2= value; break; case(3): short3= value; break; case(4): short4= value; break; case(5): short5= value; break; case(6): short6= value; break; case(7): short7= value; break; case(8): short8= value; break; case(9): short9= value; break; case(10): short10= value; break; case(11): short11= value; break; case(12): short12= value; break; case(13): short13= value; break; case(14): short14= value; break; case(16): short16= value; break; case(17): short17= value; break; case(18): short18= value; break; case(19): short19= value; break; case(20): short20= value; break; case(21): short21= value; break; case(22): short22= value; break; case(23): short23= value; break; case(24): short24= value; break; case(26): short26= value; break; case(28): short28= value; break; case(29): short29= value; break; case(30): short30= value; break; case(31): short31= value; break; case(32): short32= value; break; case(33): short33= value; break; case(35): short35= value; break; case(36): short36= value; break; case(37): short37= value; break; case(38): short38= value; break; case(39): short39= value; break; case(40): short40= value; break; case(41): short41= value; break; case(42): short42= value; break; case(43): short43= value; break; case(44): short44= value; break; case(45): short45= value; break; case(46): short46= value; break; case(47): short47= value; break; case(48): short48= value; break; case(49): short49= value; break; case(50): short50= value; break; case(52): short52= value; break; case(53): short53= value; break; case(54): short54= value; break; case(55): short55= value; break; case(56): short56= value; break; case(57): short57= value; break; case(58): short58= value; break; case(59): short59= value; break; case(60): short60= value; break; case(62): short62= value; break; case(64): short64= value; break; case(65): short65= value; break; case(66): short66= value; break; case(67): short67= value; break; case(68): short68= value; break; case(69): short69= value; break; case(71): short71= value; break; case(72): short72= value; break; case(73): short73= value; break; case(74): short74= value; break; case(75): short75= value; break; case(76): short76= value; break; case(77): short77= value; break; case(78): short78= value; break; case(79): short79= value; break; case(80): short80= value; break; case(81): short81= value; break; case(82): short82= value; break; case(83): short83= value; break; case(84): short84= value; break; case(85): short85= value; break; case(86): short86= value; break; case(88): short88= value; break; case(89): short89= value; break; case(90): short90= value; break; case(91): short91= value; break; case(92): short92= value; break; case(93): short93= value; break; case(94): short94= value; break; case(95): short95= value; break; case(96): short96= value; break; case(98): short98= value; break; case(100): short100= value; break; case(101): short101= value; break; case(102): short102= value; break; case(103): short103= value; break; case(104): short104= value; break; case(105): short105= value; break; case(107): short107= value; break; case(108): short108= value; break; case(109): short109= value; break; case(110): short110= value; break; case(111): short111= value; break; case(112): short112= value; break; case(113): short113= value; break; case(114): short114= value; break; case(115): short115= value; break; case(116): short116= value; break; case(117): short117= value; break; case(118): short118= value; break; case(119): short119= value; break; case(120): short120= value; break; case(121): short121= value; break; case(122): short122= value; break; case(124): short124= value; break; case(125): short125= value; break; case(126): short126= value; break; case(127): short127= value; break; case(128): short128= value; break; case(129): short129= value; break; case(130): short130= value; break; case(131): short131= value; break; case(132): short132= value; break; case(134): short134= value; break; case(136): short136= value; break; case(137): short137= value; break; case(138): short138= value; break; case(139): short139= value; break; case(140): short140= value; break; case(141): short141= value; break; case(143): short143= value; break; default: throw new IndexOutOfBoundsException(); } return true; } public static class Oid implements Serializable { public int identifier; public Oid() { } public Oid(String s) { identifier = Integer.parseInt(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + identifier;} public int hashCode() { return (int)identifier ; } public boolean equals(Object other) { if (other != null && (other instanceof Oid)) { Oid k = (Oid)other; return k.identifier == this.identifier; } return false; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } } } tck/src/java/org/apache/jdo/tck/pc/fieldtypes/FieldsOfShort.java100664 76163 12500110373 25112 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.io.Serializable; public class FieldsOfShort { public int identifier; private Short Short0; private Short Short1; private Short Short2; private Short Short3; private Short Short4; private Short Short5; private Short Short6; private Short Short7; private static Short Short8; private transient Short Short9; private transient Short Short10; private transient Short Short11; private transient Short Short12; private transient Short Short13; private transient Short Short14; private final Short Short15 = new Short((short)5); private volatile Short Short16; private volatile Short Short17; private volatile Short Short18; private volatile Short Short19; private volatile Short Short20; private volatile Short Short21; private volatile Short Short22; private volatile Short Short23; private static transient Short Short24; private static final Short Short25 = new Short((short)5); private static volatile Short Short26; private transient final Short Short27 = new Short((short)5); private transient volatile Short Short28; private transient volatile Short Short29; private transient volatile Short Short30; private transient volatile Short Short31; private transient volatile Short Short32; private transient volatile Short Short33; private static transient final Short Short34 = new Short((short)5); private static transient volatile Short Short35; public Short Short36; public Short Short37; public Short Short38; public Short Short39; public Short Short40; public Short Short41; public Short Short42; public Short Short43; public static Short Short44; public transient Short Short45; public transient Short Short46; public transient Short Short47; public transient Short Short48; public transient Short Short49; public transient Short Short50; public final Short Short51 = new Short((short)5); public volatile Short Short52; public volatile Short Short53; public volatile Short Short54; public volatile Short Short55; public volatile Short Short56; public volatile Short Short57; public volatile Short Short58; public volatile Short Short59; public static transient Short Short60; public static final Short Short61 = new Short((short)5); public static volatile Short Short62; public transient final Short Short63 = new Short((short)5); public transient volatile Short Short64; public transient volatile Short Short65; public transient volatile Short Short66; public transient volatile Short Short67; public transient volatile Short Short68; public transient volatile Short Short69; public static transient final Short Short70 = new Short((short)5); public static transient volatile Short Short71; protected Short Short72; protected Short Short73; protected Short Short74; protected Short Short75; protected Short Short76; protected Short Short77; protected Short Short78; protected Short Short79; protected static Short Short80; protected transient Short Short81; protected transient Short Short82; protected transient Short Short83; protected transient Short Short84; protected transient Short Short85; protected transient Short Short86; protected final Short Short87 = new Short((short)5); protected volatile Short Short88; protected volatile Short Short89; protected volatile Short Short90; protected volatile Short Short91; protected volatile Short Short92; protected volatile Short Short93; protected volatile Short Short94; protected volatile Short Short95; protected static transient Short Short96; protected static final Short Short97 = new Short((short)5); protected static volatile Short Short98; protected transient final Short Short99 = new Short((short)5); protected transient volatile Short Short100; protected transient volatile Short Short101; protected transient volatile Short Short102; protected transient volatile Short Short103; protected transient volatile Short Short104; protected transient volatile Short Short105; protected static transient final Short Short106 = new Short((short)5); protected static transient volatile Short Short107; Short Short108; Short Short109; Short Short110; Short Short111; Short Short112; Short Short113; Short Short114; Short Short115; static Short Short116; transient Short Short117; transient Short Short118; transient Short Short119; transient Short Short120; transient Short Short121; transient Short Short122; final Short Short123 = new Short((short)5); volatile Short Short124; volatile Short Short125; volatile Short Short126; volatile Short Short127; volatile Short Short128; volatile Short Short129; volatile Short Short130; volatile Short Short131; static transient Short Short132; static final Short Short133 = new Short((short)5); static volatile Short Short134; transient final Short Short135 = new Short((short)5); transient volatile Short Short136; transient volatile Short Short137; transient volatile Short Short138; transient volatile Short Short139; transient volatile Short Short140; transient volatile Short Short141; static transient final Short Short142 = new Short((short)5); static transient volatile Short Short143; public static final boolean [] isPersistent = { true,true,true,false,true,true,true,false,false,false, false,true,true,true,false,false,true,true,true,false, true,true,true,false,false,false,false,false,false,false, true,true,true,false,false,false,true,true,true,false, true,true,true,false,false,false,false,true,true,true, false,false,true,true,true,false,true,true,true,false, false,false,false,false,false,false,true,true,true,false, false,false,true,true,true,false,true,true,true,false, false,false,false,true,true,true,false,false,true,true, true,false,true,true,true,false,false,false,false,false, false,false,true,true,true,false,false,false,true,true, true,false,true,true,true,false,false,false,false,true, true,true,false,false,true,true,true,false,true,true, true,false,false,false,false,false,false,false,true,true, true,false,false,false }; public static final boolean [] isStatic = { false,false,false,false,false,false,false,false,true,false, false,false,false,false,false,false,false,false,false,false, false,false,false,false,true,true,true,false,false,false, false,false,false,false,true,true,false,false,false,false, false,false,false,false,true,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, true,true,true,false,false,false,false,false,false,false, true,true,false,false,false,false,false,false,false,false, true,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,true,true,true,false, false,false,false,false,false,false,true,true,false,false, false,false,false,false,false,false,true,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,true,true,true,false,false,false,false,false, false,false,true,true }; public static final boolean [] isFinal = { false,false,false,false,false,false,false,false,false,false, false,false,false,false,false,true,false,false,false,false, false,false,false,false,false,true,false,true,false,false, false,false,false,false,true,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, false,true,false,false,false,false,false,false,false,false, false,true,false,true,false,false,false,false,false,false, true,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,false,true,false,false, false,false,false,false,false,false,false,true,false,true, false,false,false,false,false,false,true,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,false,true,false,false,false,false,false,false, false,false,false,true,false,true,false,false,false,false, false,false,true,false }; public static final String [] fieldSpecs = { "private Short Short0", "embedded= true private Short Short1", "embedded= false private Short Short2", "persistence-modifier= none private Short Short3", "persistence-modifier= persistent private Short Short4", "persistence-modifier= persistent embedded= true private Short Short5", "persistence-modifier= persistent embedded= false private Short Short6", "persistence-modifier= transactional private Short Short7", "private static Short Short8", "private transient Short Short9", "persistence-modifier= none private transient Short Short10", "persistence-modifier= persistent private transient Short Short11", "persistence-modifier= persistent embedded= true private transient Short Short12", "persistence-modifier= persistent embedded= false private transient Short Short13", "persistence-modifier= transactional private transient Short Short14", "private final Short Short15", "private volatile Short Short16", "embedded= true private volatile Short Short17", "embedded= false private volatile Short Short18", "persistence-modifier= none private volatile Short Short19", "persistence-modifier= persistent private volatile Short Short20", "persistence-modifier= persistent embedded= true private volatile Short Short21", "persistence-modifier= persistent embedded= false private volatile Short Short22", "persistence-modifier= transactional private volatile Short Short23", "private static transient Short Short24", "private static final Short Short25", "private static volatile Short Short26", "private transient final Short Short27", "private transient volatile Short Short28", "persistence-modifier= none private transient volatile Short Short29", "persistence-modifier= persistent private transient volatile Short Short30", "persistence-modifier= persistent embedded= true private transient volatile Short Short31", "persistence-modifier= persistent embedded= false private transient volatile Short Short32", "persistence-modifier= transactional private transient volatile Short Short33", "private static transient final Short Short34", "private static transient volatile Short Short35", "public Short Short36", "embedded= true public Short Short37", "embedded= false public Short Short38", "persistence-modifier= none public Short Short39", "persistence-modifier= persistent public Short Short40", "persistence-modifier= persistent embedded= true public Short Short41", "persistence-modifier= persistent embedded= false public Short Short42", "persistence-modifier= transactional public Short Short43", "public static Short Short44", "public transient Short Short45", "persistence-modifier= none public transient Short Short46", "persistence-modifier= persistent public transient Short Short47", "persistence-modifier= persistent embedded= true public transient Short Short48", "persistence-modifier= persistent embedded= false public transient Short Short49", "persistence-modifier= transactional public transient Short Short50", "public final Short Short51", "public volatile Short Short52", "embedded= true public volatile Short Short53", "embedded= false public volatile Short Short54", "persistence-modifier= none public volatile Short Short55", "persistence-modifier= persistent public volatile Short Short56", "persistence-modifier= persistent embedded= true public volatile Short Short57", "persistence-modifier= persistent embedded= false public volatile Short Short58", "persistence-modifier= transactional public volatile Short Short59", "public static transient Short Short60", "public static final Short Short61", "public static volatile Short Short62", "public transient final Short Short63", "public transient volatile Short Short64", "persistence-modifier= none public transient volatile Short Short65", "persistence-modifier= persistent public transient volatile Short Short66", "persistence-modifier= persistent embedded= true public transient volatile Short Short67", "persistence-modifier= persistent embedded= false public transient volatile Short Short68", "persistence-modifier= transactional public transient volatile Short Short69", "public static transient final Short Short70", "public static transient volatile Short Short71", "protected Short Short72", "embedded= true protected Short Short73", "embedded= false protected Short Short74", "persistence-modifier= none protected Short Short75", "persistence-modifier= persistent protected Short Short76", "persistence-modifier= persistent embedded= true protected Short Short77", "persistence-modifier= persistent embedded= false protected Short Short78", "persistence-modifier= transactional protected Short Short79", "protected static Short Short80", "protected transient Short Short81", "persistence-modifier= none protected transient Short Short82", "persistence-modifier= persistent protected transient Short Short83", "persistence-modifier= persistent embedded= true protected transient Short Short84", "persistence-modifier= persistent embedded= false protected transient Short Short85", "persistence-modifier= transactional protected transient Short Short86", "protected final Short Short87", "protected volatile Short Short88", "embedded= true protected volatile Short Short89", "embedded= false protected volatile Short Short90", "persistence-modifier= none protected volatile Short Short91", "persistence-modifier= persistent protected volatile Short Short92", "persistence-modifier= persistent embedded= true protected volatile Short Short93", "persistence-modifier= persistent embedded= false protected volatile Short Short94", "persistence-modifier= transactional protected volatile Short Short95", "protected static transient Short Short96", "protected static final Short Short97", "protected static volatile Short Short98", "protected transient final Short Short99", "protected transient volatile Short Short100", "persistence-modifier= none protected transient volatile Short Short101", "persistence-modifier= persistent protected transient volatile Short Short102", "persistence-modifier= persistent embedded= true protected transient volatile Short Short103", "persistence-modifier= persistent embedded= false protected transient volatile Short Short104", "persistence-modifier= transactional protected transient volatile Short Short105", "protected static transient final Short Short106", "protected static transient volatile Short Short107", "Short Short108", "embedded= true Short Short109", "embedded= false Short Short110", "persistence-modifier= none Short Short111", "persistence-modifier= persistent Short Short112", "persistence-modifier= persistent embedded= true Short Short113", "persistence-modifier= persistent embedded= false Short Short114", "persistence-modifier= transactional Short Short115", "static Short Short116", "transient Short Short117", "persistence-modifier= none transient Short Short118", "persistence-modifier= persistent transient Short Short119", "persistence-modifier= persistent embedded= true transient Short Short120", "persistence-modifier= persistent embedded= false transient Short Short121", "persistence-modifier= transactional transient Short Short122", "final Short Short123", "volatile Short Short124", "embedded= true volatile Short Short125", "embedded= false volatile Short Short126", "persistence-modifier= none volatile Short Short127", "persistence-modifier= persistent volatile Short Short128", "persistence-modifier= persistent embedded= true volatile Short Short129", "persistence-modifier= persistent embedded= false volatile Short Short130", "persistence-modifier= transactional volatile Short Short131", "static transient Short Short132", "static final Short Short133", "static volatile Short Short134", "transient final Short Short135", "transient volatile Short Short136", "persistence-modifier= none transient volatile Short Short137", "persistence-modifier= persistent transient volatile Short Short138", "persistence-modifier= persistent embedded= true transient volatile Short Short139", "persistence-modifier= persistent embedded= false transient volatile Short Short140", "persistence-modifier= transactional transient volatile Short Short141", "static transient final Short Short142", "static transient volatile Short Short143" }; public int getLength() { return fieldSpecs.length; } public Short get(int index) { switch (index) { case(0): return Short0; case(1): return Short1; case(2): return Short2; case(3): return Short3; case(4): return Short4; case(5): return Short5; case(6): return Short6; case(7): return Short7; case(8): return Short8; case(9): return Short9; case(10): return Short10; case(11): return Short11; case(12): return Short12; case(13): return Short13; case(14): return Short14; case(15): return Short15; case(16): return Short16; case(17): return Short17; case(18): return Short18; case(19): return Short19; case(20): return Short20; case(21): return Short21; case(22): return Short22; case(23): return Short23; case(24): return Short24; case(25): return Short25; case(26): return Short26; case(27): return Short27; case(28): return Short28; case(29): return Short29; case(30): return Short30; case(31): return Short31; case(32): return Short32; case(33): return Short33; case(34): return Short34; case(35): return Short35; case(36): return Short36; case(37): return Short37; case(38): return Short38; case(39): return Short39; case(40): return Short40; case(41): return Short41; case(42): return Short42; case(43): return Short43; case(44): return Short44; case(45): return Short45; case(46): return Short46; case(47): return Short47; case(48): return Short48; case(49): return Short49; case(50): return Short50; case(51): return Short51; case(52): return Short52; case(53): return Short53; case(54): return Short54; case(55): return Short55; case(56): return Short56; case(57): return Short57; case(58): return Short58; case(59): return Short59; case(60): return Short60; case(61): return Short61; case(62): return Short62; case(63): return Short63; case(64): return Short64; case(65): return Short65; case(66): return Short66; case(67): return Short67; case(68): return Short68; case(69): return Short69; case(70): return Short70; case(71): return Short71; case(72): return Short72; case(73): return Short73; case(74): return Short74; case(75): return Short75; case(76): return Short76; case(77): return Short77; case(78): return Short78; case(79): return Short79; case(80): return Short80; case(81): return Short81; case(82): return Short82; case(83): return Short83; case(84): return Short84; case(85): return Short85; case(86): return Short86; case(87): return Short87; case(88): return Short88; case(89): return Short89; case(90): return Short90; case(91): return Short91; case(92): return Short92; case(93): return Short93; case(94): return Short94; case(95): return Short95; case(96): return Short96; case(97): return Short97; case(98): return Short98; case(99): return Short99; case(100): return Short100; case(101): return Short101; case(102): return Short102; case(103): return Short103; case(104): return Short104; case(105): return Short105; case(106): return Short106; case(107): return Short107; case(108): return Short108; case(109): return Short109; case(110): return Short110; case(111): return Short111; case(112): return Short112; case(113): return Short113; case(114): return Short114; case(115): return Short115; case(116): return Short116; case(117): return Short117; case(118): return Short118; case(119): return Short119; case(120): return Short120; case(121): return Short121; case(122): return Short122; case(123): return Short123; case(124): return Short124; case(125): return Short125; case(126): return Short126; case(127): return Short127; case(128): return Short128; case(129): return Short129; case(130): return Short130; case(131): return Short131; case(132): return Short132; case(133): return Short133; case(134): return Short134; case(135): return Short135; case(136): return Short136; case(137): return Short137; case(138): return Short138; case(139): return Short139; case(140): return Short140; case(141): return Short141; case(142): return Short142; case(143): return Short143; default: throw new IndexOutOfBoundsException(); } } public boolean set(int index,Short value) { if(fieldSpecs[index].indexOf("final") != -1) return false; switch (index) { case(0): Short0= value; break; case(1): Short1= value; break; case(2): Short2= value; break; case(3): Short3= value; break; case(4): Short4= value; break; case(5): Short5= value; break; case(6): Short6= value; break; case(7): Short7= value; break; case(8): Short8= value; break; case(9): Short9= value; break; case(10): Short10= value; break; case(11): Short11= value; break; case(12): Short12= value; break; case(13): Short13= value; break; case(14): Short14= value; break; case(16): Short16= value; break; case(17): Short17= value; break; case(18): Short18= value; break; case(19): Short19= value; break; case(20): Short20= value; break; case(21): Short21= value; break; case(22): Short22= value; break; case(23): Short23= value; break; case(24): Short24= value; break; case(26): Short26= value; break; case(28): Short28= value; break; case(29): Short29= value; break; case(30): Short30= value; break; case(31): Short31= value; break; case(32): Short32= value; break; case(33): Short33= value; break; case(35): Short35= value; break; case(36): Short36= value; break; case(37): Short37= value; break; case(38): Short38= value; break; case(39): Short39= value; break; case(40): Short40= value; break; case(41): Short41= value; break; case(42): Short42= value; break; case(43): Short43= value; break; case(44): Short44= value; break; case(45): Short45= value; break; case(46): Short46= value; break; case(47): Short47= value; break; case(48): Short48= value; break; case(49): Short49= value; break; case(50): Short50= value; break; case(52): Short52= value; break; case(53): Short53= value; break; case(54): Short54= value; break; case(55): Short55= value; break; case(56): Short56= value; break; case(57): Short57= value; break; case(58): Short58= value; break; case(59): Short59= value; break; case(60): Short60= value; break; case(62): Short62= value; break; case(64): Short64= value; break; case(65): Short65= value; break; case(66): Short66= value; break; case(67): Short67= value; break; case(68): Short68= value; break; case(69): Short69= value; break; case(71): Short71= value; break; case(72): Short72= value; break; case(73): Short73= value; break; case(74): Short74= value; break; case(75): Short75= value; break; case(76): Short76= value; break; case(77): Short77= value; break; case(78): Short78= value; break; case(79): Short79= value; break; case(80): Short80= value; break; case(81): Short81= value; break; case(82): Short82= value; break; case(83): Short83= value; break; case(84): Short84= value; break; case(85): Short85= value; break; case(86): Short86= value; break; case(88): Short88= value; break; case(89): Short89= value; break; case(90): Short90= value; break; case(91): Short91= value; break; case(92): Short92= value; break; case(93): Short93= value; break; case(94): Short94= value; break; case(95): Short95= value; break; case(96): Short96= value; break; case(98): Short98= value; break; case(100): Short100= value; break; case(101): Short101= value; break; case(102): Short102= value; break; case(103): Short103= value; break; case(104): Short104= value; break; case(105): Short105= value; break; case(107): Short107= value; break; case(108): Short108= value; break; case(109): Short109= value; break; case(110): Short110= value; break; case(111): Short111= value; break; case(112): Short112= value; break; case(113): Short113= value; break; case(114): Short114= value; break; case(115): Short115= value; break; case(116): Short116= value; break; case(117): Short117= value; break; case(118): Short118= value; break; case(119): Short119= value; break; case(120): Short120= value; break; case(121): Short121= value; break; case(122): Short122= value; break; case(124): Short124= value; break; case(125): Short125= value; break; case(126): Short126= value; break; case(127): Short127= value; break; case(128): Short128= value; break; case(129): Short129= value; break; case(130): Short130= value; break; case(131): Short131= value; break; case(132): Short132= value; break; case(134): Short134= value; break; case(136): Short136= value; break; case(137): Short137= value; break; case(138): Short138= value; break; case(139): Short139= value; break; case(140): Short140= value; break; case(141): Short141= value; break; case(143): Short143= value; break; default: throw new IndexOutOfBoundsException(); } return true; } public static class Oid implements Serializable { public int identifier; public Oid() { } public Oid(String s) { identifier = Integer.parseInt(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + identifier;} public int hashCode() { return (int)identifier ; } public boolean equals(Object other) { if (other != null && (other instanceof Oid)) { Oid k = (Oid)other; return k.identifier == this.identifier; } return false; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } } } tck/src/java/org/apache/jdo/tck/pc/fieldtypes/FieldsOfSimpleClass.java100664 124553 12500110373 26247 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.io.Serializable; public class FieldsOfSimpleClass { public int identifier; private SimpleClass SimpleClass0; private SimpleClass SimpleClass1; private SimpleClass SimpleClass2; private SimpleClass SimpleClass3; private SimpleClass SimpleClass4; private SimpleClass SimpleClass5; private SimpleClass SimpleClass6; private SimpleClass SimpleClass7; private static SimpleClass SimpleClass8; private transient SimpleClass SimpleClass9; private transient SimpleClass SimpleClass10; private transient SimpleClass SimpleClass11; private transient SimpleClass SimpleClass12; private transient SimpleClass SimpleClass13; private transient SimpleClass SimpleClass14; private final SimpleClass SimpleClass15 = new SimpleClass(); private volatile SimpleClass SimpleClass16; private volatile SimpleClass SimpleClass17; private volatile SimpleClass SimpleClass18; private volatile SimpleClass SimpleClass19; private volatile SimpleClass SimpleClass20; private volatile SimpleClass SimpleClass21; private volatile SimpleClass SimpleClass22; private volatile SimpleClass SimpleClass23; private static transient SimpleClass SimpleClass24; private static final SimpleClass SimpleClass25 = new SimpleClass(); private static volatile SimpleClass SimpleClass26; private transient final SimpleClass SimpleClass27 = new SimpleClass(); private transient volatile SimpleClass SimpleClass28; private transient volatile SimpleClass SimpleClass29; private transient volatile SimpleClass SimpleClass30; private transient volatile SimpleClass SimpleClass31; private transient volatile SimpleClass SimpleClass32; private transient volatile SimpleClass SimpleClass33; private static transient final SimpleClass SimpleClass34 = new SimpleClass(); private static transient volatile SimpleClass SimpleClass35; public SimpleClass SimpleClass36; public SimpleClass SimpleClass37; public SimpleClass SimpleClass38; public SimpleClass SimpleClass39; public SimpleClass SimpleClass40; public SimpleClass SimpleClass41; public SimpleClass SimpleClass42; public SimpleClass SimpleClass43; public static SimpleClass SimpleClass44; public transient SimpleClass SimpleClass45; public transient SimpleClass SimpleClass46; public transient SimpleClass SimpleClass47; public transient SimpleClass SimpleClass48; public transient SimpleClass SimpleClass49; public transient SimpleClass SimpleClass50; public final SimpleClass SimpleClass51 = new SimpleClass(); public volatile SimpleClass SimpleClass52; public volatile SimpleClass SimpleClass53; public volatile SimpleClass SimpleClass54; public volatile SimpleClass SimpleClass55; public volatile SimpleClass SimpleClass56; public volatile SimpleClass SimpleClass57; public volatile SimpleClass SimpleClass58; public volatile SimpleClass SimpleClass59; public static transient SimpleClass SimpleClass60; public static final SimpleClass SimpleClass61 = new SimpleClass(); public static volatile SimpleClass SimpleClass62; public transient final SimpleClass SimpleClass63 = new SimpleClass(); public transient volatile SimpleClass SimpleClass64; public transient volatile SimpleClass SimpleClass65; public transient volatile SimpleClass SimpleClass66; public transient volatile SimpleClass SimpleClass67; public transient volatile SimpleClass SimpleClass68; public transient volatile SimpleClass SimpleClass69; public static transient final SimpleClass SimpleClass70 = new SimpleClass(); public static transient volatile SimpleClass SimpleClass71; protected SimpleClass SimpleClass72; protected SimpleClass SimpleClass73; protected SimpleClass SimpleClass74; protected SimpleClass SimpleClass75; protected SimpleClass SimpleClass76; protected SimpleClass SimpleClass77; protected SimpleClass SimpleClass78; protected SimpleClass SimpleClass79; protected static SimpleClass SimpleClass80; protected transient SimpleClass SimpleClass81; protected transient SimpleClass SimpleClass82; protected transient SimpleClass SimpleClass83; protected transient SimpleClass SimpleClass84; protected transient SimpleClass SimpleClass85; protected transient SimpleClass SimpleClass86; protected final SimpleClass SimpleClass87 = new SimpleClass(); protected volatile SimpleClass SimpleClass88; protected volatile SimpleClass SimpleClass89; protected volatile SimpleClass SimpleClass90; protected volatile SimpleClass SimpleClass91; protected volatile SimpleClass SimpleClass92; protected volatile SimpleClass SimpleClass93; protected volatile SimpleClass SimpleClass94; protected volatile SimpleClass SimpleClass95; protected static transient SimpleClass SimpleClass96; protected static final SimpleClass SimpleClass97 = new SimpleClass(); protected static volatile SimpleClass SimpleClass98; protected transient final SimpleClass SimpleClass99 = new SimpleClass(); protected transient volatile SimpleClass SimpleClass100; protected transient volatile SimpleClass SimpleClass101; protected transient volatile SimpleClass SimpleClass102; protected transient volatile SimpleClass SimpleClass103; protected transient volatile SimpleClass SimpleClass104; protected transient volatile SimpleClass SimpleClass105; protected static transient final SimpleClass SimpleClass106 = new SimpleClass(); protected static transient volatile SimpleClass SimpleClass107; SimpleClass SimpleClass108; SimpleClass SimpleClass109; SimpleClass SimpleClass110; SimpleClass SimpleClass111; SimpleClass SimpleClass112; SimpleClass SimpleClass113; SimpleClass SimpleClass114; SimpleClass SimpleClass115; static SimpleClass SimpleClass116; transient SimpleClass SimpleClass117; transient SimpleClass SimpleClass118; transient SimpleClass SimpleClass119; transient SimpleClass SimpleClass120; transient SimpleClass SimpleClass121; transient SimpleClass SimpleClass122; final SimpleClass SimpleClass123 = new SimpleClass(); volatile SimpleClass SimpleClass124; volatile SimpleClass SimpleClass125; volatile SimpleClass SimpleClass126; volatile SimpleClass SimpleClass127; volatile SimpleClass SimpleClass128; volatile SimpleClass SimpleClass129; volatile SimpleClass SimpleClass130; volatile SimpleClass SimpleClass131; static transient SimpleClass SimpleClass132; static final SimpleClass SimpleClass133 = new SimpleClass(); static volatile SimpleClass SimpleClass134; transient final SimpleClass SimpleClass135 = new SimpleClass(); transient volatile SimpleClass SimpleClass136; transient volatile SimpleClass SimpleClass137; transient volatile SimpleClass SimpleClass138; transient volatile SimpleClass SimpleClass139; transient volatile SimpleClass SimpleClass140; transient volatile SimpleClass SimpleClass141; static transient final SimpleClass SimpleClass142 = new SimpleClass(); static transient volatile SimpleClass SimpleClass143; private SimpleClass SimpleClass144; private SimpleClass SimpleClass145; private transient SimpleClass SimpleClass146; private volatile SimpleClass SimpleClass147; private volatile SimpleClass SimpleClass148; private transient volatile SimpleClass SimpleClass149; public SimpleClass SimpleClass150; public SimpleClass SimpleClass151; public transient SimpleClass SimpleClass152; public volatile SimpleClass SimpleClass153; public volatile SimpleClass SimpleClass154; public transient volatile SimpleClass SimpleClass155; protected SimpleClass SimpleClass156; protected SimpleClass SimpleClass157; protected transient SimpleClass SimpleClass158; protected volatile SimpleClass SimpleClass159; protected volatile SimpleClass SimpleClass160; protected transient volatile SimpleClass SimpleClass161; SimpleClass SimpleClass162; SimpleClass SimpleClass163; transient SimpleClass SimpleClass164; volatile SimpleClass SimpleClass165; volatile SimpleClass SimpleClass166; transient volatile SimpleClass SimpleClass167; public static final boolean [] isPersistent = { false, true, true, false, true, true, true, false, false, false, false, true, true, true, false, false, true, true, true, false, true, true, true, false, false, false, false, false, false, false, true, true, true, false, false, false, false, true, true, false, true, true, true, false, false, false, false, true, true, true, false, false, true, true, true, false, true, true, true, false, false, false, false, false, false, false, true, true, true, false, false, false, false, true, true, false, true, true, true, false, false, false, false, true, true, true, false, false, true, true, true, false, true, true, true, false, false, false, false, false, false, false, true, true, true, false, false, false, false, true, true, false, true, true, true, false, false, false, false, true, true, true, false, false, true, true, true, false, true, true, true, false, false, false, false, false, false, false, true, true, true, false, false, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true }; public static final boolean [] isStatic = { false,false,false,false,false,false,false,false,true,false, false,false,false,false,false,false,false,false,false,false, false,false,false,false,true,true,true,false,false,false, false,false,false,false,true,true,false,false,false,false, false,false,false,false,true,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, true,true,true,false,false,false,false,false,false,false, true,true,false,false,false,false,false,false,false,false, true,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,true,true,true,false, false,false,false,false,false,false,true,true,false,false, false,false,false,false,false,false,true,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,true,true,true,false,false,false,false,false, false,false,true,true,false,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,false,false }; public static final boolean [] isFinal = { false,false,false,false,false,false,false,false,false,false, false,false,false,false,false,true,false,false,false,false, false,false,false,false,false,true,false,true,false,false, false,false,false,false,true,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, false,true,false,false,false,false,false,false,false,false, false,true,false,true,false,false,false,false,false,false, true,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,false,true,false,false, false,false,false,false,false,false,false,true,false,true, false,false,false,false,false,false,true,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,false,true,false,false,false,false,false,false, false,false,false,true,false,true,false,false,false,false, false,false,true,false,false,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,false,false }; public static final String [] fieldSpecs = { "private SimpleClass SimpleClass0", "embedded= true private SimpleClass SimpleClass1", "embedded= false private SimpleClass SimpleClass2", "persistence-modifier= none private SimpleClass SimpleClass3", "persistence-modifier= persistent private SimpleClass SimpleClass4", "persistence-modifier= persistent embedded= true private SimpleClass SimpleClass5", "persistence-modifier= persistent embedded= false private SimpleClass SimpleClass6", "persistence-modifier= transactional private SimpleClass SimpleClass7", "private static SimpleClass SimpleClass8", "private transient SimpleClass SimpleClass9", "persistence-modifier= none private transient SimpleClass SimpleClass10", "persistence-modifier= persistent private transient SimpleClass SimpleClass11", "persistence-modifier= persistent embedded= true private transient SimpleClass SimpleClass12", "persistence-modifier= persistent embedded= false private transient SimpleClass SimpleClass13", "persistence-modifier= transactional private transient SimpleClass SimpleClass14", "private final SimpleClass SimpleClass15", "private volatile SimpleClass SimpleClass16", "embedded= true private volatile SimpleClass SimpleClass17", "embedded= false private volatile SimpleClass SimpleClass18", "persistence-modifier= none private volatile SimpleClass SimpleClass19", "persistence-modifier= persistent private volatile SimpleClass SimpleClass20", "persistence-modifier= persistent embedded= true private volatile SimpleClass SimpleClass21", "persistence-modifier= persistent embedded= false private volatile SimpleClass SimpleClass22", "persistence-modifier= transactional private volatile SimpleClass SimpleClass23", "private static transient SimpleClass SimpleClass24", "private static final SimpleClass SimpleClass25", "private static volatile SimpleClass SimpleClass26", "private transient final SimpleClass SimpleClass27", "private transient volatile SimpleClass SimpleClass28", "persistence-modifier= none private transient volatile SimpleClass SimpleClass29", "persistence-modifier= persistent private transient volatile SimpleClass SimpleClass30", "persistence-modifier= persistent embedded= true private transient volatile SimpleClass SimpleClass31", "persistence-modifier= persistent embedded= false private transient volatile SimpleClass SimpleClass32", "persistence-modifier= transactional private transient volatile SimpleClass SimpleClass33", "private static transient final SimpleClass SimpleClass34", "private static transient volatile SimpleClass SimpleClass35", "public SimpleClass SimpleClass36", "embedded= true public SimpleClass SimpleClass37", "embedded= false public SimpleClass SimpleClass38", "persistence-modifier= none public SimpleClass SimpleClass39", "persistence-modifier= persistent public SimpleClass SimpleClass40", "persistence-modifier= persistent embedded= true public SimpleClass SimpleClass41", "persistence-modifier= persistent embedded= false public SimpleClass SimpleClass42", "persistence-modifier= transactional public SimpleClass SimpleClass43", "public static SimpleClass SimpleClass44", "public transient SimpleClass SimpleClass45", "persistence-modifier= none public transient SimpleClass SimpleClass46", "persistence-modifier= persistent public transient SimpleClass SimpleClass47", "persistence-modifier= persistent embedded= true public transient SimpleClass SimpleClass48", "persistence-modifier= persistent embedded= false public transient SimpleClass SimpleClass49", "persistence-modifier= transactional public transient SimpleClass SimpleClass50", "public final SimpleClass SimpleClass51", "public volatile SimpleClass SimpleClass52", "embedded= true public volatile SimpleClass SimpleClass53", "embedded= false public volatile SimpleClass SimpleClass54", "persistence-modifier= none public volatile SimpleClass SimpleClass55", "persistence-modifier= persistent public volatile SimpleClass SimpleClass56", "persistence-modifier= persistent embedded= true public volatile SimpleClass SimpleClass57", "persistence-modifier= persistent embedded= false public volatile SimpleClass SimpleClass58", "persistence-modifier= transactional public volatile SimpleClass SimpleClass59", "public static transient SimpleClass SimpleClass60", "public static final SimpleClass SimpleClass61", "public static volatile SimpleClass SimpleClass62", "public transient final SimpleClass SimpleClass63", "public transient volatile SimpleClass SimpleClass64", "persistence-modifier= none public transient volatile SimpleClass SimpleClass65", "persistence-modifier= persistent public transient volatile SimpleClass SimpleClass66", "persistence-modifier= persistent embedded= true public transient volatile SimpleClass SimpleClass67", "persistence-modifier= persistent embedded= false public transient volatile SimpleClass SimpleClass68", "persistence-modifier= transactional public transient volatile SimpleClass SimpleClass69", "public static transient final SimpleClass SimpleClass70", "public static transient volatile SimpleClass SimpleClass71", "protected SimpleClass SimpleClass72", "embedded= true protected SimpleClass SimpleClass73", "embedded= false protected SimpleClass SimpleClass74", "persistence-modifier= none protected SimpleClass SimpleClass75", "persistence-modifier= persistent protected SimpleClass SimpleClass76", "persistence-modifier= persistent embedded= true protected SimpleClass SimpleClass77", "persistence-modifier= persistent embedded= false protected SimpleClass SimpleClass78", "persistence-modifier= transactional protected SimpleClass SimpleClass79", "protected static SimpleClass SimpleClass80", "protected transient SimpleClass SimpleClass81", "persistence-modifier= none protected transient SimpleClass SimpleClass82", "persistence-modifier= persistent protected transient SimpleClass SimpleClass83", "persistence-modifier= persistent embedded= true protected transient SimpleClass SimpleClass84", "persistence-modifier= persistent embedded= false protected transient SimpleClass SimpleClass85", "persistence-modifier= transactional protected transient SimpleClass SimpleClass86", "protected final SimpleClass SimpleClass87", "protected volatile SimpleClass SimpleClass88", "embedded= true protected volatile SimpleClass SimpleClass89", "embedded= false protected volatile SimpleClass SimpleClass90", "persistence-modifier= none protected volatile SimpleClass SimpleClass91", "persistence-modifier= persistent protected volatile SimpleClass SimpleClass92", "persistence-modifier= persistent embedded= true protected volatile SimpleClass SimpleClass93", "persistence-modifier= persistent embedded= false protected volatile SimpleClass SimpleClass94", "persistence-modifier= transactional protected volatile SimpleClass SimpleClass95", "protected static transient SimpleClass SimpleClass96", "protected static final SimpleClass SimpleClass97", "protected static volatile SimpleClass SimpleClass98", "protected transient final SimpleClass SimpleClass99", "protected transient volatile SimpleClass SimpleClass100", "persistence-modifier= none protected transient volatile SimpleClass SimpleClass101", "persistence-modifier= persistent protected transient volatile SimpleClass SimpleClass102", "persistence-modifier= persistent embedded= true protected transient volatile SimpleClass SimpleClass103", "persistence-modifier= persistent embedded= false protected transient volatile SimpleClass SimpleClass104", "persistence-modifier= transactional protected transient volatile SimpleClass SimpleClass105", "protected static transient final SimpleClass SimpleClass106", "protected static transient volatile SimpleClass SimpleClass107", "SimpleClass SimpleClass108", "embedded= true SimpleClass SimpleClass109", "embedded= false SimpleClass SimpleClass110", "persistence-modifier= none SimpleClass SimpleClass111", "persistence-modifier= persistent SimpleClass SimpleClass112", "persistence-modifier= persistent embedded= true SimpleClass SimpleClass113", "persistence-modifier= persistent embedded= false SimpleClass SimpleClass114", "persistence-modifier= transactional SimpleClass SimpleClass115", "static SimpleClass SimpleClass116", "transient SimpleClass SimpleClass117", "persistence-modifier= none transient SimpleClass SimpleClass118", "persistence-modifier= persistent transient SimpleClass SimpleClass119", "persistence-modifier= persistent embedded= true transient SimpleClass SimpleClass120", "persistence-modifier= persistent embedded= false transient SimpleClass SimpleClass121", "persistence-modifier= transactional transient SimpleClass SimpleClass122", "final SimpleClass SimpleClass123", "volatile SimpleClass SimpleClass124", "embedded= true volatile SimpleClass SimpleClass125", "embedded= false volatile SimpleClass SimpleClass126", "persistence-modifier= none volatile SimpleClass SimpleClass127", "persistence-modifier= persistent volatile SimpleClass SimpleClass128", "persistence-modifier= persistent embedded= true volatile SimpleClass SimpleClass129", "persistence-modifier= persistent embedded= false volatile SimpleClass SimpleClass130", "persistence-modifier= transactional volatile SimpleClass SimpleClass131", "static transient SimpleClass SimpleClass132", "static final SimpleClass SimpleClass133", "static volatile SimpleClass SimpleClass134", "transient final SimpleClass SimpleClass135", "transient volatile SimpleClass SimpleClass136", "persistence-modifier= none transient volatile SimpleClass SimpleClass137", "persistence-modifier= persistent transient volatile SimpleClass SimpleClass138", "persistence-modifier= persistent embedded= true transient volatile SimpleClass SimpleClass139", "persistence-modifier= persistent embedded= false transient volatile SimpleClass SimpleClass140", "persistence-modifier= transactional transient volatile SimpleClass SimpleClass141", "static transient final SimpleClass SimpleClass142", "static transient volatile SimpleClass SimpleClass143", "serialized= true private SimpleClass SimpleClass144", "persistence-modifier= persistent serialized= true private SimpleClass SimpleClass145", "persistence-modifier= persistent serialized= true private transient SimpleClass SimpleClass146", "serialized= true private volatile SimpleClass SimpleClass147", "persistence-modifier= persistent serialized= true private volatile SimpleClass SimpleClass148", "persistence-modifier= persistent serialized= true private transient volatile SimpleClass SimpleClass149", "serialized= true public SimpleClass SimpleClass150", "persistence-modifier= persistent serialized= true public SimpleClass SimpleClass151", "persistence-modifier= persistent serialized= true public transient SimpleClass SimpleClass152", "serialized= true public volatile SimpleClass SimpleClass153", "persistence-modifier= persistent serialized= true public volatile SimpleClass SimpleClass154", "persistence-modifier= persistent serialized= true public transient volatile SimpleClass SimpleClass155", "serialized= true protected SimpleClass SimpleClass156", "persistence-modifier= persistent serialized= true protected SimpleClass SimpleClass157", "persistence-modifier= persistent serialized= true protected transient SimpleClass SimpleClass158", "serialized= true protected volatile SimpleClass SimpleClass159", "persistence-modifier= persistent serialized= true protected volatile SimpleClass SimpleClass160", "persistence-modifier= persistent serialized= true protected transient volatile SimpleClass SimpleClass161", "serialized= true SimpleClass SimpleClass162", "persistence-modifier= persistent serialized= true SimpleClass SimpleClass163", "persistence-modifier= persistent serialized= true transient SimpleClass SimpleClass164", "serialized= true volatile SimpleClass SimpleClass165", "persistence-modifier= persistent serialized= true volatile SimpleClass SimpleClass166", "persistence-modifier= persistent serialized= true transient volatile SimpleClass SimpleClass167" }; public int getLength() { return fieldSpecs.length; } public SimpleClass get(int index) { switch (index) { case(0): return SimpleClass0; case(1): return SimpleClass1; case(2): return SimpleClass2; case(3): return SimpleClass3; case(4): return SimpleClass4; case(5): return SimpleClass5; case(6): return SimpleClass6; case(7): return SimpleClass7; case(8): return SimpleClass8; case(9): return SimpleClass9; case(10): return SimpleClass10; case(11): return SimpleClass11; case(12): return SimpleClass12; case(13): return SimpleClass13; case(14): return SimpleClass14; case(15): return SimpleClass15; case(16): return SimpleClass16; case(17): return SimpleClass17; case(18): return SimpleClass18; case(19): return SimpleClass19; case(20): return SimpleClass20; case(21): return SimpleClass21; case(22): return SimpleClass22; case(23): return SimpleClass23; case(24): return SimpleClass24; case(25): return SimpleClass25; case(26): return SimpleClass26; case(27): return SimpleClass27; case(28): return SimpleClass28; case(29): return SimpleClass29; case(30): return SimpleClass30; case(31): return SimpleClass31; case(32): return SimpleClass32; case(33): return SimpleClass33; case(34): return SimpleClass34; case(35): return SimpleClass35; case(36): return SimpleClass36; case(37): return SimpleClass37; case(38): return SimpleClass38; case(39): return SimpleClass39; case(40): return SimpleClass40; case(41): return SimpleClass41; case(42): return SimpleClass42; case(43): return SimpleClass43; case(44): return SimpleClass44; case(45): return SimpleClass45; case(46): return SimpleClass46; case(47): return SimpleClass47; case(48): return SimpleClass48; case(49): return SimpleClass49; case(50): return SimpleClass50; case(51): return SimpleClass51; case(52): return SimpleClass52; case(53): return SimpleClass53; case(54): return SimpleClass54; case(55): return SimpleClass55; case(56): return SimpleClass56; case(57): return SimpleClass57; case(58): return SimpleClass58; case(59): return SimpleClass59; case(60): return SimpleClass60; case(61): return SimpleClass61; case(62): return SimpleClass62; case(63): return SimpleClass63; case(64): return SimpleClass64; case(65): return SimpleClass65; case(66): return SimpleClass66; case(67): return SimpleClass67; case(68): return SimpleClass68; case(69): return SimpleClass69; case(70): return SimpleClass70; case(71): return SimpleClass71; case(72): return SimpleClass72; case(73): return SimpleClass73; case(74): return SimpleClass74; case(75): return SimpleClass75; case(76): return SimpleClass76; case(77): return SimpleClass77; case(78): return SimpleClass78; case(79): return SimpleClass79; case(80): return SimpleClass80; case(81): return SimpleClass81; case(82): return SimpleClass82; case(83): return SimpleClass83; case(84): return SimpleClass84; case(85): return SimpleClass85; case(86): return SimpleClass86; case(87): return SimpleClass87; case(88): return SimpleClass88; case(89): return SimpleClass89; case(90): return SimpleClass90; case(91): return SimpleClass91; case(92): return SimpleClass92; case(93): return SimpleClass93; case(94): return SimpleClass94; case(95): return SimpleClass95; case(96): return SimpleClass96; case(97): return SimpleClass97; case(98): return SimpleClass98; case(99): return SimpleClass99; case(100): return SimpleClass100; case(101): return SimpleClass101; case(102): return SimpleClass102; case(103): return SimpleClass103; case(104): return SimpleClass104; case(105): return SimpleClass105; case(106): return SimpleClass106; case(107): return SimpleClass107; case(108): return SimpleClass108; case(109): return SimpleClass109; case(110): return SimpleClass110; case(111): return SimpleClass111; case(112): return SimpleClass112; case(113): return SimpleClass113; case(114): return SimpleClass114; case(115): return SimpleClass115; case(116): return SimpleClass116; case(117): return SimpleClass117; case(118): return SimpleClass118; case(119): return SimpleClass119; case(120): return SimpleClass120; case(121): return SimpleClass121; case(122): return SimpleClass122; case(123): return SimpleClass123; case(124): return SimpleClass124; case(125): return SimpleClass125; case(126): return SimpleClass126; case(127): return SimpleClass127; case(128): return SimpleClass128; case(129): return SimpleClass129; case(130): return SimpleClass130; case(131): return SimpleClass131; case(132): return SimpleClass132; case(133): return SimpleClass133; case(134): return SimpleClass134; case(135): return SimpleClass135; case(136): return SimpleClass136; case(137): return SimpleClass137; case(138): return SimpleClass138; case(139): return SimpleClass139; case(140): return SimpleClass140; case(141): return SimpleClass141; case(142): return SimpleClass142; case(143): return SimpleClass143; case(144): return SimpleClass144; case(145): return SimpleClass145; case(146): return SimpleClass146; case(147): return SimpleClass147; case(148): return SimpleClass148; case(149): return SimpleClass149; case(150): return SimpleClass150; case(151): return SimpleClass151; case(152): return SimpleClass152; case(153): return SimpleClass153; case(154): return SimpleClass154; case(155): return SimpleClass155; case(156): return SimpleClass156; case(157): return SimpleClass157; case(158): return SimpleClass158; case(159): return SimpleClass159; case(160): return SimpleClass160; case(161): return SimpleClass161; case(162): return SimpleClass162; case(163): return SimpleClass163; case(164): return SimpleClass164; case(165): return SimpleClass165; case(166): return SimpleClass166; case(167): return SimpleClass167; default: throw new IndexOutOfBoundsException(); } } public boolean set(int index,SimpleClass value) { if(fieldSpecs[index].indexOf("final") != -1) return false; switch (index) { case(0): SimpleClass0= value; break; case(1): SimpleClass1= value; break; case(2): SimpleClass2= value; break; case(3): SimpleClass3= value; break; case(4): SimpleClass4= value; break; case(5): SimpleClass5= value; break; case(6): SimpleClass6= value; break; case(7): SimpleClass7= value; break; case(8): SimpleClass8= value; break; case(9): SimpleClass9= value; break; case(10): SimpleClass10= value; break; case(11): SimpleClass11= value; break; case(12): SimpleClass12= value; break; case(13): SimpleClass13= value; break; case(14): SimpleClass14= value; break; case(16): SimpleClass16= value; break; case(17): SimpleClass17= value; break; case(18): SimpleClass18= value; break; case(19): SimpleClass19= value; break; case(20): SimpleClass20= value; break; case(21): SimpleClass21= value; break; case(22): SimpleClass22= value; break; case(23): SimpleClass23= value; break; case(24): SimpleClass24= value; break; case(26): SimpleClass26= value; break; case(28): SimpleClass28= value; break; case(29): SimpleClass29= value; break; case(30): SimpleClass30= value; break; case(31): SimpleClass31= value; break; case(32): SimpleClass32= value; break; case(33): SimpleClass33= value; break; case(35): SimpleClass35= value; break; case(36): SimpleClass36= value; break; case(37): SimpleClass37= value; break; case(38): SimpleClass38= value; break; case(39): SimpleClass39= value; break; case(40): SimpleClass40= value; break; case(41): SimpleClass41= value; break; case(42): SimpleClass42= value; break; case(43): SimpleClass43= value; break; case(44): SimpleClass44= value; break; case(45): SimpleClass45= value; break; case(46): SimpleClass46= value; break; case(47): SimpleClass47= value; break; case(48): SimpleClass48= value; break; case(49): SimpleClass49= value; break; case(50): SimpleClass50= value; break; case(52): SimpleClass52= value; break; case(53): SimpleClass53= value; break; case(54): SimpleClass54= value; break; case(55): SimpleClass55= value; break; case(56): SimpleClass56= value; break; case(57): SimpleClass57= value; break; case(58): SimpleClass58= value; break; case(59): SimpleClass59= value; break; case(60): SimpleClass60= value; break; case(62): SimpleClass62= value; break; case(64): SimpleClass64= value; break; case(65): SimpleClass65= value; break; case(66): SimpleClass66= value; break; case(67): SimpleClass67= value; break; case(68): SimpleClass68= value; break; case(69): SimpleClass69= value; break; case(71): SimpleClass71= value; break; case(72): SimpleClass72= value; break; case(73): SimpleClass73= value; break; case(74): SimpleClass74= value; break; case(75): SimpleClass75= value; break; case(76): SimpleClass76= value; break; case(77): SimpleClass77= value; break; case(78): SimpleClass78= value; break; case(79): SimpleClass79= value; break; case(80): SimpleClass80= value; break; case(81): SimpleClass81= value; break; case(82): SimpleClass82= value; break; case(83): SimpleClass83= value; break; case(84): SimpleClass84= value; break; case(85): SimpleClass85= value; break; case(86): SimpleClass86= value; break; case(88): SimpleClass88= value; break; case(89): SimpleClass89= value; break; case(90): SimpleClass90= value; break; case(91): SimpleClass91= value; break; case(92): SimpleClass92= value; break; case(93): SimpleClass93= value; break; case(94): SimpleClass94= value; break; case(95): SimpleClass95= value; break; case(96): SimpleClass96= value; break; case(98): SimpleClass98= value; break; case(100): SimpleClass100= value; break; case(101): SimpleClass101= value; break; case(102): SimpleClass102= value; break; case(103): SimpleClass103= value; break; case(104): SimpleClass104= value; break; case(105): SimpleClass105= value; break; case(107): SimpleClass107= value; break; case(108): SimpleClass108= value; break; case(109): SimpleClass109= value; break; case(110): SimpleClass110= value; break; case(111): SimpleClass111= value; break; case(112): SimpleClass112= value; break; case(113): SimpleClass113= value; break; case(114): SimpleClass114= value; break; case(115): SimpleClass115= value; break; case(116): SimpleClass116= value; break; case(117): SimpleClass117= value; break; case(118): SimpleClass118= value; break; case(119): SimpleClass119= value; break; case(120): SimpleClass120= value; break; case(121): SimpleClass121= value; break; case(122): SimpleClass122= value; break; case(124): SimpleClass124= value; break; case(125): SimpleClass125= value; break; case(126): SimpleClass126= value; break; case(127): SimpleClass127= value; break; case(128): SimpleClass128= value; break; case(129): SimpleClass129= value; break; case(130): SimpleClass130= value; break; case(131): SimpleClass131= value; break; case(132): SimpleClass132= value; break; case(134): SimpleClass134= value; break; case(136): SimpleClass136= value; break; case(137): SimpleClass137= value; break; case(138): SimpleClass138= value; break; case(139): SimpleClass139= value; break; case(140): SimpleClass140= value; break; case(141): SimpleClass141= value; break; case(143): SimpleClass143= value; break; case(144): SimpleClass144= value; break; case(145): SimpleClass145= value; break; case(146): SimpleClass146= value; break; case(147): SimpleClass147= value; break; case(148): SimpleClass148= value; break; case(149): SimpleClass149= value; break; case(150): SimpleClass150= value; break; case(151): SimpleClass151= value; break; case(152): SimpleClass152= value; break; case(153): SimpleClass153= value; break; case(154): SimpleClass154= value; break; case(155): SimpleClass155= value; break; case(156): SimpleClass156= value; break; case(157): SimpleClass157= value; break; case(158): SimpleClass158= value; break; case(159): SimpleClass159= value; break; case(160): SimpleClass160= value; break; case(161): SimpleClass161= value; break; case(162): SimpleClass162= value; break; case(163): SimpleClass163= value; break; case(164): SimpleClass164= value; break; case(165): SimpleClass165= value; break; case(166): SimpleClass166= value; break; case(167): SimpleClass167= value; break; default: throw new IndexOutOfBoundsException(); } return true; } public static class Oid implements Serializable { public int identifier; public Oid() { } public Oid(String s) { identifier = Integer.parseInt(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + identifier;} public int hashCode() { return (int)identifier ; } public boolean equals(Object other) { if (other != null && (other instanceof Oid)) { Oid k = (Oid)other; return k.identifier == this.identifier; } return false; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } } } tck/src/java/org/apache/jdo/tck/pc/fieldtypes/FieldsOfSimpleEnum.java100664 106261 12500110373 26102 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.io.Serializable; public class FieldsOfSimpleEnum { public int identifier; private SimpleEnum SimpleEnum0; private SimpleEnum SimpleEnum1; private SimpleEnum SimpleEnum2; private SimpleEnum SimpleEnum3; private SimpleEnum SimpleEnum4; private SimpleEnum SimpleEnum5; private SimpleEnum SimpleEnum6; private SimpleEnum SimpleEnum7; private static SimpleEnum SimpleEnum8; private transient SimpleEnum SimpleEnum9; private transient SimpleEnum SimpleEnum10; private transient SimpleEnum SimpleEnum11; private transient SimpleEnum SimpleEnum12; private transient SimpleEnum SimpleEnum13; private transient SimpleEnum SimpleEnum14; private final SimpleEnum SimpleEnum15 = SimpleEnum.AL; private volatile SimpleEnum SimpleEnum16; private volatile SimpleEnum SimpleEnum17; private volatile SimpleEnum SimpleEnum18; private volatile SimpleEnum SimpleEnum19; private volatile SimpleEnum SimpleEnum20; private volatile SimpleEnum SimpleEnum21; private volatile SimpleEnum SimpleEnum22; private volatile SimpleEnum SimpleEnum23; private static transient SimpleEnum SimpleEnum24; private static final SimpleEnum SimpleEnum25 = SimpleEnum.AL; private static volatile SimpleEnum SimpleEnum26; private transient final SimpleEnum SimpleEnum27 = SimpleEnum.AL; private transient volatile SimpleEnum SimpleEnum28; private transient volatile SimpleEnum SimpleEnum29; private transient volatile SimpleEnum SimpleEnum30; private transient volatile SimpleEnum SimpleEnum31; private transient volatile SimpleEnum SimpleEnum32; private transient volatile SimpleEnum SimpleEnum33; private static transient final SimpleEnum SimpleEnum34 = SimpleEnum.AL; private static transient volatile SimpleEnum SimpleEnum35; public SimpleEnum SimpleEnum36; public SimpleEnum SimpleEnum37; public SimpleEnum SimpleEnum38; public SimpleEnum SimpleEnum39; public SimpleEnum SimpleEnum40; public SimpleEnum SimpleEnum41; public SimpleEnum SimpleEnum42; public SimpleEnum SimpleEnum43; public static SimpleEnum SimpleEnum44; public transient SimpleEnum SimpleEnum45; public transient SimpleEnum SimpleEnum46; public transient SimpleEnum SimpleEnum47; public transient SimpleEnum SimpleEnum48; public transient SimpleEnum SimpleEnum49; public transient SimpleEnum SimpleEnum50; public final SimpleEnum SimpleEnum51 = SimpleEnum.AL; public volatile SimpleEnum SimpleEnum52; public volatile SimpleEnum SimpleEnum53; public volatile SimpleEnum SimpleEnum54; public volatile SimpleEnum SimpleEnum55; public volatile SimpleEnum SimpleEnum56; public volatile SimpleEnum SimpleEnum57; public volatile SimpleEnum SimpleEnum58; public volatile SimpleEnum SimpleEnum59; public static transient SimpleEnum SimpleEnum60; public static final SimpleEnum SimpleEnum61 = SimpleEnum.AL; public static volatile SimpleEnum SimpleEnum62; public transient final SimpleEnum SimpleEnum63 = SimpleEnum.AL; public transient volatile SimpleEnum SimpleEnum64; public transient volatile SimpleEnum SimpleEnum65; public transient volatile SimpleEnum SimpleEnum66; public transient volatile SimpleEnum SimpleEnum67; public transient volatile SimpleEnum SimpleEnum68; public transient volatile SimpleEnum SimpleEnum69; public static transient final SimpleEnum SimpleEnum70 = SimpleEnum.AL; public static transient volatile SimpleEnum SimpleEnum71; protected SimpleEnum SimpleEnum72; protected SimpleEnum SimpleEnum73; protected SimpleEnum SimpleEnum74; protected SimpleEnum SimpleEnum75; protected SimpleEnum SimpleEnum76; protected SimpleEnum SimpleEnum77; protected SimpleEnum SimpleEnum78; protected SimpleEnum SimpleEnum79; protected static SimpleEnum SimpleEnum80; protected transient SimpleEnum SimpleEnum81; protected transient SimpleEnum SimpleEnum82; protected transient SimpleEnum SimpleEnum83; protected transient SimpleEnum SimpleEnum84; protected transient SimpleEnum SimpleEnum85; protected transient SimpleEnum SimpleEnum86; protected final SimpleEnum SimpleEnum87 = SimpleEnum.AL; protected volatile SimpleEnum SimpleEnum88; protected volatile SimpleEnum SimpleEnum89; protected volatile SimpleEnum SimpleEnum90; protected volatile SimpleEnum SimpleEnum91; protected volatile SimpleEnum SimpleEnum92; protected volatile SimpleEnum SimpleEnum93; protected volatile SimpleEnum SimpleEnum94; protected volatile SimpleEnum SimpleEnum95; protected static transient SimpleEnum SimpleEnum96; protected static final SimpleEnum SimpleEnum97 = SimpleEnum.AL; protected static volatile SimpleEnum SimpleEnum98; protected transient final SimpleEnum SimpleEnum99 = SimpleEnum.AL; protected transient volatile SimpleEnum SimpleEnum100; protected transient volatile SimpleEnum SimpleEnum101; protected transient volatile SimpleEnum SimpleEnum102; protected transient volatile SimpleEnum SimpleEnum103; protected transient volatile SimpleEnum SimpleEnum104; protected transient volatile SimpleEnum SimpleEnum105; protected static transient final SimpleEnum SimpleEnum106 = SimpleEnum.AL; protected static transient volatile SimpleEnum SimpleEnum107; SimpleEnum SimpleEnum108; SimpleEnum SimpleEnum109; SimpleEnum SimpleEnum110; SimpleEnum SimpleEnum111; SimpleEnum SimpleEnum112; SimpleEnum SimpleEnum113; SimpleEnum SimpleEnum114; SimpleEnum SimpleEnum115; static SimpleEnum SimpleEnum116; transient SimpleEnum SimpleEnum117; transient SimpleEnum SimpleEnum118; transient SimpleEnum SimpleEnum119; transient SimpleEnum SimpleEnum120; transient SimpleEnum SimpleEnum121; transient SimpleEnum SimpleEnum122; final SimpleEnum SimpleEnum123 = SimpleEnum.AL; volatile SimpleEnum SimpleEnum124; volatile SimpleEnum SimpleEnum125; volatile SimpleEnum SimpleEnum126; volatile SimpleEnum SimpleEnum127; volatile SimpleEnum SimpleEnum128; volatile SimpleEnum SimpleEnum129; volatile SimpleEnum SimpleEnum130; volatile SimpleEnum SimpleEnum131; static transient SimpleEnum SimpleEnum132; static final SimpleEnum SimpleEnum133 = SimpleEnum.AL; static volatile SimpleEnum SimpleEnum134; transient final SimpleEnum SimpleEnum135 = SimpleEnum.AL; transient volatile SimpleEnum SimpleEnum136; transient volatile SimpleEnum SimpleEnum137; transient volatile SimpleEnum SimpleEnum138; transient volatile SimpleEnum SimpleEnum139; transient volatile SimpleEnum SimpleEnum140; transient volatile SimpleEnum SimpleEnum141; static transient final SimpleEnum SimpleEnum142 = SimpleEnum.AL; static transient volatile SimpleEnum SimpleEnum143; public static final boolean [] isPersistent = { true,true,true,false,true,true,true,false,false,false, false,true,true,true,false,false,true,true,true,false, true,true,true,false,false,false,false,false,false,false, true,true,true,false,false,false,true,true,true,false, true,true,true,false,false,false,false,true,true,true, false,false,true,true,true,false,true,true,true,false, false,false,false,false,false,false,true,true,true,false, false,false,true,true,true,false,true,true,true,false, false,false,false,true,true,true,false,false,true,true, true,false,true,true,true,false,false,false,false,false, false,false,true,true,true,false,false,false,true,true, true,false,true,true,true,false,false,false,false,true, true,true,false,false,true,true,true,false,true,true, true,false,false,false,false,false,false,false,true,true, true,false,false,false }; public static final boolean [] isStatic = { false,false,false,false,false,false,false,false,true,false, false,false,false,false,false,false,false,false,false,false, false,false,false,false,true,true,true,false,false,false, false,false,false,false,true,true,false,false,false,false, false,false,false,false,true,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, true,true,true,false,false,false,false,false,false,false, true,true,false,false,false,false,false,false,false,false, true,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,true,true,true,false, false,false,false,false,false,false,true,true,false,false, false,false,false,false,false,false,true,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,true,true,true,false,false,false,false,false, false,false,true,true }; public static final boolean [] isFinal = { false,false,false,false,false,false,false,false,false,false, false,false,false,false,false,true,false,false,false,false, false,false,false,false,false,true,false,true,false,false, false,false,false,false,true,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, false,true,false,false,false,false,false,false,false,false, false,true,false,true,false,false,false,false,false,false, true,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,false,true,false,false, false,false,false,false,false,false,false,true,false,true, false,false,false,false,false,false,true,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,false,true,false,false,false,false,false,false, false,false,false,true,false,true,false,false,false,false, false,false,true,false }; public static final String [] fieldSpecs = { "private SimpleEnum SimpleEnum0", "embedded= true private SimpleEnum SimpleEnum1", "embedded= false private SimpleEnum SimpleEnum2", "persistence-modifier= none private SimpleEnum SimpleEnum3", "persistence-modifier= persistent private SimpleEnum SimpleEnum4", "persistence-modifier= persistent embedded= true private SimpleEnum SimpleEnum5", "persistence-modifier= persistent embedded= false private SimpleEnum SimpleEnum6", "persistence-modifier= transactional private SimpleEnum SimpleEnum7", "private static SimpleEnum SimpleEnum8", "private transient SimpleEnum SimpleEnum9", "persistence-modifier= none private transient SimpleEnum SimpleEnum10", "persistence-modifier= persistent private transient SimpleEnum SimpleEnum11", "persistence-modifier= persistent embedded= true private transient SimpleEnum SimpleEnum12", "persistence-modifier= persistent embedded= false private transient SimpleEnum SimpleEnum13", "persistence-modifier= transactional private transient SimpleEnum SimpleEnum14", "private final SimpleEnum SimpleEnum15", "private volatile SimpleEnum SimpleEnum16", "embedded= true private volatile SimpleEnum SimpleEnum17", "embedded= false private volatile SimpleEnum SimpleEnum18", "persistence-modifier= none private volatile SimpleEnum SimpleEnum19", "persistence-modifier= persistent private volatile SimpleEnum SimpleEnum20", "persistence-modifier= persistent embedded= true private volatile SimpleEnum SimpleEnum21", "persistence-modifier= persistent embedded= false private volatile SimpleEnum SimpleEnum22", "persistence-modifier= transactional private volatile SimpleEnum SimpleEnum23", "private static transient SimpleEnum SimpleEnum24", "private static final SimpleEnum SimpleEnum25", "private static volatile SimpleEnum SimpleEnum26", "private transient final SimpleEnum SimpleEnum27", "private transient volatile SimpleEnum SimpleEnum28", "persistence-modifier= none private transient volatile SimpleEnum SimpleEnum29", "persistence-modifier= persistent private transient volatile SimpleEnum SimpleEnum30", "persistence-modifier= persistent embedded= true private transient volatile SimpleEnum SimpleEnum31", "persistence-modifier= persistent embedded= false private transient volatile SimpleEnum SimpleEnum32", "persistence-modifier= transactional private transient volatile SimpleEnum SimpleEnum33", "private static transient final SimpleEnum SimpleEnum34", "private static transient volatile SimpleEnum SimpleEnum35", "public SimpleEnum SimpleEnum36", "embedded= true public SimpleEnum SimpleEnum37", "embedded= false public SimpleEnum SimpleEnum38", "persistence-modifier= none public SimpleEnum SimpleEnum39", "persistence-modifier= persistent public SimpleEnum SimpleEnum40", "persistence-modifier= persistent embedded= true public SimpleEnum SimpleEnum41", "persistence-modifier= persistent embedded= false public SimpleEnum SimpleEnum42", "persistence-modifier= transactional public SimpleEnum SimpleEnum43", "public static SimpleEnum SimpleEnum44", "public transient SimpleEnum SimpleEnum45", "persistence-modifier= none public transient SimpleEnum SimpleEnum46", "persistence-modifier= persistent public transient SimpleEnum SimpleEnum47", "persistence-modifier= persistent embedded= true public transient SimpleEnum SimpleEnum48", "persistence-modifier= persistent embedded= false public transient SimpleEnum SimpleEnum49", "persistence-modifier= transactional public transient SimpleEnum SimpleEnum50", "public final SimpleEnum SimpleEnum51", "public volatile SimpleEnum SimpleEnum52", "embedded= true public volatile SimpleEnum SimpleEnum53", "embedded= false public volatile SimpleEnum SimpleEnum54", "persistence-modifier= none public volatile SimpleEnum SimpleEnum55", "persistence-modifier= persistent public volatile SimpleEnum SimpleEnum56", "persistence-modifier= persistent embedded= true public volatile SimpleEnum SimpleEnum57", "persistence-modifier= persistent embedded= false public volatile SimpleEnum SimpleEnum58", "persistence-modifier= transactional public volatile SimpleEnum SimpleEnum59", "public static transient SimpleEnum SimpleEnum60", "public static final SimpleEnum SimpleEnum61", "public static volatile SimpleEnum SimpleEnum62", "public transient final SimpleEnum SimpleEnum63", "public transient volatile SimpleEnum SimpleEnum64", "persistence-modifier= none public transient volatile SimpleEnum SimpleEnum65", "persistence-modifier= persistent public transient volatile SimpleEnum SimpleEnum66", "persistence-modifier= persistent embedded= true public transient volatile SimpleEnum SimpleEnum67", "persistence-modifier= persistent embedded= false public transient volatile SimpleEnum SimpleEnum68", "persistence-modifier= transactional public transient volatile SimpleEnum SimpleEnum69", "public static transient final SimpleEnum SimpleEnum70", "public static transient volatile SimpleEnum SimpleEnum71", "protected SimpleEnum SimpleEnum72", "embedded= true protected SimpleEnum SimpleEnum73", "embedded= false protected SimpleEnum SimpleEnum74", "persistence-modifier= none protected SimpleEnum SimpleEnum75", "persistence-modifier= persistent protected SimpleEnum SimpleEnum76", "persistence-modifier= persistent embedded= true protected SimpleEnum SimpleEnum77", "persistence-modifier= persistent embedded= false protected SimpleEnum SimpleEnum78", "persistence-modifier= transactional protected SimpleEnum SimpleEnum79", "protected static SimpleEnum SimpleEnum80", "protected transient SimpleEnum SimpleEnum81", "persistence-modifier= none protected transient SimpleEnum SimpleEnum82", "persistence-modifier= persistent protected transient SimpleEnum SimpleEnum83", "persistence-modifier= persistent embedded= true protected transient SimpleEnum SimpleEnum84", "persistence-modifier= persistent embedded= false protected transient SimpleEnum SimpleEnum85", "persistence-modifier= transactional protected transient SimpleEnum SimpleEnum86", "protected final SimpleEnum SimpleEnum87", "protected volatile SimpleEnum SimpleEnum88", "embedded= true protected volatile SimpleEnum SimpleEnum89", "embedded= false protected volatile SimpleEnum SimpleEnum90", "persistence-modifier= none protected volatile SimpleEnum SimpleEnum91", "persistence-modifier= persistent protected volatile SimpleEnum SimpleEnum92", "persistence-modifier= persistent embedded= true protected volatile SimpleEnum SimpleEnum93", "persistence-modifier= persistent embedded= false protected volatile SimpleEnum SimpleEnum94", "persistence-modifier= transactional protected volatile SimpleEnum SimpleEnum95", "protected static transient SimpleEnum SimpleEnum96", "protected static final SimpleEnum SimpleEnum97", "protected static volatile SimpleEnum SimpleEnum98", "protected transient final SimpleEnum SimpleEnum99", "protected transient volatile SimpleEnum SimpleEnum100", "persistence-modifier= none protected transient volatile SimpleEnum SimpleEnum101", "persistence-modifier= persistent protected transient volatile SimpleEnum SimpleEnum102", "persistence-modifier= persistent embedded= true protected transient volatile SimpleEnum SimpleEnum103", "persistence-modifier= persistent embedded= false protected transient volatile SimpleEnum SimpleEnum104", "persistence-modifier= transactional protected transient volatile SimpleEnum SimpleEnum105", "protected static transient final SimpleEnum SimpleEnum106", "protected static transient volatile SimpleEnum SimpleEnum107", "SimpleEnum SimpleEnum108", "embedded= true SimpleEnum SimpleEnum109", "embedded= false SimpleEnum SimpleEnum110", "persistence-modifier= none SimpleEnum SimpleEnum111", "persistence-modifier= persistent SimpleEnum SimpleEnum112", "persistence-modifier= persistent embedded= true SimpleEnum SimpleEnum113", "persistence-modifier= persistent embedded= false SimpleEnum SimpleEnum114", "persistence-modifier= transactional SimpleEnum SimpleEnum115", "static SimpleEnum SimpleEnum116", "transient SimpleEnum SimpleEnum117", "persistence-modifier= none transient SimpleEnum SimpleEnum118", "persistence-modifier= persistent transient SimpleEnum SimpleEnum119", "persistence-modifier= persistent embedded= true transient SimpleEnum SimpleEnum120", "persistence-modifier= persistent embedded= false transient SimpleEnum SimpleEnum121", "persistence-modifier= transactional transient SimpleEnum SimpleEnum122", "final SimpleEnum SimpleEnum123", "volatile SimpleEnum SimpleEnum124", "embedded= true volatile SimpleEnum SimpleEnum125", "embedded= false volatile SimpleEnum SimpleEnum126", "persistence-modifier= none volatile SimpleEnum SimpleEnum127", "persistence-modifier= persistent volatile SimpleEnum SimpleEnum128", "persistence-modifier= persistent embedded= true volatile SimpleEnum SimpleEnum129", "persistence-modifier= persistent embedded= false volatile SimpleEnum SimpleEnum130", "persistence-modifier= transactional volatile SimpleEnum SimpleEnum131", "static transient SimpleEnum SimpleEnum132", "static final SimpleEnum SimpleEnum133", "static volatile SimpleEnum SimpleEnum134", "transient final SimpleEnum SimpleEnum135", "transient volatile SimpleEnum SimpleEnum136", "persistence-modifier= none transient volatile SimpleEnum SimpleEnum137", "persistence-modifier= persistent transient volatile SimpleEnum SimpleEnum138", "persistence-modifier= persistent embedded= true transient volatile SimpleEnum SimpleEnum139", "persistence-modifier= persistent embedded= false transient volatile SimpleEnum SimpleEnum140", "persistence-modifier= transactional transient volatile SimpleEnum SimpleEnum141", "static transient final SimpleEnum SimpleEnum142", "static transient volatile SimpleEnum SimpleEnum143" }; public int getLength() { return fieldSpecs.length; } public SimpleEnum get(int index) { switch (index) { case(0): return SimpleEnum0; case(1): return SimpleEnum1; case(2): return SimpleEnum2; case(3): return SimpleEnum3; case(4): return SimpleEnum4; case(5): return SimpleEnum5; case(6): return SimpleEnum6; case(7): return SimpleEnum7; case(8): return SimpleEnum8; case(9): return SimpleEnum9; case(10): return SimpleEnum10; case(11): return SimpleEnum11; case(12): return SimpleEnum12; case(13): return SimpleEnum13; case(14): return SimpleEnum14; case(15): return SimpleEnum15; case(16): return SimpleEnum16; case(17): return SimpleEnum17; case(18): return SimpleEnum18; case(19): return SimpleEnum19; case(20): return SimpleEnum20; case(21): return SimpleEnum21; case(22): return SimpleEnum22; case(23): return SimpleEnum23; case(24): return SimpleEnum24; case(25): return SimpleEnum25; case(26): return SimpleEnum26; case(27): return SimpleEnum27; case(28): return SimpleEnum28; case(29): return SimpleEnum29; case(30): return SimpleEnum30; case(31): return SimpleEnum31; case(32): return SimpleEnum32; case(33): return SimpleEnum33; case(34): return SimpleEnum34; case(35): return SimpleEnum35; case(36): return SimpleEnum36; case(37): return SimpleEnum37; case(38): return SimpleEnum38; case(39): return SimpleEnum39; case(40): return SimpleEnum40; case(41): return SimpleEnum41; case(42): return SimpleEnum42; case(43): return SimpleEnum43; case(44): return SimpleEnum44; case(45): return SimpleEnum45; case(46): return SimpleEnum46; case(47): return SimpleEnum47; case(48): return SimpleEnum48; case(49): return SimpleEnum49; case(50): return SimpleEnum50; case(51): return SimpleEnum51; case(52): return SimpleEnum52; case(53): return SimpleEnum53; case(54): return SimpleEnum54; case(55): return SimpleEnum55; case(56): return SimpleEnum56; case(57): return SimpleEnum57; case(58): return SimpleEnum58; case(59): return SimpleEnum59; case(60): return SimpleEnum60; case(61): return SimpleEnum61; case(62): return SimpleEnum62; case(63): return SimpleEnum63; case(64): return SimpleEnum64; case(65): return SimpleEnum65; case(66): return SimpleEnum66; case(67): return SimpleEnum67; case(68): return SimpleEnum68; case(69): return SimpleEnum69; case(70): return SimpleEnum70; case(71): return SimpleEnum71; case(72): return SimpleEnum72; case(73): return SimpleEnum73; case(74): return SimpleEnum74; case(75): return SimpleEnum75; case(76): return SimpleEnum76; case(77): return SimpleEnum77; case(78): return SimpleEnum78; case(79): return SimpleEnum79; case(80): return SimpleEnum80; case(81): return SimpleEnum81; case(82): return SimpleEnum82; case(83): return SimpleEnum83; case(84): return SimpleEnum84; case(85): return SimpleEnum85; case(86): return SimpleEnum86; case(87): return SimpleEnum87; case(88): return SimpleEnum88; case(89): return SimpleEnum89; case(90): return SimpleEnum90; case(91): return SimpleEnum91; case(92): return SimpleEnum92; case(93): return SimpleEnum93; case(94): return SimpleEnum94; case(95): return SimpleEnum95; case(96): return SimpleEnum96; case(97): return SimpleEnum97; case(98): return SimpleEnum98; case(99): return SimpleEnum99; case(100): return SimpleEnum100; case(101): return SimpleEnum101; case(102): return SimpleEnum102; case(103): return SimpleEnum103; case(104): return SimpleEnum104; case(105): return SimpleEnum105; case(106): return SimpleEnum106; case(107): return SimpleEnum107; case(108): return SimpleEnum108; case(109): return SimpleEnum109; case(110): return SimpleEnum110; case(111): return SimpleEnum111; case(112): return SimpleEnum112; case(113): return SimpleEnum113; case(114): return SimpleEnum114; case(115): return SimpleEnum115; case(116): return SimpleEnum116; case(117): return SimpleEnum117; case(118): return SimpleEnum118; case(119): return SimpleEnum119; case(120): return SimpleEnum120; case(121): return SimpleEnum121; case(122): return SimpleEnum122; case(123): return SimpleEnum123; case(124): return SimpleEnum124; case(125): return SimpleEnum125; case(126): return SimpleEnum126; case(127): return SimpleEnum127; case(128): return SimpleEnum128; case(129): return SimpleEnum129; case(130): return SimpleEnum130; case(131): return SimpleEnum131; case(132): return SimpleEnum132; case(133): return SimpleEnum133; case(134): return SimpleEnum134; case(135): return SimpleEnum135; case(136): return SimpleEnum136; case(137): return SimpleEnum137; case(138): return SimpleEnum138; case(139): return SimpleEnum139; case(140): return SimpleEnum140; case(141): return SimpleEnum141; case(142): return SimpleEnum142; case(143): return SimpleEnum143; default: throw new IndexOutOfBoundsException(); } } public boolean set(int index,SimpleEnum value) { if(fieldSpecs[index].indexOf("final") != -1) return false; switch (index) { case(0): SimpleEnum0= value; break; case(1): SimpleEnum1= value; break; case(2): SimpleEnum2= value; break; case(3): SimpleEnum3= value; break; case(4): SimpleEnum4= value; break; case(5): SimpleEnum5= value; break; case(6): SimpleEnum6= value; break; case(7): SimpleEnum7= value; break; case(8): SimpleEnum8= value; break; case(9): SimpleEnum9= value; break; case(10): SimpleEnum10= value; break; case(11): SimpleEnum11= value; break; case(12): SimpleEnum12= value; break; case(13): SimpleEnum13= value; break; case(14): SimpleEnum14= value; break; case(16): SimpleEnum16= value; break; case(17): SimpleEnum17= value; break; case(18): SimpleEnum18= value; break; case(19): SimpleEnum19= value; break; case(20): SimpleEnum20= value; break; case(21): SimpleEnum21= value; break; case(22): SimpleEnum22= value; break; case(23): SimpleEnum23= value; break; case(24): SimpleEnum24= value; break; case(26): SimpleEnum26= value; break; case(28): SimpleEnum28= value; break; case(29): SimpleEnum29= value; break; case(30): SimpleEnum30= value; break; case(31): SimpleEnum31= value; break; case(32): SimpleEnum32= value; break; case(33): SimpleEnum33= value; break; case(35): SimpleEnum35= value; break; case(36): SimpleEnum36= value; break; case(37): SimpleEnum37= value; break; case(38): SimpleEnum38= value; break; case(39): SimpleEnum39= value; break; case(40): SimpleEnum40= value; break; case(41): SimpleEnum41= value; break; case(42): SimpleEnum42= value; break; case(43): SimpleEnum43= value; break; case(44): SimpleEnum44= value; break; case(45): SimpleEnum45= value; break; case(46): SimpleEnum46= value; break; case(47): SimpleEnum47= value; break; case(48): SimpleEnum48= value; break; case(49): SimpleEnum49= value; break; case(50): SimpleEnum50= value; break; case(52): SimpleEnum52= value; break; case(53): SimpleEnum53= value; break; case(54): SimpleEnum54= value; break; case(55): SimpleEnum55= value; break; case(56): SimpleEnum56= value; break; case(57): SimpleEnum57= value; break; case(58): SimpleEnum58= value; break; case(59): SimpleEnum59= value; break; case(60): SimpleEnum60= value; break; case(62): SimpleEnum62= value; break; case(64): SimpleEnum64= value; break; case(65): SimpleEnum65= value; break; case(66): SimpleEnum66= value; break; case(67): SimpleEnum67= value; break; case(68): SimpleEnum68= value; break; case(69): SimpleEnum69= value; break; case(71): SimpleEnum71= value; break; case(72): SimpleEnum72= value; break; case(73): SimpleEnum73= value; break; case(74): SimpleEnum74= value; break; case(75): SimpleEnum75= value; break; case(76): SimpleEnum76= value; break; case(77): SimpleEnum77= value; break; case(78): SimpleEnum78= value; break; case(79): SimpleEnum79= value; break; case(80): SimpleEnum80= value; break; case(81): SimpleEnum81= value; break; case(82): SimpleEnum82= value; break; case(83): SimpleEnum83= value; break; case(84): SimpleEnum84= value; break; case(85): SimpleEnum85= value; break; case(86): SimpleEnum86= value; break; case(88): SimpleEnum88= value; break; case(89): SimpleEnum89= value; break; case(90): SimpleEnum90= value; break; case(91): SimpleEnum91= value; break; case(92): SimpleEnum92= value; break; case(93): SimpleEnum93= value; break; case(94): SimpleEnum94= value; break; case(95): SimpleEnum95= value; break; case(96): SimpleEnum96= value; break; case(98): SimpleEnum98= value; break; case(100): SimpleEnum100= value; break; case(101): SimpleEnum101= value; break; case(102): SimpleEnum102= value; break; case(103): SimpleEnum103= value; break; case(104): SimpleEnum104= value; break; case(105): SimpleEnum105= value; break; case(107): SimpleEnum107= value; break; case(108): SimpleEnum108= value; break; case(109): SimpleEnum109= value; break; case(110): SimpleEnum110= value; break; case(111): SimpleEnum111= value; break; case(112): SimpleEnum112= value; break; case(113): SimpleEnum113= value; break; case(114): SimpleEnum114= value; break; case(115): SimpleEnum115= value; break; case(116): SimpleEnum116= value; break; case(117): SimpleEnum117= value; break; case(118): SimpleEnum118= value; break; case(119): SimpleEnum119= value; break; case(120): SimpleEnum120= value; break; case(121): SimpleEnum121= value; break; case(122): SimpleEnum122= value; break; case(124): SimpleEnum124= value; break; case(125): SimpleEnum125= value; break; case(126): SimpleEnum126= value; break; case(127): SimpleEnum127= value; break; case(128): SimpleEnum128= value; break; case(129): SimpleEnum129= value; break; case(130): SimpleEnum130= value; break; case(131): SimpleEnum131= value; break; case(132): SimpleEnum132= value; break; case(134): SimpleEnum134= value; break; case(136): SimpleEnum136= value; break; case(137): SimpleEnum137= value; break; case(138): SimpleEnum138= value; break; case(139): SimpleEnum139= value; break; case(140): SimpleEnum140= value; break; case(141): SimpleEnum141= value; break; case(143): SimpleEnum143= value; break; default: throw new IndexOutOfBoundsException(); } return true; } public static class Oid implements Serializable { public int identifier; public Oid() { } public Oid(String s) { identifier = Integer.parseInt(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + identifier;} public int hashCode() { return (int)identifier ; } public boolean equals(Object other) { if (other != null && (other instanceof Oid)) { Oid k = (Oid)other; return k.identifier == this.identifier; } return false; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } } } tck/src/java/org/apache/jdo/tck/pc/fieldtypes/FieldsOfSimpleInterface.java100664 116711 12500110373 27077 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.io.Serializable; public class FieldsOfSimpleInterface { public int identifier; private SimpleInterface SimpleInterface0; private SimpleInterface SimpleInterface1; private SimpleInterface SimpleInterface2; private SimpleInterface SimpleInterface3; private SimpleInterface SimpleInterface4; private SimpleInterface SimpleInterface5; private SimpleInterface SimpleInterface6; private SimpleInterface SimpleInterface7; private static SimpleInterface SimpleInterface8; private transient SimpleInterface SimpleInterface9; private transient SimpleInterface SimpleInterface10; private transient SimpleInterface SimpleInterface11; private transient SimpleInterface SimpleInterface12; private transient SimpleInterface SimpleInterface13; private transient SimpleInterface SimpleInterface14; private final SimpleInterface SimpleInterface15 = new SimpleClass(); private volatile SimpleInterface SimpleInterface16; private volatile SimpleInterface SimpleInterface17; private volatile SimpleInterface SimpleInterface18; private volatile SimpleInterface SimpleInterface19; private volatile SimpleInterface SimpleInterface20; private volatile SimpleInterface SimpleInterface21; private volatile SimpleInterface SimpleInterface22; private volatile SimpleInterface SimpleInterface23; private static transient SimpleInterface SimpleInterface24; private static final SimpleInterface SimpleInterface25 = new SimpleClass(); private static volatile SimpleInterface SimpleInterface26; private transient final SimpleInterface SimpleInterface27 = new SimpleClass(); private transient volatile SimpleInterface SimpleInterface28; private transient volatile SimpleInterface SimpleInterface29; private transient volatile SimpleInterface SimpleInterface30; private transient volatile SimpleInterface SimpleInterface31; private transient volatile SimpleInterface SimpleInterface32; private transient volatile SimpleInterface SimpleInterface33; private static transient final SimpleInterface SimpleInterface34 = new SimpleClass(); private static transient volatile SimpleInterface SimpleInterface35; public SimpleInterface SimpleInterface36; public SimpleInterface SimpleInterface37; public SimpleInterface SimpleInterface38; public SimpleInterface SimpleInterface39; public SimpleInterface SimpleInterface40; public SimpleInterface SimpleInterface41; public SimpleInterface SimpleInterface42; public SimpleInterface SimpleInterface43; public static SimpleInterface SimpleInterface44; public transient SimpleInterface SimpleInterface45; public transient SimpleInterface SimpleInterface46; public transient SimpleInterface SimpleInterface47; public transient SimpleInterface SimpleInterface48; public transient SimpleInterface SimpleInterface49; public transient SimpleInterface SimpleInterface50; public final SimpleInterface SimpleInterface51 = new SimpleClass(); public volatile SimpleInterface SimpleInterface52; public volatile SimpleInterface SimpleInterface53; public volatile SimpleInterface SimpleInterface54; public volatile SimpleInterface SimpleInterface55; public volatile SimpleInterface SimpleInterface56; public volatile SimpleInterface SimpleInterface57; public volatile SimpleInterface SimpleInterface58; public volatile SimpleInterface SimpleInterface59; public static transient SimpleInterface SimpleInterface60; public static final SimpleInterface SimpleInterface61 = new SimpleClass(); public static volatile SimpleInterface SimpleInterface62; public transient final SimpleInterface SimpleInterface63 = new SimpleClass(); public transient volatile SimpleInterface SimpleInterface64; public transient volatile SimpleInterface SimpleInterface65; public transient volatile SimpleInterface SimpleInterface66; public transient volatile SimpleInterface SimpleInterface67; public transient volatile SimpleInterface SimpleInterface68; public transient volatile SimpleInterface SimpleInterface69; public static transient final SimpleInterface SimpleInterface70 = new SimpleClass(); public static transient volatile SimpleInterface SimpleInterface71; protected SimpleInterface SimpleInterface72; protected SimpleInterface SimpleInterface73; protected SimpleInterface SimpleInterface74; protected SimpleInterface SimpleInterface75; protected SimpleInterface SimpleInterface76; protected SimpleInterface SimpleInterface77; protected SimpleInterface SimpleInterface78; protected SimpleInterface SimpleInterface79; protected static SimpleInterface SimpleInterface80; protected transient SimpleInterface SimpleInterface81; protected transient SimpleInterface SimpleInterface82; protected transient SimpleInterface SimpleInterface83; protected transient SimpleInterface SimpleInterface84; protected transient SimpleInterface SimpleInterface85; protected transient SimpleInterface SimpleInterface86; protected final SimpleInterface SimpleInterface87 = new SimpleClass(); protected volatile SimpleInterface SimpleInterface88; protected volatile SimpleInterface SimpleInterface89; protected volatile SimpleInterface SimpleInterface90; protected volatile SimpleInterface SimpleInterface91; protected volatile SimpleInterface SimpleInterface92; protected volatile SimpleInterface SimpleInterface93; protected volatile SimpleInterface SimpleInterface94; protected volatile SimpleInterface SimpleInterface95; protected static transient SimpleInterface SimpleInterface96; protected static final SimpleInterface SimpleInterface97 = new SimpleClass(); protected static volatile SimpleInterface SimpleInterface98; protected transient final SimpleInterface SimpleInterface99 = new SimpleClass(); protected transient volatile SimpleInterface SimpleInterface100; protected transient volatile SimpleInterface SimpleInterface101; protected transient volatile SimpleInterface SimpleInterface102; protected transient volatile SimpleInterface SimpleInterface103; protected transient volatile SimpleInterface SimpleInterface104; protected transient volatile SimpleInterface SimpleInterface105; protected static transient final SimpleInterface SimpleInterface106 = new SimpleClass(); protected static transient volatile SimpleInterface SimpleInterface107; SimpleInterface SimpleInterface108; SimpleInterface SimpleInterface109; SimpleInterface SimpleInterface110; SimpleInterface SimpleInterface111; SimpleInterface SimpleInterface112; SimpleInterface SimpleInterface113; SimpleInterface SimpleInterface114; SimpleInterface SimpleInterface115; static SimpleInterface SimpleInterface116; transient SimpleInterface SimpleInterface117; transient SimpleInterface SimpleInterface118; transient SimpleInterface SimpleInterface119; transient SimpleInterface SimpleInterface120; transient SimpleInterface SimpleInterface121; transient SimpleInterface SimpleInterface122; final SimpleInterface SimpleInterface123 = new SimpleClass(); volatile SimpleInterface SimpleInterface124; volatile SimpleInterface SimpleInterface125; volatile SimpleInterface SimpleInterface126; volatile SimpleInterface SimpleInterface127; volatile SimpleInterface SimpleInterface128; volatile SimpleInterface SimpleInterface129; volatile SimpleInterface SimpleInterface130; volatile SimpleInterface SimpleInterface131; static transient SimpleInterface SimpleInterface132; static final SimpleInterface SimpleInterface133 = new SimpleClass(); static volatile SimpleInterface SimpleInterface134; transient final SimpleInterface SimpleInterface135 = new SimpleClass(); transient volatile SimpleInterface SimpleInterface136; transient volatile SimpleInterface SimpleInterface137; transient volatile SimpleInterface SimpleInterface138; transient volatile SimpleInterface SimpleInterface139; transient volatile SimpleInterface SimpleInterface140; transient volatile SimpleInterface SimpleInterface141; static transient final SimpleInterface SimpleInterface142 = new SimpleClass(); static transient volatile SimpleInterface SimpleInterface143; public static final boolean [] isPersistent = { false,true,true,false,true,true,true,false,false,false, false,true,true,true,false,false,false,true,true,false, true,true,true,false,false,false,false,false,false,false, true,true,true,false,false,false,false,true,true,false, true,true,true,false,false,false,false,true,true,true, false,false,false,true,true,false,true,true,true,false, false,false,false,false,false,false,true,true,true,false, false,false,false,true,true,false,true,true,true,false, false,false,false,true,true,true,false,false,false,true, true,false,true,true,true,false,false,false,false,false, false,false,true,true,true,false,false,false,false,true, true,false,true,true,true,false,false,false,false,true, true,true,false,false,false,true,true,false,true,true, true,false,false,false,false,false,false,false,true,true, true,false,false,false }; public static final boolean [] isStatic = { false,false,false,false,false,false,false,false,true,false, false,false,false,false,false,false,false,false,false,false, false,false,false,false,true,true,true,false,false,false, false,false,false,false,true,true,false,false,false,false, false,false,false,false,true,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, true,true,true,false,false,false,false,false,false,false, true,true,false,false,false,false,false,false,false,false, true,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,true,true,true,false, false,false,false,false,false,false,true,true,false,false, false,false,false,false,false,false,true,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,true,true,true,false,false,false,false,false, false,false,true,true }; public static final boolean [] isFinal = { false,false,false,false,false,false,false,false,false,false, false,false,false,false,false,true,false,false,false,false, false,false,false,false,false,true,false,true,false,false, false,false,false,false,true,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, false,true,false,false,false,false,false,false,false,false, false,true,false,true,false,false,false,false,false,false, true,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,false,true,false,false, false,false,false,false,false,false,false,true,false,true, false,false,false,false,false,false,true,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,false,true,false,false,false,false,false,false, false,false,false,true,false,true,false,false,false,false, false,false,true,false }; public static final String [] fieldSpecs = { "private SimpleInterface SimpleInterface0", "serialized= true private SimpleInterface SimpleInterface1", "embedded= false private SimpleInterface SimpleInterface2", "persistence-modifier= none private SimpleInterface SimpleInterface3", "persistence-modifier= persistent private SimpleInterface SimpleInterface4", "persistence-modifier= persistent serialized= true private SimpleInterface SimpleInterface5", "persistence-modifier= persistent embedded= false private SimpleInterface SimpleInterface6", "persistence-modifier= transactional private SimpleInterface SimpleInterface7", "private static SimpleInterface SimpleInterface8", "private transient SimpleInterface SimpleInterface9", "persistence-modifier= none private transient SimpleInterface SimpleInterface10", "persistence-modifier= persistent private transient SimpleInterface SimpleInterface11", "persistence-modifier= persistent serialized= true private transient SimpleInterface SimpleInterface12", "persistence-modifier= persistent embedded= false private transient SimpleInterface SimpleInterface13", "persistence-modifier= transactional private transient SimpleInterface SimpleInterface14", "private final SimpleInterface SimpleInterface15", "private volatile SimpleInterface SimpleInterface16", "serialized= true private volatile SimpleInterface SimpleInterface17", "embedded= false private volatile SimpleInterface SimpleInterface18", "persistence-modifier= none private volatile SimpleInterface SimpleInterface19", "persistence-modifier= persistent private volatile SimpleInterface SimpleInterface20", "persistence-modifier= persistent serialized= true private volatile SimpleInterface SimpleInterface21", "persistence-modifier= persistent embedded= false private volatile SimpleInterface SimpleInterface22", "persistence-modifier= transactional private volatile SimpleInterface SimpleInterface23", "private static transient SimpleInterface SimpleInterface24", "private static final SimpleInterface SimpleInterface25", "private static volatile SimpleInterface SimpleInterface26", "private transient final SimpleInterface SimpleInterface27", "private transient volatile SimpleInterface SimpleInterface28", "persistence-modifier= none private transient volatile SimpleInterface SimpleInterface29", "persistence-modifier= persistent private transient volatile SimpleInterface SimpleInterface30", "persistence-modifier= persistent serialized= true private transient volatile SimpleInterface SimpleInterface31", "persistence-modifier= persistent embedded= false private transient volatile SimpleInterface SimpleInterface32", "persistence-modifier= transactional private transient volatile SimpleInterface SimpleInterface33", "private static transient final SimpleInterface SimpleInterface34", "private static transient volatile SimpleInterface SimpleInterface35", "public SimpleInterface SimpleInterface36", "serialized= true public SimpleInterface SimpleInterface37", "embedded= false public SimpleInterface SimpleInterface38", "persistence-modifier= none public SimpleInterface SimpleInterface39", "persistence-modifier= persistent public SimpleInterface SimpleInterface40", "persistence-modifier= persistent serialized= true public SimpleInterface SimpleInterface41", "persistence-modifier= persistent embedded= false public SimpleInterface SimpleInterface42", "persistence-modifier= transactional public SimpleInterface SimpleInterface43", "public static SimpleInterface SimpleInterface44", "public transient SimpleInterface SimpleInterface45", "persistence-modifier= none public transient SimpleInterface SimpleInterface46", "persistence-modifier= persistent public transient SimpleInterface SimpleInterface47", "persistence-modifier= persistent serialized= true public transient SimpleInterface SimpleInterface48", "persistence-modifier= persistent embedded= false public transient SimpleInterface SimpleInterface49", "persistence-modifier= transactional public transient SimpleInterface SimpleInterface50", "public final SimpleInterface SimpleInterface51", "public volatile SimpleInterface SimpleInterface52", "serialized= true public volatile SimpleInterface SimpleInterface53", "embedded= false public volatile SimpleInterface SimpleInterface54", "persistence-modifier= none public volatile SimpleInterface SimpleInterface55", "persistence-modifier= persistent public volatile SimpleInterface SimpleInterface56", "persistence-modifier= persistent serialized= true public volatile SimpleInterface SimpleInterface57", "persistence-modifier= persistent embedded= false public volatile SimpleInterface SimpleInterface58", "persistence-modifier= transactional public volatile SimpleInterface SimpleInterface59", "public static transient SimpleInterface SimpleInterface60", "public static final SimpleInterface SimpleInterface61", "public static volatile SimpleInterface SimpleInterface62", "public transient final SimpleInterface SimpleInterface63", "public transient volatile SimpleInterface SimpleInterface64", "persistence-modifier= none public transient volatile SimpleInterface SimpleInterface65", "persistence-modifier= persistent public transient volatile SimpleInterface SimpleInterface66", "persistence-modifier= persistent serialized= true public transient volatile SimpleInterface SimpleInterface67", "persistence-modifier= persistent embedded= false public transient volatile SimpleInterface SimpleInterface68", "persistence-modifier= transactional public transient volatile SimpleInterface SimpleInterface69", "public static transient final SimpleInterface SimpleInterface70", "public static transient volatile SimpleInterface SimpleInterface71", "protected SimpleInterface SimpleInterface72", "serialized= true protected SimpleInterface SimpleInterface73", "embedded= false protected SimpleInterface SimpleInterface74", "persistence-modifier= none protected SimpleInterface SimpleInterface75", "persistence-modifier= persistent protected SimpleInterface SimpleInterface76", "persistence-modifier= persistent serialized= true protected SimpleInterface SimpleInterface77", "persistence-modifier= persistent embedded= false protected SimpleInterface SimpleInterface78", "persistence-modifier= transactional protected SimpleInterface SimpleInterface79", "protected static SimpleInterface SimpleInterface80", "protected transient SimpleInterface SimpleInterface81", "persistence-modifier= none protected transient SimpleInterface SimpleInterface82", "persistence-modifier= persistent protected transient SimpleInterface SimpleInterface83", "persistence-modifier= persistent serialized= true protected transient SimpleInterface SimpleInterface84", "persistence-modifier= persistent embedded= false protected transient SimpleInterface SimpleInterface85", "persistence-modifier= transactional protected transient SimpleInterface SimpleInterface86", "protected final SimpleInterface SimpleInterface87", "protected volatile SimpleInterface SimpleInterface88", "serialized= true protected volatile SimpleInterface SimpleInterface89", "embedded= false protected volatile SimpleInterface SimpleInterface90", "persistence-modifier= none protected volatile SimpleInterface SimpleInterface91", "persistence-modifier= persistent protected volatile SimpleInterface SimpleInterface92", "persistence-modifier= persistent serialized= true protected volatile SimpleInterface SimpleInterface93", "persistence-modifier= persistent embedded= false protected volatile SimpleInterface SimpleInterface94", "persistence-modifier= transactional protected volatile SimpleInterface SimpleInterface95", "protected static transient SimpleInterface SimpleInterface96", "protected static final SimpleInterface SimpleInterface97", "protected static volatile SimpleInterface SimpleInterface98", "protected transient final SimpleInterface SimpleInterface99", "protected transient volatile SimpleInterface SimpleInterface100", "persistence-modifier= none protected transient volatile SimpleInterface SimpleInterface101", "persistence-modifier= persistent protected transient volatile SimpleInterface SimpleInterface102", "persistence-modifier= persistent serialized= true protected transient volatile SimpleInterface SimpleInterface103", "persistence-modifier= persistent embedded= false protected transient volatile SimpleInterface SimpleInterface104", "persistence-modifier= transactional protected transient volatile SimpleInterface SimpleInterface105", "protected static transient final SimpleInterface SimpleInterface106", "protected static transient volatile SimpleInterface SimpleInterface107", "SimpleInterface SimpleInterface108", "serialized= true SimpleInterface SimpleInterface109", "embedded= false SimpleInterface SimpleInterface110", "persistence-modifier= none SimpleInterface SimpleInterface111", "persistence-modifier= persistent SimpleInterface SimpleInterface112", "persistence-modifier= persistent serialized= true SimpleInterface SimpleInterface113", "persistence-modifier= persistent embedded= false SimpleInterface SimpleInterface114", "persistence-modifier= transactional SimpleInterface SimpleInterface115", "static SimpleInterface SimpleInterface116", "transient SimpleInterface SimpleInterface117", "persistence-modifier= none transient SimpleInterface SimpleInterface118", "persistence-modifier= persistent transient SimpleInterface SimpleInterface119", "persistence-modifier= persistent serialized= true transient SimpleInterface SimpleInterface120", "persistence-modifier= persistent embedded= false transient SimpleInterface SimpleInterface121", "persistence-modifier= transactional transient SimpleInterface SimpleInterface122", "final SimpleInterface SimpleInterface123", "volatile SimpleInterface SimpleInterface124", "serialized= true volatile SimpleInterface SimpleInterface125", "embedded= false volatile SimpleInterface SimpleInterface126", "persistence-modifier= none volatile SimpleInterface SimpleInterface127", "persistence-modifier= persistent volatile SimpleInterface SimpleInterface128", "persistence-modifier= persistent serialized= true volatile SimpleInterface SimpleInterface129", "persistence-modifier= persistent embedded= false volatile SimpleInterface SimpleInterface130", "persistence-modifier= transactional volatile SimpleInterface SimpleInterface131", "static transient SimpleInterface SimpleInterface132", "static final SimpleInterface SimpleInterface133", "static volatile SimpleInterface SimpleInterface134", "transient final SimpleInterface SimpleInterface135", "transient volatile SimpleInterface SimpleInterface136", "persistence-modifier= none transient volatile SimpleInterface SimpleInterface137", "persistence-modifier= persistent transient volatile SimpleInterface SimpleInterface138", "persistence-modifier= persistent serialized= true transient volatile SimpleInterface SimpleInterface139", "persistence-modifier= persistent embedded= false transient volatile SimpleInterface SimpleInterface140", "persistence-modifier= transactional transient volatile SimpleInterface SimpleInterface141", "static transient final SimpleInterface SimpleInterface142", "static transient volatile SimpleInterface SimpleInterface143" }; public int getLength() { return fieldSpecs.length; } public SimpleInterface get(int index) { switch (index) { case(0): return SimpleInterface0; case(1): return SimpleInterface1; case(2): return SimpleInterface2; case(3): return SimpleInterface3; case(4): return SimpleInterface4; case(5): return SimpleInterface5; case(6): return SimpleInterface6; case(7): return SimpleInterface7; case(8): return SimpleInterface8; case(9): return SimpleInterface9; case(10): return SimpleInterface10; case(11): return SimpleInterface11; case(12): return SimpleInterface12; case(13): return SimpleInterface13; case(14): return SimpleInterface14; case(15): return SimpleInterface15; case(16): return SimpleInterface16; case(17): return SimpleInterface17; case(18): return SimpleInterface18; case(19): return SimpleInterface19; case(20): return SimpleInterface20; case(21): return SimpleInterface21; case(22): return SimpleInterface22; case(23): return SimpleInterface23; case(24): return SimpleInterface24; case(25): return SimpleInterface25; case(26): return SimpleInterface26; case(27): return SimpleInterface27; case(28): return SimpleInterface28; case(29): return SimpleInterface29; case(30): return SimpleInterface30; case(31): return SimpleInterface31; case(32): return SimpleInterface32; case(33): return SimpleInterface33; case(34): return SimpleInterface34; case(35): return SimpleInterface35; case(36): return SimpleInterface36; case(37): return SimpleInterface37; case(38): return SimpleInterface38; case(39): return SimpleInterface39; case(40): return SimpleInterface40; case(41): return SimpleInterface41; case(42): return SimpleInterface42; case(43): return SimpleInterface43; case(44): return SimpleInterface44; case(45): return SimpleInterface45; case(46): return SimpleInterface46; case(47): return SimpleInterface47; case(48): return SimpleInterface48; case(49): return SimpleInterface49; case(50): return SimpleInterface50; case(51): return SimpleInterface51; case(52): return SimpleInterface52; case(53): return SimpleInterface53; case(54): return SimpleInterface54; case(55): return SimpleInterface55; case(56): return SimpleInterface56; case(57): return SimpleInterface57; case(58): return SimpleInterface58; case(59): return SimpleInterface59; case(60): return SimpleInterface60; case(61): return SimpleInterface61; case(62): return SimpleInterface62; case(63): return SimpleInterface63; case(64): return SimpleInterface64; case(65): return SimpleInterface65; case(66): return SimpleInterface66; case(67): return SimpleInterface67; case(68): return SimpleInterface68; case(69): return SimpleInterface69; case(70): return SimpleInterface70; case(71): return SimpleInterface71; case(72): return SimpleInterface72; case(73): return SimpleInterface73; case(74): return SimpleInterface74; case(75): return SimpleInterface75; case(76): return SimpleInterface76; case(77): return SimpleInterface77; case(78): return SimpleInterface78; case(79): return SimpleInterface79; case(80): return SimpleInterface80; case(81): return SimpleInterface81; case(82): return SimpleInterface82; case(83): return SimpleInterface83; case(84): return SimpleInterface84; case(85): return SimpleInterface85; case(86): return SimpleInterface86; case(87): return SimpleInterface87; case(88): return SimpleInterface88; case(89): return SimpleInterface89; case(90): return SimpleInterface90; case(91): return SimpleInterface91; case(92): return SimpleInterface92; case(93): return SimpleInterface93; case(94): return SimpleInterface94; case(95): return SimpleInterface95; case(96): return SimpleInterface96; case(97): return SimpleInterface97; case(98): return SimpleInterface98; case(99): return SimpleInterface99; case(100): return SimpleInterface100; case(101): return SimpleInterface101; case(102): return SimpleInterface102; case(103): return SimpleInterface103; case(104): return SimpleInterface104; case(105): return SimpleInterface105; case(106): return SimpleInterface106; case(107): return SimpleInterface107; case(108): return SimpleInterface108; case(109): return SimpleInterface109; case(110): return SimpleInterface110; case(111): return SimpleInterface111; case(112): return SimpleInterface112; case(113): return SimpleInterface113; case(114): return SimpleInterface114; case(115): return SimpleInterface115; case(116): return SimpleInterface116; case(117): return SimpleInterface117; case(118): return SimpleInterface118; case(119): return SimpleInterface119; case(120): return SimpleInterface120; case(121): return SimpleInterface121; case(122): return SimpleInterface122; case(123): return SimpleInterface123; case(124): return SimpleInterface124; case(125): return SimpleInterface125; case(126): return SimpleInterface126; case(127): return SimpleInterface127; case(128): return SimpleInterface128; case(129): return SimpleInterface129; case(130): return SimpleInterface130; case(131): return SimpleInterface131; case(132): return SimpleInterface132; case(133): return SimpleInterface133; case(134): return SimpleInterface134; case(135): return SimpleInterface135; case(136): return SimpleInterface136; case(137): return SimpleInterface137; case(138): return SimpleInterface138; case(139): return SimpleInterface139; case(140): return SimpleInterface140; case(141): return SimpleInterface141; case(142): return SimpleInterface142; case(143): return SimpleInterface143; default: throw new IndexOutOfBoundsException(); } } public boolean set(int index,SimpleInterface value) { if(fieldSpecs[index].indexOf("final") != -1) return false; switch (index) { case(0): SimpleInterface0= value; break; case(1): SimpleInterface1= value; break; case(2): SimpleInterface2= value; break; case(3): SimpleInterface3= value; break; case(4): SimpleInterface4= value; break; case(5): SimpleInterface5= value; break; case(6): SimpleInterface6= value; break; case(7): SimpleInterface7= value; break; case(8): SimpleInterface8= value; break; case(9): SimpleInterface9= value; break; case(10): SimpleInterface10= value; break; case(11): SimpleInterface11= value; break; case(12): SimpleInterface12= value; break; case(13): SimpleInterface13= value; break; case(14): SimpleInterface14= value; break; case(16): SimpleInterface16= value; break; case(17): SimpleInterface17= value; break; case(18): SimpleInterface18= value; break; case(19): SimpleInterface19= value; break; case(20): SimpleInterface20= value; break; case(21): SimpleInterface21= value; break; case(22): SimpleInterface22= value; break; case(23): SimpleInterface23= value; break; case(24): SimpleInterface24= value; break; case(26): SimpleInterface26= value; break; case(28): SimpleInterface28= value; break; case(29): SimpleInterface29= value; break; case(30): SimpleInterface30= value; break; case(31): SimpleInterface31= value; break; case(32): SimpleInterface32= value; break; case(33): SimpleInterface33= value; break; case(35): SimpleInterface35= value; break; case(36): SimpleInterface36= value; break; case(37): SimpleInterface37= value; break; case(38): SimpleInterface38= value; break; case(39): SimpleInterface39= value; break; case(40): SimpleInterface40= value; break; case(41): SimpleInterface41= value; break; case(42): SimpleInterface42= value; break; case(43): SimpleInterface43= value; break; case(44): SimpleInterface44= value; break; case(45): SimpleInterface45= value; break; case(46): SimpleInterface46= value; break; case(47): SimpleInterface47= value; break; case(48): SimpleInterface48= value; break; case(49): SimpleInterface49= value; break; case(50): SimpleInterface50= value; break; case(52): SimpleInterface52= value; break; case(53): SimpleInterface53= value; break; case(54): SimpleInterface54= value; break; case(55): SimpleInterface55= value; break; case(56): SimpleInterface56= value; break; case(57): SimpleInterface57= value; break; case(58): SimpleInterface58= value; break; case(59): SimpleInterface59= value; break; case(60): SimpleInterface60= value; break; case(62): SimpleInterface62= value; break; case(64): SimpleInterface64= value; break; case(65): SimpleInterface65= value; break; case(66): SimpleInterface66= value; break; case(67): SimpleInterface67= value; break; case(68): SimpleInterface68= value; break; case(69): SimpleInterface69= value; break; case(71): SimpleInterface71= value; break; case(72): SimpleInterface72= value; break; case(73): SimpleInterface73= value; break; case(74): SimpleInterface74= value; break; case(75): SimpleInterface75= value; break; case(76): SimpleInterface76= value; break; case(77): SimpleInterface77= value; break; case(78): SimpleInterface78= value; break; case(79): SimpleInterface79= value; break; case(80): SimpleInterface80= value; break; case(81): SimpleInterface81= value; break; case(82): SimpleInterface82= value; break; case(83): SimpleInterface83= value; break; case(84): SimpleInterface84= value; break; case(85): SimpleInterface85= value; break; case(86): SimpleInterface86= value; break; case(88): SimpleInterface88= value; break; case(89): SimpleInterface89= value; break; case(90): SimpleInterface90= value; break; case(91): SimpleInterface91= value; break; case(92): SimpleInterface92= value; break; case(93): SimpleInterface93= value; break; case(94): SimpleInterface94= value; break; case(95): SimpleInterface95= value; break; case(96): SimpleInterface96= value; break; case(98): SimpleInterface98= value; break; case(100): SimpleInterface100= value; break; case(101): SimpleInterface101= value; break; case(102): SimpleInterface102= value; break; case(103): SimpleInterface103= value; break; case(104): SimpleInterface104= value; break; case(105): SimpleInterface105= value; break; case(107): SimpleInterface107= value; break; case(108): SimpleInterface108= value; break; case(109): SimpleInterface109= value; break; case(110): SimpleInterface110= value; break; case(111): SimpleInterface111= value; break; case(112): SimpleInterface112= value; break; case(113): SimpleInterface113= value; break; case(114): SimpleInterface114= value; break; case(115): SimpleInterface115= value; break; case(116): SimpleInterface116= value; break; case(117): SimpleInterface117= value; break; case(118): SimpleInterface118= value; break; case(119): SimpleInterface119= value; break; case(120): SimpleInterface120= value; break; case(121): SimpleInterface121= value; break; case(122): SimpleInterface122= value; break; case(124): SimpleInterface124= value; break; case(125): SimpleInterface125= value; break; case(126): SimpleInterface126= value; break; case(127): SimpleInterface127= value; break; case(128): SimpleInterface128= value; break; case(129): SimpleInterface129= value; break; case(130): SimpleInterface130= value; break; case(131): SimpleInterface131= value; break; case(132): SimpleInterface132= value; break; case(134): SimpleInterface134= value; break; case(136): SimpleInterface136= value; break; case(137): SimpleInterface137= value; break; case(138): SimpleInterface138= value; break; case(139): SimpleInterface139= value; break; case(140): SimpleInterface140= value; break; case(141): SimpleInterface141= value; break; case(143): SimpleInterface143= value; break; default: throw new IndexOutOfBoundsException(); } return true; } public static class Oid implements Serializable { public int identifier; public Oid() { } public Oid(String s) { identifier = Integer.parseInt(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + identifier;} public int hashCode() { return (int)identifier ; } public boolean equals(Object other) { if (other != null && (other instanceof Oid)) { Oid k = (Oid)other; return k.identifier == this.identifier; } return false; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } } } tck/src/java/org/apache/jdo/tck/pc/fieldtypes/FieldsOfString.java100664 77746 12500110373 25271 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.io.Serializable; public class FieldsOfString { public int identifier; private String String0; private String String1; private String String2; private String String3; private String String4; private String String5; private String String6; private String String7; private static String String8; private transient String String9; private transient String String10; private transient String String11; private transient String String12; private transient String String13; private transient String String14; private final String String15 = new String("JDO TCK"); private volatile String String16; private volatile String String17; private volatile String String18; private volatile String String19; private volatile String String20; private volatile String String21; private volatile String String22; private volatile String String23; private static transient String String24; private static final String String25 = new String("JDO TCK"); private static volatile String String26; private transient final String String27 = new String("JDO TCK"); private transient volatile String String28; private transient volatile String String29; private transient volatile String String30; private transient volatile String String31; private transient volatile String String32; private transient volatile String String33; private static transient final String String34 = new String("JDO TCK"); private static transient volatile String String35; public String String36; public String String37; public String String38; public String String39; public String String40; public String String41; public String String42; public String String43; public static String String44; public transient String String45; public transient String String46; public transient String String47; public transient String String48; public transient String String49; public transient String String50; public final String String51 = new String("JDO TCK"); public volatile String String52; public volatile String String53; public volatile String String54; public volatile String String55; public volatile String String56; public volatile String String57; public volatile String String58; public volatile String String59; public static transient String String60; public static final String String61 = new String("JDO TCK"); public static volatile String String62; public transient final String String63 = new String("JDO TCK"); public transient volatile String String64; public transient volatile String String65; public transient volatile String String66; public transient volatile String String67; public transient volatile String String68; public transient volatile String String69; public static transient final String String70 = new String("JDO TCK"); public static transient volatile String String71; protected String String72; protected String String73; protected String String74; protected String String75; protected String String76; protected String String77; protected String String78; protected String String79; protected static String String80; protected transient String String81; protected transient String String82; protected transient String String83; protected transient String String84; protected transient String String85; protected transient String String86; protected final String String87 = new String("JDO TCK"); protected volatile String String88; protected volatile String String89; protected volatile String String90; protected volatile String String91; protected volatile String String92; protected volatile String String93; protected volatile String String94; protected volatile String String95; protected static transient String String96; protected static final String String97 = new String("JDO TCK"); protected static volatile String String98; protected transient final String String99 = new String("JDO TCK"); protected transient volatile String String100; protected transient volatile String String101; protected transient volatile String String102; protected transient volatile String String103; protected transient volatile String String104; protected transient volatile String String105; protected static transient final String String106 = new String("JDO TCK"); protected static transient volatile String String107; String String108; String String109; String String110; String String111; String String112; String String113; String String114; String String115; static String String116; transient String String117; transient String String118; transient String String119; transient String String120; transient String String121; transient String String122; final String String123 = new String("JDO TCK"); volatile String String124; volatile String String125; volatile String String126; volatile String String127; volatile String String128; volatile String String129; volatile String String130; volatile String String131; static transient String String132; static final String String133 = new String("JDO TCK"); static volatile String String134; transient final String String135 = new String("JDO TCK"); transient volatile String String136; transient volatile String String137; transient volatile String String138; transient volatile String String139; transient volatile String String140; transient volatile String String141; static transient final String String142 = new String("JDO TCK"); static transient volatile String String143; public static final boolean [] isPersistent = { true,true,true,false,true,true,true,false,false,false, false,true,true,true,false,false,true,true,true,false, true,true,true,false,false,false,false,false,false,false, true,true,true,false,false,false,true,true,true,false, true,true,true,false,false,false,false,true,true,true, false,false,true,true,true,false,true,true,true,false, false,false,false,false,false,false,true,true,true,false, false,false,true,true,true,false,true,true,true,false, false,false,false,true,true,true,false,false,true,true, true,false,true,true,true,false,false,false,false,false, false,false,true,true,true,false,false,false,true,true, true,false,true,true,true,false,false,false,false,true, true,true,false,false,true,true,true,false,true,true, true,false,false,false,false,false,false,false,true,true, true,false,false,false }; public static final boolean [] isStatic = { false,false,false,false,false,false,false,false,true,false, false,false,false,false,false,false,false,false,false,false, false,false,false,false,true,true,true,false,false,false, false,false,false,false,true,true,false,false,false,false, false,false,false,false,true,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, true,true,true,false,false,false,false,false,false,false, true,true,false,false,false,false,false,false,false,false, true,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,true,true,true,false, false,false,false,false,false,false,true,true,false,false, false,false,false,false,false,false,true,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,true,true,true,false,false,false,false,false, false,false,true,true }; public static final boolean [] isFinal = { false,false,false,false,false,false,false,false,false,false, false,false,false,false,false,true,false,false,false,false, false,false,false,false,false,true,false,true,false,false, false,false,false,false,true,false,false,false,false,false, false,false,false,false,false,false,false,false,false,false, false,true,false,false,false,false,false,false,false,false, false,true,false,true,false,false,false,false,false,false, true,false,false,false,false,false,false,false,false,false, false,false,false,false,false,false,false,true,false,false, false,false,false,false,false,false,false,true,false,true, false,false,false,false,false,false,true,false,false,false, false,false,false,false,false,false,false,false,false,false, false,false,false,true,false,false,false,false,false,false, false,false,false,true,false,true,false,false,false,false, false,false,true,false }; public static final String [] fieldSpecs = { "private String String0", "embedded= true private String String1", "embedded= false private String String2", "persistence-modifier= none private String String3", "persistence-modifier= persistent private String String4", "persistence-modifier= persistent embedded= true private String String5", "persistence-modifier= persistent embedded= false private String String6", "persistence-modifier= transactional private String String7", "private static String String8", "private transient String String9", "persistence-modifier= none private transient String String10", "persistence-modifier= persistent private transient String String11", "persistence-modifier= persistent embedded= true private transient String String12", "persistence-modifier= persistent embedded= false private transient String String13", "persistence-modifier= transactional private transient String String14", "private final String String15", "private volatile String String16", "embedded= true private volatile String String17", "embedded= false private volatile String String18", "persistence-modifier= none private volatile String String19", "persistence-modifier= persistent private volatile String String20", "persistence-modifier= persistent embedded= true private volatile String String21", "persistence-modifier= persistent embedded= false private volatile String String22", "persistence-modifier= transactional private volatile String String23", "private static transient String String24", "private static final String String25", "private static volatile String String26", "private transient final String String27", "private transient volatile String String28", "persistence-modifier= none private transient volatile String String29", "persistence-modifier= persistent private transient volatile String String30", "persistence-modifier= persistent embedded= true private transient volatile String String31", "persistence-modifier= persistent embedded= false private transient volatile String String32", "persistence-modifier= transactional private transient volatile String String33", "private static transient final String String34", "private static transient volatile String String35", "public String String36", "embedded= true public String String37", "embedded= false public String String38", "persistence-modifier= none public String String39", "persistence-modifier= persistent public String String40", "persistence-modifier= persistent embedded= true public String String41", "persistence-modifier= persistent embedded= false public String String42", "persistence-modifier= transactional public String String43", "public static String String44", "public transient String String45", "persistence-modifier= none public transient String String46", "persistence-modifier= persistent public transient String String47", "persistence-modifier= persistent embedded= true public transient String String48", "persistence-modifier= persistent embedded= false public transient String String49", "persistence-modifier= transactional public transient String String50", "public final String String51", "public volatile String String52", "embedded= true public volatile String String53", "embedded= false public volatile String String54", "persistence-modifier= none public volatile String String55", "persistence-modifier= persistent public volatile String String56", "persistence-modifier= persistent embedded= true public volatile String String57", "persistence-modifier= persistent embedded= false public volatile String String58", "persistence-modifier= transactional public volatile String String59", "public static transient String String60", "public static final String String61", "public static volatile String String62", "public transient final String String63", "public transient volatile String String64", "persistence-modifier= none public transient volatile String String65", "persistence-modifier= persistent public transient volatile String String66", "persistence-modifier= persistent embedded= true public transient volatile String String67", "persistence-modifier= persistent embedded= false public transient volatile String String68", "persistence-modifier= transactional public transient volatile String String69", "public static transient final String String70", "public static transient volatile String String71", "protected String String72", "embedded= true protected String String73", "embedded= false protected String String74", "persistence-modifier= none protected String String75", "persistence-modifier= persistent protected String String76", "persistence-modifier= persistent embedded= true protected String String77", "persistence-modifier= persistent embedded= false protected String String78", "persistence-modifier= transactional protected String String79", "protected static String String80", "protected transient String String81", "persistence-modifier= none protected transient String String82", "persistence-modifier= persistent protected transient String String83", "persistence-modifier= persistent embedded= true protected transient String String84", "persistence-modifier= persistent embedded= false protected transient String String85", "persistence-modifier= transactional protected transient String String86", "protected final String String87", "protected volatile String String88", "embedded= true protected volatile String String89", "embedded= false protected volatile String String90", "persistence-modifier= none protected volatile String String91", "persistence-modifier= persistent protected volatile String String92", "persistence-modifier= persistent embedded= true protected volatile String String93", "persistence-modifier= persistent embedded= false protected volatile String String94", "persistence-modifier= transactional protected volatile String String95", "protected static transient String String96", "protected static final String String97", "protected static volatile String String98", "protected transient final String String99", "protected transient volatile String String100", "persistence-modifier= none protected transient volatile String String101", "persistence-modifier= persistent protected transient volatile String String102", "persistence-modifier= persistent embedded= true protected transient volatile String String103", "persistence-modifier= persistent embedded= false protected transient volatile String String104", "persistence-modifier= transactional protected transient volatile String String105", "protected static transient final String String106", "protected static transient volatile String String107", "String String108", "embedded= true String String109", "embedded= false String String110", "persistence-modifier= none String String111", "persistence-modifier= persistent String String112", "persistence-modifier= persistent embedded= true String String113", "persistence-modifier= persistent embedded= false String String114", "persistence-modifier= transactional String String115", "static String String116", "transient String String117", "persistence-modifier= none transient String String118", "persistence-modifier= persistent transient String String119", "persistence-modifier= persistent embedded= true transient String String120", "persistence-modifier= persistent embedded= false transient String String121", "persistence-modifier= transactional transient String String122", "final String String123", "volatile String String124", "embedded= true volatile String String125", "embedded= false volatile String String126", "persistence-modifier= none volatile String String127", "persistence-modifier= persistent volatile String String128", "persistence-modifier= persistent embedded= true volatile String String129", "persistence-modifier= persistent embedded= false volatile String String130", "persistence-modifier= transactional volatile String String131", "static transient String String132", "static final String String133", "static volatile String String134", "transient final String String135", "transient volatile String String136", "persistence-modifier= none transient volatile String String137", "persistence-modifier= persistent transient volatile String String138", "persistence-modifier= persistent embedded= true transient volatile String String139", "persistence-modifier= persistent embedded= false transient volatile String String140", "persistence-modifier= transactional transient volatile String String141", "static transient final String String142", "static transient volatile String String143" }; public int getLength() { return fieldSpecs.length; } public String get(int index) { switch (index) { case(0): return String0; case(1): return String1; case(2): return String2; case(3): return String3; case(4): return String4; case(5): return String5; case(6): return String6; case(7): return String7; case(8): return String8; case(9): return String9; case(10): return String10; case(11): return String11; case(12): return String12; case(13): return String13; case(14): return String14; case(15): return String15; case(16): return String16; case(17): return String17; case(18): return String18; case(19): return String19; case(20): return String20; case(21): return String21; case(22): return String22; case(23): return String23; case(24): return String24; case(25): return String25; case(26): return String26; case(27): return String27; case(28): return String28; case(29): return String29; case(30): return String30; case(31): return String31; case(32): return String32; case(33): return String33; case(34): return String34; case(35): return String35; case(36): return String36; case(37): return String37; case(38): return String38; case(39): return String39; case(40): return String40; case(41): return String41; case(42): return String42; case(43): return String43; case(44): return String44; case(45): return String45; case(46): return String46; case(47): return String47; case(48): return String48; case(49): return String49; case(50): return String50; case(51): return String51; case(52): return String52; case(53): return String53; case(54): return String54; case(55): return String55; case(56): return String56; case(57): return String57; case(58): return String58; case(59): return String59; case(60): return String60; case(61): return String61; case(62): return String62; case(63): return String63; case(64): return String64; case(65): return String65; case(66): return String66; case(67): return String67; case(68): return String68; case(69): return String69; case(70): return String70; case(71): return String71; case(72): return String72; case(73): return String73; case(74): return String74; case(75): return String75; case(76): return String76; case(77): return String77; case(78): return String78; case(79): return String79; case(80): return String80; case(81): return String81; case(82): return String82; case(83): return String83; case(84): return String84; case(85): return String85; case(86): return String86; case(87): return String87; case(88): return String88; case(89): return String89; case(90): return String90; case(91): return String91; case(92): return String92; case(93): return String93; case(94): return String94; case(95): return String95; case(96): return String96; case(97): return String97; case(98): return String98; case(99): return String99; case(100): return String100; case(101): return String101; case(102): return String102; case(103): return String103; case(104): return String104; case(105): return String105; case(106): return String106; case(107): return String107; case(108): return String108; case(109): return String109; case(110): return String110; case(111): return String111; case(112): return String112; case(113): return String113; case(114): return String114; case(115): return String115; case(116): return String116; case(117): return String117; case(118): return String118; case(119): return String119; case(120): return String120; case(121): return String121; case(122): return String122; case(123): return String123; case(124): return String124; case(125): return String125; case(126): return String126; case(127): return String127; case(128): return String128; case(129): return String129; case(130): return String130; case(131): return String131; case(132): return String132; case(133): return String133; case(134): return String134; case(135): return String135; case(136): return String136; case(137): return String137; case(138): return String138; case(139): return String139; case(140): return String140; case(141): return String141; case(142): return String142; case(143): return String143; default: throw new IndexOutOfBoundsException(); } } public boolean set(int index,String value) { if(fieldSpecs[index].indexOf("final") != -1) return false; switch (index) { case(0): String0= value; break; case(1): String1= value; break; case(2): String2= value; break; case(3): String3= value; break; case(4): String4= value; break; case(5): String5= value; break; case(6): String6= value; break; case(7): String7= value; break; case(8): String8= value; break; case(9): String9= value; break; case(10): String10= value; break; case(11): String11= value; break; case(12): String12= value; break; case(13): String13= value; break; case(14): String14= value; break; case(16): String16= value; break; case(17): String17= value; break; case(18): String18= value; break; case(19): String19= value; break; case(20): String20= value; break; case(21): String21= value; break; case(22): String22= value; break; case(23): String23= value; break; case(24): String24= value; break; case(26): String26= value; break; case(28): String28= value; break; case(29): String29= value; break; case(30): String30= value; break; case(31): String31= value; break; case(32): String32= value; break; case(33): String33= value; break; case(35): String35= value; break; case(36): String36= value; break; case(37): String37= value; break; case(38): String38= value; break; case(39): String39= value; break; case(40): String40= value; break; case(41): String41= value; break; case(42): String42= value; break; case(43): String43= value; break; case(44): String44= value; break; case(45): String45= value; break; case(46): String46= value; break; case(47): String47= value; break; case(48): String48= value; break; case(49): String49= value; break; case(50): String50= value; break; case(52): String52= value; break; case(53): String53= value; break; case(54): String54= value; break; case(55): String55= value; break; case(56): String56= value; break; case(57): String57= value; break; case(58): String58= value; break; case(59): String59= value; break; case(60): String60= value; break; case(62): String62= value; break; case(64): String64= value; break; case(65): String65= value; break; case(66): String66= value; break; case(67): String67= value; break; case(68): String68= value; break; case(69): String69= value; break; case(71): String71= value; break; case(72): String72= value; break; case(73): String73= value; break; case(74): String74= value; break; case(75): String75= value; break; case(76): String76= value; break; case(77): String77= value; break; case(78): String78= value; break; case(79): String79= value; break; case(80): String80= value; break; case(81): String81= value; break; case(82): String82= value; break; case(83): String83= value; break; case(84): String84= value; break; case(85): String85= value; break; case(86): String86= value; break; case(88): String88= value; break; case(89): String89= value; break; case(90): String90= value; break; case(91): String91= value; break; case(92): String92= value; break; case(93): String93= value; break; case(94): String94= value; break; case(95): String95= value; break; case(96): String96= value; break; case(98): String98= value; break; case(100): String100= value; break; case(101): String101= value; break; case(102): String102= value; break; case(103): String103= value; break; case(104): String104= value; break; case(105): String105= value; break; case(107): String107= value; break; case(108): String108= value; break; case(109): String109= value; break; case(110): String110= value; break; case(111): String111= value; break; case(112): String112= value; break; case(113): String113= value; break; case(114): String114= value; break; case(115): String115= value; break; case(116): String116= value; break; case(117): String117= value; break; case(118): String118= value; break; case(119): String119= value; break; case(120): String120= value; break; case(121): String121= value; break; case(122): String122= value; break; case(124): String124= value; break; case(125): String125= value; break; case(126): String126= value; break; case(127): String127= value; break; case(128): String128= value; break; case(129): String129= value; break; case(130): String130= value; break; case(131): String131= value; break; case(132): String132= value; break; case(134): String134= value; break; case(136): String136= value; break; case(137): String137= value; break; case(138): String138= value; break; case(139): String139= value; break; case(140): String140= value; break; case(141): String141= value; break; case(143): String143= value; break; default: throw new IndexOutOfBoundsException(); } return true; } public static class Oid implements Serializable { public int identifier; public Oid() { } public Oid(String s) { identifier = Integer.parseInt(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + identifier;} public int hashCode() { return (int)identifier ; } public boolean equals(Object other) { if (other != null && (other instanceof Oid)) { Oid k = (Oid)other; return k.identifier == this.identifier; } return false; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } } } tck/src/java/org/apache/jdo/tck/pc/fieldtypes/HashMapStringKeyCollections.java100664 63135 12500110373 27752 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.io.Serializable; import java.util.HashMap; public class HashMapStringKeyCollections { public int identifier; public HashMap HashMapOfString_Object0; public HashMap HashMapOfString_Object1; public HashMap HashMapOfString_Object2; public HashMap HashMapOfString_SimpleClass3; public HashMap HashMapOfString_SimpleClass4; public HashMap HashMapOfString_SimpleClass5; public HashMap HashMapOfString_SimpleInterface6; public HashMap HashMapOfString_SimpleInterface7; public HashMap HashMapOfString_SimpleInterface8; public HashMap HashMapOfString_String9; public HashMap HashMapOfString_String10; public HashMap HashMapOfString_String11; public HashMap HashMapOfString_Date12; public HashMap HashMapOfString_Date13; public HashMap HashMapOfString_Date14; public HashMap HashMapOfString_Locale15; public HashMap HashMapOfString_Locale16; public HashMap HashMapOfString_Locale17; public HashMap HashMapOfString_BigDecimal18; public HashMap HashMapOfString_BigDecimal19; public HashMap HashMapOfString_BigDecimal20; public HashMap HashMapOfString_BigInteger21; public HashMap HashMapOfString_BigInteger22; public HashMap HashMapOfString_BigInteger23; public HashMap HashMapOfString_Byte24; public HashMap HashMapOfString_Byte25; public HashMap HashMapOfString_Byte26; public HashMap HashMapOfString_Double27; public HashMap HashMapOfString_Double28; public HashMap HashMapOfString_Double29; public HashMap HashMapOfString_Float30; public HashMap HashMapOfString_Float31; public HashMap HashMapOfString_Float32; public HashMap HashMapOfString_Integer33; public HashMap HashMapOfString_Integer34; public HashMap HashMapOfString_Integer35; public HashMap HashMapOfString_Long36; public HashMap HashMapOfString_Long37; public HashMap HashMapOfString_Long38; public HashMap HashMapOfString_Short39; public HashMap HashMapOfString_Short40; public HashMap HashMapOfString_Short41; public HashMap HashMapOfString_Object42; public HashMap HashMapOfString_Object43; public HashMap HashMapOfString_SimpleClass45; public HashMap HashMapOfString_SimpleClass46; public HashMap HashMapOfString_SimpleInterface48; public HashMap HashMapOfString_SimpleInterface49; public HashMap HashMapOfString_String51; public HashMap HashMapOfString_String52; public HashMap HashMapOfString_Date54; public HashMap HashMapOfString_Date55; public HashMap HashMapOfString_Locale57; public HashMap HashMapOfString_Locale58; public HashMap HashMapOfString_BigDecimal60; public HashMap HashMapOfString_BigDecimal61; public HashMap HashMapOfString_BigInteger63; public HashMap HashMapOfString_BigInteger64; public HashMap HashMapOfString_Byte66; public HashMap HashMapOfString_Byte67; public HashMap HashMapOfString_Double69; public HashMap HashMapOfString_Double70; public HashMap HashMapOfString_Float72; public HashMap HashMapOfString_Float73; public HashMap HashMapOfString_Integer75; public HashMap HashMapOfString_Integer76; public HashMap HashMapOfString_Long78; public HashMap HashMapOfString_Long79; public HashMap HashMapOfString_Short81; public HashMap HashMapOfString_Short82; public HashMap HashMapOfString_Object84; public HashMap HashMapOfString_Object86; public HashMap HashMapOfString_SimpleClass87; public HashMap HashMapOfString_SimpleClass89; public HashMap HashMapOfString_SimpleInterface90; public HashMap HashMapOfString_SimpleInterface92; public HashMap HashMapOfString_String93; public HashMap HashMapOfString_String95; public HashMap HashMapOfString_Date96; public HashMap HashMapOfString_Date98; public HashMap HashMapOfString_Locale99; public HashMap HashMapOfString_Locale101; public HashMap HashMapOfString_BigDecimal102; public HashMap HashMapOfString_BigDecimal104; public HashMap HashMapOfString_BigInteger105; public HashMap HashMapOfString_BigInteger107; public HashMap HashMapOfString_Byte108; public HashMap HashMapOfString_Byte110; public HashMap HashMapOfString_Double111; public HashMap HashMapOfString_Double113; public HashMap HashMapOfString_Float114; public HashMap HashMapOfString_Float116; public HashMap HashMapOfString_Integer117; public HashMap HashMapOfString_Integer119; public HashMap HashMapOfString_Long120; public HashMap HashMapOfString_Long122; public HashMap HashMapOfString_Short123; public HashMap HashMapOfString_Short125; public static final String [] fieldSpecs = { "public HashMap HashMapOfString_Object0", "embedded-value=true public HashMap HashMapOfString_Object1", "embedded-value=false public HashMap HashMapOfString_Object2", "public HashMap HashMapOfString_SimpleClass3", "embedded-value=true public HashMap HashMapOfString_SimpleClass4", "embedded-value=false public HashMap HashMapOfString_SimpleClass5", "public HashMap HashMapOfString_SimpleInterface6", "embedded-value=true public HashMap HashMapOfString_SimpleInterface7", "embedded-value=false public HashMap HashMapOfString_SimpleInterface8", "public HashMap HashMapOfString_String9", "embedded-value=true public HashMap HashMapOfString_String10", "embedded-value=false public HashMap HashMapOfString_String11", "public HashMap HashMapOfString_Date12", "embedded-value=true public HashMap HashMapOfString_Date13", "embedded-value=false public HashMap HashMapOfString_Date14", "public HashMap HashMapOfString_Locale15", "embedded-value=true public HashMap HashMapOfString_Locale16", "embedded-value=false public HashMap HashMapOfString_Locale17", "public HashMap HashMapOfString_BigDecimal18", "embedded-value=true public HashMap HashMapOfString_BigDecimal19", "embedded-value=false public HashMap HashMapOfString_BigDecimal20", "public HashMap HashMapOfString_BigInteger21", "embedded-value=true public HashMap HashMapOfString_BigInteger22", "embedded-value=false public HashMap HashMapOfString_BigInteger23", "public HashMap HashMapOfString_Byte24", "embedded-value=true public HashMap HashMapOfString_Byte25", "embedded-value=false public HashMap HashMapOfString_Byte26", "public HashMap HashMapOfString_Double27", "embedded-value=true public HashMap HashMapOfString_Double28", "embedded-value=false public HashMap HashMapOfString_Double29", "public HashMap HashMapOfString_Float30", "embedded-value=true public HashMap HashMapOfString_Float31", "embedded-value=false public HashMap HashMapOfString_Float32", "public HashMap HashMapOfString_Integer33", "embedded-value=true public HashMap HashMapOfString_Integer34", "embedded-value=false public HashMap HashMapOfString_Integer35", "public HashMap HashMapOfString_Long36", "embedded-value=true public HashMap HashMapOfString_Long37", "embedded-value=false public HashMap HashMapOfString_Long38", "public HashMap HashMapOfString_Short39", "embedded-value=true public HashMap HashMapOfString_Short40", "embedded-value=false public HashMap HashMapOfString_Short41", "embedded-key=true public HashMap HashMapOfString_Object42", "embedded-key=true embedded-value=true public HashMap HashMapOfString_Object43", "embedded-key=true public HashMap HashMapOfString_SimpleClass45", "embedded-key=true embedded-value=true public HashMap HashMapOfString_SimpleClass46", "embedded-key=true public HashMap HashMapOfString_SimpleInterface48", "embedded-key=true embedded-value=true public HashMap HashMapOfString_SimpleInterface49", "embedded-key=true public HashMap HashMapOfString_String51", "embedded-key=true embedded-value=true public HashMap HashMapOfString_String52", "embedded-key=true public HashMap HashMapOfString_Date54", "embedded-key=true embedded-value=true public HashMap HashMapOfString_Date55", "embedded-key=true public HashMap HashMapOfString_Locale57", "embedded-key=true embedded-value=true public HashMap HashMapOfString_Locale58", "embedded-key=true public HashMap HashMapOfString_BigDecimal60", "embedded-key=true embedded-value=true public HashMap HashMapOfString_BigDecimal61", "embedded-key=true public HashMap HashMapOfString_BigInteger63", "embedded-key=true embedded-value=true public HashMap HashMapOfString_BigInteger64", "embedded-key=true public HashMap HashMapOfString_Byte66", "embedded-key=true embedded-value=true public HashMap HashMapOfString_Byte67", "embedded-key=true public HashMap HashMapOfString_Double69", "embedded-key=true embedded-value=true public HashMap HashMapOfString_Double70", "embedded-key=true public HashMap HashMapOfString_Float72", "embedded-key=true embedded-value=true public HashMap HashMapOfString_Float73", "embedded-key=true public HashMap HashMapOfString_Integer75", "embedded-key=true embedded-value=true public HashMap HashMapOfString_Integer76", "embedded-key=true public HashMap HashMapOfString_Long78", "embedded-key=true embedded-value=true public HashMap HashMapOfString_Long79", "embedded-key=true public HashMap HashMapOfString_Short81", "embedded-key=true embedded-value=true public HashMap HashMapOfString_Short82", "embedded-key=false public HashMap HashMapOfString_Object84", "embedded-key=false embedded-value=false public HashMap HashMapOfString_Object86", "embedded-key=false public HashMap HashMapOfString_SimpleClass87", "embedded-key=false embedded-value=false public HashMap HashMapOfString_SimpleClass89", "embedded-key=false public HashMap HashMapOfString_SimpleInterface90", "embedded-key=false embedded-value=false public HashMap HashMapOfString_SimpleInterface92", "embedded-key=false public HashMap HashMapOfString_String93", "embedded-key=false embedded-value=false public HashMap HashMapOfString_String95", "embedded-key=false public HashMap HashMapOfString_Date96", "embedded-key=false embedded-value=false public HashMap HashMapOfString_Date98", "embedded-key=false public HashMap HashMapOfString_Locale99", "embedded-key=false embedded-value=false public HashMap HashMapOfString_Locale101", "embedded-key=false public HashMap HashMapOfString_BigDecimal102", "embedded-key=false embedded-value=false public HashMap HashMapOfString_BigDecimal104", "embedded-key=false public HashMap HashMapOfString_BigInteger105", "embedded-key=false embedded-value=false public HashMap HashMapOfString_BigInteger107", "embedded-key=false public HashMap HashMapOfString_Byte108", "embedded-key=false embedded-value=false public HashMap HashMapOfString_Byte110", "embedded-key=false public HashMap HashMapOfString_Double111", "embedded-key=false embedded-value=false public HashMap HashMapOfString_Double113", "embedded-key=false public HashMap HashMapOfString_Float114", "embedded-key=false embedded-value=false public HashMap HashMapOfString_Float116", "embedded-key=false public HashMap HashMapOfString_Integer117", "embedded-key=false embedded-value=false public HashMap HashMapOfString_Integer119", "embedded-key=false public HashMap HashMapOfString_Long120", "embedded-key=false embedded-value=false public HashMap HashMapOfString_Long122", "embedded-key=false public HashMap HashMapOfString_Short123", "embedded-key=false embedded-value=false public HashMap HashMapOfString_Short125" }; public int getLength() { return fieldSpecs.length; } public HashMap get(int index) { switch (index) { case(0): return HashMapOfString_Object0; case(1): return HashMapOfString_Object1; case(2): return HashMapOfString_Object2; case(3): return HashMapOfString_SimpleClass3; case(4): return HashMapOfString_SimpleClass4; case(5): return HashMapOfString_SimpleClass5; case(6): return HashMapOfString_SimpleInterface6; case(7): return HashMapOfString_SimpleInterface7; case(8): return HashMapOfString_SimpleInterface8; case(9): return HashMapOfString_String9; case(10): return HashMapOfString_String10; case(11): return HashMapOfString_String11; case(12): return HashMapOfString_Date12; case(13): return HashMapOfString_Date13; case(14): return HashMapOfString_Date14; case(15): return HashMapOfString_Locale15; case(16): return HashMapOfString_Locale16; case(17): return HashMapOfString_Locale17; case(18): return HashMapOfString_BigDecimal18; case(19): return HashMapOfString_BigDecimal19; case(20): return HashMapOfString_BigDecimal20; case(21): return HashMapOfString_BigInteger21; case(22): return HashMapOfString_BigInteger22; case(23): return HashMapOfString_BigInteger23; case(24): return HashMapOfString_Byte24; case(25): return HashMapOfString_Byte25; case(26): return HashMapOfString_Byte26; case(27): return HashMapOfString_Double27; case(28): return HashMapOfString_Double28; case(29): return HashMapOfString_Double29; case(30): return HashMapOfString_Float30; case(31): return HashMapOfString_Float31; case(32): return HashMapOfString_Float32; case(33): return HashMapOfString_Integer33; case(34): return HashMapOfString_Integer34; case(35): return HashMapOfString_Integer35; case(36): return HashMapOfString_Long36; case(37): return HashMapOfString_Long37; case(38): return HashMapOfString_Long38; case(39): return HashMapOfString_Short39; case(40): return HashMapOfString_Short40; case(41): return HashMapOfString_Short41; case(42): return HashMapOfString_Object42; case(43): return HashMapOfString_Object43; case(44): return HashMapOfString_SimpleClass45; case(45): return HashMapOfString_SimpleClass46; case(46): return HashMapOfString_SimpleInterface48; case(47): return HashMapOfString_SimpleInterface49; case(48): return HashMapOfString_String51; case(49): return HashMapOfString_String52; case(50): return HashMapOfString_Date54; case(51): return HashMapOfString_Date55; case(52): return HashMapOfString_Locale57; case(53): return HashMapOfString_Locale58; case(54): return HashMapOfString_BigDecimal60; case(55): return HashMapOfString_BigDecimal61; case(56): return HashMapOfString_BigInteger63; case(57): return HashMapOfString_BigInteger64; case(58): return HashMapOfString_Byte66; case(59): return HashMapOfString_Byte67; case(60): return HashMapOfString_Double69; case(61): return HashMapOfString_Double70; case(62): return HashMapOfString_Float72; case(63): return HashMapOfString_Float73; case(64): return HashMapOfString_Integer75; case(65): return HashMapOfString_Integer76; case(66): return HashMapOfString_Long78; case(67): return HashMapOfString_Long79; case(68): return HashMapOfString_Short81; case(69): return HashMapOfString_Short82; case(70): return HashMapOfString_Object84; case(71): return HashMapOfString_Object86; case(72): return HashMapOfString_SimpleClass87; case(73): return HashMapOfString_SimpleClass89; case(74): return HashMapOfString_SimpleInterface90; case(75): return HashMapOfString_SimpleInterface92; case(76): return HashMapOfString_String93; case(77): return HashMapOfString_String95; case(78): return HashMapOfString_Date96; case(79): return HashMapOfString_Date98; case(80): return HashMapOfString_Locale99; case(81): return HashMapOfString_Locale101; case(82): return HashMapOfString_BigDecimal102; case(83): return HashMapOfString_BigDecimal104; case(84): return HashMapOfString_BigInteger105; case(85): return HashMapOfString_BigInteger107; case(86): return HashMapOfString_Byte108; case(87): return HashMapOfString_Byte110; case(88): return HashMapOfString_Double111; case(89): return HashMapOfString_Double113; case(90): return HashMapOfString_Float114; case(91): return HashMapOfString_Float116; case(92): return HashMapOfString_Integer117; case(93): return HashMapOfString_Integer119; case(94): return HashMapOfString_Long120; case(95): return HashMapOfString_Long122; case(96): return HashMapOfString_Short123; case(97): return HashMapOfString_Short125; default: throw new IndexOutOfBoundsException(); } } public boolean set(int index,HashMap value) { if(fieldSpecs[index].indexOf("final") != -1) return false; switch (index) { case(0): HashMapOfString_Object0= value; break; case(1): HashMapOfString_Object1= value; break; case(2): HashMapOfString_Object2= value; break; case(3): HashMapOfString_SimpleClass3= value; break; case(4): HashMapOfString_SimpleClass4= value; break; case(5): HashMapOfString_SimpleClass5= value; break; case(6): HashMapOfString_SimpleInterface6= value; break; case(7): HashMapOfString_SimpleInterface7= value; break; case(8): HashMapOfString_SimpleInterface8= value; break; case(9): HashMapOfString_String9= value; break; case(10): HashMapOfString_String10= value; break; case(11): HashMapOfString_String11= value; break; case(12): HashMapOfString_Date12= value; break; case(13): HashMapOfString_Date13= value; break; case(14): HashMapOfString_Date14= value; break; case(15): HashMapOfString_Locale15= value; break; case(16): HashMapOfString_Locale16= value; break; case(17): HashMapOfString_Locale17= value; break; case(18): HashMapOfString_BigDecimal18= value; break; case(19): HashMapOfString_BigDecimal19= value; break; case(20): HashMapOfString_BigDecimal20= value; break; case(21): HashMapOfString_BigInteger21= value; break; case(22): HashMapOfString_BigInteger22= value; break; case(23): HashMapOfString_BigInteger23= value; break; case(24): HashMapOfString_Byte24= value; break; case(25): HashMapOfString_Byte25= value; break; case(26): HashMapOfString_Byte26= value; break; case(27): HashMapOfString_Double27= value; break; case(28): HashMapOfString_Double28= value; break; case(29): HashMapOfString_Double29= value; break; case(30): HashMapOfString_Float30= value; break; case(31): HashMapOfString_Float31= value; break; case(32): HashMapOfString_Float32= value; break; case(33): HashMapOfString_Integer33= value; break; case(34): HashMapOfString_Integer34= value; break; case(35): HashMapOfString_Integer35= value; break; case(36): HashMapOfString_Long36= value; break; case(37): HashMapOfString_Long37= value; break; case(38): HashMapOfString_Long38= value; break; case(39): HashMapOfString_Short39= value; break; case(40): HashMapOfString_Short40= value; break; case(41): HashMapOfString_Short41= value; break; case(42): HashMapOfString_Object42= value; break; case(43): HashMapOfString_Object43= value; break; case(44): HashMapOfString_SimpleClass45= value; break; case(45): HashMapOfString_SimpleClass46= value; break; case(46): HashMapOfString_SimpleInterface48= value; break; case(47): HashMapOfString_SimpleInterface49= value; break; case(48): HashMapOfString_String51= value; break; case(49): HashMapOfString_String52= value; break; case(50): HashMapOfString_Date54= value; break; case(51): HashMapOfString_Date55= value; break; case(52): HashMapOfString_Locale57= value; break; case(53): HashMapOfString_Locale58= value; break; case(54): HashMapOfString_BigDecimal60= value; break; case(55): HashMapOfString_BigDecimal61= value; break; case(56): HashMapOfString_BigInteger63= value; break; case(57): HashMapOfString_BigInteger64= value; break; case(58): HashMapOfString_Byte66= value; break; case(59): HashMapOfString_Byte67= value; break; case(60): HashMapOfString_Double69= value; break; case(61): HashMapOfString_Double70= value; break; case(62): HashMapOfString_Float72= value; break; case(63): HashMapOfString_Float73= value; break; case(64): HashMapOfString_Integer75= value; break; case(65): HashMapOfString_Integer76= value; break; case(66): HashMapOfString_Long78= value; break; case(67): HashMapOfString_Long79= value; break; case(68): HashMapOfString_Short81= value; break; case(69): HashMapOfString_Short82= value; break; case(70): HashMapOfString_Object84= value; break; case(71): HashMapOfString_Object86= value; break; case(72): HashMapOfString_SimpleClass87= value; break; case(73): HashMapOfString_SimpleClass89= value; break; case(74): HashMapOfString_SimpleInterface90= value; break; case(75): HashMapOfString_SimpleInterface92= value; break; case(76): HashMapOfString_String93= value; break; case(77): HashMapOfString_String95= value; break; case(78): HashMapOfString_Date96= value; break; case(79): HashMapOfString_Date98= value; break; case(80): HashMapOfString_Locale99= value; break; case(81): HashMapOfString_Locale101= value; break; case(82): HashMapOfString_BigDecimal102= value; break; case(83): HashMapOfString_BigDecimal104= value; break; case(84): HashMapOfString_BigInteger105= value; break; case(85): HashMapOfString_BigInteger107= value; break; case(86): HashMapOfString_Byte108= value; break; case(87): HashMapOfString_Byte110= value; break; case(88): HashMapOfString_Double111= value; break; case(89): HashMapOfString_Double113= value; break; case(90): HashMapOfString_Float114= value; break; case(91): HashMapOfString_Float116= value; break; case(92): HashMapOfString_Integer117= value; break; case(93): HashMapOfString_Integer119= value; break; case(94): HashMapOfString_Long120= value; break; case(95): HashMapOfString_Long122= value; break; case(96): HashMapOfString_Short123= value; break; case(97): HashMapOfString_Short125= value; break; default: throw new IndexOutOfBoundsException(); } return true; } public static class Oid implements Serializable { public int identifier; public Oid() { } public Oid(String s) { identifier = Integer.parseInt(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + identifier;} public int hashCode() { return (int)identifier ; } public boolean equals(Object other) { if (other != null && (other instanceof Oid)) { Oid k = (Oid)other; return k.identifier == this.identifier; } return false; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } } } tck/src/java/org/apache/jdo/tck/pc/fieldtypes/HashMapStringValueCollections.java100664 57705 12500110373 30304 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.io.Serializable; import java.util.HashMap; public class HashMapStringValueCollections { public int identifier; public HashMap HashMapOfObject_String0; public HashMap HashMapOfObject_String1; public HashMap HashMapOfObject_String2; public HashMap HashMapOfObject_String3; public HashMap HashMapOfObject_String4; public HashMap HashMapOfObject_String6; public HashMap HashMapOfObject_String8; public HashMap HashMapOfSimpleClass_String9; public HashMap HashMapOfSimpleClass_String10; public HashMap HashMapOfSimpleClass_String11; public HashMap HashMapOfSimpleClass_String12; public HashMap HashMapOfSimpleClass_String13; public HashMap HashMapOfSimpleClass_String15; public HashMap HashMapOfSimpleClass_String17; public HashMap HashMapOfSimpleInterface_String18; public HashMap HashMapOfSimpleInterface_String19; public HashMap HashMapOfSimpleInterface_String20; public HashMap HashMapOfSimpleInterface_String21; public HashMap HashMapOfSimpleInterface_String22; public HashMap HashMapOfSimpleInterface_String24; public HashMap HashMapOfSimpleInterface_String26; public HashMap HashMapOfString_String27; public HashMap HashMapOfString_String28; public HashMap HashMapOfString_String29; public HashMap HashMapOfString_String30; public HashMap HashMapOfString_String31; public HashMap HashMapOfString_String33; public HashMap HashMapOfString_String35; public HashMap HashMapOfDate_String36; public HashMap HashMapOfDate_String37; public HashMap HashMapOfDate_String38; public HashMap HashMapOfDate_String39; public HashMap HashMapOfDate_String40; public HashMap HashMapOfDate_String42; public HashMap HashMapOfDate_String44; public HashMap HashMapOfBigDecimal_String45; public HashMap HashMapOfBigDecimal_String46; public HashMap HashMapOfBigDecimal_String47; public HashMap HashMapOfBigDecimal_String48; public HashMap HashMapOfBigDecimal_String49; public HashMap HashMapOfBigDecimal_String51; public HashMap HashMapOfBigDecimal_String53; public HashMap HashMapOfBigInteger_String54; public HashMap HashMapOfBigInteger_String55; public HashMap HashMapOfBigInteger_String56; public HashMap HashMapOfBigInteger_String57; public HashMap HashMapOfBigInteger_String58; public HashMap HashMapOfBigInteger_String60; public HashMap HashMapOfBigInteger_String62; public HashMap HashMapOfByte_String63; public HashMap HashMapOfByte_String64; public HashMap HashMapOfByte_String65; public HashMap HashMapOfByte_String66; public HashMap HashMapOfByte_String67; public HashMap HashMapOfByte_String69; public HashMap HashMapOfByte_String71; public HashMap HashMapOfDouble_String72; public HashMap HashMapOfDouble_String73; public HashMap HashMapOfDouble_String74; public HashMap HashMapOfDouble_String75; public HashMap HashMapOfDouble_String76; public HashMap HashMapOfDouble_String78; public HashMap HashMapOfDouble_String80; public HashMap HashMapOfFloat_String81; public HashMap HashMapOfFloat_String82; public HashMap HashMapOfFloat_String83; public HashMap HashMapOfFloat_String84; public HashMap HashMapOfFloat_String85; public HashMap HashMapOfFloat_String87; public HashMap HashMapOfFloat_String89; public HashMap HashMapOfInteger_String90; public HashMap HashMapOfInteger_String91; public HashMap HashMapOfInteger_String92; public HashMap HashMapOfInteger_String93; public HashMap HashMapOfInteger_String94; public HashMap HashMapOfInteger_String96; public HashMap HashMapOfInteger_String98; public HashMap HashMapOfLong_String99; public HashMap HashMapOfLong_String100; public HashMap HashMapOfLong_String101; public HashMap HashMapOfLong_String102; public HashMap HashMapOfLong_String103; public HashMap HashMapOfLong_String105; public HashMap HashMapOfLong_String107; public HashMap HashMapOfShort_String108; public HashMap HashMapOfShort_String109; public HashMap HashMapOfShort_String110; public HashMap HashMapOfShort_String111; public HashMap HashMapOfShort_String112; public HashMap HashMapOfShort_String114; public HashMap HashMapOfShort_String116; public static final String [] fieldSpecs = { "public HashMap HashMapOfObject_String0", "embedded-value=true public HashMap HashMapOfObject_String1", "embedded-value=false public HashMap HashMapOfObject_String2", "embedded-key=true public HashMap HashMapOfObject_String3", "embedded-key=true embedded-value=true public HashMap HashMapOfObject_String4", "embedded-key=false public HashMap HashMapOfObject_String6", "embedded-key=false embedded-value=false public HashMap HashMapOfObject_String8", "public HashMap HashMapOfSimpleClass_String9", "embedded-value=true public HashMap HashMapOfSimpleClass_String10", "embedded-value=false public HashMap HashMapOfSimpleClass_String11", "embedded-key=true public HashMap HashMapOfSimpleClass_String12", "embedded-key=true embedded-value=true public HashMap HashMapOfSimpleClass_String13", "embedded-key=false public HashMap HashMapOfSimpleClass_String15", "embedded-key=false embedded-value=false public HashMap HashMapOfSimpleClass_String17", "public HashMap HashMapOfSimpleInterface_String18", "embedded-value=true public HashMap HashMapOfSimpleInterface_String19", "embedded-value=false public HashMap HashMapOfSimpleInterface_String20", "embedded-key=true public HashMap HashMapOfSimpleInterface_String21", "embedded-key=true embedded-value=true public HashMap HashMapOfSimpleInterface_String22", "embedded-key=false public HashMap HashMapOfSimpleInterface_String24", "embedded-key=false embedded-value=false public HashMap HashMapOfSimpleInterface_String26", "public HashMap HashMapOfString_String27", "embedded-value=true public HashMap HashMapOfString_String28", "embedded-value=false public HashMap HashMapOfString_String29", "embedded-key=true public HashMap HashMapOfString_String30", "embedded-key=true embedded-value=true public HashMap HashMapOfString_String31", "embedded-key=false public HashMap HashMapOfString_String33", "embedded-key=false embedded-value=false public HashMap HashMapOfString_String35", "public HashMap HashMapOfDate_String36", "embedded-value=true public HashMap HashMapOfDate_String37", "embedded-value=false public HashMap HashMapOfDate_String38", "embedded-key=true public HashMap HashMapOfDate_String39", "embedded-key=true embedded-value=true public HashMap HashMapOfDate_String40", "embedded-key=false public HashMap HashMapOfDate_String42", "embedded-key=false embedded-value=false public HashMap HashMapOfDate_String44", "public HashMap HashMapOfBigDecimal_String45", "embedded-value=true public HashMap HashMapOfBigDecimal_String46", "embedded-value=false public HashMap HashMapOfBigDecimal_String47", "embedded-key=true public HashMap HashMapOfBigDecimal_String48", "embedded-key=true embedded-value=true public HashMap HashMapOfBigDecimal_String49", "embedded-key=false public HashMap HashMapOfBigDecimal_String51", "embedded-key=false embedded-value=false public HashMap HashMapOfBigDecimal_String53", "public HashMap HashMapOfBigInteger_String54", "embedded-value=true public HashMap HashMapOfBigInteger_String55", "embedded-value=false public HashMap HashMapOfBigInteger_String56", "embedded-key=true public HashMap HashMapOfBigInteger_String57", "embedded-key=true embedded-value=true public HashMap HashMapOfBigInteger_String58", "embedded-key=false public HashMap HashMapOfBigInteger_String60", "embedded-key=false embedded-value=false public HashMap HashMapOfBigInteger_String62", "public HashMap HashMapOfByte_String63", "embedded-value=true public HashMap HashMapOfByte_String64", "embedded-value=false public HashMap HashMapOfByte_String65", "embedded-key=true public HashMap HashMapOfByte_String66", "embedded-key=true embedded-value=true public HashMap HashMapOfByte_String67", "embedded-key=false public HashMap HashMapOfByte_String69", "embedded-key=false embedded-value=false public HashMap HashMapOfByte_String71", "public HashMap HashMapOfDouble_String72", "embedded-value=true public HashMap HashMapOfDouble_String73", "embedded-value=false public HashMap HashMapOfDouble_String74", "embedded-key=true public HashMap HashMapOfDouble_String75", "embedded-key=true embedded-value=true public HashMap HashMapOfDouble_String76", "embedded-key=false public HashMap HashMapOfDouble_String78", "embedded-key=false embedded-value=false public HashMap HashMapOfDouble_String80", "public HashMap HashMapOfFloat_String81", "embedded-value=true public HashMap HashMapOfFloat_String82", "embedded-value=false public HashMap HashMapOfFloat_String83", "embedded-key=true public HashMap HashMapOfFloat_String84", "embedded-key=true embedded-value=true public HashMap HashMapOfFloat_String85", "embedded-key=false public HashMap HashMapOfFloat_String87", "embedded-key=false embedded-value=false public HashMap HashMapOfFloat_String89", "public HashMap HashMapOfInteger_String90", "embedded-value=true public HashMap HashMapOfInteger_String91", "embedded-value=false public HashMap HashMapOfInteger_String92", "embedded-key=true public HashMap HashMapOfInteger_String93", "embedded-key=true embedded-value=true public HashMap HashMapOfInteger_String94", "embedded-key=false public HashMap HashMapOfInteger_String96", "embedded-key=false embedded-value=false public HashMap HashMapOfInteger_String98", "public HashMap HashMapOfLong_String99", "embedded-value=true public HashMap HashMapOfLong_String100", "embedded-value=false public HashMap HashMapOfLong_String101", "embedded-key=true public HashMap HashMapOfLong_String102", "embedded-key=true embedded-value=true public HashMap HashMapOfLong_String103", "embedded-key=false public HashMap HashMapOfLong_String105", "embedded-key=false embedded-value=false public HashMap HashMapOfLong_String107", "public HashMap HashMapOfShort_String108", "embedded-value=true public HashMap HashMapOfShort_String109", "embedded-value=false public HashMap HashMapOfShort_String110", "embedded-key=true public HashMap HashMapOfShort_String111", "embedded-key=true embedded-value=true public HashMap HashMapOfShort_String112", "embedded-key=false public HashMap HashMapOfShort_String114", "embedded-key=false embedded-value=false public HashMap HashMapOfShort_String116" }; public int getLength() { return fieldSpecs.length; } public HashMap get(int index) { switch (index) { case(0): return HashMapOfObject_String0; case(1): return HashMapOfObject_String1; case(2): return HashMapOfObject_String2; case(3): return HashMapOfObject_String3; case(4): return HashMapOfObject_String4; case(5): return HashMapOfObject_String6; case(6): return HashMapOfObject_String8; case(7): return HashMapOfSimpleClass_String9; case(8): return HashMapOfSimpleClass_String10; case(9): return HashMapOfSimpleClass_String11; case(10): return HashMapOfSimpleClass_String12; case(11): return HashMapOfSimpleClass_String13; case(12): return HashMapOfSimpleClass_String15; case(13): return HashMapOfSimpleClass_String17; case(14): return HashMapOfSimpleInterface_String18; case(15): return HashMapOfSimpleInterface_String19; case(16): return HashMapOfSimpleInterface_String20; case(17): return HashMapOfSimpleInterface_String21; case(18): return HashMapOfSimpleInterface_String22; case(19): return HashMapOfSimpleInterface_String24; case(20): return HashMapOfSimpleInterface_String26; case(21): return HashMapOfString_String27; case(22): return HashMapOfString_String28; case(23): return HashMapOfString_String29; case(24): return HashMapOfString_String30; case(25): return HashMapOfString_String31; case(26): return HashMapOfString_String33; case(27): return HashMapOfString_String35; case(28): return HashMapOfDate_String36; case(29): return HashMapOfDate_String37; case(30): return HashMapOfDate_String38; case(31): return HashMapOfDate_String39; case(32): return HashMapOfDate_String40; case(33): return HashMapOfDate_String42; case(34): return HashMapOfDate_String44; case(35): return HashMapOfBigDecimal_String45; case(36): return HashMapOfBigDecimal_String46; case(37): return HashMapOfBigDecimal_String47; case(38): return HashMapOfBigDecimal_String48; case(39): return HashMapOfBigDecimal_String49; case(40): return HashMapOfBigDecimal_String51; case(41): return HashMapOfBigDecimal_String53; case(42): return HashMapOfBigInteger_String54; case(43): return HashMapOfBigInteger_String55; case(44): return HashMapOfBigInteger_String56; case(45): return HashMapOfBigInteger_String57; case(46): return HashMapOfBigInteger_String58; case(47): return HashMapOfBigInteger_String60; case(48): return HashMapOfBigInteger_String62; case(49): return HashMapOfByte_String63; case(50): return HashMapOfByte_String64; case(51): return HashMapOfByte_String65; case(52): return HashMapOfByte_String66; case(53): return HashMapOfByte_String67; case(54): return HashMapOfByte_String69; case(55): return HashMapOfByte_String71; case(56): return HashMapOfDouble_String72; case(57): return HashMapOfDouble_String73; case(58): return HashMapOfDouble_String74; case(59): return HashMapOfDouble_String75; case(60): return HashMapOfDouble_String76; case(61): return HashMapOfDouble_String78; case(62): return HashMapOfDouble_String80; case(63): return HashMapOfFloat_String81; case(64): return HashMapOfFloat_String82; case(65): return HashMapOfFloat_String83; case(66): return HashMapOfFloat_String84; case(67): return HashMapOfFloat_String85; case(68): return HashMapOfFloat_String87; case(69): return HashMapOfFloat_String89; case(70): return HashMapOfInteger_String90; case(71): return HashMapOfInteger_String91; case(72): return HashMapOfInteger_String92; case(73): return HashMapOfInteger_String93; case(74): return HashMapOfInteger_String94; case(75): return HashMapOfInteger_String96; case(76): return HashMapOfInteger_String98; case(77): return HashMapOfLong_String99; case(78): return HashMapOfLong_String100; case(79): return HashMapOfLong_String101; case(80): return HashMapOfLong_String102; case(81): return HashMapOfLong_String103; case(82): return HashMapOfLong_String105; case(83): return HashMapOfLong_String107; case(84): return HashMapOfShort_String108; case(85): return HashMapOfShort_String109; case(86): return HashMapOfShort_String110; case(87): return HashMapOfShort_String111; case(88): return HashMapOfShort_String112; case(89): return HashMapOfShort_String114; case(90): return HashMapOfShort_String116; default: throw new IndexOutOfBoundsException(); } } public boolean set(int index,HashMap value) { if(fieldSpecs[index].indexOf("final") != -1) return false; switch (index) { case(0): HashMapOfObject_String0= value; break; case(1): HashMapOfObject_String1= value; break; case(2): HashMapOfObject_String2= value; break; case(3): HashMapOfObject_String3= value; break; case(4): HashMapOfObject_String4= value; break; case(5): HashMapOfObject_String6= value; break; case(6): HashMapOfObject_String8= value; break; case(7): HashMapOfSimpleClass_String9= value; break; case(8): HashMapOfSimpleClass_String10= value; break; case(9): HashMapOfSimpleClass_String11= value; break; case(10): HashMapOfSimpleClass_String12= value; break; case(11): HashMapOfSimpleClass_String13= value; break; case(12): HashMapOfSimpleClass_String15= value; break; case(13): HashMapOfSimpleClass_String17= value; break; case(14): HashMapOfSimpleInterface_String18= value; break; case(15): HashMapOfSimpleInterface_String19= value; break; case(16): HashMapOfSimpleInterface_String20= value; break; case(17): HashMapOfSimpleInterface_String21= value; break; case(18): HashMapOfSimpleInterface_String22= value; break; case(19): HashMapOfSimpleInterface_String24= value; break; case(20): HashMapOfSimpleInterface_String26= value; break; case(21): HashMapOfString_String27= value; break; case(22): HashMapOfString_String28= value; break; case(23): HashMapOfString_String29= value; break; case(24): HashMapOfString_String30= value; break; case(25): HashMapOfString_String31= value; break; case(26): HashMapOfString_String33= value; break; case(27): HashMapOfString_String35= value; break; case(28): HashMapOfDate_String36= value; break; case(29): HashMapOfDate_String37= value; break; case(30): HashMapOfDate_String38= value; break; case(31): HashMapOfDate_String39= value; break; case(32): HashMapOfDate_String40= value; break; case(33): HashMapOfDate_String42= value; break; case(34): HashMapOfDate_String44= value; break; case(35): HashMapOfBigDecimal_String45= value; break; case(36): HashMapOfBigDecimal_String46= value; break; case(37): HashMapOfBigDecimal_String47= value; break; case(38): HashMapOfBigDecimal_String48= value; break; case(39): HashMapOfBigDecimal_String49= value; break; case(40): HashMapOfBigDecimal_String51= value; break; case(41): HashMapOfBigDecimal_String53= value; break; case(42): HashMapOfBigInteger_String54= value; break; case(43): HashMapOfBigInteger_String55= value; break; case(44): HashMapOfBigInteger_String56= value; break; case(45): HashMapOfBigInteger_String57= value; break; case(46): HashMapOfBigInteger_String58= value; break; case(47): HashMapOfBigInteger_String60= value; break; case(48): HashMapOfBigInteger_String62= value; break; case(49): HashMapOfByte_String63= value; break; case(50): HashMapOfByte_String64= value; break; case(51): HashMapOfByte_String65= value; break; case(52): HashMapOfByte_String66= value; break; case(53): HashMapOfByte_String67= value; break; case(54): HashMapOfByte_String69= value; break; case(55): HashMapOfByte_String71= value; break; case(56): HashMapOfDouble_String72= value; break; case(57): HashMapOfDouble_String73= value; break; case(58): HashMapOfDouble_String74= value; break; case(59): HashMapOfDouble_String75= value; break; case(60): HashMapOfDouble_String76= value; break; case(61): HashMapOfDouble_String78= value; break; case(62): HashMapOfDouble_String80= value; break; case(63): HashMapOfFloat_String81= value; break; case(64): HashMapOfFloat_String82= value; break; case(65): HashMapOfFloat_String83= value; break; case(66): HashMapOfFloat_String84= value; break; case(67): HashMapOfFloat_String85= value; break; case(68): HashMapOfFloat_String87= value; break; case(69): HashMapOfFloat_String89= value; break; case(70): HashMapOfInteger_String90= value; break; case(71): HashMapOfInteger_String91= value; break; case(72): HashMapOfInteger_String92= value; break; case(73): HashMapOfInteger_String93= value; break; case(74): HashMapOfInteger_String94= value; break; case(75): HashMapOfInteger_String96= value; break; case(76): HashMapOfInteger_String98= value; break; case(77): HashMapOfLong_String99= value; break; case(78): HashMapOfLong_String100= value; break; case(79): HashMapOfLong_String101= value; break; case(80): HashMapOfLong_String102= value; break; case(81): HashMapOfLong_String103= value; break; case(82): HashMapOfLong_String105= value; break; case(83): HashMapOfLong_String107= value; break; case(84): HashMapOfShort_String108= value; break; case(85): HashMapOfShort_String109= value; break; case(86): HashMapOfShort_String110= value; break; case(87): HashMapOfShort_String111= value; break; case(88): HashMapOfShort_String112= value; break; case(89): HashMapOfShort_String114= value; break; case(90): HashMapOfShort_String116= value; break; default: throw new IndexOutOfBoundsException(); } return true; } public static class Oid implements Serializable { public int identifier; public Oid() { } public Oid(String s) { identifier = Integer.parseInt(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + identifier;} public int hashCode() { return (int)identifier ; } public boolean equals(Object other) { if (other != null && (other instanceof Oid)) { Oid k = (Oid)other; return k.identifier == this.identifier; } return false; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } } } tck/src/java/org/apache/jdo/tck/pc/fieldtypes/HashSetCollections.java100664 25615 12500110373 26131 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.io.Serializable; import java.util.HashSet; public class HashSetCollections { public int identifier; public HashSet HashSetOfObject0; public HashSet HashSetOfObject1; public HashSet HashSetOfObject2; public HashSet HashSetOfSimpleClass3; public HashSet HashSetOfSimpleClass4; public HashSet HashSetOfSimpleClass5; public HashSet HashSetOfSimpleInterface6; public HashSet HashSetOfSimpleInterface7; public HashSet HashSetOfSimpleInterface8; public HashSet HashSetOfString9; public HashSet HashSetOfString10; public HashSet HashSetOfString11; public HashSet HashSetOfDate12; public HashSet HashSetOfDate13; public HashSet HashSetOfDate14; public HashSet HashSetOfLocale15; public HashSet HashSetOfLocale16; public HashSet HashSetOfLocale17; public HashSet HashSetOfBigDecimal18; public HashSet HashSetOfBigDecimal19; public HashSet HashSetOfBigDecimal20; public HashSet HashSetOfBigInteger21; public HashSet HashSetOfBigInteger22; public HashSet HashSetOfBigInteger23; public HashSet HashSetOfByte24; public HashSet HashSetOfByte25; public HashSet HashSetOfByte26; public HashSet HashSetOfDouble27; public HashSet HashSetOfDouble28; public HashSet HashSetOfDouble29; public HashSet HashSetOfFloat30; public HashSet HashSetOfFloat31; public HashSet HashSetOfFloat32; public HashSet HashSetOfInteger33; public HashSet HashSetOfInteger34; public HashSet HashSetOfInteger35; public HashSet HashSetOfLong36; public HashSet HashSetOfLong37; public HashSet HashSetOfLong38; public HashSet HashSetOfShort39; public HashSet HashSetOfShort40; public HashSet HashSetOfShort41; public HashSet HashSetOfSimpleClass42; public static final String [] fieldSpecs = { "public HashSet HashSetOfObject0", "embedded-element=true public HashSet HashSetOfObject1", "embedded-element=false public HashSet HashSetOfObject2", "public HashSet HashSetOfSimpleClass3", "embedded-element=true public HashSet HashSetOfSimpleClass4", "embedded-element=false public HashSet HashSetOfSimpleClass5", "public HashSet HashSetOfSimpleInterface6", "embedded-element=true public HashSet HashSetOfSimpleInterface7", "embedded-element=false public HashSet HashSetOfSimpleInterface8", "public HashSet HashSetOfString9", "embedded-element=true public HashSet HashSetOfString10", "embedded-element=false public HashSet HashSetOfString11", "public HashSet HashSetOfDate12", "embedded-element=true public HashSet HashSetOfDate13", "embedded-element=false public HashSet HashSetOfDate14", "public HashSet HashSetOfLocale15", "embedded-element=true public HashSet HashSetOfLocale16", "embedded-element=false public HashSet HashSetOfLocale17", "public HashSet HashSetOfBigDecimal18", "embedded-element=true public HashSet HashSetOfBigDecimal19", "embedded-element=false public HashSet HashSetOfBigDecimal20", "public HashSet HashSetOfBigInteger21", "embedded-element=true public HashSet HashSetOfBigInteger22", "embedded-element=false public HashSet HashSetOfBigInteger23", "public HashSet HashSetOfByte24", "embedded-element=true public HashSet HashSetOfByte25", "embedded-element=false public HashSet HashSetOfByte26", "public HashSet HashSetOfDouble27", "embedded-element=true public HashSet HashSetOfDouble28", "embedded-element=false public HashSet HashSetOfDouble29", "public HashSet HashSetOfFloat30", "embedded-element=true public HashSet HashSetOfFloat31", "embedded-element=false public HashSet HashSetOfFloat32", "public HashSet HashSetOfInteger33", "embedded-element=true public HashSet HashSetOfInteger34", "embedded-element=false public HashSet HashSetOfInteger35", "public HashSet HashSetOfLong36", "embedded-element=true public HashSet HashSetOfLong37", "embedded-element=false public HashSet HashSetOfLong38", "public HashSet HashSetOfShort39", "embedded-element=true public HashSet HashSetOfShort40", "embedded-element=false public HashSet HashSetOfShort41", "serialized=true public HashSet HashSetOfSimpleClass42" }; public int getLength() { return fieldSpecs.length; } public HashSet get(int index) { switch (index) { case(0): return HashSetOfObject0; case(1): return HashSetOfObject1; case(2): return HashSetOfObject2; case(3): return HashSetOfSimpleClass3; case(4): return HashSetOfSimpleClass4; case(5): return HashSetOfSimpleClass5; case(6): return HashSetOfSimpleInterface6; case(7): return HashSetOfSimpleInterface7; case(8): return HashSetOfSimpleInterface8; case(9): return HashSetOfString9; case(10): return HashSetOfString10; case(11): return HashSetOfString11; case(12): return HashSetOfDate12; case(13): return HashSetOfDate13; case(14): return HashSetOfDate14; case(15): return HashSetOfLocale15; case(16): return HashSetOfLocale16; case(17): return HashSetOfLocale17; case(18): return HashSetOfBigDecimal18; case(19): return HashSetOfBigDecimal19; case(20): return HashSetOfBigDecimal20; case(21): return HashSetOfBigInteger21; case(22): return HashSetOfBigInteger22; case(23): return HashSetOfBigInteger23; case(24): return HashSetOfByte24; case(25): return HashSetOfByte25; case(26): return HashSetOfByte26; case(27): return HashSetOfDouble27; case(28): return HashSetOfDouble28; case(29): return HashSetOfDouble29; case(30): return HashSetOfFloat30; case(31): return HashSetOfFloat31; case(32): return HashSetOfFloat32; case(33): return HashSetOfInteger33; case(34): return HashSetOfInteger34; case(35): return HashSetOfInteger35; case(36): return HashSetOfLong36; case(37): return HashSetOfLong37; case(38): return HashSetOfLong38; case(39): return HashSetOfShort39; case(40): return HashSetOfShort40; case(41): return HashSetOfShort41; case(42): return HashSetOfSimpleClass42; default: throw new IndexOutOfBoundsException(); } } public boolean set(int index,HashSet value) { if(fieldSpecs[index].indexOf("final") != -1) return false; switch (index) { case(0): HashSetOfObject0= value; break; case(1): HashSetOfObject1= value; break; case(2): HashSetOfObject2= value; break; case(3): HashSetOfSimpleClass3= value; break; case(4): HashSetOfSimpleClass4= value; break; case(5): HashSetOfSimpleClass5= value; break; case(6): HashSetOfSimpleInterface6= value; break; case(7): HashSetOfSimpleInterface7= value; break; case(8): HashSetOfSimpleInterface8= value; break; case(9): HashSetOfString9= value; break; case(10): HashSetOfString10= value; break; case(11): HashSetOfString11= value; break; case(12): HashSetOfDate12= value; break; case(13): HashSetOfDate13= value; break; case(14): HashSetOfDate14= value; break; case(15): HashSetOfLocale15= value; break; case(16): HashSetOfLocale16= value; break; case(17): HashSetOfLocale17= value; break; case(18): HashSetOfBigDecimal18= value; break; case(19): HashSetOfBigDecimal19= value; break; case(20): HashSetOfBigDecimal20= value; break; case(21): HashSetOfBigInteger21= value; break; case(22): HashSetOfBigInteger22= value; break; case(23): HashSetOfBigInteger23= value; break; case(24): HashSetOfByte24= value; break; case(25): HashSetOfByte25= value; break; case(26): HashSetOfByte26= value; break; case(27): HashSetOfDouble27= value; break; case(28): HashSetOfDouble28= value; break; case(29): HashSetOfDouble29= value; break; case(30): HashSetOfFloat30= value; break; case(31): HashSetOfFloat31= value; break; case(32): HashSetOfFloat32= value; break; case(33): HashSetOfInteger33= value; break; case(34): HashSetOfInteger34= value; break; case(35): HashSetOfInteger35= value; break; case(36): HashSetOfLong36= value; break; case(37): HashSetOfLong37= value; break; case(38): HashSetOfLong38= value; break; case(39): HashSetOfShort39= value; break; case(40): HashSetOfShort40= value; break; case(41): HashSetOfShort41= value; break; case(42): HashSetOfSimpleClass42= value; break; default: throw new IndexOutOfBoundsException(); } return true; } public static class Oid implements Serializable { public int identifier; public Oid() { } public Oid(String s) { identifier = Integer.parseInt(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + identifier;} public int hashCode() { return (int)identifier ; } public boolean equals(Object other) { if (other != null && (other instanceof Oid)) { Oid k = (Oid)other; return k.identifier == this.identifier; } return false; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } } } tck/src/java/org/apache/jdo/tck/pc/fieldtypes/HashtableStringKeyCollections.java100664 65446 12500110373 30333 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.io.Serializable; import java.util.Hashtable; public class HashtableStringKeyCollections { public int identifier; public Hashtable HashtableOfString_Object0; public Hashtable HashtableOfString_Object1; public Hashtable HashtableOfString_Object2; public Hashtable HashtableOfString_SimpleClass3; public Hashtable HashtableOfString_SimpleClass4; public Hashtable HashtableOfString_SimpleClass5; public Hashtable HashtableOfString_SimpleInterface6; public Hashtable HashtableOfString_SimpleInterface7; public Hashtable HashtableOfString_SimpleInterface8; public Hashtable HashtableOfString_String9; public Hashtable HashtableOfString_String10; public Hashtable HashtableOfString_String11; public Hashtable HashtableOfString_Date12; public Hashtable HashtableOfString_Date13; public Hashtable HashtableOfString_Date14; public Hashtable HashtableOfString_Locale15; public Hashtable HashtableOfString_Locale16; public Hashtable HashtableOfString_Locale17; public Hashtable HashtableOfString_BigDecimal18; public Hashtable HashtableOfString_BigDecimal19; public Hashtable HashtableOfString_BigDecimal20; public Hashtable HashtableOfString_BigInteger21; public Hashtable HashtableOfString_BigInteger22; public Hashtable HashtableOfString_BigInteger23; public Hashtable HashtableOfString_Byte24; public Hashtable HashtableOfString_Byte25; public Hashtable HashtableOfString_Byte26; public Hashtable HashtableOfString_Double27; public Hashtable HashtableOfString_Double28; public Hashtable HashtableOfString_Double29; public Hashtable HashtableOfString_Float30; public Hashtable HashtableOfString_Float31; public Hashtable HashtableOfString_Float32; public Hashtable HashtableOfString_Integer33; public Hashtable HashtableOfString_Integer34; public Hashtable HashtableOfString_Integer35; public Hashtable HashtableOfString_Long36; public Hashtable HashtableOfString_Long37; public Hashtable HashtableOfString_Long38; public Hashtable HashtableOfString_Short39; public Hashtable HashtableOfString_Short40; public Hashtable HashtableOfString_Short41; public Hashtable HashtableOfString_Object42; public Hashtable HashtableOfString_Object43; public Hashtable HashtableOfString_SimpleClass45; public Hashtable HashtableOfString_SimpleClass46; public Hashtable HashtableOfString_SimpleInterface48; public Hashtable HashtableOfString_SimpleInterface49; public Hashtable HashtableOfString_String51; public Hashtable HashtableOfString_String52; public Hashtable HashtableOfString_Date54; public Hashtable HashtableOfString_Date55; public Hashtable HashtableOfString_Locale57; public Hashtable HashtableOfString_Locale58; public Hashtable HashtableOfString_BigDecimal60; public Hashtable HashtableOfString_BigDecimal61; public Hashtable HashtableOfString_BigInteger63; public Hashtable HashtableOfString_BigInteger64; public Hashtable HashtableOfString_Byte66; public Hashtable HashtableOfString_Byte67; public Hashtable HashtableOfString_Double69; public Hashtable HashtableOfString_Double70; public Hashtable HashtableOfString_Float72; public Hashtable HashtableOfString_Float73; public Hashtable HashtableOfString_Integer75; public Hashtable HashtableOfString_Integer76; public Hashtable HashtableOfString_Long78; public Hashtable HashtableOfString_Long79; public Hashtable HashtableOfString_Short81; public Hashtable HashtableOfString_Short82; public Hashtable HashtableOfString_Object84; public Hashtable HashtableOfString_Object86; public Hashtable HashtableOfString_SimpleClass87; public Hashtable HashtableOfString_SimpleClass89; public Hashtable HashtableOfString_SimpleInterface90; public Hashtable HashtableOfString_SimpleInterface92; public Hashtable HashtableOfString_String93; public Hashtable HashtableOfString_String95; public Hashtable HashtableOfString_Date96; public Hashtable HashtableOfString_Date98; public Hashtable HashtableOfString_Locale99; public Hashtable HashtableOfString_Locale101; public Hashtable HashtableOfString_BigDecimal102; public Hashtable HashtableOfString_BigDecimal104; public Hashtable HashtableOfString_BigInteger105; public Hashtable HashtableOfString_BigInteger107; public Hashtable HashtableOfString_Byte108; public Hashtable HashtableOfString_Byte110; public Hashtable HashtableOfString_Double111; public Hashtable HashtableOfString_Double113; public Hashtable HashtableOfString_Float114; public Hashtable HashtableOfString_Float116; public Hashtable HashtableOfString_Integer117; public Hashtable HashtableOfString_Integer119; public Hashtable HashtableOfString_Long120; public Hashtable HashtableOfString_Long122; public Hashtable HashtableOfString_Short123; public Hashtable HashtableOfString_Short125; public static final String [] fieldSpecs = { "public Hashtable HashtableOfString_Object0", "embedded-value=true public Hashtable HashtableOfString_Object1", "embedded-value=false public Hashtable HashtableOfString_Object2", "public Hashtable HashtableOfString_SimpleClass3", "embedded-value=true public Hashtable HashtableOfString_SimpleClass4", "embedded-value=false public Hashtable HashtableOfString_SimpleClass5", "public Hashtable HashtableOfString_SimpleInterface6", "embedded-value=true public Hashtable HashtableOfString_SimpleInterface7", "embedded-value=false public Hashtable HashtableOfString_SimpleInterface8", "public Hashtable HashtableOfString_String9", "embedded-value=true public Hashtable HashtableOfString_String10", "embedded-value=false public Hashtable HashtableOfString_String11", "public Hashtable HashtableOfString_Date12", "embedded-value=true public Hashtable HashtableOfString_Date13", "embedded-value=false public Hashtable HashtableOfString_Date14", "public Hashtable HashtableOfString_Locale15", "embedded-value=true public Hashtable HashtableOfString_Locale16", "embedded-value=false public Hashtable HashtableOfString_Locale17", "public Hashtable HashtableOfString_BigDecimal18", "embedded-value=true public Hashtable HashtableOfString_BigDecimal19", "embedded-value=false public Hashtable HashtableOfString_BigDecimal20", "public Hashtable HashtableOfString_BigInteger21", "embedded-value=true public Hashtable HashtableOfString_BigInteger22", "embedded-value=false public Hashtable HashtableOfString_BigInteger23", "public Hashtable HashtableOfString_Byte24", "embedded-value=true public Hashtable HashtableOfString_Byte25", "embedded-value=false public Hashtable HashtableOfString_Byte26", "public Hashtable HashtableOfString_Double27", "embedded-value=true public Hashtable HashtableOfString_Double28", "embedded-value=false public Hashtable HashtableOfString_Double29", "public Hashtable HashtableOfString_Float30", "embedded-value=true public Hashtable HashtableOfString_Float31", "embedded-value=false public Hashtable HashtableOfString_Float32", "public Hashtable HashtableOfString_Integer33", "embedded-value=true public Hashtable HashtableOfString_Integer34", "embedded-value=false public Hashtable HashtableOfString_Integer35", "public Hashtable HashtableOfString_Long36", "embedded-value=true public Hashtable HashtableOfString_Long37", "embedded-value=false public Hashtable HashtableOfString_Long38", "public Hashtable HashtableOfString_Short39", "embedded-value=true public Hashtable HashtableOfString_Short40", "embedded-value=false public Hashtable HashtableOfString_Short41", "embedded-key=true public Hashtable HashtableOfString_Object42", "embedded-key=true embedded-value=true public Hashtable HashtableOfString_Object43", "embedded-key=true public Hashtable HashtableOfString_SimpleClass45", "embedded-key=true embedded-value=true public Hashtable HashtableOfString_SimpleClass46", "embedded-key=true public Hashtable HashtableOfString_SimpleInterface48", "embedded-key=true embedded-value=true public Hashtable HashtableOfString_SimpleInterface49", "embedded-key=true public Hashtable HashtableOfString_String51", "embedded-key=true embedded-value=true public Hashtable HashtableOfString_String52", "embedded-key=true public Hashtable HashtableOfString_Date54", "embedded-key=true embedded-value=true public Hashtable HashtableOfString_Date55", "embedded-key=true public Hashtable HashtableOfString_Locale57", "embedded-key=true embedded-value=true public Hashtable HashtableOfString_Locale58", "embedded-key=true public Hashtable HashtableOfString_BigDecimal60", "embedded-key=true embedded-value=true public Hashtable HashtableOfString_BigDecimal61", "embedded-key=true public Hashtable HashtableOfString_BigInteger63", "embedded-key=true embedded-value=true public Hashtable HashtableOfString_BigInteger64", "embedded-key=true public Hashtable HashtableOfString_Byte66", "embedded-key=true embedded-value=true public Hashtable HashtableOfString_Byte67", "embedded-key=true public Hashtable HashtableOfString_Double69", "embedded-key=true embedded-value=true public Hashtable HashtableOfString_Double70", "embedded-key=true public Hashtable HashtableOfString_Float72", "embedded-key=true embedded-value=true public Hashtable HashtableOfString_Float73", "embedded-key=true public Hashtable HashtableOfString_Integer75", "embedded-key=true embedded-value=true public Hashtable HashtableOfString_Integer76", "embedded-key=true public Hashtable HashtableOfString_Long78", "embedded-key=true embedded-value=true public Hashtable HashtableOfString_Long79", "embedded-key=true public Hashtable HashtableOfString_Short81", "embedded-key=true embedded-value=true public Hashtable HashtableOfString_Short82", "embedded-key=false public Hashtable HashtableOfString_Object84", "embedded-key=false embedded-value=false public Hashtable HashtableOfString_Object86", "embedded-key=false public Hashtable HashtableOfString_SimpleClass87", "embedded-key=false embedded-value=false public Hashtable HashtableOfString_SimpleClass89", "embedded-key=false public Hashtable HashtableOfString_SimpleInterface90", "embedded-key=false embedded-value=false public Hashtable HashtableOfString_SimpleInterface92", "embedded-key=false public Hashtable HashtableOfString_String93", "embedded-key=false embedded-value=false public Hashtable HashtableOfString_String95", "embedded-key=false public Hashtable HashtableOfString_Date96", "embedded-key=false embedded-value=false public Hashtable HashtableOfString_Date98", "embedded-key=false public Hashtable HashtableOfString_Locale99", "embedded-key=false embedded-value=false public Hashtable HashtableOfString_Locale101", "embedded-key=false public Hashtable HashtableOfString_BigDecimal102", "embedded-key=false embedded-value=false public Hashtable HashtableOfString_BigDecimal104", "embedded-key=false public Hashtable HashtableOfString_BigInteger105", "embedded-key=false embedded-value=false public Hashtable HashtableOfString_BigInteger107", "embedded-key=false public Hashtable HashtableOfString_Byte108", "embedded-key=false embedded-value=false public Hashtable HashtableOfString_Byte110", "embedded-key=false public Hashtable HashtableOfString_Double111", "embedded-key=false embedded-value=false public Hashtable HashtableOfString_Double113", "embedded-key=false public Hashtable HashtableOfString_Float114", "embedded-key=false embedded-value=false public Hashtable HashtableOfString_Float116", "embedded-key=false public Hashtable HashtableOfString_Integer117", "embedded-key=false embedded-value=false public Hashtable HashtableOfString_Integer119", "embedded-key=false public Hashtable HashtableOfString_Long120", "embedded-key=false embedded-value=false public Hashtable HashtableOfString_Long122", "embedded-key=false public Hashtable HashtableOfString_Short123", "embedded-key=false embedded-value=false public Hashtable HashtableOfString_Short125" }; public int getLength() { return fieldSpecs.length; } public Hashtable get(int index) { switch (index) { case(0): return HashtableOfString_Object0; case(1): return HashtableOfString_Object1; case(2): return HashtableOfString_Object2; case(3): return HashtableOfString_SimpleClass3; case(4): return HashtableOfString_SimpleClass4; case(5): return HashtableOfString_SimpleClass5; case(6): return HashtableOfString_SimpleInterface6; case(7): return HashtableOfString_SimpleInterface7; case(8): return HashtableOfString_SimpleInterface8; case(9): return HashtableOfString_String9; case(10): return HashtableOfString_String10; case(11): return HashtableOfString_String11; case(12): return HashtableOfString_Date12; case(13): return HashtableOfString_Date13; case(14): return HashtableOfString_Date14; case(15): return HashtableOfString_Locale15; case(16): return HashtableOfString_Locale16; case(17): return HashtableOfString_Locale17; case(18): return HashtableOfString_BigDecimal18; case(19): return HashtableOfString_BigDecimal19; case(20): return HashtableOfString_BigDecimal20; case(21): return HashtableOfString_BigInteger21; case(22): return HashtableOfString_BigInteger22; case(23): return HashtableOfString_BigInteger23; case(24): return HashtableOfString_Byte24; case(25): return HashtableOfString_Byte25; case(26): return HashtableOfString_Byte26; case(27): return HashtableOfString_Double27; case(28): return HashtableOfString_Double28; case(29): return HashtableOfString_Double29; case(30): return HashtableOfString_Float30; case(31): return HashtableOfString_Float31; case(32): return HashtableOfString_Float32; case(33): return HashtableOfString_Integer33; case(34): return HashtableOfString_Integer34; case(35): return HashtableOfString_Integer35; case(36): return HashtableOfString_Long36; case(37): return HashtableOfString_Long37; case(38): return HashtableOfString_Long38; case(39): return HashtableOfString_Short39; case(40): return HashtableOfString_Short40; case(41): return HashtableOfString_Short41; case(42): return HashtableOfString_Object42; case(43): return HashtableOfString_Object43; case(44): return HashtableOfString_SimpleClass45; case(45): return HashtableOfString_SimpleClass46; case(46): return HashtableOfString_SimpleInterface48; case(47): return HashtableOfString_SimpleInterface49; case(48): return HashtableOfString_String51; case(49): return HashtableOfString_String52; case(50): return HashtableOfString_Date54; case(51): return HashtableOfString_Date55; case(52): return HashtableOfString_Locale57; case(53): return HashtableOfString_Locale58; case(54): return HashtableOfString_BigDecimal60; case(55): return HashtableOfString_BigDecimal61; case(56): return HashtableOfString_BigInteger63; case(57): return HashtableOfString_BigInteger64; case(58): return HashtableOfString_Byte66; case(59): return HashtableOfString_Byte67; case(60): return HashtableOfString_Double69; case(61): return HashtableOfString_Double70; case(62): return HashtableOfString_Float72; case(63): return HashtableOfString_Float73; case(64): return HashtableOfString_Integer75; case(65): return HashtableOfString_Integer76; case(66): return HashtableOfString_Long78; case(67): return HashtableOfString_Long79; case(68): return HashtableOfString_Short81; case(69): return HashtableOfString_Short82; case(70): return HashtableOfString_Object84; case(71): return HashtableOfString_Object86; case(72): return HashtableOfString_SimpleClass87; case(73): return HashtableOfString_SimpleClass89; case(74): return HashtableOfString_SimpleInterface90; case(75): return HashtableOfString_SimpleInterface92; case(76): return HashtableOfString_String93; case(77): return HashtableOfString_String95; case(78): return HashtableOfString_Date96; case(79): return HashtableOfString_Date98; case(80): return HashtableOfString_Locale99; case(81): return HashtableOfString_Locale101; case(82): return HashtableOfString_BigDecimal102; case(83): return HashtableOfString_BigDecimal104; case(84): return HashtableOfString_BigInteger105; case(85): return HashtableOfString_BigInteger107; case(86): return HashtableOfString_Byte108; case(87): return HashtableOfString_Byte110; case(88): return HashtableOfString_Double111; case(89): return HashtableOfString_Double113; case(90): return HashtableOfString_Float114; case(91): return HashtableOfString_Float116; case(92): return HashtableOfString_Integer117; case(93): return HashtableOfString_Integer119; case(94): return HashtableOfString_Long120; case(95): return HashtableOfString_Long122; case(96): return HashtableOfString_Short123; case(97): return HashtableOfString_Short125; default: throw new IndexOutOfBoundsException("Bad index " + index); } } public boolean set(int index,Hashtable value) { if(fieldSpecs[index].indexOf("final") != -1) return false; switch (index) { case(0): HashtableOfString_Object0= value; break; case(1): HashtableOfString_Object1= value; break; case(2): HashtableOfString_Object2= value; break; case(3): HashtableOfString_SimpleClass3= value; break; case(4): HashtableOfString_SimpleClass4= value; break; case(5): HashtableOfString_SimpleClass5= value; break; case(6): HashtableOfString_SimpleInterface6= value; break; case(7): HashtableOfString_SimpleInterface7= value; break; case(8): HashtableOfString_SimpleInterface8= value; break; case(9): HashtableOfString_String9= value; break; case(10): HashtableOfString_String10= value; break; case(11): HashtableOfString_String11= value; break; case(12): HashtableOfString_Date12= value; break; case(13): HashtableOfString_Date13= value; break; case(14): HashtableOfString_Date14= value; break; case(15): HashtableOfString_Locale15= value; break; case(16): HashtableOfString_Locale16= value; break; case(17): HashtableOfString_Locale17= value; break; case(18): HashtableOfString_BigDecimal18= value; break; case(19): HashtableOfString_BigDecimal19= value; break; case(20): HashtableOfString_BigDecimal20= value; break; case(21): HashtableOfString_BigInteger21= value; break; case(22): HashtableOfString_BigInteger22= value; break; case(23): HashtableOfString_BigInteger23= value; break; case(24): HashtableOfString_Byte24= value; break; case(25): HashtableOfString_Byte25= value; break; case(26): HashtableOfString_Byte26= value; break; case(27): HashtableOfString_Double27= value; break; case(28): HashtableOfString_Double28= value; break; case(29): HashtableOfString_Double29= value; break; case(30): HashtableOfString_Float30= value; break; case(31): HashtableOfString_Float31= value; break; case(32): HashtableOfString_Float32= value; break; case(33): HashtableOfString_Integer33= value; break; case(34): HashtableOfString_Integer34= value; break; case(35): HashtableOfString_Integer35= value; break; case(36): HashtableOfString_Long36= value; break; case(37): HashtableOfString_Long37= value; break; case(38): HashtableOfString_Long38= value; break; case(39): HashtableOfString_Short39= value; break; case(40): HashtableOfString_Short40= value; break; case(41): HashtableOfString_Short41= value; break; case(42): HashtableOfString_Object42= value; break; case(43): HashtableOfString_Object43= value; break; case(44): HashtableOfString_SimpleClass45= value; break; case(45): HashtableOfString_SimpleClass46= value; break; case(46): HashtableOfString_SimpleInterface48= value; break; case(47): HashtableOfString_SimpleInterface49= value; break; case(48): HashtableOfString_String51= value; break; case(49): HashtableOfString_String52= value; break; case(50): HashtableOfString_Date54= value; break; case(51): HashtableOfString_Date55= value; break; case(52): HashtableOfString_Locale57= value; break; case(53): HashtableOfString_Locale58= value; break; case(54): HashtableOfString_BigDecimal60= value; break; case(55): HashtableOfString_BigDecimal61= value; break; case(56): HashtableOfString_BigInteger63= value; break; case(57): HashtableOfString_BigInteger64= value; break; case(58): HashtableOfString_Byte66= value; break; case(59): HashtableOfString_Byte67= value; break; case(60): HashtableOfString_Double69= value; break; case(61): HashtableOfString_Double70= value; break; case(62): HashtableOfString_Float72= value; break; case(63): HashtableOfString_Float73= value; break; case(64): HashtableOfString_Integer75= value; break; case(65): HashtableOfString_Integer76= value; break; case(66): HashtableOfString_Long78= value; break; case(67): HashtableOfString_Long79= value; break; case(68): HashtableOfString_Short81= value; break; case(69): HashtableOfString_Short82= value; break; case(70): HashtableOfString_Object84= value; break; case(71): HashtableOfString_Object86= value; break; case(72): HashtableOfString_SimpleClass87= value; break; case(73): HashtableOfString_SimpleClass89= value; break; case(74): HashtableOfString_SimpleInterface90= value; break; case(75): HashtableOfString_SimpleInterface92= value; break; case(76): HashtableOfString_String93= value; break; case(77): HashtableOfString_String95= value; break; case(78): HashtableOfString_Date96= value; break; case(79): HashtableOfString_Date98= value; break; case(80): HashtableOfString_Locale99= value; break; case(81): HashtableOfString_Locale101= value; break; case(82): HashtableOfString_BigDecimal102= value; break; case(83): HashtableOfString_BigDecimal104= value; break; case(84): HashtableOfString_BigInteger105= value; break; case(85): HashtableOfString_BigInteger107= value; break; case(86): HashtableOfString_Byte108= value; break; case(87): HashtableOfString_Byte110= value; break; case(88): HashtableOfString_Double111= value; break; case(89): HashtableOfString_Double113= value; break; case(90): HashtableOfString_Float114= value; break; case(91): HashtableOfString_Float116= value; break; case(92): HashtableOfString_Integer117= value; break; case(93): HashtableOfString_Integer119= value; break; case(94): HashtableOfString_Long120= value; break; case(95): HashtableOfString_Long122= value; break; case(96): HashtableOfString_Short123= value; break; case(97): HashtableOfString_Short125= value; break; default: throw new IndexOutOfBoundsException("Bad index " + index); } return true; } public static class Oid implements Serializable { public int identifier; public Oid() { } public Oid(String s) { identifier = Integer.parseInt(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + identifier;} public int hashCode() { return (int)identifier ; } public boolean equals(Object other) { if (other != null && (other instanceof Oid)) { Oid k = (Oid)other; return k.identifier == this.identifier; } return false; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } } } tck/src/java/org/apache/jdo/tck/pc/fieldtypes/HashtableStringValueCollections.java100664 62070 12500110373 30645 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.io.Serializable; import java.util.Hashtable; public class HashtableStringValueCollections { public int identifier; public Hashtable HashtableOfObject_String0; public Hashtable HashtableOfObject_String1; public Hashtable HashtableOfObject_String2; public Hashtable HashtableOfObject_String3; public Hashtable HashtableOfObject_String4; public Hashtable HashtableOfObject_String6; public Hashtable HashtableOfObject_String8; public Hashtable HashtableOfSimpleClass_String9; public Hashtable HashtableOfSimpleClass_String10; public Hashtable HashtableOfSimpleClass_String11; public Hashtable HashtableOfSimpleClass_String12; public Hashtable HashtableOfSimpleClass_String13; public Hashtable HashtableOfSimpleClass_String15; public Hashtable HashtableOfSimpleClass_String17; public Hashtable HashtableOfSimpleInterface_String18; public Hashtable HashtableOfSimpleInterface_String19; public Hashtable HashtableOfSimpleInterface_String20; public Hashtable HashtableOfSimpleInterface_String21; public Hashtable HashtableOfSimpleInterface_String22; public Hashtable HashtableOfSimpleInterface_String24; public Hashtable HashtableOfSimpleInterface_String26; public Hashtable HashtableOfString_String27; public Hashtable HashtableOfString_String28; public Hashtable HashtableOfString_String29; public Hashtable HashtableOfString_String30; public Hashtable HashtableOfString_String31; public Hashtable HashtableOfString_String33; public Hashtable HashtableOfString_String35; public Hashtable HashtableOfDate_String36; public Hashtable HashtableOfDate_String37; public Hashtable HashtableOfDate_String38; public Hashtable HashtableOfDate_String39; public Hashtable HashtableOfDate_String40; public Hashtable HashtableOfDate_String42; public Hashtable HashtableOfDate_String44; public Hashtable HashtableOfBigDecimal_String45; public Hashtable HashtableOfBigDecimal_String46; public Hashtable HashtableOfBigDecimal_String47; public Hashtable HashtableOfBigDecimal_String48; public Hashtable HashtableOfBigDecimal_String49; public Hashtable HashtableOfBigDecimal_String51; public Hashtable HashtableOfBigDecimal_String53; public Hashtable HashtableOfBigInteger_String54; public Hashtable HashtableOfBigInteger_String55; public Hashtable HashtableOfBigInteger_String56; public Hashtable HashtableOfBigInteger_String57; public Hashtable HashtableOfBigInteger_String58; public Hashtable HashtableOfBigInteger_String60; public Hashtable HashtableOfBigInteger_String62; public Hashtable HashtableOfByte_String63; public Hashtable HashtableOfByte_String64; public Hashtable HashtableOfByte_String65; public Hashtable HashtableOfByte_String66; public Hashtable HashtableOfByte_String67; public Hashtable HashtableOfByte_String69; public Hashtable HashtableOfByte_String71; public Hashtable HashtableOfDouble_String72; public Hashtable HashtableOfDouble_String73; public Hashtable HashtableOfDouble_String74; public Hashtable HashtableOfDouble_String75; public Hashtable HashtableOfDouble_String76; public Hashtable HashtableOfDouble_String78; public Hashtable HashtableOfDouble_String80; public Hashtable HashtableOfFloat_String81; public Hashtable HashtableOfFloat_String82; public Hashtable HashtableOfFloat_String83; public Hashtable HashtableOfFloat_String84; public Hashtable HashtableOfFloat_String85; public Hashtable HashtableOfFloat_String87; public Hashtable HashtableOfFloat_String89; public Hashtable HashtableOfInteger_String90; public Hashtable HashtableOfInteger_String91; public Hashtable HashtableOfInteger_String92; public Hashtable HashtableOfInteger_String93; public Hashtable HashtableOfInteger_String94; public Hashtable HashtableOfInteger_String96; public Hashtable HashtableOfInteger_String98; public Hashtable HashtableOfLong_String99; public Hashtable HashtableOfLong_String100; public Hashtable HashtableOfLong_String101; public Hashtable HashtableOfLong_String102; public Hashtable HashtableOfLong_String103; public Hashtable HashtableOfLong_String105; public Hashtable HashtableOfLong_String107; public Hashtable HashtableOfShort_String108; public Hashtable HashtableOfShort_String109; public Hashtable HashtableOfShort_String110; public Hashtable HashtableOfShort_String111; public Hashtable HashtableOfShort_String112; public Hashtable HashtableOfShort_String114; public Hashtable HashtableOfShort_String116; public static final String [] fieldSpecs = { "public Hashtable HashtableOfObject_String0", "embedded-value=true public Hashtable HashtableOfObject_String1", "embedded-value=false public Hashtable HashtableOfObject_String2", "embedded-key=true public Hashtable HashtableOfObject_String3", "embedded-key=true embedded-value=true public Hashtable HashtableOfObject_String4", "embedded-key=false public Hashtable HashtableOfObject_String6", "embedded-key=false embedded-value=false public Hashtable HashtableOfObject_String8", "public Hashtable HashtableOfSimpleClass_String9", "embedded-value=true public Hashtable HashtableOfSimpleClass_String10", "embedded-value=false public Hashtable HashtableOfSimpleClass_String11", "embedded-key=true public Hashtable HashtableOfSimpleClass_String12", "embedded-key=true embedded-value=true public Hashtable HashtableOfSimpleClass_String13", "embedded-key=false public Hashtable HashtableOfSimpleClass_String15", "embedded-key=false embedded-value=false public Hashtable HashtableOfSimpleClass_String17", "public Hashtable HashtableOfSimpleInterface_String18", "embedded-value=true public Hashtable HashtableOfSimpleInterface_String19", "embedded-value=false public Hashtable HashtableOfSimpleInterface_String20", "embedded-key=true public Hashtable HashtableOfSimpleInterface_String21", "embedded-key=true embedded-value=true public Hashtable HashtableOfSimpleInterface_String22", "embedded-key=false public Hashtable HashtableOfSimpleInterface_String24", "embedded-key=false embedded-value=false public Hashtable HashtableOfSimpleInterface_String26", "public Hashtable HashtableOfString_String27", "embedded-value=true public Hashtable HashtableOfString_String28", "embedded-value=false public Hashtable HashtableOfString_String29", "embedded-key=true public Hashtable HashtableOfString_String30", "embedded-key=true embedded-value=true public Hashtable HashtableOfString_String31", "embedded-key=false public Hashtable HashtableOfString_String33", "embedded-key=false embedded-value=false public Hashtable HashtableOfString_String35", "public Hashtable HashtableOfDate_String36", "embedded-value=true public Hashtable HashtableOfDate_String37", "embedded-value=false public Hashtable HashtableOfDate_String38", "embedded-key=true public Hashtable HashtableOfDate_String39", "embedded-key=true embedded-value=true public Hashtable HashtableOfDate_String40", "embedded-key=false public Hashtable HashtableOfDate_String42", "embedded-key=false embedded-value=false public Hashtable HashtableOfDate_String44", "public Hashtable HashtableOfBigDecimal_String45", "embedded-value=true public Hashtable HashtableOfBigDecimal_String46", "embedded-value=false public Hashtable HashtableOfBigDecimal_String47", "embedded-key=true public Hashtable HashtableOfBigDecimal_String48", "embedded-key=true embedded-value=true public Hashtable HashtableOfBigDecimal_String49", "embedded-key=false public Hashtable HashtableOfBigDecimal_String51", "embedded-key=false embedded-value=false public Hashtable HashtableOfBigDecimal_String53", "public Hashtable HashtableOfBigInteger_String54", "embedded-value=true public Hashtable HashtableOfBigInteger_String55", "embedded-value=false public Hashtable HashtableOfBigInteger_String56", "embedded-key=true public Hashtable HashtableOfBigInteger_String57", "embedded-key=true embedded-value=true public Hashtable HashtableOfBigInteger_String58", "embedded-key=false public Hashtable HashtableOfBigInteger_String60", "embedded-key=false embedded-value=false public Hashtable HashtableOfBigInteger_String62", "public Hashtable HashtableOfByte_String63", "embedded-value=true public Hashtable HashtableOfByte_String64", "embedded-value=false public Hashtable HashtableOfByte_String65", "embedded-key=true public Hashtable HashtableOfByte_String66", "embedded-key=true embedded-value=true public Hashtable HashtableOfByte_String67", "embedded-key=false public Hashtable HashtableOfByte_String69", "embedded-key=false embedded-value=false public Hashtable HashtableOfByte_String71", "public Hashtable HashtableOfDouble_String72", "embedded-value=true public Hashtable HashtableOfDouble_String73", "embedded-value=false public Hashtable HashtableOfDouble_String74", "embedded-key=true public Hashtable HashtableOfDouble_String75", "embedded-key=true embedded-value=true public Hashtable HashtableOfDouble_String76", "embedded-key=false public Hashtable HashtableOfDouble_String78", "embedded-key=false embedded-value=false public Hashtable HashtableOfDouble_String80", "public Hashtable HashtableOfFloat_String81", "embedded-value=true public Hashtable HashtableOfFloat_String82", "embedded-value=false public Hashtable HashtableOfFloat_String83", "embedded-key=true public Hashtable HashtableOfFloat_String84", "embedded-key=true embedded-value=true public Hashtable HashtableOfFloat_String85", "embedded-key=false public Hashtable HashtableOfFloat_String87", "embedded-key=false embedded-value=false public Hashtable HashtableOfFloat_String89", "public Hashtable HashtableOfInteger_String90", "embedded-value=true public Hashtable HashtableOfInteger_String91", "embedded-value=false public Hashtable HashtableOfInteger_String92", "embedded-key=true public Hashtable HashtableOfInteger_String93", "embedded-key=true embedded-value=true public Hashtable HashtableOfInteger_String94", "embedded-key=false public Hashtable HashtableOfInteger_String96", "embedded-key=false embedded-value=false public Hashtable HashtableOfInteger_String98", "public Hashtable HashtableOfLong_String99", "embedded-value=true public Hashtable HashtableOfLong_String100", "embedded-value=false public Hashtable HashtableOfLong_String101", "embedded-key=true public Hashtable HashtableOfLong_String102", "embedded-key=true embedded-value=true public Hashtable HashtableOfLong_String103", "embedded-key=false public Hashtable HashtableOfLong_String105", "embedded-key=false embedded-value=false public Hashtable HashtableOfLong_String107", "public Hashtable HashtableOfShort_String108", "embedded-value=true public Hashtable HashtableOfShort_String109", "embedded-value=false public Hashtable HashtableOfShort_String110", "embedded-key=true public Hashtable HashtableOfShort_String111", "embedded-key=true embedded-value=true public Hashtable HashtableOfShort_String112", "embedded-key=false public Hashtable HashtableOfShort_String114", "embedded-key=false embedded-value=false public Hashtable HashtableOfShort_String116" }; public int getLength() { return fieldSpecs.length; } public Hashtable get(int index) { switch (index) { case(0): return HashtableOfObject_String0; case(1): return HashtableOfObject_String1; case(2): return HashtableOfObject_String2; case(3): return HashtableOfObject_String3; case(4): return HashtableOfObject_String4; case(5): return HashtableOfObject_String6; case(6): return HashtableOfObject_String8; case(7): return HashtableOfSimpleClass_String9; case(8): return HashtableOfSimpleClass_String10; case(9): return HashtableOfSimpleClass_String11; case(10): return HashtableOfSimpleClass_String12; case(11): return HashtableOfSimpleClass_String13; case(12): return HashtableOfSimpleClass_String15; case(13): return HashtableOfSimpleClass_String17; case(14): return HashtableOfSimpleInterface_String18; case(15): return HashtableOfSimpleInterface_String19; case(16): return HashtableOfSimpleInterface_String20; case(17): return HashtableOfSimpleInterface_String21; case(18): return HashtableOfSimpleInterface_String22; case(19): return HashtableOfSimpleInterface_String24; case(20): return HashtableOfSimpleInterface_String26; case(21): return HashtableOfString_String27; case(22): return HashtableOfString_String28; case(23): return HashtableOfString_String29; case(24): return HashtableOfString_String30; case(25): return HashtableOfString_String31; case(26): return HashtableOfString_String33; case(27): return HashtableOfString_String35; case(28): return HashtableOfDate_String36; case(29): return HashtableOfDate_String37; case(30): return HashtableOfDate_String38; case(31): return HashtableOfDate_String39; case(32): return HashtableOfDate_String40; case(33): return HashtableOfDate_String42; case(34): return HashtableOfDate_String44; case(35): return HashtableOfBigDecimal_String45; case(36): return HashtableOfBigDecimal_String46; case(37): return HashtableOfBigDecimal_String47; case(38): return HashtableOfBigDecimal_String48; case(39): return HashtableOfBigDecimal_String49; case(40): return HashtableOfBigDecimal_String51; case(41): return HashtableOfBigDecimal_String53; case(42): return HashtableOfBigInteger_String54; case(43): return HashtableOfBigInteger_String55; case(44): return HashtableOfBigInteger_String56; case(45): return HashtableOfBigInteger_String57; case(46): return HashtableOfBigInteger_String58; case(47): return HashtableOfBigInteger_String60; case(48): return HashtableOfBigInteger_String62; case(49): return HashtableOfByte_String63; case(50): return HashtableOfByte_String64; case(51): return HashtableOfByte_String65; case(52): return HashtableOfByte_String66; case(53): return HashtableOfByte_String67; case(54): return HashtableOfByte_String69; case(55): return HashtableOfByte_String71; case(56): return HashtableOfDouble_String72; case(57): return HashtableOfDouble_String73; case(58): return HashtableOfDouble_String74; case(59): return HashtableOfDouble_String75; case(60): return HashtableOfDouble_String76; case(61): return HashtableOfDouble_String78; case(62): return HashtableOfDouble_String80; case(63): return HashtableOfFloat_String81; case(64): return HashtableOfFloat_String82; case(65): return HashtableOfFloat_String83; case(66): return HashtableOfFloat_String84; case(67): return HashtableOfFloat_String85; case(68): return HashtableOfFloat_String87; case(69): return HashtableOfFloat_String89; case(70): return HashtableOfInteger_String90; case(71): return HashtableOfInteger_String91; case(72): return HashtableOfInteger_String92; case(73): return HashtableOfInteger_String93; case(74): return HashtableOfInteger_String94; case(75): return HashtableOfInteger_String96; case(76): return HashtableOfInteger_String98; case(77): return HashtableOfLong_String99; case(78): return HashtableOfLong_String100; case(79): return HashtableOfLong_String101; case(80): return HashtableOfLong_String102; case(81): return HashtableOfLong_String103; case(82): return HashtableOfLong_String105; case(83): return HashtableOfLong_String107; case(84): return HashtableOfShort_String108; case(85): return HashtableOfShort_String109; case(86): return HashtableOfShort_String110; case(87): return HashtableOfShort_String111; case(88): return HashtableOfShort_String112; case(89): return HashtableOfShort_String114; case(90): return HashtableOfShort_String116; default: throw new IndexOutOfBoundsException("Bad index " + index); } } public boolean set(int index,Hashtable value) { if(fieldSpecs[index].indexOf("final") != -1) return false; switch (index) { case(0): HashtableOfObject_String0= value; break; case(1): HashtableOfObject_String1= value; break; case(2): HashtableOfObject_String2= value; break; case(3): HashtableOfObject_String3= value; break; case(4): HashtableOfObject_String4= value; break; case(5): HashtableOfObject_String6= value; break; case(6): HashtableOfObject_String8= value; break; case(7): HashtableOfSimpleClass_String9= value; break; case(8): HashtableOfSimpleClass_String10= value; break; case(9): HashtableOfSimpleClass_String11= value; break; case(10): HashtableOfSimpleClass_String12= value; break; case(11): HashtableOfSimpleClass_String13= value; break; case(12): HashtableOfSimpleClass_String15= value; break; case(13): HashtableOfSimpleClass_String17= value; break; case(14): HashtableOfSimpleInterface_String18= value; break; case(15): HashtableOfSimpleInterface_String19= value; break; case(16): HashtableOfSimpleInterface_String20= value; break; case(17): HashtableOfSimpleInterface_String21= value; break; case(18): HashtableOfSimpleInterface_String22= value; break; case(19): HashtableOfSimpleInterface_String24= value; break; case(20): HashtableOfSimpleInterface_String26= value; break; case(21): HashtableOfString_String27= value; break; case(22): HashtableOfString_String28= value; break; case(23): HashtableOfString_String29= value; break; case(24): HashtableOfString_String30= value; break; case(25): HashtableOfString_String31= value; break; case(26): HashtableOfString_String33= value; break; case(27): HashtableOfString_String35= value; break; case(28): HashtableOfDate_String36= value; break; case(29): HashtableOfDate_String37= value; break; case(30): HashtableOfDate_String38= value; break; case(31): HashtableOfDate_String39= value; break; case(32): HashtableOfDate_String40= value; break; case(33): HashtableOfDate_String42= value; break; case(34): HashtableOfDate_String44= value; break; case(35): HashtableOfBigDecimal_String45= value; break; case(36): HashtableOfBigDecimal_String46= value; break; case(37): HashtableOfBigDecimal_String47= value; break; case(38): HashtableOfBigDecimal_String48= value; break; case(39): HashtableOfBigDecimal_String49= value; break; case(40): HashtableOfBigDecimal_String51= value; break; case(41): HashtableOfBigDecimal_String53= value; break; case(42): HashtableOfBigInteger_String54= value; break; case(43): HashtableOfBigInteger_String55= value; break; case(44): HashtableOfBigInteger_String56= value; break; case(45): HashtableOfBigInteger_String57= value; break; case(46): HashtableOfBigInteger_String58= value; break; case(47): HashtableOfBigInteger_String60= value; break; case(48): HashtableOfBigInteger_String62= value; break; case(49): HashtableOfByte_String63= value; break; case(50): HashtableOfByte_String64= value; break; case(51): HashtableOfByte_String65= value; break; case(52): HashtableOfByte_String66= value; break; case(53): HashtableOfByte_String67= value; break; case(54): HashtableOfByte_String69= value; break; case(55): HashtableOfByte_String71= value; break; case(56): HashtableOfDouble_String72= value; break; case(57): HashtableOfDouble_String73= value; break; case(58): HashtableOfDouble_String74= value; break; case(59): HashtableOfDouble_String75= value; break; case(60): HashtableOfDouble_String76= value; break; case(61): HashtableOfDouble_String78= value; break; case(62): HashtableOfDouble_String80= value; break; case(63): HashtableOfFloat_String81= value; break; case(64): HashtableOfFloat_String82= value; break; case(65): HashtableOfFloat_String83= value; break; case(66): HashtableOfFloat_String84= value; break; case(67): HashtableOfFloat_String85= value; break; case(68): HashtableOfFloat_String87= value; break; case(69): HashtableOfFloat_String89= value; break; case(70): HashtableOfInteger_String90= value; break; case(71): HashtableOfInteger_String91= value; break; case(72): HashtableOfInteger_String92= value; break; case(73): HashtableOfInteger_String93= value; break; case(74): HashtableOfInteger_String94= value; break; case(75): HashtableOfInteger_String96= value; break; case(76): HashtableOfInteger_String98= value; break; case(77): HashtableOfLong_String99= value; break; case(78): HashtableOfLong_String100= value; break; case(79): HashtableOfLong_String101= value; break; case(80): HashtableOfLong_String102= value; break; case(81): HashtableOfLong_String103= value; break; case(82): HashtableOfLong_String105= value; break; case(83): HashtableOfLong_String107= value; break; case(84): HashtableOfShort_String108= value; break; case(85): HashtableOfShort_String109= value; break; case(86): HashtableOfShort_String110= value; break; case(87): HashtableOfShort_String111= value; break; case(88): HashtableOfShort_String112= value; break; case(89): HashtableOfShort_String114= value; break; case(90): HashtableOfShort_String116= value; break; default: throw new IndexOutOfBoundsException("Bad index " + index); } return true; } public static class Oid implements Serializable { public int identifier; public Oid() { } public Oid(String s) { identifier = Integer.parseInt(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + identifier;} public int hashCode() { return (int)identifier ; } public boolean equals(Object other) { if (other != null && (other instanceof Oid)) { Oid k = (Oid)other; return k.identifier == this.identifier; } return false; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } } } tck/src/java/org/apache/jdo/tck/pc/fieldtypes/LinkedListCollections.java100664 27236 12500110373 26635 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.io.Serializable; import java.util.LinkedList; public class LinkedListCollections { public int identifier; public LinkedList LinkedListOfObject0; public LinkedList LinkedListOfObject1; public LinkedList LinkedListOfObject2; public LinkedList LinkedListOfSimpleClass3; public LinkedList LinkedListOfSimpleClass4; public LinkedList LinkedListOfSimpleClass5; public LinkedList LinkedListOfSimpleInterface6; public LinkedList LinkedListOfSimpleInterface7; public LinkedList LinkedListOfSimpleInterface8; public LinkedList LinkedListOfString9; public LinkedList LinkedListOfString10; public LinkedList LinkedListOfString11; public LinkedList LinkedListOfDate12; public LinkedList LinkedListOfDate13; public LinkedList LinkedListOfDate14; public LinkedList LinkedListOfLocale15; public LinkedList LinkedListOfLocale16; public LinkedList LinkedListOfLocale17; public LinkedList LinkedListOfBigDecimal18; public LinkedList LinkedListOfBigDecimal19; public LinkedList LinkedListOfBigDecimal20; public LinkedList LinkedListOfBigInteger21; public LinkedList LinkedListOfBigInteger22; public LinkedList LinkedListOfBigInteger23; public LinkedList LinkedListOfByte24; public LinkedList LinkedListOfByte25; public LinkedList LinkedListOfByte26; public LinkedList LinkedListOfDouble27; public LinkedList LinkedListOfDouble28; public LinkedList LinkedListOfDouble29; public LinkedList LinkedListOfFloat30; public LinkedList LinkedListOfFloat31; public LinkedList LinkedListOfFloat32; public LinkedList LinkedListOfInteger33; public LinkedList LinkedListOfInteger34; public LinkedList LinkedListOfInteger35; public LinkedList LinkedListOfLong36; public LinkedList LinkedListOfLong37; public LinkedList LinkedListOfLong38; public LinkedList LinkedListOfShort39; public LinkedList LinkedListOfShort40; public LinkedList LinkedListOfShort41; public LinkedList LinkedListOfSimpleClass42; public static final String [] fieldSpecs = { "public LinkedList LinkedListOfObject0", "embedded-element=true public LinkedList LinkedListOfObject1", "embedded-element=false public LinkedList LinkedListOfObject2", "public LinkedList LinkedListOfSimpleClass3", "embedded-element=true public LinkedList LinkedListOfSimpleClass4", "embedded-element=false public LinkedList LinkedListOfSimpleClass5", "public LinkedList LinkedListOfSimpleInterface6", "embedded-element=true public LinkedList LinkedListOfSimpleInterface7", "embedded-element=false public LinkedList LinkedListOfSimpleInterface8", "public LinkedList LinkedListOfString9", "embedded-element=true public LinkedList LinkedListOfString10", "embedded-element=false public LinkedList LinkedListOfString11", "public LinkedList LinkedListOfDate12", "embedded-element=true public LinkedList LinkedListOfDate13", "embedded-element=false public LinkedList LinkedListOfDate14", "public LinkedList LinkedListOfLocale15", "embedded-element=true public LinkedList LinkedListOfLocale16", "embedded-element=false public LinkedList LinkedListOfLocale17", "public LinkedList LinkedListOfBigDecimal18", "embedded-element=true public LinkedList LinkedListOfBigDecimal19", "embedded-element=false public LinkedList LinkedListOfBigDecimal20", "public LinkedList LinkedListOfBigInteger21", "embedded-element=true public LinkedList LinkedListOfBigInteger22", "embedded-element=false public LinkedList LinkedListOfBigInteger23", "public LinkedList LinkedListOfByte24", "embedded-element=true public LinkedList LinkedListOfByte25", "embedded-element=false public LinkedList LinkedListOfByte26", "public LinkedList LinkedListOfDouble27", "embedded-element=true public LinkedList LinkedListOfDouble28", "embedded-element=false public LinkedList LinkedListOfDouble29", "public LinkedList LinkedListOfFloat30", "embedded-element=true public LinkedList LinkedListOfFloat31", "embedded-element=false public LinkedList LinkedListOfFloat32", "public LinkedList LinkedListOfInteger33", "embedded-element=true public LinkedList LinkedListOfInteger34", "embedded-element=false public LinkedList LinkedListOfInteger35", "public LinkedList LinkedListOfLong36", "embedded-element=true public LinkedList LinkedListOfLong37", "embedded-element=false public LinkedList LinkedListOfLong38", "public LinkedList LinkedListOfShort39", "embedded-element=true public LinkedList LinkedListOfShort40", "embedded-element=false public LinkedList LinkedListOfShort41", "serialized=true public LinkedList LinkedListOfSimpleClass42" }; public int getLength() { return fieldSpecs.length; } public LinkedList get(int index) { switch (index) { case(0): return LinkedListOfObject0; case(1): return LinkedListOfObject1; case(2): return LinkedListOfObject2; case(3): return LinkedListOfSimpleClass3; case(4): return LinkedListOfSimpleClass4; case(5): return LinkedListOfSimpleClass5; case(6): return LinkedListOfSimpleInterface6; case(7): return LinkedListOfSimpleInterface7; case(8): return LinkedListOfSimpleInterface8; case(9): return LinkedListOfString9; case(10): return LinkedListOfString10; case(11): return LinkedListOfString11; case(12): return LinkedListOfDate12; case(13): return LinkedListOfDate13; case(14): return LinkedListOfDate14; case(15): return LinkedListOfLocale15; case(16): return LinkedListOfLocale16; case(17): return LinkedListOfLocale17; case(18): return LinkedListOfBigDecimal18; case(19): return LinkedListOfBigDecimal19; case(20): return LinkedListOfBigDecimal20; case(21): return LinkedListOfBigInteger21; case(22): return LinkedListOfBigInteger22; case(23): return LinkedListOfBigInteger23; case(24): return LinkedListOfByte24; case(25): return LinkedListOfByte25; case(26): return LinkedListOfByte26; case(27): return LinkedListOfDouble27; case(28): return LinkedListOfDouble28; case(29): return LinkedListOfDouble29; case(30): return LinkedListOfFloat30; case(31): return LinkedListOfFloat31; case(32): return LinkedListOfFloat32; case(33): return LinkedListOfInteger33; case(34): return LinkedListOfInteger34; case(35): return LinkedListOfInteger35; case(36): return LinkedListOfLong36; case(37): return LinkedListOfLong37; case(38): return LinkedListOfLong38; case(39): return LinkedListOfShort39; case(40): return LinkedListOfShort40; case(41): return LinkedListOfShort41; case(42): return LinkedListOfSimpleClass42; default: throw new IndexOutOfBoundsException(); } } public boolean set(int index,LinkedList value) { if(fieldSpecs[index].indexOf("final") != -1) return false; switch (index) { case(0): LinkedListOfObject0= value; break; case(1): LinkedListOfObject1= value; break; case(2): LinkedListOfObject2= value; break; case(3): LinkedListOfSimpleClass3= value; break; case(4): LinkedListOfSimpleClass4= value; break; case(5): LinkedListOfSimpleClass5= value; break; case(6): LinkedListOfSimpleInterface6= value; break; case(7): LinkedListOfSimpleInterface7= value; break; case(8): LinkedListOfSimpleInterface8= value; break; case(9): LinkedListOfString9= value; break; case(10): LinkedListOfString10= value; break; case(11): LinkedListOfString11= value; break; case(12): LinkedListOfDate12= value; break; case(13): LinkedListOfDate13= value; break; case(14): LinkedListOfDate14= value; break; case(15): LinkedListOfLocale15= value; break; case(16): LinkedListOfLocale16= value; break; case(17): LinkedListOfLocale17= value; break; case(18): LinkedListOfBigDecimal18= value; break; case(19): LinkedListOfBigDecimal19= value; break; case(20): LinkedListOfBigDecimal20= value; break; case(21): LinkedListOfBigInteger21= value; break; case(22): LinkedListOfBigInteger22= value; break; case(23): LinkedListOfBigInteger23= value; break; case(24): LinkedListOfByte24= value; break; case(25): LinkedListOfByte25= value; break; case(26): LinkedListOfByte26= value; break; case(27): LinkedListOfDouble27= value; break; case(28): LinkedListOfDouble28= value; break; case(29): LinkedListOfDouble29= value; break; case(30): LinkedListOfFloat30= value; break; case(31): LinkedListOfFloat31= value; break; case(32): LinkedListOfFloat32= value; break; case(33): LinkedListOfInteger33= value; break; case(34): LinkedListOfInteger34= value; break; case(35): LinkedListOfInteger35= value; break; case(36): LinkedListOfLong36= value; break; case(37): LinkedListOfLong37= value; break; case(38): LinkedListOfLong38= value; break; case(39): LinkedListOfShort39= value; break; case(40): LinkedListOfShort40= value; break; case(41): LinkedListOfShort41= value; break; case(42): LinkedListOfSimpleClass42= value; break; default: throw new IndexOutOfBoundsException(); } return true; } public static class Oid implements Serializable { public int identifier; public Oid() { } public Oid(String s) { identifier = Integer.parseInt(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + identifier;} public int hashCode() { return (int)identifier ; } public boolean equals(Object other) { if (other != null && (other instanceof Oid)) { Oid k = (Oid)other; return k.identifier == this.identifier; } return false; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } } } tck/src/java/org/apache/jdo/tck/pc/fieldtypes/ListCollections.java100664 24174 12500110373 25504 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.io.Serializable; import java.util.List; public class ListCollections { public int identifier; public List ListOfObject0; public List ListOfObject1; public List ListOfObject2; public List ListOfSimpleClass3; public List ListOfSimpleClass4; public List ListOfSimpleClass5; public List ListOfSimpleInterface6; public List ListOfSimpleInterface7; public List ListOfSimpleInterface8; public List ListOfString9; public List ListOfString10; public List ListOfString11; public List ListOfDate12; public List ListOfDate13; public List ListOfDate14; public List ListOfLocale15; public List ListOfLocale16; public List ListOfLocale17; public List ListOfBigDecimal18; public List ListOfBigDecimal19; public List ListOfBigDecimal20; public List ListOfBigInteger21; public List ListOfBigInteger22; public List ListOfBigInteger23; public List ListOfByte24; public List ListOfByte25; public List ListOfByte26; public List ListOfDouble27; public List ListOfDouble28; public List ListOfDouble29; public List ListOfFloat30; public List ListOfFloat31; public List ListOfFloat32; public List ListOfInteger33; public List ListOfInteger34; public List ListOfInteger35; public List ListOfLong36; public List ListOfLong37; public List ListOfLong38; public List ListOfShort39; public List ListOfShort40; public List ListOfShort41; public List ListOfSimpleClass42; public static final String [] fieldSpecs = { "public List ListOfObject0", "embedded-element=true public List ListOfObject1", "embedded-element=false public List ListOfObject2", "public List ListOfSimpleClass3", "embedded-element=true public List ListOfSimpleClass4", "embedded-element=false public List ListOfSimpleClass5", "public List ListOfSimpleInterface6", "embedded-element=true public List ListOfSimpleInterface7", "embedded-element=false public List ListOfSimpleInterface8", "public List ListOfString9", "embedded-element=true public List ListOfString10", "embedded-element=false public List ListOfString11", "public List ListOfDate12", "embedded-element=true public List ListOfDate13", "embedded-element=false public List ListOfDate14", "public List ListOfLocale15", "embedded-element=true public List ListOfLocale16", "embedded-element=false public List ListOfLocale17", "public List ListOfBigDecimal18", "embedded-element=true public List ListOfBigDecimal19", "embedded-element=false public List ListOfBigDecimal20", "public List ListOfBigInteger21", "embedded-element=true public List ListOfBigInteger22", "embedded-element=false public List ListOfBigInteger23", "public List ListOfByte24", "embedded-element=true public List ListOfByte25", "embedded-element=false public List ListOfByte26", "public List ListOfDouble27", "embedded-element=true public List ListOfDouble28", "embedded-element=false public List ListOfDouble29", "public List ListOfFloat30", "embedded-element=true public List ListOfFloat31", "embedded-element=false public List ListOfFloat32", "public List ListOfInteger33", "embedded-element=true public List ListOfInteger34", "embedded-element=false public List ListOfInteger35", "public List ListOfLong36", "embedded-element=true public List ListOfLong37", "embedded-element=false public List ListOfLong38", "public List ListOfShort39", "embedded-element=true public List ListOfShort40", "embedded-element=false public List ListOfShort41", "serialized=true public List ListOfSimpleClass42" }; public int getLength() { return fieldSpecs.length; } public List get(int index) { switch (index) { case(0): return ListOfObject0; case(1): return ListOfObject1; case(2): return ListOfObject2; case(3): return ListOfSimpleClass3; case(4): return ListOfSimpleClass4; case(5): return ListOfSimpleClass5; case(6): return ListOfSimpleInterface6; case(7): return ListOfSimpleInterface7; case(8): return ListOfSimpleInterface8; case(9): return ListOfString9; case(10): return ListOfString10; case(11): return ListOfString11; case(12): return ListOfDate12; case(13): return ListOfDate13; case(14): return ListOfDate14; case(15): return ListOfLocale15; case(16): return ListOfLocale16; case(17): return ListOfLocale17; case(18): return ListOfBigDecimal18; case(19): return ListOfBigDecimal19; case(20): return ListOfBigDecimal20; case(21): return ListOfBigInteger21; case(22): return ListOfBigInteger22; case(23): return ListOfBigInteger23; case(24): return ListOfByte24; case(25): return ListOfByte25; case(26): return ListOfByte26; case(27): return ListOfDouble27; case(28): return ListOfDouble28; case(29): return ListOfDouble29; case(30): return ListOfFloat30; case(31): return ListOfFloat31; case(32): return ListOfFloat32; case(33): return ListOfInteger33; case(34): return ListOfInteger34; case(35): return ListOfInteger35; case(36): return ListOfLong36; case(37): return ListOfLong37; case(38): return ListOfLong38; case(39): return ListOfShort39; case(40): return ListOfShort40; case(41): return ListOfShort41; case(42): return ListOfSimpleClass42; default: throw new IndexOutOfBoundsException(); } } public boolean set(int index, List value) { if(fieldSpecs[index].indexOf("final") != -1) return false; switch (index) { case(0): ListOfObject0= value; break; case(1): ListOfObject1= value; break; case(2): ListOfObject2= value; break; case(3): ListOfSimpleClass3= value; break; case(4): ListOfSimpleClass4= value; break; case(5): ListOfSimpleClass5= value; break; case(6): ListOfSimpleInterface6= value; break; case(7): ListOfSimpleInterface7= value; break; case(8): ListOfSimpleInterface8= value; break; case(9): ListOfString9= value; break; case(10): ListOfString10= value; break; case(11): ListOfString11= value; break; case(12): ListOfDate12= value; break; case(13): ListOfDate13= value; break; case(14): ListOfDate14= value; break; case(15): ListOfLocale15= value; break; case(16): ListOfLocale16= value; break; case(17): ListOfLocale17= value; break; case(18): ListOfBigDecimal18= value; break; case(19): ListOfBigDecimal19= value; break; case(20): ListOfBigDecimal20= value; break; case(21): ListOfBigInteger21= value; break; case(22): ListOfBigInteger22= value; break; case(23): ListOfBigInteger23= value; break; case(24): ListOfByte24= value; break; case(25): ListOfByte25= value; break; case(26): ListOfByte26= value; break; case(27): ListOfDouble27= value; break; case(28): ListOfDouble28= value; break; case(29): ListOfDouble29= value; break; case(30): ListOfFloat30= value; break; case(31): ListOfFloat31= value; break; case(32): ListOfFloat32= value; break; case(33): ListOfInteger33= value; break; case(34): ListOfInteger34= value; break; case(35): ListOfInteger35= value; break; case(36): ListOfLong36= value; break; case(37): ListOfLong37= value; break; case(38): ListOfLong38= value; break; case(39): ListOfShort39= value; break; case(40): ListOfShort40= value; break; case(41): ListOfShort41= value; break; case(42): ListOfSimpleClass42= value; break; default: throw new IndexOutOfBoundsException(); } return true; } public static class Oid implements Serializable { public int identifier; public Oid() { } public Oid(String s) { identifier = Integer.parseInt(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + identifier;} public int hashCode() { return (int)identifier ; } public boolean equals(Object other) { if (other != null && (other instanceof Oid)) { Oid k = (Oid)other; return k.identifier == this.identifier; } return false; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } } } tck/src/java/org/apache/jdo/tck/pc/fieldtypes/MapStringKeyCollections.java100664 64446 12500110373 27154 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.io.Serializable; import java.util.Map; public class MapStringKeyCollections { public int identifier; public Map MapOfString_Object0; public Map MapOfString_Object1; public Map MapOfString_Object2; public Map MapOfString_SimpleClass3; public Map MapOfString_SimpleClass4; public Map MapOfString_SimpleClass5; public Map MapOfString_SimpleInterface6; public Map MapOfString_SimpleInterface7; public Map MapOfString_SimpleInterface8; public Map MapOfString_String9; public Map MapOfString_String10; public Map MapOfString_String11; public Map MapOfString_Date12; public Map MapOfString_Date13; public Map MapOfString_Date14; public Map MapOfString_Locale15; public Map MapOfString_Locale16; public Map MapOfString_Locale17; public Map MapOfString_BigDecimal18; public Map MapOfString_BigDecimal19; public Map MapOfString_BigDecimal20; public Map MapOfString_BigInteger21; public Map MapOfString_BigInteger22; public Map MapOfString_BigInteger23; public Map MapOfString_Byte24; public Map MapOfString_Byte25; public Map MapOfString_Byte26; public Map MapOfString_Double27; public Map MapOfString_Double28; public Map MapOfString_Double29; public Map MapOfString_Float30; public Map MapOfString_Float31; public Map MapOfString_Float32; public Map MapOfString_Integer33; public Map MapOfString_Integer34; public Map MapOfString_Integer35; public Map MapOfString_Long36; public Map MapOfString_Long37; public Map MapOfString_Long38; public Map MapOfString_Short39; public Map MapOfString_Short40; public Map MapOfString_Short41; public Map MapOfString_Object42; public Map MapOfString_Object43; public Map MapOfString_SimpleClass45; public Map MapOfString_SimpleClass46; public Map MapOfString_SimpleInterface48; public Map MapOfString_SimpleInterface49; public Map MapOfString_String51; public Map MapOfString_String52; public Map MapOfString_Date54; public Map MapOfString_Date55; public Map MapOfString_Locale57; public Map MapOfString_Locale58; public Map MapOfString_BigDecimal60; public Map MapOfString_BigDecimal61; public Map MapOfString_BigInteger63; public Map MapOfString_BigInteger64; public Map MapOfString_Byte66; public Map MapOfString_Byte67; public Map MapOfString_Double69; public Map MapOfString_Double70; public Map MapOfString_Float72; public Map MapOfString_Float73; public Map MapOfString_Integer75; public Map MapOfString_Integer76; public Map MapOfString_Long78; public Map MapOfString_Long79; public Map MapOfString_Short81; public Map MapOfString_Short82; public Map MapOfString_Object84; public Map MapOfString_Object86; public Map MapOfString_SimpleClass87; public Map MapOfString_SimpleClass89; public Map MapOfString_SimpleInterface90; public Map MapOfString_SimpleInterface92; public Map MapOfString_String93; public Map MapOfString_String95; public Map MapOfString_Date96; public Map MapOfString_Date98; public Map MapOfString_Locale99; public Map MapOfString_Locale101; public Map MapOfString_BigDecimal102; public Map MapOfString_BigDecimal104; public Map MapOfString_BigInteger105; public Map MapOfString_BigInteger107; public Map MapOfString_Byte108; public Map MapOfString_Byte110; public Map MapOfString_Double111; public Map MapOfString_Double113; public Map MapOfString_Float114; public Map MapOfString_Float116; public Map MapOfString_Integer117; public Map MapOfString_Integer119; public Map MapOfString_Long120; public Map MapOfString_Long122; public Map MapOfString_Short123; public Map MapOfString_Short125; public Map MapOfString_SimpleEnum126; public Map MapOfString_SimpleEnum127; public Map MapOfString_SimpleEnum128; public Map MapOfString_SimpleEnum129; public Map MapOfString_SimpleEnum130; public Map MapOfString_SimpleEnum131; public Map MapOfString_SimpleEnum132; public Map MapOfString_SimpleEnum133; public Map MapOfString_SimpleEnum134; public Map MapOfString_SimpleEnum135; public Map MapOfString_SimpleEnum136; public Map MapOfString_SimpleEnum137; public Map MapOfString_SimpleEnum138; public static final String [] fieldSpecs = { "public Map MapOfString_Object0", "embedded-value=true public Map MapOfString_Object1", "embedded-value=false public Map MapOfString_Object2", "public Map MapOfString_SimpleClass3", "embedded-value=true public Map MapOfString_SimpleClass4", "embedded-value=false public Map MapOfString_SimpleClass5", "public Map MapOfString_SimpleInterface6", "embedded-value=true public Map MapOfString_SimpleInterface7", "embedded-value=false public Map MapOfString_SimpleInterface8", "public Map MapOfString_String9", "embedded-value=true public Map MapOfString_String10", "embedded-value=false public Map MapOfString_String11", "public Map MapOfString_Date12", "embedded-value=true public Map MapOfString_Date13", "embedded-value=false public Map MapOfString_Date14", "public Map MapOfString_Locale15", "embedded-value=true public Map MapOfString_Locale16", "embedded-value=false public Map MapOfString_Locale17", "public Map MapOfString_BigDecimal18", "embedded-value=true public Map MapOfString_BigDecimal19", "embedded-value=false public Map MapOfString_BigDecimal20", "public Map MapOfString_BigInteger21", "embedded-value=true public Map MapOfString_BigInteger22", "embedded-value=false public Map MapOfString_BigInteger23", "public Map MapOfString_Byte24", "embedded-value=true public Map MapOfString_Byte25", "embedded-value=false public Map MapOfString_Byte26", "public Map MapOfString_Double27", "embedded-value=true public Map MapOfString_Double28", "embedded-value=false public Map MapOfString_Double29", "public Map MapOfString_Float30", "embedded-value=true public Map MapOfString_Float31", "embedded-value=false public Map MapOfString_Float32", "public Map MapOfString_Integer33", "embedded-value=true public Map MapOfString_Integer34", "embedded-value=false public Map MapOfString_Integer35", "public Map MapOfString_Long36", "embedded-value=true public Map MapOfString_Long37", "embedded-value=false public Map MapOfString_Long38", "public Map MapOfString_Short39", "embedded-value=true public Map MapOfString_Short40", "embedded-value=false public Map MapOfString_Short41", "embedded-key=true public Map MapOfString_Object42", "embedded-key=true embedded-value=true public Map MapOfString_Object43", "embedded-key=true public Map MapOfString_SimpleClass45", "embedded-key=true embedded-value=true public Map MapOfString_SimpleClass46", "embedded-key=true public Map MapOfString_SimpleInterface48", "embedded-key=true embedded-value=true public Map MapOfString_SimpleInterface49", "embedded-key=true public Map MapOfString_String51", "embedded-key=true embedded-value=true public Map MapOfString_String52", "embedded-key=true public Map MapOfString_Date54", "embedded-key=true embedded-value=true public Map MapOfString_Date55", "embedded-key=true public Map MapOfString_Locale57", "embedded-key=true embedded-value=true public Map MapOfString_Locale58", "embedded-key=true public Map MapOfString_BigDecimal60", "embedded-key=true embedded-value=true public Map MapOfString_BigDecimal61", "embedded-key=true public Map MapOfString_BigInteger63", "embedded-key=true embedded-value=true public Map MapOfString_BigInteger64", "embedded-key=true public Map MapOfString_Byte66", "embedded-key=true embedded-value=true public Map MapOfString_Byte67", "embedded-key=true public Map MapOfString_Double69", "embedded-key=true embedded-value=true public Map MapOfString_Double70", "embedded-key=true public Map MapOfString_Float72", "embedded-key=true embedded-value=true public Map MapOfString_Float73", "embedded-key=true public Map MapOfString_Integer75", "embedded-key=true embedded-value=true public Map MapOfString_Integer76", "embedded-key=true public Map MapOfString_Long78", "embedded-key=true embedded-value=true public Map MapOfString_Long79", "embedded-key=true public Map MapOfString_Short81", "embedded-key=true embedded-value=true public Map MapOfString_Short82", "embedded-key=false public Map MapOfString_Object84", "embedded-key=false embedded-value=false public Map MapOfString_Object86", "embedded-key=false public Map MapOfString_SimpleClass87", "embedded-key=false embedded-value=false public Map MapOfString_SimpleClass89", "embedded-key=false public Map MapOfString_SimpleInterface90", "embedded-key=false embedded-value=false public Map MapOfString_SimpleInterface92", "embedded-key=false public Map MapOfString_String93", "embedded-key=false embedded-value=false public Map MapOfString_String95", "embedded-key=false public Map MapOfString_Date96", "embedded-key=false embedded-value=false public Map MapOfString_Date98", "embedded-key=false public Map MapOfString_Locale99", "embedded-key=false embedded-value=false public Map MapOfString_Locale101", "embedded-key=false public Map MapOfString_BigDecimal102", "embedded-key=false embedded-value=false public Map MapOfString_BigDecimal104", "embedded-key=false public Map MapOfString_BigInteger105", "embedded-key=false embedded-value=false public Map MapOfString_BigInteger107", "embedded-key=false public Map MapOfString_Byte108", "embedded-key=false embedded-value=false public Map MapOfString_Byte110", "embedded-key=false public Map MapOfString_Double111", "embedded-key=false embedded-value=false public Map MapOfString_Double113", "embedded-key=false public Map MapOfString_Float114", "embedded-key=false embedded-value=false public Map MapOfString_Float116", "embedded-key=false public Map MapOfString_Integer117", "embedded-key=false embedded-value=false public Map MapOfString_Integer119", "embedded-key=false public Map MapOfString_Long120", "embedded-key=false embedded-value=false public Map MapOfString_Long122", "embedded-key=false public Map MapOfString_Short123", "embedded-key=false embedded-value=false public Map MapOfString_Short125", "public Map MapOfString_SimpleEnum126", "embedded-value=true public Map MapOfString_SimpleEnum127", "embedded-value=false public Map MapOfString_SimpleEnum128", "embedded-key=true public Map MapOfString_SimpleEnum129", "embedded-key=true embedded-value=true public Map MapOfString_SimpleEnum130", "embedded-key=false public Map MapOfString_SimpleEnum131", "embedded-key=false embedded-value=false public Map MapOfString_SimpleEnum132", "public Map MapOfString_SimpleEnum133", "embedded-value=true public Map MapOfString_SimpleEnum134", "embedded-value=false public Map MapOfString_SimpleEnum135", "embedded-key=true public Map MapOfString_SimpleEnum136", "embedded-key=true embedded-value=true public Map MapOfString_SimpleEnum137", "embedded-key=false public Map MapOfString_SimpleEnum138" }; public int getLength() { return fieldSpecs.length; } public Map get(int index) { switch (index) { case(0): return MapOfString_Object0; case(1): return MapOfString_Object1; case(2): return MapOfString_Object2; case(3): return MapOfString_SimpleClass3; case(4): return MapOfString_SimpleClass4; case(5): return MapOfString_SimpleClass5; case(6): return MapOfString_SimpleInterface6; case(7): return MapOfString_SimpleInterface7; case(8): return MapOfString_SimpleInterface8; case(9): return MapOfString_String9; case(10): return MapOfString_String10; case(11): return MapOfString_String11; case(12): return MapOfString_Date12; case(13): return MapOfString_Date13; case(14): return MapOfString_Date14; case(15): return MapOfString_Locale15; case(16): return MapOfString_Locale16; case(17): return MapOfString_Locale17; case(18): return MapOfString_BigDecimal18; case(19): return MapOfString_BigDecimal19; case(20): return MapOfString_BigDecimal20; case(21): return MapOfString_BigInteger21; case(22): return MapOfString_BigInteger22; case(23): return MapOfString_BigInteger23; case(24): return MapOfString_Byte24; case(25): return MapOfString_Byte25; case(26): return MapOfString_Byte26; case(27): return MapOfString_Double27; case(28): return MapOfString_Double28; case(29): return MapOfString_Double29; case(30): return MapOfString_Float30; case(31): return MapOfString_Float31; case(32): return MapOfString_Float32; case(33): return MapOfString_Integer33; case(34): return MapOfString_Integer34; case(35): return MapOfString_Integer35; case(36): return MapOfString_Long36; case(37): return MapOfString_Long37; case(38): return MapOfString_Long38; case(39): return MapOfString_Short39; case(40): return MapOfString_Short40; case(41): return MapOfString_Short41; case(42): return MapOfString_Object42; case(43): return MapOfString_Object43; case(44): return MapOfString_SimpleClass45; case(45): return MapOfString_SimpleClass46; case(46): return MapOfString_SimpleInterface48; case(47): return MapOfString_SimpleInterface49; case(48): return MapOfString_String51; case(49): return MapOfString_String52; case(50): return MapOfString_Date54; case(51): return MapOfString_Date55; case(52): return MapOfString_Locale57; case(53): return MapOfString_Locale58; case(54): return MapOfString_BigDecimal60; case(55): return MapOfString_BigDecimal61; case(56): return MapOfString_BigInteger63; case(57): return MapOfString_BigInteger64; case(58): return MapOfString_Byte66; case(59): return MapOfString_Byte67; case(60): return MapOfString_Double69; case(61): return MapOfString_Double70; case(62): return MapOfString_Float72; case(63): return MapOfString_Float73; case(64): return MapOfString_Integer75; case(65): return MapOfString_Integer76; case(66): return MapOfString_Long78; case(67): return MapOfString_Long79; case(68): return MapOfString_Short81; case(69): return MapOfString_Short82; case(70): return MapOfString_Object84; case(71): return MapOfString_Object86; case(72): return MapOfString_SimpleClass87; case(73): return MapOfString_SimpleClass89; case(74): return MapOfString_SimpleInterface90; case(75): return MapOfString_SimpleInterface92; case(76): return MapOfString_String93; case(77): return MapOfString_String95; case(78): return MapOfString_Date96; case(79): return MapOfString_Date98; case(80): return MapOfString_Locale99; case(81): return MapOfString_Locale101; case(82): return MapOfString_BigDecimal102; case(83): return MapOfString_BigDecimal104; case(84): return MapOfString_BigInteger105; case(85): return MapOfString_BigInteger107; case(86): return MapOfString_Byte108; case(87): return MapOfString_Byte110; case(88): return MapOfString_Double111; case(89): return MapOfString_Double113; case(90): return MapOfString_Float114; case(91): return MapOfString_Float116; case(92): return MapOfString_Integer117; case(93): return MapOfString_Integer119; case(94): return MapOfString_Long120; case(95): return MapOfString_Long122; case(96): return MapOfString_Short123; case(97): return MapOfString_Short125; case(98): return MapOfString_SimpleEnum126; case(99): return MapOfString_SimpleEnum127; case(100): return MapOfString_SimpleEnum128; case(101): return MapOfString_SimpleEnum129; case(102): return MapOfString_SimpleEnum130; case(103): return MapOfString_SimpleEnum131; case(104): return MapOfString_SimpleEnum132; case(105): return MapOfString_SimpleEnum133; case(106): return MapOfString_SimpleEnum134; case(107): return MapOfString_SimpleEnum135; case(108): return MapOfString_SimpleEnum136; case(109): return MapOfString_SimpleEnum137; case(110): return MapOfString_SimpleEnum138; default: throw new IndexOutOfBoundsException(); } } public boolean set(int index,Map value) { if(fieldSpecs[index].indexOf("final") != -1) return false; switch (index) { case(0): MapOfString_Object0= value; break; case(1): MapOfString_Object1= value; break; case(2): MapOfString_Object2= value; break; case(3): MapOfString_SimpleClass3= value; break; case(4): MapOfString_SimpleClass4= value; break; case(5): MapOfString_SimpleClass5= value; break; case(6): MapOfString_SimpleInterface6= value; break; case(7): MapOfString_SimpleInterface7= value; break; case(8): MapOfString_SimpleInterface8= value; break; case(9): MapOfString_String9= value; break; case(10): MapOfString_String10= value; break; case(11): MapOfString_String11= value; break; case(12): MapOfString_Date12= value; break; case(13): MapOfString_Date13= value; break; case(14): MapOfString_Date14= value; break; case(15): MapOfString_Locale15= value; break; case(16): MapOfString_Locale16= value; break; case(17): MapOfString_Locale17= value; break; case(18): MapOfString_BigDecimal18= value; break; case(19): MapOfString_BigDecimal19= value; break; case(20): MapOfString_BigDecimal20= value; break; case(21): MapOfString_BigInteger21= value; break; case(22): MapOfString_BigInteger22= value; break; case(23): MapOfString_BigInteger23= value; break; case(24): MapOfString_Byte24= value; break; case(25): MapOfString_Byte25= value; break; case(26): MapOfString_Byte26= value; break; case(27): MapOfString_Double27= value; break; case(28): MapOfString_Double28= value; break; case(29): MapOfString_Double29= value; break; case(30): MapOfString_Float30= value; break; case(31): MapOfString_Float31= value; break; case(32): MapOfString_Float32= value; break; case(33): MapOfString_Integer33= value; break; case(34): MapOfString_Integer34= value; break; case(35): MapOfString_Integer35= value; break; case(36): MapOfString_Long36= value; break; case(37): MapOfString_Long37= value; break; case(38): MapOfString_Long38= value; break; case(39): MapOfString_Short39= value; break; case(40): MapOfString_Short40= value; break; case(41): MapOfString_Short41= value; break; case(42): MapOfString_Object42= value; break; case(43): MapOfString_Object43= value; break; case(44): MapOfString_SimpleClass45= value; break; case(45): MapOfString_SimpleClass46= value; break; case(46): MapOfString_SimpleInterface48= value; break; case(47): MapOfString_SimpleInterface49= value; break; case(48): MapOfString_String51= value; break; case(49): MapOfString_String52= value; break; case(50): MapOfString_Date54= value; break; case(51): MapOfString_Date55= value; break; case(52): MapOfString_Locale57= value; break; case(53): MapOfString_Locale58= value; break; case(54): MapOfString_BigDecimal60= value; break; case(55): MapOfString_BigDecimal61= value; break; case(56): MapOfString_BigInteger63= value; break; case(57): MapOfString_BigInteger64= value; break; case(58): MapOfString_Byte66= value; break; case(59): MapOfString_Byte67= value; break; case(60): MapOfString_Double69= value; break; case(61): MapOfString_Double70= value; break; case(62): MapOfString_Float72= value; break; case(63): MapOfString_Float73= value; break; case(64): MapOfString_Integer75= value; break; case(65): MapOfString_Integer76= value; break; case(66): MapOfString_Long78= value; break; case(67): MapOfString_Long79= value; break; case(68): MapOfString_Short81= value; break; case(69): MapOfString_Short82= value; break; case(70): MapOfString_Object84= value; break; case(71): MapOfString_Object86= value; break; case(72): MapOfString_SimpleClass87= value; break; case(73): MapOfString_SimpleClass89= value; break; case(74): MapOfString_SimpleInterface90= value; break; case(75): MapOfString_SimpleInterface92= value; break; case(76): MapOfString_String93= value; break; case(77): MapOfString_String95= value; break; case(78): MapOfString_Date96= value; break; case(79): MapOfString_Date98= value; break; case(80): MapOfString_Locale99= value; break; case(81): MapOfString_Locale101= value; break; case(82): MapOfString_BigDecimal102= value; break; case(83): MapOfString_BigDecimal104= value; break; case(84): MapOfString_BigInteger105= value; break; case(85): MapOfString_BigInteger107= value; break; case(86): MapOfString_Byte108= value; break; case(87): MapOfString_Byte110= value; break; case(88): MapOfString_Double111= value; break; case(89): MapOfString_Double113= value; break; case(90): MapOfString_Float114= value; break; case(91): MapOfString_Float116= value; break; case(92): MapOfString_Integer117= value; break; case(93): MapOfString_Integer119= value; break; case(94): MapOfString_Long120= value; break; case(95): MapOfString_Long122= value; break; case(96): MapOfString_Short123= value; break; case(97): MapOfString_Short125= value; break; case(98): MapOfString_SimpleEnum126= value; break; case(99): MapOfString_SimpleEnum127= value; break; case(100): MapOfString_SimpleEnum128= value; break; case(101): MapOfString_SimpleEnum129= value; break; case(102): MapOfString_SimpleEnum130= value; break; case(103): MapOfString_SimpleEnum131= value; break; case(104): MapOfString_SimpleEnum132= value; break; case(105): MapOfString_SimpleEnum133= value; break; case(106): MapOfString_SimpleEnum134= value; break; case(107): MapOfString_SimpleEnum135= value; break; case(108): MapOfString_SimpleEnum136= value; break; case(109): MapOfString_SimpleEnum137= value; break; case(110): MapOfString_SimpleEnum138= value; break; default: throw new IndexOutOfBoundsException(); } return true; } public static class Oid implements Serializable { public int identifier; public Oid() { } public Oid(String s) { identifier = Integer.parseInt(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + identifier;} public int hashCode() { return (int)identifier ; } public boolean equals(Object other) { if (other != null && (other instanceof Oid)) { Oid k = (Oid)other; return k.identifier == this.identifier; } return false; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } } } tck/src/java/org/apache/jdo/tck/pc/fieldtypes/MapStringValueCollections.java100664 61516 12500110373 27473 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.io.Serializable; import java.util.Map; public class MapStringValueCollections { public int identifier; public Map MapOfObject_String0; public Map MapOfObject_String1; public Map MapOfObject_String2; public Map MapOfObject_String3; public Map MapOfObject_String4; public Map MapOfObject_String6; public Map MapOfObject_String8; public Map MapOfSimpleClass_String9; public Map MapOfSimpleClass_String10; public Map MapOfSimpleClass_String11; public Map MapOfSimpleClass_String12; public Map MapOfSimpleClass_String13; public Map MapOfSimpleClass_String15; public Map MapOfSimpleClass_String17; public Map MapOfSimpleInterface_String18; public Map MapOfSimpleInterface_String19; public Map MapOfSimpleInterface_String20; public Map MapOfSimpleInterface_String21; public Map MapOfSimpleInterface_String22; public Map MapOfSimpleInterface_String24; public Map MapOfSimpleInterface_String26; public Map MapOfString_String27; public Map MapOfString_String28; public Map MapOfString_String29; public Map MapOfString_String30; public Map MapOfString_String31; public Map MapOfString_String33; public Map MapOfString_String35; public Map MapOfDate_String36; public Map MapOfDate_String37; public Map MapOfDate_String38; public Map MapOfDate_String39; public Map MapOfDate_String40; public Map MapOfDate_String42; public Map MapOfDate_String44; public Map MapOfBigDecimal_String45; public Map MapOfBigDecimal_String46; public Map MapOfBigDecimal_String47; public Map MapOfBigDecimal_String48; public Map MapOfBigDecimal_String49; public Map MapOfBigDecimal_String51; public Map MapOfBigDecimal_String53; public Map MapOfBigInteger_String54; public Map MapOfBigInteger_String55; public Map MapOfBigInteger_String56; public Map MapOfBigInteger_String57; public Map MapOfBigInteger_String58; public Map MapOfBigInteger_String60; public Map MapOfBigInteger_String62; public Map MapOfByte_String63; public Map MapOfByte_String64; public Map MapOfByte_String65; public Map MapOfByte_String66; public Map MapOfByte_String67; public Map MapOfByte_String69; public Map MapOfByte_String71; public Map MapOfDouble_String72; public Map MapOfDouble_String73; public Map MapOfDouble_String74; public Map MapOfDouble_String75; public Map MapOfDouble_String76; public Map MapOfDouble_String78; public Map MapOfDouble_String80; public Map MapOfFloat_String81; public Map MapOfFloat_String82; public Map MapOfFloat_String83; public Map MapOfFloat_String84; public Map MapOfFloat_String85; public Map MapOfFloat_String87; public Map MapOfFloat_String89; public Map MapOfInteger_String90; public Map MapOfInteger_String91; public Map MapOfInteger_String92; public Map MapOfInteger_String93; public Map MapOfInteger_String94; public Map MapOfInteger_String96; public Map MapOfInteger_String98; public Map MapOfLong_String99; public Map MapOfLong_String100; public Map MapOfLong_String101; public Map MapOfLong_String102; public Map MapOfLong_String103; public Map MapOfLong_String105; public Map MapOfLong_String107; public Map MapOfShort_String108; public Map MapOfShort_String109; public Map MapOfShort_String110; public Map MapOfShort_String111; public Map MapOfShort_String112; public Map MapOfShort_String114; public Map MapOfShort_String116; public Map MapOfSimpleEnum_String117; public Map MapOfSimpleEnum_String118; public Map MapOfSimpleEnum_String119; public Map MapOfSimpleEnum_String120; public Map MapOfSimpleEnum_String121; public Map MapOfSimpleEnum_String122; public Map MapOfSimpleEnum_String123; public Map MapOfSimpleEnum_String124; public Map MapOfSimpleEnum_String125; public Map MapOfSimpleEnum_String126; public Map MapOfSimpleEnum_String127; public Map MapOfSimpleEnum_String128; public Map MapOfSimpleEnum_String129; public static final String [] fieldSpecs = { "public Map MapOfObject_String0", "embedded-value=true public Map MapOfObject_String1", "embedded-value=false public Map MapOfObject_String2", "embedded-key=true public Map MapOfObject_String3", "embedded-key=true embedded-value=true public Map MapOfObject_String4", "embedded-key=false public Map MapOfObject_String6", "embedded-key=false embedded-value=false public Map MapOfObject_String8", "public Map MapOfSimpleClass_String9", "embedded-value=true public Map MapOfSimpleClass_String10", "embedded-value=false public Map MapOfSimpleClass_String11", "embedded-key=true public Map MapOfSimpleClass_String12", "embedded-key=true embedded-value=true public Map MapOfSimpleClass_String13", "embedded-key=false public Map MapOfSimpleClass_String15", "embedded-key=false embedded-value=false public Map MapOfSimpleClass_String17", "public Map MapOfSimpleInterface_String18", "embedded-value=true public Map MapOfSimpleInterface_String19", "embedded-value=false public Map MapOfSimpleInterface_String20", "embedded-key=true public Map MapOfSimpleInterface_String21", "embedded-key=true embedded-value=true public Map MapOfSimpleInterface_String22", "embedded-key=false public Map MapOfSimpleInterface_String24", "embedded-key=false embedded-value=false public Map MapOfSimpleInterface_String26", "public Map MapOfString_String27", "embedded-value=true public Map MapOfString_String28", "embedded-value=false public Map MapOfString_String29", "embedded-key=true public Map MapOfString_String30", "embedded-key=true embedded-value=true public Map MapOfString_String31", "embedded-key=false public Map MapOfString_String33", "embedded-key=false embedded-value=false public Map MapOfString_String35", "public Map MapOfDate_String36", "embedded-value=true public Map MapOfDate_String37", "embedded-value=false public Map MapOfDate_String38", "embedded-key=true public Map MapOfDate_String39", "embedded-key=true embedded-value=true public Map MapOfDate_String40", "embedded-key=false public Map MapOfDate_String42", "embedded-key=false embedded-value=false public Map MapOfDate_String44", "public Map MapOfBigDecimal_String45", "embedded-value=true public Map MapOfBigDecimal_String46", "embedded-value=false public Map MapOfBigDecimal_String47", "embedded-key=true public Map MapOfBigDecimal_String48", "embedded-key=true embedded-value=true public Map MapOfBigDecimal_String49", "embedded-key=false public Map MapOfBigDecimal_String51", "embedded-key=false embedded-value=false public Map MapOfBigDecimal_String53", "public Map MapOfBigInteger_String54", "embedded-value=true public Map MapOfBigInteger_String55", "embedded-value=false public Map MapOfBigInteger_String56", "embedded-key=true public Map MapOfBigInteger_String57", "embedded-key=true embedded-value=true public Map MapOfBigInteger_String58", "embedded-key=false public Map MapOfBigInteger_String60", "embedded-key=false embedded-value=false public Map MapOfBigInteger_String62", "public Map MapOfByte_String63", "embedded-value=true public Map MapOfByte_String64", "embedded-value=false public Map MapOfByte_String65", "embedded-key=true public Map MapOfByte_String66", "embedded-key=true embedded-value=true public Map MapOfByte_String67", "embedded-key=false public Map MapOfByte_String69", "embedded-key=false embedded-value=false public Map MapOfByte_String71", "public Map MapOfDouble_String72", "embedded-value=true public Map MapOfDouble_String73", "embedded-value=false public Map MapOfDouble_String74", "embedded-key=true public Map MapOfDouble_String75", "embedded-key=true embedded-value=true public Map MapOfDouble_String76", "embedded-key=false public Map MapOfDouble_String78", "embedded-key=false embedded-value=false public Map MapOfDouble_String80", "public Map MapOfFloat_String81", "embedded-value=true public Map MapOfFloat_String82", "embedded-value=false public Map MapOfFloat_String83", "embedded-key=true public Map MapOfFloat_String84", "embedded-key=true embedded-value=true public Map MapOfFloat_String85", "embedded-key=false public Map MapOfFloat_String87", "embedded-key=false embedded-value=false public Map MapOfFloat_String89", "public Map MapOfInteger_String90", "embedded-value=true public Map MapOfInteger_String91", "embedded-value=false public Map MapOfInteger_String92", "embedded-key=true public Map MapOfInteger_String93", "embedded-key=true embedded-value=true public Map MapOfInteger_String94", "embedded-key=false public Map MapOfInteger_String96", "embedded-key=false embedded-value=false public Map MapOfInteger_String98", "public Map MapOfLong_String99", "embedded-value=true public Map MapOfLong_String100", "embedded-value=false public Map MapOfLong_String101", "embedded-key=true public Map MapOfLong_String102", "embedded-key=true embedded-value=true public Map MapOfLong_String103", "embedded-key=false public Map MapOfLong_String105", "embedded-key=false embedded-value=false public Map MapOfLong_String107", "public Map MapOfShort_String108", "embedded-value=true public Map MapOfShort_String109", "embedded-value=false public Map MapOfShort_String110", "embedded-key=true public Map MapOfShort_String111", "embedded-key=true embedded-value=true public Map MapOfShort_String112", "embedded-key=false public Map MapOfShort_String114", "embedded-key=false embedded-value=false public Map MapOfShort_String116", "public Map MapOfSimpleEnum_String117", "embedded-value=true public Map MapOfSimpleEnum_String118", "embedded-value=false public Map MapOfSimpleEnum_String119", "embedded-key=true public Map MapOfSimpleEnum_String120", "embedded-key=true embedded-value=true public Map MapOfSimpleEnum_String121", "embedded-key=false public Map MapOfSimpleEnum_String122", "embedded-key=false embedded-value=false public Map MapOfSimpleEnum_String123", "public Map MapOfSimpleEnum_String124", "embedded-value=true public Map MapOfSimpleEnum_String124", "embedded-value=false public Map MapOfSimpleEnum_String126", "embedded-key=true public Map MapOfSimpleEnum_String127", "embedded-key=true embedded-value=true public Map MapOfSimpleEnum_String128", "embedded-key=false public Map MapOfSimpleEnum_String129" }; public int getLength() { return fieldSpecs.length; } public Map get(int index) { switch (index) { case(0): return MapOfObject_String0; case(1): return MapOfObject_String1; case(2): return MapOfObject_String2; case(3): return MapOfObject_String3; case(4): return MapOfObject_String4; case(5): return MapOfObject_String6; case(6): return MapOfObject_String8; case(7): return MapOfSimpleClass_String9; case(8): return MapOfSimpleClass_String10; case(9): return MapOfSimpleClass_String11; case(10): return MapOfSimpleClass_String12; case(11): return MapOfSimpleClass_String13; case(12): return MapOfSimpleClass_String15; case(13): return MapOfSimpleClass_String17; case(14): return MapOfSimpleInterface_String18; case(15): return MapOfSimpleInterface_String19; case(16): return MapOfSimpleInterface_String20; case(17): return MapOfSimpleInterface_String21; case(18): return MapOfSimpleInterface_String22; case(19): return MapOfSimpleInterface_String24; case(20): return MapOfSimpleInterface_String26; case(21): return MapOfString_String27; case(22): return MapOfString_String28; case(23): return MapOfString_String29; case(24): return MapOfString_String30; case(25): return MapOfString_String31; case(26): return MapOfString_String33; case(27): return MapOfString_String35; case(28): return MapOfDate_String36; case(29): return MapOfDate_String37; case(30): return MapOfDate_String38; case(31): return MapOfDate_String39; case(32): return MapOfDate_String40; case(33): return MapOfDate_String42; case(34): return MapOfDate_String44; case(35): return MapOfBigDecimal_String45; case(36): return MapOfBigDecimal_String46; case(37): return MapOfBigDecimal_String47; case(38): return MapOfBigDecimal_String48; case(39): return MapOfBigDecimal_String49; case(40): return MapOfBigDecimal_String51; case(41): return MapOfBigDecimal_String53; case(42): return MapOfBigInteger_String54; case(43): return MapOfBigInteger_String55; case(44): return MapOfBigInteger_String56; case(45): return MapOfBigInteger_String57; case(46): return MapOfBigInteger_String58; case(47): return MapOfBigInteger_String60; case(48): return MapOfBigInteger_String62; case(49): return MapOfByte_String63; case(50): return MapOfByte_String64; case(51): return MapOfByte_String65; case(52): return MapOfByte_String66; case(53): return MapOfByte_String67; case(54): return MapOfByte_String69; case(55): return MapOfByte_String71; case(56): return MapOfDouble_String72; case(57): return MapOfDouble_String73; case(58): return MapOfDouble_String74; case(59): return MapOfDouble_String75; case(60): return MapOfDouble_String76; case(61): return MapOfDouble_String78; case(62): return MapOfDouble_String80; case(63): return MapOfFloat_String81; case(64): return MapOfFloat_String82; case(65): return MapOfFloat_String83; case(66): return MapOfFloat_String84; case(67): return MapOfFloat_String85; case(68): return MapOfFloat_String87; case(69): return MapOfFloat_String89; case(70): return MapOfInteger_String90; case(71): return MapOfInteger_String91; case(72): return MapOfInteger_String92; case(73): return MapOfInteger_String93; case(74): return MapOfInteger_String94; case(75): return MapOfInteger_String96; case(76): return MapOfInteger_String98; case(77): return MapOfLong_String99; case(78): return MapOfLong_String100; case(79): return MapOfLong_String101; case(80): return MapOfLong_String102; case(81): return MapOfLong_String103; case(82): return MapOfLong_String105; case(83): return MapOfLong_String107; case(84): return MapOfShort_String108; case(85): return MapOfShort_String109; case(86): return MapOfShort_String110; case(87): return MapOfShort_String111; case(88): return MapOfShort_String112; case(89): return MapOfShort_String114; case(90): return MapOfShort_String116; case(91): return MapOfSimpleEnum_String117; case(92): return MapOfSimpleEnum_String118; case(93): return MapOfSimpleEnum_String119; case(94): return MapOfSimpleEnum_String120; case(95): return MapOfSimpleEnum_String121; case(96): return MapOfSimpleEnum_String122; case(97): return MapOfSimpleEnum_String123; case(98): return MapOfSimpleEnum_String124; case(99): return MapOfSimpleEnum_String125; case(100): return MapOfSimpleEnum_String126; case(101): return MapOfSimpleEnum_String127; case(102): return MapOfSimpleEnum_String128; case(103): return MapOfSimpleEnum_String129; default: throw new IndexOutOfBoundsException("Bad index " + index); } } public boolean set(int index,Map value) { if(fieldSpecs[index].indexOf("final") != -1) return false; switch (index) { case(0): MapOfObject_String0= value; break; case(1): MapOfObject_String1= value; break; case(2): MapOfObject_String2= value; break; case(3): MapOfObject_String3= value; break; case(4): MapOfObject_String4= value; break; case(5): MapOfObject_String6= value; break; case(6): MapOfObject_String8= value; break; case(7): MapOfSimpleClass_String9= value; break; case(8): MapOfSimpleClass_String10= value; break; case(9): MapOfSimpleClass_String11= value; break; case(10): MapOfSimpleClass_String12= value; break; case(11): MapOfSimpleClass_String13= value; break; case(12): MapOfSimpleClass_String15= value; break; case(13): MapOfSimpleClass_String17= value; break; case(14): MapOfSimpleInterface_String18= value; break; case(15): MapOfSimpleInterface_String19= value; break; case(16): MapOfSimpleInterface_String20= value; break; case(17): MapOfSimpleInterface_String21= value; break; case(18): MapOfSimpleInterface_String22= value; break; case(19): MapOfSimpleInterface_String24= value; break; case(20): MapOfSimpleInterface_String26= value; break; case(21): MapOfString_String27= value; break; case(22): MapOfString_String28= value; break; case(23): MapOfString_String29= value; break; case(24): MapOfString_String30= value; break; case(25): MapOfString_String31= value; break; case(26): MapOfString_String33= value; break; case(27): MapOfString_String35= value; break; case(28): MapOfDate_String36= value; break; case(29): MapOfDate_String37= value; break; case(30): MapOfDate_String38= value; break; case(31): MapOfDate_String39= value; break; case(32): MapOfDate_String40= value; break; case(33): MapOfDate_String42= value; break; case(34): MapOfDate_String44= value; break; case(35): MapOfBigDecimal_String45= value; break; case(36): MapOfBigDecimal_String46= value; break; case(37): MapOfBigDecimal_String47= value; break; case(38): MapOfBigDecimal_String48= value; break; case(39): MapOfBigDecimal_String49= value; break; case(40): MapOfBigDecimal_String51= value; break; case(41): MapOfBigDecimal_String53= value; break; case(42): MapOfBigInteger_String54= value; break; case(43): MapOfBigInteger_String55= value; break; case(44): MapOfBigInteger_String56= value; break; case(45): MapOfBigInteger_String57= value; break; case(46): MapOfBigInteger_String58= value; break; case(47): MapOfBigInteger_String60= value; break; case(48): MapOfBigInteger_String62= value; break; case(49): MapOfByte_String63= value; break; case(50): MapOfByte_String64= value; break; case(51): MapOfByte_String65= value; break; case(52): MapOfByte_String66= value; break; case(53): MapOfByte_String67= value; break; case(54): MapOfByte_String69= value; break; case(55): MapOfByte_String71= value; break; case(56): MapOfDouble_String72= value; break; case(57): MapOfDouble_String73= value; break; case(58): MapOfDouble_String74= value; break; case(59): MapOfDouble_String75= value; break; case(60): MapOfDouble_String76= value; break; case(61): MapOfDouble_String78= value; break; case(62): MapOfDouble_String80= value; break; case(63): MapOfFloat_String81= value; break; case(64): MapOfFloat_String82= value; break; case(65): MapOfFloat_String83= value; break; case(66): MapOfFloat_String84= value; break; case(67): MapOfFloat_String85= value; break; case(68): MapOfFloat_String87= value; break; case(69): MapOfFloat_String89= value; break; case(70): MapOfInteger_String90= value; break; case(71): MapOfInteger_String91= value; break; case(72): MapOfInteger_String92= value; break; case(73): MapOfInteger_String93= value; break; case(74): MapOfInteger_String94= value; break; case(75): MapOfInteger_String96= value; break; case(76): MapOfInteger_String98= value; break; case(77): MapOfLong_String99= value; break; case(78): MapOfLong_String100= value; break; case(79): MapOfLong_String101= value; break; case(80): MapOfLong_String102= value; break; case(81): MapOfLong_String103= value; break; case(82): MapOfLong_String105= value; break; case(83): MapOfLong_String107= value; break; case(84): MapOfShort_String108= value; break; case(85): MapOfShort_String109= value; break; case(86): MapOfShort_String110= value; break; case(87): MapOfShort_String111= value; break; case(88): MapOfShort_String112= value; break; case(89): MapOfShort_String114= value; break; case(90): MapOfShort_String116= value; break; case(91): MapOfSimpleEnum_String117= value; break; case(92): MapOfSimpleEnum_String118= value; break; case(93): MapOfSimpleEnum_String119= value; break; case(94): MapOfSimpleEnum_String120= value; break; case(95): MapOfSimpleEnum_String121= value; break; case(96): MapOfSimpleEnum_String122= value; break; case(97): MapOfSimpleEnum_String123= value; break; case(98): MapOfSimpleEnum_String124= value; break; case(99): MapOfSimpleEnum_String125= value; break; case(100): MapOfSimpleEnum_String126= value; break; case(101): MapOfSimpleEnum_String127= value; break; case(102): MapOfSimpleEnum_String128= value; break; case(103): MapOfSimpleEnum_String129= value; break; default: throw new IndexOutOfBoundsException("Bad index " + index); } return true; } public static class Oid implements Serializable { public int identifier; public Oid() { } public Oid(String s) { identifier = Integer.parseInt(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + identifier;} public int hashCode() { return (int)identifier ; } public boolean equals(Object other) { if (other != null && (other instanceof Oid)) { Oid k = (Oid)other; return k.identifier == this.identifier; } return false; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } } } tck/src/java/org/apache/jdo/tck/pc/fieldtypes/SetCollections.java100664 23565 12500110373 25327 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.io.Serializable; import java.util.Set; public class SetCollections { public int identifier; public Set SetOfObject0; public Set SetOfObject1; public Set SetOfObject2; public Set SetOfSimpleClass3; public Set SetOfSimpleClass4; public Set SetOfSimpleClass5; public Set SetOfSimpleInterface6; public Set SetOfSimpleInterface7; public Set SetOfSimpleInterface8; public Set SetOfString9; public Set SetOfString10; public Set SetOfString11; public Set SetOfDate12; public Set SetOfDate13; public Set SetOfDate14; public Set SetOfLocale15; public Set SetOfLocale16; public Set SetOfLocale17; public Set SetOfBigDecimal18; public Set SetOfBigDecimal19; public Set SetOfBigDecimal20; public Set SetOfBigInteger21; public Set SetOfBigInteger22; public Set SetOfBigInteger23; public Set SetOfByte24; public Set SetOfByte25; public Set SetOfByte26; public Set SetOfDouble27; public Set SetOfDouble28; public Set SetOfDouble29; public Set SetOfFloat30; public Set SetOfFloat31; public Set SetOfFloat32; public Set SetOfInteger33; public Set SetOfInteger34; public Set SetOfInteger35; public Set SetOfLong36; public Set SetOfLong37; public Set SetOfLong38; public Set SetOfShort39; public Set SetOfShort40; public Set SetOfShort41; public Set SetOfSimpleClass42; public static final String [] fieldSpecs = { "public Set SetOfObject0", "embedded-element=true public Set SetOfObject1", "embedded-element=false public Set SetOfObject2", "public Set SetOfSimpleClass3", "embedded-element=true public Set SetOfSimpleClass4", "embedded-element=false public Set SetOfSimpleClass5", "public Set SetOfSimpleInterface6", "embedded-element=true public Set SetOfSimpleInterface7", "embedded-element=false public Set SetOfSimpleInterface8", "public Set SetOfString9", "embedded-element=true public Set SetOfString10", "embedded-element=false public Set SetOfString11", "public Set SetOfDate12", "embedded-element=true public Set SetOfDate13", "embedded-element=false public Set SetOfDate14", "public Set SetOfLocale15", "embedded-element=true public Set SetOfLocale16", "embedded-element=false public Set SetOfLocale17", "public Set SetOfBigDecimal18", "embedded-element=true public Set SetOfBigDecimal19", "embedded-element=false public Set SetOfBigDecimal20", "public Set SetOfBigInteger21", "embedded-element=true public Set SetOfBigInteger22", "embedded-element=false public Set SetOfBigInteger23", "public Set SetOfByte24", "embedded-element=true public Set SetOfByte25", "embedded-element=false public Set SetOfByte26", "public Set SetOfDouble27", "embedded-element=true public Set SetOfDouble28", "embedded-element=false public Set SetOfDouble29", "public Set SetOfFloat30", "embedded-element=true public Set SetOfFloat31", "embedded-element=false public Set SetOfFloat32", "public Set SetOfInteger33", "embedded-element=true public Set SetOfInteger34", "embedded-element=false public Set SetOfInteger35", "public Set SetOfLong36", "embedded-element=true public Set SetOfLong37", "embedded-element=false public Set SetOfLong38", "public Set SetOfShort39", "embedded-element=true public Set SetOfShort40", "embedded-element=false public Set SetOfShort41", "serialized=true public Set SetOfSimpleClass42" }; public int getLength() { return fieldSpecs.length; } public Set get(int index) { switch (index) { case(0): return SetOfObject0; case(1): return SetOfObject1; case(2): return SetOfObject2; case(3): return SetOfSimpleClass3; case(4): return SetOfSimpleClass4; case(5): return SetOfSimpleClass5; case(6): return SetOfSimpleInterface6; case(7): return SetOfSimpleInterface7; case(8): return SetOfSimpleInterface8; case(9): return SetOfString9; case(10): return SetOfString10; case(11): return SetOfString11; case(12): return SetOfDate12; case(13): return SetOfDate13; case(14): return SetOfDate14; case(15): return SetOfLocale15; case(16): return SetOfLocale16; case(17): return SetOfLocale17; case(18): return SetOfBigDecimal18; case(19): return SetOfBigDecimal19; case(20): return SetOfBigDecimal20; case(21): return SetOfBigInteger21; case(22): return SetOfBigInteger22; case(23): return SetOfBigInteger23; case(24): return SetOfByte24; case(25): return SetOfByte25; case(26): return SetOfByte26; case(27): return SetOfDouble27; case(28): return SetOfDouble28; case(29): return SetOfDouble29; case(30): return SetOfFloat30; case(31): return SetOfFloat31; case(32): return SetOfFloat32; case(33): return SetOfInteger33; case(34): return SetOfInteger34; case(35): return SetOfInteger35; case(36): return SetOfLong36; case(37): return SetOfLong37; case(38): return SetOfLong38; case(39): return SetOfShort39; case(40): return SetOfShort40; case(41): return SetOfShort41; case(42): return SetOfSimpleClass42; default: throw new IndexOutOfBoundsException(); } } public boolean set(int index,Set value) { if(fieldSpecs[index].indexOf("final") != -1) return false; switch (index) { case(0): SetOfObject0= value; break; case(1): SetOfObject1= value; break; case(2): SetOfObject2= value; break; case(3): SetOfSimpleClass3= value; break; case(4): SetOfSimpleClass4= value; break; case(5): SetOfSimpleClass5= value; break; case(6): SetOfSimpleInterface6= value; break; case(7): SetOfSimpleInterface7= value; break; case(8): SetOfSimpleInterface8= value; break; case(9): SetOfString9= value; break; case(10): SetOfString10= value; break; case(11): SetOfString11= value; break; case(12): SetOfDate12= value; break; case(13): SetOfDate13= value; break; case(14): SetOfDate14= value; break; case(15): SetOfLocale15= value; break; case(16): SetOfLocale16= value; break; case(17): SetOfLocale17= value; break; case(18): SetOfBigDecimal18= value; break; case(19): SetOfBigDecimal19= value; break; case(20): SetOfBigDecimal20= value; break; case(21): SetOfBigInteger21= value; break; case(22): SetOfBigInteger22= value; break; case(23): SetOfBigInteger23= value; break; case(24): SetOfByte24= value; break; case(25): SetOfByte25= value; break; case(26): SetOfByte26= value; break; case(27): SetOfDouble27= value; break; case(28): SetOfDouble28= value; break; case(29): SetOfDouble29= value; break; case(30): SetOfFloat30= value; break; case(31): SetOfFloat31= value; break; case(32): SetOfFloat32= value; break; case(33): SetOfInteger33= value; break; case(34): SetOfInteger34= value; break; case(35): SetOfInteger35= value; break; case(36): SetOfLong36= value; break; case(37): SetOfLong37= value; break; case(38): SetOfLong38= value; break; case(39): SetOfShort39= value; break; case(40): SetOfShort40= value; break; case(41): SetOfShort41= value; break; case(42): SetOfSimpleClass42= value; break; default: throw new IndexOutOfBoundsException(); } return true; } public static class Oid implements Serializable { public int identifier; public Oid() { } public Oid(String s) { identifier = Integer.parseInt(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + identifier;} public int hashCode() { return (int)identifier ; } public boolean equals(Object other) { if (other != null && (other instanceof Oid)) { Oid k = (Oid)other; return k.identifier == this.identifier; } return false; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } } } tck/src/java/org/apache/jdo/tck/pc/fieldtypes/SimpleClass.java100664 6321 12500110373 24563 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.util.Date; import java.io.Serializable; public class SimpleClass implements Serializable, SimpleInterface, Comparable { private static long counter = new Date().getTime(); private static long newId() { synchronized (SimpleClass.class) { return counter++; } } private long id = newId(); private int intField=0; private String stringField = new String("Test"); public SimpleClass(){}; public SimpleClass(int intField, String stringField) { this.intField = intField; this.stringField = stringField; } public void setIntValue(int intField) { this.intField = intField; } public int getIntValue() { return intField; } public void setStringValue(String stringField) { this.stringField = stringField; } public String getStringValue() { return stringField; } public boolean equals(Object obj) { if(!(obj instanceof SimpleClass)) return false; if (intField == ((SimpleClass)obj).getIntValue() && stringField.equals(((SimpleClass)obj).getStringValue())) return true; else return false; } public int hashCode() { return intField ^ stringField.hashCode(); } public int compareTo(Object p) { SimpleClass sc = (SimpleClass) p; if( intField < sc.intField ) return -1; if( intField > sc.intField ) return 1; return stringField.compareTo(sc.stringField); } public static class Oid implements Serializable, Comparable { public long id; public Oid() { } public Oid(String s) { id = Integer.parseInt(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 k = (Oid)other; return k.id == this.id; } return false; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } public int compareTo(Object p){ // may throw ClassCastException which the user must handle Oid other = (Oid) p; if( id < other.id ) return -1; if( id > other.id ) return 1; return 0; } } } tck/src/java/org/apache/jdo/tck/pc/fieldtypes/SimpleEnum.java100664 6072 12500110373 24425 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.util.Date; import java.io.Serializable; public enum SimpleEnum { AL("ALABAMA"), AK("ALASKA"), AS("AMERICAN SAMOA"), AZ("ARIZONA"), AR("ARKANSAS"), CA("CALIFORNIA"), CO("COLORADO"), CT("CONNECTICUT"), DE("DELAWARE"), DC("DISTRICT OF COLUMBIA"), FM("FEDERATED STATES OF MICRONESIA"), FL("FLORIDA"), GA("GEORGIA"), GU("GUAM"), HI("HAWAII"), ID("IDAHO"), IL("ILLINOIS"), IN("INDIANA"), IA("IOWA"), KS("KANSAS"), KY("KENTUCKY"), LA("LOUISIANA"), ME("MAINE"), MH("MARSHALL ISLANDS"), MD("MARYLAND"), MA("MASSACHUSETTS"), MI("MICHIGAN"), MN("MINNESOTA"), MS("MISSISSIPPI"), MO("MISSOURI"), MT("MONTANA"), NE("NEBRASKA"), NV("NEVADA"), NH("NEW HAMPSHIRE"), NJ("NEW JERSEY"), NM("NEW MEXICO"), NY("NEW YORK"), NC("NORTH CAROLINA"), ND("NORTH DAKOTA"), MP("NORTHERN MARIANA ISLANDS"), OH("OHIO"), OK("OKLAHOMA"), OR("OREGON"), PW("PALAU"), PA("PENNSYLVANIA"), PR("PUERTO RICO"), RI("RHODE ISLAND"), SC("SOUTH CAROLINA"), SD("SOUTH DAKOTA"), TN("TENNESSEE"), TX("TEXAS"), UT("UTAH"), VT("VERMONT"), VI("VIRGIN ISLANDS"), VA("VIRGINIA"), WA("WASHINGTON"), WV("WEST VIRGINIA"), WI("WISCONSIN"), WY("WYOMING"); String sname; SimpleEnum(String s) { sname = s; } public String toString() { return sname; }; public static class Oid implements Serializable, Comparable { public long id; public Oid() { } public Oid(String s) { id = Integer.parseInt(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 k = (Oid)other; return k.id == this.id; } return false; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } public int compareTo(Object p){ // may throw ClassCastException which the user must handle Oid other = (Oid) p; if( id < other.id ) return -1; if( id > other.id ) return 1; return 0; } } } tck/src/java/org/apache/jdo/tck/pc/fieldtypes/SimpleInterface.java100664 2031 12500110373 25410 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; public interface SimpleInterface { public void setIntValue(int intField); public int getIntValue(); public void setStringValue(String stringField); public String getStringValue(); } tck/src/java/org/apache/jdo/tck/pc/fieldtypes/TreeMapStringKeyCollections.java100664 63135 12500110373 27766 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.io.Serializable; import java.util.TreeMap; public class TreeMapStringKeyCollections { public int identifier; public TreeMap TreeMapOfString_Object0; public TreeMap TreeMapOfString_Object1; public TreeMap TreeMapOfString_Object2; public TreeMap TreeMapOfString_SimpleClass3; public TreeMap TreeMapOfString_SimpleClass4; public TreeMap TreeMapOfString_SimpleClass5; public TreeMap TreeMapOfString_SimpleInterface6; public TreeMap TreeMapOfString_SimpleInterface7; public TreeMap TreeMapOfString_SimpleInterface8; public TreeMap TreeMapOfString_String9; public TreeMap TreeMapOfString_String10; public TreeMap TreeMapOfString_String11; public TreeMap TreeMapOfString_Date12; public TreeMap TreeMapOfString_Date13; public TreeMap TreeMapOfString_Date14; public TreeMap TreeMapOfString_Locale15; public TreeMap TreeMapOfString_Locale16; public TreeMap TreeMapOfString_Locale17; public TreeMap TreeMapOfString_BigDecimal18; public TreeMap TreeMapOfString_BigDecimal19; public TreeMap TreeMapOfString_BigDecimal20; public TreeMap TreeMapOfString_BigInteger21; public TreeMap TreeMapOfString_BigInteger22; public TreeMap TreeMapOfString_BigInteger23; public TreeMap TreeMapOfString_Byte24; public TreeMap TreeMapOfString_Byte25; public TreeMap TreeMapOfString_Byte26; public TreeMap TreeMapOfString_Double27; public TreeMap TreeMapOfString_Double28; public TreeMap TreeMapOfString_Double29; public TreeMap TreeMapOfString_Float30; public TreeMap TreeMapOfString_Float31; public TreeMap TreeMapOfString_Float32; public TreeMap TreeMapOfString_Integer33; public TreeMap TreeMapOfString_Integer34; public TreeMap TreeMapOfString_Integer35; public TreeMap TreeMapOfString_Long36; public TreeMap TreeMapOfString_Long37; public TreeMap TreeMapOfString_Long38; public TreeMap TreeMapOfString_Short39; public TreeMap TreeMapOfString_Short40; public TreeMap TreeMapOfString_Short41; public TreeMap TreeMapOfString_Object42; public TreeMap TreeMapOfString_Object43; public TreeMap TreeMapOfString_SimpleClass45; public TreeMap TreeMapOfString_SimpleClass46; public TreeMap TreeMapOfString_SimpleInterface48; public TreeMap TreeMapOfString_SimpleInterface49; public TreeMap TreeMapOfString_String51; public TreeMap TreeMapOfString_String52; public TreeMap TreeMapOfString_Date54; public TreeMap TreeMapOfString_Date55; public TreeMap TreeMapOfString_Locale57; public TreeMap TreeMapOfString_Locale58; public TreeMap TreeMapOfString_BigDecimal60; public TreeMap TreeMapOfString_BigDecimal61; public TreeMap TreeMapOfString_BigInteger63; public TreeMap TreeMapOfString_BigInteger64; public TreeMap TreeMapOfString_Byte66; public TreeMap TreeMapOfString_Byte67; public TreeMap TreeMapOfString_Double69; public TreeMap TreeMapOfString_Double70; public TreeMap TreeMapOfString_Float72; public TreeMap TreeMapOfString_Float73; public TreeMap TreeMapOfString_Integer75; public TreeMap TreeMapOfString_Integer76; public TreeMap TreeMapOfString_Long78; public TreeMap TreeMapOfString_Long79; public TreeMap TreeMapOfString_Short81; public TreeMap TreeMapOfString_Short82; public TreeMap TreeMapOfString_Object84; public TreeMap TreeMapOfString_Object86; public TreeMap TreeMapOfString_SimpleClass87; public TreeMap TreeMapOfString_SimpleClass89; public TreeMap TreeMapOfString_SimpleInterface90; public TreeMap TreeMapOfString_SimpleInterface92; public TreeMap TreeMapOfString_String93; public TreeMap TreeMapOfString_String95; public TreeMap TreeMapOfString_Date96; public TreeMap TreeMapOfString_Date98; public TreeMap TreeMapOfString_Locale99; public TreeMap TreeMapOfString_Locale101; public TreeMap TreeMapOfString_BigDecimal102; public TreeMap TreeMapOfString_BigDecimal104; public TreeMap TreeMapOfString_BigInteger105; public TreeMap TreeMapOfString_BigInteger107; public TreeMap TreeMapOfString_Byte108; public TreeMap TreeMapOfString_Byte110; public TreeMap TreeMapOfString_Double111; public TreeMap TreeMapOfString_Double113; public TreeMap TreeMapOfString_Float114; public TreeMap TreeMapOfString_Float116; public TreeMap TreeMapOfString_Integer117; public TreeMap TreeMapOfString_Integer119; public TreeMap TreeMapOfString_Long120; public TreeMap TreeMapOfString_Long122; public TreeMap TreeMapOfString_Short123; public TreeMap TreeMapOfString_Short125; public static final String [] fieldSpecs = { "public TreeMap TreeMapOfString_Object0", "embedded-value=true public TreeMap TreeMapOfString_Object1", "embedded-value=false public TreeMap TreeMapOfString_Object2", "public TreeMap TreeMapOfString_SimpleClass3", "embedded-value=true public TreeMap TreeMapOfString_SimpleClass4", "embedded-value=false public TreeMap TreeMapOfString_SimpleClass5", "public TreeMap TreeMapOfString_SimpleInterface6", "embedded-value=true public TreeMap TreeMapOfString_SimpleInterface7", "embedded-value=false public TreeMap TreeMapOfString_SimpleInterface8", "public TreeMap TreeMapOfString_String9", "embedded-value=true public TreeMap TreeMapOfString_String10", "embedded-value=false public TreeMap TreeMapOfString_String11", "public TreeMap TreeMapOfString_Date12", "embedded-value=true public TreeMap TreeMapOfString_Date13", "embedded-value=false public TreeMap TreeMapOfString_Date14", "public TreeMap TreeMapOfString_Locale15", "embedded-value=true public TreeMap TreeMapOfString_Locale16", "embedded-value=false public TreeMap TreeMapOfString_Locale17", "public TreeMap TreeMapOfString_BigDecimal18", "embedded-value=true public TreeMap TreeMapOfString_BigDecimal19", "embedded-value=false public TreeMap TreeMapOfString_BigDecimal20", "public TreeMap TreeMapOfString_BigInteger21", "embedded-value=true public TreeMap TreeMapOfString_BigInteger22", "embedded-value=false public TreeMap TreeMapOfString_BigInteger23", "public TreeMap TreeMapOfString_Byte24", "embedded-value=true public TreeMap TreeMapOfString_Byte25", "embedded-value=false public TreeMap TreeMapOfString_Byte26", "public TreeMap TreeMapOfString_Double27", "embedded-value=true public TreeMap TreeMapOfString_Double28", "embedded-value=false public TreeMap TreeMapOfString_Double29", "public TreeMap TreeMapOfString_Float30", "embedded-value=true public TreeMap TreeMapOfString_Float31", "embedded-value=false public TreeMap TreeMapOfString_Float32", "public TreeMap TreeMapOfString_Integer33", "embedded-value=true public TreeMap TreeMapOfString_Integer34", "embedded-value=false public TreeMap TreeMapOfString_Integer35", "public TreeMap TreeMapOfString_Long36", "embedded-value=true public TreeMap TreeMapOfString_Long37", "embedded-value=false public TreeMap TreeMapOfString_Long38", "public TreeMap TreeMapOfString_Short39", "embedded-value=true public TreeMap TreeMapOfString_Short40", "embedded-value=false public TreeMap TreeMapOfString_Short41", "embedded-key=true public TreeMap TreeMapOfString_Object42", "embedded-key=true embedded-value=true public TreeMap TreeMapOfString_Object43", "embedded-key=true public TreeMap TreeMapOfString_SimpleClass45", "embedded-key=true embedded-value=true public TreeMap TreeMapOfString_SimpleClass46", "embedded-key=true public TreeMap TreeMapOfString_SimpleInterface48", "embedded-key=true embedded-value=true public TreeMap TreeMapOfString_SimpleInterface49", "embedded-key=true public TreeMap TreeMapOfString_String51", "embedded-key=true embedded-value=true public TreeMap TreeMapOfString_String52", "embedded-key=true public TreeMap TreeMapOfString_Date54", "embedded-key=true embedded-value=true public TreeMap TreeMapOfString_Date55", "embedded-key=true public TreeMap TreeMapOfString_Locale57", "embedded-key=true embedded-value=true public TreeMap TreeMapOfString_Locale58", "embedded-key=true public TreeMap TreeMapOfString_BigDecimal60", "embedded-key=true embedded-value=true public TreeMap TreeMapOfString_BigDecimal61", "embedded-key=true public TreeMap TreeMapOfString_BigInteger63", "embedded-key=true embedded-value=true public TreeMap TreeMapOfString_BigInteger64", "embedded-key=true public TreeMap TreeMapOfString_Byte66", "embedded-key=true embedded-value=true public TreeMap TreeMapOfString_Byte67", "embedded-key=true public TreeMap TreeMapOfString_Double69", "embedded-key=true embedded-value=true public TreeMap TreeMapOfString_Double70", "embedded-key=true public TreeMap TreeMapOfString_Float72", "embedded-key=true embedded-value=true public TreeMap TreeMapOfString_Float73", "embedded-key=true public TreeMap TreeMapOfString_Integer75", "embedded-key=true embedded-value=true public TreeMap TreeMapOfString_Integer76", "embedded-key=true public TreeMap TreeMapOfString_Long78", "embedded-key=true embedded-value=true public TreeMap TreeMapOfString_Long79", "embedded-key=true public TreeMap TreeMapOfString_Short81", "embedded-key=true embedded-value=true public TreeMap TreeMapOfString_Short82", "embedded-key=false public TreeMap TreeMapOfString_Object84", "embedded-key=false embedded-value=false public TreeMap TreeMapOfString_Object86", "embedded-key=false public TreeMap TreeMapOfString_SimpleClass87", "embedded-key=false embedded-value=false public TreeMap TreeMapOfString_SimpleClass89", "embedded-key=false public TreeMap TreeMapOfString_SimpleInterface90", "embedded-key=false embedded-value=false public TreeMap TreeMapOfString_SimpleInterface92", "embedded-key=false public TreeMap TreeMapOfString_String93", "embedded-key=false embedded-value=false public TreeMap TreeMapOfString_String95", "embedded-key=false public TreeMap TreeMapOfString_Date96", "embedded-key=false embedded-value=false public TreeMap TreeMapOfString_Date98", "embedded-key=false public TreeMap TreeMapOfString_Locale99", "embedded-key=false embedded-value=false public TreeMap TreeMapOfString_Locale101", "embedded-key=false public TreeMap TreeMapOfString_BigDecimal102", "embedded-key=false embedded-value=false public TreeMap TreeMapOfString_BigDecimal104", "embedded-key=false public TreeMap TreeMapOfString_BigInteger105", "embedded-key=false embedded-value=false public TreeMap TreeMapOfString_BigInteger107", "embedded-key=false public TreeMap TreeMapOfString_Byte108", "embedded-key=false embedded-value=false public TreeMap TreeMapOfString_Byte110", "embedded-key=false public TreeMap TreeMapOfString_Double111", "embedded-key=false embedded-value=false public TreeMap TreeMapOfString_Double113", "embedded-key=false public TreeMap TreeMapOfString_Float114", "embedded-key=false embedded-value=false public TreeMap TreeMapOfString_Float116", "embedded-key=false public TreeMap TreeMapOfString_Integer117", "embedded-key=false embedded-value=false public TreeMap TreeMapOfString_Integer119", "embedded-key=false public TreeMap TreeMapOfString_Long120", "embedded-key=false embedded-value=false public TreeMap TreeMapOfString_Long122", "embedded-key=false public TreeMap TreeMapOfString_Short123", "embedded-key=false embedded-value=false public TreeMap TreeMapOfString_Short125" }; public int getLength() { return fieldSpecs.length; } public TreeMap get(int index) { switch (index) { case(0): return TreeMapOfString_Object0; case(1): return TreeMapOfString_Object1; case(2): return TreeMapOfString_Object2; case(3): return TreeMapOfString_SimpleClass3; case(4): return TreeMapOfString_SimpleClass4; case(5): return TreeMapOfString_SimpleClass5; case(6): return TreeMapOfString_SimpleInterface6; case(7): return TreeMapOfString_SimpleInterface7; case(8): return TreeMapOfString_SimpleInterface8; case(9): return TreeMapOfString_String9; case(10): return TreeMapOfString_String10; case(11): return TreeMapOfString_String11; case(12): return TreeMapOfString_Date12; case(13): return TreeMapOfString_Date13; case(14): return TreeMapOfString_Date14; case(15): return TreeMapOfString_Locale15; case(16): return TreeMapOfString_Locale16; case(17): return TreeMapOfString_Locale17; case(18): return TreeMapOfString_BigDecimal18; case(19): return TreeMapOfString_BigDecimal19; case(20): return TreeMapOfString_BigDecimal20; case(21): return TreeMapOfString_BigInteger21; case(22): return TreeMapOfString_BigInteger22; case(23): return TreeMapOfString_BigInteger23; case(24): return TreeMapOfString_Byte24; case(25): return TreeMapOfString_Byte25; case(26): return TreeMapOfString_Byte26; case(27): return TreeMapOfString_Double27; case(28): return TreeMapOfString_Double28; case(29): return TreeMapOfString_Double29; case(30): return TreeMapOfString_Float30; case(31): return TreeMapOfString_Float31; case(32): return TreeMapOfString_Float32; case(33): return TreeMapOfString_Integer33; case(34): return TreeMapOfString_Integer34; case(35): return TreeMapOfString_Integer35; case(36): return TreeMapOfString_Long36; case(37): return TreeMapOfString_Long37; case(38): return TreeMapOfString_Long38; case(39): return TreeMapOfString_Short39; case(40): return TreeMapOfString_Short40; case(41): return TreeMapOfString_Short41; case(42): return TreeMapOfString_Object42; case(43): return TreeMapOfString_Object43; case(44): return TreeMapOfString_SimpleClass45; case(45): return TreeMapOfString_SimpleClass46; case(46): return TreeMapOfString_SimpleInterface48; case(47): return TreeMapOfString_SimpleInterface49; case(48): return TreeMapOfString_String51; case(49): return TreeMapOfString_String52; case(50): return TreeMapOfString_Date54; case(51): return TreeMapOfString_Date55; case(52): return TreeMapOfString_Locale57; case(53): return TreeMapOfString_Locale58; case(54): return TreeMapOfString_BigDecimal60; case(55): return TreeMapOfString_BigDecimal61; case(56): return TreeMapOfString_BigInteger63; case(57): return TreeMapOfString_BigInteger64; case(58): return TreeMapOfString_Byte66; case(59): return TreeMapOfString_Byte67; case(60): return TreeMapOfString_Double69; case(61): return TreeMapOfString_Double70; case(62): return TreeMapOfString_Float72; case(63): return TreeMapOfString_Float73; case(64): return TreeMapOfString_Integer75; case(65): return TreeMapOfString_Integer76; case(66): return TreeMapOfString_Long78; case(67): return TreeMapOfString_Long79; case(68): return TreeMapOfString_Short81; case(69): return TreeMapOfString_Short82; case(70): return TreeMapOfString_Object84; case(71): return TreeMapOfString_Object86; case(72): return TreeMapOfString_SimpleClass87; case(73): return TreeMapOfString_SimpleClass89; case(74): return TreeMapOfString_SimpleInterface90; case(75): return TreeMapOfString_SimpleInterface92; case(76): return TreeMapOfString_String93; case(77): return TreeMapOfString_String95; case(78): return TreeMapOfString_Date96; case(79): return TreeMapOfString_Date98; case(80): return TreeMapOfString_Locale99; case(81): return TreeMapOfString_Locale101; case(82): return TreeMapOfString_BigDecimal102; case(83): return TreeMapOfString_BigDecimal104; case(84): return TreeMapOfString_BigInteger105; case(85): return TreeMapOfString_BigInteger107; case(86): return TreeMapOfString_Byte108; case(87): return TreeMapOfString_Byte110; case(88): return TreeMapOfString_Double111; case(89): return TreeMapOfString_Double113; case(90): return TreeMapOfString_Float114; case(91): return TreeMapOfString_Float116; case(92): return TreeMapOfString_Integer117; case(93): return TreeMapOfString_Integer119; case(94): return TreeMapOfString_Long120; case(95): return TreeMapOfString_Long122; case(96): return TreeMapOfString_Short123; case(97): return TreeMapOfString_Short125; default: throw new IndexOutOfBoundsException(); } } public boolean set(int index,TreeMap value) { if(fieldSpecs[index].indexOf("final") != -1) return false; switch (index) { case(0): TreeMapOfString_Object0= value; break; case(1): TreeMapOfString_Object1= value; break; case(2): TreeMapOfString_Object2= value; break; case(3): TreeMapOfString_SimpleClass3= value; break; case(4): TreeMapOfString_SimpleClass4= value; break; case(5): TreeMapOfString_SimpleClass5= value; break; case(6): TreeMapOfString_SimpleInterface6= value; break; case(7): TreeMapOfString_SimpleInterface7= value; break; case(8): TreeMapOfString_SimpleInterface8= value; break; case(9): TreeMapOfString_String9= value; break; case(10): TreeMapOfString_String10= value; break; case(11): TreeMapOfString_String11= value; break; case(12): TreeMapOfString_Date12= value; break; case(13): TreeMapOfString_Date13= value; break; case(14): TreeMapOfString_Date14= value; break; case(15): TreeMapOfString_Locale15= value; break; case(16): TreeMapOfString_Locale16= value; break; case(17): TreeMapOfString_Locale17= value; break; case(18): TreeMapOfString_BigDecimal18= value; break; case(19): TreeMapOfString_BigDecimal19= value; break; case(20): TreeMapOfString_BigDecimal20= value; break; case(21): TreeMapOfString_BigInteger21= value; break; case(22): TreeMapOfString_BigInteger22= value; break; case(23): TreeMapOfString_BigInteger23= value; break; case(24): TreeMapOfString_Byte24= value; break; case(25): TreeMapOfString_Byte25= value; break; case(26): TreeMapOfString_Byte26= value; break; case(27): TreeMapOfString_Double27= value; break; case(28): TreeMapOfString_Double28= value; break; case(29): TreeMapOfString_Double29= value; break; case(30): TreeMapOfString_Float30= value; break; case(31): TreeMapOfString_Float31= value; break; case(32): TreeMapOfString_Float32= value; break; case(33): TreeMapOfString_Integer33= value; break; case(34): TreeMapOfString_Integer34= value; break; case(35): TreeMapOfString_Integer35= value; break; case(36): TreeMapOfString_Long36= value; break; case(37): TreeMapOfString_Long37= value; break; case(38): TreeMapOfString_Long38= value; break; case(39): TreeMapOfString_Short39= value; break; case(40): TreeMapOfString_Short40= value; break; case(41): TreeMapOfString_Short41= value; break; case(42): TreeMapOfString_Object42= value; break; case(43): TreeMapOfString_Object43= value; break; case(44): TreeMapOfString_SimpleClass45= value; break; case(45): TreeMapOfString_SimpleClass46= value; break; case(46): TreeMapOfString_SimpleInterface48= value; break; case(47): TreeMapOfString_SimpleInterface49= value; break; case(48): TreeMapOfString_String51= value; break; case(49): TreeMapOfString_String52= value; break; case(50): TreeMapOfString_Date54= value; break; case(51): TreeMapOfString_Date55= value; break; case(52): TreeMapOfString_Locale57= value; break; case(53): TreeMapOfString_Locale58= value; break; case(54): TreeMapOfString_BigDecimal60= value; break; case(55): TreeMapOfString_BigDecimal61= value; break; case(56): TreeMapOfString_BigInteger63= value; break; case(57): TreeMapOfString_BigInteger64= value; break; case(58): TreeMapOfString_Byte66= value; break; case(59): TreeMapOfString_Byte67= value; break; case(60): TreeMapOfString_Double69= value; break; case(61): TreeMapOfString_Double70= value; break; case(62): TreeMapOfString_Float72= value; break; case(63): TreeMapOfString_Float73= value; break; case(64): TreeMapOfString_Integer75= value; break; case(65): TreeMapOfString_Integer76= value; break; case(66): TreeMapOfString_Long78= value; break; case(67): TreeMapOfString_Long79= value; break; case(68): TreeMapOfString_Short81= value; break; case(69): TreeMapOfString_Short82= value; break; case(70): TreeMapOfString_Object84= value; break; case(71): TreeMapOfString_Object86= value; break; case(72): TreeMapOfString_SimpleClass87= value; break; case(73): TreeMapOfString_SimpleClass89= value; break; case(74): TreeMapOfString_SimpleInterface90= value; break; case(75): TreeMapOfString_SimpleInterface92= value; break; case(76): TreeMapOfString_String93= value; break; case(77): TreeMapOfString_String95= value; break; case(78): TreeMapOfString_Date96= value; break; case(79): TreeMapOfString_Date98= value; break; case(80): TreeMapOfString_Locale99= value; break; case(81): TreeMapOfString_Locale101= value; break; case(82): TreeMapOfString_BigDecimal102= value; break; case(83): TreeMapOfString_BigDecimal104= value; break; case(84): TreeMapOfString_BigInteger105= value; break; case(85): TreeMapOfString_BigInteger107= value; break; case(86): TreeMapOfString_Byte108= value; break; case(87): TreeMapOfString_Byte110= value; break; case(88): TreeMapOfString_Double111= value; break; case(89): TreeMapOfString_Double113= value; break; case(90): TreeMapOfString_Float114= value; break; case(91): TreeMapOfString_Float116= value; break; case(92): TreeMapOfString_Integer117= value; break; case(93): TreeMapOfString_Integer119= value; break; case(94): TreeMapOfString_Long120= value; break; case(95): TreeMapOfString_Long122= value; break; case(96): TreeMapOfString_Short123= value; break; case(97): TreeMapOfString_Short125= value; break; default: throw new IndexOutOfBoundsException(); } return true; } public static class Oid implements Serializable { public int identifier; public Oid() { } public Oid(String s) { identifier = Integer.parseInt(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + identifier;} public int hashCode() { return (int)identifier ; } public boolean equals(Object other) { if (other != null && (other instanceof Oid)) { Oid k = (Oid)other; return k.identifier == this.identifier; } return false; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } } } tck/src/java/org/apache/jdo/tck/pc/fieldtypes/TreeMapStringValueCollections.java100664 57705 12500110373 30320 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.io.Serializable; import java.util.TreeMap; public class TreeMapStringValueCollections { public int identifier; public TreeMap TreeMapOfObject_String0; public TreeMap TreeMapOfObject_String1; public TreeMap TreeMapOfObject_String2; public TreeMap TreeMapOfObject_String3; public TreeMap TreeMapOfObject_String4; public TreeMap TreeMapOfObject_String6; public TreeMap TreeMapOfObject_String8; public TreeMap TreeMapOfSimpleClass_String9; public TreeMap TreeMapOfSimpleClass_String10; public TreeMap TreeMapOfSimpleClass_String11; public TreeMap TreeMapOfSimpleClass_String12; public TreeMap TreeMapOfSimpleClass_String13; public TreeMap TreeMapOfSimpleClass_String15; public TreeMap TreeMapOfSimpleClass_String17; public TreeMap TreeMapOfSimpleInterface_String18; public TreeMap TreeMapOfSimpleInterface_String19; public TreeMap TreeMapOfSimpleInterface_String20; public TreeMap TreeMapOfSimpleInterface_String21; public TreeMap TreeMapOfSimpleInterface_String22; public TreeMap TreeMapOfSimpleInterface_String24; public TreeMap TreeMapOfSimpleInterface_String26; public TreeMap TreeMapOfString_String27; public TreeMap TreeMapOfString_String28; public TreeMap TreeMapOfString_String29; public TreeMap TreeMapOfString_String30; public TreeMap TreeMapOfString_String31; public TreeMap TreeMapOfString_String33; public TreeMap TreeMapOfString_String35; public TreeMap TreeMapOfDate_String36; public TreeMap TreeMapOfDate_String37; public TreeMap TreeMapOfDate_String38; public TreeMap TreeMapOfDate_String39; public TreeMap TreeMapOfDate_String40; public TreeMap TreeMapOfDate_String42; public TreeMap TreeMapOfDate_String44; public TreeMap TreeMapOfBigDecimal_String45; public TreeMap TreeMapOfBigDecimal_String46; public TreeMap TreeMapOfBigDecimal_String47; public TreeMap TreeMapOfBigDecimal_String48; public TreeMap TreeMapOfBigDecimal_String49; public TreeMap TreeMapOfBigDecimal_String51; public TreeMap TreeMapOfBigDecimal_String53; public TreeMap TreeMapOfBigInteger_String54; public TreeMap TreeMapOfBigInteger_String55; public TreeMap TreeMapOfBigInteger_String56; public TreeMap TreeMapOfBigInteger_String57; public TreeMap TreeMapOfBigInteger_String58; public TreeMap TreeMapOfBigInteger_String60; public TreeMap TreeMapOfBigInteger_String62; public TreeMap TreeMapOfByte_String63; public TreeMap TreeMapOfByte_String64; public TreeMap TreeMapOfByte_String65; public TreeMap TreeMapOfByte_String66; public TreeMap TreeMapOfByte_String67; public TreeMap TreeMapOfByte_String69; public TreeMap TreeMapOfByte_String71; public TreeMap TreeMapOfDouble_String72; public TreeMap TreeMapOfDouble_String73; public TreeMap TreeMapOfDouble_String74; public TreeMap TreeMapOfDouble_String75; public TreeMap TreeMapOfDouble_String76; public TreeMap TreeMapOfDouble_String78; public TreeMap TreeMapOfDouble_String80; public TreeMap TreeMapOfFloat_String81; public TreeMap TreeMapOfFloat_String82; public TreeMap TreeMapOfFloat_String83; public TreeMap TreeMapOfFloat_String84; public TreeMap TreeMapOfFloat_String85; public TreeMap TreeMapOfFloat_String87; public TreeMap TreeMapOfFloat_String89; public TreeMap TreeMapOfInteger_String90; public TreeMap TreeMapOfInteger_String91; public TreeMap TreeMapOfInteger_String92; public TreeMap TreeMapOfInteger_String93; public TreeMap TreeMapOfInteger_String94; public TreeMap TreeMapOfInteger_String96; public TreeMap TreeMapOfInteger_String98; public TreeMap TreeMapOfLong_String99; public TreeMap TreeMapOfLong_String100; public TreeMap TreeMapOfLong_String101; public TreeMap TreeMapOfLong_String102; public TreeMap TreeMapOfLong_String103; public TreeMap TreeMapOfLong_String105; public TreeMap TreeMapOfLong_String107; public TreeMap TreeMapOfShort_String108; public TreeMap TreeMapOfShort_String109; public TreeMap TreeMapOfShort_String110; public TreeMap TreeMapOfShort_String111; public TreeMap TreeMapOfShort_String112; public TreeMap TreeMapOfShort_String114; public TreeMap TreeMapOfShort_String116; public static final String [] fieldSpecs = { "public TreeMap TreeMapOfObject_String0", "embedded-value=true public TreeMap TreeMapOfObject_String1", "embedded-value=false public TreeMap TreeMapOfObject_String2", "embedded-key=true public TreeMap TreeMapOfObject_String3", "embedded-key=true embedded-value=true public TreeMap TreeMapOfObject_String4", "embedded-key=false public TreeMap TreeMapOfObject_String6", "embedded-key=false embedded-value=false public TreeMap TreeMapOfObject_String8", "public TreeMap TreeMapOfSimpleClass_String9", "embedded-value=true public TreeMap TreeMapOfSimpleClass_String10", "embedded-value=false public TreeMap TreeMapOfSimpleClass_String11", "embedded-key=true public TreeMap TreeMapOfSimpleClass_String12", "embedded-key=true embedded-value=true public TreeMap TreeMapOfSimpleClass_String13", "embedded-key=false public TreeMap TreeMapOfSimpleClass_String15", "embedded-key=false embedded-value=false public TreeMap TreeMapOfSimpleClass_String17", "public TreeMap TreeMapOfSimpleInterface_String18", "embedded-value=true public TreeMap TreeMapOfSimpleInterface_String19", "embedded-value=false public TreeMap TreeMapOfSimpleInterface_String20", "embedded-key=true public TreeMap TreeMapOfSimpleInterface_String21", "embedded-key=true embedded-value=true public TreeMap TreeMapOfSimpleInterface_String22", "embedded-key=false public TreeMap TreeMapOfSimpleInterface_String24", "embedded-key=false embedded-value=false public TreeMap TreeMapOfSimpleInterface_String26", "public TreeMap TreeMapOfString_String27", "embedded-value=true public TreeMap TreeMapOfString_String28", "embedded-value=false public TreeMap TreeMapOfString_String29", "embedded-key=true public TreeMap TreeMapOfString_String30", "embedded-key=true embedded-value=true public TreeMap TreeMapOfString_String31", "embedded-key=false public TreeMap TreeMapOfString_String33", "embedded-key=false embedded-value=false public TreeMap TreeMapOfString_String35", "public TreeMap TreeMapOfDate_String36", "embedded-value=true public TreeMap TreeMapOfDate_String37", "embedded-value=false public TreeMap TreeMapOfDate_String38", "embedded-key=true public TreeMap TreeMapOfDate_String39", "embedded-key=true embedded-value=true public TreeMap TreeMapOfDate_String40", "embedded-key=false public TreeMap TreeMapOfDate_String42", "embedded-key=false embedded-value=false public TreeMap TreeMapOfDate_String44", "public TreeMap TreeMapOfBigDecimal_String45", "embedded-value=true public TreeMap TreeMapOfBigDecimal_String46", "embedded-value=false public TreeMap TreeMapOfBigDecimal_String47", "embedded-key=true public TreeMap TreeMapOfBigDecimal_String48", "embedded-key=true embedded-value=true public TreeMap TreeMapOfBigDecimal_String49", "embedded-key=false public TreeMap TreeMapOfBigDecimal_String51", "embedded-key=false embedded-value=false public TreeMap TreeMapOfBigDecimal_String53", "public TreeMap TreeMapOfBigInteger_String54", "embedded-value=true public TreeMap TreeMapOfBigInteger_String55", "embedded-value=false public TreeMap TreeMapOfBigInteger_String56", "embedded-key=true public TreeMap TreeMapOfBigInteger_String57", "embedded-key=true embedded-value=true public TreeMap TreeMapOfBigInteger_String58", "embedded-key=false public TreeMap TreeMapOfBigInteger_String60", "embedded-key=false embedded-value=false public TreeMap TreeMapOfBigInteger_String62", "public TreeMap TreeMapOfByte_String63", "embedded-value=true public TreeMap TreeMapOfByte_String64", "embedded-value=false public TreeMap TreeMapOfByte_String65", "embedded-key=true public TreeMap TreeMapOfByte_String66", "embedded-key=true embedded-value=true public TreeMap TreeMapOfByte_String67", "embedded-key=false public TreeMap TreeMapOfByte_String69", "embedded-key=false embedded-value=false public TreeMap TreeMapOfByte_String71", "public TreeMap TreeMapOfDouble_String72", "embedded-value=true public TreeMap TreeMapOfDouble_String73", "embedded-value=false public TreeMap TreeMapOfDouble_String74", "embedded-key=true public TreeMap TreeMapOfDouble_String75", "embedded-key=true embedded-value=true public TreeMap TreeMapOfDouble_String76", "embedded-key=false public TreeMap TreeMapOfDouble_String78", "embedded-key=false embedded-value=false public TreeMap TreeMapOfDouble_String80", "public TreeMap TreeMapOfFloat_String81", "embedded-value=true public TreeMap TreeMapOfFloat_String82", "embedded-value=false public TreeMap TreeMapOfFloat_String83", "embedded-key=true public TreeMap TreeMapOfFloat_String84", "embedded-key=true embedded-value=true public TreeMap TreeMapOfFloat_String85", "embedded-key=false public TreeMap TreeMapOfFloat_String87", "embedded-key=false embedded-value=false public TreeMap TreeMapOfFloat_String89", "public TreeMap TreeMapOfInteger_String90", "embedded-value=true public TreeMap TreeMapOfInteger_String91", "embedded-value=false public TreeMap TreeMapOfInteger_String92", "embedded-key=true public TreeMap TreeMapOfInteger_String93", "embedded-key=true embedded-value=true public TreeMap TreeMapOfInteger_String94", "embedded-key=false public TreeMap TreeMapOfInteger_String96", "embedded-key=false embedded-value=false public TreeMap TreeMapOfInteger_String98", "public TreeMap TreeMapOfLong_String99", "embedded-value=true public TreeMap TreeMapOfLong_String100", "embedded-value=false public TreeMap TreeMapOfLong_String101", "embedded-key=true public TreeMap TreeMapOfLong_String102", "embedded-key=true embedded-value=true public TreeMap TreeMapOfLong_String103", "embedded-key=false public TreeMap TreeMapOfLong_String105", "embedded-key=false embedded-value=false public TreeMap TreeMapOfLong_String107", "public TreeMap TreeMapOfShort_String108", "embedded-value=true public TreeMap TreeMapOfShort_String109", "embedded-value=false public TreeMap TreeMapOfShort_String110", "embedded-key=true public TreeMap TreeMapOfShort_String111", "embedded-key=true embedded-value=true public TreeMap TreeMapOfShort_String112", "embedded-key=false public TreeMap TreeMapOfShort_String114", "embedded-key=false embedded-value=false public TreeMap TreeMapOfShort_String116" }; public int getLength() { return fieldSpecs.length; } public TreeMap get(int index) { switch (index) { case(0): return TreeMapOfObject_String0; case(1): return TreeMapOfObject_String1; case(2): return TreeMapOfObject_String2; case(3): return TreeMapOfObject_String3; case(4): return TreeMapOfObject_String4; case(5): return TreeMapOfObject_String6; case(6): return TreeMapOfObject_String8; case(7): return TreeMapOfSimpleClass_String9; case(8): return TreeMapOfSimpleClass_String10; case(9): return TreeMapOfSimpleClass_String11; case(10): return TreeMapOfSimpleClass_String12; case(11): return TreeMapOfSimpleClass_String13; case(12): return TreeMapOfSimpleClass_String15; case(13): return TreeMapOfSimpleClass_String17; case(14): return TreeMapOfSimpleInterface_String18; case(15): return TreeMapOfSimpleInterface_String19; case(16): return TreeMapOfSimpleInterface_String20; case(17): return TreeMapOfSimpleInterface_String21; case(18): return TreeMapOfSimpleInterface_String22; case(19): return TreeMapOfSimpleInterface_String24; case(20): return TreeMapOfSimpleInterface_String26; case(21): return TreeMapOfString_String27; case(22): return TreeMapOfString_String28; case(23): return TreeMapOfString_String29; case(24): return TreeMapOfString_String30; case(25): return TreeMapOfString_String31; case(26): return TreeMapOfString_String33; case(27): return TreeMapOfString_String35; case(28): return TreeMapOfDate_String36; case(29): return TreeMapOfDate_String37; case(30): return TreeMapOfDate_String38; case(31): return TreeMapOfDate_String39; case(32): return TreeMapOfDate_String40; case(33): return TreeMapOfDate_String42; case(34): return TreeMapOfDate_String44; case(35): return TreeMapOfBigDecimal_String45; case(36): return TreeMapOfBigDecimal_String46; case(37): return TreeMapOfBigDecimal_String47; case(38): return TreeMapOfBigDecimal_String48; case(39): return TreeMapOfBigDecimal_String49; case(40): return TreeMapOfBigDecimal_String51; case(41): return TreeMapOfBigDecimal_String53; case(42): return TreeMapOfBigInteger_String54; case(43): return TreeMapOfBigInteger_String55; case(44): return TreeMapOfBigInteger_String56; case(45): return TreeMapOfBigInteger_String57; case(46): return TreeMapOfBigInteger_String58; case(47): return TreeMapOfBigInteger_String60; case(48): return TreeMapOfBigInteger_String62; case(49): return TreeMapOfByte_String63; case(50): return TreeMapOfByte_String64; case(51): return TreeMapOfByte_String65; case(52): return TreeMapOfByte_String66; case(53): return TreeMapOfByte_String67; case(54): return TreeMapOfByte_String69; case(55): return TreeMapOfByte_String71; case(56): return TreeMapOfDouble_String72; case(57): return TreeMapOfDouble_String73; case(58): return TreeMapOfDouble_String74; case(59): return TreeMapOfDouble_String75; case(60): return TreeMapOfDouble_String76; case(61): return TreeMapOfDouble_String78; case(62): return TreeMapOfDouble_String80; case(63): return TreeMapOfFloat_String81; case(64): return TreeMapOfFloat_String82; case(65): return TreeMapOfFloat_String83; case(66): return TreeMapOfFloat_String84; case(67): return TreeMapOfFloat_String85; case(68): return TreeMapOfFloat_String87; case(69): return TreeMapOfFloat_String89; case(70): return TreeMapOfInteger_String90; case(71): return TreeMapOfInteger_String91; case(72): return TreeMapOfInteger_String92; case(73): return TreeMapOfInteger_String93; case(74): return TreeMapOfInteger_String94; case(75): return TreeMapOfInteger_String96; case(76): return TreeMapOfInteger_String98; case(77): return TreeMapOfLong_String99; case(78): return TreeMapOfLong_String100; case(79): return TreeMapOfLong_String101; case(80): return TreeMapOfLong_String102; case(81): return TreeMapOfLong_String103; case(82): return TreeMapOfLong_String105; case(83): return TreeMapOfLong_String107; case(84): return TreeMapOfShort_String108; case(85): return TreeMapOfShort_String109; case(86): return TreeMapOfShort_String110; case(87): return TreeMapOfShort_String111; case(88): return TreeMapOfShort_String112; case(89): return TreeMapOfShort_String114; case(90): return TreeMapOfShort_String116; default: throw new IndexOutOfBoundsException(); } } public boolean set(int index,TreeMap value) { if(fieldSpecs[index].indexOf("final") != -1) return false; switch (index) { case(0): TreeMapOfObject_String0= value; break; case(1): TreeMapOfObject_String1= value; break; case(2): TreeMapOfObject_String2= value; break; case(3): TreeMapOfObject_String3= value; break; case(4): TreeMapOfObject_String4= value; break; case(5): TreeMapOfObject_String6= value; break; case(6): TreeMapOfObject_String8= value; break; case(7): TreeMapOfSimpleClass_String9= value; break; case(8): TreeMapOfSimpleClass_String10= value; break; case(9): TreeMapOfSimpleClass_String11= value; break; case(10): TreeMapOfSimpleClass_String12= value; break; case(11): TreeMapOfSimpleClass_String13= value; break; case(12): TreeMapOfSimpleClass_String15= value; break; case(13): TreeMapOfSimpleClass_String17= value; break; case(14): TreeMapOfSimpleInterface_String18= value; break; case(15): TreeMapOfSimpleInterface_String19= value; break; case(16): TreeMapOfSimpleInterface_String20= value; break; case(17): TreeMapOfSimpleInterface_String21= value; break; case(18): TreeMapOfSimpleInterface_String22= value; break; case(19): TreeMapOfSimpleInterface_String24= value; break; case(20): TreeMapOfSimpleInterface_String26= value; break; case(21): TreeMapOfString_String27= value; break; case(22): TreeMapOfString_String28= value; break; case(23): TreeMapOfString_String29= value; break; case(24): TreeMapOfString_String30= value; break; case(25): TreeMapOfString_String31= value; break; case(26): TreeMapOfString_String33= value; break; case(27): TreeMapOfString_String35= value; break; case(28): TreeMapOfDate_String36= value; break; case(29): TreeMapOfDate_String37= value; break; case(30): TreeMapOfDate_String38= value; break; case(31): TreeMapOfDate_String39= value; break; case(32): TreeMapOfDate_String40= value; break; case(33): TreeMapOfDate_String42= value; break; case(34): TreeMapOfDate_String44= value; break; case(35): TreeMapOfBigDecimal_String45= value; break; case(36): TreeMapOfBigDecimal_String46= value; break; case(37): TreeMapOfBigDecimal_String47= value; break; case(38): TreeMapOfBigDecimal_String48= value; break; case(39): TreeMapOfBigDecimal_String49= value; break; case(40): TreeMapOfBigDecimal_String51= value; break; case(41): TreeMapOfBigDecimal_String53= value; break; case(42): TreeMapOfBigInteger_String54= value; break; case(43): TreeMapOfBigInteger_String55= value; break; case(44): TreeMapOfBigInteger_String56= value; break; case(45): TreeMapOfBigInteger_String57= value; break; case(46): TreeMapOfBigInteger_String58= value; break; case(47): TreeMapOfBigInteger_String60= value; break; case(48): TreeMapOfBigInteger_String62= value; break; case(49): TreeMapOfByte_String63= value; break; case(50): TreeMapOfByte_String64= value; break; case(51): TreeMapOfByte_String65= value; break; case(52): TreeMapOfByte_String66= value; break; case(53): TreeMapOfByte_String67= value; break; case(54): TreeMapOfByte_String69= value; break; case(55): TreeMapOfByte_String71= value; break; case(56): TreeMapOfDouble_String72= value; break; case(57): TreeMapOfDouble_String73= value; break; case(58): TreeMapOfDouble_String74= value; break; case(59): TreeMapOfDouble_String75= value; break; case(60): TreeMapOfDouble_String76= value; break; case(61): TreeMapOfDouble_String78= value; break; case(62): TreeMapOfDouble_String80= value; break; case(63): TreeMapOfFloat_String81= value; break; case(64): TreeMapOfFloat_String82= value; break; case(65): TreeMapOfFloat_String83= value; break; case(66): TreeMapOfFloat_String84= value; break; case(67): TreeMapOfFloat_String85= value; break; case(68): TreeMapOfFloat_String87= value; break; case(69): TreeMapOfFloat_String89= value; break; case(70): TreeMapOfInteger_String90= value; break; case(71): TreeMapOfInteger_String91= value; break; case(72): TreeMapOfInteger_String92= value; break; case(73): TreeMapOfInteger_String93= value; break; case(74): TreeMapOfInteger_String94= value; break; case(75): TreeMapOfInteger_String96= value; break; case(76): TreeMapOfInteger_String98= value; break; case(77): TreeMapOfLong_String99= value; break; case(78): TreeMapOfLong_String100= value; break; case(79): TreeMapOfLong_String101= value; break; case(80): TreeMapOfLong_String102= value; break; case(81): TreeMapOfLong_String103= value; break; case(82): TreeMapOfLong_String105= value; break; case(83): TreeMapOfLong_String107= value; break; case(84): TreeMapOfShort_String108= value; break; case(85): TreeMapOfShort_String109= value; break; case(86): TreeMapOfShort_String110= value; break; case(87): TreeMapOfShort_String111= value; break; case(88): TreeMapOfShort_String112= value; break; case(89): TreeMapOfShort_String114= value; break; case(90): TreeMapOfShort_String116= value; break; default: throw new IndexOutOfBoundsException(); } return true; } public static class Oid implements Serializable { public int identifier; public Oid() { } public Oid(String s) { identifier = Integer.parseInt(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + identifier;} public int hashCode() { return (int)identifier ; } public boolean equals(Object other) { if (other != null && (other instanceof Oid)) { Oid k = (Oid)other; return k.identifier == this.identifier; } return false; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } } } tck/src/java/org/apache/jdo/tck/pc/fieldtypes/TreeSetCollections.java100664 24104 12500110373 26135 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.io.Serializable; import java.util.TreeSet; public class TreeSetCollections { public int identifier; public TreeSet TreeSetOfObject0; public TreeSet TreeSetOfObject1; public TreeSet TreeSetOfObject2; public TreeSet TreeSetOfSimpleClass3; public TreeSet TreeSetOfSimpleClass4; public TreeSet TreeSetOfSimpleClass5; public TreeSet TreeSetOfSimpleInterface6; public TreeSet TreeSetOfSimpleInterface7; public TreeSet TreeSetOfSimpleInterface8; public TreeSet TreeSetOfString9; public TreeSet TreeSetOfString10; public TreeSet TreeSetOfString11; public TreeSet TreeSetOfDate12; public TreeSet TreeSetOfDate13; public TreeSet TreeSetOfDate14; public TreeSet TreeSetOfBigDecimal15; public TreeSet TreeSetOfBigDecimal16; public TreeSet TreeSetOfBigDecimal17; public TreeSet TreeSetOfBigInteger18; public TreeSet TreeSetOfBigInteger19; public TreeSet TreeSetOfBigInteger20; public TreeSet TreeSetOfByte21; public TreeSet TreeSetOfByte22; public TreeSet TreeSetOfByte23; public TreeSet TreeSetOfDouble24; public TreeSet TreeSetOfDouble25; public TreeSet TreeSetOfDouble26; public TreeSet TreeSetOfFloat27; public TreeSet TreeSetOfFloat28; public TreeSet TreeSetOfFloat29; public TreeSet TreeSetOfInteger30; public TreeSet TreeSetOfInteger31; public TreeSet TreeSetOfInteger32; public TreeSet TreeSetOfLong33; public TreeSet TreeSetOfLong34; public TreeSet TreeSetOfLong35; public TreeSet TreeSetOfShort36; public TreeSet TreeSetOfShort37; public TreeSet TreeSetOfShort38; public static final String [] fieldSpecs = { "public TreeSet TreeSetOfObject0", "embedded-element=true public TreeSet TreeSetOfObject1", "embedded-element=false public TreeSet TreeSetOfObject2", "public TreeSet TreeSetOfSimpleClass3", "embedded-element=true public TreeSet TreeSetOfSimpleClass4", "embedded-element=false public TreeSet TreeSetOfSimpleClass5", "public TreeSet TreeSetOfSimpleInterface6", "embedded-element=true public TreeSet TreeSetOfSimpleInterface7", "embedded-element=false public TreeSet TreeSetOfSimpleInterface8", "public TreeSet TreeSetOfString9", "embedded-element=true public TreeSet TreeSetOfString10", "embedded-element=false public TreeSet TreeSetOfString11", "public TreeSet TreeSetOfDate12", "embedded-element=true public TreeSet TreeSetOfDate13", "embedded-element=false public TreeSet TreeSetOfDate14", "public TreeSet TreeSetOfBigDecimal15", "embedded-element=true public TreeSet TreeSetOfBigDecimal16", "embedded-element=false public TreeSet TreeSetOfBigDecimal17", "public TreeSet TreeSetOfBigInteger18", "embedded-element=true public TreeSet TreeSetOfBigInteger19", "embedded-element=false public TreeSet TreeSetOfBigInteger20", "public TreeSet TreeSetOfByte21", "embedded-element=true public TreeSet TreeSetOfByte22", "embedded-element=false public TreeSet TreeSetOfByte23", "public TreeSet TreeSetOfDouble24", "embedded-element=true public TreeSet TreeSetOfDouble25", "embedded-element=false public TreeSet TreeSetOfDouble26", "public TreeSet TreeSetOfFloat27", "embedded-element=true public TreeSet TreeSetOfFloat28", "embedded-element=false public TreeSet TreeSetOfFloat29", "public TreeSet TreeSetOfInteger30", "embedded-element=true public TreeSet TreeSetOfInteger31", "embedded-element=false public TreeSet TreeSetOfInteger32", "public TreeSet TreeSetOfLong33", "embedded-element=true public TreeSet TreeSetOfLong34", "embedded-element=false public TreeSet TreeSetOfLong35", "public TreeSet TreeSetOfShort36", "embedded-element=true public TreeSet TreeSetOfShort37", "embedded-element=false public TreeSet TreeSetOfShort38" }; public int getLength() { return fieldSpecs.length; } public TreeSet get(int index) { switch (index) { case(0): return TreeSetOfObject0; case(1): return TreeSetOfObject1; case(2): return TreeSetOfObject2; case(3): return TreeSetOfSimpleClass3; case(4): return TreeSetOfSimpleClass4; case(5): return TreeSetOfSimpleClass5; case(6): return TreeSetOfSimpleInterface6; case(7): return TreeSetOfSimpleInterface7; case(8): return TreeSetOfSimpleInterface8; case(9): return TreeSetOfString9; case(10): return TreeSetOfString10; case(11): return TreeSetOfString11; case(12): return TreeSetOfDate12; case(13): return TreeSetOfDate13; case(14): return TreeSetOfDate14; case(15): return TreeSetOfBigDecimal15; case(16): return TreeSetOfBigDecimal16; case(17): return TreeSetOfBigDecimal17; case(18): return TreeSetOfBigInteger18; case(19): return TreeSetOfBigInteger19; case(20): return TreeSetOfBigInteger20; case(21): return TreeSetOfByte21; case(22): return TreeSetOfByte22; case(23): return TreeSetOfByte23; case(24): return TreeSetOfDouble24; case(25): return TreeSetOfDouble25; case(26): return TreeSetOfDouble26; case(27): return TreeSetOfFloat27; case(28): return TreeSetOfFloat28; case(29): return TreeSetOfFloat29; case(30): return TreeSetOfInteger30; case(31): return TreeSetOfInteger31; case(32): return TreeSetOfInteger32; case(33): return TreeSetOfLong33; case(34): return TreeSetOfLong34; case(35): return TreeSetOfLong35; case(36): return TreeSetOfShort36; case(37): return TreeSetOfShort37; case(38): return TreeSetOfShort38; default: throw new IndexOutOfBoundsException(); } } public boolean set(int index,TreeSet value) { if(fieldSpecs[index].indexOf("final") != -1) return false; switch (index) { case(0): TreeSetOfObject0= value; break; case(1): TreeSetOfObject1= value; break; case(2): TreeSetOfObject2= value; break; case(3): TreeSetOfSimpleClass3= value; break; case(4): TreeSetOfSimpleClass4= value; break; case(5): TreeSetOfSimpleClass5= value; break; case(6): TreeSetOfSimpleInterface6= value; break; case(7): TreeSetOfSimpleInterface7= value; break; case(8): TreeSetOfSimpleInterface8= value; break; case(9): TreeSetOfString9= value; break; case(10): TreeSetOfString10= value; break; case(11): TreeSetOfString11= value; break; case(12): TreeSetOfDate12= value; break; case(13): TreeSetOfDate13= value; break; case(14): TreeSetOfDate14= value; break; case(15): TreeSetOfBigDecimal15= value; break; case(16): TreeSetOfBigDecimal16= value; break; case(17): TreeSetOfBigDecimal17= value; break; case(18): TreeSetOfBigInteger18= value; break; case(19): TreeSetOfBigInteger19= value; break; case(20): TreeSetOfBigInteger20= value; break; case(21): TreeSetOfByte21= value; break; case(22): TreeSetOfByte22= value; break; case(23): TreeSetOfByte23= value; break; case(24): TreeSetOfDouble24= value; break; case(25): TreeSetOfDouble25= value; break; case(26): TreeSetOfDouble26= value; break; case(27): TreeSetOfFloat27= value; break; case(28): TreeSetOfFloat28= value; break; case(29): TreeSetOfFloat29= value; break; case(30): TreeSetOfInteger30= value; break; case(31): TreeSetOfInteger31= value; break; case(32): TreeSetOfInteger32= value; break; case(33): TreeSetOfLong33= value; break; case(34): TreeSetOfLong34= value; break; case(35): TreeSetOfLong35= value; break; case(36): TreeSetOfShort36= value; break; case(37): TreeSetOfShort37= value; break; case(38): TreeSetOfShort38= value; break; default: throw new IndexOutOfBoundsException(); } return true; } public static class Oid implements Serializable { public int identifier; public Oid() { } public Oid(String s) { identifier = Integer.parseInt(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + identifier;} public int hashCode() { return (int)identifier ; } public boolean equals(Object other) { if (other != null && (other instanceof Oid)) { Oid k = (Oid)other; return k.identifier == this.identifier; } return false; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } } } tck/src/java/org/apache/jdo/tck/pc/fieldtypes/VectorCollections.java100664 25227 12500110373 26033 0ustarmbouschenstaff 0 0 /* * 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.fieldtypes; import java.io.Serializable; import java.util.Vector; public class VectorCollections { public int identifier; public Vector VectorOfObject0; public Vector VectorOfObject1; public Vector VectorOfObject2; public Vector VectorOfSimpleClass3; public Vector VectorOfSimpleClass4; public Vector VectorOfSimpleClass5; public Vector VectorOfSimpleInterface6; public Vector VectorOfSimpleInterface7; public Vector VectorOfSimpleInterface8; public Vector VectorOfString9; public Vector VectorOfString10; public Vector VectorOfString11; public Vector VectorOfDate12; public Vector VectorOfDate13; public Vector VectorOfDate14; public Vector VectorOfLocale15; public Vector VectorOfLocale16; public Vector VectorOfLocale17; public Vector VectorOfBigDecimal18; public Vector VectorOfBigDecimal19; public Vector VectorOfBigDecimal20; public Vector VectorOfBigInteger21; public Vector VectorOfBigInteger22; public Vector VectorOfBigInteger23; public Vector VectorOfByte24; public Vector VectorOfByte25; public Vector VectorOfByte26; public Vector VectorOfDouble27; public Vector VectorOfDouble28; public Vector VectorOfDouble29; public Vector VectorOfFloat30; public Vector VectorOfFloat31; public Vector VectorOfFloat32; public Vector VectorOfInteger33; public Vector VectorOfInteger34; public Vector VectorOfInteger35; public Vector VectorOfLong36; public Vector VectorOfLong37; public Vector VectorOfLong38; public Vector VectorOfShort39; public Vector VectorOfShort40; public Vector VectorOfShort41; public Vector VectorOfSimpleClass42; public static final String [] fieldSpecs = { "public Vector VectorOfObject0", "embedded-element=true public Vector VectorOfObject1", "embedded-element=false public Vector VectorOfObject2", "public Vector VectorOfSimpleClass3", "embedded-element=true public Vector VectorOfSimpleClass4", "embedded-element=false public Vector VectorOfSimpleClass5", "public Vector VectorOfSimpleInterface6", "embedded-element=true public Vector VectorOfSimpleInterface7", "embedded-element=false public Vector VectorOfSimpleInterface8", "public Vector VectorOfString9", "embedded-element=true public Vector VectorOfString10", "embedded-element=false public Vector VectorOfString11", "public Vector VectorOfDate12", "embedded-element=true public Vector VectorOfDate13", "embedded-element=false public Vector VectorOfDate14", "public Vector VectorOfLocale15", "embedded-element=true public Vector VectorOfLocale16", "embedded-element=false public Vector VectorOfLocale17", "public Vector VectorOfBigDecimal18", "embedded-element=true public Vector VectorOfBigDecimal19", "embedded-element=false public Vector VectorOfBigDecimal20", "public Vector VectorOfBigInteger21", "embedded-element=true public Vector VectorOfBigInteger22", "embedded-element=false public Vector VectorOfBigInteger23", "public Vector VectorOfByte24", "embedded-element=true public Vector VectorOfByte25", "embedded-element=false public Vector VectorOfByte26", "public Vector VectorOfDouble27", "embedded-element=true public Vector VectorOfDouble28", "embedded-element=false public Vector VectorOfDouble29", "public Vector VectorOfFloat30", "embedded-element=true public Vector VectorOfFloat31", "embedded-element=false public Vector VectorOfFloat32", "public Vector VectorOfInteger33", "embedded-element=true public Vector VectorOfInteger34", "embedded-element=false public Vector VectorOfInteger35", "public Vector VectorOfLong36", "embedded-element=true public Vector VectorOfLong37", "embedded-element=false public Vector VectorOfLong38", "public Vector VectorOfShort39", "embedded-element=true public Vector VectorOfShort40", "embedded-element=false public Vector VectorOfShort41", "serialized=true public Vector VectorOfSimpleClass42" }; public int getLength() { return fieldSpecs.length; } public Vector get(int index) { switch (index) { case(0): return VectorOfObject0; case(1): return VectorOfObject1; case(2): return VectorOfObject2; case(3): return VectorOfSimpleClass3; case(4): return VectorOfSimpleClass4; case(5): return VectorOfSimpleClass5; case(6): return VectorOfSimpleInterface6; case(7): return VectorOfSimpleInterface7; case(8): return VectorOfSimpleInterface8; case(9): return VectorOfString9; case(10): return VectorOfString10; case(11): return VectorOfString11; case(12): return VectorOfDate12; case(13): return VectorOfDate13; case(14): return VectorOfDate14; case(15): return VectorOfLocale15; case(16): return VectorOfLocale16; case(17): return VectorOfLocale17; case(18): return VectorOfBigDecimal18; case(19): return VectorOfBigDecimal19; case(20): return VectorOfBigDecimal20; case(21): return VectorOfBigInteger21; case(22): return VectorOfBigInteger22; case(23): return VectorOfBigInteger23; case(24): return VectorOfByte24; case(25): return VectorOfByte25; case(26): return VectorOfByte26; case(27): return VectorOfDouble27; case(28): return VectorOfDouble28; case(29): return VectorOfDouble29; case(30): return VectorOfFloat30; case(31): return VectorOfFloat31; case(32): return VectorOfFloat32; case(33): return VectorOfInteger33; case(34): return VectorOfInteger34; case(35): return VectorOfInteger35; case(36): return VectorOfLong36; case(37): return VectorOfLong37; case(38): return VectorOfLong38; case(39): return VectorOfShort39; case(40): return VectorOfShort40; case(41): return VectorOfShort41; case(42): return VectorOfSimpleClass42; default: throw new IndexOutOfBoundsException(); } } public boolean set(int index,Vector value) { if(fieldSpecs[index].indexOf("final") != -1) return false; switch (index) { case(0): VectorOfObject0= value; break; case(1): VectorOfObject1= value; break; case(2): VectorOfObject2= value; break; case(3): VectorOfSimpleClass3= value; break; case(4): VectorOfSimpleClass4= value; break; case(5): VectorOfSimpleClass5= value; break; case(6): VectorOfSimpleInterface6= value; break; case(7): VectorOfSimpleInterface7= value; break; case(8): VectorOfSimpleInterface8= value; break; case(9): VectorOfString9= value; break; case(10): VectorOfString10= value; break; case(11): VectorOfString11= value; break; case(12): VectorOfDate12= value; break; case(13): VectorOfDate13= value; break; case(14): VectorOfDate14= value; break; case(15): VectorOfLocale15= value; break; case(16): VectorOfLocale16= value; break; case(17): VectorOfLocale17= value; break; case(18): VectorOfBigDecimal18= value; break; case(19): VectorOfBigDecimal19= value; break; case(20): VectorOfBigDecimal20= value; break; case(21): VectorOfBigInteger21= value; break; case(22): VectorOfBigInteger22= value; break; case(23): VectorOfBigInteger23= value; break; case(24): VectorOfByte24= value; break; case(25): VectorOfByte25= value; break; case(26): VectorOfByte26= value; break; case(27): VectorOfDouble27= value; break; case(28): VectorOfDouble28= value; break; case(29): VectorOfDouble29= value; break; case(30): VectorOfFloat30= value; break; case(31): VectorOfFloat31= value; break; case(32): VectorOfFloat32= value; break; case(33): VectorOfInteger33= value; break; case(34): VectorOfInteger34= value; break; case(35): VectorOfInteger35= value; break; case(36): VectorOfLong36= value; break; case(37): VectorOfLong37= value; break; case(38): VectorOfLong38= value; break; case(39): VectorOfShort39= value; break; case(40): VectorOfShort40= value; break; case(41): VectorOfShort41= value; break; case(42): VectorOfSimpleClass42= value; break; default: throw new IndexOutOfBoundsException(); } return true; } public static class Oid implements Serializable { public int identifier; public Oid() { } public Oid(String s) { identifier = Integer.parseInt(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + identifier;} public int hashCode() { return (int)identifier ; } public boolean equals(Object other) { if (other != null && (other instanceof Oid)) { Oid k = (Oid)other; return k.identifier == this.identifier; } return false; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } } } tck/src/java/org/apache/jdo/tck/pc/inheritance/AllPersist.java100664 4673 12500110372 24556 0ustarmbouschenstaff 0 0 /* * 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.inheritance; import java.io.Serializable; /** */ public class AllPersist { public int intA; // not managed public double doubleB; // persistent public int intB; // persistent private int keyValue; // persistent--used as key field in application identity private static int nextKeyValue = 1; public int hashCode() { return keyValue; } public boolean equals(Object obj) { if( obj == null || !this.getClass().equals(obj.getClass()) ) return false; else return keyValue == ((Id)obj).keyValue; } public AllPersist() { intA = -1; doubleB = 2.0; intB = -5; } public AllPersist(int intA, double doubleVal, int intB) { keyValue = nextKeyValue++; this.intA = intA; doubleB = doubleVal; this.intB = intB; } public static class Id implements Serializable { public int keyValue; public Id() { } public Id(int keyValue) { this.keyValue = keyValue; } public Id(String s) { try { keyValue = Integer.parseInt(s);} catch(NumberFormatException e){ keyValue = 0; } } public boolean equals(Object obj) { if( obj == null || !this.getClass().equals(obj.getClass()) ) return false; else return keyValue == ((Id)obj).keyValue; } public int hashCode() { return keyValue; } public String toString() { return Integer.toString(keyValue); } } } tck/src/java/org/apache/jdo/tck/pc/inheritance/AllPersist2.java100664 2556 12500110372 24636 0ustarmbouschenstaff 0 0 /* * 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.inheritance; /** */ public class AllPersist2 extends AllPersist { public char charC; // not managed public boolean booleanD; // not managed public float floatE; // transactional public AllPersist2() { charC = '3'; booleanD = false; floatE = -4.4f; } public AllPersist2 (int intA, double doubleB, int intB, char charC, boolean booleanVal, float floatE) { super(intA, doubleB, intB); this.charC = charC; booleanD = booleanVal; this.floatE = floatE; } } tck/src/java/org/apache/jdo/tck/pc/inheritance/AllPersist3.java100664 2465 12500110372 24636 0ustarmbouschenstaff 0 0 /* * 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.inheritance; /** */ public class AllPersist3 extends AllPersist2 { public short shortF; // persistent public AllPersist4 secondObj; // transactional public AllPersist4 thirdObj; // persistent public AllPersist3() { shortF = 1238; } public AllPersist3 (int intA, double doubleB, int intB, char charC, boolean booleanD, float floatE, short shortVal) { super(intA, doubleB, intB, charC, booleanD, floatE); shortF = shortVal; } } tck/src/java/org/apache/jdo/tck/pc/inheritance/AllPersist4.java100664 2600 12500110372 24626 0ustarmbouschenstaff 0 0 /* * 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.inheritance; /** */ public class AllPersist4 extends AllPersist3 { public short shortG; // not managed public AllPersist4 fourthObj; // not managed public int intH; // persistent public AllPersist4() { shortG = -360; intH = -6; } public AllPersist4 (int intA, double doubleB, int intB, char charC, boolean booleanD, float floatE, short shortF, short shortG, int intVal) { super(intA, doubleB, intB, charC, booleanD, floatE, shortF); this.shortG = shortG; intH = intVal; } } tck/src/java/org/apache/jdo/tck/pc/inheritance/Constants.java100664 4467 12500110372 24451 0ustarmbouschenstaff 0 0 /* * 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.inheritance; /** * @author Michael Bouschen * * Defines constants used by the inheritance pc classes and the inheritance tck * test cases. */ public class Constants { // 0 1 2 3 4 5 6 7 8 9 10 11 public static final int[] intA_V = { -1, 350, 43, 336, -447, 1, 337, 10, 43, -447, 20, 30}; public static final double[] doubleB_V = { 2.0, 9.8, 94.5, -7.2, -13., 4.0, -8.2, -13, 94.5, -13, 23, 33}; public static final int[] intB_V = { -5 , 3334, -76, 28, 12497, 5, 38, 14, -76, 12497, 24, 34}; public static final char[] charC_V = { '3', 'D', 'J', 'L', 'N', 'w', '1', 'x', 'J', 'P', 'y', 'z'}; public static final boolean[] booleanD_V ={false, true, true, true, true, false, true, true, true, true, true, false}; public static final float[] floatE_V = {-4.4f, -32.7f, -21.5f, -3266f, -3.6f, 3.0f, -4266f, 12f, -21.5f, -3.6f, 22f, 32f}; public static final short[] shortF_V = { 1238, 258, 394, 8, 21, 6, 9, 15, 394, 21, 25, 35}; public static final short[] shortG_V = { -360, -1000, -4321, -6, -44, 2, -7, 11, 4321, -44, 21, 31}; public static final int[] intH_V = { -6, -25, -347600, -603, -7613, 7, -703, 16, -347600, -7613, 26, 36}; } tck/src/java/org/apache/jdo/tck/pc/inheritance/FieldSameName.java100664 4760 12500110372 25123 0ustarmbouschenstaff 0 0 /* * 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.inheritance; import java.io.Serializable; /** */ public class FieldSameName { int n1; // not managed double n2; // persistent int n3; // persistent private int keyValue; // persistent--used as key field in application identity private static int nextKeyValue = 1; public FieldSameName() { n1 = -1; n2 = 2.0; n3 = -5; } public FieldSameName(int intA, double doubleVal, int intB) { keyValue = nextKeyValue++; n1 = intA; n2 = doubleVal; n3 = intB; } public void setIntA(int intA) { n1 = intA; } public int getIntA() { return n1; } public void setDoubleB(double doubleB) { n2 = doubleB; } public double getDoubleB() { return n2; } public void setIntB(int intB) { n3 = intB; } public int getIntB() { return n3; } public static class Id implements Serializable { public int keyValue; public Id() { } public Id(int keyValue) { this.keyValue = keyValue; } public Id(String s) { try{ keyValue = Integer.parseInt(s);} catch(NumberFormatException e){ keyValue = 0;} } public boolean equals(Object obj) { if( obj == null || !this.getClass().equals(obj.getClass()) ) return false; else return keyValue == ((Id)obj).keyValue; } public int hashCode() { return keyValue; } public String toString() { return Integer.toString(keyValue); } } } tck/src/java/org/apache/jdo/tck/pc/inheritance/FieldSameName2.java100664 3312 12500110372 25175 0ustarmbouschenstaff 0 0 /* * 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.inheritance; /** */ public class FieldSameName2 extends FieldSameName { char n1; // not managed boolean n2; // not managed float n3; // transactional public FieldSameName2() { n1 = '3'; n2 = false; n3 = -4.4f; } public FieldSameName2 (int intA, double doubleB, int intB, char charC, boolean booleanVal, float floatE) { super(intA, doubleB, intB); n1 = charC; n2 = booleanVal; n3 = floatE; } public void setCharC(char charC) { n1 = charC; } public char getCharC() { return n1; } public void setBooleanD(boolean booleanD) { n2 = booleanD; } public boolean getBooleanD() { return n2; } public void setFloatE(float floatE) { n3 = floatE; } public float getFloatE() { return n3; } } tck/src/java/org/apache/jdo/tck/pc/inheritance/FieldSameName3.java100664 3341 12500110372 25200 0ustarmbouschenstaff 0 0 /* * 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.inheritance; /** */ public class FieldSameName3 extends FieldSameName2 { short n1; // persistent FieldSameName4 n2; // transactional FieldSameName4 n3; // persistent public FieldSameName3() { n1 = 1238; } public FieldSameName3 (int intA, double doubleB, int intB, char charC, boolean booleanD, float floatE, short shortVal) { super(intA, doubleB, intB, charC, booleanD, floatE); n1 = shortVal; } public void setShortF(short shortF) { n1 = shortF; } public short getShortF() { return n1; } public void setSecondObj(FieldSameName4 secondObj) { n2 = secondObj; } public FieldSameName4 getSecondObj() { return n2; } public void setThirdObj(FieldSameName4 thirdObj) { n3 = thirdObj; } public FieldSameName4 getThirdObj() { return n3; } } tck/src/java/org/apache/jdo/tck/pc/inheritance/FieldSameName4.java100664 3402 12500110372 25177 0ustarmbouschenstaff 0 0 /* * 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.inheritance; /** */ public class FieldSameName4 extends FieldSameName3 { short n1; // not managed FieldSameName4 n2; // not managed int n3; // persistent public FieldSameName4() { n1 = -360; n3 = -6; } public FieldSameName4 (int intA, double doubleB, int intB, char charC, boolean booleanD, float floatE, short shortF, short shortG, int intVal) { super(intA, doubleB, intB, charC, booleanD, floatE, shortF); n1 = shortG; n3 = intVal; } public void setShortG(short shortG) { n1 = shortG; } public short getShortG() { return n1; } public void setFourthObj(FieldSameName4 fourthObj) { n2 = fourthObj; } public FieldSameName4 getFourthObj() { return n2; } public void setIntH(int intH) { n3 = intH; } public int getIntH() { return n3; } } tck/src/java/org/apache/jdo/tck/pc/inheritance/TopNonPersist.java100664 2054 12500110372 25252 0ustarmbouschenstaff 0 0 /* * 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.inheritance; /** */ public class TopNonPersist { // not persistent public int intA; public TopNonPersist() { intA = -1; } public TopNonPersist(int intA) { this.intA = intA; } } tck/src/java/org/apache/jdo/tck/pc/inheritance/TopNonPersistB.java100664 4241 12500110372 25354 0ustarmbouschenstaff 0 0 /* * 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.inheritance; import java.io.Serializable; /** */ public class TopNonPersistB extends TopNonPersist { // persistent public double doubleB; // persistent public int intB; // persistent private int keyValue; // persistent--used as key field in application identity static private int nextKeyValue = 1; public TopNonPersistB() { doubleB = 2.0; intB = -5; } public TopNonPersistB (int intA, double doubleVal, int intB) { super(intA); keyValue = nextKeyValue++; doubleB = doubleVal; this.intB = intB; } public static class Id implements Serializable { public int keyValue; public Id() { } public Id(int keyValue) { this.keyValue = keyValue; } public Id(String s) { try{ keyValue = Integer.parseInt(s);} catch(NumberFormatException e){ keyValue = 0;} } public boolean equals(Object obj) { if( obj == null || !this.getClass().equals(obj.getClass()) ) return false; else return keyValue == ((Id)obj).keyValue; } public int hashCode() { return keyValue; } public String toString() { return Integer.toString(keyValue); } } } tck/src/java/org/apache/jdo/tck/pc/inheritance/TopNonPersistC.java100664 2231 12500110372 25352 0ustarmbouschenstaff 0 0 /* * 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.inheritance; /** */ public class TopNonPersistC extends TopNonPersistB { // not persistent public char charC; public TopNonPersistC() { charC = '3'; } public TopNonPersistC (int intA, double doubleB, int intB, char charC) { super(intA, doubleB, intB); this.charC = charC; } } tck/src/java/org/apache/jdo/tck/pc/inheritance/TopNonPersistD.java100664 2301 12500110372 25351 0ustarmbouschenstaff 0 0 /* * 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.inheritance; /** */ public class TopNonPersistD extends TopNonPersistC { // not persistent public boolean booleanD; public TopNonPersistD() { booleanD = false; } public TopNonPersistD (int int1, double doubleB, int intB, char charC, boolean booleanVal) { super(int1, doubleB, intB,charC); booleanD = booleanVal; } } tck/src/java/org/apache/jdo/tck/pc/inheritance/TopNonPersistE.java100664 2341 12500110372 25356 0ustarmbouschenstaff 0 0 /* * 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.inheritance; /** */ public class TopNonPersistE extends TopNonPersistD { // persistent public float floatE; // transactional public TopNonPersistE () { floatE = -4.4f; } public TopNonPersistE (int intA, double doubleB, int intB, char charC, boolean booleanD, float floatE) { super(intA, doubleB, intB, charC, booleanD); this.floatE = floatE; } } tck/src/java/org/apache/jdo/tck/pc/inheritance/TopNonPersistF.java100664 2526 12500110372 25364 0ustarmbouschenstaff 0 0 /* * 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.inheritance; /** */ public class TopNonPersistF extends TopNonPersistE { // persistent public short shortF; // persistent public TopNonPersistH secondObj; // transactional public TopNonPersistH thirdObj; // persistent public TopNonPersistF() { shortF = 1238; } public TopNonPersistF (int intA, double doubleB, int intB, char charC, boolean booleanD, float floatE, short shortVal) { super(intA, doubleB, intB, charC, booleanD, floatE); shortF = shortVal; } } tck/src/java/org/apache/jdo/tck/pc/inheritance/TopNonPersistG.java100664 2452 12500110372 25363 0ustarmbouschenstaff 0 0 /* * 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.inheritance; /** */ public class TopNonPersistG extends TopNonPersistF { // not persistent public short shortG; public TopNonPersistH fourthObj; public TopNonPersistG() { shortG = -360; } public TopNonPersistG (int intA, double doubleB, int intB, char charC, boolean booleanD, float floatE, short shortF, short shortG) { super(intA, doubleB, intB, charC, booleanD, floatE, shortF); this.shortG = shortG; } } tck/src/java/org/apache/jdo/tck/pc/inheritance/TopNonPersistH.java100664 2430 12500110372 25360 0ustarmbouschenstaff 0 0 /* * 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.inheritance; /** */ public class TopNonPersistH extends TopNonPersistG { // persistent public int intH; // persistent public TopNonPersistH() { intH = -6; } public TopNonPersistH (int intA, double doubleB, int intB, char charC, boolean booleanD, float floatE, short shortF, short shortG, int intVal) { super(intA, doubleB, intB, charC, booleanD, floatE, shortF, shortG); intH = intVal; } } tck/src/java/org/apache/jdo/tck/pc/inheritance/TopPersist.java100664 4352 12500110372 24602 0ustarmbouschenstaff 0 0 /* * 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.inheritance; import java.io.Serializable; /** */ public class TopPersist { // persistent public int intA; // not managed public double doubleB; // persistent public int intB; // persistent private int keyValue; // persistent--used as key field in application identity static private int nextKeyValue = 1; public TopPersist() { intA = Constants.intA_V[0]; doubleB = Constants.doubleB_V[0]; intB = Constants.intB_V[0]; } public TopPersist (int intA, double doubleVal, int intB) { keyValue = nextKeyValue++; this.intA = intA; doubleB = doubleVal; this.intB = intB; } public static class Id implements Serializable { public int keyValue; public Id() { } public Id(int keyValue) { this.keyValue = keyValue; } public Id(String s) { try{ keyValue = Integer.parseInt(s);} catch(NumberFormatException e){ keyValue = 0;} } public boolean equals(Object obj) { if( obj == null || !this.getClass().equals(obj.getClass()) ) return false; else return keyValue == ((Id)obj).keyValue; } public int hashCode() { return keyValue; } public String toString() { return Integer.toString(keyValue); } } } tck/src/java/org/apache/jdo/tck/pc/inheritance/TopPersistC.java100664 2231 12500110372 24677 0ustarmbouschenstaff 0 0 /* * 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.inheritance; /** */ public class TopPersistC extends TopPersist { // not persistent public char charC; public TopPersistC() { charC = Constants.charC_V[0]; } public TopPersistC (int intA, double doubleB, int intB, char charC) { super(intA, doubleB, intB); this.charC = charC; } } tck/src/java/org/apache/jdo/tck/pc/inheritance/TopPersistD.java100664 2303 12500110372 24700 0ustarmbouschenstaff 0 0 /* * 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.inheritance; /** */ public class TopPersistD extends TopPersistC { // not persistent public boolean booleanD; public TopPersistD() { booleanD = Constants.booleanD_V[0]; } public TopPersistD (int int1, double doubleB, int intB, char charC, boolean booleanVal) { super(int1, doubleB, intB,charC); booleanD = booleanVal; } } tck/src/java/org/apache/jdo/tck/pc/inheritance/TopPersistE.java100664 2341 12500110372 24703 0ustarmbouschenstaff 0 0 /* * 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.inheritance; /** */ public class TopPersistE extends TopPersistD { // persistent public float floatE; // transactional public TopPersistE () { floatE = Constants.floatE_V[0]; } public TopPersistE (int intA, double doubleB, int intB, char charC, boolean booleanD, float floatE) { super(intA, doubleB, intB, charC, booleanD); this.floatE = floatE; } } tck/src/java/org/apache/jdo/tck/pc/inheritance/TopPersistF.java100664 2525 12500110372 24710 0ustarmbouschenstaff 0 0 /* * 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.inheritance; /** */ public class TopPersistF extends TopPersistE { // persistent public short shortF; // persistent public TopPersistH secondObj; // transactional public TopPersistH thirdObj; // persistent public TopPersistF() { shortF = Constants.shortF_V[0]; } public TopPersistF (int intA, double doubleB, int intB, char charC, boolean booleanD, float floatE, short shortVal) { super(intA, doubleB, intB, charC, booleanD, floatE); shortF = shortVal; } } tck/src/java/org/apache/jdo/tck/pc/inheritance/TopPersistG.java100664 2450 12500110372 24706 0ustarmbouschenstaff 0 0 /* * 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.inheritance; /** */ public class TopPersistG extends TopPersistF { // not persistent public short shortG; public TopPersistH fourthObj; public TopPersistG() { shortG = Constants.shortG_V[0]; } public TopPersistG (int intA, double doubleB, int intB, char charC, boolean booleanD, float floatE, short shortF, short shortG) { super(intA, doubleB, intB, charC, booleanD, floatE, shortF); this.shortG = shortG; } } tck/src/java/org/apache/jdo/tck/pc/inheritance/TopPersistH.java100664 2424 12500110372 24710 0ustarmbouschenstaff 0 0 /* * 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.inheritance; /** */ public class TopPersistH extends TopPersistG { // persistent public int intH; // persistent public TopPersistH() { intH = Constants.intH_V[0]; } public TopPersistH (int intA, double doubleB, int intB, char charC, boolean booleanD, float floatE, short shortF, short shortG, int intVal) { super(intA, doubleB, intB, charC, booleanD, floatE, shortF, shortG); intH = intVal; } } tck/src/java/org/apache/jdo/tck/pc/instancecallbacks/InstanceCallbackClass.java100664 21017 12500110372 30025 0ustarmbouschenstaff 0 0 /* * 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.instancecallbacks; import java.io.Serializable; import java.util.Date; import java.util.HashSet; import java.util.Iterator; import javax.jdo.Extent; import javax.jdo.InstanceCallbacks; import javax.jdo.JDOHelper; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; public class InstanceCallbackClass implements InstanceCallbacks { public static boolean performPreClearTests; public static boolean performPreDeleteTests; public static boolean performPreStoreTests; // The following two variables used in CallingJdoPreDelete tests public static boolean preDeleteCalled; public static int objectState; // The rest of these variables used in FieldsInPredelete tests, except to set a variable to make object dirty. public static int arraySize = 5; public static String[] capturedName = new String[arraySize]; public static Date[] capturedTimeStamp = new Date[arraySize]; public static double[] capturedDoubleValue = new double[arraySize]; public static short[] capturedChildToDelete = new short[arraySize]; public static char[] capturedCharValue = new char[arraySize]; public static String[] capturedNextObjName = new String[arraySize]; public static int[] numberOfChildren = new int[arraySize]; public static int[] sumOfChildrenIntValue = new int[arraySize]; public static boolean[] processedIndex = new boolean[arraySize]; public static boolean[] transactionActive = new boolean[arraySize]; private static int nextKeyValue = 1; private int keyValue; // persistent--used as key field in application identity public String name; public Date timeStamp; public InstanceCallbackClass nextObj; public HashSet children; public int intValue; public double doubleValue; public short childToDelete; public char charValue; public static void initializeStaticsForTest() { performPreClearTests = false; performPreDeleteTests = false; performPreStoreTests = false; preDeleteCalled = false; for( int i = 0; i < arraySize; ++i){ processedIndex[i] = false; transactionActive[i] = false; } } public static void removeAllInstances(PersistenceManager pm) { Extent e = pm.getExtent(InstanceCallbackClass.class, true); Iterator i = e.iterator(); while( i.hasNext() ){ pm.deletePersistent(i.next()); } } public InstanceCallbackClass() { // not used by application } public InstanceCallbackClass(String label,Date createTime,int intValue,double doubleValue,short childToDelete,char charValue,InstanceCallbackClass obj) { keyValue = nextKeyValue++; name = label; timeStamp = createTime; nextObj = obj; children = new HashSet(); this.intValue = intValue; this.doubleValue = doubleValue; this.childToDelete = childToDelete; this.charValue = charValue; } public void addChild(InstanceCallbackClass child) { children.add(child); } public void jdoPreStore() { if(!performPreStoreTests) { return; } captureValues(); PersistenceManager pm = JDOHelper.getPersistenceManager(this); usePM(pm); } public void jdoPreDelete() { if(!performPreDeleteTests) { return; } // The following two variables set for CallingJdoPreDelete tests preDeleteCalled = true; objectState = JDO_Test.currentState(this); captureValues(); // The rest of this routine used for Accessing FieldsInPredelete tests // check that intValue is a valid index if(intValue >= 0 & intValue < arraySize) { PersistenceManager pm = JDOHelper.getPersistenceManager(this); usePM(pm); if(nextObj != null) { pm.deletePersistent(nextObj); // delete referenced object // delete designated child for(Iterator i = children.iterator(); i.hasNext();) { InstanceCallbackClass obj = (InstanceCallbackClass)i.next(); if( obj.intValue == childToDelete) { pm.deletePersistent(obj); break; } } } } } public void jdoPostLoad() { } public void jdoPreClear() { if(!performPreClearTests) { return; } // the following code is copied from captureValues, because it must // not be enhanced for execution during jdoPreClear. // check that intValue is a valid index if(intValue >= 0 & intValue < arraySize) { processedIndex[intValue] = true; // capture values of the attributes capturedName[intValue] = name; capturedTimeStamp[intValue] = timeStamp; capturedDoubleValue[intValue] = doubleValue; numberOfChildren[intValue] = children.size(); sumOfChildrenIntValue[intValue] = 0; for(Iterator i = children.iterator(); i.hasNext();) { InstanceCallbackClass o = (InstanceCallbackClass)i.next(); sumOfChildrenIntValue[intValue] += o.intValue; } capturedChildToDelete[intValue] = childToDelete; capturedCharValue[intValue] = charValue; if(nextObj != null) { capturedNextObjName[intValue] = nextObj.name; } else { capturedNextObjName[intValue] = null; } } } void captureValues() { // check that intValue is a valid index if(intValue >= 0 & intValue < arraySize) { processedIndex[intValue] = true; // capture values of the attributes capturedName[intValue] = name; capturedTimeStamp[intValue] = timeStamp; capturedDoubleValue[intValue] = doubleValue; numberOfChildren[intValue] = children.size(); sumOfChildrenIntValue[intValue] = 0; for(Iterator i = children.iterator(); i.hasNext();) { InstanceCallbackClass o = (InstanceCallbackClass)i.next(); sumOfChildrenIntValue[intValue] += o.intValue; } capturedChildToDelete[intValue] = childToDelete; capturedCharValue[intValue] = charValue; if(nextObj != null) { capturedNextObjName[intValue] = nextObj.name; } else { capturedNextObjName[intValue] = null; } } } void usePM(PersistenceManager pm) { if(intValue >= 0 & intValue < arraySize) { Transaction t = pm.currentTransaction(); if(t.isActive()) { transactionActive[intValue] = true; } } } public static class KeyClass implements Serializable, Comparable { public int keyValue; public KeyClass() { } public KeyClass(String s) { try{ keyValue = Integer.parseInt(s);} catch(NumberFormatException e){ keyValue = 0;} } public boolean equals(Object obj) { if( obj == null || !this.getClass().equals(obj.getClass()) ) return false; else return keyValue == ((KeyClass)obj).keyValue; } public int hashCode() { return keyValue; } public String toString() { return Integer.toString(keyValue); } public int compareTo(Object obj) { // may throw ClassCastException to be handled by user. return keyValue - ((KeyClass)obj).keyValue; } } } tck/src/java/org/apache/jdo/tck/pc/instancecallbacks/InstanceCallbackNonPersistFdsClass.java100664 22356 12500110372 32516 0ustarmbouschenstaff 0 0 /* * 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.instancecallbacks; import java.io.*; import java.util.*; import javax.jdo.*; public class InstanceCallbackNonPersistFdsClass implements InstanceCallbacks { public int i; // non-managed public char c; // non-managed public double d; // transactional public short s; // transactional public HashSet children; // non-managed public Date loadTime; // non-managed private int keyValue; // persistent--used as key field in application identity public float floatValue; // persistent public int intValue; // persistent --primary key field private static int nextKeyValue = 1; public static int savedIntValue; public static float savedFloatValue; public static Date savedLoadTime; public static String member1 = "one"; public static String member2 = "two"; public static String member3 = "three"; public static boolean preClearCalled = false; public static boolean preStoreCalled = false; public static boolean preDeleteCalled = false; public static boolean postloadCalled = false; public static boolean postloadCalledMultipleTimes = false; // used in CallingJdoPostload test public static int beforeGetObjectById = 1; public static int afterGetObjectById = 2; public static int savedApplicationStep; public static int applicationStep; // values are 0, beforeGetObjectById and afterGetObjectById // used in ModificationOfNontransactionalNonpersistentFields test public static ArrayList exceptions = new ArrayList(); public static ArrayList callbackCalled = new ArrayList(); public static ArrayList attributeOpCausingExceptions = new ArrayList(); public static void initializeStaticsForTest() { savedIntValue = 0; savedFloatValue = 0.0f; savedLoadTime = null; preClearCalled = false; preStoreCalled = false; preDeleteCalled = false; postloadCalled = false; postloadCalledMultipleTimes = false; savedApplicationStep = 0; applicationStep = 0; exceptions = new ArrayList(); callbackCalled = new ArrayList(); attributeOpCausingExceptions = new ArrayList(); } public static void removeAllInstances(PersistenceManager pm) { Extent e = pm.getExtent(org.apache.jdo.tck.pc.instancecallbacks.InstanceCallbackNonPersistFdsClass.class, true); Iterator i = e.iterator(); while( i.hasNext() ){ pm.deletePersistent(i.next()); } } public InstanceCallbackNonPersistFdsClass() { } public InstanceCallbackNonPersistFdsClass(float floatValue,int intValue) { keyValue = nextKeyValue++; this.floatValue = floatValue; this.intValue = intValue; } public void setNonPersist(int i, char c, double d, short s) { this.i = i; this.c = c; this.d = d; this.s = s; } public void setNonManaged(int i, char c) { this.i = i; this.c = c; } public int calcIntValue() { return i * c; } public float calcFloatValue () { return (float)(d * s); } public void incrementIntValue() { intValue++; } public void jdoPreStore() { preStoreCalled = true; intValue = calcIntValue(); floatValue = calcFloatValue(); try { i = -30; }catch(Exception e) { callbackCalled.add("jdoPreStore "); exceptions.add(e); attributeOpCausingExceptions.add("i = -30;"); } try { c = '\u0000'; }catch(Exception e) { callbackCalled.add("jdoPreStore "); exceptions.add(e); attributeOpCausingExceptions.add("c = '\u0000';"); } try { d = 362.5; }catch(Exception e) { callbackCalled.add("jdoPreStore "); exceptions.add(e); attributeOpCausingExceptions.add("d = 362.5;"); } try { s = 0; }catch(Exception e) { callbackCalled.add("jdoPreStore "); exceptions.add(e); attributeOpCausingExceptions.add("s = 0;"); } try { loadTime = null; }catch(Exception e) { callbackCalled.add("jdoPreStore "); exceptions.add(e); attributeOpCausingExceptions.add("loadTime = null;"); } try { children = null; }catch(Exception e) { callbackCalled.add("jdoPreStore "); exceptions.add(e); attributeOpCausingExceptions.add("children = null;"); } } public void jdoPreDelete() { preDeleteCalled = true; try { i = 0; }catch(Exception e) { callbackCalled.add("jdoPreDelete "); exceptions.add(e); attributeOpCausingExceptions.add("i = 0;"); } try { c = 'x'; }catch(Exception e) { callbackCalled.add("jdoPreDelete "); exceptions.add(e); attributeOpCausingExceptions.add("c = 'x';"); } try { d = 0.0; }catch(Exception e) { callbackCalled.add("jdoPreDelete "); exceptions.add(e); attributeOpCausingExceptions.add("d = 0.0;"); } try { s = -5; }catch(Exception e) { callbackCalled.add("jdoPreDelete "); exceptions.add(e); attributeOpCausingExceptions.add("s = -5;"); } try { loadTime = null; }catch(Exception e) { callbackCalled.add("jdoPreDelete "); exceptions.add(e); attributeOpCausingExceptions.add("loadTime = null;"); } try { children = null; }catch(Exception e) { callbackCalled.add("jdoPreDelete "); exceptions.add(e); attributeOpCausingExceptions.add("children = null;"); } } public void jdoPostLoad() { postloadCalled = true; savedApplicationStep = applicationStep; i = -10; c = '2'; d = 30.0; s = 40; savedIntValue = intValue; savedFloatValue = floatValue; loadTime = new Date(); savedLoadTime = loadTime; children = new HashSet(); children.add(member1); children.add(member2); children.add(member3); } public void jdoPreClear() { preClearCalled = true; try { i = 1; }catch(Exception e) { callbackCalled.add("jdoPreClear "); exceptions.add(e); attributeOpCausingExceptions.add("i = 1;"); } try { c = '2'; }catch(Exception e) { callbackCalled.add("jdoPreClear "); exceptions.add(e); attributeOpCausingExceptions.add("c = '2';"); } try { d = 3.0; }catch(Exception e) { callbackCalled.add("jdoPreClear "); exceptions.add(e); attributeOpCausingExceptions.add("d = 3.0;"); } try { s = 4; }catch(Exception e) { callbackCalled.add("jdoPreClear "); exceptions.add(e); attributeOpCausingExceptions.add("s = 4;"); } try { loadTime = null; }catch(Exception e) { callbackCalled.add("jdoPreClear "); exceptions.add(e); attributeOpCausingExceptions.add("loadTime = null;"); } try { children = null; }catch(Exception e) { callbackCalled.add("jdoPreClear "); exceptions.add(e); attributeOpCausingExceptions.add("children = null;"); } } public static class KeyClass implements Serializable { public int keyValue; public KeyClass() { } public KeyClass(String s) { try{ keyValue = Integer.parseInt(s);} catch(NumberFormatException e){ keyValue = 0;} } public boolean equals(Object obj) { if( obj == null || !this.getClass().equals(obj.getClass()) ) return false; else return keyValue == ((KeyClass)obj).keyValue; } public int hashCode() { return keyValue; } public String toString() { return Integer.toString(keyValue); } } } tck/src/java/org/apache/jdo/tck/pc/lifecycle/StateTransitionObj.java100664 6431 12500110372 25722 0ustarmbouschenstaff 0 0 /* * 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.lifecycle; import java.io.Serializable; public class StateTransitionObj implements Serializable { private static int counter = 0; private int id; private int int_field; private transient int nonmanaged_field; public StateTransitionObj() { id = ++counter; int_field = 0; } public StateTransitionObj(int v) { this(); int_field = v; } public int readField() { int value = int_field; return value; } public void writeField(int value) { int_field = value; } public int readNonmanagedField() { return nonmanaged_field; } public void writeNonmanagedField(int value) { nonmanaged_field = value; } /** * @return Returns the id. */ public int getId() { return id; } /** * @param id The id to set. */ public void setId(int id) { this.id = id; } /** * The class to be used as the application identifier * for the StateTransitionObj class. */ public static class Oid implements Serializable, Comparable { /** * This field is part of the identifier and should match in name * and type with a field in the StateTransitionObj class. */ public int id; /** The required public no-arg constructor. */ public Oid() { } /** * Initialize the identifier. * @param id the id. */ public Oid(int id) { this.id = id; } public Oid(String s) { id = Integer.parseInt(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + id;} /** */ public boolean equals(Object obj) { if (obj==null || !this.getClass().equals(obj.getClass())) return false; Oid o = (Oid) obj; if (this.id != o.id) return false; return true; } /** */ public int hashCode() { return id; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } /** */ public int compareTo(Object obj) { // may throw ClassCastException which the user must handle Oid other = (Oid) obj; return id - other.id; } } } tck/src/java/org/apache/jdo/tck/pc/mylib/MylibReader.java100664 7707 12500110373 23520 0ustarmbouschenstaff 0 0 /* * 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.mylib; import java.io.InputStream; import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; import java.util.Locale; import java.util.TimeZone; import org.springframework.beans.propertyeditors.CustomDateEditor; import org.springframework.beans.factory.xml.XmlBeanFactory; import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.InputStreamResource; /** * Utility class to create a mylib instances from an xml * representation. */ public class MylibReader extends XmlBeanFactory { /** The format of date values in the xml representation */ public static final String DATE_PATTERN = "d/MMM/yyyy"; /** The name of the root list bean. */ public static final String ROOT_LIST_NAME = "root"; /** Teardown classes */ private static final Class[] tearDownClasses = new Class[] { PrimitiveTypes.class, PCClass.class }; /** * Create a MylibReader for the specified resourceName. * @param resourceName the name of the resource */ public MylibReader(String resourceName) { // Use the class loader of the PrimitiveTypes class to find the resource this(resourceName, PrimitiveTypes.class.getClassLoader()); } /** * Create a MylibReader for the specified resourceName. * @param resourceName the name of the resource */ public MylibReader(String resourceName, ClassLoader classLoader) { super(new ClassPathResource(resourceName, classLoader)); configureFactory(); } /** * Create a MylibReader for the specified InputStream. * @param stream the input stream */ public MylibReader(InputStream stream) { super(new InputStreamResource(stream)); configureFactory(); } /** * Returns a list of root objects. The method expects to find a bean * called "root" of type list in the xml and returns it. * @return a list of root instances */ public List getRootList() { return (List)getBean(ROOT_LIST_NAME); } /** * Configure the MylibReader, e.g. register CustomEditor classes * to convert the string representation of a property into an instance * of the right type. */ private void configureFactory() { SimpleDateFormat formatter = new SimpleDateFormat(DATE_PATTERN, Locale.US); CustomDateEditor dateEditor = new CustomDateEditor(formatter, true); registerCustomEditor(Date.class, dateEditor); } // Convenience methods /** * Convenience method returning an Address instance for the specified * name. The method returns null if there is no Address * bean with the specified name. * @param name the name of the bean to return. * @return the instance of the bean or null if there no * Address bean. */ public PrimitiveTypes getPrimitiveTypes(String name) { return (PrimitiveTypes)getBean(name, PrimitiveTypes.class); } /** * @return Returns the tearDownClasses. */ public static Class[] getTearDownClasses() { return tearDownClasses; } } tck/src/java/org/apache/jdo/tck/pc/mylib/PCClass.java100664 10355 12500110373 22622 0ustarmbouschenstaff 0 0 /* * 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.mylib; import java.io.Serializable; import javax.jdo.listener.LoadCallback; public class PCClass implements LoadCallback { private long id; private int number1; private int number2; private int transientNumber1; private int transientNumber2; public PCClass() { } /** * @see LoadCallback#jdoPostLoad() */ public void jdoPostLoad() { transientNumber1 = number1; transientNumber2 = number2; } /** * @see Object#toString() */ public String toString() { return "PCClass(" + id + ")"; } /** * @see Object#hashCode() */ public int hashCode() { return (int)id ; } /** * @see Object#equals(java.lang.Object) */ public boolean equals(Object other) { if (other != null && (other instanceof PCClass)) { PCClass k = (PCClass)other; return k.id == this.id; } return false; } /** * @return Returns the id. */ public long getId() { return id; } /** * @param id The id to set. */ public void setId(long id) { this.id = id; } /** * @return Returns the number. */ public int getNumber1() { return number1; } /** * @param number The number to set. */ public void setNumber1(int number) { this.number1 = number; } /** * @return Returns the number2. */ public int getNumber2() { return number2; } /** * @param number2 The number2 to set. */ public void setNumber2(int number2) { this.number2 = number2; } /** * @return Returns the transientNumber1. */ public int getTransientNumber1() { return transientNumber1; } /** * @param transientNumber1 The transientNumber1 to set. */ public void setTransientNumber1(int transientNumber1) { this.transientNumber1 = transientNumber1; } /** * @return Returns the transientNumber2. */ public int getTransientNumber2() { return transientNumber2; } /** * @param transientNumber2 The transientNumber2 to set. */ public void setTransientNumber2(int transientNumber2) { this.transientNumber2 = transientNumber2; } /** * The objectid class for this class in case of application identity. */ public static class Oid implements Serializable, Comparable { 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 k = (Oid)other; return k.id == this.id; } return false; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } public int compareTo(Object o) { if (o == null) throw new ClassCastException(); if (o == this) return 0; long otherId = ((Oid)o).id; if (id == otherId) return 0; else if (id < otherId) return -1; return 1; } } } tck/src/java/org/apache/jdo/tck/pc/mylib/PCPoint.java100664 5415 12500110373 22627 0ustarmbouschenstaff 0 0 /* * 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.mylib; import java.io.Serializable; import java.util.Date; /** * A simple class with two fields for application identity * * @author Marina Vatkina */ public class PCPoint implements Serializable { private static long counter = new Date().getTime(); private static long newId() { synchronized (PCPoint.class) { return counter++; } } private long id = newId(); public int x; public Integer y; public PCPoint() { } public PCPoint(int x, int y) { this.x = x; this.y = new Integer(y); } public PCPoint(int x, Integer y) { this.x = x; this.y = y; } public String toString() { String rc = null; Object obj = this; try { rc = obj.getClass().getName(); //rc = Util.getClassName(this) + name(); } catch (NullPointerException ex) { rc = "NPE getting PCPoint's values"; } return rc; } public void setX(int x) { this.x = x; } public int getX() { return x; } public void setY(Integer y) { this.y = y; } public Integer getY() { return y; } public String name() { return " x: " + getX() + ", y: " + getY().intValue(); } 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 k = (Oid)other; return k.id == this.id; } return false; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } } } tck/src/java/org/apache/jdo/tck/pc/mylib/PCPoint2.java100664 7046 12500110373 22713 0ustarmbouschenstaff 0 0 /* * 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.mylib; import java.io.Serializable; import java.util.Date; import javax.jdo.InstanceCallbacks; /** * A simple class with two fields for application identity * * @author Marina Vatkina */ public class PCPoint2 implements Serializable, InstanceCallbacks { private static long counter = new Date().getTime(); private static long newId() { synchronized (PCPoint2.class) { return counter++; } } private long id = newId(); public int x; public Integer y; private boolean clearCalled = false; private boolean loadCalled = false; private boolean storeCalled = false; private boolean deleteCalled = false; public void jdoPreClear() { clearCalled = true; } public void jdoPostLoad() { loadCalled = true; } public void jdoPreStore() { storeCalled = true; } public void jdoPreDelete() { deleteCalled = true; } public boolean wasClearCalled() { return clearCalled; } public boolean wasPostLoadCalled() { return loadCalled; } public boolean wasPreStoreCalled() { return storeCalled; } public boolean wasPreDeleteCalled() { return deleteCalled; } public PCPoint2() { } public PCPoint2(int x, int y) { this.x = x; this.y = new Integer(y); } public PCPoint2(int x, Integer y) { this.x = x; this.y = y; } public String toString() { String rc = null; Object obj = this; try { rc = obj.getClass().getName(); //rc = Util.getClassName(this) + name(); } catch (NullPointerException ex) { rc = "NPE getting PCPoint2's values"; } return rc; } public void setX(int x) { this.x = x; } public int getX() { return x; } public void setY(Integer y) { this.y = y; } public Integer getY() { return y; } public String name() { return " x: " + getX() + ", y: " + getY().intValue(); } 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 k = (Oid)other; return k.id == this.id; } return false; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } } } tck/src/java/org/apache/jdo/tck/pc/mylib/PCRect.java100664 5530 12500110373 22431 0ustarmbouschenstaff 0 0 /* * 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.mylib; import java.io.Serializable; import java.util.Date; /** * Test for instances with application identity containing instances of * a user-defined class. * * @author Marina Vatkina */ public class PCRect { private static long counter = new Date().getTime(); private static long newId() { synchronized (PCRect.class) { return counter++; } } public long id = newId(); public PCPoint upperLeft; public PCPoint lowerRight; public PCRect() { } public PCRect(long id, PCPoint ul, PCPoint lr) { upperLeft = ul; lowerRight = lr; } public PCRect(PCPoint ul, PCPoint lr) { upperLeft = ul; lowerRight = lr; } public PCPoint getUpperLeft() { return upperLeft; } public PCPoint getLowerRight() { return lowerRight; } public long getId() { return id; } public void setId(long id) { this.id = id; } public String toString() { String rc = null; Object obj = this; try { //rc = Util.getClassName(this) rc = obj.getClass().getName() + " ul: " + getUpperLeft().name() + " lr: " + getLowerRight().name(); } catch (NullPointerException ex) { rc = "NPE getting PCRect's values"; } return rc; } 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 k = (Oid)other; return k.id == this.id; } return false; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } } } tck/src/java/org/apache/jdo/tck/pc/mylib/Point.java100664 3400 12500110373 22374 0ustarmbouschenstaff 0 0 /* * 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.mylib; /** * A simple class with two fields * * @author Dave Bristor */ public class Point { public int x; public Integer y; public Point() { } public Point(int x, int y) { this.x = x; this.y = new Integer(y); } public Point(int x, Integer y) { this.x = x; this.y = y; } public String toString() { String rc = null; Object obj = this; try { rc = obj.getClass().getName(); //rc = Util.getClassName(this) + name(); } catch (NullPointerException ex) { rc = "NPE getting Point's values"; } return rc; } public int getX() { System.out.println("Hello from Point.getX"); return x; } public Integer getY() { System.out.println("Hello from Point.getY"); return y; } public String name() { return " x: " + getX() + ", y: " + getY().intValue(); } } tck/src/java/org/apache/jdo/tck/pc/mylib/PrimitiveTypes.java100664 27561 12500110373 24336 0ustarmbouschenstaff 0 0 /* * 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.mylib; import java.io.Serializable; import java.math.BigDecimal; import java.math.BigInteger; import java.util.Date; public class PrimitiveTypes implements Serializable { private static long counter = new Date().getTime(); private static long newId() { synchronized (PrimitiveTypes.class) { return counter++; } } private long id = newId(); private boolean booleanNotNull; private Boolean booleanNull; private byte byteNotNull; private Byte byteNull; private short shortNotNull; private Short shortNull; private int intNotNull; private Integer intNull; private long longNotNull; private Long longNull; private float floatNotNull; private Float floatNull; private double doubleNotNull; private Double doubleNull; private char charNotNull; private Character charNull; private Date dateNull; private String stringNull; private BigDecimal bigDecimal; private BigInteger bigInteger; private Long PrimitiveTypes; public Object getOid() { Oid oid = new Oid(); oid.id = this.id; return oid; } public String toString() { return "PrimitiveTypes(" + id + ")"; } public int hashCode() { int hashCode = 0; hashCode += id; hashCode += booleanNotNull ? Boolean.TRUE.hashCode() : Boolean.FALSE.hashCode(); hashCode += booleanNull != null ? booleanNull.hashCode() : 0; hashCode += byteNotNull; hashCode += byteNull != null ? byteNull.hashCode() : 0; hashCode += shortNotNull; hashCode += shortNull != null ? shortNull.hashCode() : 0; hashCode += intNotNull; hashCode += intNull != null ? intNull.hashCode() : 0; hashCode += longNotNull; hashCode += longNull != null ? longNull.hashCode() : 0; hashCode += floatNotNull; hashCode += floatNull != null ? floatNull.hashCode() : 0; hashCode += doubleNotNull; hashCode += doubleNull != null ? doubleNull.hashCode() : 0; hashCode += charNotNull; hashCode += charNull != null ? charNull.hashCode() : 0; hashCode += dateNull != null ? dateNull.hashCode() : 0; hashCode += stringNull != null ? stringNull.hashCode() : 0; hashCode += bigDecimal != null ? bigDecimal.hashCode() : 0; hashCode += bigInteger != null ? bigDecimal.hashCode() : 0; hashCode += PrimitiveTypes != null ? PrimitiveTypes.hashCode() : 0; return hashCode; } public boolean equals(Object o) { PrimitiveTypes p = (PrimitiveTypes) o; if (id != p.id) return false; if (booleanNotNull != p.booleanNotNull) return false; if (booleanNull != null) return booleanNull.equals(p.booleanNull); else if (p.booleanNull != null) return false; if (byteNotNull != p.byteNotNull) return false; if (byteNull != null) return byteNull.equals(p.byteNull); else if (p.byteNull != null) return false; if (shortNotNull != p.shortNotNull) return false; if (shortNull != null) return shortNull.equals(p.shortNull); else if (p.shortNull != null) return false; if (intNotNull != p.intNotNull) return false; if (intNull != null) return intNull.equals(p.intNull); else if (p.intNull != null) return false; if (longNotNull != p.longNotNull) return false; if (longNull != null) return longNull.equals(p.longNull); else if (p.longNull != null) return false; if (floatNotNull != p.floatNotNull) return false; if (floatNull != null) return floatNull.equals(p.floatNull); else if (p.floatNull != null) return false; if (doubleNotNull != p.doubleNotNull) return false; if (doubleNull != null) return doubleNull.equals(p.doubleNull); else if (p.doubleNull != null) return false; if (charNotNull != p.charNotNull) return false; if (charNull != null) return charNull.equals(p.charNull); else if (p.charNull != null) return false; if (dateNull != null) return dateNull.equals(p.dateNull); else if (p.dateNull != null) return false; if (stringNull != null) return stringNull.equals(p.stringNull); else if (p.stringNull != null) return false; if (bigDecimal != null) return bigDecimal.equals(p.bigDecimal); else if (p.bigDecimal != null) return false; if (bigInteger != null) return bigInteger.equals(p.bigInteger); else if (p.bigInteger != null) return false; if (PrimitiveTypes != null) return PrimitiveTypes.equals(p.PrimitiveTypes); else if (p.PrimitiveTypes != null) return false; return true; } public PrimitiveTypes() { } public PrimitiveTypes(long id, boolean booleanNotNull, Boolean booleanNull, byte byteNotNull, Byte byteNull, short shortNotNull, Short shortNull, int intNotNull, Integer intNull, long longNotNull, Long longNull, float floatNotNull, Float floatNull, double doubleNotNull, Double doubleNull, char charNotNull, Character charNull, Date dateNull, String stringNull, BigDecimal bigDecimal, BigInteger bigInteger, Long PrimitiveTypes) { this.id = id; this.booleanNotNull = booleanNotNull; this.booleanNull = booleanNull; this.byteNotNull = byteNotNull; this.byteNull = byteNull; this.shortNotNull = shortNotNull; this.shortNull = shortNull; this.intNotNull = intNotNull; this.intNull = intNull; this.longNotNull = longNotNull; this.longNull =longNull; this.floatNotNull = floatNotNull; this.floatNull =floatNull; this.doubleNotNull = doubleNotNull; this.doubleNull = doubleNull; this.charNotNull = charNotNull; this.charNull = charNull; this.dateNull = dateNull; this.stringNull = stringNull; this.bigDecimal = bigDecimal; this.bigInteger = bigInteger; this.PrimitiveTypes = PrimitiveTypes; } public long getId() { return id; } public void setId(long id) { this.id = id; } public boolean getBooleanNotNull() { return booleanNotNull; } public void setBooleanNotNull(boolean booleanNotNull) { this.booleanNotNull = booleanNotNull; } public Boolean getBooleanNull() { return booleanNull; } public void setBooleanNull(Boolean booleanNull) { this.booleanNull = booleanNull; } public byte getByteNotNull() { return byteNotNull; } public void setByteNotNull(byte byteNotNull) { this.byteNotNull = byteNotNull; } public Byte getByteNull() { return byteNull; } public void setByteNull(Byte byteNull) { this.byteNull = byteNull; } public short getShortNotNull() { return shortNotNull; } public void setShortNotNull(short shortNotNull) { this.shortNotNull = shortNotNull; } public Short getShortNull() { return shortNull; } public void setShortNull(Short shortNull) { this.shortNull = shortNull; } public int getIntNotNull() { return intNotNull; } public void setIntNotNull(int intNotNull) { this.intNotNull = intNotNull; } public Integer getIntNull() { return intNull; } public void setIntNull(Integer intNull) { this.intNull = intNull; } public long getLongNotNull() { return longNotNull; } public void setLongNotNull(long longNotNull) { this.longNotNull = longNotNull; } public Long getLongNull() { return longNull; } public void setLongNull(Long longNull) { this.longNull = longNull; } public float getFloatNotNull() { return floatNotNull; } public void setFloatNotNull(float floatNotNull) { this.floatNotNull = floatNotNull; } public Float getFloatNull() { return floatNull; } public void setFloatNull(Float floatNull) { this.floatNull = floatNull; } public double getDoubleNotNull() { return doubleNotNull; } public void setDoubleNotNull(double doubleNotNull) { this.doubleNotNull = doubleNotNull; } public Double getDoubleNull() { return doubleNull; } public void setDoubleNull(Double doubleNull) { this.doubleNull = doubleNull; } public char getCharNotNull() { return charNotNull; } public void setCharNotNull(char charNotNull) { this.charNotNull = charNotNull; } public Character getCharNull() { return charNull; } public void setCharNull(Character charNull) { this.charNull = charNull; } public Date getDateNull() { return dateNull; } public void setDateNull(Date dateNull) { this.dateNull = dateNull; } public String getStringNull() { return stringNull; } public void setStringNull(String stringNull) { this.stringNull = stringNull; } public BigDecimal getBigDecimal() { return bigDecimal; } public void setBigDecimal(BigDecimal bigDecimal) { this.bigDecimal = bigDecimal; } public BigInteger getBigInteger() { return bigInteger; } public void setBigInteger(BigInteger bigInteger) { this.bigInteger = bigInteger; } public Long getPrimitiveTypes() { return PrimitiveTypes; } public void setPrimitiveTypes(Long primitiveTypes) { this.PrimitiveTypes = primitiveTypes; } public static class Oid implements Serializable, Comparable { 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 k = (Oid)other; return k.id == this.id; } return false; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } public int compareTo(Object o) { if (o == null) throw new ClassCastException(); if (o == this) return 0; long otherId = ((Oid)o).id; if (id == otherId) return 0; else if (id < otherId) return -1; return 1; } } } tck/src/java/org/apache/jdo/tck/pc/mylib/VersionedPCPoint.java100664 6236 12500110373 24510 0ustarmbouschenstaff 0 0 /* * 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.mylib; import java.io.Serializable; import java.util.Date; /** * A simple class with two fields for application identity * * @author Marina Vatkina */ public class VersionedPCPoint implements Serializable { private static long counter = new Date().getTime(); private static long newId() { synchronized (PCPoint.class) { return counter++; } } private long id = newId(); public int x; public Integer y; public VersionedPCPoint() { } public VersionedPCPoint(int x, int y) { this.x = x; this.y = new Integer(y); } public VersionedPCPoint(int x, Integer y) { this.x = x; this.y = y; } public String toString() { String rc = null; Object obj = this; try { rc = obj.getClass().getName(); //rc = Util.getClassName(this) + name(); } catch (NullPointerException ex) { rc = "NPE getting PCPoint's values"; } return rc; } public void setX(int x) { this.x = x; } public int getX() { return x; } public void setY(Integer y) { this.y = y; } public Integer getY() { return y; } public String name() { return " x: " + getX() + ", y: " + getY().intValue(); } public static class Oid implements Serializable { public long id; /** The name of the class of the target object. */ public static String targetClassName = "org.apache.jdo.tck.pc.mylib.VersionedPCPoint"; public Oid() { } public Oid(String s) { id = Long.parseLong(justTheId(s)); } public String toString() { return getTargetClassName() + ": " + id;} public int hashCode() { return (int)id ; } public boolean equals(Object other) { if (other != null && (other instanceof Oid)) { Oid k = (Oid)other; return k.id == this.id; } return false; } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } /** Return the target class name. * @return the target class name. */ public String getTargetClassName() { return targetClassName; } } } tck/src/java/org/apache/jdo/tck/pc/newInstance/AAddress.java100664 3127 12500110373 24141 0ustarmbouschenstaff 0 0 /* * 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.newInstance; /** * This interface represents the persistent state of Address. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ public abstract class AAddress implements IAddress { public abstract long getAddrid(); public abstract String getStreet(); public abstract String getCity(); public abstract String getState(); public abstract String getZipcode(); public abstract String getCountry(); public abstract void setAddrid(long addrid); public abstract void setStreet(String street); public abstract void setCity(String city); public abstract void setState(String state); public abstract void setZipcode(String zipcode); public abstract void setCountry(String country); } tck/src/java/org/apache/jdo/tck/pc/newInstance/AAddress_bad.java100664 3362 12500110373 24750 0ustarmbouschenstaff 0 0 /* * 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.newInstance; /** * This interface represents the persistent state of Address. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ public abstract class AAddress_bad implements IAddress { public abstract long getAddrid(); public abstract String getStreet(); public abstract String getCity(); public abstract String getState(); public abstract String getZipcode(); public abstract String getCountry(); // Lacks setter, so not a persistent property // Expect JDOUserException on pm.newInstance(this) public abstract String getAString(); public abstract void setAddrid(long addrid); public abstract void setStreet(String street); public abstract void setCity(String city); public abstract void setState(String state); public abstract void setZipcode(String zipcode); public abstract void setCountry(String country); } tck/src/java/org/apache/jdo/tck/pc/newInstance/Address.java100664 24702 12500110373 24062 0ustarmbouschenstaff 0 0 /* * 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.newInstance; import java.io.Serializable; /** * This class represents a postal address. */ public class Address implements IAddress // , Serializable, Comparable, Comparator, DeepEquality { private long addrid; private String street; private String city; private String state; private String zipcode; private String country; /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public Address() {} /** * This constructor initializes the Address components. * @param addrid The address ID. * @param street The street address. * @param city The city. * @param state The state. * @param zipcode The zip code. * @param country The zip country. */ public Address(long addrid, String street, String city, String state, String zipcode, String country) { this.addrid = addrid; this.street = street; this.city = city; this.state = state; this.zipcode = zipcode; this.country = country; } /** * Get the addrid associated with this object. * @return the addrid. */ public long getAddrid() { return addrid; } /** * Set the id associated with this object. * @param id the id. */ public void setAddrid(long id) { if (this.addrid != 0) throw new IllegalStateException("Id is already set."); this.addrid = id; } /** * Get the street component of the address. * @return The street component of the address. */ public String getStreet() { return street; } /** * Set the street component of the address. * @param street The street component. */ public void setStreet(String street) { this.street = street; } /** * Get the city. * @return The city component of the address. */ public String getCity() { return city; } /** * Set the city component of the address. * @param city The city. */ public void setCity(String city) { this.city = city; } /** * Get the state component of the address. * @return The state. */ public String getState() { return state; } /** * Set the state component of the address. * @param state The state. */ public void setState(String state) { this.state = state; } /** * Get the zipcode component of the address. * @return The zipcode. */ public String getZipcode() { return zipcode; } /** * Set the zip code component of the address. * @param zipcode The zipcode. */ public void setZipcode(String zipcode) { this.zipcode = zipcode; } /** * Get the country component of the address. * @return The country. */ public String getCountry() { return country; } /** * Set the country component of the address. * @param country The country. */ public void setCountry(String country) { this.country = country; } /** * Returns a String representation of a Address object. * @return a String representation of a Address object. */ public String toString() { return "Address(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(addrid); rc.append(", street ").append(street); rc.append(", city ").append(city); rc.append(", state ").append(state); rc.append(", zipcode ").append(zipcode); rc.append(", country ").append(country); return rc.toString(); } // /** // * Returns true if all the fields of this instance are // * deep equal to the coresponding fields of the specified Person. // * @param other the object with which to compare. // * @param helper EqualityHelper to keep track of instances that have // * already been processed. // * @return true if all the fields are deep equal; // * false otherwise. // * @throws ClassCastException if the specified instances' type prevents // * it from being compared to this instance. // */ // public boolean deepCompareFields(Object other, // EqualityHelper helper) { // IAddress otherAddress = (IAddress)other; // String where = "Address<" + addrid + ">"; // return // helper.equals(addrid, otherAddress.getAddrid(), where + ".addrid") & // helper.equals(street, otherAddress.getStreet(), where + ".street") & // helper.equals(city, otherAddress.getCity(), where + ".city") & // helper.equals(state, otherAddress.getState(), where + ".state") & // helper.equals(zipcode, otherAddress.getZipcode(), where + ".zipcode") & // helper.equals(country, otherAddress.getCountry(), where + ".country"); // } // // /** // * Compares this object with the specified object for order. Returns a // * negative integer, zero, or a positive integer as this object is less // * than, equal to, or greater than the specified object. // * @param o The Object to be compared. // * @return a negative integer, zero, or a positive integer as this // * object is less than, equal to, or greater than the specified object. // * @throws ClassCastException - if the specified object's type prevents // * it from being compared to this Object. // */ // public int compareTo(Object o) { // return compareTo((IAddress)o); // } // // /** // * Compare two instances. This is a method in Comparator. // */ // public int compare(Object o1, Object o2) { // return compare((IAddress)o1, (IAddress)o2); // } // // /** // * Compares this object with the specified Address object for // * order. Returns a negative integer, zero, or a positive integer as // * this object is less than, equal to, or greater than the specified // * object. // * @param other The Address object to be compared. // * @return a negative integer, zero, or a positive integer as this // * object is less than, equal to, or greater than the specified Address // * object. // */ // public int compareTo(IAddress other) { // return compare(this, other); // } // // /** // * Compares its two IAddress arguments for order. Returns a negative // * integer, zero, or a positive integer as the first argument is less // * than, equal to, or greater than the second. // * @param o1 the first IAddress object to be compared. // * @param o2 the second IAddress object to be compared. // * @return a negative integer, zero, or a positive integer as the first // * object is less than, equal to, or greater than the second object. // */ // public static int compare(IAddress o1, IAddress o2) { // return EqualityHelper.compare(o1.getAddrid(), o2.getAddrid()); // } // // /** // * Indicates whether some other object is "equal to" this one. // * @param obj the object with which to compare. // * @return true if this object is the same as the obj // * argument; false otherwise. // */ // public boolean equals(Object obj) { // if (obj instanceof IAddress) { // return compareTo((IAddress)obj) == 0; // } // return false; // } /** * Returns a hash code value for the object. * @return a hash code value for this object. */ public int hashCode() { return (int)addrid; } /** * This class is used to represent the application identifier * for the Address class. */ public static class Oid implements Serializable, Comparable { /** * This is the identifier field for Address and must * correspond in type and name to the field in * Address. */ public long addrid; /** The required public, no-arg constructor. */ public Oid() { addrid = 0; } /** * A constructor to initialize the identifier field. * @param addrid the id of the Address. */ public Oid(long addrid) { this.addrid = addrid; } public Oid(String s) { addrid = Long.parseLong(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + addrid;} /** */ public boolean equals(java.lang.Object obj) { if( obj==null || !this.getClass().equals(obj.getClass()) ) return( false ); Oid o = (Oid) obj; if( this.addrid != o.addrid ) return( false ); return( true ); } /** */ public int hashCode() { return( (int) addrid ); } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } /** */ public int compareTo(Object obj) { // may throw ClassCastException which the user must handle Oid other = (Oid) obj; if( addrid < other.addrid ) return -1; if( addrid > other.addrid ) return 1; return 0; } } } tck/src/java/org/apache/jdo/tck/pc/newInstance/Address_bad.java100664 24623 12500110373 24672 0ustarmbouschenstaff 0 0 /* * 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.newInstance; import java.io.Serializable; /** * This class represents a postal address. */ public class Address_bad implements IAddress { private long addrid; private String street; private String city; private String state; private String zipcode; private String country; // Expect JDOUserException on pm.newInstance(this) // with non-public constructor private Address_bad() {} /** * This constructor initializes the Address components. * @param addrid The address ID. * @param street The street address. * @param city The city. * @param state The state. * @param zipcode The zip code. * @param country The zip country. */ public Address_bad(long addrid, String street, String city, String state, String zipcode, String country) { this.addrid = addrid; this.street = street; this.city = city; this.state = state; this.zipcode = zipcode; this.country = country; } public String getAString() { return "A String"; } /** * Get the addrid associated with this object. * @return the addrid. */ public long getAddrid() { return addrid; } /** * Set the id associated with this object. * @param id the id. */ public void setAddrid(long id) { if (this.addrid != 0) throw new IllegalStateException("Id is already set."); this.addrid = id; } /** * Get the street component of the address. * @return The street component of the address. */ public String getStreet() { return street; } /** * Set the street component of the address. * @param street The street component. */ public void setStreet(String street) { this.street = street; } /** * Get the city. * @return The city component of the address. */ public String getCity() { return city; } /** * Set the city component of the address. * @param city The city. */ public void setCity(String city) { this.city = city; } /** * Get the state component of the address. * @return The state. */ public String getState() { return state; } /** * Set the state component of the address. * @param state The state. */ public void setState(String state) { this.state = state; } /** * Get the zipcode component of the address. * @return The zipcode. */ public String getZipcode() { return zipcode; } /** * Set the zip code component of the address. * @param zipcode The zipcode. */ public void setZipcode(String zipcode) { this.zipcode = zipcode; } /** * Get the country component of the address. * @return The country. */ public String getCountry() { return country; } /** * Set the country component of the address. * @param country The country. */ public void setCountry(String country) { this.country = country; } /** * Returns a String representation of a Address object. * @return a String representation of a Address object. */ public String toString() { return "Address(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(addrid); rc.append(", street ").append(street); rc.append(", city ").append(city); rc.append(", state ").append(state); rc.append(", zipcode ").append(zipcode); rc.append(", country ").append(country); return rc.toString(); } // /** // * Returns true if all the fields of this instance are // * deep equal to the coresponding fields of the specified Person. // * @param other the object with which to compare. // * @param helper EqualityHelper to keep track of instances that have // * already been processed. // * @return true if all the fields are deep equal; // * false otherwise. // * @throws ClassCastException if the specified instances' type prevents // * it from being compared to this instance. // */ // public boolean deepCompareFields(Object other, // EqualityHelper helper) { // IAddress otherAddress = (IAddress)other; // String where = "Address<" + addrid + ">"; // return // helper.equals(addrid, otherAddress.getAddrid(), where + ".addrid") & // helper.equals(street, otherAddress.getStreet(), where + ".street") & // helper.equals(city, otherAddress.getCity(), where + ".city") & // helper.equals(state, otherAddress.getState(), where + ".state") & // helper.equals(zipcode, otherAddress.getZipcode(), where + ".zipcode") & // helper.equals(country, otherAddress.getCountry(), where + ".country"); // } // // /** // * Compares this object with the specified object for order. Returns a // * negative integer, zero, or a positive integer as this object is less // * than, equal to, or greater than the specified object. // * @param o The Object to be compared. // * @return a negative integer, zero, or a positive integer as this // * object is less than, equal to, or greater than the specified object. // * @throws ClassCastException - if the specified object's type prevents // * it from being compared to this Object. // */ // public int compareTo(Object o) { // return compareTo((IAddress)o); // } // // /** // * Compare two instances. This is a method in Comparator. // */ // public int compare(Object o1, Object o2) { // return compare((IAddress)o1, (IAddress)o2); // } // // /** // * Compares this object with the specified Address object for // * order. Returns a negative integer, zero, or a positive integer as // * this object is less than, equal to, or greater than the specified // * object. // * @param other The Address object to be compared. // * @return a negative integer, zero, or a positive integer as this // * object is less than, equal to, or greater than the specified Address // * object. // */ // public int compareTo(IAddress other) { // return compare(this, other); // } // // /** // * Compares its two IAddress arguments for order. Returns a negative // * integer, zero, or a positive integer as the first argument is less // * than, equal to, or greater than the second. // * @param o1 the first IAddress object to be compared. // * @param o2 the second IAddress object to be compared. // * @return a negative integer, zero, or a positive integer as the first // * object is less than, equal to, or greater than the second object. // */ // public static int compare(IAddress o1, IAddress o2) { // return EqualityHelper.compare(o1.getAddrid(), o2.getAddrid()); // } // // /** // * Indicates whether some other object is "equal to" this one. // * @param obj the object with which to compare. // * @return true if this object is the same as the obj // * argument; false otherwise. // */ // public boolean equals(Object obj) { // if (obj instanceof IAddress) { // return compareTo((IAddress)obj) == 0; // } // return false; // } /** * Returns a hash code value for the object. * @return a hash code value for this object. */ public int hashCode() { return (int)addrid; } /** * This class is used to represent the application identifier * for the Address class. */ public static class Oid implements Serializable, Comparable { /** * This is the identifier field for Address and must * correspond in type and name to the field in * Address. */ public long addrid; /** The required public, no-arg constructor. */ public Oid() { addrid = 0; } /** * A constructor to initialize the identifier field. * @param addrid the id of the Address. */ public Oid(long addrid) { this.addrid = addrid; } public Oid(String s) { addrid = Long.parseLong(justTheId(s)); } public String toString() { return this.getClass().getName() + ": " + addrid;} /** */ public boolean equals(java.lang.Object obj) { if( obj==null || !this.getClass().equals(obj.getClass()) ) return( false ); Oid o = (Oid) obj; if( this.addrid != o.addrid ) return( false ); return( true ); } /** */ public int hashCode() { return( (int) addrid ); } protected static String justTheId(String str) { return str.substring(str.indexOf(':') + 1); } /** */ public int compareTo(Object obj) { // may throw ClassCastException which the user must handle Oid other = (Oid) obj; if( addrid < other.addrid ) return -1; if( addrid > other.addrid ) return 1; return 0; } } } tck/src/java/org/apache/jdo/tck/pc/newInstance/IAddress.java100664 2576 12500110373 24160 0ustarmbouschenstaff 0 0 /* * 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.newInstance; /** * This interface represents the persistent state of Address. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ public interface IAddress { long getAddrid(); String getStreet(); String getCity(); String getState(); String getZipcode(); String getCountry(); void setAddrid(long addrid); void setStreet(String street); void setCity(String city); void setState(String state); void setZipcode(String zipcode); void setCountry(String country); } tck/src/java/org/apache/jdo/tck/pc/newInstance/IAddress_bad.java100664 3007 12500110373 24754 0ustarmbouschenstaff 0 0 /* * 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.newInstance; /** * This interface represents the persistent state of Address. * Javadoc was deliberately omitted because it would distract from * the purpose of the interface. */ public interface IAddress_bad { long getAddrid(); String getStreet(); String getCity(); String getState(); String getZipcode(); String getCountry(); // Lacks setter, so not a persistent property // Expect JDOUserException on pm.newInstance(this) String getAString(); void setAddrid(long addrid); void setStreet(String street); void setCity(String city); void setState(String state); void setZipcode(String zipcode); void setCountry(String country); } tck/src/java/org/apache/jdo/tck/pc/order/Order.java100664 15272 12500110373 22407 0ustarmbouschenstaff 0 0 /* * 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.order; import java.io.Serializable; import java.util.Comparator; import java.util.Set; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; public class Order implements Serializable, Comparable, Comparator, DeepEquality { long orderId; Set items; long customerId; public Order() {} public Order(long orderId, long customerId) { this.orderId = orderId; this.customerId = customerId; } public Order(long orderId, Set items, long customerId) { this.orderId = orderId; this.items = items; this.customerId = customerId; } public long getOrderId() { return orderId; } public void setOrderId(long orderId) { this.orderId = orderId; } public Set getItems() { return items; } public void setItems(Set items) { this.items = items; } public long getCustomerId() { return customerId; } public void setCustomerId(long customerId) { this.customerId = customerId; } /** * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the specified Person. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { Order otherOrder = (Order)other; String where = "Order<" + orderId + ">"; return helper.equals(orderId, otherOrder.getOrderId(), where + ".order") & helper.equals(items, otherOrder.getItems(), where + ".items") & helper.equals(customerId, otherOrder.getCustomerId(), where + ".customerId"); } /** * Compares this object with the specified object for order. Returns a * negative integer, zero, or a positive integer as this object is less * than, equal to, or greater than the specified object. * @param o The Object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified object. * @throws ClassCastException - if the specified object's type prevents * it from being compared to this Object. */ public int compareTo(Object o) { return compareTo((Order)o); } /** * Compare two instances. This is a method in Comparator. */ public int compare(Object o1, Object o2) { return compare((Order)o1, (Order)o2); } /** * Compares this object with the specified Company object for * order. Returns a negative integer, zero, or a positive integer as * this object is less than, equal to, or greater than the specified * object. * @param other The Company object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified Company * object. */ public int compareTo(Order other) { return compare(this, other); } /** * Compares its two Order arguments for order. Returns a negative * integer, zero, or a positive integer as the first argument is less * than, equal to, or greater than the second. * @param o1 the first Order object to be compared. * @param o2 the second Order object to be compared. * @return a negative integer, zero, or a positive integer as the first * object is less than, equal to, or greater than the second object. */ public static int compare(Order o1, Order o2) { return EqualityHelper.compare(o1.getOrderId(), o2.getOrderId()); } /** * Indicates whether some other object is "equal to" this one. * @param obj the object with which to compare. * @return true if this object is the same as the obj * argument; false otherwise. */ public boolean equals(Object obj) { if (obj instanceof Order) { return compareTo((Order)obj) == 0; } return false; } /** * The class to be used as the application identifier * for the Order class. It consists of both the orderId * field. */ public static class OrderOid implements Serializable, Comparable { public long orderId; /** The required public no-arg constructor. */ public OrderOid() { } public OrderOid(String s) { orderId = Long.parseLong(justTheOrder(s)); } public String toString() { return this.getClass().getName() + "order:" + String.valueOf(orderId); } /** */ public boolean equals(Object obj) { if (obj == null || !this.getClass().equals(obj.getClass())) return false; OrderOid o = (OrderOid) obj; if (this.orderId != o.orderId) { return false; } return true; } /** */ public int hashCode() { return (int)orderId; } protected static String justTheOrder(String str) { return str.substring(str.indexOf(':') + 1); } /** */ public int compareTo(Object obj) { // may throw ClassCastException which the user must handle OrderOid other = (OrderOid) obj; if( orderId < other.orderId ) return -1; if( orderId > other.orderId ) return 1; return 0; } } } tck/src/java/org/apache/jdo/tck/pc/order/OrderFactory.java100664 2601 12500110373 23707 0ustarmbouschenstaff 0 0 /* * 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. */ /* * OrderFactory.java * */ package org.apache.jdo.tck.pc.order; import java.math.BigDecimal; import java.util.Date; import java.util.Set; /** * This interface is implemented by a factory class that can create * Order model instances. The factory instance is registered with * OrderFactoryRegistry. */ public interface OrderFactory { Order newOrder(long orderId, Set items, long customerId); Order newOrder(long orderId, long customerId); OrderItem newOrderItem(Order order, long item, String description, int quantity); Class[] getTearDownClasses(); } tck/src/java/org/apache/jdo/tck/pc/order/OrderFactoryAbstractImpl.java100664 5360 12500110373 26222 0ustarmbouschenstaff 0 0 /* * 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.order; import javax.jdo.PersistenceManager; import java.util.Set; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /* * This class provides an implementation of OrderFactory that sets all * of the properties of the instance and defines abstract methods to * construct the instance itself. It is intended to be subclassed by * classes that implement only the methods to construct the instance. */ public abstract class OrderFactoryAbstractImpl implements OrderFactory { protected PersistenceManager pm; /** Logger */ protected Log logger = LogFactory.getFactory().getInstance("org.apache.jdo.tck"); /** true if debug logging is enabled. */ protected boolean debug = logger.isDebugEnabled(); /** Creates a new instance of OrderFactoryAbstractImpl */ public OrderFactoryAbstractImpl(PersistenceManager pm) { this.pm = pm; } abstract Order newOrder(); abstract OrderItem newOrderItem(); public Order newOrder(long orderId, long customerId) { Order result = newOrder(); result.setOrderId(orderId); result.setCustomerId(customerId); if (debug) logger.debug("newOrder returned" + result); return result; } public Order newOrder(long orderId, Set items, long customerId) { Order result = newOrder(); result.setOrderId(orderId); result.setItems(items); result.setCustomerId(customerId); if (debug) logger.debug("newOrder returned" + result); return result; } public OrderItem newOrderItem(Order order, long item, String description, int quantity) { OrderItem result = newOrderItem(); result.setOrder(order); result.setItem(item); result.setDescription(description); result.setQuantity(quantity); if (debug) logger.debug("newOrderItem returned" + result); return result; } } tck/src/java/org/apache/jdo/tck/pc/order/OrderFactoryConcreteClass.java100664 3416 12500110373 26365 0ustarmbouschenstaff 0 0 /* * 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.order; import java.util.Set; import javax.jdo.PersistenceManager; /* * This class is the order factory that uses constructors of the * concrete classes. */ public class OrderFactoryConcreteClass implements OrderFactory { /** */ public static final Class[] tearDownClasses = new Class[] { Order.class, OrderItem.class }; public OrderFactoryConcreteClass(PersistenceManager pm) { } public OrderFactoryConcreteClass() { } public Order newOrder(long orderId, long customerId) { return new Order(orderId, customerId); } public Order newOrder(long orderId, Set items, long customerId) { return new Order(orderId, items, customerId); } public OrderItem newOrderItem(Order order, long item, String description, int quantity) { return new OrderItem(order, item, description, quantity); } public Class[] getTearDownClasses() { return tearDownClasses; } } tck/src/java/org/apache/jdo/tck/pc/order/OrderFactoryPMClass.java100664 3176 12500110373 25142 0ustarmbouschenstaff 0 0 /* * 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.order; import javax.jdo.PersistenceManager; /* * OrderFactoryPMClass.java * * This class uses the PersistenceManager.newInstance method with the concrete * class as a parameter. */ public class OrderFactoryPMClass extends OrderFactoryAbstractImpl { /** */ public static final Class[] tearDownClasses = new Class[] { Order.class, OrderItem.class }; /** * Creates a new instance of OrderFactoryPMClass */ public OrderFactoryPMClass(PersistenceManager pm) { super(pm); } public Order newOrder() { return (Order)pm.newInstance(Order.class); } public OrderItem newOrderItem() { return (OrderItem)pm.newInstance(OrderItem.class); } public Class[] getTearDownClasses() { return tearDownClasses; } } tck/src/java/org/apache/jdo/tck/pc/order/OrderFactoryPMInterface.java100664 3027 12500110373 25770 0ustarmbouschenstaff 0 0 /* * 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.order; import javax.jdo.PersistenceManager; /* * OrderFactoryPMInterface.java * */ public class OrderFactoryPMInterface extends OrderFactoryAbstractImpl { /** */ public static final Class[] tearDownClasses = new Class[] { Order.class, OrderItem.class }; /** * Creates a new instance of OrderFactoryPMInterface */ public OrderFactoryPMInterface(PersistenceManager pm) { super(pm); } Order newOrder() { return (Order)pm.newInstance(Order.class); } OrderItem newOrderItem() { return (OrderItem)pm.newInstance(OrderItem.class); } public Class[] getTearDownClasses() { return tearDownClasses; } } tck/src/java/org/apache/jdo/tck/pc/order/OrderFactoryRegistry.java100664 11531 12500110373 25462 0ustarmbouschenstaff 0 0 /* * 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.order; import java.lang.reflect.Constructor; import javax.jdo.PersistenceManager; /* * This is the registry for order factories. It is used for the * CompletenessTest to create instances from input xml test data files. * Factory instances that implement OrderFactory interface are * registered (using the singleton pattern). *

Several registration methods are available. The default factory, * which creates instances by construction, is automatically * registered during class initialization. The default factory can * also be registered by using the no-args method registerFactory(). *

Non-default factories can be registered using the registerFactory * method taking the factory as an argument. Non-default factories that * have a single constructor argument PersistenceManager can be * registered using either the method that explicitly names the class, * or with the method that takes the class name from a system property. */ public class OrderFactoryRegistry { /** The system property for factory name * * NOTE: SHOULD BE RENAMED!! */ final static String FACTORY_PROPERTY_NAME = "jdo.tck.mapping.companyfactory"; /** The factory name if the system property is not set. */ final static String DEFAULT_FACTORY_CLASS_NAME = "org.apache.jdo.tck.pc.order.OrderFactoryConcreteClass"; /** * The default factory class name */ final static String FACTORY_CLASS_NAME; static { String prop = System.getProperty(FACTORY_PROPERTY_NAME); if ((prop == null) || (prop.length() == 0)) prop = DEFAULT_FACTORY_CLASS_NAME; FACTORY_CLASS_NAME = prop; } /** * This is the default order factory singleton. This is statically * loaded regardless of the setting of the system property. */ final static OrderFactory SINGLETON = new OrderFactoryConcreteClass(); /** * This is the currently registered factory. */ static OrderFactory instance = SINGLETON; /** * Creates a new instance of OrderFactoryRegistry */ private OrderFactoryRegistry() { } /** * Get the currently registered factory. * @return the factory */ public static OrderFactory getInstance() { return instance; } /** Register the default factory. */ public static void registerFactory() { instance = SINGLETON; } /** Register a factory using the default factory name from the * system property. The factory must be available in the current * class path and have a public constructor * taking a PersistenceManager as a parameter. * @param pm the PersistenceManager */ public static void registerFactory(PersistenceManager pm) { registerFactory(FACTORY_CLASS_NAME, pm); } /** Register a factory using the specified factoryName * parameter. The factory class must be loadable by the current context * classloader and have a public constructor * taking a PersistenceManager as a parameter. * @param factoryClassName the fully-qualified class name of the factory * @param pm the PersistenceManager */ public static void registerFactory(String factoryClassName, PersistenceManager pm) { OrderFactory factory = null; try { if (factoryClassName != null) { Class factoryClass = Class.forName(factoryClassName); Constructor ctor = factoryClass.getConstructor(new Class[] {PersistenceManager.class}); factory = (OrderFactory) ctor.newInstance(new Object[]{pm}); } registerFactory(factory); } catch (Exception ex) { throw new RuntimeException ("Unable to construct OrderFactory " + factoryClassName, ex); } } /** Register the factory. * @param factory the factory */ public static void registerFactory(OrderFactory factory) { instance = factory!=null?factory:SINGLETON; } } tck/src/java/org/apache/jdo/tck/pc/order/OrderItem.java100664 17167 12500110373 23233 0ustarmbouschenstaff 0 0 /* * 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.order; import java.io.Serializable; import java.util.Comparator; import org.apache.jdo.tck.util.DeepEquality; import org.apache.jdo.tck.util.EqualityHelper; public class OrderItem implements Serializable, Comparable, Comparator, DeepEquality { Order order; long item; String description; int quantity; public OrderItem() { } public OrderItem(Order order, long item, String description, int quantity) { this.order = order; this.item = item; this.description = description; this.quantity = quantity; } public Order getOrder() { return order; } public void setOrder (Order order) { this.order = order; } public long getItem() { return item; } public void setItem (long item) { this.item = item; } public String getDescription() { return description; } public void setDescription (String description) { this.description = description; } public int getQuantity() { return quantity; } public void setQuantity (int quantity) { this.quantity = quantity; } /** * Returns true if all the fields of this instance are * deep equal to the coresponding fields of the specified Person. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper) { OrderItem otherOrderItem = (OrderItem)other; String where = "OrderItem<" + order.getOrderId() + "," + item + ">"; return helper.equals(order, otherOrderItem.getOrder(), where + ".order") & helper.equals(item, otherOrderItem.getItem(), where + ".item"); } /** * Compares this object with the specified object for order. Returns a * negative integer, zero, or a positive integer as this object is less * than, equal to, or greater than the specified object. * @param o The Object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified object. * @throws ClassCastException - if the specified object's type prevents * it from being compared to this Object. */ public int compareTo(Object o) { return compareTo((OrderItem)o); } /** * Compare two instances. This is a method in Comparator. */ public int compare(Object o1, Object o2) { return compare((OrderItem)o1, (OrderItem)o2); } /** * Compares this object with the specified Company object for * order. Returns a negative integer, zero, or a positive integer as * this object is less than, equal to, or greater than the specified * object. * @param other The Company object to be compared. * @return a negative integer, zero, or a positive integer as this * object is less than, equal to, or greater than the specified Company * object. */ public int compareTo(OrderItem other) { return compare(this, other); } /** * Compares its two OrderItem arguments for order. Returns a negative * integer, zero, or a positive integer as the first argument is less * than, equal to, or greater than the second. * @param o1 the first OrderItem object to be compared. * @param o2 the second OrderItem object to be compared. * @return a negative integer, zero, or a positive integer as the first * object is less than, equal to, or greater than the second object. */ public static int compare(OrderItem o1, OrderItem o2) { int retval = o1.getOrder().compareTo(o2.getOrder()); if (retval != 0) { return retval; } return EqualityHelper.compare(o1.getItem(), o2.getItem()); } /** * Indicates whether some other object is "equal to" this one. * @param obj the object with which to compare. * @return true if this object is the same as the obj * argument; false otherwise. */ public boolean equals(Object obj) { if (obj instanceof OrderItem) { return compareTo((OrderItem)obj) == 0; } return false; } /** * Returns a hash code value for the object. * @return a hash code value for this object. */ public int hashCode() { return (int)(order.orderId + item); } /** * The class to be used as the application identifier * for the OrderItem class. It consists of both the order * and the item fields. */ public static class OrderItemOid implements Serializable, Comparable { public Order.OrderOid order; //matches order field name and OrderId type public long item; // matches item field name and type /** The required public no-arg constructor. */ public OrderItemOid() { } public OrderItemOid(String s) { order = new Order.OrderOid(); order.orderId = Long.parseLong(justTheOrder(s)); item = Long.parseLong(justTheItem(s)); } public String toString() { return this.getClass().getName() + "order:" + order.orderId + ",item:" + item; } /** */ public boolean equals(Object obj) { if (obj==null || !this.getClass().equals(obj.getClass())) return false; OrderItemOid o = (OrderItemOid) obj; if (!this.order.equals(o.order) || (this.item != o.item)) { return false; } return true; } /** */ public int hashCode() { return (int)(item + order.orderId); } protected static String justTheOrder(String str) { return str.substring(str.indexOf("order:") + 6, str.indexOf(",item:")); } protected static String justTheItem(String str) { return str.substring(str.indexOf("item:") + 5); } /** */ public int compareTo(Object obj) { // may throw ClassCastException which the user must handle OrderItemOid other = (OrderItemOid) obj; if( order.orderId < other.order.orderId ) return -1; if( order.orderId > other.order.orderId ) return 1; if( item < other.item ) return -1; if( item > other.item ) return 1; return 0; } } } tck/src/java/org/apache/jdo/tck/pc/order/OrderModelReader.java100664 11721 12500110373 24506 0ustarmbouschenstaff 0 0 /* * 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.order; import java.io.InputStream; import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; import java.util.Locale; import java.util.TimeZone; import org.apache.jdo.tck.util.ConversionHelper; import org.springframework.beans.factory.xml.XmlBeanFactory; import org.springframework.beans.propertyeditors.CustomDateEditor; import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.InputStreamResource; /** * Utility class to create a graph of order model instances from an xml * representation. * */ public class OrderModelReader extends XmlBeanFactory { /** The format of date values in the xml representation */ public static final String DATE_PATTERN = "d/MMM/yyyy"; /** The name of the root list bean. */ public static final String ROOT_LIST_NAME = "root"; /** The bean-factory name in the xml input files. */ public static final String BEAN_FACTORY_NAME = "orderFactory"; /** The order factory instance. */ private OrderFactory orderFactory; /** * Create a OrderModelReader for the specified resourceName. * @param resourceName the name of the resource */ public OrderModelReader(String resourceName) { // Use the class loader of the Order class to find the resource this(resourceName, Order.class.getClassLoader()); } /** * Create a OrderModelReader for the specified resourceName. * @param resourceName the name of the resource */ public OrderModelReader(String resourceName, ClassLoader classLoader) { super(new ClassPathResource(resourceName, classLoader)); configureFactory(); } /** * Create a OrderModelReader for the specified InputStream. * @param stream the input stream */ public OrderModelReader(InputStream stream) { super(new InputStreamResource(stream)); configureFactory(); } /** * Returns a list of root objects. The method expects to find a bean * called "root" of type list in the xml and returns it. * @return a list of root instances */ public List getRootList() { return (List)getBean(ROOT_LIST_NAME); } /** * Configure the OrderModelReader, e.g. register CustomEditor classes * to convert the string representation of a property into an instance * of the right type. */ private void configureFactory() { SimpleDateFormat formatter = new SimpleDateFormat(DATE_PATTERN, Locale.US); CustomDateEditor dateEditor = new CustomDateEditor(formatter, true); registerCustomEditor(Date.class, dateEditor); orderFactory = OrderFactoryRegistry.getInstance(); addSingleton(BEAN_FACTORY_NAME, orderFactory); } // Convenience methods /** * Convenience method returning a Order instance for the specified * name. The method returns null if there is no Order * bean with the specified name. * @param name the name of the bean to return. * @return the instance of the bean or null if there no * Order bean. */ public Order getOrder(String name) { return (Order)getBean(name, Order.class); } /** * Convenience method returning a OrderItem instance for the specified * name. The method returns null if there is no Department * bean with the specified name. * @param name the name of the bean to return. * @return the instance of the bean or null if there no * Department bean. */ public OrderItem getOrderItem(String name) { return (OrderItem)getBean(name, OrderItem.class); } /** * @return Returns the tearDownClasses. */ public Class[] getTearDownClassesFromFactory() { return orderFactory.getTearDownClasses(); } /** * @return Returns the tearDownClasses. */ public static Class[] getTearDownClasses() { return OrderFactoryConcreteClass.tearDownClasses; } public static Date stringToUtilDate(String value) { return ConversionHelper.toUtilDate(DATE_PATTERN, Locale.US, value); } } tck/src/java/org/apache/jdo/tck/pc/query/JDOQLKeywordsAsFieldNames.java100664 2217 12500110372 26155 0ustarmbouschenstaff 0 0 /* * 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.query; /** * The PC class for testing JDOQL queries. */ public class JDOQLKeywordsAsFieldNames { /** * The primary key field. */ private String select; public void setSelect(String select) { this.select = select; } public String getSelect() { return this.select; } } tck/src/java/org/apache/jdo/tck/pc/query/MathSample.java100664 3465 12500110372 23401 0ustarmbouschenstaff 0 0 /* * 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.query; import java.io.Serializable; import java.math.BigDecimal; public class MathSample implements Serializable { long id; /** Angle in radians. */ BigDecimal angle; public long getId() { return id; } public void setId(long id) { this.id = id; } public BigDecimal getAngle() { return angle; } public void setAngle(BigDecimal angle) { this.angle = angle; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((angle == null) ? 0 : angle.hashCode()); result = prime * result + (int) (id ^ (id >>> 32)); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; MathSample other = (MathSample) obj; if (angle == null) { if (other.angle != null) return false; } else if (!angle.equals(other.angle)) return false; if (id != other.id) return false; return true; } } tck/src/java/org/apache/jdo/tck/pc/query/NoExtent.java100664 2165 12500110372 23106 0ustarmbouschenstaff 0 0 /* * 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.query; /** * The PC class for testing JDOQL queries. */ public class NoExtent { /** * The primary key field. */ private int id; public NoExtent() {} public NoExtent(int id) { this.id = id; } public int getId() { return this.id; } } tck/src/java/org/apache/jdo/tck/pc/query/TimeSample.java100664 3365 12500110372 23405 0ustarmbouschenstaff 0 0 /* * 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.query; import java.io.Serializable; import java.sql.Time; public class TimeSample implements Serializable { long id; Time time; public long getId() { return id; } public void setId(long id) { this.id = id; } public Time getTime() { return time; } public void setTime(Time time) { this.time = time; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + (int) (id ^ (id >>> 32)); result = prime * result + ((time == null) ? 0 : time.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; TimeSample other = (TimeSample) obj; if (id != other.id) return false; if (time == null) { if (other.time != null) return false; } else if (!time.equals(other.time)) return false; return true; } } tck/src/java/org/apache/jdo/tck/pc/shoppingcart/Cart.java100664 7404 12500110372 23570 0ustarmbouschenstaff 0 0 /* * 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.shoppingcart; import java.io.Serializable; import java.util.*; /** This class represents an online shopping cart. It has a list of entries of * type CartEntry. */ public class Cart 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 identity of the customer whose shopping cart this is. */ protected String customerId; /** The list of entries in this cart */ protected Set entries = new HashSet(); // element-type CartEntry /** For JDO compliance only; not for public consumption. */ protected Cart() {} public Cart(String customerId) { this(nextId(), customerId); } protected Cart(long id, String customerId) { setId(id); setCustomerId(customerId); } public long getId() { return id; } protected void setId(long id) { this.id = id; } public CartEntry newCartEntry(Product product, int quantity) { CartEntry ce = new CartEntry(this, CartEntry.nextId(), product, quantity); entries.add(ce); return ce; } public void addCartEntry(CartEntry ce) { if (ce == null) { throw new IllegalArgumentException("no CartEntry given"); } ce.setCart(this); entries.add(ce); } public Iterator getEntries() { return entries.iterator(); } public String getCustomerId() { return customerId; } public void setCustomerId(String customerId) { this.customerId = customerId; } public boolean equals(Object that) { if (this == that) { return true; } if (that == null) { return false; } if (!(that instanceof Cart)) { return false; } return equals((Cart) that); } public boolean equals(Cart 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); } } } tck/src/java/org/apache/jdo/tck/pc/shoppingcart/CartEntry.java100664 7547 12500110372 24622 0ustarmbouschenstaff 0 0 /* * 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.shoppingcart; import java.io.Serializable; /** This class represents an entry in an online shopping cart that has a * quantity of a product. */ public class CartEntry 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; protected Cart cart; protected Product product; protected int quantity = 1; /** No-arg constructor required by JDO; not for public consumption */ protected CartEntry() {} public CartEntry(Cart cart, Product product) { this(cart, nextId(), product); } public CartEntry(Cart cart, long id, Product product) { this(cart, id, product, 1); } public CartEntry(Cart cart, long id, Product product, int quantity) { setId(id); setProduct(product); setQuantity(quantity); cart.addCartEntry(this); } public long getId() { return id; } protected void setId(long id) { this.id = id; } public Cart getCart() { return cart; } protected void setCart(Cart cart) { if (this.cart != null) { throw new IllegalStateException("Cart already set"); } this.cart = cart; } public Product getProduct() { return product; } public void setProduct(Product product) { this.product = product; } public int getQuantity() { return quantity; } public void setQuantity(int quantity) { if (quantity < 1) { throw new IllegalArgumentException("quantity can't be less than one"); } this.quantity = quantity; } public boolean equals(Object that) { if (this == that) { return true; } if (that == null) { return false; } if (!(that instanceof CartEntry)) { return false; } return equals((CartEntry) that); } public boolean equals(CartEntry 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); } } } tck/src/java/org/apache/jdo/tck/pc/shoppingcart/Product.java100664 5215 12500110372 24315 0ustarmbouschenstaff 0 0 /* * 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.shoppingcart; import java.io.Serializable; /** This class represents a product that you would buy from an online store. */ public class Product implements Serializable { /** Identity field when used with application identity */ protected String sku; protected String description; /** No-arg constructor required by JDO; not for public consumption */ protected Product() {} /** Domain model constructor */ public Product(String sku) { setSku(sku); } /** Constructor with sku and description */ public Product(String sku, String description) { this(sku); setDescription(description); } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public String getSku() { return sku; } public void setSku(String sku) { if (sku == null || (sku = sku.trim()).length() == 0) { throw new IllegalArgumentException("no sku given"); } this.sku = sku.toUpperCase(); } public static class Oid implements Serializable { public String sku; public Oid() { } public Oid(String s) { sku = justTheSku(s); } public String toString() { return this.getClass().getName() + ":" + sku; } public int hashCode() { return sku.hashCode(); } public boolean equals(Object other) { if (other != null && (other instanceof Oid)) { Oid that = (Oid) other; return that.sku.equals(this.sku); } return false; } protected static String justTheSku(String str) { return str.substring(str.indexOf(':') + 1); } } } tck/src/java/org/apache/jdo/tck/pc/shoppingcart/Undetachable.java100664 4700 12500110372 25252 0ustarmbouschenstaff 0 0 /* * 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.shoppingcart; import java.io.Serializable; /** * This class is a token undetachable class. It is only present to be * persistence-capable but not detachable so as to test that a detachable class * must be declared so. */ public class Undetachable 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; protected int foo; protected int bar; public Undetachable() { this(nextId()); } public Undetachable(long id) { this.id = 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); } } public int getFoo() { return foo; } public void setFoo(int foo) { this.foo = foo; } public int getBar() { return bar; } public void setBar(int bar) { this.bar = bar; } } tck/src/java/org/apache/jdo/tck/pc/singlefieldidentity/AbstractPCPointSingleField.java100664 4044 12500110372 31340 0ustarmbouschenstaff 0 0 /* * 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.singlefieldidentity; import java.io.Serializable; import java.util.Date; import javax.jdo.identity.SingleFieldIdentity; /** * This is the super class for all PCPoint single indentity classes. * It defines an abstract method equals(SingleFieldIdentity). * That method ensures that all single identity test cases have a common * implementation. * @author Michael Watzek */ abstract public class AbstractPCPointSingleField implements Serializable { /** * This field is used by subclasses * to compute the value of the primary key field. */ static long counter = new Date().getTime(); /** * Returns true if the given the key of the given * SingleFieldIdentity instance equals the key in the subclass * of this class. * @param singleFieldIdentity the single field identity to check. * @return returns true if the given the key of the given * SingleFieldIdentity instance equals the key in the subclass * of this class. */ abstract public boolean equalsPKField(SingleFieldIdentity singleFieldIdentity); public String toString() { return '(' + getClass().getName() + ')'; } } tck/src/java/org/apache/jdo/tck/pc/singlefieldidentity/Employee.java100664 6570 12500110372 26017 0ustarmbouschenstaff 0 0 /* * 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.singlefieldidentity; import java.util.Date; /** * This class represents an employee. */ public abstract class Employee extends Person { private Date hiredate; private double weeklyhours; /** This is the JDO-required no-args constructor */ protected Employee() {} /** * Construct an Employee instance. * @param personid The identifier for the person. * @param firstname The first name of the employee. * @param lastname The last name of the employee. * @param middlename The middle name of the employee. * @param birthdate The birth date of the employee. * @param hiredate The date that the employee was hired. */ public Employee(long personid, String firstname, String lastname, String middlename, Date birthdate, Date hiredate) { super(personid, firstname, lastname, middlename, birthdate); this.hiredate = hiredate; } /** * Get the date that the employee was hired. * @return The date the employee was hired. */ public Date getHiredate() { return hiredate; } /** * Set the date that the employee was hired. * @param hiredate The date the employee was hired. */ public void setHiredate(Date hiredate) { this.hiredate = hiredate; } /** * Get the weekly hours of the employee. * @return The number of hours per week that the employee works. */ public double getWeeklyhours() { return weeklyhours; } /** * Set the number of hours per week that the employee works. * @param weeklyhours The number of hours per week that the employee * works. */ public void setWeeklyhours(double weeklyhours) { this.weeklyhours = weeklyhours; } /** * Return a String representation of a Employee object. * @return a String representation of a Employee object. */ @Override public String toString() { return "Employee(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ @Override protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(super.getFieldRepr()); rc.append(", hired ").append( hiredate==null ? "null" : formatter.format(hiredate)); rc.append(", weeklyhours ").append(weeklyhours); return rc.toString(); } } tck/src/java/org/apache/jdo/tck/pc/singlefieldidentity/FullTimeEmployee.java100664 5565 12500110372 27464 0ustarmbouschenstaff 0 0 /* * 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.singlefieldidentity; import java.util.Date; /** * This class represents a full-time employee. */ public class FullTimeEmployee extends Employee { private double salary; /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public FullTimeEmployee() {} /** * Construct a full-time employee. * @param personid The person identifier. * @param first The person's first name. * @param last The person's last name. * @param middle The person's middle name. * @param born The person's birthdate. * @param hired The date that the person was hired. * @param sal The salary of the full-time employee. */ public FullTimeEmployee(long personid, String first, String last, String middle, Date born, Date hired, double sal) { super(personid, first, last, middle, born, hired); salary = sal; } /** * Get the salary of the full time employee. * @return The salary of the full time employee. */ public double getSalary() { return salary; } /** * Set the salary for the full-time employee. * @param salary The salary to set for the full-time employee. */ public void setSalary(double salary) { this.salary = salary; } /** * Return a String representation of a FullTimeEmployee object. * @return a String representation of a FullTimeEmployee object. */ @Override public String toString() { return "FullTimeEmployee(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ @Override public String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(super.getFieldRepr()); rc.append(", $").append(salary); return rc.toString(); } } tck/src/java/org/apache/jdo/tck/pc/singlefieldidentity/PartTimeEmployee.java100664 5472 12500110372 27465 0ustarmbouschenstaff 0 0 /* * 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.singlefieldidentity; import java.util.Date; /** * This class represents a part-time employee. */ public class PartTimeEmployee extends Employee { private double wage; /** This is the JDO-required no-args constructor. The TCK relies on * this constructor for testing PersistenceManager.newInstance(PCClass). */ public PartTimeEmployee() {} /** * Construct a part-time employee. * @param personid The identifier for the person. * @param first The person's first name. * @param last The person's last name. * @param middle The person's middle name. * @param born The person's birthdate. * @param hired The date the person was hired. * @param wage The person's wage. */ public PartTimeEmployee(long personid, String first, String last, String middle, Date born, Date hired, double wage ) { super(personid, first, last, middle, born, hired); this.wage = wage; } /** * Get the wage of the part-time employee. * @return The wage of the part-time employee. */ public double getWage() { return wage; } /** * Set the wage of the part-time employee. * @param wage The wage of the part-time employee. */ public void setWage(double wage) { this.wage = wage; } /** * Returns a String representation of a PartTimeEmployee object. * @return a String representation of a PartTimeEmployee object. */ @Override public String toString() { return "PartTimeEmployee(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ @Override public String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(super.getFieldRepr()); rc.append(", $" + wage); return rc.toString(); } } tck/src/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldByte.java100664 6400 12500110372 30476 0ustarmbouschenstaff 0 0 /* * 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.singlefieldidentity; import javax.jdo.identity.ByteIdentity; import javax.jdo.identity.SingleFieldIdentity; /** * The PC class for testing ByteIdentity. * @author Michael Watzek */ public class PCPointSingleFieldByte extends AbstractPCPointSingleField { /** * Returns a unique value, used for primary key field initialization. * @return a unique value */ private static byte newId() { synchronized (PCPointSingleFieldByte.class) { return (byte) ((counter++) % Byte.MAX_VALUE); } } /** * The primary key field. */ private Byte id = new Byte(newId()); public int x; public Integer y; /** * This constructor is used by test cases checking assertion A7.12-38:
* For classes using single field identity method * PersistenceCapable.newObjectIdInstance() must be called * on a persistent instance with its primary key field initialized, * or a JDOFatalInternalException is thrown. */ public PCPointSingleFieldByte() { this.id = null; } /** * This constructor is used by test cases checking assertion A7.12-39:
* The instance returned is initialized with the value of the primary key * field of the instance on which the method is called. * @param x * @param y */ public PCPointSingleFieldByte(int x, int y) { this.x = x; this.y = new Integer(y); } public void setX(int x) { this.x = x; } public int getX() { return x; } public void setY(Integer y) { this.y = y; } public Integer getY() { return y; } public String name() { return " x: " + getX() + ", y: " + getY().intValue(); } /** * Returns true if the given the key of the given * SingleFieldIdentity instance equals the key in the subclass * of this class. * @param singleFieldIdentity the single field identity to check. * @return returns true if the given the key of the given * SingleFieldIdentity instance equals the key in the subclass * of this class. */ public boolean equalsPKField(SingleFieldIdentity singleFieldIdentity) { return this.id.byteValue()==((ByteIdentity)singleFieldIdentity).getKey(); } public String toString() { return super.toString() + this.id; } } tck/src/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldCharacter.java100664 6443 12500110372 31476 0ustarmbouschenstaff 0 0 /* * 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.singlefieldidentity; import javax.jdo.identity.CharIdentity; import javax.jdo.identity.SingleFieldIdentity; /** * The PC class for testing CharIdentity. * @author Michael Watzek */ public class PCPointSingleFieldCharacter extends AbstractPCPointSingleField { /** * Returns a unique value, used for primary key field initialization. * @return a unique value */ private static char newId() { synchronized (PCPointSingleFieldCharacter.class) { return (char) ((counter++) % Character.MAX_VALUE); } } /** * The primary key field. */ private Character id = new Character(newId()); public int x; public Integer y; /** * This constructor is used by test cases checking assertion A7.12-38:
* For classes using single field identity method * PersistenceCapable.newObjectIdInstance() must be called * on a persistent instance with its primary key field initialized, * or a JDOFatalInternalException is thrown. */ public PCPointSingleFieldCharacter() { this.id = null; } /** * This constructor is used by test cases checking assertion A7.12-39:
* The instance returned is initialized with the value of the primary key * field of the instance on which the method is called. * @param x * @param y */ public PCPointSingleFieldCharacter(int x, int y) { this.x = x; this.y = new Integer(y); } public void setX(int x) { this.x = x; } public int getX() { return x; } public void setY(Integer y) { this.y = y; } public Integer getY() { return y; } public String name() { return " x: " + getX() + ", y: " + getY().intValue(); } /** * Returns true if the given the key of the given * SingleFieldIdentity instance equals the key in the subclass * of this class. * @param singleFieldIdentity the single field identity to check. * @return returns true if the given the key of the given * SingleFieldIdentity instance equals the key in the subclass * of this class. */ public boolean equalsPKField(SingleFieldIdentity singleFieldIdentity) { return this.id.charValue()==((CharIdentity)singleFieldIdentity).getKey(); } public String toString() { return super.toString() + this.id; } } tck/src/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldDate.java100664 6375 12500110372 30463 0ustarmbouschenstaff 0 0 /* * 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.singlefieldidentity; import java.util.Date; import javax.jdo.identity.ObjectIdentity; import javax.jdo.identity.SingleFieldIdentity; /** * The PC class for testing ObjectIdentity. * @author Michael Watzek */ public class PCPointSingleFieldDate extends AbstractPCPointSingleField { /** * Returns a unique value, used for primary key field initialization. * @return a unique value */ private static long newId() { synchronized (PCPointSingleFieldDate.class) { return counter++; } } /** * The primary key field. */ private Date id = new Date(newId()); public int x; public Integer y; /** * This constructor is used by test cases checking assertion A7.12-38:
* For classes using single field identity method * PersistenceCapable.newObjectIdInstance() must be called * on a persistent instance with its primary key field initialized, * or a JDOFatalInternalException is thrown. */ public PCPointSingleFieldDate() { this.id = null; } /** * This constructor is used by test cases checking assertion A7.12-39:
* The instance returned is initialized with the value of the primary key * field of the instance on which the method is called. * @param x * @param y */ public PCPointSingleFieldDate(int x, int y) { this.x = x; this.y = new Integer(y); } public void setX(int x) { this.x = x; } public int getX() { return x; } public void setY(Integer y) { this.y = y; } public Integer getY() { return y; } public String name() { return " x: " + getX() + ", y: " + getY().intValue(); } /** * Returns true if the given the key of the given * SingleFieldIdentity instance equals the key in the subclass * of this class. * @param singleFieldIdentity the single field identity to check. * @return returns true if the given the key of the given * SingleFieldIdentity instance equals the key in the subclass * of this class. */ public boolean equalsPKField(SingleFieldIdentity singleFieldIdentity) { return this.id.equals(((ObjectIdentity)singleFieldIdentity).getKey()); } public String toString() { return super.toString() + this.id; } } tck/src/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldInteger.java100664 6417 12500110372 31200 0ustarmbouschenstaff 0 0 /* * 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.singlefieldidentity; import javax.jdo.identity.IntIdentity; import javax.jdo.identity.SingleFieldIdentity; /** * The PC class for testing IntIdentity. * @author Michael Watzek */ public class PCPointSingleFieldInteger extends AbstractPCPointSingleField { /** * Returns a unique value, used for primary key field initialization. * @return a unique value */ private static int newId() { synchronized (PCPointSingleFieldInteger.class) { return (int) ((counter++) % Integer.MAX_VALUE); } } /** * The primary key field. */ private Integer id = new Integer(newId()); public int x; public Integer y; /** * This constructor is used by test cases checking assertion A7.12-38:
* For classes using single field identity method * PersistenceCapable.newObjectIdInstance() must be called * on a persistent instance with its primary key field initialized, * or a JDOFatalInternalException is thrown. */ public PCPointSingleFieldInteger() { this.id = null; } /** * This constructor is used by test cases checking assertion A7.12-39:
* The instance returned is initialized with the value of the primary key * field of the instance on which the method is called. * @param x * @param y */ public PCPointSingleFieldInteger(int x, int y) { this.x = x; this.y = new Integer(y); } public void setX(int x) { this.x = x; } public int getX() { return x; } public void setY(Integer y) { this.y = y; } public Integer getY() { return y; } public String name() { return " x: " + getX() + ", y: " + getY().intValue(); } /** * Returns true if the given the key of the given * SingleFieldIdentity instance equals the key in the subclass * of this class. * @param singleFieldIdentity the single field identity to check. * @return returns true if the given the key of the given * SingleFieldIdentity instance equals the key in the subclass * of this class. */ public boolean equalsPKField(SingleFieldIdentity singleFieldIdentity) { return this.id.intValue()==((IntIdentity)singleFieldIdentity).getKey(); } public String toString() { return super.toString() + this.id; } } tck/src/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldLong.java100664 6344 12500110372 30501 0ustarmbouschenstaff 0 0 /* * 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.singlefieldidentity; import javax.jdo.identity.LongIdentity; import javax.jdo.identity.SingleFieldIdentity; /** * The PC class for testing LongIdentity. * @author Michael Watzek */ public class PCPointSingleFieldLong extends AbstractPCPointSingleField { /** * Returns a unique value, used for primary key field initialization. * @return a unique value */ private static long newId() { synchronized (PCPointSingleFieldLong.class) { return counter++; } } /** * The primary key field. */ private Long id = new Long(newId()); public int x; public Integer y; /** * This constructor is used by test cases checking assertion A7.12-38:
* For classes using single field identity method * PersistenceCapable.newObjectIdInstance() must be called * on a persistent instance with its primary key field initialized, * or a JDOFatalInternalException is thrown. */ public PCPointSingleFieldLong() { this.id = null; } /** * This constructor is used by test cases checking assertion A7.12-39:
* The instance returned is initialized with the value of the primary key * field of the instance on which the method is called. * @param x * @param y */ public PCPointSingleFieldLong(int x, int y) { this.x = x; this.y = new Integer(y); } public void setX(int x) { this.x = x; } public int getX() { return x; } public void setY(Integer y) { this.y = y; } public Integer getY() { return y; } public String name() { return " x: " + getX() + ", y: " + getY().intValue(); } /** * Returns true if the given the key of the given * SingleFieldIdentity instance equals the key in the subclass * of this class. * @param singleFieldIdentity the single field identity to check. * @return returns true if the given the key of the given * SingleFieldIdentity instance equals the key in the subclass * of this class. */ public boolean equalsPKField(SingleFieldIdentity singleFieldIdentity) { return this.id.longValue()==((LongIdentity)singleFieldIdentity).getKey(); } public String toString() { return super.toString() + this.id; } } tck/src/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldPrimitivebyte.java100664 5543 12500110372 32436 0ustarmbouschenstaff 0 0 /* * 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.singlefieldidentity; import javax.jdo.identity.ByteIdentity; import javax.jdo.identity.SingleFieldIdentity; /** * The PC class for testing ByteIdentity. * @author Michael Watzek */ public class PCPointSingleFieldPrimitivebyte extends AbstractPCPointSingleField { /** * Returns a unique value, used for primary key field initialization. * @return a unique value */ private static byte newId() { synchronized (PCPointSingleFieldPrimitivebyte.class) { return (byte) ((counter++) % Byte.MAX_VALUE); } } /** * The primary key field. */ private byte id = newId(); public int x; public Integer y; /** * This constructor is used by test cases checking assertion A7.12-39:
* The instance returned is initialized with the value of the primary key * field of the instance on which the method is called. * @param x * @param y */ public PCPointSingleFieldPrimitivebyte(int x, int y) { this.x = x; this.y = new Integer(y); } public void setX(int x) { this.x = x; } public int getX() { return x; } public void setY(Integer y) { this.y = y; } public Integer getY() { return y; } public String name() { return " x: " + getX() + ", y: " + getY().intValue(); } /** * Returns true if the given the key of the given * SingleFieldIdentity instance equals the key in the subclass * of this class. * @param singleFieldIdentity the single field identity to check. * @return returns true if the given the key of the given * SingleFieldIdentity instance equals the key in the subclass * of this class. */ public boolean equalsPKField(SingleFieldIdentity singleFieldIdentity) { return this.id==((ByteIdentity)singleFieldIdentity).getKey(); } public String toString() { return super.toString() + this.id; } } tck/src/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldPrimitivechar.java100664 5550 12500110372 32406 0ustarmbouschenstaff 0 0 /* * 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.singlefieldidentity; import javax.jdo.identity.CharIdentity; import javax.jdo.identity.SingleFieldIdentity; /** * The PC class for testing CharIdentity. * @author Michael Watzek */ public class PCPointSingleFieldPrimitivechar extends AbstractPCPointSingleField { /** * Returns a unique value, used for primary key field initialization. * @return a unique value */ private static char newId() { synchronized (PCPointSingleFieldPrimitivechar.class) { return (char) ((counter++) % Character.MAX_VALUE); } } /** * The primary key field. */ private char id = newId(); public int x; public Integer y; /** * This constructor is used by test cases checking assertion A7.12-39:
* The instance returned is initialized with the value of the primary key * field of the instance on which the method is called. * @param x * @param y */ public PCPointSingleFieldPrimitivechar(int x, int y) { this.x = x; this.y = new Integer(y); } public void setX(int x) { this.x = x; } public int getX() { return x; } public void setY(Integer y) { this.y = y; } public Integer getY() { return y; } public String name() { return " x: " + getX() + ", y: " + getY().intValue(); } /** * Returns true if the given the key of the given * SingleFieldIdentity instance equals the key in the subclass * of this class. * @param singleFieldIdentity the single field identity to check. * @return returns true if the given the key of the given * SingleFieldIdentity instance equals the key in the subclass * of this class. */ public boolean equalsPKField(SingleFieldIdentity singleFieldIdentity) { return this.id==((CharIdentity)singleFieldIdentity).getKey(); } public String toString() { return super.toString() + this.id; } } tck/src/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldPrimitiveint.java100664 5535 12500110372 32266 0ustarmbouschenstaff 0 0 /* * 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.singlefieldidentity; import javax.jdo.identity.IntIdentity; import javax.jdo.identity.SingleFieldIdentity; /** * The PC class for testing IntIdentity. * @author Michael Watzek */ public class PCPointSingleFieldPrimitiveint extends AbstractPCPointSingleField { /** * Returns a unique value, used for primary key field initialization. * @return a unique value */ private static int newId() { synchronized (PCPointSingleFieldPrimitiveint.class) { return (int) ((counter++) % Integer.MAX_VALUE); } } /** * The primary key field. */ private int id = newId(); public int x; public Integer y; /** * This constructor is used by test cases checking assertion A7.12-39:
* The instance returned is initialized with the value of the primary key * field of the instance on which the method is called. * @param x * @param y */ public PCPointSingleFieldPrimitiveint(int x, int y) { this.x = x; this.y = new Integer(y); } public void setX(int x) { this.x = x; } public int getX() { return x; } public void setY(Integer y) { this.y = y; } public Integer getY() { return y; } public String name() { return " x: " + getX() + ", y: " + getY().intValue(); } /** * Returns true if the given the key of the given * SingleFieldIdentity instance equals the key in the subclass * of this class. * @param singleFieldIdentity the single field identity to check. * @return returns true if the given the key of the given * SingleFieldIdentity instance equals the key in the subclass * of this class. */ public boolean equalsPKField(SingleFieldIdentity singleFieldIdentity) { return this.id==((IntIdentity)singleFieldIdentity).getKey(); } public String toString() { return super.toString() + this.id; } } tck/src/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldPrimitivelong.java100664 5507 12500110372 32432 0ustarmbouschenstaff 0 0 /* * 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.singlefieldidentity; import javax.jdo.identity.LongIdentity; import javax.jdo.identity.SingleFieldIdentity; /** * The PC class for testing LongIdentity. * @author Michael Watzek */ public class PCPointSingleFieldPrimitivelong extends AbstractPCPointSingleField { /** * Returns a unique value, used for primary key field initialization. * @return a unique value */ private static long newId() { synchronized (PCPointSingleFieldPrimitivelong.class) { return counter++; } } /** * The primary key field. */ private long id = newId(); public int x; public Integer y; /** * This constructor is used by test cases checking assertion A7.12-39:
* The instance returned is initialized with the value of the primary key * field of the instance on which the method is called. * @param x * @param y */ public PCPointSingleFieldPrimitivelong(int x, int y) { this.x = x; this.y = new Integer(y); } public void setX(int x) { this.x = x; } public int getX() { return x; } public void setY(Integer y) { this.y = y; } public Integer getY() { return y; } public String name() { return " x: " + getX() + ", y: " + getY().intValue(); } /** * Returns true if the given the key of the given * SingleFieldIdentity instance equals the key in the subclass * of this class. * @param singleFieldIdentity the single field identity to check. * @return returns true if the given the key of the given * SingleFieldIdentity instance equals the key in the subclass * of this class. */ public boolean equalsPKField(SingleFieldIdentity singleFieldIdentity) { return this.id==((LongIdentity)singleFieldIdentity).getKey(); } public String toString() { return super.toString() + this.id; } } tck/src/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldPrimitiveshort.java100664 5555 12500110372 32635 0ustarmbouschenstaff 0 0 /* * 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.singlefieldidentity; import javax.jdo.identity.ShortIdentity; import javax.jdo.identity.SingleFieldIdentity; /** * The PC class for testing ShortIdentity. * @author Michael Watzek */ public class PCPointSingleFieldPrimitiveshort extends AbstractPCPointSingleField { /** * Returns a unique value, used for primary key field initialization. * @return a unique value */ private static short newId() { synchronized (PCPointSingleFieldPrimitiveshort.class) { return (short) ((counter++) % Short.MAX_VALUE); } } /** * The primary key field. */ private short id = newId(); public int x; public Integer y; /** * This constructor is used by test cases checking assertion A7.12-39:
* The instance returned is initialized with the value of the primary key * field of the instance on which the method is called. * @param x * @param y */ public PCPointSingleFieldPrimitiveshort(int x, int y) { this.x = x; this.y = new Integer(y); } public void setX(int x) { this.x = x; } public int getX() { return x; } public void setY(Integer y) { this.y = y; } public Integer getY() { return y; } public String name() { return " x: " + getX() + ", y: " + getY().intValue(); } /** * Returns true if the given the key of the given * SingleFieldIdentity instance equals the key in the subclass * of this class. * @param singleFieldIdentity the single field identity to check. * @return returns true if the given the key of the given * SingleFieldIdentity instance equals the key in the subclass * of this class. */ public boolean equalsPKField(SingleFieldIdentity singleFieldIdentity) { return this.id==((ShortIdentity)singleFieldIdentity).getKey(); } public String toString() { return super.toString() + this.id; } } tck/src/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldShort.java100664 6415 12500110372 30700 0ustarmbouschenstaff 0 0 /* * 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.singlefieldidentity; import javax.jdo.identity.ShortIdentity; import javax.jdo.identity.SingleFieldIdentity; /** * The PC class for testing ShortIdentity. * @author Michael Watzek */ public class PCPointSingleFieldShort extends AbstractPCPointSingleField { /** * Returns a unique value, used for primary key field initialization. * @return a unique value */ private static short newId() { synchronized (PCPointSingleFieldShort.class) { return (short) ((counter++) % Short.MAX_VALUE); } } /** * The primary key field. */ private Short id = new Short(newId()); public int x; public Integer y; /** * This constructor is used by test cases checking assertion A7.12-38:
* For classes using single field identity method * PersistenceCapable.newObjectIdInstance() must be called * on a persistent instance with its primary key field initialized, * or a JDOFatalInternalException is thrown. */ public PCPointSingleFieldShort() { this.id = null; } /** * This constructor is used by test cases checking assertion A7.12-39:
* The instance returned is initialized with the value of the primary key * field of the instance on which the method is called. * @param x * @param y */ public PCPointSingleFieldShort(int x, int y) { this.x = x; this.y = new Integer(y); } public void setX(int x) { this.x = x; } public int getX() { return x; } public void setY(Integer y) { this.y = y; } public Integer getY() { return y; } public String name() { return " x: " + getX() + ", y: " + getY().intValue(); } /** * Returns true if the given the key of the given * SingleFieldIdentity instance equals the key in the subclass * of this class. * @param singleFieldIdentity the single field identity to check. * @return returns true if the given the key of the given * SingleFieldIdentity instance equals the key in the subclass * of this class. */ public boolean equalsPKField(SingleFieldIdentity singleFieldIdentity) { return this.id.shortValue()==((ShortIdentity)singleFieldIdentity).getKey(); } public String toString() { return super.toString() + this.id; } } tck/src/java/org/apache/jdo/tck/pc/singlefieldidentity/PCPointSingleFieldString.java100664 6364 12500110372 31052 0ustarmbouschenstaff 0 0 /* * 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.singlefieldidentity; import javax.jdo.identity.SingleFieldIdentity; import javax.jdo.identity.StringIdentity; /** * The PC class for testing StringIdentity. * @author Michael Watzek */ public class PCPointSingleFieldString extends AbstractPCPointSingleField { /** * Returns a unique value, used for primary key field initialization. * @return a unique value */ private static long newId() { synchronized (PCPointSingleFieldString.class) { return counter++; } } /** * The primary key field. */ private String id = Long.toString(newId()); public int x; public Integer y; /** * This constructor is used by test cases checking assertion A7.12-38:
* For classes using single field identity method * PersistenceCapable.newObjectIdInstance() must be called * on a persistent instance with its primary key field initialized, * or a JDOFatalInternalException is thrown. */ public PCPointSingleFieldString() { this.id = null; } /** * This constructor is used by test cases checking assertion A7.12-39:
* The instance returned is initialized with the value of the primary key * field of the instance on which the method is called. * @param x * @param y */ public PCPointSingleFieldString(int x, int y) { this.x = x; this.y = new Integer(y); } public void setX(int x) { this.x = x; } public int getX() { return x; } public void setY(Integer y) { this.y = y; } public Integer getY() { return y; } public String name() { return " x: " + getX() + ", y: " + getY().intValue(); } /** * Returns true if the given the key of the given * SingleFieldIdentity instance equals the key in the subclass * of this class. * @param singleFieldIdentity the single field identity to check. * @return returns true if the given the key of the given * SingleFieldIdentity instance equals the key in the subclass * of this class. */ public boolean equalsPKField(SingleFieldIdentity singleFieldIdentity) { return this.id.equals(((StringIdentity)singleFieldIdentity).getKey()); } public String toString() { return super.toString() + this.id; } } tck/src/java/org/apache/jdo/tck/pc/singlefieldidentity/Person.java100664 10561 12500110372 25521 0ustarmbouschenstaff 0 0 /* * 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.singlefieldidentity; import java.io.Serializable; import java.text.SimpleDateFormat; import java.util.Date; /** * This class represents a person. */ public class Person implements Serializable { private long id; private String firstname; private String lastname; private String middlename; private Date birthdate; protected static SimpleDateFormat formatter = new SimpleDateFormat("d/MMM/yyyy"); /** This is the JDO-required no-args constructor. */ protected Person() {} /** * Construct a Person instance. * @param id The person identifier. * @param firstname The person's first name. * @param lastname The person's last name. * @param middlename The person's middle name. * @param birthdate The person's birthdate. */ public Person(long personid, String firstname, String lastname, String middlename, Date birthdate) { this.id = personid; this.firstname = firstname; this.lastname = lastname; this.middlename = middlename; this.birthdate = birthdate; } /** * Set the id associated with this object. * @param id the id. */ public void setPersonid(long id) { if (this.id != 0) throw new IllegalStateException("Id is already set."); this.id = id; } /** * Get the person's id. * @return The id. */ public long getPersonid() { return id; } /** * Get the person's last name. * @return The last name. */ public String getLastname() { return lastname; } /** * Set the person's last name. * @param lastname The last name. */ public void setLastname(String lastname) { this.lastname = lastname; } /** * Get the person's first name. * @return The first name. */ public String getFirstname() { return firstname; } /** * Set the person's first name. * @param firstname The first name. */ public void setFirstname(String firstname) { this.firstname = firstname; } /** * Get the person's middle name. * @return The middle name. */ public String getMiddlename() { return middlename; } /** * Set the person's middle name. * @param middlename The middle name. */ public void setMiddlename(String middlename) { this.middlename = middlename; } /** * Get the person's birthdate. * @return The person's birthdate. */ public Date getBirthdate() { return birthdate; } /** * Set the person's birthdate. * @param birthdate The person's birthdate. */ public void setBirthdate(Date birthdate) { this. birthdate = birthdate; } /** * Returns a String representation of a Person object. * @return a string representation of a Person object. */ @Override public String toString() { return "Person(" + getFieldRepr() + ")"; } /** * Returns a String representation of the non-relationship fields. * @return a String representation of the non-relationship fields. */ protected String getFieldRepr() { StringBuffer rc = new StringBuffer(); rc.append(id); rc.append(", ").append(lastname); rc.append(", ").append(firstname); rc.append(", born ").append( birthdate==null ? "null" : formatter.format(birthdate)); return rc.toString(); } } tck/src/java/org/apache/jdo/tck/query/api/ChangeQuery.java100664 7504 12500110373 23727 0ustarmbouschenstaff 0 0 /* * 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.query.api; import java.math.BigDecimal; import java.util.Arrays; import java.util.List; import javax.jdo.Query; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.FullTimeEmployee; import org.apache.jdo.tck.pc.company.Person; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.query.result.classes.FullName; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Change Query. *
*Keywords: query *
*Assertion ID: A14.5-15. *
*Assertion Description: * The Query instance returned from this method can be modified * by the application, just like any other Query instance. */ public class ChangeQuery extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.5-15 (ChangeQuery) failed: "; /** * The main 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(ChangeQuery.class); } /** */ public void testPositive() { Query query = getPM().newNamedQuery(Person.class, "changeQuery"); // change query query.setResult("DISTINCT firstname, lastname"); query.setResultClass(FullName.class); query.setClass(FullTimeEmployee.class); String filter = "salary > 1000 & projects.contains(p) & " + "p.budget > limit"; query.setFilter(filter); String imports = "import org.apache.jdo.tck.pc.company.Project; " + "import java.math.BigDecimal;"; query.declareImports(imports); query.declareVariables("Project p"); query.declareParameters("BigDecimal limit"); query.setOrdering("firstname ASCENDING, lastname ASCENDING"); query.setRange(0, 5); String singleStringQuery = "SELECT DISTINCT firstname, lastname " + "INTO FullName FROM FullTimeEmployee " + "WHERE salary > 1000 & projects.contains(p) & " + "p.budget > limit " + "VARIABLES Project p PARAMETERS BigDecimal limit " + "ORDER BY firstname ASCENDING, lastname ASCENDING RANGE 0, 5"; // query parameters Object[] parameters = {new BigDecimal("2000")}; // expected result List expectedResult = Arrays.asList(new Object[] { new FullName("emp1First", "emp1Last"), new FullName("emp2First", "emp2Last"), new FullName("emp5First", "emp5Last")}); // execute query executeJDOQuery(ASSERTION_FAILED, query, singleStringQuery, true, parameters, expectedResult, true); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/api/Close.java100664 10725 12500110373 22600 0ustarmbouschenstaff 0 0 /* * 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.query.api; import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import java.util.List; import java.util.NoSuchElementException; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Close *
*Keywords: query *
*Assertion ID: A14.6.7-1. *
*Assertion Description: Query.close(Object) closes the *result of one execute(...) method, and releases resources *associated with it. After this method completes, the query result can no *longer be used, for example to iterate the returned elements. Any elements *returned previously by iteration of the results remain in their current state. *Any iterators acquired from the queryResult will return false to *hasNext() and will throw NoSuchElementException to *next(). */ public class Close extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.7-1 (Close) failed: "; /** * The main 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(Close.class); } /** */ public void testPositive() { PersistenceManager pm = getPM(); if (debug) logger.debug("\nExecuting test Close()..."); Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(); query.setClass(PCPoint.class); query.setCandidates(pm.getExtent(PCPoint.class, false)); Object results = query.execute(); // check query result List expected = new ArrayList(); Object p1 = new PCPoint(0, 0); Object p2 = new PCPoint(1, 1); Object p3 = new PCPoint(2, 2); Object p4 = new PCPoint(3, 3); Object p5 = new PCPoint(4, 4); expected.add(p1); expected.add(p2); expected.add(p3); expected.add(p4); expected.add(p5); expected = getFromInserted(expected); // printOutput(results); checkQueryResultWithoutOrder(ASSERTION_FAILED, results, expected); if (debug) logger.debug("Test Close: Results are as expected and accessible before query is closed"); Iterator resIterator = ((Collection)results).iterator(); query.close(results); if(resIterator.hasNext()) { fail(ASSERTION_FAILED, "Iterator.hasNext() should return false after closing the query result."); } try { resIterator.next(); fail(ASSERTION_FAILED, "Iterator.hasNext() should throw NoSuchElementException after closing the query result."); } catch (NoSuchElementException ex) { // expected exception } tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint.class); loadAndPersistPCPoints(getPM()); } } tck/src/java/org/apache/jdo/tck/query/api/CloseAll.java100664 6545 12500110373 23216 0ustarmbouschenstaff 0 0 /* * 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.query.api; import java.util.Collection; import java.util.Iterator; import java.util.NoSuchElementException; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Close All *
*Keywords: query *
*Assertion ID: A14.6.7-2. *
*Assertion Description: Query.closeAll() closes all results of execute(...) methods on this Query instance, as in A14.6.7-1. The Query instance is still valid and can still be used. */ public class CloseAll extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.7-2 (CloseAll) failed: "; /** * The main 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(CloseAll.class); } /** */ public void testPositive() { PersistenceManager pm = getPM(); if (debug) logger.debug("\nExecuting test CloseAll()..."); Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(); query.setClass(PCPoint.class); query.setCandidates(pm.getExtent(PCPoint.class, false)); Collection results = (Collection)query.execute(); Iterator resIterator = results.iterator(); query.closeAll(); if (resIterator.hasNext()) { fail(ASSERTION_FAILED, "Iterator.hasNext() should return false after closing all query results."); } try { resIterator.next(); fail(ASSERTION_FAILED, "Iterator.hasNext() should throw NoSuchElementException after closing all query results."); } catch (NoSuchElementException ex) { // expected exception } tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint.class); loadAndPersistPCPoints(getPM()); } } tck/src/java/org/apache/jdo/tck/query/api/CompileQuery.java100664 6531 12500110373 24131 0ustarmbouschenstaff 0 0 /* * 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.query.api; import java.util.ArrayList; import java.util.List; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Compile Query *
*Keywords: query *
*Assertion ID: A14.6-14. *
*Assertion Description: Query.compile() requires the Query instance to validate any elements bound to the query instance and report any inconsistencies by throwing a JDOUserException. It is only a hint to the Query instance to prepare and optimize an execution plan for the query, implementations are not required to support query compilation. */ public class CompileQuery extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6-14 (CompileQuery) failed: "; /** * The main 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(CompileQuery.class); } /** */ public void testPositive() { PersistenceManager pm = getPM(); Transaction tx = pm.currentTransaction(); try { tx.begin(); String params = "Integer param"; Query query = pm.newQuery(); query.setClass(PCPoint.class); query.setCandidates(pm.getExtent(PCPoint.class, false)); query.declareParameters(params); query.setFilter("x == param"); query.compile(); Object results = query.execute(new Integer(4)); // check query result List expected = new ArrayList(); Object p5 = new PCPoint(4, 4); expected.add(p5); expected = getFromInserted(expected); printOutput(results, expected); checkQueryResultWithoutOrder(ASSERTION_FAILED, "x == param", results, expected); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint.class); loadAndPersistPCPoints(getPM()); } } tck/src/java/org/apache/jdo/tck/query/api/DeclareImports.java100664 12327 12500110373 24450 0ustarmbouschenstaff 0 0 /* * 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.query.api; import java.util.ArrayList; import java.util.List; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.pc.company.Department; import org.apache.jdo.tck.pc.company.Company; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.util.ConversionHelper; /** *Title: Declare Imports *
*Keywords: query *
*Assertion ID: A14.6-8. *
*Assertion Description: Query.declareImports(String imports) binds the import statements to the query instance. All imports must be declared in the same method call, and the imports must be separated by semicolons. */ public class DeclareImports extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6-8 (DeclareImports) failed: "; /** * The main 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(DeclareImports.class); } /** */ public void test() { pm = getPM(); runTestDeclareImports01(pm); runTestDeclareImports02(pm); runTestDeclareImports03(pm); pm.close(); pm = null; } private void runTestDeclareImports01(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(); query.setClass(PCPoint.class); query.setCandidates(pm.getExtent(PCPoint.class, false)); query.declareImports("import java.lang.Integer"); query.declareParameters("Integer param"); query.setFilter("y == param"); Object results = query.execute(new Integer(2)); // check query result List expected = new ArrayList(); Object p3 = new PCPoint(2, 2); expected.add(p3); expected = getFromInserted(expected); printOutput(results, expected); checkQueryResultWithoutOrder(ASSERTION_FAILED, "y == param", results, expected); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ private void runTestDeclareImports02(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(); query.setClass(Department.class); query.setCandidates(pm.getExtent(Department.class, false)); query.declareImports("import org.apache.jdo.tck.pc.company.Employee"); query.declareVariables("Employee e" ); query.setFilter("employees.contains(e) && e.firstname==\"Michael\"" ); Object results = query.execute(); // Just check whether query with import declaration compiles tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ private void runTestDeclareImports03(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(); query.setClass(Company.class); query.setCandidates(pm.getExtent(Company.class, false)); query.declareImports("import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.pc.company.Department"); query.declareVariables("Department d; Employee e" ); query.setFilter("departments.contains(d) && (d.employees.contains(e) && e.firstname==\"Michael\")"); Object results = query.execute(); // Just check whether query with import declarations compiles tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint.class); loadAndPersistPCPoints(getPM()); } } tck/src/java/org/apache/jdo/tck/query/api/DeclareParameters.java100664 12666 12500110373 25124 0ustarmbouschenstaff 0 0 /* * 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.query.api; import java.util.ArrayList; import java.util.List; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Declare Parameters *
*Keywords: query *
*Assertion ID: A14.6-10. *
*Assertion Description: Query.declareParameters(String parameters) binds the parameter statements to the query instance. This method defines the parameter types and names which will be used by a subsequent execute method. */ public class DeclareParameters extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6-10 (DeclareParameters) failed: "; /** * The main 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(DeclareParameters.class); } /** */ public void testPositive() { PersistenceManager pm = getPM(); runTestDeclareParameters01(pm); runTestDeclareParameters02(pm); runTestDeclareParameters03(pm); } /** */ private void runTestDeclareParameters01(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(); query.setClass(PCPoint.class); query.setCandidates(pm.getExtent(PCPoint.class, false)); query.declareParameters("Integer param"); query.setFilter("x == param"); Object results = query.execute(new Integer(2)); // check query result List expected = new ArrayList(); Object p3 = new PCPoint(2, 2); expected.add(p3); expected = getFromInserted(expected); printOutput(results, expected); checkQueryResultWithoutOrder(ASSERTION_FAILED, "x == param", results, expected); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ private void runTestDeclareParameters02(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(); query.setClass(PCPoint.class); query.setCandidates(pm.getExtent(PCPoint.class, false)); query.declareParameters("Integer param1, Integer param2"); query.setFilter("x == param1 && y == param2"); Object results = query.execute(new Integer(2), new Integer(2)); // check query result List expected = new ArrayList(); Object p3 = new PCPoint(2, 2); expected.add(p3); expected = getFromInserted(expected); printOutput(results, expected); checkQueryResultWithoutOrder(ASSERTION_FAILED, "x == param1 && y == param2", results, expected); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ void runTestDeclareParameters03(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(); query.setClass(PCPoint.class); query.setCandidates(pm.getExtent(PCPoint.class, false)); query.declareParameters("int a, int b"); query.setFilter("x == a && y == b"); Object results = query.execute(new Integer(1), new Integer(1)); // check query result List expected = new ArrayList(); Object p = new PCPoint(1, 1); expected.add(p); expected = getFromInserted(expected); printOutput(results, expected); checkQueryResultWithoutOrder(ASSERTION_FAILED, "x == a && y == b", results, expected); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint.class); loadAndPersistPCPoints(getPM()); } } tck/src/java/org/apache/jdo/tck/query/api/DeclareVariables.java100664 7303 12500110373 24701 0ustarmbouschenstaff 0 0 /* * 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.query.api; import java.util.ArrayList; import java.util.List; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.company.Department; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Declare Variables *
*Keywords: query *
*Assertion ID: A14.6-9. *
*Assertion Description: Query.declareVariables(String variables) binds the unbound variable statements to the query instance. This method defines the types and names of variables that will be used in the filter but not provided as values by the execute method. */ public class DeclareVariables extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6-9 (DeclareVariables) failed: "; /** * The main 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(DeclareVariables.class); } /** */ public void test() { pm = getPM(); runTestDeclareVariables01(pm); runTestDeclareVariables02(pm); pm.close(); pm = null; } /** */ private void runTestDeclareVariables01(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(); query.setClass(Department.class); query.setCandidates(pm.getExtent(Department.class, false)); query.declareVariables("org.apache.jdo.tck.pc.company.Employee e" ); query.setFilter("employees.contains(e) && e.firstname==\"Michael\"" ); Object results = query.execute(); // Just check whether query compiles tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ private void runTestDeclareVariables02(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(); query.setClass(Department.class); query.setCandidates(pm.getExtent(Department.class, false)); query.declareVariables("org.apache.jdo.tck.pc.company.Employee e; org.apache.jdo.tck.pc.company.Project p;"); query.setFilter("employees.contains(e) && (e.projects.contains(p) && p.projid == 1)"); Object results = query.execute(); // Just check whether query compiles tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/query/api/ExecuteQuery.java100664 13154 12500110373 24162 0ustarmbouschenstaff 0 0 /* * 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.query.api; import java.util.ArrayList; import java.util.List; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Execute Query *
*Keywords: query *
*Assertion ID: A14.6.1-3. *
*Assertion Description: The Query.execute methods execute * the query using the parameters and return the result, which is a collection * of instances that satisfy the boolean filter. Each parameter of the * execute method(s) is an object which is either the value of the * corresponding parameter or the wrapped value of a primitive parameter. */ public class ExecuteQuery extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.1-3 (ExecuteQuery) failed: "; /** * The main 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(ExecuteQuery.class); } /** */ public void testPositive() { PersistenceManager pm = getPM(); runTestExecuteQuery01(pm); runTestExecuteQuery02(pm); runTestExecuteQuery03(pm); } /** */ private void runTestExecuteQuery01(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(); query.setClass(PCPoint.class); query.setCandidates(pm.getExtent(PCPoint.class, false)); query.setFilter("x == 4"); Object results = query.execute(); // check query result List expected = new ArrayList(); Object p5 = new PCPoint(4, 4); expected.add(p5); expected = getFromInserted(expected); printOutput(results, expected); checkQueryResultWithoutOrder(ASSERTION_FAILED, "x == 4", results, expected); tx.commit(); tx = null; if (debug) logger.debug ("Test ExecuteQuery01 - Passed\n"); } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ private void runTestExecuteQuery02(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(); query.setClass(PCPoint.class); query.setCandidates(pm.getExtent(PCPoint.class, false)); query.declareParameters("Integer param"); query.setFilter("x == param"); Object results = query.execute(new java.lang.Integer(2)); // check query result List expected = new ArrayList(); Object p3 = new PCPoint(2, 2); expected.add(p3); expected = getFromInserted(expected); printOutput(results, expected); checkQueryResultWithoutOrder(ASSERTION_FAILED, "x == param", results, expected); tx.commit(); tx = null; if (debug) logger.debug("Test ExecuteQuery02 - Passed\n"); } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ private void runTestExecuteQuery03(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(); query.setClass(PCPoint.class); query.setCandidates(pm.getExtent(PCPoint.class, false)); query.declareParameters("Integer param1, Integer param2"); query.setFilter("x == param1 && y == param2"); Object results = query.execute(new Integer(2), new Integer(2)); // check query result List expected = new ArrayList(); Object p3 = new PCPoint(2, 2); expected.add(p3); expected = getFromInserted(expected); printOutput(results, expected); checkQueryResultWithoutOrder(ASSERTION_FAILED, "x == param1 && y == param2", results, expected); tx.commit(); tx = null; if (debug) logger.debug("Test ExecuteQuery03 - Passed\n"); } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint.class); loadAndPersistPCPoints(getPM()); } } tck/src/java/org/apache/jdo/tck/query/api/ExecuteQueryWithArray.java100664 11530 12500110373 26011 0ustarmbouschenstaff 0 0 /* * 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.query.api; import java.util.ArrayList; import java.util.List; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Execute Query with Array *
*Keywords: query *
*Assertion ID: A14.6.1-6. *
*Assertion Description: The executeWithArray method is *similar to the execute method, but takes its parameters from an *array instance. The array contains Objects, in which the *positional Object is the value to use in the query for that *parameter. Unlike execute, there is no limit on the number of *parameters. */ public class ExecuteQueryWithArray extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.1-6 (ExecuteQueryWithArray) failed: "; /** * The main 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(ExecuteQueryWithArray.class); } /** */ public void testPositive() { PersistenceManager pm = getPM(); runTestExecuteQueryWithArray01(pm); runTestExecuteQueryWithArray02(pm); } /** */ private void runTestExecuteQueryWithArray01(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(); query.setClass(PCPoint.class); query.setCandidates(pm.getExtent(PCPoint.class, false)); query.declareParameters("Integer param"); query.setFilter("x == param"); Object[] actualParams = { new Integer(2) }; Object results = query.executeWithArray(actualParams); // check query result List expected = new ArrayList(); Object p3 = new PCPoint(2, 2); expected.add(p3); expected = getFromInserted(expected); printOutput(results, expected); checkQueryResultWithoutOrder(ASSERTION_FAILED, "x == param", results, expected); tx.commit(); tx = null; if (debug) logger.debug ("Test ExecuteQueryWithArray01 - Passed\n"); } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ private void runTestExecuteQueryWithArray02(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(); query.setClass(PCPoint.class); query.setCandidates(pm.getExtent(PCPoint.class, false)); query.declareParameters("Integer param1, Integer param2"); query.setFilter("x == param1 && y == param2"); Object[] actualParams = { new Integer(2), new Integer(2) }; Object results = query.executeWithArray(actualParams); // check query result List expected = new ArrayList(); Object p3 = new PCPoint(2, 2); expected.add(p3); expected = getFromInserted(expected); printOutput(results, expected); checkQueryResultWithoutOrder(ASSERTION_FAILED, "x == param1 && y == param2", results, expected); tx.commit(); tx = null; if (debug) logger.debug ("Test ExecuteQueryWithArray02 - Passed\n"); } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint.class); loadAndPersistPCPoints(getPM()); } } tck/src/java/org/apache/jdo/tck/query/api/ExecuteQueryWithMap.java100664 12012 12500110373 25444 0ustarmbouschenstaff 0 0 /* * 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.query.api; import java.util.ArrayList; import java.util.List; import java.util.Map; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Execute Query with Map *
*Keywords: query *
*Assertion ID: A14.6.1-5. *
*Assertion Description: The Query.executeWithMap method is *similar to the execute method, but takes its parameters from a *Map instance. The Map contains key/value pairs, *in which the key is the declared parameter name, and the value is the value *to use in the query for that parameter. Unlike execute, there is *no limit on the number of parameters. */ public class ExecuteQueryWithMap extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.1-5 (ExecuteQueryWithMap) failed: "; /** * The main 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(ExecuteQueryWithMap.class); } /** */ public void testPositive() { PersistenceManager pm = getPM(); runTestExecuteQueryWithMap01(pm); runTestExecuteQueryWithMap02(pm); } /** */ private void runTestExecuteQueryWithMap01(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(); query.setClass(PCPoint.class); query.setCandidates(pm.getExtent(PCPoint.class, false)); query.declareParameters("Integer param"); query.setFilter("x == param"); Map actualParams = new java.util.HashMap(); actualParams.put("param", new Integer(2) ); Object results = query.executeWithMap(actualParams); // check query result List expected = new ArrayList(); Object p3 = new PCPoint(2, 2); expected.add(p3); expected = getFromInserted(expected); printOutput(results, expected); checkQueryResultWithoutOrder(ASSERTION_FAILED, "x == param", results, expected); tx.commit(); tx = null; if (debug) logger.debug("Test ExecuteQueryWithMap01 - Passed\n"); } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ private void runTestExecuteQueryWithMap02(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(); query.setClass(PCPoint.class); query.setCandidates(pm.getExtent(PCPoint.class, false)); query.declareParameters("Integer param1, Integer param2"); query.setFilter("x == param1 && y == param2"); Map actualParams = new java.util.HashMap(); actualParams.put("param1", new Integer(2) ); actualParams.put("param2", new Integer(2) ); Object results = query.executeWithMap(actualParams); // check query result List expected = new ArrayList(); Object p3 = new PCPoint(2, 2); expected.add(p3); expected = getFromInserted(expected); printOutput(results, expected); checkQueryResultWithoutOrder(ASSERTION_FAILED, "x == param1 && y == param2", results, expected); tx.commit(); tx = null; if (debug) logger.debug("Test ExecuteQueryWithMap02 - Passed\n"); } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint.class); loadAndPersistPCPoints(getPM()); } } tck/src/java/org/apache/jdo/tck/query/api/GetFetchPlan.java100664 10413 12500110373 24031 0ustarmbouschenstaff 0 0 /* * 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.query.api; import java.util.Collection; import javax.jdo.FetchPlan; import javax.jdo.Query; import org.apache.jdo.tck.pc.mylib.PCClass; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Get Fetch Plan. *
*Keywords: query *
*Assertion ID: A14.6-21. *
*Assertion Description: * This method retrieves the fetch plan associated with the Query. * It always returns the identical instance for the same Query instance. * Any change made to the fetch plan affects subsequent query execution. */ public class GetFetchPlan extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6-21 (FetchPan) failed: "; private String FETCH_GROUP_1 = "fetchGroup1"; private String FETCH_GROUP_2 = "fetchGroup2"; /** * The main 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(GetFetchPlan.class); } /** */ private Query createQuery() { Query query = getPM().newQuery(PCClass.class, "true"); query.getFetchPlan().setGroup(FETCH_GROUP_1); return query; } /** */ public void testFetchGroup1() { // localSetUp closes the PM Query query = createQuery(); checkSameFetchPlanInstances(query); checkFetchGroup1(query); cleanupPM(); } public void testFetchGroup2() { // localSetUp closes the PM Query query = createQuery(); checkFetchGroup2(query); checkFetchGroup1(query); } private void checkSameFetchPlanInstances(Query query) { FetchPlan fetchPlan1 = query.getFetchPlan(); FetchPlan fetchPlan2 = query.getFetchPlan(); if (fetchPlan1 != fetchPlan2) { fail(ASSERTION_FAILED + "Calling getFetchPlan twice on the same " + "query instance results in two different fetch plan instances."); } } /** * Checks if the given query loads fields * assigned to fetchGroup1 * @param query the query */ private void checkFetchGroup1(Query query) { FetchPlan fetchplan = query.getFetchPlan(); Collection fetchgroups = fetchplan.getGroups(); assertTrue("FetchPlan should include fetchGroup1 and not fetchGroup2", fetchgroups.contains(FETCH_GROUP_1) && !fetchgroups.contains(FETCH_GROUP_2)); } /** * Checks if the given query loads fields assigned * to "fetchGroup1" plus fetch group "fetchGroup2". * For this purpose, the method temporarily adds fetch group "fetchGroup2" * to the fetch plan of the given query instance. * That fetch group loads field number2. * Finally, that fetch group is removed from the fetch plan again. * @param query the query */ private void checkFetchGroup2(Query query) { FetchPlan fetchplan = query.getFetchPlan(); fetchplan.addGroup(FETCH_GROUP_2); Collection fetchgroups = fetchplan.getGroups(); try { assertTrue("FetchPlan should include fetchGroup1 and fetchGroup2", fetchgroups.contains(FETCH_GROUP_1) && fetchgroups.contains(FETCH_GROUP_2)); } finally { query.getFetchPlan().removeGroup(FETCH_GROUP_2); } } } tck/src/java/org/apache/jdo/tck/query/api/GetIgnoreCache.java100664 10710 12500110373 24334 0ustarmbouschenstaff 0 0 /* * 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.query.api; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Get IgnoreCache *
*Keywords: query *
*Assertion ID: A14.6-13. *
*Assertion Description: Query.getIgnoreCache returns the *current setting of the IgnoreCache option. */ public class GetIgnoreCache extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6-13 (GetIgnoreCache) failed: "; /** * The main 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(GetIgnoreCache.class); } /** */ public void test() throws Exception { pmf = getPMF(); pm = getPM(); runTestGetIgnoreCache01(pm); runTestGetIgnoreCache02(pm); pm.close(); pm = null; } /** */ void runTestGetIgnoreCache01(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(); // the ignoreCache flag of PM must default to the PMF setting if (pm.getIgnoreCache() == pmf.getIgnoreCache()) { if (debug) logger.debug("PM ignoreCache defaults to the PMF setting."); } else { fail(ASSERTION_FAILED, "PM ignoreCache does NOT default to the PMF setting."); } // the ignoreCache flag of Query must default to the setting in PM if (query.getIgnoreCache() == pm.getIgnoreCache()) { if (debug) logger.debug("Query ignoreCache defaults to the PM setting."); } else { fail(ASSERTION_FAILED, "Query ignoreCache does NOT default to the PM setting."); } tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ void runTestGetIgnoreCache02(PersistenceManager pm) { boolean ignoreCacheDefault = pmf.getIgnoreCache(); // set PM's ignoreCache to a different value pm.setIgnoreCache(!ignoreCacheDefault); Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(); // Query.ignoreCache must be equal to the new value in PM if (query.getIgnoreCache() == !ignoreCacheDefault) { if (debug) logger.debug("Query ignoreCache flag is equal to new PM setting."); } else { fail(ASSERTION_FAILED, "Query ignoreCache flag is NOT equal to new PM setting."); } // change the Query's ignoreCache flag query.setIgnoreCache(ignoreCacheDefault); if (query.getIgnoreCache() == ignoreCacheDefault) { if (debug) logger.debug("Query ignoreCache flag successfully changed"); } else { fail(ASSERTION_FAILED, "Could NOT change the Query's ignoreCache flag."); } tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/query/api/GetPersistenceManager.java100664 7716 12500110373 25740 0ustarmbouschenstaff 0 0 /* * 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.query.api; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Get PersistenceManager *
*Keywords: query *
*Assertion ID: A14.6-2. *
*Assertion Description: Query.getPersistenceManager() *returns the associated PersistenceManager instance. */ public class GetPersistenceManager extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6-2 (GetPersistenceManager) failed: "; /** * The main 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(GetPersistenceManager.class); } /** */ public void test() { pm = getPM(); runTestGetPersistenceManager01(pm); runTestGetPersistenceManager02(pm); pm.close(); pm = null; } /** */ void runTestGetPersistenceManager01(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.setOptimistic(false); tx.begin(); Query query = pm.newQuery(); query.setClass(PCPoint.class); query.setCandidates(pm.getExtent(PCPoint.class, false)); PersistenceManager pm1 = query.getPersistenceManager(); if(pm.equals(pm1)) { if (debug) logger.debug("Pessimistic: GetPersistenceManager Test: Passed."); } else { fail(ASSERTION_FAILED, "Pessimistic: query.getPersistenceManager() returned different pm than the one it was created from."); } query.compile(); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ void runTestGetPersistenceManager02(PersistenceManager pm) { if (!isOptimisticSupported()) return; Transaction tx = pm.currentTransaction(); try { tx.setOptimistic(true); tx.begin(); Query query = pm.newQuery(); query.setClass(PCPoint.class); query.setCandidates(pm.getExtent(PCPoint.class, false)); PersistenceManager pm1 = query.getPersistenceManager(); if(pm.equals(pm1)) { if (debug) logger.debug("Optimistic: GetPersistenceManager Test: Passed"); } else { fail(ASSERTION_FAILED, "Optimistic: query.getPersistenceManager() returned different pm than the one it was created from."); } query.compile(); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/query/api/GetPersistenceManagerFromRestoredSerializedQuery.java100664 10476 12500110373 33353 0ustarmbouschenstaff 0 0 /* * 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.query.api; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import javax.jdo.PersistenceManager; import javax.jdo.Query; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Get PersistenceManager From Restored Serialized Query *
*Keywords: query *
*Assertion ID: A14.6-3. *
*Assertion Description: If a Query instance has been restored from a serialized form, Query.getPersistenceManager() returns null. */ public class GetPersistenceManagerFromRestoredSerializedQuery extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6-3 (GetPersistenceManagerFromRestoredSerializedQuery) failed: "; /** * The main 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(GetPersistenceManagerFromRestoredSerializedQuery.class); } /** */ public void test() throws Exception { pm = getPM(); // initDatabase(pm, PCPoint.class); runTestGetPersistenceManagerFromRestoredSerializedQuery(pm); pm.close(); pm = null; } /** */ void serializeQuery(PersistenceManager pm) throws Exception { Query query = pm.newQuery(); query.setClass(PCPoint.class); query.setCandidates(pm.getExtent(PCPoint.class, false)); query.setFilter("x == 3"); query.compile(); ObjectOutputStream oos = null; try { if (debug) logger.debug("Attempting to serialize Query object."); oos = new ObjectOutputStream(new FileOutputStream(SERIALZED_QUERY)); oos.writeObject(query); if (debug) logger.debug("Query object serialized."); } finally { if (oos != null) { try { oos.close();} catch(Exception ex) {} } } } /** */ void runTestGetPersistenceManagerFromRestoredSerializedQuery( PersistenceManager pm) throws Exception { if (debug) logger.debug("\nExecuting test GetPersistenceManagerFromRestoredSerializedQuery() ..."); Query restoredQuery = null; ObjectInputStream ois = null; PersistenceManager pm1 = null; serializeQuery(pm); try { if (debug) logger.debug("Attempting to de-serialize Query object."); ois = new ObjectInputStream(new FileInputStream(SERIALZED_QUERY)); restoredQuery = (Query)ois.readObject(); if (restoredQuery == null) { fail(ASSERTION_FAILED, "Deserialzed query is null"); } if (debug) logger.debug("Query object restored."); } finally { if (ois != null) { try { ois.close(); } catch(Exception ex) {} } } pm1 = restoredQuery.getPersistenceManager(); if (pm1 == null) { if (debug) logger.debug("Test GetPersistenceManagerFromRestoredSerializedQuery(): Passed"); } else { fail(ASSERTION_FAILED, "Deserialzed query instance should not have a pm associated"); } } } tck/src/java/org/apache/jdo/tck/query/api/InvalidNamedQuery.java100664 4061 12500110373 25070 0ustarmbouschenstaff 0 0 /* * 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.query.api; import javax.jdo.JDOUserException; import org.apache.jdo.tck.pc.company.Person; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Invalid Named Query. *
*Keywords: query *
*Assertion ID: A14.5-16. *
*Assertion Description: * Named queries must be compilable. Attempts to get a named query * that cannot be compiled result in JDOUserException. */ public class InvalidNamedQuery extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.5-16 (InvalidNamedQuery) failed: "; /** * The main 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(InvalidNamedQuery.class); } /** */ public void testNegative() { try { getPM().newNamedQuery(Person.class, "invalidQuery"); fail(ASSERTION_FAILED + "Lookup of named query 'invalidQuery' " + " succeeded, though the query is not compilable."); } catch (JDOUserException e) { } } } tck/src/java/org/apache/jdo/tck/query/api/MetadataSearchOrder.java100664 10341 12500110373 25367 0ustarmbouschenstaff 0 0 /* * 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.query.api; import javax.jdo.Query; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Person; import org.apache.jdo.tck.pc.mylib.MylibReader; import org.apache.jdo.tck.pc.mylib.PCClass; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Metadata Search Order. *
*Keywords: query *
*Assertion ID: A14.5-13. *
*Assertion Description: * If the named query is not found in already-loaded metadata, * the query is searched for using an algorithm. * Files containing metadata are examined in turn until the query is found. * The order is based on the metadata search order for class metadata, * but includes files named based on the query name. */ public class MetadataSearchOrder extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.5-13 (MetadataSearchOrder) failed: "; /** * The expected results of valid queries. */ private Object[] expectedResult = { getTransientCompanyModelInstancesAsList(new String[]{ "emp1", "emp2", "emp3", "emp4", "emp5"}), getTransientCompanyModelInstancesAsList(new String[]{ "emp2", "emp3", "emp4", "emp5"}), getTransientMylibInstancesAsList(new String[]{ "pcClass1", "pcClass2"}), getTransientCompanyModelInstancesAsList(new String[]{ "emp3", "emp4", "emp5"}), getTransientCompanyModelInstancesAsList(new String[]{ "emp4", "emp5"}) }; /** * The main 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(MetadataSearchOrder.class); } /** */ public void testPackageJDOInDefaultPackage() { int index = 0; executeNamedQuery(null, "packageJDOInDefaultPackage", expectedResult[index]); } /** */ public void testPackageJDO() { int index = 1; executeNamedQuery(Person.class, "packageJDO", expectedResult[index]); } /** */ public void testClassJDO() { int index = 2; executeNamedQuery(PCClass.class, "classJDO", expectedResult[index]); } /** */ public void testPackageORM() { int index = 3; executeNamedQuery(Person.class, "packageORM", expectedResult[index]); } /** */ public void testClassJDOQuery() { int index = 4; executeNamedQuery(Person.class, "classJDOQuery", expectedResult[index]); } private void executeNamedQuery(Class candidateClass, String namedQuery, Object expectedResult) { Query query = getPM().newNamedQuery(candidateClass, namedQuery); executeJDOQuery(ASSERTION_FAILED, query, "Named query " + namedQuery, false, null, expectedResult, true); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); addTearDownClass(MylibReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); loadAndPersistMylib(getPM()); } } tck/src/java/org/apache/jdo/tck/query/api/NamedQueryNotFound.java100664 4067 12500110373 25244 0ustarmbouschenstaff 0 0 /* * 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.query.api; import javax.jdo.JDOUserException; import org.apache.jdo.tck.pc.company.Person; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Named Query not Found. *
*Keywords: query *
*Assertion ID: A14.5-14. *
*Assertion Description: * If the metadata is not found in the above, a JDOUserException is thrown. */ public class NamedQueryNotFound extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.5-14 (NamedQueryNotFound) failed: "; /** * The main 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(NamedQueryNotFound.class); } /** */ public void testNegative() { try { getPM().newNamedQuery(Person.class, "nonExistingNamedQuery"); fail(ASSERTION_FAILED + "The lookup of named query 'nonExistingNamedQuery' " + "is successful, though that named query is undefined."); } catch (JDOUserException e) { } } } tck/src/java/org/apache/jdo/tck/query/api/NewNamedQuery.java100664 6420 12500110373 24234 0ustarmbouschenstaff 0 0 /* * 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.query.api; import java.util.Arrays; import javax.jdo.Query; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Person; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.query.result.classes.FullName; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: New Named Query. *
*Keywords: query *
*Assertion ID: A14.5-12. *
*Assertion Description: * Construct a new query instance * with the given candidate class from a named query. */ public class NewNamedQuery extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.5-12 (NewNamedQuery) failed: "; /** * The expected results of valid queries. */ private Object[] expectedResult = { Arrays.asList(new Object[] { new FullName("emp1First", "emp1Last"), new FullName("emp2First", "emp2Last"), new FullName("emp3First", "emp3Last"), new FullName("emp4First", "emp4Last"), new FullName("emp5First", "emp5Last")}), new FullName("emp1First", "emp1Last") }; /** * The main 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(NewNamedQuery.class); } /** */ public void testPositive() { int index = 0; executeNamedQuery(Person.class, "validNotUnique", expectedResult[index], true); index = 1; executeNamedQuery(Person.class, "validUnique", expectedResult[index], true); } /** */ public void testNegative() { executeNamedQuery(Person.class, "invalidUnique", null, false); } private void executeNamedQuery(Class candidateClass, String namedQuery, Object expectedResult, boolean positive) { Query query = getPM().newNamedQuery(candidateClass, namedQuery); executeJDOQuery(ASSERTION_FAILED, query, "Named query " + namedQuery, false, null, expectedResult, positive); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/api/NewQueryFromExistingQueryBoundToPMFromSameVendor.java100664 13364 12500110373 33241 0ustarmbouschenstaff 0 0 /* * 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.query.api; import java.util.ArrayList; import java.util.List; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: New Query From Existing Query Bound to PersistenceManag er From Same Vendor *
*Keywords: query *
*Assertion ID: A14.5-3. *
*Assertion Description: PersistenceManager.newQuery(Object query) constructs a Query instance from another query, where the parameter is currently bound to a PersistenceManager from the same JDO vendor. Any of the elements Class, Filter, Import declarations, Variable declarations, Parameter declarations, and Ordering from the parameter Query are copied to the new Query instance, but a candidate Collection or Extent element is discarded. */ public class NewQueryFromExistingQueryBoundToPMFromSameVendor extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.5-3 (NewQueryFromExistingQueryBoundToPMFromSameVendor) failed: "; /** * The main 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(NewQueryFromExistingQueryBoundToPMFromSameVendor.class); } /** */ public void testPositive() { PersistenceManager pm = getPM(); runTestNewQueryFromExistingQueryBoundToPMFromSameVendor01(pm); runTestNewQueryFromExistingQueryBoundToPMFromSameVendor02(pm); } /** */ void runTestNewQueryFromExistingQueryBoundToPMFromSameVendor01( PersistenceManager pm) { if (debug) logger.debug("\nExecuting test NewQueryFromExistingQueryBoundToPMFromSameVendor01()..."); Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(); query.setClass(PCPoint.class); Query query1 = pm.newQuery(query); query1.compile(); Object results = query1.execute(); List expected = new ArrayList(); Object p1 = new PCPoint(0, 0); Object p2 = new PCPoint(1, 1); Object p3 = new PCPoint(2, 2); Object p4 = new PCPoint(3, 3); Object p5 = new PCPoint(4, 4); expected.add(p1); expected.add(p2); expected.add(p3); expected.add(p4); expected.add(p5); expected = getFromInserted(expected); printOutput(results, expected); checkQueryResultWithoutOrder(ASSERTION_FAILED, results, expected); if (debug) logger.debug("Test NewQueryFromExistingQueryBoundToPMFromSameVendor01() - Passed\n"); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ void runTestNewQueryFromExistingQueryBoundToPMFromSameVendor02( PersistenceManager pm) { if (debug) logger.debug("\nExecuting test NewQueryFromExistingQueryBoundToPMFromSameVendor02()..."); Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(); query.setClass(PCPoint.class); query.setCandidates(pm.getExtent(PCPoint.class, false)); Query query1 = pm.newQuery(query); query1.setCandidates(pm.getExtent(PCPoint.class, true)); query1.compile(); Object results = query1.execute(); // check query result List expected = new ArrayList(); Object p1 = new PCPoint(0, 0); Object p2 = new PCPoint(1, 1); Object p3 = new PCPoint(2, 2); Object p4 = new PCPoint(3, 3); Object p5 = new PCPoint(4, 4); expected.add(p1); expected.add(p2); expected.add(p3); expected.add(p4); expected.add(p5); expected = getFromInserted(expected); printOutput(results, expected); checkQueryResultWithoutOrder(ASSERTION_FAILED, results, expected); if (debug) logger.debug("Test NewQueryFromExistingQueryBoundToPMFromSameVendor02() - Passed\n"); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint.class); loadAndPersistPCPoints(getPM()); } } tck/src/java/org/apache/jdo/tck/query/api/NewQueryFromRestoredSerializedQuery.java100664 11342 12500110373 30704 0ustarmbouschenstaff 0 0 /* * 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.query.api; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.util.ArrayList; import java.util.List; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: New Query From Existing Serialized Query *
*Keywords: query *
*Assertion ID: A14.5-2. *
*Assertion Description: PersistenceManager.newQuery(Object query) constructs a Query instance from another query, where the parameter is a serialized/re-stored Query instance from the same JDO vendor but a different execution environment. Any of the elements Class, Filter, Import declarations, Variable declarations, Parameter declarations, and Ordering from the parameter Query are copied to the new Query instance, but a candidate Collection or Extent element is discarded. */ public class NewQueryFromRestoredSerializedQuery extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.5-2 (NewQueryFromRestoredSerializedQuery) failed: "; /** * The main 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(NewQueryFromRestoredSerializedQuery.class); } /** */ public void testPositive() throws Exception { PersistenceManager pm = getPM(); if (debug) logger.debug("\nExecuting test NewQueryFromRestoredSerializedQuery01() ..."); Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(); query.setClass(PCPoint.class); query.setCandidates(pm.getExtent(PCPoint.class, false)); query.setFilter("x == 3"); query.compile(); ObjectOutputStream oos = null; try { if (debug) logger.debug("Attempting to serialize Query object."); oos = new ObjectOutputStream( new FileOutputStream(SERIALZED_QUERY)); oos.writeObject(query); if (debug) logger.debug("Query object serialized."); } finally { if (oos != null) { try { oos.flush();} catch(Exception ex) {} try { oos.close();} catch(Exception ex) {} } } ObjectInputStream in = new ObjectInputStream(new FileInputStream(SERIALZED_QUERY)); Query query1 = (Query)in.readObject(); // init and execute query query = pm.newQuery(query1); query.setCandidates(pm.getExtent(PCPoint.class, false)); Object results = query.execute(); // check query result List expected = new ArrayList(); Object p4 = new PCPoint(3, 3); expected.add(p4); expected = getFromInserted(expected); printOutput(results, expected); checkQueryResultWithoutOrder(ASSERTION_FAILED, "x == 3", results, expected); if (debug) logger.debug("Test NewQueryFromRestoredSerializedQuery01(): Passed"); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint.class); loadAndPersistPCPoints(getPM()); } } tck/src/java/org/apache/jdo/tck/query/api/NewQuerySingleString.java100664 6161 12500110373 25622 0ustarmbouschenstaff 0 0 /* * 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.query.api; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Person; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Single String Query. *
*Keywords: query *
*Assertion ID: A14.5-11. *
*Assertion Description: * Construct a new query instance using the specified String * as the single-string representation of the query. */ public class NewQuerySingleString extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.5-11 (NewQuerySingleString) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** * The expected results of valid queries. */ private Object[] expectedResult = { getTransientCompanyModelInstancesAsList(new String[]{ "emp1", "emp2", "emp3", "emp4", "emp5"}) }; /** * The main 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(NewQuerySingleString.class); } /** */ public void testPositive() { for (int i = 0; i < VALID_QUERIES.length; i++) { executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/api/NewQueryWithCandidateClass.java100664 5255 12500110373 26713 0ustarmbouschenstaff 0 0 /* * 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.query.api; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: New Query with Candidate Class *
*Keywords: query *
*Assertion ID: A14.5-5. *
*Assertion Description: PersistenceManager.newQuery(Class cls) constructs a query instance with the candidate class specified. */ public class NewQueryWithCandidateClass extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.5-5 (NewQueryWithCandidateClass) failed: "; /** * The main 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(NewQueryWithCandidateClass.class); } /** */ public void testPositive() { PersistenceManager pm = getPM(); Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(PCPoint.class); query.setCandidates(pm.getExtent(PCPoint.class, false)); Object results = query.execute(); // check query result printOutput(results, inserted); checkQueryResultWithoutOrder(ASSERTION_FAILED, results, inserted); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint.class); loadAndPersistPCPoints(getPM()); } } tck/src/java/org/apache/jdo/tck/query/api/NewQueryWithCandidateClassAndCollection.java100664 5361 12500110373 31350 0ustarmbouschenstaff 0 0 /* * 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.query.api; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: New Query with Candidate Class and Collection *
*Keywords: query extent *
*Assertion ID: A14.5-7. *
*Assertion Description: PersistenceManager.newQuery(Class cls, Collection cln) constructs a query instance with the candidate class and candidate Collection specified. */ public class NewQueryWithCandidateClassAndCollection extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.5-7 (NewQueryWithCandidateClassAndCollection) failed: "; /** * The main 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(NewQueryWithCandidateClassAndCollection.class); } /** */ public void testPositive() { PersistenceManager pm = getPM(); Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(PCPoint.class, inserted); Object results = query.execute(); // check query result printOutput(results, inserted); checkQueryResultWithoutOrder(ASSERTION_FAILED, results, inserted); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint.class); loadAndPersistPCPoints(getPM()); } } tck/src/java/org/apache/jdo/tck/query/api/NewQueryWithCandidateClassAndExtent.java100664 5566 12500110373 30533 0ustarmbouschenstaff 0 0 /* * 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.query.api; import javax.jdo.Extent; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: New Query with Candidate Class and Extent *
*Keywords: query extent *
*Assertion ID: A14.5-6. *
*Assertion Description: PersistenceManager.newQuery(Class cls, Extent cln) constructs a query instance with the candidate class and candidate Extent specified. */ public class NewQueryWithCandidateClassAndExtent extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.5-6 (NewQueryWithCandidateClassAndExtent) failed: "; /** * The main 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(NewQueryWithCandidateClassAndExtent.class); } /** */ public void testPositive() { PersistenceManager pm = getPM(); Transaction tx = pm.currentTransaction(); Class clazz = PCPoint.class; try { Extent extent = pm.getExtent(clazz, true); tx.begin(); Query query = pm.newQuery(); query.setClass(clazz); query.setCandidates(extent); Object results = query.execute(); // check query result printOutput(results, inserted); checkQueryResultWithoutOrder(ASSERTION_FAILED, results, inserted); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint.class); loadAndPersistPCPoints(getPM()); } } tck/src/java/org/apache/jdo/tck/query/api/NewQueryWithCandidateClassAndFilter.java100664 6040 12500110373 30475 0ustarmbouschenstaff 0 0 /* * 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.query.api; import java.util.ArrayList; import java.util.List; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: New Query with Candidate Class and Filter *
*Keywords: query *
*Assertion ID: A14.5-8. *
*Assertion Description: PersistenceManager.newQuery(Class cls, String filter) constructs a query instance with the candidate class and filter specified. */ public class NewQueryWithCandidateClassAndFilter extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.5-8 (NewQueryWithCandidateClassAndFilter) failed: "; /** * The main 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(NewQueryWithCandidateClassAndFilter.class); } /** */ public void testPositive() { PersistenceManager pm = getPM(); Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(PCPoint.class, "x == 1"); query.setClass(PCPoint.class); query.setCandidates(pm.getExtent(PCPoint.class, false)); Object results = query.execute(); // check query result List expected = new ArrayList(); Object pcp1 = new PCPoint(1, 1); expected.add(pcp1); expected = getFromInserted(expected); printOutput(results, expected); checkQueryResultWithoutOrder(ASSERTION_FAILED, "x == 1", results, expected); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint.class); loadAndPersistPCPoints(getPM()); } } tck/src/java/org/apache/jdo/tck/query/api/NewQueryWithCandidateClassCollectionFilter.java100664 6035 12500110373 32072 0ustarmbouschenstaff 0 0 /* * 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.query.api; import java.util.ArrayList; import java.util.List; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: New Query with Candidate Class, Collection, and Filter *
*Keywords: query *
*Assertion ID: A14.5-9. *
*Assertion Description: PersistenceManager.newQuery(Class cls, Collection cln, String filter) constructs a query instance with the candidate class, the candidate Collection, and filter specified. */ public class NewQueryWithCandidateClassCollectionFilter extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.5-9 (NewQueryWithCandidateClassCollectionFilter) failed: "; /** * The main 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(NewQueryWithCandidateClassCollectionFilter.class); } /** */ public void testPositive() { PersistenceManager pm = getPM(); Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(PCPoint.class, inserted, "x ==2"); Object results = query.execute(); // check query result List expected = new ArrayList(); PCPoint pc1 = new PCPoint(2, 2); expected.add(pc1); expected = getFromInserted(expected); printOutput(results, expected); checkQueryResultWithoutOrder(ASSERTION_FAILED, "x ==2", results, expected); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint.class); loadAndPersistPCPoints(getPM()); } } tck/src/java/org/apache/jdo/tck/query/api/NewQueryWithExtent.java100664 5124 12500110373 25313 0ustarmbouschenstaff 0 0 /* * 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.query.api; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: New Query *
*Keywords: query *
*Assertion IDs: A14.5-1. *
*Assertion Description: PersistenceManagerFactory.newQuery() constructs and empty Query instance. */ public class NewQueryWithExtent extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.5-1 (NewQueryWithExtent) failed: "; /** * The main 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(NewQueryWithExtent.class); } /** */ public void testPositive() { PersistenceManager pm = getPM(); Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(pm.getExtent(PCPoint.class, false)); query.setClass(PCPoint.class); Object results = query.execute(); // check query result printOutput(results, inserted); checkQueryResultWithoutOrder(ASSERTION_FAILED, results, inserted); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint.class); loadAndPersistPCPoints(getPM()); } } tck/src/java/org/apache/jdo/tck/query/api/NewQueryWithExtentAndFilter.java100664 5572 12500110373 27113 0ustarmbouschenstaff 0 0 /* * 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.query.api; import java.util.ArrayList; import java.util.List; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: New Query *
*Keywords: query *
*Assertion IDs: A14.5-10. *
*Assertion Description: Construct a new query instance with the candidate Extent and filter specified; the candidate class is taken from the Extent. */ public class NewQueryWithExtentAndFilter extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.5-1 (NewQueryWithExtentAndFilter) failed: "; /** * The main 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(NewQueryWithExtentAndFilter.class); } /** */ public void testPositive() { PersistenceManager pm = getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); try { Query query = pm.newQuery(pm.getExtent(PCPoint.class, false), "x == 1"); Object results = query.execute(); // check query result List expected = new ArrayList(); Object pcp1 = new PCPoint(1, 1); expected.add(pcp1); expected = getFromInserted(expected); printOutput(results, expected); checkQueryResultWithoutOrder(ASSERTION_FAILED, "x == 1", results, expected); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint.class); loadAndPersistPCPoints(getPM()); } } tck/src/java/org/apache/jdo/tck/query/api/NewQueryWithSpecifiedLanguageAndQuery.java100664 7547 12500110373 31067 0ustarmbouschenstaff 0 0 /* * 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.query.api; import java.util.ArrayList; import java.util.List; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: New Query With Specified Language and Query *
*Keywords: query *
*Assertion ID: A14.5-4. *
*Assertion Description: PersistenceManager.newQuery(String language, Object query) constructs a query instance using the specified language and the specified query . The query instance returned will be of a class defined by the query language. The language parameter for the JDO Query language as herein documented is "javax.jdo.query.JDOQL". */ public class NewQueryWithSpecifiedLanguageAndQuery extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.5-4 (NewQueryWithSpecifiedLanguageAndQuery) failed: "; /** * The main 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(NewQueryWithSpecifiedLanguageAndQuery.class); } /** */ public void testPositive() { PersistenceManager pm = getPM(); if (debug) logger.debug("\nExecuting test NewQueryWithSpecifiedLanguageAndQuery()..."); Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(); query.setClass(PCPoint.class); query.setCandidates(pm.getExtent(PCPoint.class, false)); Query query1 = pm.newQuery("javax.jdo.query.JDOQL", query); query1.setCandidates(pm.getExtent(PCPoint.class, false)); query1.compile(); Object results = query1.execute(); // check query result List expected = new ArrayList(); Object p1 = new PCPoint(0, 0); Object p2 = new PCPoint(1, 1); Object p3 = new PCPoint(2, 2); Object p4 = new PCPoint(3, 3); Object p5 = new PCPoint(4, 4); expected.add(p1); expected.add(p2); expected.add(p3); expected.add(p4); expected.add(p5); expected = getFromInserted(expected); printOutput(results, expected); checkQueryResultWithoutOrder(ASSERTION_FAILED, results, expected); if (debug) logger.debug("Test NewQueryWithSpecifiedLanguageAndQuery() - Passed\n"); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint.class); loadAndPersistPCPoints(getPM()); } } tck/src/java/org/apache/jdo/tck/query/api/QueryCancel.java100664 21553 12500110373 23747 0ustarmbouschenstaff 0 0 /* * 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.query.api; import java.util.concurrent.CyclicBarrier; import junit.framework.AssertionFailedError; import javax.jdo.JDOFatalException; import javax.jdo.JDOQueryInterruptedException; import javax.jdo.JDOUnsupportedOptionException; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.pc.mylib.PCPoint2; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.util.ThreadExceptionHandler; /** *Title: QueryCancel *
*Keywords: query *
*Assertion ID: A14.6.1-8 *
*Assertion Description: These methods cancel a running query (or queries). The thread that has its query canceled will throw a JDOQueryInterruptedException. If cancel is not supported (most likely due to the underlying implementation not supporting cancel) then JDOUnsupportedOptionException is thrown to the caller. REMARK: This assertion seems to be untestable with the current TCK, thus I drop it from the query.conf configuration. Looks like Derby is evaluating the query on ResultSet.next() and thus the actual query execution is too fast to be canceled. */ public class QueryCancel extends QueryTest { /** Time for the main thread to sleep after starting a parallel thread. */ private static int MAIN_SLEEP_MILLIS = 40; /** Number of instances to be created. */ private static int NO_OF_INSTANCES = 5000; /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.1-8 (QueryCancel) failed: "; /** Single String JDOQL Query to be canceled. */ private static String SSJDOQL = "select avg (this.x + point2.y) " + "from PCPoint " + "where this.y >= 0 && point2.x >= 0 " + "variables PCPoint2 point2 " + "import org.apache.jdo.tck.pc.mylib.PCPoint; " + "import org.apache.jdo.tck.pc.mylib.PCPoint2; "; /** * The main 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(QueryCancel.class); } /** */ public void testCancel() throws Exception { PersistenceManager pm = getPM(); // Test query Query query = pm.newQuery(SSJDOQL); query.compile(); // Thread executing the query CyclicBarrier barrier = new CyclicBarrier(2); ThreadExceptionHandler group = new ThreadExceptionHandler(); QueryExecutor runnable = new QueryExecutor(pm, query, barrier); Thread t = new Thread(group, runnable, "Query Executor"); t.start(); try { // Wait for the other thread barrier.await(); // Wait a couple of millis such that the other thread can start query execution Thread.sleep(MAIN_SLEEP_MILLIS); // cancel query query.cancel(t); if (!isQueryCancelSupported()) { fail(ASSERTION_FAILED, "Query.cancel should throw a JDOQueryInterruptedException, " + "if query canceling is not supported "); } } catch (JDOUnsupportedOptionException ex) { if (isQueryCancelSupported()) { fail(ASSERTION_FAILED, "Query.cancel should not result in a JDOQueryInterruptedException, " + "if query canceling is supported "); } } t.join(); Throwable problem = group.getUncaughtException(t); if (problem != null) { if (problem instanceof AssertionFailedError) throw (AssertionFailedError)problem; else throw new JDOFatalException( "Thread " + t.getName()+ " results in exception ", problem); } } /** */ public void testCancelAll() throws Exception { PersistenceManager pm = getPM(); // Test query Query query = pm.newQuery(SSJDOQL); query.compile(); // Thread executing the query CyclicBarrier barrier = new CyclicBarrier(2); ThreadExceptionHandler group = new ThreadExceptionHandler(); QueryExecutor runnable = new QueryExecutor(pm, query, barrier); Thread t = new Thread(group, runnable, "Query Executor"); t.start(); try { // cancel query // Wait for the other thread barrier.await(); // Wait a couple of millis such that the other thread can start query execution Thread.sleep(MAIN_SLEEP_MILLIS); query.cancelAll(); if (!isQueryCancelSupported()) { fail(ASSERTION_FAILED, "Query.cancel should throw a JDOQueryInterruptedException, " + "if query canceling is not supported "); } } catch (JDOUnsupportedOptionException ex) { if (isQueryCancelSupported()) { fail(ASSERTION_FAILED, "Query.cancel should not result in a JDOQueryInterruptedException, " + "if query canceling is supported "); } } t.join(); Throwable problem = group.getUncaughtException(t); if (problem != null) { if (problem instanceof AssertionFailedError) throw (AssertionFailedError)problem; else throw new JDOFatalException( "Thread " + t.getName()+ " results in exception ", problem); } } /** Runnable class executing the query. */ class QueryExecutor implements Runnable { PersistenceManager pm; CyclicBarrier barrier; Query query; QueryExecutor(PersistenceManager pm, Query query, CyclicBarrier barrier) { this.pm = pm; this.query = query; this.barrier = barrier; } public void run() { Transaction tx = pm.currentTransaction(); try { tx.begin(); // wait for the other thread barrier.await(); Object result = query.execute(); tx.commit(); tx = null; if (isQueryCancelSupported()) { fail(ASSERTION_FAILED, "Query.execute should result in a JDOQueryInterruptedException, " + "if query canceling is supported."); } } catch (JDOQueryInterruptedException ex) { if (!isQueryCancelSupported()) { fail(ASSERTION_FAILED, "Query.execute should not result in a JDOQueryInterruptedException, " + "if query canceling is not supported."); } } catch (Exception ex) { throw new RuntimeException(ex); } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint.class); addTearDownClass(PCPoint2.class); // create PCPoint and PCPoint2 instances PersistenceManager pm = getPM(); Transaction tx = pm.currentTransaction(); try { tx.begin(); for (int i = 0; i < NO_OF_INSTANCES; i++) { PCPoint obj = new PCPoint(i, i); pm.makePersistent(obj); } for (int i = 0; i < NO_OF_INSTANCES; i++) { PCPoint2 obj = new PCPoint2(i, i); pm.makePersistent(obj); } tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/query/api/QueryExtentions.java100664 5535 12500110373 24704 0ustarmbouschenstaff 0 0 /* * 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.query.api; import java.util.HashMap; import java.util.Map; import javax.jdo.Query; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Person; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Query Extentions. *
*Keywords: query *
*Assertion ID: A14.9-1. *
*Assertion Description: * Some JDO vendors provide extensions to the query, * and these extensions must be set in the query instance prior to execution. */ public class QueryExtentions extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.9-1 (QueryExtentions) failed: "; private static String singleStringQuery = "SELECT FROM " + Person.class.getName(); /** * The expected results of valid queries. */ private Object[] expectedResult = { getTransientCompanyModelInstancesAsList( new String[]{"emp1", "emp2", "emp3", "emp4", "emp5"}) }; /** * The main 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(QueryExtentions.class); } /** */ public void testPositive() { int index = 0; Query query = getPM().newQuery(singleStringQuery); Map extentions = new HashMap(); extentions.put("unknown key 1", "unknown value 1"); query.setExtensions(extentions); query.addExtension("unknown key 2", "unknown value 2"); executeJDOQuery(ASSERTION_FAILED, query, singleStringQuery, false, null, expectedResult[index], true); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/api/SetCandidateCollection.java100664 6531 12500110373 26057 0ustarmbouschenstaff 0 0 /* * 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.query.api; import java.util.ArrayList; import java.util.List; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Set Candidate Collection *
*Keywords: query *
*Assertion ID: A14.6-5. *
*Assertion Description: Query.setCandidates(Collection *candidateCollection) binds the candidate Collection *to the query instance. */ public class SetCandidateCollection extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6-5 (SetCandidateCollection) failed: "; /** * The main 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(SetCandidateCollection.class); } /** */ public void testPositive() { PersistenceManager pm = getPM(); if (debug) logger.debug("\nExecuting test SetCandidateCollection()..."); Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(); query.setClass(PCPoint.class); query.setCandidates(inserted); Object results = query.execute(); // check query result List expected = new ArrayList(); Object p1 = new PCPoint(0, 0); Object p2 = new PCPoint(1, 1); Object p3 = new PCPoint(2, 2); Object p4 = new PCPoint(3, 3); Object p5 = new PCPoint(4, 4); expected.add(p1); expected.add(p2); expected.add(p3); expected.add(p4); expected.add(p5); expected = getFromInserted(expected); printOutput(results, expected); checkQueryResultWithoutOrder(ASSERTION_FAILED, results, expected); if (debug) logger.debug("Test SetCandidateCollection: Passed"); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint.class); loadAndPersistPCPoints(getPM()); } } tck/src/java/org/apache/jdo/tck/query/api/SetCandidateExtent.java100664 6514 12500110373 25234 0ustarmbouschenstaff 0 0 /* * 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.query.api; import java.util.ArrayList; import java.util.List; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Set Candidate Extent *
*Keywords: query extent *
*Assertion ID: A14.6-6. *
*Assertion Description: Query.setCandidates(Extent *candidateExtent) binds the candidate Extent to the query *instance. */ public class SetCandidateExtent extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6-6 (SetCandidateExtent) failed: "; /** * The main 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(SetCandidateExtent.class); } /** */ public void testPositive() { PersistenceManager pm = getPM(); if (debug) logger.debug("\nExecuting test SetCandidateExtent()..."); Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(); query.setClass(PCPoint.class); query.setCandidates(pm.getExtent(PCPoint.class, false)); Object results = query.execute(); // check query result List expected = new ArrayList(); Object p1 = new PCPoint(0, 0); Object p2 = new PCPoint(1, 1); Object p3 = new PCPoint(2, 2); Object p4 = new PCPoint(3, 3); Object p5 = new PCPoint(4, 4); expected.add(p1); expected.add(p2); expected.add(p3); expected.add(p4); expected.add(p5); expected = getFromInserted(expected); printOutput(results, expected); checkQueryResultWithoutOrder(ASSERTION_FAILED, results, expected); if (debug) logger.debug("Test SetCandidateExtent: Passed"); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint.class); loadAndPersistPCPoints(getPM()); } } tck/src/java/org/apache/jdo/tck/query/api/SetFilter.java100664 5713 12500110373 23415 0ustarmbouschenstaff 0 0 /* * 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.query.api; import java.util.ArrayList; import java.util.List; import javax.jdo.Extent; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Set Filter *
*Keywords: query *
*Assertion ID: A14.6-7. *
*Assertion Description: Query.setFilter(String filter) binds the query filter to the query instance. */ public class SetFilter extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6-7 (SetFilter) failed: "; /** * The main 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(SetFilter.class); } /** */ public void testPositive() { PersistenceManager pm = getPM(); Transaction tx = pm.currentTransaction(); Class clazz = PCPoint.class; try { Extent extent = pm.getExtent(clazz, true); tx.begin(); Query query = pm.newQuery(); query.setClass(clazz); query.setCandidates(extent); query.setFilter("x == 2"); Object results = query.execute(); // check query result List expected = new ArrayList(); expected.add(new PCPoint(2, 2)); expected = getFromInserted(expected); printOutput(results, expected); checkQueryResultWithoutOrder(ASSERTION_FAILED, "x == 2", results, expected); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint.class); loadAndPersistPCPoints(getPM()); } } tck/src/java/org/apache/jdo/tck/query/api/SetGrouping.java100664 5167 12500110373 23765 0ustarmbouschenstaff 0 0 /* * 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.query.api; import java.util.Arrays; import javax.jdo.Query; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Person; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Set Grouping. *
*Keywords: query *
*Assertion ID: A14.6-17. *
*Assertion Description: * void setGrouping (String grouping); * Specify the grouping of results for aggregates. */ public class SetGrouping extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6-17 (SetGrouping) failed: "; /** * The expected results of valid queries. */ private Object[] expectedResult = { Arrays.asList(new Object[] { "emp1Last", "emp2Last", "emp3Last", "emp4Last", "emp5Last"}) }; /** * The main 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(SetGrouping.class); } /** */ public void testPositive() { int index = 0; Query query = getPM().newQuery(Person.class); query.setResult("lastname"); query.setGrouping("lastname"); String singleStringQuery = "SELECT lastname FROM Person GROUP BY lastname"; executeJDOQuery(ASSERTION_FAILED, query, singleStringQuery, false, null, expectedResult[index], true); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/api/SetIgnoreCache.java100664 12307 12500110373 24354 0ustarmbouschenstaff 0 0 /* * 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.query.api; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Set IgnoreCache *
*Keywords: query *
*Assertion ID: A14.6-12. *
*Assertion Description: Query.setIgnoreCache(boolean flag) *sets the IgnoreCache option for queries. */ public class SetIgnoreCache extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6-12 (SetIgnoreCache) failed: "; /** * The main 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(SetIgnoreCache.class); } /** */ public void test() { pm = getPM(); runTestSetIgnoreCache01(pm); runTestSetIgnoreCache02(pm); pm.close(); pm = null; } /** */ void runTestSetIgnoreCache01(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); tx.setOptimistic(false); try { tx.begin(); Query query = pm.newQuery(); query.setClass(PCPoint.class); query.setCandidates(pm.getExtent(PCPoint.class, false)); if (debug) logger.debug("Pessimistic: IgnoreCache - Setting value = true"); query.setIgnoreCache(true); if(query.getIgnoreCache()) { if (debug) logger.debug("Pessimistic: IgnoreCache - value = " + query.getIgnoreCache()); } else { fail(ASSERTION_FAILED, "query.getIgnoreCache() returns false after setting the flag to true"); } if (debug) logger.debug("Pessimistic: IgnoreCache - Setting value = false"); query.setIgnoreCache(false); if(!query.getIgnoreCache()) { if (debug) logger.debug("Pessimistic: IgnoreCache - value = " + query.getIgnoreCache()); } else { fail(ASSERTION_FAILED, "query.getIgnoreCache() returns true after setting the flag to false"); } query.compile(); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ void runTestSetIgnoreCache02(PersistenceManager pm) { if (!isOptimisticSupported()) { if (debug) logger.debug("Optimistic tx not supported"); return; } Transaction tx = pm.currentTransaction(); try { tx.setOptimistic(true); tx.begin(); Query query = pm.newQuery(); query.setClass(PCPoint.class); query.setCandidates(pm.getExtent(PCPoint.class, false)); if (debug) logger.debug("Optimistic: IgnoreCache - Setting value = true"); query.setIgnoreCache(true); if(query.getIgnoreCache()) { if (debug) logger.debug("Optimistic: IgnoreCache - value = " + query.getIgnoreCache()); } else { fail(ASSERTION_FAILED, "query.getIgnoreCache() returns false after setting the flag to true"); } if (debug) logger.debug("Optimistic: IgnoreCache - Setting value = false"); query.setIgnoreCache(false); if(!query.getIgnoreCache()) { if (debug) logger.debug("Optimistic: IgnoreCache - value = " + query.getIgnoreCache()); } else { fail(ASSERTION_FAILED, "query.getIgnoreCache() returns true after setting the flag to false"); } query.compile(); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/query/api/SetOrdering.java100664 10052 12500110373 23751 0ustarmbouschenstaff 0 0 /* * 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.query.api; import java.util.ArrayList; import java.util.List; import java.util.ListIterator; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Set Ordering *
*Keywords: query *
*Assertion ID: A14.6-11. *
*Assertion Description: Query.setOrdering(String ordering) binds the ordering statements to the query instance. */ public class SetOrdering extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6-11 (SetOrdering) failed: "; /** * The main 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(SetOrdering.class); } /** */ public void testPositive() { PersistenceManager pm = getPM(); runTestAscending(pm); runTestDescending(pm); } /** */ void runTestAscending(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); //ascending Query query = pm.newQuery(); query.setClass(PCPoint.class); query.setCandidates(pm.getExtent(PCPoint.class, false)); query.setOrdering("x ascending"); Object results = query.execute(); // check result printOutput(results, inserted); checkQueryResultWithOrder(ASSERTION_FAILED, results, inserted); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ void runTestDescending(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); Class clazz = PCPoint.class; try { tx.begin(); //descending Query query = pm.newQuery(); query.setClass(PCPoint.class); query.setCandidates(pm.getExtent(PCPoint.class, false)); query.setOrdering("x descending"); Object results = query.execute(); // check result List expected = new ArrayList(); ListIterator li = inserted.listIterator(inserted.size()); // construct expected results by iterating inserted objects backwards while (li.hasPrevious()) { Object obj = li.previous(); expected.add(obj); } expected = getFromInserted(expected); printOutput(results, expected); checkQueryResultWithOrder(ASSERTION_FAILED, results, expected); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint.class); loadAndPersistPCPoints(getPM()); } } tck/src/java/org/apache/jdo/tck/query/api/SetRange.java100664 5134 12500110373 23221 0ustarmbouschenstaff 0 0 /* * 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.query.api; import javax.jdo.Query; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Person; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Set Range. *
*Keywords: query *
*Assertion ID: A14.6-20. *
*Assertion Description: * setRange(int fromIncl, int toExcl); * Specify the number of instances to skip over * and the maximum number of result instances to return. */ public class SetRange extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6-20 (SetRange) failed: "; /** * The expected results of valid queries. */ private Object[] expectedResult = { getTransientCompanyModelInstancesAsList( new String[]{"emp1", "emp2", "emp3", "emp4", "emp5"}) }; /** * The main 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(SetRange.class); } /** */ public void testPositive() { int index = 0; Query query = getPM().newQuery(Person.class); query.setRange(0, 5); String singleStringQuery = "SELECT FROM Person RANGE 0, 5"; executeJDOQuery(ASSERTION_FAILED, query, singleStringQuery, false, null, expectedResult[index], true); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/api/SetResult.java100664 6034 12500110373 23443 0ustarmbouschenstaff 0 0 /* * 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.query.api; import java.util.Arrays; import javax.jdo.JDOUserException; import javax.jdo.Query; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Person; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Set Result. *
*Keywords: query *
*Assertion ID: A14.6-16. *
*Assertion Description: * void setResult (String result); Specify the results of the query * if not instances of the candidate class. */ public class SetResult extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6-16 (SetResult) failed: "; /** * The expected results of valid queries. */ private Object[] expectedResult = { Arrays.asList(new Object[] { "emp1Last", "emp2Last", "emp3Last", "emp4Last", "emp5Last"}) }; /** * The main 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(SetResult.class); } /** */ public void testPositive() { int index = 0; Query query = getPM().newQuery(Person.class); query.setResult("lastname"); String singleStringQuery = "SELECT lastname FROM Person"; executeJDOQuery(ASSERTION_FAILED, query, singleStringQuery, false, null, expectedResult[index], true); } /** */ public void testNegative() { Query query = getPM().newQuery(Person.class); try { query.setResult("noname"); query.compile(); fail(ASSERTION_FAILED + "Compilation for query " + "'SELECT noname FROM Person' " + "succeeded, though the result clause is invalid."); } catch (JDOUserException e) { } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/api/SetResultClass.java100664 5671 12500110373 24437 0ustarmbouschenstaff 0 0 /* * 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.query.api; import java.util.Arrays; import javax.jdo.Query; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Person; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.query.result.classes.FullName; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Set Result Class. *
*Keywords: query *
*Assertion ID: A14.6-19. *
*Assertion Description: * void setResultClass (Class resultClass); * Specify the class to be used to return result instances. */ public class SetResultClass extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6-19 (SetResultClass) failed: "; /** * The expected results of valid queries. */ private Object[] expectedResult = { Arrays.asList(new Object[] { new FullName("emp1First", "emp1Last"), new FullName("emp2First", "emp2Last"), new FullName("emp3First", "emp3Last"), new FullName("emp4First", "emp4Last"), new FullName("emp5First", "emp5Last")}) }; /** * The main 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(SetResultClass.class); } /** */ public void testPositive() { int index = 0; Query query = getPM().newQuery(Person.class); query.setResultClass(FullName.class); query.setResult("firstname, lastname"); String singleStringQuery = "SELECT firstname, lastname INTO FullName FROM Person"; executeJDOQuery(ASSERTION_FAILED, query, singleStringQuery, false, null, expectedResult[index], true); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/api/SetterReplacePreviousValues.java100664 14046 12500110373 27212 0ustarmbouschenstaff 0 0 /* * 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.query.api; import javax.jdo.Query; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Department; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Setter replace previous values. *
*Keywords: query *
*Assertion ID: A14.6.15. *
*Assertion Description: * All of these methods replace the previously set query element, by the * parameter. [The methods are not additive]. */ public class SetterReplacePreviousValues extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.15 (SetterReplacePreviousValues) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { // replace parameter declaration new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Department.class, /*EXCLUDE*/ null, /*WHERE*/ "deptid == param", /*VARIABLES*/ null, /*PARAMETERS*/ "String x", /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // replace filter setting new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ "personid == 1L", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // replace variable declaration new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Department.class, /*EXCLUDE*/ null, /*WHERE*/ "employees.contains(e) && e.personid == 1", /*VARIABLES*/ "Employee e1; Employee e2", /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** * The expected results of valid queries. */ private Object[] expectedResult = { // replace parameter declaration getTransientCompanyModelInstancesAsList(new String[]{"dept1"}), // replace filter setting getTransientCompanyModelInstancesAsList(new String[]{"emp2"}), // replace variable declaration getTransientCompanyModelInstancesAsList(new String[]{"dept1"}) }; /** * The main 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(SetterReplacePreviousValues.class); } /** */ public void testPositive() { // replace parameter declaration int index = 0; Query query = VALID_QUERIES[index].getAPIQuery(getPM()); query.declareParameters("long param"); Object[] parameters = new Object[] {new Long(1)}; executeJDOQuery(ASSERTION_FAILED, query, VALID_QUERIES[index].toString(), false, parameters, expectedResult[index], true); query = VALID_QUERIES[index].getSingleStringQuery(getPM()); query.declareParameters("long param"); executeJDOQuery(ASSERTION_FAILED, query, VALID_QUERIES[index].toString(), false, parameters, expectedResult[index], true); // replace filter setting index++; query = VALID_QUERIES[index].getAPIQuery(getPM()); query.setFilter("personid == 2L"); executeJDOQuery(ASSERTION_FAILED, query, VALID_QUERIES[index].toString(), false, null, expectedResult[index], true); query = VALID_QUERIES[index].getSingleStringQuery(getPM()); query.setFilter("personid == 2L"); executeJDOQuery(ASSERTION_FAILED, query, VALID_QUERIES[index].toString(), false, null, expectedResult[index], true); // replace variable declaration index++; query = VALID_QUERIES[index].getAPIQuery(getPM()); query.declareVariables("Employee e"); executeJDOQuery(ASSERTION_FAILED, query, VALID_QUERIES[index].toString(), false, null, expectedResult[index], true); query = VALID_QUERIES[index].getSingleStringQuery(getPM()); query.declareVariables("Employee e"); executeJDOQuery(ASSERTION_FAILED, query, VALID_QUERIES[index].toString(), false, null, expectedResult[index], true); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/api/SetUnique.java100664 5672 12500110373 23442 0ustarmbouschenstaff 0 0 /* * 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.query.api; import javax.jdo.Query; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Person; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Set Unique. *
*Keywords: query *
*Assertion ID: A14.6-18. *
*Assertion Description: * void setUnique (boolean unique); * Specify that there is a single result of the query. */ public class SetUnique extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6-18 (SetUnique) failed: "; /** * The expected results of valid queries. */ private Object[] expectedResult = { getTransientCompanyModelInstance("emp1"), getTransientCompanyModelInstancesAsList( new String[]{"emp1", "emp2", "emp3", "emp4", "emp5"}) }; /** * The main 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(SetUnique.class); } /** */ public void testPositive() { int index = 0; Query query = getPM().newQuery(Person.class); query.setUnique(true); query.setFilter("lastname == 'emp1Last'"); String singleStringQuery = "SELECT FROM Person WHERE lastname == 'emp1Last'"; executeJDOQuery(ASSERTION_FAILED, query, singleStringQuery, false, null, expectedResult[index], true); index = 1; query = getPM().newQuery(Person.class); query.setUnique(false); singleStringQuery = "SELECT FROM Person"; executeJDOQuery(ASSERTION_FAILED, query, singleStringQuery, false, null, expectedResult[index], true); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/api/SingleStringQuery.java100664 10517 12500110373 25170 0ustarmbouschenstaff 0 0 /* * 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.query.api; import java.math.BigDecimal; import javax.jdo.Query; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.FullTimeEmployee; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.query.result.classes.FullName; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Single String Query. *
*Keywords: query *
*Assertion ID: A14.6-23. *
*Assertion Description: * The single string query is first parsed to yield the result, * result class, filter, variable list, parameter list, import list, * grouping, ordering, and range. * Then, the values specified in APIs setResult, setResultClass, * setFilter, declareVariables, declareParamters, declareImports, * setGrouping, setOrdering, and setRange * override the corresponding settings from the single string query. */ public class SingleStringQuery extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6-23 (SingleStringQuery) failed: "; private static String singleStringQuery = "SELECT UNIQUE firstname, lastname " + "INTO FullName " + "FROM FullTimeEmployee " + "WHERE salary > 1000 & " + " projects.contains(p) & p.budget > limit & " + " firstname == 'emp1First' " + "VARIABLES Project p " + "PARAMETERS BigDecimal limit " + "import org.apache.jdo.tck.query.result.classes.FullName; " + "import org.apache.jdo.tck.pc.company.FullTimeEmployee; " + "import org.apache.jdo.tck.pc.company.Project; " + "import java.math.BigDecimal; " + "GROUP BY firstname, lastname " + "ORDER BY lastname ASCENDING " + "RANGE 0,5"; /** * The expected results of valid queries. */ private Object[] expectedResult = { new FullName("emp1First", "emp1Last"), getTransientCompanyModelInstancesAsList(new String[]{"emp1", "emp2", "emp5"}) }; /** Parameters of valid queries. */ private Object[][] parameters = { {new BigDecimal("2000")} }; /** * The main 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(SingleStringQuery.class); } /** */ public void testPositive() { int index = 0; Query query = getPM().newQuery(singleStringQuery); executeJDOQuery(ASSERTION_FAILED, query, singleStringQuery, true, parameters[index], expectedResult[index], true); index = 1; String singleStringQuery = "SELECT FROM FullTimeEmployee"; query.setUnique(false); query.setResult(null); query.setResultClass(null); query.setClass(FullTimeEmployee.class); query.setFilter(null); query.declareVariables(null); query.declareParameters(null); query.declareImports(null); query.setGrouping(null); query.setOrdering(null); query.setRange(null); executeJDOQuery(ASSERTION_FAILED, query, singleStringQuery, false, null, expectedResult[index], true); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/api/UnmodifiableQuery.java100664 14003 12500110373 25150 0ustarmbouschenstaff 0 0 /* * 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.query.api; import java.util.Arrays; import javax.jdo.JDOUserException; import javax.jdo.Query; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.pc.company.Person; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.query.result.classes.FullName; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Unmodifiable Query. *
*Keywords: query *
*Assertion ID: A14.6-22. *
*Assertion Description: * The Unmodifiable option, when set to true, * disallows further modification of the query, * except for specifying the range and result class and ignoreCache option. */ public class UnmodifiableQuery extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6-22 (UnmodifiableQuery) failed: "; private static String singleStringQuery = "SELECT firstname, lastname FROM org.apache.jdo.tck.pc.company.Person"; /** * The expected results of valid queries. */ private Object[] expectedResult = { Arrays.asList(new Object[] { new FullName("emp1First", "emp1Last"), new FullName("emp2First", "emp2Last"), new FullName("emp3First", "emp3Last"), new FullName("emp4First", "emp4Last"), new FullName("emp5First", "emp5Last")}) }; /** * The main 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(UnmodifiableQuery.class); } /** */ public void testPositive() { int index = 0; Query query = getPM().newQuery(singleStringQuery); query.setUnmodifiable(); query.setResultClass(FullName.class); query.setRange(0, 5); query.setIgnoreCache(true); executeJDOQuery(ASSERTION_FAILED, query, singleStringQuery, false, null, expectedResult[index], true); query = getPM().newNamedQuery(Person.class, "unmodifiable"); query.setResultClass(FullName.class); query.setRange(0, 5); query.setIgnoreCache(true); executeJDOQuery(ASSERTION_FAILED, query, singleStringQuery, false, null, expectedResult[index], true); } /** */ public void testNegative() { Query query = getPM().newQuery(singleStringQuery); query.setUnmodifiable(); checkSetters(query); query = getPM().newNamedQuery(Person.class, "unmodifiable"); checkSetters(query); } private void checkSetters(Query query) { checkSetResult(query); checkSetClass(query); checkSetFilter(query); checkDeclareVariables(query); checkDeclareParameters(query); checkDeclareImports(query); checkSetOrdering(query); checkSetGrouping(query); checkSetOrdering(query); } private void checkSetResult(Query query) { try { query.setResult("firstname, lastname"); methodFailed("setResult()"); } catch (JDOUserException e) { } } private void checkSetClass(Query query) { try { query.setClass(Employee.class); methodFailed("setClass()"); } catch (JDOUserException e) { } } private void checkSetFilter(Query query) { try { query.setFilter("firstname == 'emp1First'"); methodFailed("setFilter()"); } catch (JDOUserException e) { } } private void checkDeclareVariables(Query query) { try { query.declareVariables("Employee emp"); methodFailed("declareVariables()"); } catch (JDOUserException e) { } } private void checkDeclareParameters(Query query) { try { query.declareParameters("Employee emp"); methodFailed("declareParameters()"); } catch (JDOUserException e) { } } private void checkDeclareImports(Query query) { try { query.declareImports("import org.apache.jdo.tck.pc.company.Employee"); methodFailed("declareImports()"); } catch (JDOUserException e) { } } private void checkSetGrouping(Query query) { try { query.setGrouping("firstname"); methodFailed("setGrouping()"); } catch (JDOUserException e) { } } private void checkSetOrdering(Query query) { try { query.setOrdering("firstname ASCENDING"); methodFailed("setOrdering()"); } catch (JDOUserException e) { } } private void methodFailed(String method) { fail(ASSERTION_FAILED + method + " on an unmodifiable query must throw JDOUserException." ); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/delete/DeleteCallback.java100664 47643 12500110373 25054 0ustarmbouschenstaff 0 0 /* * 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.query.delete; import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; import java.util.Iterator; import java.util.List; import javax.jdo.JDOHelper; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import javax.jdo.listener.DeleteLifecycleListener; import javax.jdo.listener.InstanceLifecycleEvent; import javax.jdo.listener.StoreLifecycleListener; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Department; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.pc.company.Person; import org.apache.jdo.tck.pc.company.Project; import org.apache.jdo.tck.pc.mylib.MylibReader; import org.apache.jdo.tck.pc.mylib.PrimitiveTypes; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.util.ConversionHelper; /** *Title: Delete Persistent All. *
*Keywords: query *
*Assertion ID: A14.8-4 *
*Assertion Description: * Dirty instances of affected classes are first flushed to the datastore. * Instances already in the cache when deleted via these methods * or brought into the cache as a result of these methods * undergo the life cycle transitions as if deletePersistent * had been called on them. * That is, if an affected class implements the DeleteCallback interface, * the instances to be deleted are instantiated in memory and * the jdoPreDelete method is called prior * to deleting the instance in the datastore. * If any LifecycleListener instances are registered with affected classes, * these listeners are called for each deleted instance. * Before returning control to the application, * instances of affected classes in the cache are refreshed * by the implementation so their status in the cache reflects * whether they were deleted from the datastore. */ public class DeleteCallback extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.8-4 (DeleteCallback) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ PrimitiveTypes.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** * The expected results of valid queries. */ private List[] expectedResult = { getTransientCompanyModelInstancesAsList(new String[]{ "emp1", "emp2", "emp3", "emp4", "emp5"}), getTransientMylibInstancesAsList(new String[]{ "primitiveTypesPositive", "primitiveTypesNegative", "primitiveTypesCharacterStringLiterals"}) }; /** * The main 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(DeleteCallback.class); } /** */ public void testRelationshipsAPI() { queryUpdateDeleteVerify(0, false, "middlename"); } /** */ public void testRelationshipsSingleString() { queryUpdateDeleteVerify(0, true, "middlename"); } /** */ public void testNoRelationshipsAPI() { queryUpdateDeleteVerify(1, false, "stringNull"); } /** */ public void testNoRelationshipsSingleString() { queryUpdateDeleteVerify(1, true, "stringNull"); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); addTearDownClass(MylibReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); loadAndPersistMylib(getPM()); } /** * Adds a lifecycle listener to the persistence manager. * Converts the query element holder instance refered to by argument * index to a JDO query instance based on argument * asSingleString. * Executes the query instance and marks all queried pc instances as dirty * by calling {@link JDOHelper#makeDirty(java.lang.Object, java.lang.String)}. * Passes argument fieldName to that call. * Afterwards, calls {@link Query#deletePersistentAll()}, and * verifies the lifecycle callbacks and the lifecycle states. * @param index the index of the query element holder instance * @param fieldName the field name passed as argument to * {@link JDOHelper#makeDirty(java.lang.Object, java.lang.String) * @param asSingleString determines if the query is executed as * single string query or as API query. */ private void queryUpdateDeleteVerify(int index, boolean asSingleString, String fieldName) { PersistenceManager pm = getPM(); Transaction transaction = pm.currentTransaction(); transaction.begin(); try { LifecycleVerifier lifecycleVerifier; Query query = asSingleString ? VALID_QUERIES[index].getSingleStringQuery(pm) : VALID_QUERIES[index].getAPIQuery(pm); Collection result = executeQuery(query, index, asSingleString); try { lifecycleVerifier = new LifecycleVerifier(result); pm.addInstanceLifecycleListener(lifecycleVerifier, new Class[]{VALID_QUERIES[index].getCandidateClass()}); updateInstances(result, fieldName); deleteInstances(query, index, asSingleString, result.size()); } finally { query.close(result); } lifecycleVerifier.verifyCallbacksAndStates(); } finally { if (transaction.isActive()) { transaction.rollback(); } } } /** * Executes the given query, checks and returns the query result. * Note: This mthod does not close the query result. * @param query the query. * @param index the index of the query element holder instance * which was used to created the given query. * @param asSingleString indicates if the given query was created * using API methods or if it was created by a single string. * @return the query result. */ private Collection executeQuery(Query query, int index, boolean asSingleString) { if (logger.isDebugEnabled()) { if (asSingleString) { logger.debug("Executing single string query: " + VALID_QUERIES[index]); } else { logger.debug("Executing API query: " + VALID_QUERIES[index]); } } Collection result = (Collection) query.execute(); if (logger.isDebugEnabled()) { logger.debug("Query result: " + ConversionHelper. convertObjectArrayElements(result)); } checkQueryResultWithoutOrder(ASSERTION_FAILED, result, expectedResult[index]); return result; } /** * Makes all instances in the given collection dirty. * If instances are employees, then all relationships are cleared. * @param instances the instances * @param fieldName the field name passed as argument to * {@link JDOHelper#makeDirty(java.lang.Object, java.lang.String) */ private void updateInstances(Collection instances, String fieldName) { for (Iterator i = instances.iterator(); i.hasNext(); ) { Object pc = i.next(); // clear employee relationships if (pc instanceof Employee) { Employee employee = (Employee) pc; if (employee.getDentalInsurance() != null) { employee.getDentalInsurance().setEmployee(null); } if (employee.getMedicalInsurance() != null) { employee.getMedicalInsurance().setEmployee(null); } if (employee.getDepartment() != null) { ((Department)employee.getDepartment()).removeEmployee(employee); } if (employee.getFundingDept() != null) { ((Department)employee.getFundingDept()).removeEmployee(employee); } if (employee.getManager() != null) { ((Employee)employee.getManager()).removeFromTeam(employee); } if (employee.getMentor() != null) { employee.getMentor().setProtege(null); } if (employee.getProtege() != null) { employee.getProtege().setMentor(null); } if (employee.getHradvisor() != null) { ((Employee)employee.getHradvisor()).removeAdvisee(employee); } if (employee.getReviewedProjects() != null) { for (Iterator it=employee.getReviewedProjects().iterator(); it.hasNext(); ) { Project other = (Project) it.next(); other.removeReviewer(employee); } } if (employee.getProjects() != null) { for (Iterator it=employee.getProjects().iterator(); it.hasNext(); ) { Project other = (Project) it.next(); other.removeMember(employee); } } if (employee.getTeam() != null) { for (Iterator it=employee.getTeam().iterator(); it.hasNext(); ) { Employee other = (Employee) it.next(); other.setManager(null); } } if (employee.getHradvisees() != null) { for (Iterator it=employee.getHradvisees().iterator(); it.hasNext(); ) { Employee other = (Employee) it.next(); other.setHradvisor(employee); } } } // make the instance dirty. if (logger.isDebugEnabled()) { logger.debug("Calling JDOHelper.makeDirty(" + pc + ", \"" + fieldName + "\")"); } JDOHelper.makeDirty(pc, fieldName); } } /** * Calls {@link Query#deletePersistentAll()} on the given query. * @param query the query. * @param index the index of the query element holder instance * which was used to created the given query. * @param asSingleString indicates if the given query was created * using API methods or if it was created by a single string. * @param expectedNumberOfDeletedInstances the expected number * of deleted instances. */ private void deleteInstances(Query query, int index, boolean asSingleString, int expectedNumberOfDeletedInstances) { if (logger.isDebugEnabled()) { if (asSingleString) { logger.debug("Deleting persistent by single string query: " + VALID_QUERIES[index]); } else { logger.debug("Deleting persistent by API query: " + VALID_QUERIES[index]); } } long nr = query.deletePersistentAll(); if (logger.isDebugEnabled()) { logger.debug(nr + " objects deleted."); } if (nr != expectedNumberOfDeletedInstances) { fail(ASSERTION_FAILED, "deletePersistentAll returned " + nr + ", expected is " + expectedNumberOfDeletedInstances + ". Query: " + VALID_QUERIES[index]); } } /** * A lifecycle listener which may be added to persistence managers. * Gathers delete events and store events and keeps those * in a list. * Method {@link LifecycleVerifier#verifyCallbacksAndStates()} * may be called to check if the right events have been called * on all expected instances. * The expected instances are passed through * {@link LifecycleVerifier#LifecycleVerifier(Collection). */ private class LifecycleVerifier implements DeleteLifecycleListener, StoreLifecycleListener { /** The oids of expected pc instances. */ private Collection expectedOids = new HashSet(); /** The list of events. */ private List events = new ArrayList(); /** * Argument expectedPCInstances holds pc instances * which are expected to be sources of events. * @param expectedPCInstances the pc instances * which are expected to be sources of events. */ public LifecycleVerifier(Collection expectedPCInstances) { for (Iterator i = expectedPCInstances.iterator(); i.hasNext(); ) { this.expectedOids.add(JDOHelper.getObjectId(i.next())); } } /** * Verifies if the right events have been called for all * expected pc instances. * All store events must have been fired before the * first delete event has been fired. * Furthermore, checks if pc instances kept in * delete events have state persistent-deleted. * The test case fails if one of these conditions * is violated. */ public void verifyCallbacksAndStates() { if (logger.isDebugEnabled()) { logger.debug("Verifying callbacks and states."); } // The two collections are filled iterating through the list of // events. Finally, they are compared against field expectedOids. // Note: Set implementations are used instead of list // implementations to eliminate duplicates. Duplicates may occur // if multiple updates or deletions are executed for the same // pc instances. Collection oidsOfDeletedInstances = new HashSet(); Collection oidsOfUpdateInstances = new HashSet(); boolean hasDeleteEventBeenPassed = false; int size = events.size(); for (int i = 0; i < size; i++) { InstanceLifecycleEvent event = (InstanceLifecycleEvent) this.events.get(i); Object source = event.getSource(); int eventType = event.getEventType(); if (eventType == InstanceLifecycleEvent.DELETE) { if (logger.isDebugEnabled()) { logger.debug("Verifying delete event on " + JDOHelper.getObjectId(source)); } hasDeleteEventBeenPassed = true; if (!JDOHelper.isDeleted(source)) { fail(ASSERTION_FAILED, "PC instance must have persistent deleted " + "state: " + source); } oidsOfDeletedInstances.add(JDOHelper.getObjectId(source)); } else if (eventType == InstanceLifecycleEvent.STORE) { if (logger.isDebugEnabled()) { logger.debug("Verifying store event on " + JDOHelper.getObjectId(source)); } if (hasDeleteEventBeenPassed) { fail(ASSERTION_FAILED, "PC instances must not be flushed " + "after delete has been executed."); } oidsOfUpdateInstances.add(JDOHelper.getObjectId(source)); } } if (!equalsCollection(oidsOfDeletedInstances, this.expectedOids)) { String lf = System.getProperty("line.separator"); fail(ASSERTION_FAILED, "Got delete events for oids " + oidsOfDeletedInstances + '.' + lf + "Expected deleted events for oids " + this.expectedOids + '.'); } else if (!oidsOfUpdateInstances.containsAll(this.expectedOids)) { String lf = System.getProperty("line.separator"); fail(ASSERTION_FAILED, "Got store events for oids " + oidsOfUpdateInstances + '.' + lf + "Expected store events for oids " + this.expectedOids + '.'); } } /** * @see DeleteLifecycleListener#preDelete(javax.jdo.listener.InstanceLifecycleEvent) */ public void preDelete(InstanceLifecycleEvent event) { if (logger.isDebugEnabled()) { logger.debug("preDelete event: " + JDOHelper.getObjectId(event.getSource())); } } /** * @see DeleteLifecycleListener#postDelete(javax.jdo.listener.InstanceLifecycleEvent) */ public void postDelete(InstanceLifecycleEvent event) { this.events.add(event); if (logger.isDebugEnabled()) { logger.debug("postDelete event: " + JDOHelper.getObjectId(event.getSource())); } } /** * @see StoreLifecycleListener#preStore(javax.jdo.listener.InstanceLifecycleEvent) */ public void preStore(InstanceLifecycleEvent event) { if (logger.isDebugEnabled()) { logger.debug("preStore event: " + JDOHelper.getObjectId(event.getSource())); } } /** * @see StoreLifecycleListener#postStore(javax.jdo.listener.InstanceLifecycleEvent) */ public void postStore(InstanceLifecycleEvent event) { this.events.add(event); if (logger.isDebugEnabled()) { logger.debug("postStore event: " + JDOHelper.getObjectId(event.getSource())); } } } } tck/src/java/org/apache/jdo/tck/query/delete/DeletePersistentAll.java100664 11371 12500110373 26136 0ustarmbouschenstaff 0 0 /* * 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.query.delete; import java.util.HashMap; import java.util.Map; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Insurance; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Delete Persistent All. *
*Keywords: query *
*Assertion ID: A14.8-1, A14.8-2 *
*Assertion Description: * These methods delete the instances of affected classes * that pass the filter, and all dependent instances. * Affected classes are the candidate class and * its persistence-capable subclasses. * * The number of instances of affected classes that were deleted is returned. * Embedded instances and dependent instances are not counted * in the return value. */ public class DeletePersistentAll extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.8-1 (DeletePersistentAll) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Insurance.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Insurance.class, /*EXCLUDE*/ null, /*WHERE*/ "carrier == param", /*VARIABLES*/ null, /*PARAMETERS*/ "String param", /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** * The main 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(DeletePersistentAll.class); } /** */ public void testNoParametersAPI() { deletePersistentAllByAPIQuery(ASSERTION_FAILED, VALID_QUERIES[0], null, 11); } /** */ public void testNoParametersSingleString() { deletePersistentAllBySingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[0], null, 11); } /** */ public void testObjectArrayParametersAPI() { Object[] parameters = new Object[] {"Carrier1"}; deletePersistentAllByAPIQuery(ASSERTION_FAILED, VALID_QUERIES[1], parameters, 2); } /** */ public void testObjectArrayParametersSingleString() { Object[] parameters = new Object[] {"Carrier1"}; deletePersistentAllBySingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[1], parameters, 2); } /** */ public void testMapParametersAPI() { Map parameters = new HashMap(); parameters.put("param", "Carrier1"); deletePersistentAllByAPIQuery(ASSERTION_FAILED, VALID_QUERIES[1], parameters, 2); } /** */ public void testMapParametersSingleString() { Map parameters = new HashMap(); parameters.put("param", "Carrier1"); deletePersistentAllBySingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[1], parameters, 2); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/delete/DeleteQueryElements.java100664 21145 12500110373 26147 0ustarmbouschenstaff 0 0 /* * 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.query.delete; import java.math.BigDecimal; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.DentalInsurance; import org.apache.jdo.tck.pc.company.FullTimeEmployee; import org.apache.jdo.tck.pc.company.Insurance; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.query.result.classes.FullName; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Delete Query Elements. *
*Keywords: query *
*Assertion ID: A14.8-3 *
*Assertion Description: * Query elements filter, parameters, imports, variables, * and unique are valid in queries used for delete. * Elements result, result class, range, grouping, and ordering are invalid. * If any of these elements is set to its non-default value * when one of the deletePersistentAll methods is called, * a JDOUserException is thrown and no instances are deleted. */ public class DeleteQueryElements extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.8-1 (DeleteQueryElements) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { new QueryElementHolder( /*UNIQUE*/ Boolean.TRUE, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ DentalInsurance.class, /*EXCLUDE*/ null, /*WHERE*/ "((FullTimeEmployee)employee).salary > 10000 & " + "employee.projects.contains(p) & p.budget > limit", /*VARIABLES*/ "Project p", /*PARAMETERS*/ "BigDecimal limit", /*IMPORTS*/ "import org.apache.jdo.tck.pc.company.Project; " + "import java.math.BigDecimal;", /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** * The array of invalid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] INVALID_QUERIES = { // The query is invalid because it defines a result clause. new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "carrier", /*INTO*/ null, /*FROM*/ Insurance.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // The query is invalid because it defines a result class. new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ String.class, /*FROM*/ Insurance.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // The query is invalid because it defines a result clause // and a result class. new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "carrier", /*INTO*/ String.class, /*FROM*/ Insurance.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // The query is invalid because it defines a grouping clause. new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Insurance.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ "carrier", /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // The query is invalid because it defines a result clause // and a grouping clause new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "carrier", /*INTO*/ null, /*FROM*/ Insurance.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ "carrier", /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // The query is invalid because it defines an ordering clause. new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Insurance.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ "carrier", /*FROM*/ null, /*TO*/ null), // The query is invalid because it defines a range clause. new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Insurance.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ "0", /*TO*/ "5"), // The query is valid but deletePersistentAll is expected // to throw a JDOUserException because it defines a // unique clause but it affects multiple rows in the database. new QueryElementHolder( /*UNIQUE*/ Boolean.TRUE, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Insurance.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** Parameters of valid queries. */ private Object[][] parameters = { {new BigDecimal("2500000")} }; /** * The main 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(DeleteQueryElements.class); } /** */ public void testAPI() { int index = 0; deletePersistentAllByAPIQuery(ASSERTION_FAILED, VALID_QUERIES[index], parameters[index], 1); } /** */ public void testSingleString() { int index = 0; deletePersistentAllBySingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index], parameters[index], 1); } /** */ public void testNegative() { for (int i = 0; i < INVALID_QUERIES.length; i++) { deletePersistentAllByAPIQuery(ASSERTION_FAILED, INVALID_QUERIES[i], null, -1); deletePersistentAllBySingleStringQuery(ASSERTION_FAILED, INVALID_QUERIES[i], null, -1); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/AssignmentPrePostIncrementDecrementNotSupported.java100664 11751 12500110373 33603 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql; import javax.jdo.JDOUserException; import javax.jdo.PersistenceManager; import javax.jdo.Query; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Assignment, Pre- and Post-Increment and Decrement Operators *are not supported *
*Keywords: query *
*Assertion IDs: A14.6.2-7. *
*Assertion Description: The assignment operators =, +=, etc. and pre- and post-increment and -decrement are not supported in a Query filter. */ public class AssignmentPrePostIncrementDecrementNotSupported extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-7 (AssignmentPrePostIncrementDecrementNotSupported) failed: "; /** * The main 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(AssignmentPrePostIncrementDecrementNotSupported.class); } /** */ public void testNegative() { PersistenceManager pm = getPM(); runTestUnsupportedOperators01(pm, "x = 1"); runTestUnsupportedOperators01(pm, "x += 1"); runTestUnsupportedOperators01(pm, "x -= 1"); runTestUnsupportedOperators01(pm, "x *= 1"); runTestUnsupportedOperators01(pm, "x /= 1"); runTestUnsupportedOperators01(pm, "x &= 1"); runTestUnsupportedOperators01(pm, "x |= 1"); runTestUnsupportedOperators01(pm, "x ^= 1"); runTestUnsupportedOperators01(pm, "x %= 1"); runTestUnsupportedOperators01(pm, "x++ == 1"); runTestUnsupportedOperators01(pm, "x-- == 1"); runTestUnsupportedOperators01(pm, "++x == 1"); runTestUnsupportedOperators01(pm, "--x == 1"); runTestUnsupportedOperators02(pm, "x == ++param", new Integer(1)); runTestUnsupportedOperators02(pm, "x == --param", new Integer(1)); runTestUnsupportedOperators02(pm, "x == param++", new Integer(1)); runTestUnsupportedOperators02(pm, "x == param--", new Integer(1)); pm.close(); pm = null; } /** */ void runTestUnsupportedOperators01(PersistenceManager pm, String filter) { Query query = pm.newQuery(); String expectedMsg = "setFilter: Syntax error unexpected token ..."; query.setClass(PCPoint.class); query.setCandidates(pm.getExtent(PCPoint.class, false)); try { query.setFilter(filter); query.compile(); fail(ASSERTION_FAILED, "Test UnsupportedOperators01(" + filter + ") - " + "Missing JDOUserException(" + expectedMsg + ")"); } catch (JDOUserException ex) { // expected exception if (debug) { logger.debug("expected exception: " + ex); logger.debug("Test UnsupportedOperators01(\"" + filter + "\") - Passed\n"); } } } /** */ void runTestUnsupportedOperators02(PersistenceManager pm, String filter, Integer param) { Query query = pm.newQuery(); String params = "Integer param"; String expectedMsg = "setFilter: Syntax error unexpected token ..."; query.setClass(PCPoint.class); query.setCandidates(pm.getExtent(PCPoint.class, false)); query.declareParameters(params); try { query.setFilter(filter); query.compile(); fail(ASSERTION_FAILED, "Test UnsupportedOperators02(" + filter + ") - " + "Missing JDOUserException(" + expectedMsg + ")"); } catch (JDOUserException ex) { if (debug) { logger.debug("expected exception: " + ex); logger.debug("Test UnsupportedOperators02(\"" + filter + "\") - Passed\n"); } } } } tck/src/java/org/apache/jdo/tck/query/jdoql/Cast.java100664 7543 12500110373 22751 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Department; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Cast Query Operator *
*Keywords: query *
*Assertion ID: A14.6.2-38. *
*Assertion Description: The cast operator can be used for type conversions on classes. */ public class Cast extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-38 (Cast) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ "((FullTimeEmployee)this).salary > 15000.0", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ "import org.apache.jdo.tck.pc.company.FullTimeEmployee", /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Department.class, /*EXCLUDE*/ null, /*WHERE*/ "employees.contains(e) && ((FullTimeEmployee)e).salary > 15000.0", /*VARIABLES*/ "Employee e", /*PARAMETERS*/ null, /*IMPORTS*/ "import org.apache.jdo.tck.pc.company.FullTimeEmployee", /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** * The expected results of valid queries. */ private Object[] expectedResult = { getTransientCompanyModelInstancesAsList(new String[]{"emp1", "emp5"}), getTransientCompanyModelInstancesAsList(new String[]{"dept1", "dept2"}) }; /** * The main 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(Cast.class); } /** */ public void testPositive() { for (int i = 0; i < VALID_QUERIES.length; i++) { executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/CharacterAndStringLiterals.java100664 12754 12500110373 27305 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.MylibReader; import org.apache.jdo.tck.pc.mylib.PrimitiveTypes; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Character and String Literals. *
*Keywords: query *
*Assertion ID: A14.6.2-42. *
*Assertion Description: * There is no distinction made between character literals and * String literals. Single character String literals can be used * wherever character literals are permitted. * String literals are allowed to be delimited by single quote marks * or double quote marks. This allows String literal filters * to use single quote marks instead of escaped double quote marks. */ public class CharacterAndStringLiterals extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-42 (CharacterAndStringLiterals) failed: "; /** * The array of invalid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] INVALID_QUERIES = { new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ PrimitiveTypes.class, /*EXCLUDE*/ null, /*WHERE*/ "charNotNull == 'O.'", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ PrimitiveTypes.class, /*EXCLUDE*/ null, /*WHERE*/ "charNotNull == \"O.\"", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ PrimitiveTypes.class, /*EXCLUDE*/ null, /*WHERE*/ "stringNull.startsWith('Even') || charNotNull == 'O'", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ PrimitiveTypes.class, /*EXCLUDE*/ null, /*WHERE*/ "stringNull.startsWith(\"Even\") || charNotNull == \"O\"", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** * The expected results of valid queries. */ private Object[] expectedResult = { getTransientMylibInstancesAsList(new String[]{ "primitiveTypesCharacterStringLiterals"}) }; /** * The main 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(CharacterAndStringLiterals.class); } /** */ public void testPositive() { if (isUnconstrainedVariablesSupported()) { for (int i = 0; i < VALID_QUERIES.length; i++) { executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); } } } /** */ public void testNegative() { for (int i = 0; i < INVALID_QUERIES.length; i++) { compileAPIQuery(ASSERTION_FAILED, INVALID_QUERIES[i], false); compileSingleStringQuery(ASSERTION_FAILED, INVALID_QUERIES[i], false); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(MylibReader.getTearDownClasses()); loadAndPersistMylib(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/ComparingCollectionFieldToNull.java100664 10005 12500110373 30117 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Comparing a Collection Field to Null *
*Keywords: query nullcollection *
*Assertion ID: A14.6.2-36. *
*Assertion Description: * For datastores that support null values for * Collection types, it is valid to compare the field to * null. Datastores that do not support null values * for Collection types will return false if the query * compares the field to null. */ public class ComparingCollectionFieldToNull extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-36 (ComparingCollectionFieldToNull) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ "personid == 1 && projects == null", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** * The expected results of valid queries. */ private Object[] expectedResult; /** * The main 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(ComparingCollectionFieldToNull.class); } /** */ public void testPositive() { for (int i = 0; i < VALID_QUERIES.length; i++) { executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); Employee employee = (Employee) getPersistentCompanyModelInstance("emp1"); expectedResult = new Object[] { // emp1 should be in the query result set, // if the JDO Implentation supports null values for Collections getTransientCompanyModelInstancesAsList( isNullCollectionSupported() ? new String[]{"emp1"} : new String[]{}) }; if (isNullCollectionSupported()) { getPM().currentTransaction().begin(); employee.setProjects(null); getPM().currentTransaction().commit(); } } } tck/src/java/org/apache/jdo/tck/query/jdoql/ComparingPersistentAndNonPersistentInstance.java100664 10034 12500110373 32730 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Comparing persistent and non-persistent instance *
*Keywords: query *
*Assertion ID: A14.6.2-44. *
*Assertion Description: * Comparisons between persistent and non-persistent instances return * not equal. */ public class ComparingPersistentAndNonPersistentInstance extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-36 (ComparingPersistentAndNonPersistentInstance) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ "this == param", /*VARIABLES*/ null, /*PARAMETERS*/ "Employee param", /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ "this.personid == param.personid", /*VARIABLES*/ null, /*PARAMETERS*/ "Employee param", /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** * The expected results of valid queries. */ private Object[] expectedResult = { getTransientCompanyModelInstancesAsList(new String[]{}), getTransientCompanyModelInstancesAsList(new String[]{"emp1"}) }; /** Parameters of valid queries. */ private Object[][] parameters = { {getTransientCompanyModelInstance("emp1")}, {getTransientCompanyModelInstance("emp1")} }; /** * The main 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(ComparingPersistentAndNonPersistentInstance.class); } /** */ public void testPositive() { for (int i = 0; i < VALID_QUERIES.length; i++) { executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[i], parameters[i], expectedResult[i]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[i], parameters[i], expectedResult[i]); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/DenoteUniquenessInFilter.java100664 14035 12500110373 27024 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Department; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Element Returned in Query Result *
*Keywords: query *
*Assertion ID: A14.6.2-2. *
*Assertion Description: An element of the candidate collection is returned in the result if:

  • it is assignment compatible to the candidate Class of the Query; and
  • for all variables there exists a value for which the filter expression evaluates to true. The user may denote uniqueness in the filter expression by explicitly declaring an expression (for example, e1 != e2).
*/ public class DenoteUniquenessInFilter extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-2 (DenoteUniquenessInFilter) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { // Uniqueness not specified. // emp1 qualifies for both contains clause => result is dept1 new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Department.class, /*EXCLUDE*/ null, /*WHERE*/ "employees.contains(e1) && (e1.personid == 1 && " + "(employees.contains(e2) && (e2.weeklyhours == 40)))", /*VARIABLES*/ "Employee e1; Employee e2", /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // Uniqueness specified. // Only emp3 qualifies for both contains clause. // Condition e1 != e2 violated => result is empty new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Department.class, /*EXCLUDE*/ null, /*WHERE*/ "employees.contains(e1) && (e1.personid == 3 && " + "(employees.contains(e2) && (e2.weeklyhours == 19 && " + "e1 != e2)))", /*VARIABLES*/ "Employee e1; Employee e2", /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // Uniqueness specified. // Only emp1 matches the first contains clause. // emp1 and emp2 match the second contains clause. // Thus, there are two different values for e1 and e2 // satifying the entire filter => result is dept1 new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Department.class, /*EXCLUDE*/ null, /*WHERE*/ "employees.contains(e1) && (e1.personid == 1 && " + "(employees.contains(e2) && (e2.weeklyhours == 40 && " + "e1 != e2)))", /*VARIABLES*/ "Employee e1; Employee e2", /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** * The expected results of valid queries. */ private Object[] expectedResult = { // Uniqueness not specified. // emp1 qualifies for both contains clause => result is dept1 getTransientCompanyModelInstancesAsList(new String[]{"dept1"}), // Uniqueness specified. // Only emp3 qualifies for both contains clause. // Condition e1 != e2 violated => result is empty getTransientCompanyModelInstancesAsList(new String[]{}), // Uniqueness specified. // Only emp1 matches the first contains clause. // emp1 and emp2 match the second contains clause. // Thus, there are two different values for e1 and e2 // satifying the entire filter => result is dept1 getTransientCompanyModelInstancesAsList(new String[]{"dept1"}) }; /** * The main 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(DenoteUniquenessInFilter.class); } /** */ public void testPositive() { for (int i = 0; i < VALID_QUERIES.length; i++) { executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/ExecuteQueryWhenPersistenceManagerIsClosed.java100664 6254 12500110373 32455 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql; import javax.jdo.JDOFatalUserException; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Execute Query when Persistence Manager is Closed *
*Keywords: query *
*Assertion ID: A14.6.1-1. *
*Assertion Description: If the PersistenceManager which constructed the Query is closed, then the Query.execute methods throw JDOFatalUserException. */ public class ExecuteQueryWhenPersistenceManagerIsClosed extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.1-1 (ExecuteQueryWhenPersistenceManagerIsClosed) failed: "; /** * The main 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(ExecuteQueryWhenPersistenceManagerIsClosed.class); } /** */ public void test() { pm = getPM(); runTestExecuteQueryWhenPersistenceManagerIsClosed(pm); //pm.close(); pm = null; } /** */ void runTestExecuteQueryWhenPersistenceManagerIsClosed(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(); query.setClass(PCPoint.class); query.setCandidates(pm.getExtent(PCPoint.class, false)); query.setFilter("x == 4"); query.compile(); Object results = query.execute(); tx.commit(); tx = null; pm.close(); try { Object result = query.execute(); fail(ASSERTION_FAILED, "Query.execute after pm is closed should throw JDOUserException."); } catch (JDOFatalUserException ex) { // expected exception if (debug) logger.debug("expected exception " + ex); } } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/query/jdoql/ExecutingMultipleQueriesSimultaneouslyIsThreadSafe.java100664 14164 12500110373 34302 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql; import java.util.Collection; import java.util.Iterator; import java.util.Map; import java.util.Set; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.util.ThreadExceptionHandler; /** *Title: Executing Multiple Queries Simultaneously is ThreadSafe *
*Keywords: query concurrency *
*Assertion ID: A14.3-2. *
*Assertion Description: Multiple queries might be executed simultaneously by different threads (but the implementation might choose to execute them serially). In either case, the execution must be thread safe. */ public class ExecutingMultipleQueriesSimultaneouslyIsThreadSafe extends MultipleActiveQueryInstanceInSamePersistenceManager { static int nrOfThreads = 20; /** */ private static final String ASSERTION_FAILED = "Assertion A14.3-2 (ExecutingMultipleQueriesSimultaneouslyIsThreadSafe) failed: "; /** * The main 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(ExecutingMultipleQueriesSimultaneouslyIsThreadSafe.class); } /** */ public void testPositive() { PersistenceManager pm = getPM(); Transaction tx = pm.currentTransaction(); try { tx.begin(); if (debug) logger.debug(getThreadName() + ": Starting " + nrOfThreads + " concurrent threads."); ThreadExceptionHandler group = new ThreadExceptionHandler(); Thread[] threads = new Thread[nrOfThreads]; for (int i = 0; i < nrOfThreads; i++) { // Runnable r = new QueryExecuter(pm); Runnable r = new ExecutingMultipleQueriesSimultaneouslyIsThreadSafe(). getQueryExecuter(pm); Thread t = new Thread(group, r); t.setName("ThreadID-" + i); threads[i] = t; if (debug) logger.debug(getThreadName() + ": Running"); t.start(); } if (debug) logger.debug(getThreadName() + ": Waiting for threads to join..."); for (int i = 0; i < nrOfThreads; i++) { try { threads[i].join(); } catch (InterruptedException e) { } } if (debug) logger.debug(getThreadName() + ": All threads joined."); tx.commit(); tx = null; // check unhandled exceptions Set uncaught = group.getAllUncaughtExceptions(); if ((uncaught != null) && !uncaught.isEmpty()) { for (Iterator i = uncaught.iterator(); i.hasNext();) { Map.Entry next = (Map.Entry)i.next(); Thread thread = (Thread)next.getKey(); Throwable problem = (Throwable)next.getValue(); if (debug) { logger.debug("uncaught exception in thread " + thread + " stacktrace:"); problem.printStackTrace(); } fail(ASSERTION_FAILED, "Thread " + thread + ": uncaught exception " + problem); } } } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ String getThreadName() { return "[" + Thread.currentThread().getName() + "]"; } /** Will be removed. */ Runnable getQueryExecuter(PersistenceManager pm) { return new QueryExecuter(pm); } /** Will be removed. */ void executeQueries(PersistenceManager ignore) { pm = getPM(); setInsertedObjects(pm); super.executeQueries(pm); pm.close(); pm = null; } /** Will be removed. */ void setInsertedObjects(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(); query.setClass(PCPoint.class); query.setCandidates(pm.getExtent(PCPoint.class, false)); Object results = query.execute(); for (Iterator i=((Collection)results).iterator(); i.hasNext();) { inserted.add(i.next()); } tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ class QueryExecuter implements Runnable { final PersistenceManager pm; /** */ public QueryExecuter(PersistenceManager pm) { this.pm = pm; } /** */ public void run() { ExecutingMultipleQueriesSimultaneouslyIsThreadSafe.this.executeQueries(pm); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint.class); loadAndPersistPCPoints(getPM()); } } ././@LongLink100644 0 0 147 12500111677 10255 Lustar 0 0 tck/src/java/org/apache/jdo/tck/query/jdoql/ExecutingQueryWhenNoTransactionNoNontransactionalRead.javatck/src/java/org/apache/jdo/tck/query/jdoql/ExecutingQueryWhenNoTransactionNoNontransactionalRead.ja100664 5510 12500110373 34355 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql; import javax.jdo.Extent; import javax.jdo.JDOUserException; import javax.jdo.PersistenceManager; import javax.jdo.Query; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Executing Query when no Transaction, no NontransactionalRead *
*Keywords: query *
*Assertion ID: A14.6.1-2. *
*Assertion Description: If the NontransactionalRead property is false, and a transaction is not active, then the execute methods throw JDOUserException. */ public class ExecutingQueryWhenNoTransactionNoNontransactionalRead extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.1-2 (ExecutingQueryWhenNoTransactionNoNontransactionalRead) failed: "; /** * The main 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(ExecutingQueryWhenNoTransactionNoNontransactionalRead.class); } /** */ public void testNegative() { PersistenceManager pm = getPM(); pm.currentTransaction().setNontransactionalRead(false); runTestNewQuery(pm); } /** */ void runTestNewQuery(PersistenceManager pm) { Class clazz = PCPoint.class; Extent extent = pm.getExtent(clazz, true); Query query = pm.newQuery(); query.setClass(clazz); query.setCandidates(extent); try { Object results = query.execute(); fail(ASSERTION_FAILED, "Querying outside transactions should throw exception with non transactional read set to false"); } catch (JDOUserException ex) { // expected exception if (debug) logger.debug("expected exception " + ex); } } } tck/src/java/org/apache/jdo/tck/query/jdoql/Having.java100664 13613 12500110373 23306 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql; import java.util.Arrays; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Having. *
*Keywords: query *
*Assertion ID: A14.6.10-2. *
*Assertion Description: * When having is specified, the having expression consists of * arithmetic and boolean expressions containing aggregate expressions. */ public class Having extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.10-2 (Having) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "department, AVG(weeklyhours)", /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ "department HAVING COUNT(department) > 0", /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // HAVING clause uses field that isn't contained in the SELECT clause. new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "department, AVG(weeklyhours)", /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ "department HAVING COUNT(personid) > 1", /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** * The array of invalid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] INVALID_QUERIES = { // HAVING clause is not a boolean expression new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "department, AVG(weeklyhours)", /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ "department HAVING firstname", /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // HAVING clause is a non-aggregate expression using a non-grouping field new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "department, AVG(weeklyhours)", /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ "department HAVING firstname == 'emp1First'", /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** * The expected results of valid queries. */ private Object[] expectedResult = { Arrays.asList(new Object[] { new Object[] { getTransientCompanyModelInstance("dept1"), new Double(33.0)}, new Object[] { getTransientCompanyModelInstance("dept2"), new Double(0.0)}}), Arrays.asList(new Object[] { new Object[] { getTransientCompanyModelInstance("dept1"), new Double(33.0)}, new Object[] { getTransientCompanyModelInstance("dept2"), new Double(0.0)}}) }; /** * The main 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(Having.class); } /** */ public void testPositive() { for (int i = 0; i < VALID_QUERIES.length; i++) { executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); } } /** */ public void testNegative() { for (int i = 0; i < INVALID_QUERIES.length; i++) { compileAPIQuery(ASSERTION_FAILED, INVALID_QUERIES[i], false); compileSingleStringQuery(ASSERTION_FAILED, INVALID_QUERIES[i], false); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/IdentifiersEqualFieldNames.java100664 13034 12500110373 27254 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Department; import org.apache.jdo.tck.pc.company.Person; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Identifiers Equal Field Names. *
*Keywords: query *
*Assertion ID: A14.6.2-43. *
*Assertion Description: * Identifiers that are persistent field names or * public final static field names are required * to be supported by JDO implementations. */ public class IdentifiersEqualFieldNames extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-43 (IdentifiersEqualFieldNames) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ "this.firstname == 'emp1First'", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ "this.personid < Byte.MAX_VALUE", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Department.class, /*EXCLUDE*/ null, /*WHERE*/ "employees.size() > org.apache.jdo.tck.pc.company.Department.RECOMMENDED_NO_OF_EMPS", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Department.class, /*EXCLUDE*/ null, /*WHERE*/ "employees.size() > Department.RECOMMENDED_NO_OF_EMPS", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Department.class, /*EXCLUDE*/ null, /*WHERE*/ "employees.size() > RECOMMENDED_NO_OF_EMPS", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** * The expected results of valid queries. */ private Object[] expectedResult = { getTransientCompanyModelInstancesAsList(new String[]{"emp1"}), getTransientCompanyModelInstancesAsList(new String[]{ "emp1", "emp2", "emp3", "emp4", "emp5"}), getTransientCompanyModelInstancesAsList(new String[]{"dept1"}), getTransientCompanyModelInstancesAsList(new String[]{"dept1"}), getTransientCompanyModelInstancesAsList(new String[]{"dept1"}) }; /** * The main 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(IdentifiersEqualFieldNames.class); } /** */ public void testPositive() { for (int i = 0; i < VALID_QUERIES.length; i++) { executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/IfElseInFilter.java100664 16702 12500110373 24700 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.DentalInsurance; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.pc.company.FullTimeEmployee; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Use of If Else expression in filter *
*Keywords: query *
*Assertion ID: A14.6.x *
*Assertion Description: */ public class IfElseInFilter extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.x (IfElseInFilter) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { // simple If/Else using literals new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ FullTimeEmployee.class, /*EXCLUDE*/ null, /*WHERE*/ "this.salary > (IF (this.department.name == 'Development') 15000 ELSE 25000)", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ "this.personid", /*FROM*/ null, /*TO*/ null), // simple If/Else using relationships new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ "(IF (this.manager == null) this.mentor.department.deptid ELSE this.manager.department.deptid) == this.department.deptid", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ "this.personid", /*FROM*/ null, /*TO*/ null), // multiple If/Else with distinct conditions new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ FullTimeEmployee.class, /*EXCLUDE*/ null, /*WHERE*/ "(IF (0.0 <= this.salary && this.salary < 10000.1) 1 ELSE IF (10000.1 <= this.salary && this.salary < 20000.1) 2 ELSE IF (20000.1 <= this.salary && this.salary < 30000.1) 3 ELSE 4) == 2", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ "this.personid", /*FROM*/ null, /*TO*/ null), // multiple If/Else with overlapping conditions new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ FullTimeEmployee.class, /*EXCLUDE*/ null, /*WHERE*/ "(IF (this.salary < 10000.1) 1 ELSE IF (this.salary < 20000.1) 2 ELSE IF (this.salary < 30000.1) 3 ELSE 4) == 2", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ "this.personid", /*FROM*/ null, /*TO*/ null) }; /** * The array of invalid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] INVALID_QUERIES = { // Invalid type of condition expression new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ "(IF (this.firstname) 0 ELSE 1) == 0", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // missing ELSE new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ DentalInsurance.class, /*EXCLUDE*/ null, /*WHERE*/ "(IF (this.employee == null) 15000) == 15000", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // type of THEN expr must be the same as type of ELSE expr new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ DentalInsurance.class, /*EXCLUDE*/ null, /*WHERE*/ "(IF (this.employee == null) 'Michael' ELSE this.employee) == 'Michael'", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** * The expected results of valid queries. */ private Object[] expectedResult = { getTransientCompanyModelInstancesAsList(new String[]{"emp1", "emp5"}), getTransientCompanyModelInstancesAsList(new String[]{"emp1", "emp2", "emp3"}), getTransientCompanyModelInstancesAsList(new String[]{"emp1"}), getTransientCompanyModelInstancesAsList(new String[]{"emp1"}) }; /** * The main 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(IfElseInFilter.class); } /** */ public void testPositive() { for (int i = 0; i < VALID_QUERIES.length; i++) { executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); } } /** */ public void testNegative() { for (int i = 0; i < INVALID_QUERIES.length; i++) { compileAPIQuery(ASSERTION_FAILED, INVALID_QUERIES[i], false); compileSingleStringQuery(ASSERTION_FAILED, INVALID_QUERIES[i], false); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/IgnoreCacheFalse.java100664 14464 12500110373 25221 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql; import java.util.Collection; import java.util.Iterator; import javax.jdo.JDOHelper; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PrimitiveTypes; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Query with ignoreCache=false. *
*Keywords: query *
*Assertion ID: A14.6.1-7. *
*Assertion Description: * With ignoreCache set to false: *
    *
  • if instances were made persistent in the current transaction, * the instances will be considered part of the candidate instances.
  • *
  • if instances were deleted in the current transaction, the instances * will not be considered part of the candidate instances.
  • *
  • modified instances will be evaluated using their current transactional * values.
  • *
*/ public class IgnoreCacheFalse extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.1-7 (IgnoreCacheFalse) failed: "; /** * The main 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(IgnoreCacheFalse.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PrimitiveTypes.class); super.localSetUp(); loadAndPersistPrimitiveTypes(getPM()); } /** */ public void test() { pm = getPM(); try { // set ignoreCache flag pm.setIgnoreCache(false); runTestNewInstance(pm); runTestDeletedInstance(pm); runTestModifiedInstance(pm); } finally { pm.close(); pm = null; } } /** */ void runTestNewInstance(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); tx.begin(); // create new instance PrimitiveTypes newInstance = new PrimitiveTypes(); newInstance.setId(98L); newInstance.setIntNotNull(98); pm.makePersistent(newInstance); Collection result = (Collection)pm.newQuery( PrimitiveTypes.class, "intNotNull == 98").execute(); // check result if (result.isEmpty()) fail(ASSERTION_FAILED, "Query should find new instance, but query result is empty"); Iterator i = result.iterator(); PrimitiveTypes p = (PrimitiveTypes)i.next(); if (p.getId() != 98L) fail(ASSERTION_FAILED, "Query returned wrong instance with id " + p.getId()); if (i.hasNext()) fail(ASSERTION_FAILED, "Query returned more than one instance"); if (debug) logger.debug("New instance is part of query result"); tx.rollback(); } /** */ void runTestDeletedInstance(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); tx.begin(); Collection tmp = (Collection)pm.newQuery( PrimitiveTypes.class, "id == 3").execute(); PrimitiveTypes instance3 = (PrimitiveTypes)tmp.iterator().next(); pm.deletePersistent(instance3); Collection result = (Collection)pm.newQuery( PrimitiveTypes.class, "intNotNull == 3").execute(); // check result if (result.isEmpty()) { if (debug) logger.debug("deleted instance not part of query result."); } else { // query result not empty => problem PrimitiveTypes p = (PrimitiveTypes)result.iterator().next(); if (JDOHelper.isDeleted(p)) fail(ASSERTION_FAILED, "query result should not include deleted instance"); else fail(ASSERTION_FAILED, "query returns suspicious isntance " + p); } tx.rollback(); } /** */ void runTestModifiedInstance(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); tx.begin(); Collection tmp = (Collection)pm.newQuery( PrimitiveTypes.class, "id == 5").execute(); PrimitiveTypes instance5 = (PrimitiveTypes)tmp.iterator().next(); instance5.setIntNotNull(99); Collection result = (Collection)pm.newQuery( PrimitiveTypes.class, "intNotNull == 99").execute(); // check result if (result.isEmpty()) { fail(ASSERTION_FAILED, "Query should find modified instance, but query result is empty"); } Iterator i = result.iterator(); PrimitiveTypes p = (PrimitiveTypes)i.next(); if (p.getId() != 5L) fail(ASSERTION_FAILED, "Query returned wrong instance with id " + p.getId()); if (p.getIntNotNull() != 99) fail(ASSERTION_FAILED, "Query returned instance with wrong intNotNull field value " + p.getIntNotNull()); if (i.hasNext()) fail(ASSERTION_FAILED, "Query returned more than one instance"); if (debug) logger.debug("Modified instance is part of query result"); tx.rollback(); } } tck/src/java/org/apache/jdo/tck/query/jdoql/keywords/InvalidUseOfKeywords.java100664 10024 12500110373 30012 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.keywords; import org.apache.jdo.tck.pc.company.Person; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Invalid uses of keywords. *
*Keywords: query *
*Assertion ID: A14.4-6. *
*Assertion Description: * Keywords must not be used as package names, class names, * parameter names, or variable names in queries. */ public class InvalidUseOfKeywords extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.4-6 (InvalidUseOfKeywords) failed: "; /** The array of invalid single string queries. */ private static final String[] INVALID_SINGLE_STRING_QUERIES = { "SELECT INTO range.PersonResult FROM org.apache.jdo.tck.pc.company.Person", "SELECT INTO range FROM org.apache.jdo.tck.pc.company.Person", "SELECT FROM select.Person", "SELECT FROM select", "SELECT FROM org.apache.jdo.tck.pc.company.Person PARAMETERS int this", "SELECT FROM org.apache.jdo.tck.pc.company.Person VARIABLES long this" }; /** * The array of invalid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] INVALID_QUERIES = { new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ "int this", /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ "long this", /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** * The main 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(InvalidUseOfKeywords.class); } /** */ public void testNegative() { for (int i = 0; i < INVALID_SINGLE_STRING_QUERIES.length; i++) { compileSingleStringQuery(ASSERTION_FAILED, INVALID_SINGLE_STRING_QUERIES[i], false); } for (int i = 0; i < INVALID_QUERIES.length; i++) { compileAPIQuery(ASSERTION_FAILED, INVALID_QUERIES[i], false); compileSingleStringQuery(ASSERTION_FAILED, INVALID_QUERIES[i], false); } } } tck/src/java/org/apache/jdo/tck/query/jdoql/keywords/KeywordsAsFieldNames.java100664 7163 12500110373 27747 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.keywords; import org.apache.jdo.tck.pc.query.JDOQLKeywordsAsFieldNames; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Keywords as field names. *
*Keywords: query *
*Assertion ID: A14.4-7. *
*Assertion Description: * Keywords are permitted as field names only * if they are on the right side of the "." in field access expressions. */ public class KeywordsAsFieldNames extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.4-7 (KeywordsAsFieldNames) failed: "; /** * The array of invalid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] INVALID_QUERIES = { new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "select", /*INTO*/ null, /*FROM*/ JDOQLKeywordsAsFieldNames.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "this.select", /*INTO*/ null, /*FROM*/ JDOQLKeywordsAsFieldNames.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** * The main 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(KeywordsAsFieldNames.class); } /** */ public void testPositive() { for (int i = 0; i < VALID_QUERIES.length; i++) { compileAPIQuery(ASSERTION_FAILED, VALID_QUERIES[i], true); compileSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[i], true); } } public void testNegative() { for (int i = 0; i < INVALID_QUERIES.length; i++) { compileAPIQuery(ASSERTION_FAILED, INVALID_QUERIES[i], false); compileSingleStringQuery(ASSERTION_FAILED, INVALID_QUERIES[i], false); } } } tck/src/java/org/apache/jdo/tck/query/jdoql/keywords/SingleString.java100664 7654 12500110373 26341 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.keywords; import java.math.BigDecimal; import java.util.Arrays; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.FullTimeEmployee; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.query.result.classes.FullName; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Single string query. *
*Keywords: query *
*Assertion ID: A14.6.13-1. *
*Assertion Description: * The String version of Query represents all query elements * using a single string. The string contains the following structure: */ public class SingleString extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.13-1 (SingleString) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { new QueryElementHolder( /*UNIQUE*/ Boolean.FALSE, /*RESULT*/ "firstname AS firstName, lastname AS lastName", /*INTO*/ FullName.class, /*FROM*/ FullTimeEmployee.class, /*EXCLUDE*/ Boolean.TRUE, /*WHERE*/ "salary > 1000 & projects.contains(p) & " + "p.budget > limit", /*VARIABLES*/ "Project p", /*PARAMETERS*/ "BigDecimal limit", /*IMPORTS*/ "import org.apache.jdo.tck.pc.company.Project; " + "import java.math.BigDecimal", /*GROUP BY*/ "firstname, lastname HAVING lastname.startsWith('emp')", /*ORDER BY*/ "lastname ASCENDING", /*FROM*/ 0, /*TO*/ 3) }; /** * The expected results of valid queries. */ private Object[] expectedResult = { Arrays.asList(new Object[]{ new FullName("emp1First", "emp1Last"), new FullName("emp2First", "emp2Last"), new FullName("emp5First", "emp5Last")}) }; /** Parameters of valid queries. */ private Object[][] parameters = { {new BigDecimal("2000")} }; /** * The main 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(SingleString.class); } /** */ public void testPositive() { for (int i = 0; i < VALID_QUERIES.length; i++) { executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[i], parameters[i], expectedResult[i]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[i], parameters[i], expectedResult[i]); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/keywords/ThisIsReservedWordForElementOfCollection.java100664 5464 12500110373 33747 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.keywords; import java.util.Collection; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PrimitiveTypes; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: This is Reserved Word for Element of Collection *
*Keywords: query *
*Assertion ID: A14.6.2-12. *
*Assertion Description: * this is a reserved word which means the element of the * candidate collection being evaluated. */ public class ThisIsReservedWordForElementOfCollection extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-12 (ThisIsReservedWordForElementOfCollection) failed: "; /** * The main 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(ThisIsReservedWordForElementOfCollection.class); } /** */ public void testPositive() { PersistenceManager pm = getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); Collection instance9 = (Collection)pm.newQuery( PrimitiveTypes.class, "id == 9").execute(); // compare this with a parameter runParameterPrimitiveTypesQuery( "this == param", "PrimitiveTypes param", instance9.iterator().next(), pm, instance9, ASSERTION_FAILED); // use this to access a field runParameterPrimitiveTypesQuery( "this.intNotNull == intNotNull", "int intNotNull", new Integer(9), pm, instance9, ASSERTION_FAILED); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PrimitiveTypes.class); loadAndPersistPrimitiveTypes(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/keywords/UppercaseLowercase.java100664 5231 12500110373 27512 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.keywords; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Keywords in uppercase and lowercase. *
*Keywords: query *
*Assertion ID: A14.6.13-2. *
*Assertion Description: * Keywords, identified above in bold, are either all upper-case * or all lower-case. Keywords cannot be mixed case. */ public class UppercaseLowercase extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.13-2 (UppercaseLowercase) failed: "; /** The array of valid single string queries. */ private static final String[] VALID_SINGLE_STRING_QUERIES = { "SELECT FROM org.apache.jdo.tck.pc.company.Person", "select from org.apache.jdo.tck.pc.company.Person", "select FROM org.apache.jdo.tck.pc.company.Person", }; /** The array of invalid single string queries. */ private static final String[] INVALID_SINGLE_STRING_QUERIES = { "SeLeCt FrOm org.apache.jdo.tck.pc.company.Person" }; /** * The main 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(UppercaseLowercase.class); } /** */ public void testPositive() { for (int i = 0; i < VALID_SINGLE_STRING_QUERIES.length; i++) { compileSingleStringQuery(ASSERTION_FAILED, VALID_SINGLE_STRING_QUERIES[i], true); } } public void testNegitve() { for (int i = 0; i < INVALID_SINGLE_STRING_QUERIES.length; i++) { compileSingleStringQuery(ASSERTION_FAILED, INVALID_SINGLE_STRING_QUERIES[i], false); } } } tck/src/java/org/apache/jdo/tck/query/jdoql/keywords/UseOfThisToAcessHiddenField.java100664 11226 12500110373 31152 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.keywords; import java.util.ArrayList; import java.util.List; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Use of this to Access Hidden Field *
*Keywords: query *
*Assertion ID: A14.4-4. *
*Assertion Description: A hidden field may be accessed using the *'this' qualifier: this.fieldName. */ public class UseOfThisToAcessHiddenField extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.4-4 (UseOfThisToAcessHiddenField) failed: "; /** * The main 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(UseOfThisToAcessHiddenField.class); } /** */ public void testPositve() { PersistenceManager pm = getPM(); runTestUseOfThisToAcessHiddenField01(pm); runTestUseOfThisToAcessHiddenField02(pm); } /** */ void runTestUseOfThisToAcessHiddenField01(PersistenceManager pm) { if (debug) logger.debug("\nExecuting test UseOfThisToAcessHiddenField01() ..."); Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(); query.setClass(PCPoint.class); query.setCandidates(pm.getExtent(PCPoint.class, false)); query.declareParameters("Integer x"); query.setFilter("this.x == x"); Object results = query.execute(new java.lang.Integer(2)); // check query result List expected = new ArrayList(); Object p3 = new PCPoint(2, 2); expected.add(p3); expected = getFromInserted(expected); printOutput(results, expected); checkQueryResultWithoutOrder(ASSERTION_FAILED, "this.x == x", results, expected); if (debug) logger.debug("Test UseOfThisToAcessHiddenField01(): Passed"); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ void runTestUseOfThisToAcessHiddenField02(PersistenceManager pm) { if (debug) logger.debug("\nExecuting test UseOfThisToAcessHiddenField02() ..."); Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(); query.setClass(PCPoint.class); query.setCandidates(pm.getExtent(PCPoint.class, false)); query.declareParameters("Integer y"); query.setFilter("this.y == y"); Object results = query.execute(new java.lang.Integer(3)); // check query result List expected = new ArrayList(); Object p4 = new PCPoint(3, 3); expected.add(p4); expected = getFromInserted(expected); printOutput(results, expected); checkQueryResultWithoutOrder(ASSERTION_FAILED, "this.y == y", results, expected); if (debug) logger.debug("Test UseOfThisToAcessHiddenField02(): Passed"); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint.class); loadAndPersistPCPoints(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/methods/EnumMethodOrdinal.java100664 7467 12500110373 27105 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.methods; import java.util.ArrayList; import java.util.Collection; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.fieldtypes.FieldsOfSimpleEnum; import org.apache.jdo.tck.pc.fieldtypes.SimpleEnum; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Supported Enum methods. *
*Keywords: query *
*Assertion ID: A14.6.2-59. *
*Assertion Description: * New supported Enum methods: *
    *
  • ordinal() *
  • toString() *
*/ public class EnumMethodOrdinal extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-59 (EnumMethodOrdinal) failed: "; /** */ private Object oidOfExpectedResult; /** * The main 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(EnumMethodOrdinal.class); } /** */ public void testOrdinal() { final String filter = "SimpleEnum0.ordinal() == 5"; PersistenceManager pm = getPM(); Transaction tx = pm.currentTransaction(); try { tx.begin(); Collection expectedResult = new ArrayList(); expectedResult.add(pm.getObjectById(oidOfExpectedResult)); Query q = pm.newQuery(); q.setClass(FieldsOfSimpleEnum.class); q.setFilter(filter); Collection results = (Collection)q.execute(); checkQueryResultWithoutOrder(ASSERTION_FAILED, filter, results, expectedResult); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(FieldsOfSimpleEnum.class); insertFieldsOfSimpleEnums(getPM()); } /** */ private void insertFieldsOfSimpleEnums(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); FieldsOfSimpleEnum f1 = new FieldsOfSimpleEnum(); f1.set(0, SimpleEnum.CA); f1.identifier = 1; pm.makePersistent(f1); FieldsOfSimpleEnum f2 = new FieldsOfSimpleEnum(); f2.set(0, SimpleEnum.HI); f2.identifier = 2; pm.makePersistent(f2); FieldsOfSimpleEnum f3 = new FieldsOfSimpleEnum(); f3.set(0, SimpleEnum.DC); f3.identifier = 3; pm.makePersistent(f3); oidOfExpectedResult = pm.getObjectId(f1); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/query/jdoql/methods/EnumMethodToString.java100664 7500 12500110373 27252 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.methods; import java.util.ArrayList; import java.util.Collection; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.fieldtypes.FieldsOfSimpleEnum; import org.apache.jdo.tck.pc.fieldtypes.SimpleEnum; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Supported Enum methods. *
*Keywords: query *
*Assertion ID: A14.6.2-59. *
*Assertion Description: * New supported Enum methods: *
    *
  • ordinal() *
  • toString() *
*/ public class EnumMethodToString extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-59 (EnumMethodToString) failed: "; /** */ private Object oidOfExpectedResult; /** * The main 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(EnumMethodToString.class); } /** */ public void testToString() { final String filter = "SimpleEnum0.toString() == 'CA'"; PersistenceManager pm = getPM(); Transaction tx = pm.currentTransaction(); try { tx.begin(); Collection expectedResult = new ArrayList(); expectedResult.add(pm.getObjectById(oidOfExpectedResult)); Query q = pm.newQuery(); q.setClass(FieldsOfSimpleEnum.class); q.setFilter(filter); Collection results = (Collection)q.execute(); checkQueryResultWithoutOrder(ASSERTION_FAILED, filter, results, expectedResult); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(FieldsOfSimpleEnum.class); insertFieldsOfSimpleEnums(getPM()); } /** */ private void insertFieldsOfSimpleEnums(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); FieldsOfSimpleEnum f1 = new FieldsOfSimpleEnum(); f1.set(0, SimpleEnum.CA); f1.identifier = 1; pm.makePersistent(f1); FieldsOfSimpleEnum f2 = new FieldsOfSimpleEnum(); f2.set(0, SimpleEnum.HI); f2.identifier = 2; pm.makePersistent(f2); FieldsOfSimpleEnum f3 = new FieldsOfSimpleEnum(); f3.set(0, SimpleEnum.DC); f3.identifier = 3; pm.makePersistent(f3); oidOfExpectedResult = pm.getObjectId(f1); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/query/jdoql/methods/MethodsAndObjectConstructionNotSupported.java100664 5642 12500110373 33677 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.methods; import javax.jdo.JDOUserException; import javax.jdo.PersistenceManager; import javax.jdo.Query; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Methods and Object Construction not Supported *
*Keywords: query *
*Assertion ID: A14.6.2-8. *
*Assertion Description: Methods, including object construction, are not *supported in a Query filter. */ public class MethodsAndObjectConstructionNotSupported extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-8 (MethodsAndObjectConstructionNotSupported) failed: "; /** * The main 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(MethodsAndObjectConstructionNotSupported.class); } /** */ public void testNegative() { PersistenceManager pm = getPM(); runTestUnsupportedOperators01(pm, Employee.class, "this.team.add(this)"); runTestUnsupportedOperators01(pm, Employee.class, "this.team.remove(this)"); runTestUnsupportedOperators01(pm, PCPoint.class, "y == new Integer(1)"); } /** */ void runTestUnsupportedOperators01(PersistenceManager pm, Class candidateClass, String filter) { String expectedMsg = "setFilter: Invalid method call ...."; Query query = pm.newQuery(); query.setClass(candidateClass); try { query.setFilter(filter); query.compile(); fail(ASSERTION_FAILED, "Missing JDOUserException(" + expectedMsg + ") for filter " + filter); } catch (JDOUserException ex) { if (debug) logger.debug("expected exception " + ex); } } } tck/src/java/org/apache/jdo/tck/query/jdoql/methods/StartsWithAndEndsWith.java100664 7730 12500110373 27725 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.methods; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: StartsWith and EndsWith Query Operators *
*Keywords: query *
*Assertion ID: A14.6.2-33. *
*Assertion Description: String methods startsWith and endsWith support wild card queries. JDO does not define any special semantic to the argument passed to the method; in particular, it does not define any wild card characters. */ public class StartsWithAndEndsWith extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-33 (StartsWithAndEndsWith) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { // startsWith new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ "firstname.startsWith(\"emp1\")", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // endsWith new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ "firstname.endsWith(\"1First\")", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** * The expected results of valid queries. */ private Object[] expectedResult = { // startsWith getTransientCompanyModelInstancesAsList(new String[]{"emp1"}), // endsWith getTransientCompanyModelInstancesAsList(new String[]{"emp1"}) }; /** * The main 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(StartsWithAndEndsWith.class); } /** */ public void testPositive() { for (int i = 0; i < VALID_QUERIES.length; i++) { executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/methods/SupportedCollectionMethods.java100664 16410 12500110373 31060 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.methods; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Department; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title:Supported collection methods *
*Keywords: query collection *
*Assertion ID: A14.6.2-45. *
*Assertion Description: * Supported collection methods: *
    *
  • isEmpty
  • *
  • contains
  • *
  • size
  • *
*/ public class SupportedCollectionMethods extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-45 (SupportedCollectionMethods) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { // contains(VARIABLE) new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Department.class, /*EXCLUDE*/ null, /*WHERE*/ "employees.contains(e) && e.personid == 1", /*VARIABLES*/ "Employee e", /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // contains(PARAMETER) new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Department.class, /*EXCLUDE*/ null, /*WHERE*/ "employees.contains(e)", /*VARIABLES*/ null, /*PARAMETERS*/ "Employee e", /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // !isEmpty new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Department.class, /*EXCLUDE*/ null, /*WHERE*/ "!employees.isEmpty()", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // isEmpty new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ "team.isEmpty()", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // size new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Department.class, /*EXCLUDE*/ null, /*WHERE*/ "employees.size() == 3", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** * The expected results of valid queries. */ private Object[] expectedResult = { // contains(VARIABLE) getTransientCompanyModelInstancesAsList(new String[]{"dept1"}), // contains(PARAMETER) getTransientCompanyModelInstancesAsList(new String[]{"dept1"}), // !isEmpty getTransientCompanyModelInstancesAsList(new String[]{"dept1", "dept2"}), // isEmpty getTransientCompanyModelInstancesAsList(new String[]{ "emp1", "emp3", "emp4", "emp5"}), // size getTransientCompanyModelInstancesAsList(new String[]{"dept1"}) }; /** * The main 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(SupportedCollectionMethods.class); } /** */ public void testContains() { int index = 0; executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); index++; getPM().currentTransaction().begin(); Object[] parameters = new Object[]{getPersistentCompanyModelInstance("emp1")}; getPM().currentTransaction().commit(); executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[index], parameters, expectedResult[index]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index], parameters, expectedResult[index]); } /** */ public void testIsEmpty() { for (int index = 2; index < 4; index++) { executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); } } /** */ public void testSize() { int index = 4; executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/methods/SupportedDateMethods.java100664 11451 12500110373 27642 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.methods; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Person; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Supported Date methods. *
*Keywords: query *
*Assertion ID: A14.6.2-60. *
*Assertion Description: * New supported Date methods: *
    *
  • getDate()
  • *
  • getMonth()
  • *
  • getYear()
  • *
*/ public class SupportedDateMethods extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-60 (SupportedDateMethods) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ "birthdate.getDate() == 10", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ "birthdate.getMonth() == 5", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ "birthdate.getYear() == 1970", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), }; /** * The expected results of valid queries. */ private Object[] expectedResult = { getTransientCompanyModelInstancesAsList(new String[]{"emp1"}), getTransientCompanyModelInstancesAsList(new String[]{"emp1"}), getTransientCompanyModelInstancesAsList(new String[]{"emp1"}), }; /** * The main 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(SupportedDateMethods.class); } /** */ public void testGetDate() { int index = 0; executeQuery(index); } /** */ public void testGetMonth() { int index = 1; executeQuery(index); } /** */ public void testGetYear() { int index = 2; executeQuery(index); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } /** */ private void executeQuery(int index) { executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); } } tck/src/java/org/apache/jdo/tck/query/jdoql/methods/SupportedJDOHelperMethods.java100664 20460 12500110373 30541 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.methods; import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import java.util.List; import javax.jdo.JDOHelper; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Person; import org.apache.jdo.tck.pc.mylib.VersionedPCPoint; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Supported JDOHelper methods. *
*Keywords: query *
*Assertion ID: A14.6.2-49. *
*Assertion Description: * Supported JDOHelper methods: *
    *
  • JDOHelper.getObjectId(Object) *
  • JDOHelper.getVersion(Object) *
*/ public class SupportedJDOHelperMethods extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-49 (SupportedJDOHelperMethods) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "JDOHelper.getObjectId(this)", /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ "JDOHelper.getObjectId(this) == oid", /*VARIABLES*/ null, /*PARAMETERS*/ "Object oid", /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "JDOHelper.getVersion(this)", /*INTO*/ null, /*FROM*/ VersionedPCPoint.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ VersionedPCPoint.class, /*EXCLUDE*/ null, /*WHERE*/ "JDOHelper.getVersion(this) == ver", /*VARIABLES*/ null, /*PARAMETERS*/ "Long ver", /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), }; /** * The main 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(SupportedJDOHelperMethods.class); } /** */ public void testGetObjectById() { // query 1 int index = 0; List expectedResult = getExpectedResult(true, Person.class); executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult); // query 2 index = 1; expectedResult = getExpectedResult(false, Person.class, "personid == 1"); // The query above returns a collection of size 1. // The collection element is a pc instances // whose oid is the parameter of the query below. Object[] parameters = new Object[]{ JDOHelper.getObjectId(expectedResult.get(0))}; executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[index], parameters, expectedResult); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index], parameters, expectedResult); } /** Test for JDOHelper.getVersion() in queries. */ public void testGetVersion() { // create some sample data pm.currentTransaction().begin(); VersionedPCPoint pt1 = new VersionedPCPoint(1, 2); pm.makePersistent(pt1); pm.currentTransaction().commit(); Object id = pm.getObjectId(pt1); try { // query 1 int index = 2; List expectedResult = new ArrayList(); expectedResult.add((long) 1); executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult); // query 2 index = 3; expectedResult = getExpectedResult(false, VersionedPCPoint.class, "x == 1"); Object[] parameters = new Object[]{new Long(1)}; executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[index], parameters, expectedResult); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index], parameters, expectedResult); } finally { pm.currentTransaction().begin(); pm.deletePersistent(pm.getObjectById(id)); pm.currentTransaction().commit(); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } /** */ private List getExpectedResult(boolean oidsWanted, Class candidateClass) { return getExpectedResult(oidsWanted, candidateClass, null); } /** */ private List getExpectedResult(boolean oidsWanted, Class candidateClass, String filter) { List expectedResult; PersistenceManager pm = getPM(); Transaction transaction = pm.currentTransaction(); transaction.begin(); try { Query query = filter == null ? pm.newQuery(candidateClass) : pm.newQuery(candidateClass, filter); try { Collection result = (Collection) query.execute(); if (oidsWanted) { expectedResult = new ArrayList(); for (Iterator i = result.iterator(); i.hasNext(); ) { expectedResult.add(JDOHelper.getObjectId(i.next())); } } else { expectedResult = new ArrayList(result); } } finally { query.closeAll(); } } finally { if (transaction.isActive()) { transaction.rollback(); } } return expectedResult; } } tck/src/java/org/apache/jdo/tck/query/jdoql/methods/SupportedListMethods.java100775 11207 12500110373 27702 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.methods; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Department; import org.apache.jdo.tck.pc.company.MeetingRoom; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title:Supported list methods *
*Keywords: query list *
*Assertion ID: A14.6.2-58. *
*Assertion Description: * Supported list methods: *
    *
  • get(int)
  • *
*/ public class SupportedListMethods extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-58 (SupportedListMethods) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { // get(PARAMETER) in filter new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Department.class, /*EXCLUDE*/ null, /*WHERE*/ "meetingRooms.get(pos) == room1", /*VARIABLES*/ null, /*PARAMETERS*/ "int pos, MeetingRoom room1", /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // get(LITERAL) in result new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "meetingRooms.get(1)", /*INTO*/ null, /*FROM*/ Department.class, /*EXCLUDE*/ null, /*WHERE*/ "deptid == 1", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** * The expected results of valid queries. */ private Object[] expectedResult = { // get(PARAMETER) in filter getTransientCompanyModelInstancesAsList(new String[]{"dept1"}), // get(LITERAL) in result getTransientCompanyModelInstancesAsList(new String[]{"room2"}) }; /** * The main 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(SupportedListMethods.class); } /** */ public void testGetInFilter() { int index = 0; getPM().currentTransaction().begin(); Object[] parameters = new Object[]{1, getPersistentCompanyModelInstance("room2")}; getPM().currentTransaction().commit(); executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[index], parameters, expectedResult[index]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index], parameters, expectedResult[index]); } /** */ public void testGetInResult() { int index = 1; executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/methods/SupportedMapMethods.java100664 16314 12500110373 27505 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.methods; import java.util.ArrayList; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Person; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Supported Map methods. *
*Keywords: query *
*Assertion ID: A14.6.2-46. *
*Assertion Description: * Supported Map methods: *
    *
  • get(Object) *
  • containsKey(Object) *
  • containsValue(Object) *
  • isEmpty() *
  • size() *
*/ public class SupportedMapMethods extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-46 (SupportedMapMethods) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { // get new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ "phoneNumbers.get('home') == '1111'", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // containsKey new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ "phoneNumbers.containsKey('home')", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // containsValue new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ "phoneNumbers.containsValue('1111')", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // isEmpty new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ "phoneNumbers.isEmpty()", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // size new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ "phoneNumbers.size() == 2", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** * The expected results of valid queries. */ private Object[] expectedResult = { // get getTransientCompanyModelInstancesAsList(new String[]{"emp1"}), // containsKey getTransientCompanyModelInstancesAsList(new String[]{ "emp1", "emp2", "emp3", "emp4", "emp5"}), // containsValue getTransientCompanyModelInstancesAsList(new String[]{"emp1"}), // isEmpty new ArrayList(), // size getTransientCompanyModelInstancesAsList(new String[]{ "emp1", "emp2", "emp3", "emp4", "emp5"}) }; /** * The main 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(SupportedMapMethods.class); } /** */ public void testGet() { int index = 0; executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); } /** */ public void testContainsKey() { int index = 1; executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); } /** */ public void testContainsValue() { int index = 2; executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); } /** */ public void testIsEmpty() { int index = 3; executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); } /** */ public void testSize() { int index = 4; executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/methods/SupportedMathMethods.java100664 45244 12500110373 27665 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.methods; import java.math.BigDecimal; import java.util.ArrayList; import java.util.Collection; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.MylibReader; import org.apache.jdo.tck.pc.mylib.PrimitiveTypes; import org.apache.jdo.tck.pc.query.MathSample; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Supported Math methods. *
*Keywords: query *
*Assertion ID: A14.6.2-48. *
*Assertion Description: * Supported Math methods: *
    *
  • Math.abs(numeric)
  • *
  • Math.sqrt(numeric)
  • *
  • Math.sin(numeric)
  • *
  • Math.cos(numeric)
  • *
  • Math.tan(numeric)
  • *
*/ public class SupportedMathMethods extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-48 (SupportedMathMethods) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. * These queries are used to test Math.abs. */ private static final QueryElementHolder[] VALID_QUERIES_ABS = { new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ PrimitiveTypes.class, /*EXCLUDE*/ null, /*WHERE*/ "Math.abs(intNotNull) == 4", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ PrimitiveTypes.class, /*EXCLUDE*/ null, /*WHERE*/ "Math.abs(intNull) == 4", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ PrimitiveTypes.class, /*EXCLUDE*/ null, /*WHERE*/ "Math.abs(longNotNull) == 4", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ PrimitiveTypes.class, /*EXCLUDE*/ null, /*WHERE*/ "Math.abs(longNull) == 4", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ PrimitiveTypes.class, /*EXCLUDE*/ null, /*WHERE*/ "Math.abs(floatNotNull) < 4.1 &&" + "Math.abs(floatNotNull) > 3.9", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ PrimitiveTypes.class, /*EXCLUDE*/ null, /*WHERE*/ "Math.abs(floatNull) < 4.1 &&" + "Math.abs(floatNull) > 3.9", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ PrimitiveTypes.class, /*EXCLUDE*/ null, /*WHERE*/ "Math.abs(doubleNotNull) < 4.1 &&" + "Math.abs(doubleNotNull) > 3.9", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ PrimitiveTypes.class, /*EXCLUDE*/ null, /*WHERE*/ "Math.abs(doubleNull) < 4.1 &&" + "Math.abs(doubleNull) > 3.9", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** * The array of valid queries which may be executed as * single string queries and as API queries. * These queries are used to test Math.sqrt. */ private static final QueryElementHolder[] VALID_QUERIES_SQRT = { new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ PrimitiveTypes.class, /*EXCLUDE*/ null, /*WHERE*/ "doubleNotNull > 0 && " + "Math.sqrt(doubleNotNull) < 2.1 && " + "Math.sqrt(doubleNotNull) > 1.9", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ PrimitiveTypes.class, /*EXCLUDE*/ null, /*WHERE*/ "doubleNull > 0 && " + "Math.sqrt(doubleNull) < 2.1 && " + "Math.sqrt(doubleNull) > 1.9", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ PrimitiveTypes.class, /*EXCLUDE*/ null, /*WHERE*/ "intNotNull > 0 && " + "Math.sqrt(intNotNull) < 2.1 && " + "Math.sqrt(intNotNull) > 1.9", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ PrimitiveTypes.class, /*EXCLUDE*/ null, /*WHERE*/ "intNull > 0 && " + "Math.sqrt(intNull) < 2.1 && " + "Math.sqrt(intNull) > 1.9", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), }; /** */ private Object oidOfMath1; /** */ private Object oidOfMath2; /** */ private Object oidOfMath3; /** * The expected results of valid queries testing Math.abs. */ private Object[] expectedResultABS = { getTransientMylibInstancesAsList(new String[]{ "primitiveTypesPositive", "primitiveTypesNegative"}), getTransientMylibInstancesAsList(new String[]{ "primitiveTypesPositive", "primitiveTypesNegative"}), getTransientMylibInstancesAsList(new String[]{ "primitiveTypesPositive", "primitiveTypesNegative"}), getTransientMylibInstancesAsList(new String[]{ "primitiveTypesPositive", "primitiveTypesNegative"}), getTransientMylibInstancesAsList(new String[]{ "primitiveTypesPositive", "primitiveTypesNegative"}), getTransientMylibInstancesAsList(new String[]{ "primitiveTypesPositive", "primitiveTypesNegative"}), getTransientMylibInstancesAsList(new String[]{ "primitiveTypesPositive", "primitiveTypesNegative"}), getTransientMylibInstancesAsList(new String[]{ "primitiveTypesPositive", "primitiveTypesNegative"}) }; /** The expected results of valid queries testing Math.sqrt. */ private Object[] expectedResultSQRT = { getTransientMylibInstancesAsList(new String[]{ "primitiveTypesPositive"}), getTransientMylibInstancesAsList(new String[]{ "primitiveTypesPositive"}), getTransientMylibInstancesAsList(new String[]{ "primitiveTypesPositive"}), getTransientMylibInstancesAsList(new String[]{ "primitiveTypesPositive"}), getTransientMylibInstancesAsList(new String[]{ "primitiveTypesPositive"}), getTransientMylibInstancesAsList(new String[]{ "primitiveTypesPositive"}), getTransientMylibInstancesAsList(new String[]{ "primitiveTypesPositive"}), getTransientMylibInstancesAsList(new String[]{ "primitiveTypesPositive"}) }; /** * The main 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(SupportedMathMethods.class); } /** */ public void testAbs() { for (int i = 0; i < VALID_QUERIES_ABS.length; i++) { executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES_ABS[i], expectedResultABS[i]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES_ABS[i], expectedResultABS[i]); } } /** */ public void testSqrt() { for (int i = 0; i < VALID_QUERIES_SQRT.length; i++) { executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES_SQRT[i], expectedResultSQRT[i]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES_SQRT[i], expectedResultSQRT[i]); } } /** * Tests for Math.sin() */ @SuppressWarnings("unchecked") public void testSin() { insertMathSampleData(getPM()); PersistenceManager pm = getPM(); Transaction tx = pm.currentTransaction(); try { tx.begin(); String filter = "Math.sin(angle) < 0.02 && Math.sin(angle) > -0.02"; Collection expectedResult = new ArrayList(); expectedResult.add(pm.getObjectById(oidOfMath1)); expectedResult.add(pm.getObjectById(oidOfMath3)); Query q = pm.newQuery(); q.setClass(MathSample.class); q.setFilter(filter); Collection results = (Collection)q.execute(); checkQueryResultWithoutOrder(ASSERTION_FAILED, filter, results, expectedResult); filter = "Math.sin(angle) < 1.02 && Math.sin(angle) > 0.98"; expectedResult.clear(); expectedResult.add(pm.getObjectById(oidOfMath2)); q = pm.newQuery(); q.setClass(MathSample.class); q.setFilter(filter); results = (Collection)q.execute(); checkQueryResultWithoutOrder(ASSERTION_FAILED, filter, results, expectedResult); filter = "Math.sin(angle) < -0.98 && Math.sin(angle) > -1.02"; expectedResult.clear(); q = pm.newQuery(); q.setClass(MathSample.class); q.setFilter(filter); results = (Collection)q.execute(); checkQueryResultWithoutOrder(ASSERTION_FAILED, filter, results, expectedResult); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** * Tests for Math.cos() */ @SuppressWarnings("unchecked") public void testCos() { insertMathSampleData(getPM()); PersistenceManager pm = getPM(); Transaction tx = pm.currentTransaction(); try { tx.begin(); String filter = "Math.cos(angle) < 0.02 && Math.cos(angle) > -0.02"; Collection expectedResult = new ArrayList(); expectedResult.add(pm.getObjectById(oidOfMath2)); Query q = pm.newQuery(); q.setClass(MathSample.class); q.setFilter(filter); Collection results = (Collection)q.execute(); checkQueryResultWithoutOrder(ASSERTION_FAILED, filter, results, expectedResult); filter = "Math.cos(angle) < -0.98 && Math.cos(angle) > -1.02"; expectedResult.clear(); expectedResult.add(pm.getObjectById(oidOfMath1)); q = pm.newQuery(); q.setClass(MathSample.class); q.setFilter(filter); results = (Collection)q.execute(); checkQueryResultWithoutOrder(ASSERTION_FAILED, filter, results, expectedResult); filter = "Math.cos(angle) < 1.02 && Math.cos(angle) > 0.98"; expectedResult.clear(); expectedResult.add(pm.getObjectById(oidOfMath3)); q = pm.newQuery(); q.setClass(MathSample.class); q.setFilter(filter); results = (Collection)q.execute(); checkQueryResultWithoutOrder(ASSERTION_FAILED, filter, results, expectedResult); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** * Tests for Math.tan() */ @SuppressWarnings("unchecked") public void testTan() { insertMathSampleData(getPM()); PersistenceManager pm = getPM(); Transaction tx = pm.currentTransaction(); try { tx.begin(); String filter = "Math.tan(angle) < 0.02 && Math.tan(angle) > -0.02"; Collection expectedResult = new ArrayList(); expectedResult.add(pm.getObjectById(oidOfMath1)); expectedResult.add(pm.getObjectById(oidOfMath3)); Query q = pm.newQuery(); q.setClass(MathSample.class); q.setFilter(filter); Collection results = (Collection)q.execute(); checkQueryResultWithoutOrder(ASSERTION_FAILED, filter, results, expectedResult); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(MylibReader.getTearDownClasses()); addTearDownClass(MathSample.class); loadAndPersistMylib(getPM()); } /** */ private void insertMathSampleData(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); // Sample 1 : angle=PI (180 degrees) MathSample ms1 = new MathSample(); ms1.setId(1); ms1.setAngle(new BigDecimal(Math.PI)); pm.makePersistent(ms1); // Sample 2 : angle=PI/2 (90 degrees) MathSample ms2 = new MathSample(); ms2.setId(2); ms2.setAngle(new BigDecimal(Math.PI/2.0)); pm.makePersistent(ms2); // Sample 3 : angle=0 (0 degrees) MathSample ms3 = new MathSample(); ms3.setId(3); ms3.setAngle(new BigDecimal(0)); pm.makePersistent(ms3); tx.commit(); oidOfMath1 = pm.getObjectId(ms1); oidOfMath2 = pm.getObjectId(ms2); oidOfMath3 = pm.getObjectId(ms3); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/query/jdoql/methods/SupportedStringMethods.java100664 34055 12500110373 30240 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.methods; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Department; import org.apache.jdo.tck.pc.company.Person; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Supported String methods. *
*Keywords: query *
*Assertion ID: A14.6.2-47. *
*Assertion Description: * New supported String methods: *
    *
  • toLowerCase() *
  • toUpperCase() *
  • indexOf(String) *
  • indexOf(String, int) *
  • matches(String) *
  • substring(int) *
  • substring(int, int) *
  • startsWith(String) *
  • endsWith(String) *
  • charAt(int) *
  • startsWith(String, int) *
  • length() *
  • trim() *
*/ public class SupportedStringMethods extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-47 (SupportedStringMethods) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ "firstname.toLowerCase() == 'emp1first'", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ "firstname.toUpperCase() == 'EMP1FIRST'", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Department.class, /*EXCLUDE*/ null, /*WHERE*/ "name.indexOf('e') == 1", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Department.class, /*EXCLUDE*/ null, /*WHERE*/ "name.indexOf('e', 2) == 3", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ "firstname.matches('.*First')", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ "firstname.matches('emp.First')", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ "firstname.matches('(?i)EMP1FIRST')", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ "firstname.substring(4) == 'First'", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ "firstname.substring(4,9) == 'First'", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ "firstname.startsWith('emp')", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ "firstname.endsWith('First')", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ "firstname.charAt(3) == '1'", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ "firstname.startsWith('mp', 1)", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ "firstname.length() == 9", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ "firstname.trim() == 'emp1First'", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** * The expected results of valid queries. */ private Object[] expectedResult = { getTransientCompanyModelInstancesAsList(new String[]{"emp1"}), getTransientCompanyModelInstancesAsList(new String[]{"emp1"}), getTransientCompanyModelInstancesAsList(new String[]{"dept1"}), getTransientCompanyModelInstancesAsList(new String[]{"dept1"}), getTransientCompanyModelInstancesAsList(new String[]{ "emp1", "emp2", "emp3", "emp4", "emp5"}), getTransientCompanyModelInstancesAsList(new String[]{ "emp1", "emp2", "emp3", "emp4", "emp5"}), getTransientCompanyModelInstancesAsList(new String[]{"emp1"}), getTransientCompanyModelInstancesAsList(new String[]{ "emp1", "emp2", "emp3", "emp4", "emp5"}), getTransientCompanyModelInstancesAsList(new String[]{ "emp1", "emp2", "emp3", "emp4", "emp5"}), getTransientCompanyModelInstancesAsList(new String[]{ "emp1", "emp2", "emp3", "emp4", "emp5"}), getTransientCompanyModelInstancesAsList(new String[]{ "emp1", "emp2", "emp3", "emp4", "emp5"}), getTransientCompanyModelInstancesAsList(new String[]{ "emp1"}), getTransientCompanyModelInstancesAsList(new String[]{ "emp1", "emp2", "emp3", "emp4", "emp5"}), getTransientCompanyModelInstancesAsList(new String[]{ "emp1", "emp2", "emp3", "emp4", "emp5"}), getTransientCompanyModelInstancesAsList(new String[]{ "emp1"}) }; /** * The main 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(SupportedStringMethods.class); } /** */ public void testToLowerCase() { int index = 0; executeQuery(index); } /** */ public void testToUpperCase() { int index = 1; executeQuery(index); } /** */ public void testIndexOfString() { int index = 2; executeQuery(index); } /** */ public void testIndexOfStringInt() { int index = 3; executeQuery(index); } /** */ public void testMatches() { int index = 4; executeQuery(index); executeQuery(++index); executeQuery(++index); } /** */ public void testSubstringInt() { int index = 7; executeQuery(index); } /** */ public void testSubstringIntInt() { int index = 8; executeQuery(index); } /** */ public void testStartsWith() { int index = 9; executeQuery(index); } /** */ public void testEndsWith() { int index = 10; executeQuery(index); } /** */ public void testStartsWithIndexed() { int index = 11; executeQuery(index); } /** */ public void testLength() { int index = 12; executeQuery(index); } /** */ public void testCharAt() { int index = 13; executeQuery(index); } /** */ public void testTrim() { int index = 14; executeQuery(index); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } /** */ private void executeQuery(int index) { executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); } } tck/src/java/org/apache/jdo/tck/query/jdoql/methods/SupportedTimeMethods.java100664 13046 12500110373 27665 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.methods; import java.sql.Time; import java.util.ArrayList; import java.util.Collection; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.query.TimeSample; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Supported Time methods. *
*Keywords: query *
*Assertion ID: A14.6.2-47. *
*Assertion Description: * New supported Time methods: *
    *
  • getHour()
  • *
  • getMinute()
  • *
  • getSecond()
  • *
*/ public class SupportedTimeMethods extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-47 (SupportedTimeMethods) failed: "; /** */ private Object oidOfTime1; /** */ private Object oidOfTime2; /** * The main 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(SupportedTimeMethods.class); } /** */ @SuppressWarnings("unchecked") public void testHour() { final String filter = "time.getHour() == 10"; PersistenceManager pm = getPM(); Transaction tx = pm.currentTransaction(); try { tx.begin(); Collection expectedResult = new ArrayList(); expectedResult.add(pm.getObjectById(oidOfTime1)); Query q = pm.newQuery(); q.setClass(TimeSample.class); q.setFilter(filter); Collection results = (Collection)q.execute(); checkQueryResultWithoutOrder(ASSERTION_FAILED, filter, results, expectedResult); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ @SuppressWarnings("unchecked") public void testMinute() { final String filter = "time.getMinute() == 15"; PersistenceManager pm = getPM(); Transaction tx = pm.currentTransaction(); try { tx.begin(); Collection expectedResult = new ArrayList(); expectedResult.add(pm.getObjectById(oidOfTime2)); Query q = pm.newQuery(); q.setClass(TimeSample.class); q.setFilter(filter); Collection results = (Collection)q.execute(); checkQueryResultWithoutOrder(ASSERTION_FAILED, filter, results, expectedResult); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ @SuppressWarnings("unchecked") public void testSecond() { final String filter = "time.getSecond() == 45"; PersistenceManager pm = getPM(); Transaction tx = pm.currentTransaction(); try { tx.begin(); Collection expectedResult = new ArrayList(); expectedResult.add(pm.getObjectById(oidOfTime2)); Query q = pm.newQuery(); q.setClass(TimeSample.class); q.setFilter(filter); Collection results = (Collection)q.execute(); checkQueryResultWithoutOrder(ASSERTION_FAILED, filter, results, expectedResult); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(TimeSample.class); insertTimeSampleData(getPM()); } /** */ @SuppressWarnings("deprecation") private void insertTimeSampleData(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); TimeSample ts1 = new TimeSample(); ts1.setId(1); Time time = new Time(0); time.setHours(10); time.setMinutes(0); time.setSeconds(0); ts1.setTime(time); pm.makePersistent(ts1); TimeSample ts2 = new TimeSample(); ts2.setId(2); Time time2 = new Time(0); time2.setHours(16); time2.setMinutes(15); time2.setSeconds(45); ts2.setTime(time2); pm.makePersistent(ts2); tx.commit(); oidOfTime1 = pm.getObjectId(ts1); oidOfTime2 = pm.getObjectId(ts2); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } ././@LongLink100644 0 0 145 12500111677 10253 Lustar 0 0 tck/src/java/org/apache/jdo/tck/query/jdoql/MultipleActiveQueryInstanceInSamePersistenceManager.javatck/src/java/org/apache/jdo/tck/query/jdoql/MultipleActiveQueryInstanceInSamePersistenceManager.java100664 7714 12500110373 34316 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql; import java.util.ArrayList; import java.util.List; import javax.jdo.PersistenceManager; import javax.jdo.Query; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Multiple Active Query Instances in Same PersistenceMana ger *
*Keywords: query concurrency *
*Assertion ID: A14.3-1. *
*Assertion Description: Multiple JDO Query instances might *be active simultaneously in the same JDO PersistenceManager *instance. */ public class MultipleActiveQueryInstanceInSamePersistenceManager extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.3-1 (MultipleActiveQueryInstanceInSamePersistenceManager) failed: "; /** * The main 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(MultipleActiveQueryInstanceInSamePersistenceManager.class); } public void testPositive() { PersistenceManager pm = getPM(); if (debug) logger.debug("\nExecuting test MultipleActiveQueryInstanceInSamePersistenceManager()..."); executeQueries(pm); if (debug) logger.debug("Test MultipleActiveQueryInstanceInSamePersistenceManager: Passed"); } /** */ void executeQueries(PersistenceManager pm) { // query selecting all point instances pm.currentTransaction().begin(); Query query = pm.newQuery(); query.setClass(PCPoint.class); query.setCandidates(pm.getExtent(PCPoint.class, false)); // query selecting point with x value 0 Query query2 = pm.newQuery(); query2.setClass(PCPoint.class); query2.setCandidates(pm.getExtent(PCPoint.class, false)); query2.setFilter("x == 0"); // execute first query Object results = query.execute(); // check query result of first query List expected = new ArrayList(); expected.add(new PCPoint(0, 0)); expected.add(new PCPoint(1, 1)); expected.add(new PCPoint(2, 2)); expected.add(new PCPoint(3, 3)); expected.add(new PCPoint(4, 4)); expected = getFromInserted(expected); checkQueryResultWithoutOrder(ASSERTION_FAILED, "x == 0", results, expected); // execute second query Object results2 = query2.execute(); // check query result of second query List expected2 = new ArrayList(); expected2.add(new PCPoint(0, 0)); expected2 = getFromInserted(expected2); checkQueryResultWithoutOrder(ASSERTION_FAILED, "x == 0", results2, expected2); pm.currentTransaction().commit(); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint.class); loadAndPersistPCPoints(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/MultipleIdenticalImports.java100664 16555 12500110373 27070 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql; import java.util.Collection; import java.util.HashSet; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Department; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Multiple identical imports *
*Keywords: query *
*Assertion ID: A14.4-5. *
*Assertion Description: * It is valid to specify the same import multiple times. */ public class MultipleIdenticalImports extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.4-5 (MultipleIdenticalImports) failed: "; /** * The main 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(MultipleIdenticalImports.class); } /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { // Import Department twice new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ "department == d", /*VARIABLES*/ null, /*PARAMETERS*/ "Department d", /*IMPORTS*/ "import org.apache.jdo.tck.pc.company.Department; " + "import org.apache.jdo.tck.pc.company.Department;", /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // Import Department explictly and per type-import-on-demand new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ "department == d", /*VARIABLES*/ null, /*PARAMETERS*/ "Department d", /*IMPORTS*/ "import org.apache.jdo.tck.pc.company.Department; " + "import org.apache.jdo.tck.pc.company.*", /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // type-import-on-demand twice new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ "department == d", /*VARIABLES*/ null, /*PARAMETERS*/ "Department d", /*IMPORTS*/ "import org.apache.jdo.tck.pc.company.*; " + "import org.apache.jdo.tck.pc.company.*", /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** * The expected results of valid queries. */ private Object[] expectedResult = { // Import Department twice getTransientCompanyModelInstancesAsList(new String[]{"emp1", "emp2", "emp3"}), // Import Department explictly and per type-import-on-demand getTransientCompanyModelInstancesAsList(new String[]{"emp1", "emp2", "emp3"}), // type-import-on-demand twice getTransientCompanyModelInstancesAsList(new String[]{"emp1", "emp2", "emp3"}) }; /** Parameters of valid queries. */ private Object[][] parameters = { // Import Department twice {getPersistentCompanyModelInstance("dept1")}, // Import Department explictly and per type-import-on-demand {getPersistentCompanyModelInstance("dept1")}, // type-import-on-demand twice {getPersistentCompanyModelInstance("dept1")} }; /** */ void runTest(PersistenceManager pm, CompanyModelReader reader) { Query query; Collection expected; Object result; Transaction tx = pm.currentTransaction(); tx.begin(); Department dept1 = (Department)reader.getDepartment("dept1"); expected = new HashSet(); expected.add(reader.getFullTimeEmployee("emp1")); expected.add(reader.getFullTimeEmployee("emp2")); expected.add(reader.getPartTimeEmployee("emp3")); // Import Department twice query = pm.newQuery(Employee.class); query.declareImports("import org.apache.jdo.tck.pc.company.Department; import org.apache.jdo.tck.pc.company.Department;"); query.declareParameters("Department d"); query.setFilter("department == d"); result = query.execute(dept1); checkQueryResultWithoutOrder(ASSERTION_FAILED, "department == d", result, expected); // Import Department explictly and per type-import-on-demand query = pm.newQuery(Employee.class); query.declareImports("import org.apache.jdo.tck.pc.company.Department; import org.apache.jdo.tck.pc.company.*"); query.declareParameters("Department d"); query.setFilter("department == d"); result = query.execute(dept1); checkQueryResultWithoutOrder(ASSERTION_FAILED, "department == d", result, expected); // type-import-on-demand twice query = pm.newQuery(Employee.class); query.declareImports("import org.apache.jdo.tck.pc.company.*; import org.apache.jdo.tck.pc.company.*"); query.declareParameters("Department d"); query.setFilter("department == d"); result = query.execute(dept1); checkQueryResultWithoutOrder(ASSERTION_FAILED, "department == d", result, expected); tx.commit(); tx = null; } /** */ public void testPositive() { for (int i = 0; i < VALID_QUERIES.length; i++) { executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[i], parameters[i], expectedResult[i]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[i], parameters[i], expectedResult[i]); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/NamespaceOfIdentifiers.java100664 6207 12500110373 26422 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql; import java.util.Collection; import java.util.HashSet; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PrimitiveTypes; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Namespace of Identifiers *
*Keywords: query *
*Assertion ID: A14.6.2-11. *
*Assertion Description: * Identifiers in the expression are considered to be in the name * space of the specified class, with the addition of declared * imports, parameters and variables. */ public class NamespaceOfIdentifiers extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-11 (NamespaceOfIdentifiers) failed: "; /** * The main 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(NamespaceOfIdentifiers.class); } /** */ public void testPositive() { PersistenceManager pm = getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); Collection instance9 = (Collection)pm.newQuery( PrimitiveTypes.class, "id == 9").execute(); Collection allInstances = (Collection)pm.newQuery( PrimitiveTypes.class, "true").execute(); Collection empty = new HashSet(); // use of field names runSimplePrimitiveTypesQuery("intNotNull == intNotNull", pm, allInstances, ASSERTION_FAILED); // use of parameter names runParameterPrimitiveTypesQuery( "intNotNull == intNotNull", "String intNotNull", "Michael", pm, allInstances, ASSERTION_FAILED); // use of field/parameter names runParameterPrimitiveTypesQuery( "this.intNotNull == intNotNull", "int intNotNull", new Integer(9), pm, instance9, ASSERTION_FAILED); tx.commit(); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PrimitiveTypes.class); loadAndPersistPrimitiveTypes(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/NavigationThroughACollectionField.java100664 6561 12500110373 30577 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Department; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Navigation Through a Collection Field *
*Keywords: query *
*Assertion ID: A14.6.2-10. *
*Assertion Description: * Navigation through multi-valued fields (Collection types) is * specified using a variable declaration and the * Collection.contains(Object o) method. */ public class NavigationThroughACollectionField extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-10 (NavigationThroughACollectionField) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Department.class, /*EXCLUDE*/ null, /*WHERE*/ "employees.contains(e) && e.firstname == \"emp1First\"", /*VARIABLES*/ "Employee e", /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** * The expected results of valid queries. */ private Object[] expectedResult = { getTransientCompanyModelInstancesAsList(new String[]{"dept1"}) }; /** * The main 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(NavigationThroughACollectionField.class); } /** */ public void testPositive() { for (int i = 0; i < VALID_QUERIES.length; i++) { executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/NavigationThroughANullValuedField.java100664 11666 12500110373 30601 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Department; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Navigation Through a Null-Valued Field *
*Keywords: query *
*Assertion ID: A14.6.2-9. *
*Assertion Description: * Navigation through a null-valued field, which would throw * NullPointerException, is treated as if the filter expression * returned false for the evaluation of the current set of variable * values. Other values for variables might still qualify the candidate instance * for inclusion in the result set. */ public class NavigationThroughANullValuedField extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-9 (NavigationThroughANullValuedField) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { // navigation through reference relationship field // the relationship medicalInsurence is not set for emp2 and emp3 => // they should not be part of the result new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ "medicalInsurance.carrier == \"Carrier1\"", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // navigation through collection relationship field // employees emp2 and emp3 do not have a medicalInsurence, but emp1 // matches the filter such that dept1 qualifies for inclusion in the // result set. new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Department.class, /*EXCLUDE*/ null, /*WHERE*/ "employees.contains(e) && e.medicalInsurance.carrier == \"Carrier1\"", /*VARIABLES*/ "Employee e", /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** * The expected results of valid queries. */ private Object[] expectedResult = { // navigation through reference relationship field // the relationship medicalInsurence is not set for emp2 and emp3 => // they should not be part of the result getTransientCompanyModelInstancesAsList(new String[]{"emp1"}), // navigation through collection relationship field // employees emp2 and emp3 do not have a medicalInsurence, but emp1 // matches the filter such that dept1 qualifies for inclusion in the // result set. getTransientCompanyModelInstancesAsList(new String[]{"dept1"}) }; /** * The main 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(NavigationThroughANullValuedField.class); } /** */ public void testPositive() { for (int i = 0; i < VALID_QUERIES.length; i++) { executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/NavigationThroughReferencesUsesDotOperator.java100664 10271 12500110373 32554 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.pc.company.MedicalInsurance; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Navigation Through a References uses Dot Operator *
*Keywords: query *
*Assertion ID: A14.6.2-13. *
*Assertion Description: * Navigation through single-valued fields is specified by the Java language * syntax of field_name.field_name....field_name. */ public class NavigationThroughReferencesUsesDotOperator extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-13 (NavigationThroughReferencesUsesDotOperator) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { // navigation through one relationship new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ "medicalInsurance.carrier == \"Carrier1\"", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // navigation through multiple relationships new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ MedicalInsurance.class, /*EXCLUDE*/ null, /*WHERE*/ "this.employee.department.name == \"Development\"", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** * The expected results of valid queries. */ private Object[] expectedResult = { // navigation through one relationship getTransientCompanyModelInstancesAsList(new String[]{"emp1"}), // navigation through multiple relationships getTransientCompanyModelInstancesAsList(new String[]{ "medicalIns1", "medicalIns2", "medicalIns3"}) }; /** * The main 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(NavigationThroughReferencesUsesDotOperator.class); } /** */ public void testPositive() { for (int i = 0; i < VALID_QUERIES.length; i++) { executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/NegativeRange.java100664 11735 12500110373 24614 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql; import java.util.Arrays; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Person; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Negative Range. *
*Keywords: query *
*Assertion ID: A14.6.8-2. *
*Assertion Description: * If ((toExcl - fromIncl) <= 0) evaluates to true, if the result of the query * execution is a List, the returned List contains no instances, * and an Iterator obtained from the List returns false to hasNext(). * If the result of the query execution is a single instance (setUnique(true)), * it will have a value of null. */ public class NegativeRange extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.8-2 (NegativeRange) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ 4, /*TO*/ 4), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ 4, /*TO*/ 3), new QueryElementHolder( /*UNIQUE*/ Boolean.TRUE, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ 4, /*TO*/ 4), new QueryElementHolder( /*UNIQUE*/ Boolean.TRUE, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ 4, /*TO*/ 3) }; /** * The expected results of valid queries. */ private Object[] expectedResult = { Arrays.asList(new Object[]{}), Arrays.asList(new Object[]{}), null, null }; /** * The main 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(NegativeRange.class); } /** */ public void testNonUnique() { for (int i = 0; i < 2; i++) { executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); } } /** */ public void testUnique() { for (int i = 2; i < 4; i++) { executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/NullCollectionsAndContainsMethod.java100664 10745 12500110373 30471 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.pc.company.Project; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Null Collections and Contains Method *
*Keywords: query nullcollection *
*Assertion ID: A14.6.2-35. *
*Assertion Description: * null-valued fields of Collection types are treated * as if they were empty and all contains methods return * false. */ public class NullCollectionsAndContainsMethod extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-35 (NullCollectionsAndContainsMethod) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { // contains new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ "personid == 1 && projects.contains(p)", /*VARIABLES*/ null, /*PARAMETERS*/ "org.apache.jdo.tck.pc.company.Project p", /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // contains new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ "!team.contains(null)", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), }; /** * The expected results of valid queries. */ private Object[] expectedResult = { // contains getTransientCompanyModelInstancesAsList(new String[]{}), // contains getTransientCompanyModelInstancesAsList(new String[]{ "emp1", "emp2", "emp3", "emp4", "emp5"}) }; /** Parameters of valid queries. */ private Object[][] parameters = { // contains {new Project(999l, "TestProject", null)}, // contains null }; /** * The main 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(NullCollectionsAndContainsMethod.class); } /** */ public void testPositive() { for (int i = 0; i < VALID_QUERIES.length; i++) { executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[i], parameters[i], expectedResult[i]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[i], parameters[i], expectedResult[i]); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); getPM().currentTransaction().begin(); Employee emp1 = (Employee) getPersistentCompanyModelInstance("emp1"); emp1.setProjects(null); getPM().currentTransaction().commit(); } } tck/src/java/org/apache/jdo/tck/query/jdoql/NullCollectionsAndIsEmpty.java100664 7055 12500110373 27124 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Handling of Null Collections and isEmpty in Queries *
*Keywords: query nullcollection *
*Assertion ID: A14.6.2-34. *
*Assertion Description: * null-valued fields of Collection types are treated * as if they were empty and isEmpty returns true. */ public class NullCollectionsAndIsEmpty extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-34 (NullCollectionsAndIsEmpty) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { // isEmpty new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ "personid == 1 && projects.isEmpty()", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), }; /** * The expected results of valid queries. */ private Object[] expectedResult = { // isEmpty getTransientCompanyModelInstancesAsList(new String[]{"emp1"}) }; /** * The main 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(NullCollectionsAndIsEmpty.class); } /** */ public void testPositive() { for (int i = 0; i < VALID_QUERIES.length; i++) { executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); getPM().currentTransaction().begin(); Employee emp1 = (Employee) getPersistentCompanyModelInstance("emp1"); emp1.setProjects(null); getPM().currentTransaction().commit(); } } tck/src/java/org/apache/jdo/tck/query/jdoql/operators/BinaryAddition.java100664 12340 12500110373 27004 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.operators; import java.util.Collection; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PrimitiveTypes; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Binary Addition Query Operator *
*Keywords: query *
*Assertion ID: A14.6.2-26. *
*Assertion Description: The binary addition operator (+) is supported for all types as they are defined in the Java language. This includes the following types:
  • byte, short, int, long, char, Byte, Short Integer, Long, Character
  • float, double, Float, Double
  • BigDecimal, BigInteger
The operation on object-valued fields of wrapper types (Boolean, Byte, Short, Integer, Long, Float, and Double), and numeric types (BigDecimal and BigInteger) use the wrapped values as operands. */ public class BinaryAddition extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-26 (BinaryAddition) failed: "; /** * The main 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(BinaryAddition.class); } /** */ public void testPositive() { PersistenceManager pm = getPM(); if (debug) logger.debug("\nExecuting test BinaryAddition() ..."); Transaction tx = pm.currentTransaction(); tx.begin(); Collection instance9 = (Collection)pm.newQuery( PrimitiveTypes.class, "id == 9").execute(); Collection allOddInstances = (Collection)pm.newQuery( PrimitiveTypes.class, "booleanNull").execute(); runSimplePrimitiveTypesQuery("id + 1 == 10", pm, instance9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("byteNotNull + 1 == 10", pm, instance9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("shortNotNull + 1 == 10", pm, instance9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("intNotNull + 1 == 10", pm, instance9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("longNotNull + 1 == 10", pm, instance9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("floatNotNull + 1 == 10", pm, instance9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("doubleNotNull + 1 == 10", pm, instance9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("byteNull + 1 == 10", pm, instance9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("shortNull + 1 == 10", pm, instance9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("intNull + 1 == 10", pm, instance9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("longNull + 1 == 10", pm, instance9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("floatNull + 1 == 10", pm, instance9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("doubleNull + 1 == 10", pm, instance9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("bigDecimal + 1 == 10", pm, instance9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("bigInteger + 1 == 10", pm, instance9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("charNull + 1 == 'P'", pm, allOddInstances, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("charNotNull + 1 == 'P'", pm, allOddInstances, ASSERTION_FAILED); tx.commit(); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PrimitiveTypes.class); loadAndPersistPrimitiveTypes(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/operators/BinarySubtraction.java100664 12347 12500110373 27555 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.operators; import java.util.Collection; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PrimitiveTypes; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Binary Subtraction Query Operator *
*Keywords: query *
*Assertion ID: A14.6.2-28. *
*Assertion Description: The binary subtraction operator (-) is supported for all types as they are defined in the Java language. This includes the following types:
  • byte, short, int, long, char, Byte, Short Integer, Long, Character
  • float, double, Float, Double
  • BigDecimal, BigInteger
The operation on object-valued fields of wrapper types (Boolean, Byte, Short, Integer, Long, Float, and Double), and numeric types (BigDecimal and BigInteger) use the wrapped values as operands. */ public class BinarySubtraction extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-28 (BinarySubtraction) failed: "; /** * The main 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(BinarySubtraction.class); } /** */ public void testPositive() { PersistenceManager pm = getPM(); if (debug) logger.debug("\nExecuting test BinarySubtraction() ..."); Transaction tx = pm.currentTransaction(); tx.begin(); Collection instance9 = (Collection)pm.newQuery( PrimitiveTypes.class, "id == 9").execute(); Collection allOddInstances = (Collection)pm.newQuery( PrimitiveTypes.class, "booleanNull").execute(); runSimplePrimitiveTypesQuery("id - 1 == 8", pm, instance9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("byteNotNull - 1 == 8", pm, instance9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("shortNotNull - 1 == 8", pm, instance9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("intNotNull - 1 == 8", pm, instance9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("longNotNull - 1 == 8", pm, instance9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("floatNotNull - 1 == 8", pm, instance9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("doubleNotNull - 1 == 8", pm, instance9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("byteNull - 1 == 8", pm, instance9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("shortNull - 1 == 8", pm, instance9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("intNull - 1 == 8", pm, instance9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("longNull - 1 == 8", pm, instance9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("floatNull - 1 == 8", pm, instance9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("doubleNull - 1 == 8", pm, instance9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("bigDecimal - 1 == 8", pm, instance9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("bigInteger - 1 == 8", pm, instance9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("charNull - 1 == 'N'", pm, allOddInstances, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("charNotNull - 1 == 'N'", pm, allOddInstances, ASSERTION_FAILED); tx.commit(); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PrimitiveTypes.class); loadAndPersistPrimitiveTypes(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/operators/BitwiseComplement.java100664 10060 12500110373 27533 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.operators; import java.util.Collection; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PrimitiveTypes; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Bitwise Complement Query Operator *
*Keywords: query *
*Assertion ID: A14.6.2-24. *
*Assertion Description: The integral unary bitwise complement operator (~) is supported for all types as they are defined in the Java language. This includes the following types:
  • byte, short, int, long, char, Byte, Short Integer, Long, Character
*/ public class BitwiseComplement extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-24 (BitwiseComplement) failed: "; /** * The main 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(BitwiseComplement.class); } /** */ public void testPositive() { PersistenceManager pm = getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); Collection instance9 = (Collection)pm.newQuery( PrimitiveTypes.class, "id == 9").execute(); Collection allOddInstances = (Collection)pm.newQuery( PrimitiveTypes.class, "booleanNull").execute(); runSimplePrimitiveTypesQuery("~id == -10", pm, instance9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("~byteNotNull == -10", pm, instance9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("~shortNotNull == -10", pm, instance9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("~intNotNull == -10", pm, instance9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("~longNotNull == -10", pm, instance9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("~byteNull == -10", pm, instance9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("~shortNull == -10", pm, instance9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("~intNull == -10", pm, instance9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("~longNull == -10", pm, instance9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("~charNull == -80", pm, allOddInstances, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("~charNotNull == -80", pm, allOddInstances, ASSERTION_FAILED); tx.commit(); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PrimitiveTypes.class); loadAndPersistPrimitiveTypes(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/operators/BooleanLogicalAND.java100664 13424 12500110373 27305 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.operators; import java.util.Collection; import java.util.HashSet; import javax.jdo.JDOUserException; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PrimitiveTypes; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Boolean Logical AND Query Operator *
*Keywords: query *
*Assertion ID: A14.6.2-20. *
*Assertion Description: The Boolean logical AND (not bitwise) operator (&) is supported for all types as they are defined in the Java language. This includes the following types:
  • Boolean, boolean
*/ public class BooleanLogicalAND extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-20 (BooleanLogicalAND) failed: "; /** * The main 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(BooleanLogicalAND.class); } /** */ public void testPositive() { PersistenceManager pm = getPM(); if (debug) logger.debug("\nExecuting positive test BooleanLogicalAND() ..."); Transaction tx = pm.currentTransaction(); tx.begin(); Collection instance9 = (Collection)pm.newQuery( PrimitiveTypes.class, "id == 9").execute(); Collection allOddInstances = (Collection)pm.newQuery( PrimitiveTypes.class, "booleanNull").execute(); Collection allInstances = (Collection)pm.newQuery( PrimitiveTypes.class, "true").execute(); Collection empty = new HashSet(); // case true & true runSimplePrimitiveTypesQuery("true & true", pm, allInstances, ASSERTION_FAILED); // case true & false runSimplePrimitiveTypesQuery("true & false", pm, empty, ASSERTION_FAILED); // case false & true runSimplePrimitiveTypesQuery("false & true", pm, empty, ASSERTION_FAILED); // case false & false runSimplePrimitiveTypesQuery("false & false", pm, empty, ASSERTION_FAILED); // case boolean & boolean runSimplePrimitiveTypesQuery("intNotNull == 9 & booleanNotNull", pm, instance9, ASSERTION_FAILED); // case boolean & Boolean runSimplePrimitiveTypesQuery("intNotNull == 9 & booleanNull", pm, instance9, ASSERTION_FAILED); // case Boolean & boolean runSimplePrimitiveTypesQuery("booleanNull & intNotNull == 9", pm, instance9, ASSERTION_FAILED); // case Boolean & Boolean runSimplePrimitiveTypesQuery("booleanNull & booleanNull", pm, allOddInstances, ASSERTION_FAILED); // case Boolean parameter runParameterPrimitiveTypesQuery("param & id == 9", "Boolean param", Boolean.TRUE, pm, instance9, ASSERTION_FAILED); runParameterPrimitiveTypesQuery("param & id == 9", "Boolean param", Boolean.FALSE, pm, empty, ASSERTION_FAILED); // case boolean parameter runParameterPrimitiveTypesQuery("param & id == 9", "boolean param", Boolean.TRUE, pm, instance9, ASSERTION_FAILED); runParameterPrimitiveTypesQuery("param & id == 9", "boolean param", Boolean.FALSE, pm, empty, ASSERTION_FAILED); tx.commit(); } /** */ public void testNegative() { PersistenceManager pm = getPM(); if (debug) logger.debug("\nExecuting positive test BooleanLogicalAND() ..."); Transaction tx = pm.currentTransaction(); tx.begin(); try { Query q = pm.newQuery(PrimitiveTypes.class, "intNotNull & intNotNull"); Object result = q.execute(); fail(ASSERTION_FAILED, "Query uisng bitwise & operator should throw JDOUserException."); } catch (JDOUserException ex) { // expected exception if (debug) { logger.debug("expected exception: " + ex); } } tx.commit(); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PrimitiveTypes.class); loadAndPersistPrimitiveTypes(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/operators/BooleanLogicalOR.java100664 14056 12500110373 27225 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.operators; import java.util.Collection; import java.util.HashSet; import javax.jdo.JDOUserException; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PrimitiveTypes; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Boolean Logical OR Query Operator *
*Keywords: query *
*Assertion ID: A14.6.2-22. *
*Assertion Description: The Boolean logical OR (not bitwise) operator (|) is supported for all types as they are defined in the Java language. This includes the following types:
  • Boolean, boolean
*/ public class BooleanLogicalOR extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-22 (BooleanLogicalOR) failed: "; /** * The main 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(BooleanLogicalOR.class); } /** */ public void testPositive() { PersistenceManager pm = getPM(); if (debug) logger.debug("\nExecuting positive test BooleanLogicalOR() ..."); Transaction tx = pm.currentTransaction(); tx.begin(); Collection instance9 = (Collection)pm.newQuery( PrimitiveTypes.class, "id == 9").execute(); Collection instancesLess3 = (Collection)pm.newQuery( PrimitiveTypes.class, "id < 3").execute(); Collection allOddInstances = (Collection)pm.newQuery( PrimitiveTypes.class, "booleanNull").execute(); Collection allInstances = (Collection)pm.newQuery( PrimitiveTypes.class, "true").execute(); Collection empty = new HashSet(); // case true | true runSimplePrimitiveTypesQuery("true | true", pm, allInstances, ASSERTION_FAILED); // case true | false runSimplePrimitiveTypesQuery("true | false", pm, allInstances, ASSERTION_FAILED); // case false | true runSimplePrimitiveTypesQuery("false | true", pm, allInstances, ASSERTION_FAILED); // case false | false runSimplePrimitiveTypesQuery("false | false", pm, empty, ASSERTION_FAILED); // case boolean | boolean runSimplePrimitiveTypesQuery("intNotNull == 9 | booleanNotNull", pm, allOddInstances, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("id == 1 | id == 2", pm, instancesLess3, ASSERTION_FAILED); // case boolean | Boolean runSimplePrimitiveTypesQuery("intNotNull == 9 | booleanNull", pm, allOddInstances, ASSERTION_FAILED); // case Boolean | boolean runSimplePrimitiveTypesQuery("booleanNull | intNotNull == 9", pm, allOddInstances, ASSERTION_FAILED); // case Boolean | Boolean runSimplePrimitiveTypesQuery("booleanNull | booleanNull", pm, allOddInstances, ASSERTION_FAILED); // case Boolean parameter runParameterPrimitiveTypesQuery("param | id == 9", "Boolean param", Boolean.TRUE, pm, allInstances, ASSERTION_FAILED); runParameterPrimitiveTypesQuery("param | id == 9", "Boolean param", Boolean.FALSE, pm, instance9, ASSERTION_FAILED); // case boolean parameter runParameterPrimitiveTypesQuery("param | id == 9", "boolean param", Boolean.TRUE, pm, allInstances, ASSERTION_FAILED); runParameterPrimitiveTypesQuery("param | id == 9", "boolean param", Boolean.FALSE, pm, instance9, ASSERTION_FAILED); tx.commit(); } /** */ public void testNegative() { PersistenceManager pm = getPM(); if (debug) logger.debug("\nExecuting positive test BooleanLogicalAND() ..."); Transaction tx = pm.currentTransaction(); tx.begin(); try { Query q = pm.newQuery(PrimitiveTypes.class, "intNotNull | intNotNull"); Object result = q.execute(); fail(ASSERTION_FAILED, "Query uisng bitwise | operator should throw JDOUserException."); } catch (JDOUserException ex) { // expected exception if (debug) { logger.debug("expected exception: " + ex); } } tx.commit(); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PrimitiveTypes.class); loadAndPersistPrimitiveTypes(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/operators/ComparisonTests.java100664 10720 12500110373 27241 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.operators; import java.util.Collection; import java.util.Iterator; import javax.jdo.Extent; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.fieldtypes.AllTypes; public abstract class ComparisonTests extends JDO_Test { protected Query query; protected Transaction tx; protected Collection query_result; protected static String BooleanParameter = "Boolean value"; protected static String booleanParameter = "boolean value"; protected static String ByteParameter = "Byte value"; protected static String byteParameter = "byte value"; protected static String CharacterParameter = "Character value"; protected static String charParameter = "char value"; protected static String DoubleParameter = "Double value"; protected static String doubleParameter = "double value"; protected static String FloatParameter = "Float value"; protected static String floatParameter = "float value"; protected static String IntegerParameter = "Integer value"; protected static String intParameter = "int value"; protected static String LongParameter = "Long value"; protected static String longParameter = "long value"; protected static String ShortParameter = "Short value"; protected static String shortParameter = "short value"; protected static String StringParameter = "String value"; protected static String LocaleParameter = "java.util.Locale value"; protected static String BigDecimalParameter = "java.math.BigDecimal value"; protected static String BigIntegerParameter = "java.math.BigInteger value"; protected static String DateParameter = "java.util.Date value"; protected static String AllTypesParameter = "org.apache.jdo.tck.pc.fieldtypes.AllTypes value"; /** */ protected void fail(String assertion, String message, String filter, String parameter) { StringBuffer buf = new StringBuffer(); buf.append(message); buf.append("("); buf.append(" filter \"").append(filter).append("\""); if (parameter != null) { buf.append(" , parameter \"").append(parameter).append("\""); } buf.append(")"); fail(assertion, buf.toString()); } /** */ protected void runQuery(PersistenceManager pm, String filter, String parameter, Object parameterValue, String assertion) { Extent e = pm.getExtent(AllTypes.class, false); query = pm.newQuery(e, filter); query_result = null; try { if (parameter != null) { query.declareParameters(parameter); query_result = (Collection) query.execute(parameterValue); } else { query_result = (Collection) query.execute(); } } catch (Throwable throwable) { if (debug) throwable.printStackTrace(); fail(assertion, "Exception on Query.execute " + throwable, filter, parameter); query_result = null; if (tx.isActive()) tx.rollback(); return; } if (query_result == null) { fail(assertion, "Query.execute returned a null", filter, parameter); if (tx.isActive()) tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/query/jdoql/operators/ConditionalAND.java100664 11721 12500110373 26674 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.operators; import java.util.Collection; import java.util.HashSet; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PrimitiveTypes; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Conditional AND Query Operator *
*Keywords: query *
*Assertion ID: A14.6.2-21. *
*Assertion Description: The conditional AND operator (&&) is supported for all types as they are defined in the Java language. This includes the following types:
  • Boolean, boolean
*/ public class ConditionalAND extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-21 (ConditionalAND) failed: "; /** * The main 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(ConditionalAND.class); } /** */ public void testPositive() { PersistenceManager pm = getPM(); if (debug) logger.debug("\nExecuting test ConditionalAND() ..."); Transaction tx = pm.currentTransaction(); tx.begin(); Collection instance9 = (Collection)pm.newQuery( PrimitiveTypes.class, "id == 9").execute(); Collection allOddInstances = (Collection)pm.newQuery( PrimitiveTypes.class, "booleanNull").execute(); Collection allInstances = (Collection)pm.newQuery( PrimitiveTypes.class, "true").execute(); Collection empty = new HashSet(); // case true && true runSimplePrimitiveTypesQuery("true && true", pm, allInstances, ASSERTION_FAILED); // case true && false runSimplePrimitiveTypesQuery("true && false", pm, empty, ASSERTION_FAILED); // case false && true runSimplePrimitiveTypesQuery("false && true", pm, empty, ASSERTION_FAILED); // case false && false runSimplePrimitiveTypesQuery("false && false", pm, empty, ASSERTION_FAILED); // case boolean && boolean runSimplePrimitiveTypesQuery("intNotNull == 9 && booleanNotNull", pm, instance9, ASSERTION_FAILED); // case boolean && Boolean runSimplePrimitiveTypesQuery("intNotNull == 9 && booleanNull", pm, instance9, ASSERTION_FAILED); // case Boolean && boolean runSimplePrimitiveTypesQuery("booleanNull && intNotNull == 9", pm, instance9, ASSERTION_FAILED); // case Boolean && Boolean runSimplePrimitiveTypesQuery("booleanNull && booleanNull", pm, allOddInstances, ASSERTION_FAILED); // case Boolean parameter runParameterPrimitiveTypesQuery("param && id == 9", "Boolean param", Boolean.TRUE, pm, instance9, ASSERTION_FAILED); runParameterPrimitiveTypesQuery("param && id == 9", "Boolean param", Boolean.FALSE, pm, empty, ASSERTION_FAILED); // case boolean parameter runParameterPrimitiveTypesQuery("param && id == 9", "boolean param", Boolean.TRUE, pm, instance9, ASSERTION_FAILED); runParameterPrimitiveTypesQuery("param && id == 9", "boolean param", Boolean.FALSE, pm, empty, ASSERTION_FAILED); tx.commit(); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PrimitiveTypes.class); loadAndPersistPrimitiveTypes(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/operators/ConditionalOR.java100664 12351 12500110373 26612 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.operators; import java.util.Collection; import java.util.HashSet; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PrimitiveTypes; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Conditional OR Query Operator *
*Keywords: query *
*Assertion ID: A14.6.2-23. *
*Assertion Description: The conditional OR operator (||) is supported for all types as they are defined in the Java language. This includes the following types:
  • Boolean, boolean
*/ public class ConditionalOR extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-23 (ConditionalOR) failed: "; /** * The main 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(ConditionalOR.class); } /** */ public void testPositive() { PersistenceManager pm = getPM(); if (debug) logger.debug("\nExecuting test ConditionalOR() ..."); Transaction tx = pm.currentTransaction(); tx.begin(); Collection instance9 = (Collection)pm.newQuery( PrimitiveTypes.class, "id == 9").execute(); Collection instancesLess3 = (Collection)pm.newQuery( PrimitiveTypes.class, "id < 3").execute(); Collection allOddInstances = (Collection)pm.newQuery( PrimitiveTypes.class, "booleanNull").execute(); Collection allInstances = (Collection)pm.newQuery( PrimitiveTypes.class, "true").execute(); Collection empty = new HashSet(); // case true || true runSimplePrimitiveTypesQuery("true || true", pm, allInstances, ASSERTION_FAILED); // case true || false runSimplePrimitiveTypesQuery("true || false", pm, allInstances, ASSERTION_FAILED); // case false || true runSimplePrimitiveTypesQuery("false || true", pm, allInstances, ASSERTION_FAILED); // case false || false runSimplePrimitiveTypesQuery("false || false", pm, empty, ASSERTION_FAILED); // case boolean || boolean runSimplePrimitiveTypesQuery("intNotNull == 9 || booleanNotNull", pm, allOddInstances, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("id == 1 || id == 2", pm, instancesLess3, ASSERTION_FAILED); // case boolean || Boolean runSimplePrimitiveTypesQuery("intNotNull == 9 || booleanNull", pm, allOddInstances, ASSERTION_FAILED); // case Boolean || boolean runSimplePrimitiveTypesQuery("booleanNull || intNotNull == 9", pm, allOddInstances, ASSERTION_FAILED); // case Boolean || Boolean runSimplePrimitiveTypesQuery("booleanNull || booleanNull", pm, allOddInstances, ASSERTION_FAILED); // case Boolean parameter runParameterPrimitiveTypesQuery("param || id == 9", "Boolean param", Boolean.TRUE, pm, allInstances, ASSERTION_FAILED); runParameterPrimitiveTypesQuery("param || id == 9", "Boolean param", Boolean.FALSE, pm, instance9, ASSERTION_FAILED); // case boolean parameter runParameterPrimitiveTypesQuery("param || id == 9", "boolean param", Boolean.TRUE, pm, allInstances, ASSERTION_FAILED); runParameterPrimitiveTypesQuery("param || id == 9", "boolean param", Boolean.FALSE, pm, instance9, ASSERTION_FAILED); tx.commit(); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PrimitiveTypes.class); loadAndPersistPrimitiveTypes(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/operators/Division.java100664 12264 12500110373 25675 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.operators; import java.util.Collection; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PrimitiveTypes; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Division Query Operator *
*Keywords: query *
*Assertion ID: A14.6.2-31. *
*Assertion Description: The division operator (/) is supported for all types as they are defined in the Java language. This includes the following types:
  • byte, short, int, long, char, Byte, Short Integer, Long, Character
  • float, double, Float, Double
  • BigDecimal, BigInteger
The operation on object-valued fields of wrapper types (Boolean, Byte, Short, Integer, Long, Float, and Double), and numeric types (BigDecimal and BigInteger) use the wrapped values as operands. */ public class Division extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-31 (Division) failed: "; /** * The main 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(Division.class); } /** */ public void testPositive() { PersistenceManager pm = getPM(); if (debug) logger.debug("\nExecuting test Division() ..."); Transaction tx = pm.currentTransaction(); tx.begin(); Collection instance8 = (Collection)pm.newQuery( PrimitiveTypes.class, "id == 8").execute(); Collection instances8And9 = (Collection)pm.newQuery( PrimitiveTypes.class, "id == 8 || id == 9").execute(); runSimplePrimitiveTypesQuery("id / 2 == 4", pm, instances8And9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("byteNotNull / 2 == 4", pm, instances8And9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("shortNotNull / 2 == 4", pm, instances8And9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("intNotNull / 2 == 4", pm, instances8And9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("longNotNull / 2 == 4", pm, instances8And9, ASSERTION_FAILED); /* testing float division? runSimplePrimitiveTypesQuery("floatNotNull / 2 == 4", pm, instance8, ASSERTION_FAILED);*/ /* testing double division? runSimplePrimitiveTypesQuery("doubleNotNull / 2 == 4", pm, instance8, ASSERTION_FAILED);*/ runSimplePrimitiveTypesQuery("byteNull / 2 == 4", pm, instances8And9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("shortNull / 2 == 4", pm, instances8And9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("intNull / 2 == 4", pm, instances8And9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("longNull / 2 == 4", pm, instances8And9, ASSERTION_FAILED); /* testing float division? runSimplePrimitiveTypesQuery("floatNull / 2 == 4", pm, instance8, ASSERTION_FAILED);*/ /* testing double division? runSimplePrimitiveTypesQuery("doubleNull / 2 == 4", pm, instance8, ASSERTION_FAILED);*/ /* testing BigDecimal division? Scaling issue! runSimplePrimitiveTypesQuery("bigDecimal / 2 == 4", pm, instances8And9, ASSERTION_FAILED);*/ runSimplePrimitiveTypesQuery("bigInteger / 2 == 4", pm, instances8And9, ASSERTION_FAILED); tx.commit(); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PrimitiveTypes.class); loadAndPersistPrimitiveTypes(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/operators/Equality.java100664 242214 12500110373 25726 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.operators; import java.math.BigDecimal; import java.math.BigInteger; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; import java.util.Iterator; import java.util.Locale; import java.util.TimeZone; import org.apache.jdo.tck.pc.fieldtypes.AllTypes; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Equality Operator Support *
*Keywords: query *
*Assertion ID: A14.6.2-14. *
*Assertion Description: The equal operator (==) is supported for the following types:
  • byte, short, int, long, char, Byte, Short Integer, Long, Character
  • float, double, Float, Double
  • BigDecimal, BigInteger
  • Boolean, boolean
  • any class instance or array
  • Date, String
The operation on object-valued fields of wrapper types (Boolean, Byte, Short, Integer, Long, Float, and Double), and numeric types (BigDecimal and BigInteger) use the wrapped values as operands. Equality comparison of object-valued fields of PersistenceCapable types use the JDO Identity comparison of the references. Thus, two objects will compare equal if they have the same JDO Identity. Equality comparison of object-valued fields of non-PersistenceCapable types uses the equals method of the field type. */ public class Equality extends ComparisonTests { private static String boolean_filterL = "value == fld_boolean"; private static String boolean_filterR = "fld_boolean == value"; private static String boolean_filterT = "fld_boolean == true"; private static String boolean_filterF = "false == fld_boolean"; private static String boolean_filterObj = "value.fld_boolean == fld_boolean"; private static String byte_filterL = "value == fld_byte"; private static String byte_filterR = "fld_byte == value"; private static String byte_filterObj = "value.fld_byte == fld_byte"; private static String byte_filterVal = "fld_byte == 100"; private static String char_filterL = "value == fld_char"; private static String char_filterR = "fld_char == value"; private static String char_filterObj = "value.fld_char == fld_char"; private static String char_filterVal = "'M' == fld_char"; private static String double_filterL = "value == fld_double"; private static String double_filterR = "fld_double == value"; private static String double_filterObj = "value.fld_double == fld_double"; private static String double_filterVal = "fld_double == 100.0"; private static String float_filterL = "value == fld_float"; private static String float_filterR = "fld_float == value"; private static String float_filterObj = "fld_float == value.fld_float"; private static String float_filterVal = "fld_float == 100.0"; private static String int_filterL = "value == fld_int"; private static String int_filterR = "fld_int == value"; private static String int_filterObj = "value.fld_int == fld_int"; private static String int_filterVal = "fld_int == 1000"; private static String long_filterL = "value == fld_long"; private static String long_filterR = "fld_long == value"; private static String long_filterObj = "fld_long == value.fld_long"; private static String long_filterVal = "fld_long == 1000000"; private static String short_filterL = "value == fld_short"; private static String short_filterR = "fld_short == value"; private static String short_filterObj = "value.fld_short == fld_short"; private static String short_filterVal = "1000 == fld_short"; private static String Boolean_filterL = "value == fld_Boolean"; private static String Boolean_filterR = "fld_Boolean == value"; private static String Boolean_filterT = "fld_Boolean == true"; private static String Boolean_filterF = "false == fld_Boolean"; private static String Boolean_filterObj = "value.fld_Boolean == fld_Boolean"; private static String Boolean_filterVal = "fld_Boolean == false"; private static String Byte_filterL = "value == fld_Byte"; private static String Byte_filterR = "fld_Byte == value"; private static String Byte_filterObj = "fld_Byte == value.fld_Byte"; private static String Byte_filterVal = "100 == fld_Byte"; private static String Character_filterL = "value == fld_Character"; private static String Character_filterR = "fld_Character == value"; private static String Character_filterObj = "value.fld_Character == fld_Character"; private static String Character_filterVal = "fld_Character == 'z'"; private static String Double_filterL = "value == fld_Double"; private static String Double_filterR = "fld_Double == value"; private static String Double_filterObj = "value.fld_Double == fld_Double"; private static String Double_filterVal = "fld_Double == -25.5"; private static String Float_filterL = "value == fld_Float"; private static String Float_filterR = "fld_Float == value"; private static String Float_filterObj = "fld_Float == value.fld_Float"; private static String Float_filterVal = "100.0f == fld_Float"; private static String Integer_filterL = "value == fld_Integer"; private static String Integer_filterR = "fld_Integer == value"; private static String Integer_filterObj = "fld_Integer == value.fld_Integer"; private static String Integer_filterVal = "fld_Integer == 100"; private static String Long_filterL = "value == fld_Long"; private static String Long_filterR = "fld_Long == value"; private static String Long_filterObj = "value.fld_Long == fld_Long"; private static String Long_filterVal = "-1000 == fld_Long"; private static String Short_filterL = "value == fld_Short"; private static String Short_filterR = "fld_Short == value"; private static String Short_filterObj = "fld_Short == value.fld_Short"; private static String Short_filterVal = "-1000 == fld_Short"; private static String String_filterL = "value == fld_String"; private static String String_filterR = "fld_String == value"; private static String String_filterObj = "value.fld_String == fld_String"; private static String String_filterVal1 = "fld_String == \"Java\""; private static String String_filterVal2 = "fld_String == \"\""; private static String Locale_filterL = "value == fld_Locale"; private static String Locale_filterR = "fld_Locale == value"; private static String Locale_filterObj = "value.fld_Locale == fld_Locale"; private static String Date_filterL = "value == fld_Date"; private static String Date_filterR = "fld_Date == value"; private static String Date_filterObj = "fld_Date == value.fld_Date"; private static String BigDecimal_filterL = "value == fld_BigDecimal"; private static String BigDecimal_filterR = "fld_BigDecimal == value"; private static String BigDecimal_filterObj = "value.fld_BigDecimal == fld_BigDecimal"; private static String BigInteger_filterL = "value == fld_BigInteger"; private static String BigInteger_filterR = "fld_BigInteger == value"; private static String BigInteger_filterObj = "fld_BigInteger == value.fld_BigInteger"; /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-14 (Equality) failed: "; /** * The main 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(Equality.class); } /** */ public void test() { pm = getPM(); tx = pm.currentTransaction(); runQueries(); } /** */ private void runQueries() { run_booleanQuery(boolean_filterL, booleanParameter, Boolean.TRUE, true, 4); run_booleanQuery(boolean_filterL, booleanParameter, Boolean.FALSE, false, 6); run_booleanQuery(boolean_filterR, booleanParameter, Boolean.TRUE, true, 4); run_booleanQuery(boolean_filterR, booleanParameter, Boolean.FALSE, false, 6); run_booleanQuery(boolean_filterL, BooleanParameter, Boolean.TRUE, true, 4); run_booleanQuery(boolean_filterL, BooleanParameter, Boolean.FALSE, false, 6); run_booleanQuery(boolean_filterR, BooleanParameter, Boolean.TRUE, true, 4); run_booleanQuery(boolean_filterR, BooleanParameter, Boolean.FALSE, false, 6); run_booleanQuery(boolean_filterT, null, null, true, 4); run_booleanQuery(boolean_filterF, null, null, false, 6); AllTypes alltypes = new AllTypes(); alltypes.setboolean(true); run_booleanQuery(boolean_filterObj, AllTypesParameter, alltypes, true, 4); alltypes.setboolean(false); run_booleanQuery(boolean_filterObj, AllTypesParameter, alltypes, false, 6); run_byteQuery(byte_filterL, byteParameter, new Byte((byte)50), (byte)50, 2); run_byteQuery(byte_filterR, byteParameter, new Byte(Byte.MIN_VALUE), Byte.MIN_VALUE, 1); run_byteQuery(byte_filterL, ByteParameter, new Byte((byte)20), (byte)20, 0); run_byteQuery(byte_filterR, ByteParameter, new Byte(Byte.MAX_VALUE), Byte.MAX_VALUE, 1); run_byteQuery(byte_filterL, shortParameter, new Short((short)50), (byte)50, 2); run_byteQuery(byte_filterR, shortParameter, new Short((short)50), (byte)50, 2); run_byteQuery(byte_filterL, ShortParameter, new Short((short)-100), (byte)-100, 1); run_byteQuery(byte_filterR, ShortParameter, new Short((short)-100), (byte)-100, 1); run_byteQuery(byte_filterL, charParameter, new Character((char)50), (byte)50, 2); run_byteQuery(byte_filterR, charParameter, new Character((char)50), (byte)50, 2); run_byteQuery(byte_filterL, CharacterParameter, new Character((char)50), (byte)50, 2); run_byteQuery(byte_filterR, CharacterParameter, new Character((char)100), (byte)100, 1); run_byteQuery(byte_filterL, intParameter, new Integer(50), (byte)50, 2); run_byteQuery(byte_filterR, intParameter, new Integer(50), (byte)50, 2); run_byteQuery(byte_filterL, IntegerParameter, new Integer(-100), (byte)-100, 1); run_byteQuery(byte_filterR, IntegerParameter, new Integer(-100), (byte)-100, 1); run_byteQuery(byte_filterL, longParameter, new Long(50), (byte)50, 2); run_byteQuery(byte_filterR, longParameter, new Long(50), (byte)50, 2); run_byteQuery(byte_filterL, LongParameter, new Long(-100), (byte)-100, 1); run_byteQuery(byte_filterR, LongParameter, new Long(-100), (byte)-100, 1); run_byteQuery(byte_filterL, floatParameter, new Float(50.0f), (byte)50, 2); run_byteQuery(byte_filterR, floatParameter, new Float(50.0f), (byte)50, 2); run_byteQuery(byte_filterL, FloatParameter, new Float(-100.0f), (byte)-100, 1); run_byteQuery(byte_filterR, FloatParameter, new Float(-100.0f), (byte)-100, 1); run_byteQuery(byte_filterL, doubleParameter, new Double(50.0), (byte)50, 2); run_byteQuery(byte_filterR, doubleParameter, new Double(50.0), (byte)50, 2); run_byteQuery(byte_filterL, DoubleParameter, new Double(-100.0), (byte)-100, 1); run_byteQuery(byte_filterR, DoubleParameter, new Double(-100.0), (byte)-100, 1); run_byteQuery(byte_filterL, BigIntegerParameter, new BigInteger("50"), (byte)50, 2); run_byteQuery(byte_filterR, BigIntegerParameter, new BigInteger("-100"), (byte)-100, 1); run_byteQuery(byte_filterL, BigDecimalParameter, new BigDecimal("100.0"), (byte)100, 1); run_byteQuery(byte_filterR, BigDecimalParameter, new BigDecimal("10.0"), (byte)10, 1); alltypes.setbyte((byte)50); run_byteQuery(byte_filterObj, AllTypesParameter, alltypes, (byte)50, 2); alltypes.setbyte((byte)45); run_byteQuery(byte_filterObj, AllTypesParameter, alltypes, (byte)45, 0); run_byteQuery(byte_filterVal, null, null, (byte)100, 1); run_shortQuery(short_filterL, shortParameter, new Short((short)100), (short)100, 2); run_shortQuery(short_filterR, shortParameter, new Short((short)100), (short)100, 2); run_shortQuery(short_filterL, ShortParameter, new Short(Short.MIN_VALUE), Short.MIN_VALUE, 1); run_shortQuery(short_filterR, ShortParameter, new Short((short)253), (short)253, 0); run_shortQuery(short_filterR, shortParameter, new Short((short)1000), (short)1000, 1); run_shortQuery(short_filterL, byteParameter, new Byte((byte)75), (short)75, 0); run_shortQuery(short_filterR, byteParameter, new Byte((byte)75), (short)75, 0); run_shortQuery(short_filterL, ByteParameter, new Byte((byte)100), (short)100, 2); run_shortQuery(short_filterR, ByteParameter, new Byte((byte)100), (short)100, 2); run_shortQuery(short_filterL, charParameter, new Character((char)75), (short)75, 0); run_shortQuery(short_filterR, charParameter, new Character((char)75), (short)75, 0); run_shortQuery(short_filterL, CharacterParameter, new Character((char)100), (short)100, 2); run_shortQuery(short_filterR, CharacterParameter, new Character((char)100), (short)100, 2); run_shortQuery(short_filterL, intParameter, new Integer(-10000), (short)-10000, 1); run_shortQuery(short_filterR, intParameter, new Integer(-10000), (short)-10000, 1); run_shortQuery(short_filterL, IntegerParameter, new Integer(10000), (short)10000, 1); run_shortQuery(short_filterR, IntegerParameter, new Integer(10000), (short)10000, 1); run_shortQuery(short_filterL, longParameter, new Long(10000), (short) 10000, 1); run_shortQuery(short_filterR, longParameter, new Long(10000), (short) 10000, 1); run_shortQuery(short_filterL, LongParameter, new Long(100), (short)100, 2); run_shortQuery(short_filterR, LongParameter, new Long(100), (short)100, 2); run_shortQuery(short_filterL, floatParameter, new Float(23000), (short)23000, 0); run_shortQuery(short_filterR, floatParameter, new Float(23000), (short)23000, 0); run_shortQuery(short_filterL, FloatParameter, new Float(100), (short)100, 2); run_shortQuery(short_filterR, FloatParameter, new Float(100), (short)100, 2); run_shortQuery(short_filterL, doubleParameter, new Double(-10000), (short)-10000, 1); run_shortQuery(short_filterR, doubleParameter, new Double(-10000), (short)-10000, 1); run_shortQuery(short_filterL, DoubleParameter, new Double(23), (short)23, 0); run_shortQuery(short_filterR, DoubleParameter, new Double(23), (short)23, 0); run_shortQuery(short_filterL, BigIntegerParameter, new BigInteger("999"), (short)999, 0); run_shortQuery(short_filterR, BigIntegerParameter, new BigInteger("-1000"), (short)-1000, 1); run_shortQuery(short_filterL, BigDecimalParameter, new BigDecimal("100.0"), (short)100, 2); run_shortQuery(short_filterR, BigDecimalParameter, new BigDecimal("100.0001"), (short)100, 0); alltypes.setshort((short)100); run_shortQuery(short_filterObj, AllTypesParameter, alltypes, (short)100, 2); alltypes.setshort((short)23); run_shortQuery(short_filterObj, AllTypesParameter, alltypes, (short)23, 0); run_shortQuery(short_filterVal, null, null, (short)1000, 1); run_charQuery(char_filterL, charParameter, new Character(Character.MIN_VALUE), Character.MIN_VALUE, 1); run_charQuery(char_filterR, charParameter, new Character(Character.MAX_VALUE), Character.MAX_VALUE, 1); run_charQuery(char_filterL, charParameter, new Character('C'), 'C', 0); run_charQuery(char_filterR, charParameter, new Character('z'), 'z', 2); run_charQuery(char_filterL, CharacterParameter, new Character(' '), ' ', 1); run_charQuery(char_filterR, CharacterParameter, new Character('f'), 'f', 0); run_charQuery(char_filterL, byteParameter, new Byte((byte)Character.MIN_VALUE), (char)Character.MIN_VALUE, 1); run_charQuery(char_filterR, byteParameter, new Byte((byte)122), 'z', 2); run_charQuery(char_filterL, ByteParameter, new Byte((byte)'a'), 'a', 0); run_charQuery(char_filterR, ByteParameter, new Byte((byte)'a'), 'a', 0); run_charQuery(char_filterL, shortParameter, new Short((short)'M'), 'M', 2); run_charQuery(char_filterR, shortParameter, new Short((short)'M'), 'M', 2); run_charQuery(char_filterL, ShortParameter, new Short((short)'A'), 'A', 1); run_charQuery(char_filterR, ShortParameter, new Short((short)'A'), 'A', 1); run_charQuery(char_filterL, intParameter, new Integer('z'), 'z', 2); run_charQuery(char_filterR, intParameter, new Integer('z'), 'z', 2); run_charQuery(char_filterL, IntegerParameter, new Integer('B'), 'B', 1); run_charQuery(char_filterR, IntegerParameter, new Integer('B'), 'B', 1); run_charQuery(char_filterL, longParameter, new Long('z'), 'z', 2); run_charQuery(char_filterR, longParameter, new Long('z'), 'z', 2); run_charQuery(char_filterL, LongParameter, new Long('B'), 'B', 1); run_charQuery(char_filterR, LongParameter, new Long('B'), 'B', 1); run_charQuery(char_filterL, floatParameter, new Float(123.222), 'x', 0); run_charQuery(char_filterR, floatParameter, new Float(123.222), 'x', 0); run_charQuery(char_filterL, FloatParameter, new Float('z'), 'z', 2); run_charQuery(char_filterR, FloatParameter, new Float('z'), 'z', 2); run_charQuery(char_filterL, doubleParameter, new Double('B'), 'B', 1); run_charQuery(char_filterR, doubleParameter, new Double('B'), 'B', 1); run_charQuery(char_filterL, DoubleParameter, new Double('A'), 'A', 1); run_charQuery(char_filterR, DoubleParameter, new Double('A'), 'A', 1); run_charQuery(char_filterL, BigIntegerParameter, new BigInteger("65"), 'A', 1); // 'A' == 65 run_charQuery(char_filterR, BigIntegerParameter, new BigInteger("122"), 'z', 2); // 'z' == 122 run_charQuery(char_filterL, BigDecimalParameter, new BigDecimal("65.0"), 'A', 1); run_charQuery(char_filterR, BigDecimalParameter, new BigDecimal("77.0"), 'M', 2); // 'M' == 77 alltypes.setchar('A'); run_charQuery(char_filterObj, AllTypesParameter, alltypes, 'A', 1); alltypes.setchar('b'); run_charQuery(char_filterObj, AllTypesParameter, alltypes, 'b', 0); run_charQuery(char_filterVal, null, null, 'M', 2); run_intQuery(int_filterL, intParameter, new Integer(AllTypes.veryLargeNegativeInt), AllTypes.veryLargeNegativeInt, 1); run_intQuery(int_filterR, intParameter, new Integer(AllTypes.veryLargePositiveInt), AllTypes.veryLargePositiveInt, 1); run_intQuery(int_filterR, intParameter, new Integer(23), 23, 0); run_intQuery(int_filterL, IntegerParameter, new Integer(1000000), 1000000, 1); run_intQuery(int_filterR, IntegerParameter, new Integer(1000), 1000, 1); run_intQuery(int_filterL, byteParameter, new Byte((byte)100), 100, 2); run_intQuery(int_filterR, byteParameter, new Byte((byte)0), 0, 1); run_intQuery(int_filterL, ByteParameter, new Byte((byte)100), 100, 2); run_intQuery(int_filterR, ByteParameter, new Byte((byte)0), 0, 1); run_intQuery(int_filterL, shortParameter, new Short((short)10000), 10000, 1); run_intQuery(int_filterR, shortParameter, new Short((short)-1000), -1000, 1); run_intQuery(int_filterL, ShortParameter, new Short((short)-1000), -1000, 1); run_intQuery(int_filterR, ShortParameter, new Short((short)10000), 10000, 1); run_intQuery(int_filterL, charParameter, new Character((char)10000), 10000, 1); run_intQuery(int_filterR, charParameter, new Character((char)0), 0, 1); run_intQuery(int_filterL, CharacterParameter, new Character((char)100), 100, 2); run_intQuery(int_filterR, CharacterParameter, new Character((char)10000), 10000, 1); run_intQuery(int_filterL, longParameter, new Long(AllTypes.veryLargePositiveInt), AllTypes.veryLargePositiveInt, 1); run_intQuery(int_filterR, longParameter, new Long(AllTypes.veryLargeNegativeInt), AllTypes.veryLargeNegativeInt, 1); run_intQuery(int_filterL, LongParameter, new Long(10000), 10000, 1); run_intQuery(int_filterR, LongParameter, new Long(43), 43, 0); run_intQuery(int_filterL, floatParameter, new Float(AllTypes.veryLargePositiveInt), AllTypes.veryLargePositiveInt, 1); run_intQuery(int_filterR, floatParameter, new Float(AllTypes.veryLargeNegativeInt), AllTypes.veryLargeNegativeInt, 1); run_intQuery(int_filterL, FloatParameter, new Float(10000), 10000, 1); run_intQuery(int_filterR, FloatParameter, new Float(43), 43, 0); run_intQuery(int_filterL, doubleParameter, new Double(AllTypes.veryLargePositiveInt), AllTypes.veryLargePositiveInt, 1); run_intQuery(int_filterR, doubleParameter, new Double(AllTypes.veryLargeNegativeInt), AllTypes.veryLargeNegativeInt, 1); run_intQuery(int_filterL, DoubleParameter, new Double(10000), 10000, 1); run_intQuery(int_filterR, DoubleParameter, new Double(43), 43, 0); run_intQuery(int_filterL, BigIntegerParameter, new BigInteger("1000000"), 1000000, 1); run_intQuery(int_filterR, BigIntegerParameter, new BigInteger("-1000000"), -1000000, 1); run_intQuery(int_filterL, BigDecimalParameter, new BigDecimal("1000000.0"), 1000000, 1); run_intQuery(int_filterR, BigDecimalParameter, new BigDecimal("-1000000.00001"), -1000000, 0); alltypes.setint(100); run_intQuery(int_filterObj, AllTypesParameter, alltypes, 100, 2); run_intQuery(int_filterVal, null, null, 1000, 1); run_longQuery(long_filterL, longParameter, new Long(Long.MIN_VALUE), Long.MIN_VALUE, 1); run_longQuery(long_filterR, longParameter, new Long(Long.MAX_VALUE), Long.MAX_VALUE, 1); run_longQuery(long_filterL, LongParameter, new Long(100), 100, 2); run_longQuery(long_filterR, LongParameter, new Long(23), 23, 0); run_longQuery(long_filterL, byteParameter, new Byte((byte)100), 100, 2); run_longQuery(long_filterR, byteParameter, new Byte((byte)0), 0, 1); run_longQuery(long_filterL, ByteParameter, new Byte((byte)100), 100, 2); run_longQuery(long_filterR, ByteParameter, new Byte((byte)0), 0, 1); run_longQuery(long_filterL, shortParameter, new Short((short)-1000 ), -1000, 2); run_longQuery(long_filterR, shortParameter, new Short((short)1000), 1000, 1); run_longQuery(long_filterL, ShortParameter, new Short((short)100), 100, 2); run_longQuery(long_filterR, ShortParameter, new Short((short)32), 32, 0); run_longQuery(long_filterL, charParameter, new Character((char)0), 0, 1); run_longQuery(long_filterR, charParameter, new Character((char)100), 100, 2); run_longQuery(long_filterL, CharacterParameter, new Character((char)23), 23, 0); run_longQuery(long_filterR, CharacterParameter, new Character((char)0), 0, 1); run_longQuery(long_filterL, intParameter, new Integer(100), 100, 2); run_longQuery(long_filterR, intParameter, new Integer(0), 0, 1); run_longQuery(long_filterL, IntegerParameter, new Integer(23), 23, 0); run_longQuery(long_filterR, IntegerParameter, new Integer(1000000), 1000000, 1); run_longQuery(long_filterL, floatParameter, new Float(-1000000.0), -1000000, 1); // run_longQuery(long_filterR, floatParameter, new Float((float)Long.MAX_VALUE), Long.MAX_VALUE, 1); run_longQuery(long_filterL, FloatParameter, new Float(100), 100, 2); run_longQuery(long_filterR, FloatParameter, new Float(32), 32, 0); run_longQuery(long_filterL, doubleParameter, new Double(-1000000.0), -1000000, 1); // run_longQuery(long_filterR, doubleParameter, new Double((double)Long.MAX_VALUE), Long.MAX_VALUE, 1); run_longQuery(long_filterL, DoubleParameter, new Double(100.0), 100, 2); run_longQuery(long_filterR, DoubleParameter, new Double(32.0), 32, 0); run_longQuery(long_filterL, BigIntegerParameter, new BigInteger("1000000"), 1000000, 1); run_longQuery(long_filterR, BigIntegerParameter, new BigInteger("-1000000"), -1000000, 1); run_longQuery(long_filterL, BigDecimalParameter, new BigDecimal("100.0"), 100, 2); run_longQuery(long_filterR, BigDecimalParameter, new BigDecimal("-1000000.0001"), -1000000, 0); alltypes.setlong(100); run_longQuery(long_filterObj, AllTypesParameter, alltypes, 100, 2); run_longQuery(long_filterVal, null, null, 1000000, 1); run_floatQuery(float_filterL, floatParameter, new Float(-234.23f), -234.23f, 1); run_floatQuery(float_filterR, floatParameter, new Float(-234.23f), -234.23f, 1); run_floatQuery(float_filterL, FloatParameter, new Float(0.0), 0.0f, 1); run_floatQuery(float_filterR, FloatParameter, new Float(4.0), 4.0f, 0); run_floatQuery(float_filterL, byteParameter, new Byte((byte)0), 0.0f, 1); run_floatQuery(float_filterR, byteParameter, new Byte((byte)23), 23.0f, 0); run_floatQuery(float_filterL, ByteParameter, new Byte((byte)34), 34.0f, 0); run_floatQuery(float_filterR, ByteParameter, new Byte((byte)100), 100.0f, 2); run_floatQuery(float_filterL, shortParameter, new Short((short)0), 0.0f, 1); run_floatQuery(float_filterR, shortParameter, new Short((short)23), 23.0f, 0); run_floatQuery(float_filterL, ShortParameter, new Short((short)34), 34.0f, 0); run_floatQuery(float_filterR, ShortParameter, new Short((short)100), 100.0f, 2); run_floatQuery(float_filterL, charParameter, new Character((char)0), 0.0f, 1); run_floatQuery(float_filterR, charParameter, new Character((char)23), 23.0f, 0); run_floatQuery(float_filterL, CharacterParameter, new Character((char)34), 34.0f, 0); run_floatQuery(float_filterR, CharacterParameter, new Character((char)100), 100.0f, 2); run_floatQuery(float_filterL, intParameter, new Integer(50000000), 50000000.0f, 1); run_floatQuery(float_filterR, intParameter, new Integer(23), 23.0f, 0); run_floatQuery(float_filterL, IntegerParameter, new Integer(34), 34.0f, 0); run_floatQuery(float_filterR, IntegerParameter, new Integer(100), 100.0f, 2); run_floatQuery(float_filterL, longParameter, new Long(50000000), 50000000.0f, 1); run_floatQuery(float_filterR, longParameter, new Long(23), 23.0f, 0); run_floatQuery(float_filterL, LongParameter, new Long(34), 34.0f, 0); run_floatQuery(float_filterR, LongParameter, new Long(100), 100.0f, 2); run_floatQuery(float_filterL, doubleParameter, new Double(50000000.0), 50000000.0f, 1); run_floatQuery(float_filterR, doubleParameter, new Double(-25.5), -25.5f, 1); run_floatQuery(float_filterL, DoubleParameter, new Double(0.0), 0.0f, 1); run_floatQuery(float_filterR, DoubleParameter, new Double(100.0), 100.0f, 2); run_floatQuery(float_filterL, BigIntegerParameter, new BigInteger("0"), 0.0f, 1); run_floatQuery(float_filterR, BigIntegerParameter, new BigInteger("1000000000"), 1000000000.0f, 1); run_floatQuery(float_filterL, BigDecimalParameter, new BigDecimal("350.5"), 350.5f, 1); run_floatQuery(float_filterR, BigDecimalParameter, new BigDecimal("50000000.0"), 50000000.0f, 1); alltypes.setfloat(23.23f); run_floatQuery(float_filterObj, AllTypesParameter, alltypes, 23.23f, 0); run_floatQuery(float_filterVal, null, null, 100.0f, 2); run_doubleQuery(double_filterL, doubleParameter, new Double(-234234.234), -234234.234, 1); run_doubleQuery(double_filterR, doubleParameter, new Double(-234234.234), -234234.234, 1); run_doubleQuery(double_filterL, DoubleParameter, new Double(0.0), 0.0, 1); run_doubleQuery(double_filterR, DoubleParameter, new Double(23.34), 23.34, 0); run_doubleQuery(double_filterL, byteParameter, new Byte((byte)100), 100.0, 2); run_doubleQuery(double_filterR, byteParameter, new Byte((byte)0), 0.0, 1); run_doubleQuery(double_filterL, ByteParameter, new Byte((byte)23), 23.0, 0); run_doubleQuery(double_filterR, ByteParameter, new Byte((byte)100), 100.0, 2); run_doubleQuery(double_filterL, shortParameter, new Short((short)100), 100.0, 2); run_doubleQuery(double_filterR, shortParameter, new Short((short)0), 0.0, 1); run_doubleQuery(double_filterL, ShortParameter, new Short((short)23), 23.0, 0); run_doubleQuery(double_filterR, ShortParameter, new Short((short)100), 100.0, 2); run_doubleQuery(double_filterL, intParameter, new Integer(100), 100.0, 2); run_doubleQuery(double_filterR, intParameter, new Integer(0), 0.0, 1); run_doubleQuery(double_filterL, IntegerParameter, new Integer(23), 23.0, 0); run_doubleQuery(double_filterR, IntegerParameter, new Integer(100), 100.0, 2); run_doubleQuery(double_filterL, longParameter, new Long(100), 100.0, 2); run_doubleQuery(double_filterR, longParameter, new Long(0), 0.0, 1); run_doubleQuery(double_filterL, LongParameter, new Long(23), 23.0, 0); run_doubleQuery(double_filterR, LongParameter, new Long(100), 100.0, 2); run_doubleQuery(double_filterL, floatParameter, new Float(0.0f),0.0f, 1); run_doubleQuery(double_filterR, floatParameter, new Float(100.0f), 100.0f, 2); run_doubleQuery(double_filterL, FloatParameter, new Float(100.0f), 100.0, 2); run_doubleQuery(double_filterR, FloatParameter, new Float(69.96f), 69.96, 0); run_doubleQuery(double_filterL, BigIntegerParameter, new BigInteger("50000000"), 50000000.0f, 1); run_doubleQuery(double_filterR, BigIntegerParameter, new BigInteger("1000000000"), 1000000000.0f, 1); run_doubleQuery(double_filterL, BigDecimalParameter, new BigDecimal("350.5"), 350.5f, 1); run_doubleQuery(double_filterR, BigDecimalParameter, new BigDecimal("50000000.0"), 50000000.0f, 1); alltypes.setdouble(-25.5); run_doubleQuery(double_filterObj, AllTypesParameter, alltypes, -25.5, 1); run_doubleQuery(double_filterVal, null, null, 100.0, 2); run_BooleanQuery(Boolean_filterL, booleanParameter, Boolean.TRUE, Boolean.TRUE, 4); run_BooleanQuery(Boolean_filterL, booleanParameter, Boolean.FALSE, Boolean.FALSE, 6); run_BooleanQuery(Boolean_filterR, booleanParameter, Boolean.TRUE, Boolean.TRUE, 4); run_BooleanQuery(Boolean_filterR, booleanParameter, Boolean.FALSE, Boolean.FALSE, 6); run_BooleanQuery(Boolean_filterL, BooleanParameter, Boolean.TRUE, Boolean.TRUE, 4); run_BooleanQuery(Boolean_filterL, BooleanParameter, Boolean.FALSE, Boolean.FALSE, 6); run_BooleanQuery(Boolean_filterR, BooleanParameter, Boolean.TRUE, Boolean.TRUE, 4); run_BooleanQuery(Boolean_filterR, BooleanParameter, Boolean.FALSE, Boolean.FALSE, 6); run_BooleanQuery(Boolean_filterT, null, Boolean.TRUE, Boolean.TRUE, 4); run_BooleanQuery(Boolean_filterF, null, Boolean.FALSE, Boolean.FALSE, 6); alltypes.setBoolean(Boolean.TRUE); run_BooleanQuery(Boolean_filterObj, AllTypesParameter, alltypes, Boolean.TRUE, 4); alltypes.setBoolean(Boolean.FALSE); run_BooleanQuery(Boolean_filterObj, AllTypesParameter, alltypes, Boolean.FALSE, 6); run_ByteQuery(Byte_filterL, byteParameter, new Byte((byte)50), new Byte((byte)50), 2); run_ByteQuery(Byte_filterR, byteParameter, new Byte(Byte.MIN_VALUE), new Byte(Byte.MIN_VALUE), 1); run_ByteQuery(Byte_filterL, ByteParameter, new Byte((byte)20), new Byte((byte)20), 0); run_ByteQuery(Byte_filterR, ByteParameter, new Byte(Byte.MAX_VALUE), new Byte(Byte.MAX_VALUE), 1); run_ByteQuery(Byte_filterL, shortParameter, new Short((short)50), new Byte((byte)50), 2); run_ByteQuery(Byte_filterR, shortParameter, new Short((short)50), new Byte((byte)50), 2); run_ByteQuery(Byte_filterL, ShortParameter, new Short((short)-100), new Byte((byte)-100), 1); run_ByteQuery(Byte_filterR, ShortParameter, new Short((short)-100), new Byte((byte)-100), 1); run_ByteQuery(Byte_filterL, charParameter, new Character((char)50), new Byte((byte)50), 2); run_ByteQuery(Byte_filterR, charParameter, new Character((char)50), new Byte((byte)50), 2); run_ByteQuery(Byte_filterL, CharacterParameter, new Character((char)50), new Byte((byte)50), 2); run_ByteQuery(Byte_filterR, CharacterParameter, new Character((char)75), new Byte((byte)75), 1); run_ByteQuery(Byte_filterL, intParameter, new Integer(50), new Byte((byte)50), 2); run_ByteQuery(Byte_filterR, intParameter, new Integer(50), new Byte((byte)50), 2); run_ByteQuery(Byte_filterL, IntegerParameter, new Integer(50), new Byte((byte)50), 2); run_ByteQuery(Byte_filterR, IntegerParameter, new Integer(75), new Byte((byte)75), 1); run_ByteQuery(Byte_filterL, longParameter, new Long(50), new Byte((byte)50), 2); run_ByteQuery(Byte_filterR, longParameter, new Long(50), new Byte((byte)50), 2); run_ByteQuery(Byte_filterL, LongParameter, new Long(-100), new Byte((byte)-100), 1); run_ByteQuery(Byte_filterR, LongParameter, new Long(-100), new Byte((byte)-100), 1); run_ByteQuery(Byte_filterL, floatParameter, new Float(50), new Byte((byte)50), 2); run_ByteQuery(Byte_filterR, floatParameter, new Float(50), new Byte((byte)50), 2); run_ByteQuery(Byte_filterL, FloatParameter, new Float(-100), new Byte((byte)-100), 1); run_ByteQuery(Byte_filterR, FloatParameter, new Float(-100), new Byte((byte)-100), 1); run_ByteQuery(Byte_filterL, doubleParameter, new Double(50), new Byte((byte)50), 2); run_ByteQuery(Byte_filterR, doubleParameter, new Double(50), new Byte((byte)50), 2); run_ByteQuery(Byte_filterL, DoubleParameter, new Double(-100), new Byte((byte)-100), 1); run_ByteQuery(Byte_filterR, DoubleParameter, new Double(-100), new Byte((byte)-100), 1); run_ByteQuery(Byte_filterL, BigIntegerParameter, new BigInteger("50"), new Byte((byte)50), 2); run_ByteQuery(Byte_filterR, BigIntegerParameter, new BigInteger("-100"), new Byte((byte)-100), 1); run_ByteQuery(Byte_filterL, BigDecimalParameter, new BigDecimal("100.0"), new Byte((byte)100), 1); run_ByteQuery(Byte_filterR, BigDecimalParameter, new BigDecimal("10.0001"), new Byte((byte)10), 0); Byte val = new Byte((byte)50); alltypes.setByte(val); run_ByteQuery(Byte_filterObj, AllTypesParameter, alltypes, val, 2); val = new Byte((byte)45); alltypes.setByte(val); run_ByteQuery(Byte_filterObj, AllTypesParameter, alltypes, val, 0); run_ByteQuery(Byte_filterVal, null, null, new Byte((byte)100), 1); run_ShortQuery(Short_filterL, shortParameter, new Short((short)100), new Short((short)100), 2); run_ShortQuery(Short_filterR, shortParameter, new Short((short)100), new Short((short)100), 2); run_ShortQuery(Short_filterL, ShortParameter, new Short(Short.MIN_VALUE), new Short(Short.MIN_VALUE), 1); run_ShortQuery(Short_filterR, ShortParameter, new Short((short)253), new Short((short)253), 0); run_ShortQuery(Short_filterR, shortParameter, new Short((short)1000), new Short((short)1000), 1); run_ShortQuery(Short_filterL, byteParameter, new Byte((byte)75), new Short((short)75), 0); run_ShortQuery(Short_filterR, byteParameter, new Byte((byte)75), new Short((short)75), 0); run_ShortQuery(Short_filterL, ByteParameter, new Byte((byte)100), new Short((short)100), 2); run_ShortQuery(Short_filterR, ByteParameter, new Byte((byte)100), new Short((short)100), 2); run_ShortQuery(Short_filterL, charParameter, new Character((char)75), new Short((short)75), 0); run_ShortQuery(Short_filterR, charParameter, new Character((char)75), new Short((short)75), 0); run_ShortQuery(Short_filterL, CharacterParameter, new Character((char)100), new Short((short)100), 2); run_ShortQuery(Short_filterR, CharacterParameter, new Character((char)100), new Short((short)100), 2); run_ShortQuery(Short_filterL, intParameter, new Integer(-10000), new Short((short)-10000), 1); run_ShortQuery(Short_filterR, intParameter, new Integer(-10000), new Short((short)-10000), 1); run_ShortQuery(Short_filterL, IntegerParameter, new Integer(10000), new Short((short)10000), 1); run_ShortQuery(Short_filterR, IntegerParameter, new Integer(10000), new Short((short)10000), 1); run_ShortQuery(Short_filterL, longParameter, new Long(10000), new Short((short) 10000), 1); run_ShortQuery(Short_filterR, longParameter, new Long(10000), new Short((short) 10000), 1); run_ShortQuery(Short_filterL, LongParameter, new Long(100), new Short((short)100), 2); run_ShortQuery(Short_filterR, LongParameter, new Long(100), new Short((short)100), 2); run_ShortQuery(Short_filterL, floatParameter, new Float(23000), new Short((short)23000), 0); run_ShortQuery(Short_filterR, floatParameter, new Float(23000), new Short((short)23000), 0); run_ShortQuery(Short_filterL, FloatParameter, new Float(100), new Short((short)100), 2); run_ShortQuery(Short_filterR, FloatParameter, new Float(100), new Short((short)100), 2); run_ShortQuery(Short_filterL, doubleParameter, new Double(-10000), new Short((short)-10000), 1); run_ShortQuery(Short_filterR, doubleParameter, new Double(-10000), new Short((short)-10000), 1); run_ShortQuery(Short_filterL, DoubleParameter, new Double(23), new Short((short)23), 0); run_ShortQuery(Short_filterR, DoubleParameter, new Double(23), new Short((short)23), 0); run_ShortQuery(Short_filterL, BigIntegerParameter, new BigInteger("999"), new Short((short)999), 0); run_ShortQuery(Short_filterR, BigIntegerParameter, new BigInteger("-1000"), new Short((short)-1000), 1); run_ShortQuery(Short_filterL, BigDecimalParameter, new BigDecimal("100.0"), new Short((short)100), 2); run_ShortQuery(Short_filterR, BigDecimalParameter, new BigDecimal("101.0"), new Short((short)100), 0); Short sval = new Short((short)100); alltypes.setShort(sval); run_ShortQuery(Short_filterObj, AllTypesParameter, alltypes, sval, 2); sval = new Short((short)23); alltypes.setShort(sval); run_ShortQuery(Short_filterObj, AllTypesParameter, alltypes, sval, 0); run_ShortQuery(Short_filterVal, null, null, new Short((short)-1000), 1); run_CharacterQuery(Character_filterL, charParameter, new Character(Character.MIN_VALUE), new Character(Character.MIN_VALUE), 1); run_CharacterQuery(Character_filterR, charParameter, new Character(Character.MAX_VALUE), new Character(Character.MAX_VALUE), 1); run_CharacterQuery(Character_filterL, charParameter, new Character('C'), new Character('C'), 0); run_CharacterQuery(Character_filterR, charParameter, new Character('z'), new Character('z'), 2); run_CharacterQuery(Character_filterL, CharacterParameter, new Character(' '), new Character(' '), 1); run_CharacterQuery(Character_filterR, CharacterParameter, new Character('f'), new Character('f'), 0); run_CharacterQuery(Character_filterL, byteParameter, new Byte((byte)Character.MIN_VALUE), new Character((char)Character.MIN_VALUE), 1); run_CharacterQuery(Character_filterR, ByteParameter, new Byte((byte)'a'), new Character('a'), 0); run_CharacterQuery(Character_filterL, shortParameter, new Short((short)'M'), new Character('M'), 2); run_CharacterQuery(Character_filterR, shortParameter, new Short((short)'F'), new Character('F'), 1); run_CharacterQuery(Character_filterL, ShortParameter, new Short((short)'A'), new Character('A'), 1); run_CharacterQuery(Character_filterR, ShortParameter, new Short((short)'A'), new Character('A'), 1); run_CharacterQuery(Character_filterL, intParameter, new Integer('z'), new Character('z'), 2); run_CharacterQuery(Character_filterR, intParameter, new Integer('z'), new Character('z'), 2); run_CharacterQuery(Character_filterL, IntegerParameter, new Integer('B'), new Character('B'), 1); run_CharacterQuery(Character_filterR, IntegerParameter, new Integer('B'), new Character('B'), 1); run_CharacterQuery(Character_filterL, longParameter, new Long('z'), new Character('z'), 2); run_CharacterQuery(Character_filterR, longParameter, new Long('z'), new Character('z'), 2); run_CharacterQuery(Character_filterL, LongParameter, new Long('B'), new Character('B'), 1); run_CharacterQuery(Character_filterR, LongParameter, new Long('B'), new Character('B'), 1); run_CharacterQuery(Character_filterL, floatParameter, new Float(123.222), new Character('x'), 0); run_CharacterQuery(Character_filterR, floatParameter, new Float(123.222), new Character('x'), 0); run_CharacterQuery(Character_filterL, FloatParameter, new Float('z'), new Character('z'), 2); run_CharacterQuery(Character_filterR, FloatParameter, new Float('z'), new Character('z'), 2); run_CharacterQuery(Character_filterL, doubleParameter, new Double('B'), new Character('B'), 1); run_CharacterQuery(Character_filterR, doubleParameter, new Double('B'), new Character('B'), 1); run_CharacterQuery(Character_filterL, DoubleParameter, new Double('A'), new Character('A'), 1); run_CharacterQuery(Character_filterR, DoubleParameter, new Double('A'), new Character('A'), 1); run_CharacterQuery(Character_filterL, BigIntegerParameter, new BigInteger("65"), new Character('A'), 1); // 'A' == 65 run_CharacterQuery(Character_filterR, BigIntegerParameter, new BigInteger("122"), new Character('z'), 2); // 'z' == 122 run_CharacterQuery(Character_filterL, BigDecimalParameter, new BigDecimal("65.0"), new Character('A'), 1); run_CharacterQuery(Character_filterR, BigDecimalParameter, new BigDecimal("77.0"), new Character('M'), 2); // 'M' == 77 alltypes.setCharacter(new Character('A')); run_CharacterQuery(Character_filterObj, AllTypesParameter, alltypes, new Character('A'), 1); alltypes.setCharacter(new Character('b')); run_CharacterQuery(Character_filterObj, AllTypesParameter, alltypes, new Character('b'), 0); run_CharacterQuery(Character_filterVal, null, null, new Character('z'), 2); run_IntegerQuery(Integer_filterL, intParameter, new Integer(AllTypes.veryLargeNegativeInt), new Integer(AllTypes.veryLargeNegativeInt), 1); run_IntegerQuery(Integer_filterR, intParameter, new Integer(AllTypes.veryLargePositiveInt), new Integer(AllTypes.veryLargePositiveInt), 1); run_IntegerQuery(Integer_filterR, intParameter, new Integer(23), new Integer(23), 0); run_IntegerQuery(Integer_filterL, IntegerParameter, new Integer(1000000), new Integer(1000000), 1); run_IntegerQuery(Integer_filterR, IntegerParameter, new Integer(1000), new Integer(1000), 1); run_IntegerQuery(Integer_filterL, byteParameter, new Byte((byte)100), new Integer(100), 2); run_IntegerQuery(Integer_filterR, byteParameter, new Byte((byte)0), new Integer(0), 1); run_IntegerQuery(Integer_filterL, ByteParameter, new Byte((byte)100), new Integer(100), 2); run_IntegerQuery(Integer_filterR, ByteParameter, new Byte((byte)0), new Integer(0), 1); run_IntegerQuery(Integer_filterL, shortParameter, new Short((short)10000), new Integer(10000), 1); run_IntegerQuery(Integer_filterR, shortParameter, new Short((short)-1000), new Integer(-1000), 1); run_IntegerQuery(Integer_filterL, ShortParameter, new Short((short)-1000), new Integer(-1000), 1); run_IntegerQuery(Integer_filterL, charParameter, new Character((char)10000), new Integer(10000), 1); run_IntegerQuery(Integer_filterR, charParameter, new Character((char)10000), new Integer(10000), 1); run_IntegerQuery(Integer_filterL, CharacterParameter, new Character((char)100), new Integer(100), 2); run_IntegerQuery(Integer_filterR, CharacterParameter, new Character((char)10000), new Integer(10000), 1); run_IntegerQuery(Integer_filterL, longParameter, new Long(AllTypes.veryLargePositiveInt), new Integer(AllTypes.veryLargePositiveInt), 1); run_IntegerQuery(Integer_filterR, longParameter, new Long(AllTypes.veryLargeNegativeInt), new Integer(AllTypes.veryLargeNegativeInt), 1); run_IntegerQuery(Integer_filterL, LongParameter, new Long(10000), new Integer(10000), 1); run_IntegerQuery(Integer_filterR, LongParameter, new Long(43), new Integer(43), 0); run_IntegerQuery(Integer_filterL, floatParameter, new Float(AllTypes.veryLargePositiveInt), new Integer(AllTypes.veryLargePositiveInt), 1); run_IntegerQuery(Integer_filterR, floatParameter, new Float(AllTypes.veryLargeNegativeInt), new Integer(AllTypes.veryLargeNegativeInt), 1); run_IntegerQuery(Integer_filterL, FloatParameter, new Float(10000), new Integer(10000), 1); run_IntegerQuery(Integer_filterR, FloatParameter, new Float(43), new Integer(43), 0); run_IntegerQuery(Integer_filterL, doubleParameter, new Double(AllTypes.veryLargePositiveInt), new Integer(AllTypes.veryLargePositiveInt), 1); run_IntegerQuery(Integer_filterR, doubleParameter, new Double(AllTypes.veryLargeNegativeInt), new Integer(AllTypes.veryLargeNegativeInt), 1); run_IntegerQuery(Integer_filterL, DoubleParameter, new Double(10000), new Integer(10000), 1); run_IntegerQuery(Integer_filterR, DoubleParameter, new Double(43), new Integer(43), 0); run_IntegerQuery(Integer_filterL, BigIntegerParameter, new BigInteger("1000000"), new Integer(1000000), 1); run_IntegerQuery(Integer_filterR, BigIntegerParameter, new BigInteger("-1000000"), new Integer(-1000000), 1); run_IntegerQuery(Integer_filterL, BigDecimalParameter, new BigDecimal("1000000.0"), new Integer(1000000), 1); run_IntegerQuery(Integer_filterR, BigDecimalParameter, new BigDecimal("-1000000.01"), new Integer(-1000000), 0); alltypes.setInteger(new Integer(100)); run_IntegerQuery(Integer_filterObj, AllTypesParameter, alltypes, new Integer(100), 2); run_IntegerQuery(Integer_filterVal, null, null, new Integer(100), 2); run_LongQuery(Long_filterL, longParameter, new Long(Long.MIN_VALUE), new Long(Long.MIN_VALUE), 1); run_LongQuery(Long_filterR, longParameter, new Long(Long.MAX_VALUE), new Long(Long.MAX_VALUE), 1); run_LongQuery(Long_filterL, LongParameter, new Long(100), new Long(100), 2); run_LongQuery(Long_filterR, LongParameter, new Long(23), new Long(23), 0); run_LongQuery(Long_filterL, byteParameter, new Byte((byte)100), new Long(100), 2); run_LongQuery(Long_filterR, byteParameter, new Byte((byte)0), new Long(0), 1); run_LongQuery(Long_filterL, ByteParameter, new Byte((byte)100), new Long(100), 2); run_LongQuery(Long_filterR, ByteParameter, new Byte((byte)0), new Long(0), 1); run_LongQuery(Long_filterL, shortParameter, new Short((short)-1000 ), new Long(-1000), 2); run_LongQuery(Long_filterR, shortParameter, new Short((short)1000), new Long(1000), 1); run_LongQuery(Long_filterL, ShortParameter, new Short((short)100), new Long(100), 2); run_LongQuery(Long_filterR, ShortParameter, new Short((short)32), new Long(32), 0); run_LongQuery(Long_filterL, charParameter, new Character((char)0), new Long(0), 1); run_LongQuery(Long_filterR, charParameter, new Character((char)100), new Long(100), 2); run_LongQuery(Long_filterL, CharacterParameter, new Character((char)23), new Long(23), 0); run_LongQuery(Long_filterR, CharacterParameter, new Character((char)0), new Long(0), 1); run_LongQuery(Long_filterL, intParameter, new Integer(100), new Long(100), 2); run_LongQuery(Long_filterR, intParameter, new Integer(0), new Long(0), 1); run_LongQuery(Long_filterL, IntegerParameter, new Integer(23), new Long(23), 0); run_LongQuery(Long_filterR, IntegerParameter, new Integer(1000000), new Long(1000000), 1); run_LongQuery(Long_filterL, longParameter, new Long(100), new Long(100), 2); run_LongQuery(Long_filterR, longParameter, new Long(0), new Long(0), 1); run_LongQuery(Long_filterL, LongParameter, new Long(23), new Long(23), 0); run_LongQuery(Long_filterR, LongParameter, new Long(1000000), new Long(1000000), 1); run_LongQuery(Long_filterL, floatParameter, new Float(-1000000.0), new Long(-1000000), 1); // run_LongQuery(Long_filterR, floatParameter, new Float((float)Long.MAX_VALUE), new Long(Long.MAX_VALUE), 1); run_LongQuery(Long_filterL, FloatParameter, new Float(100), new Long(100), 2); run_LongQuery(Long_filterR, FloatParameter, new Float(32), new Long(32), 0); run_LongQuery(Long_filterL, doubleParameter, new Double(-1000000.0), new Long(-1000000), 1); // run_LongQuery(Long_filterR, doubleParameter, new Double((double)Long.MAX_VALUE), new Long(Long.MAX_VALUE), 1); run_LongQuery(Long_filterL, DoubleParameter, new Double(100), new Long(100), 2); run_LongQuery(Long_filterR, DoubleParameter, new Double(32), new Long(32), 0); run_LongQuery(Long_filterL, BigIntegerParameter, new BigInteger("1000000"), new Long(1000000), 1); run_LongQuery(Long_filterR, BigIntegerParameter, new BigInteger("-1000000"), new Long(-1000000), 1); run_LongQuery(Long_filterL, BigDecimalParameter, new BigDecimal("1000000.0"), new Long(1000000), 1); run_LongQuery(Long_filterR, BigDecimalParameter, new BigDecimal("-1000000.0001"), new Long(-1000000), 0); alltypes.setLong(new Long(100)); run_LongQuery(Long_filterObj, AllTypesParameter, alltypes, new Long(100), 2); run_LongQuery(Long_filterVal, null, null, new Long(-1000), 2); run_FloatQuery(Float_filterL, floatParameter, new Float(350.5f), new Float(350.5f), 1); run_FloatQuery(Float_filterR, floatParameter, new Float(350.5f), new Float(350.5f), 1); run_FloatQuery(Float_filterL, FloatParameter, new Float(0.0), new Float(0.0f), 1); run_FloatQuery(Float_filterR, FloatParameter, new Float(4.0), new Float(4.0f), 0); run_FloatQuery(Float_filterL, byteParameter, new Byte((byte)0), new Float(0.0f), 1); run_FloatQuery(Float_filterR, byteParameter, new Byte((byte)23), new Float(23.0f), 0); run_FloatQuery(Float_filterL, ByteParameter, new Byte((byte)34), new Float(34.0f), 0); run_FloatQuery(Float_filterR, ByteParameter, new Byte((byte)100), new Float(100.0f), 2); run_FloatQuery(Float_filterL, shortParameter, new Short((short)0), new Float(0.0f), 1); run_FloatQuery(Float_filterR, shortParameter, new Short((short)23), new Float(23.0f), 0); run_FloatQuery(Float_filterL, ShortParameter, new Short((short)34), new Float(34.0f), 0); run_FloatQuery(Float_filterR, ShortParameter, new Short((short)100), new Float(100.0f), 2); run_FloatQuery(Float_filterL, charParameter, new Character((char)0), new Float(0.0f), 1); run_FloatQuery(Float_filterR, charParameter, new Character((char)23), new Float(23.0f), 0); run_FloatQuery(Float_filterL, CharacterParameter, new Character((char)34), new Float(34.0f), 0); run_FloatQuery(Float_filterR, CharacterParameter, new Character((char)100), new Float(100.0f), 2); run_FloatQuery(Float_filterL, intParameter, new Integer(50000000), new Float(50000000.0f), 1); run_FloatQuery(Float_filterR, intParameter, new Integer(23), new Float(23.0f), 0); run_FloatQuery(Float_filterL, IntegerParameter, new Integer(34), new Float(34.0f), 0); run_FloatQuery(Float_filterR, IntegerParameter, new Integer(100), new Float(100.0f), 2); run_FloatQuery(Float_filterL, longParameter, new Long(50000000), new Float(50000000.0f), 1); run_FloatQuery(Float_filterR, longParameter, new Long(23), new Float(23.0f), 0); run_FloatQuery(Float_filterL, LongParameter, new Long(34), new Float(34.0f), 0); run_FloatQuery(Float_filterR, LongParameter, new Long(100), new Float(100.0f), 2); run_FloatQuery(Float_filterL, doubleParameter, new Double(50000000.0f), new Float(50000000.0f), 1); run_FloatQuery(Float_filterR, doubleParameter, new Double(100.0f), new Float(100.0f), 2); run_FloatQuery(Float_filterL, DoubleParameter, new Double(0.0f), new Float(0.0f), 1); run_FloatQuery(Float_filterR, DoubleParameter, new Double(100.0f), new Float(100.0f), 2); run_FloatQuery(Float_filterL, BigIntegerParameter, new BigInteger("50000000"), new Float(50000000.0f), 1); run_FloatQuery(Float_filterR, BigIntegerParameter, new BigInteger("1000000000"), new Float(1000000000.0f), 1); run_FloatQuery(Float_filterL, BigDecimalParameter, new BigDecimal("350.5"), new Float(350.5f), 1); run_FloatQuery(Float_filterR, BigDecimalParameter, new BigDecimal("50000000.0"), new Float(50000000.0f), 1); alltypes.setFloat(new Float(23.23f)); run_FloatQuery(Float_filterObj, AllTypesParameter, alltypes, new Float(23.23f), 0); run_FloatQuery(Float_filterVal, null, null, new Float(100.0f), 2); run_DoubleQuery(Double_filterL, doubleParameter, new Double(350.5), new Double(350.5), 1); run_DoubleQuery(Double_filterR, doubleParameter, new Double(350.5), new Double(350.5), 1); run_DoubleQuery(Double_filterL, DoubleParameter, new Double(0.0), new Double(0.0), 1); run_DoubleQuery(Double_filterR, DoubleParameter, new Double(23.34), new Double(23.34), 0); run_DoubleQuery(Double_filterL, byteParameter, new Byte((byte)100), new Double(100.0), 2); run_DoubleQuery(Double_filterR, byteParameter, new Byte((byte)0), new Double(0.0), 1); run_DoubleQuery(Double_filterL, ByteParameter, new Byte((byte)23), new Double(23.0), 0); run_DoubleQuery(Double_filterR, ByteParameter, new Byte((byte)100), new Double(100.0), 2); run_DoubleQuery(Double_filterL, shortParameter, new Short((short)100), new Double(100.0), 2); run_DoubleQuery(Double_filterR, shortParameter, new Short((short)0), new Double(0.0), 1); run_DoubleQuery(Double_filterL, ShortParameter, new Short((short)23), new Double(23.0), 0); run_DoubleQuery(Double_filterR, ShortParameter, new Short((short)100), new Double(100.0), 2); run_DoubleQuery(Double_filterL, charParameter, new Character((char)100), new Double(100.0), 2); run_DoubleQuery(Double_filterR, charParameter, new Character((char)0), new Double(0.0), 1); run_DoubleQuery(Double_filterL, CharacterParameter, new Character((char)23), new Double(23.0), 0); run_DoubleQuery(Double_filterR, CharacterParameter, new Character((char)100), new Double(100.0), 2); run_DoubleQuery(Double_filterL, intParameter, new Integer(100), new Double(100.0), 2); run_DoubleQuery(Double_filterR, intParameter, new Integer(0), new Double(0.0), 1); run_DoubleQuery(Double_filterL, IntegerParameter, new Integer(23), new Double(23.0), 0); run_DoubleQuery(Double_filterR, IntegerParameter, new Integer(100), new Double(100.0), 2); run_DoubleQuery(Double_filterL, longParameter, new Long(100), new Double(100.0), 2); run_DoubleQuery(Double_filterR, longParameter, new Long(0), new Double(0.0), 1); run_DoubleQuery(Double_filterL, LongParameter, new Long(23), new Double(23.0), 0); run_DoubleQuery(Double_filterR, LongParameter, new Long(100), new Double(100.0), 2); run_DoubleQuery(Double_filterL, floatParameter, new Float(0.0f), new Double(0.0f), 1); run_DoubleQuery(Double_filterR, floatParameter, new Float(100.0f), new Double(100.0f), 2); run_DoubleQuery(Double_filterL, FloatParameter, new Float(100.0f), new Double(100.0f), 2); run_DoubleQuery(Double_filterR, FloatParameter, new Float(69.96f), new Double(69.96), 0); run_DoubleQuery(Double_filterL, BigIntegerParameter, new BigInteger("50000000"), new Double(50000000.0f), 1); run_DoubleQuery(Double_filterR, BigIntegerParameter, new BigInteger("1000000000"), new Double(1000000000.0f), 1); run_DoubleQuery(Double_filterL, BigDecimalParameter, new BigDecimal("350.5"), new Double(350.5f), 1); run_DoubleQuery(Double_filterR, BigDecimalParameter, new BigDecimal("50000000.0"), new Double(50000000.0f), 1); alltypes.setDouble(new Double(-25.5)); run_DoubleQuery(Double_filterObj, AllTypesParameter, alltypes, new Double(-25.5), 1); run_DoubleQuery(Double_filterVal, null, null, new Double(-25.5), 1); run_StringQuery(String_filterL, StringParameter, new String("JDO"), new String("JDO"), 1); run_StringQuery(String_filterR, StringParameter, new String("JDBC"), new String("JDBC"), 0); alltypes.setString(new String("abcde")); run_StringQuery(String_filterObj, AllTypesParameter, alltypes, new String("abcde"), 1); run_StringQuery(String_filterVal1, null, null, new String("Java"), 2); run_StringQuery(String_filterVal2, null, null, new String(""), 1); run_LocaleQuery(Locale_filterL, LocaleParameter, Locale.CANADA_FRENCH, Locale.CANADA_FRENCH, 0); run_LocaleQuery(Locale_filterR, LocaleParameter, Locale.US, Locale.US, 1); alltypes.setLocale(Locale.UK); run_LocaleQuery(Locale_filterObj, AllTypesParameter, alltypes, Locale.UK, 1); BigDecimal bd = new BigDecimal("100.0"); run_BigDecimalQuery(BigDecimal_filterL, BigDecimalParameter, bd, bd, 2); bd = new BigDecimal("-234234.23333"); run_BigDecimalQuery(BigDecimal_filterR, BigDecimalParameter, bd, bd, 1); bd = new BigDecimal("989899.33304953"); run_BigDecimalQuery(BigDecimal_filterL, BigDecimalParameter, bd, bd, 0); bd = new BigDecimal("-1123123.22"); run_BigDecimalQuery(BigDecimal_filterR, BigDecimalParameter, bd, bd, 1); alltypes.setBigDecimal(bd); run_BigDecimalQuery(BigDecimal_filterObj, AllTypesParameter, alltypes, bd, 1); BigInteger bi = new BigInteger("987034534985043985"); run_BigIntegerQuery(BigInteger_filterL, BigIntegerParameter, bi, bi, 1); bi = new BigInteger("-999999999999999999"); run_BigIntegerQuery(BigInteger_filterR, BigIntegerParameter, bi, bi, 1); bi = new BigInteger("-99999999999999999"); run_BigIntegerQuery(BigInteger_filterR, BigIntegerParameter, bi, bi, 0); bi = new BigInteger("1333330"); alltypes.setBigInteger(bi); run_BigIntegerQuery(BigInteger_filterObj, AllTypesParameter, alltypes, bi, 1); GregorianCalendar gc = new GregorianCalendar(TimeZone.getTimeZone("GMT"), Locale.UK); gc.clear(); gc.set(1999, Calendar.DECEMBER, 31, 9, 0, 0); Date d = gc.getTime(); run_DateQuery(Date_filterL, DateParameter, d, d, 1); gc.set(1992, Calendar.NOVEMBER, 22, 9, 0, 0); d = gc.getTime(); run_DateQuery(Date_filterR, DateParameter, d, d, 1); gc.set(1959, Calendar.OCTOBER, 9, 9, 0, 0); d = gc.getTime(); run_DateQuery(Date_filterR, DateParameter, d, d, 0); gc.set(1995, Calendar.JUNE, 14, 9, 0, 0); d = gc.getTime(); alltypes.setDate(d); run_DateQuery(Date_filterObj, AllTypesParameter, alltypes, d, 1); } private void run_booleanQuery(String filter, String parameter, Object parameterValue, boolean value, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while(iter.hasNext()){ AllTypes obj = (AllTypes) iter.next(); boolean val = obj.getboolean(); if (val != value) { fail(ASSERTION_FAILED, "JDOQL Equality test returns object with incorrect value, retrieved value: " + val + ", expected value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL Equality test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_byteQuery(String filter, String parameter, Object parameterValue, byte value, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); byte val = obj.getbyte(); if( val != value ){ fail(ASSERTION_FAILED, "JDOQL Equality test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL Equality test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_shortQuery(String filter, String parameter, Object parameterValue, short value, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); short val = obj.getshort(); if( val != value ){ fail(ASSERTION_FAILED, "JDOQL Equality test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL Equality test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_charQuery(String filter, String parameter, Object parameterValue, char value, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); char val = obj.getchar(); if( val != value ){ fail(ASSERTION_FAILED, "JDOQL Equality test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL Equality test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_intQuery(String filter, String parameter, Object parameterValue, int value, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); int val = obj.getint(); if( val != value ){ fail(ASSERTION_FAILED, "JDOQL Equality test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL Equality test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_longQuery(String filter, String parameter, Object parameterValue, long value, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); long val = obj.getlong(); if( val != value ){ fail(ASSERTION_FAILED, "JDOQL Equality test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL Equality test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_floatQuery(String filter, String parameter, Object parameterValue, float value, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); float val = obj.getfloat(); if( val != value ){ fail(ASSERTION_FAILED, "JDOQL Equality test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL Equality test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_doubleQuery(String filter, String parameter, Object parameterValue, double value, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); double val = obj.getdouble(); if( val != value ){ fail(ASSERTION_FAILED, "JDOQL Equality test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL Equality test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_BooleanQuery(String filter, String parameter, Object parameterValue, Boolean value, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while(iter.hasNext()){ AllTypes obj = (AllTypes) iter.next(); Boolean val = obj.getBoolean(); if( !val.equals(value) ){ fail(ASSERTION_FAILED, "JDOQL Equality test returns object with incorrect value", filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL Equality test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_ByteQuery(String filter, String parameter, Object parameterValue, Byte value, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); Byte val = obj.getByte(); if( !val.equals(value) ){ fail(ASSERTION_FAILED, "JDOQL Equality test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL Equality test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_ShortQuery(String filter, String parameter, Object parameterValue, Short value, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); Short val = obj.getShort(); if( !val.equals(value) ){ fail(ASSERTION_FAILED, "JDOQL Equality test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL Equality test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_CharacterQuery(String filter, String parameter, Object parameterValue, Character value, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); Character val = obj.getCharacter(); if( !val.equals(value) ){ fail(ASSERTION_FAILED, "JDOQL Equality test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL Equality test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_IntegerQuery(String filter, String parameter, Object parameterValue, Integer value, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); Integer val = obj.getInteger(); if( !val.equals(value) ){ fail(ASSERTION_FAILED, "JDOQL Equality test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL Equality test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_LongQuery(String filter, String parameter, Object parameterValue, Long value, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); Long val = obj.getLong(); if( !val.equals(value) ){ fail(ASSERTION_FAILED, "JDOQL Equality test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL Equality test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_FloatQuery(String filter, String parameter, Object parameterValue, Float value, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); Float val = obj.getFloat(); if( !val.equals(value) ){ fail(ASSERTION_FAILED, "JDOQL Equality test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL Equality test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_DoubleQuery(String filter, String parameter, Object parameterValue, Double value, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); Double val = obj.getDouble(); if( !val.equals(value) ){ fail(ASSERTION_FAILED, "JDOQL Equality test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL Equality test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_StringQuery(String filter, String parameter, Object parameterValue, String value, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); String val = obj.getString(); if( !val.equals(value) ){ fail(ASSERTION_FAILED, "JDOQL Equality test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL Equality test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_LocaleQuery(String filter, String parameter, Object parameterValue, Locale value, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); Locale val = obj.getLocale(); if( !val.equals(value) ){ fail(ASSERTION_FAILED, "JDOQL Equality test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL Equality test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_BigDecimalQuery(String filter, String parameter, Object parameterValue, BigDecimal value, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); BigDecimal val = obj.getBigDecimal(); // if( !val.equals(value) ){ if( val.compareTo(value) != 0 ){ fail(ASSERTION_FAILED, "JDOQL Equality test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL Equality test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_BigIntegerQuery(String filter, String parameter, Object parameterValue, BigInteger value, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); BigInteger val = obj.getBigInteger(); if( !val.equals(value) ){ fail(ASSERTION_FAILED, "JDOQL Equality test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL Equality test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_DateQuery(String filter, String parameter, Object parameterValue, Date value, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); Date val = obj.getDate(); if( !val.equals(value) ){ fail(ASSERTION_FAILED, "JDOQL Equality test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL Equality test returns wrong number of instances", filter, parameter); } query.close(query_result); tx.rollback(); } /** */ protected void localSetUp() { addTearDownClass(AllTypes.class); AllTypes.load(getPM()); } } ././@LongLink100644 0 0 160 12500111677 10250 Lustar 0 0 tck/src/java/org/apache/jdo/tck/query/jdoql/operators/EqualityAndComparisonsBetweenDateFieldsAndParameters.javatck/src/java/org/apache/jdo/tck/query/jdoql/operators/EqualityAndComparisonsBetweenDateFieldsAndPara100664 12727 12500110373 34321 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.operators; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; import java.util.TimeZone; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Equality and Comparisons Between Date Fields and Parameters *
*Keywords: query *
*Assertion ID: A14.6.2-4. *
*Assertion Description: Equality and ordering comparisons of Date fields and Date parameters are valid in a Query filter. */ public class EqualityAndComparisonsBetweenDateFieldsAndParameters extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-4 (EqualityAndComparisonsBetweenDateFieldsAndParameters) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { // date field == date parameter new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ "hiredate == param", /*VARIABLES*/ null, /*PARAMETERS*/ "java.util.Date param", /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // date field >= date parameter new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ "hiredate >= param", /*VARIABLES*/ null, /*PARAMETERS*/ "java.util.Date param", /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // date field >= date parameter new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ "param < birthdate", /*VARIABLES*/ null, /*PARAMETERS*/ "java.util.Date param", /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), }; /** * The expected results of valid queries. */ private Object[] expectedResult = { // date field == date parameter getTransientCompanyModelInstancesAsList(new String[]{"emp1"}), // date field >= date parameter getTransientCompanyModelInstancesAsList(new String[]{ "emp1", "emp2", "emp3", "emp4"}), // date field >= date parameter getTransientCompanyModelInstancesAsList(new String[]{}) }; /** */ private static final Date FIRST_OF_JAN_1999; static { // initialize static field FIRST_OF_JAN_1999 Calendar cal = new GregorianCalendar(); cal.set(1999, GregorianCalendar.JANUARY, 1, 0, 0, 0); cal.set(GregorianCalendar.MILLISECOND, 0); FIRST_OF_JAN_1999 = cal.getTime(); } /** Parameters of valid queries. */ private Object[][] parameters = { // date field == date parameter {FIRST_OF_JAN_1999}, // date field >= date parameter {FIRST_OF_JAN_1999}, // date field >= date parameter {FIRST_OF_JAN_1999} }; /** * The main 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(EqualityAndComparisonsBetweenDateFieldsAndParameters.class); } /** */ public void testPositive() { for (int i = 0; i < VALID_QUERIES.length; i++) { executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[i], parameters[i], expectedResult[i]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[i], parameters[i], expectedResult[i]); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } ././@LongLink100644 0 0 166 12500111677 10256 Lustar 0 0 tck/src/java/org/apache/jdo/tck/query/jdoql/operators/EqualityAndComparisonsBetweenPrimitivesAndWrapperInstances.javatck/src/java/org/apache/jdo/tck/query/jdoql/operators/EqualityAndComparisonsBetweenPrimitivesAndWrap100664 7444 12500110373 34456 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.operators; import java.util.Collection; import java.util.HashSet; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PrimitiveTypes; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Equality and Comparisons Between Primitives and Wrapper Instances *
*Keywords: query *
*Assertion ID: A14.6.2-3. *
*Assertion Description: Equality and ordering comparisons between * primitives and instances of wrapper classes are valid in a Query * filter. */ public class EqualityAndComparisonsBetweenPrimitivesAndWrapperInstances extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-3 (EqualityAndComparisonsBetweenPrimitivesAndWrapperInstances) failed: "; /** * The main 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(EqualityAndComparisonsBetweenPrimitivesAndWrapperInstances.class); } /** */ public void testPositive() { PersistenceManager pm = getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); Collection instance9 = (Collection)pm.newQuery( PrimitiveTypes.class, "id == 9").execute(); Collection instancesLess3 = (Collection)pm.newQuery( PrimitiveTypes.class, "id < 3").execute(); Collection allOddInstances = (Collection)pm.newQuery( PrimitiveTypes.class, "booleanNull").execute(); Collection allInstances = (Collection)pm.newQuery( PrimitiveTypes.class, "true").execute(); Collection empty = new HashSet(); // case Integer == int runSimplePrimitiveTypesQuery("intNull == 9", pm, instance9, ASSERTION_FAILED); // case Integer == long runSimplePrimitiveTypesQuery("intNull == 9L", pm, instance9, ASSERTION_FAILED); // case char == Character runSimplePrimitiveTypesQuery("'O' == charNull", pm, allOddInstances, ASSERTION_FAILED); // case int <= Integer runParameterPrimitiveTypesQuery( "intNotNull <= param", "java.lang.Integer param", new Integer(2), pm, instancesLess3, ASSERTION_FAILED); // case Double > double runSimplePrimitiveTypesQuery("doubleNull > 0.0", pm, allInstances, ASSERTION_FAILED); tx.commit(); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PrimitiveTypes.class); loadAndPersistPrimitiveTypes(getPM()); } } ././@LongLink100644 0 0 162 12500111677 10252 Lustar 0 0 tck/src/java/org/apache/jdo/tck/query/jdoql/operators/EqualityAndComparisonsBetweenStringFieldsAndParameters.javatck/src/java/org/apache/jdo/tck/query/jdoql/operators/EqualityAndComparisonsBetweenStringFieldsAndPa100664 12162 12500110373 34360 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.operators; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Equality and Comparisons Between String Fields and Parameters *
*Keywords: query *
*Assertion ID: A14.6.2-5. *
*Assertion Description: Equality and ordering comparisons of String fields and String parameters are valid. The comparison is done lexicographically. */ public class EqualityAndComparisonsBetweenStringFieldsAndParameters extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-5 (EqualityAndComparisonsBetweenStringFieldsAndParameters) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { // string field == string parameter new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ "firstname == param", /*VARIABLES*/ null, /*PARAMETERS*/ "java.lang.String param", /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // string field >= string parameter new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ "firstname >= param", /*VARIABLES*/ null, /*PARAMETERS*/ "java.lang.String param", /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // string parameter < string field new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ "param < firstname", /*VARIABLES*/ null, /*PARAMETERS*/ "java.lang.String param", /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), }; /** * The expected results of valid queries. */ private Object[] expectedResult = { // string field == string parameter getTransientCompanyModelInstancesAsList(new String[]{"emp1"}), // string field >= string parameter getTransientCompanyModelInstancesAsList(new String[]{ "emp1", "emp2", "emp3", "emp4", "emp5"}), // string parameter < string field getTransientCompanyModelInstancesAsList(new String[]{ "emp3", "emp4", "emp5"}), }; /** Parameters of valid queries. */ private Object[][] parameters = { // string field == string parameter {"emp1First"}, // string field >= string parameter {"emp1First"}, // string parameter < string field {"emp2First"} }; /** * The main 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(EqualityAndComparisonsBetweenStringFieldsAndParameters.class); } /** */ public void testPositive() { for (int i = 0; i < VALID_QUERIES.length; i++) { executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[i], parameters[i], expectedResult[i]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[i], parameters[i], expectedResult[i]); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/operators/GreaterThan.java100664 241157 12500110373 26342 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.operators; import java.math.BigDecimal; import java.math.BigInteger; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; import java.util.Iterator; import java.util.Locale; import java.util.TimeZone; import org.apache.jdo.tck.pc.fieldtypes.AllTypes; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Greater Than Query Operator *
*Keywords: query *
*Assertion ID: A14.6.2-16. *
*Assertion Description: The greater than operator (>) is supported for all types as they are defined in the Java language. This includes the following types:
  • byte, short, int, long, char, Byte, Short Integer, Long, Character
  • float, double, Float, Double
  • BigDecimal, BigInteger
  • Date, String
The operation on object-valued fields of wrapper types (Boolean, Byte, Short, Integer, Long, Float, and Double), and numeric types (BigDecimal and BigInteger) use the wrapped values as operands. */ public class GreaterThan extends ComparisonTests { private static String boolean_filterL = "value > fld_boolean"; private static String boolean_filterR = "fld_boolean > value"; private static String boolean_filterT = "fld_boolean > true"; private static String boolean_filterF = "false > fld_boolean"; private static String boolean_filterObj = "value.fld_boolean > fld_boolean"; private static String byte_filterL = "value > fld_byte"; private static String byte_filterR = "fld_byte > value"; private static String byte_filterObj = "value.fld_byte > fld_byte"; private static String byte_filterVal = "fld_byte > 100"; private static String char_filterL = "value > fld_char"; private static String char_filterR = "fld_char > value"; private static String char_filterObj = "value.fld_char > fld_char"; private static String char_filterVal = "'M' > fld_char"; private static String double_filterL = "value > fld_double"; private static String double_filterR = "fld_double > value"; private static String double_filterObj = "value.fld_double > fld_double"; private static String double_filterVal = "fld_double > 100.0"; private static String float_filterL = "value > fld_float"; private static String float_filterR = "fld_float > value"; private static String float_filterObj = "fld_float > value.fld_float"; private static String float_filterVal = "fld_float > 100.0"; private static String int_filterL = "value > fld_int"; private static String int_filterR = "fld_int > value"; private static String int_filterObj = "value.fld_int > fld_int"; private static String int_filterVal = "fld_int > 1000"; private static String long_filterL = "value > fld_long"; private static String long_filterR = "fld_long > value"; private static String long_filterObj = "fld_long > value.fld_long"; private static String long_filterVal = "fld_long > 1000000"; private static String short_filterL = "value > fld_short"; private static String short_filterR = "fld_short > value"; private static String short_filterObj = "value.fld_short > fld_short"; private static String short_filterVal = "1000 > fld_short"; private static String Boolean_filterL = "value > fld_Boolean"; private static String Boolean_filterR = "fld_Boolean > value"; private static String Boolean_filterT = "fld_Boolean > true"; private static String Boolean_filterF = "false > fld_Boolean"; private static String Boolean_filterObj = "value.fld_Boolean > fld_Boolean"; private static String Boolean_filterVal = "fld_Boolean > false"; private static String Byte_filterL = "value > fld_Byte"; private static String Byte_filterR = "fld_Byte > value"; private static String Byte_filterObj = "fld_Byte > value.fld_Byte"; private static String Byte_filterVal = "100 > fld_Byte"; private static String Character_filterL = "value > fld_Character"; private static String Character_filterR = "fld_Character > value"; private static String Character_filterObj = "value.fld_Character > fld_Character"; private static String Character_filterVal = "fld_Character > 'z'"; private static String Double_filterL = "value > fld_Double"; private static String Double_filterR = "fld_Double > value"; private static String Double_filterObj = "value.fld_Double > fld_Double"; private static String Double_filterVal = "fld_Double > 100.0"; private static String Float_filterL = "value > fld_Float"; private static String Float_filterR = "fld_Float > value"; private static String Float_filterObj = "fld_Float > value.fld_Float"; private static String Float_filterVal = "100.0f > fld_Float"; private static String Integer_filterL = "value > fld_Integer"; private static String Integer_filterR = "fld_Integer > value"; private static String Integer_filterObj = "fld_Integer > value.fld_Integer"; private static String Integer_filterVal = "fld_Integer > 100"; private static String Long_filterL = "value > fld_Long"; private static String Long_filterR = "fld_Long > value"; private static String Long_filterObj = "value.fld_Long > fld_Long"; private static String Long_filterVal = "-1000 > fld_Long"; private static String Short_filterL = "value > fld_Short"; private static String Short_filterR = "fld_Short > value"; private static String Short_filterObj = "fld_Short > value.fld_Short"; private static String Short_filterVal = "-1000 > fld_Short"; private static String String_filterL = "value > fld_String"; private static String String_filterR = "fld_String > value"; private static String String_filterObj = "value.fld_String > fld_String"; private static String String_filterVal1 = "fld_String > \"Java\""; private static String String_filterVal2 = "fld_String > \"\""; private static String Date_filterL = "value > fld_Date"; private static String Date_filterR = "fld_Date > value"; private static String Date_filterObj = "fld_Date > value.fld_Date"; private static String BigDecimal_filterL = "value > fld_BigDecimal"; private static String BigDecimal_filterR = "fld_BigDecimal > value"; private static String BigDecimal_filterObj = "value.fld_BigDecimal > fld_BigDecimal"; private static String BigInteger_filterL = "value > fld_BigInteger"; private static String BigInteger_filterR = "fld_BigInteger > value"; private static String BigInteger_filterObj = "fld_BigInteger > value.fld_BigInteger"; /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-16 (GreaterThan) failed: "; /** * The main 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(GreaterThan.class); } /** */ public void test() { pm = getPM(); tx = pm.currentTransaction(); runQueries(); } /** */ private void runQueries() { AllTypes alltypes = new AllTypes(); run_byteQuery(byte_filterL, byteParameter, new Byte((byte)0), (byte)0, true, 3); run_byteQuery(byte_filterR, byteParameter, new Byte(Byte.MIN_VALUE), Byte.MIN_VALUE, false, 9); run_byteQuery(byte_filterL, ByteParameter, new Byte((byte)50), (byte)50, true, 5); run_byteQuery(byte_filterR, ByteParameter, new Byte(Byte.MAX_VALUE), Byte.MAX_VALUE, false, 0); run_byteQuery(byte_filterL, shortParameter, new Short((short)75), (byte)75, true, 7); run_byteQuery(byte_filterR, shortParameter, new Short((short)75), (byte)75, false, 2); run_byteQuery(byte_filterL, ShortParameter, new Short((short)10), (byte)10, true, 4); run_byteQuery(byte_filterR, ShortParameter, new Short((short)25), (byte)25, false, 5); run_byteQuery(byte_filterL, charParameter, new Character((char)101), (byte)101, true, 9); run_byteQuery(byte_filterR, charParameter, new Character((char)50), (byte)50, false, 3); run_byteQuery(byte_filterL, CharacterParameter, new Character((char)0), (byte)0, true, 3); run_byteQuery(byte_filterR, CharacterParameter, new Character((char)0), (byte)0, false, 6); run_byteQuery(byte_filterL, intParameter, new Integer(25), (byte)25, true, 5); run_byteQuery(byte_filterR, intParameter, new Integer(50), (byte)50, false, 3); run_byteQuery(byte_filterL, IntegerParameter, new Integer(-10), (byte)-10, true, 2); run_byteQuery(byte_filterR, IntegerParameter, new Integer(-100), (byte)-100, false, 8); run_byteQuery(byte_filterL, longParameter, new Long(50), (byte)50, true, 5); run_byteQuery(byte_filterR, longParameter, new Long(60), (byte)60, false, 3); run_byteQuery(byte_filterL, LongParameter, new Long(-100), (byte)-100, true, 1); run_byteQuery(byte_filterR, LongParameter, new Long(-100), (byte)-100, false, 8); run_byteQuery(byte_filterL, floatParameter, new Float(51), (byte)51, true, 7); run_byteQuery(byte_filterR, floatParameter, new Float(-20), (byte)-20, false, 8); run_byteQuery(byte_filterL, FloatParameter, new Float(-99), (byte)-99, true, 2); run_byteQuery(byte_filterR, FloatParameter, new Float(-100), (byte)-100, false, 8); run_byteQuery(byte_filterL, doubleParameter, new Double(50), (byte)50, true, 5); run_byteQuery(byte_filterR, doubleParameter, new Double(60), (byte)60, false, 3); run_byteQuery(byte_filterL, DoubleParameter, new Double(Byte.MAX_VALUE), Byte.MAX_VALUE, true, 9); run_byteQuery(byte_filterR, DoubleParameter, new Double(25), (byte)25, false, 5); run_byteQuery(byte_filterL, BigIntegerParameter, new BigInteger("50"), (byte)50, true, 5); run_byteQuery(byte_filterR, BigIntegerParameter, new BigInteger("-100"), (byte)-100, false, 8); run_byteQuery(byte_filterL, BigDecimalParameter, new BigDecimal("50.000000"), (byte)50, true, 5); run_byteQuery(byte_filterR, BigDecimalParameter, new BigDecimal("10.00000"), (byte)10, false, 5); alltypes.setbyte((byte)50); run_byteQuery(byte_filterObj, AllTypesParameter, alltypes, (byte)50, true, 5); alltypes.setbyte((byte)55); run_byteQuery(byte_filterObj, AllTypesParameter, alltypes, (byte)55, true, 7); run_byteQuery(byte_filterVal, null, null, (byte)100, false, 1); run_shortQuery(short_filterL, shortParameter, new Short((short)100), (short)100, true, 5); run_shortQuery(short_filterR, shortParameter, new Short((short)100), (short)100, false, 3); run_shortQuery(short_filterL, ShortParameter, new Short(Short.MIN_VALUE), Short.MIN_VALUE, true, 0); run_shortQuery(short_filterR, ShortParameter, new Short((short)253), (short)253, false, 3); run_shortQuery(short_filterR, shortParameter, new Short((short)1000), (short)1000, false, 2); run_shortQuery(short_filterL, byteParameter, new Byte((byte)75), (short)75, true, 5); run_shortQuery(short_filterR, byteParameter, new Byte((byte)-75), (short)-75, false, 6); run_shortQuery(short_filterL, ByteParameter, new Byte((byte)100), (short)100, true, 5); run_shortQuery(short_filterR, ByteParameter, new Byte((byte)100), (short)100, false, 3); run_shortQuery(short_filterL, charParameter, new Character((char)75), (short)75, true, 5); run_shortQuery(short_filterR, charParameter, new Character((char)9999), (short)9999, false, 2); run_shortQuery(short_filterL, CharacterParameter, new Character((char)1000), (short)1000, true, 7); run_shortQuery(short_filterR, CharacterParameter, new Character((char)10000), (short)10000, false, 1); run_shortQuery(short_filterL, intParameter, new Integer(-10000), (short)-10000, true, 1); run_shortQuery(short_filterR, intParameter, new Integer(-10000), (short)-10000, false, 8); run_shortQuery(short_filterL, IntegerParameter, new Integer(10000), (short)10000, true, 8); run_shortQuery(short_filterR, IntegerParameter, new Integer(30000), (short)30000, false, 1); run_shortQuery(short_filterL, longParameter, new Long(10000), (short) 10000, true, 8); run_shortQuery(short_filterR, longParameter, new Long(Short.MAX_VALUE), Short.MAX_VALUE, false, 0); run_shortQuery(short_filterL, LongParameter, new Long(Short.MAX_VALUE), Short.MAX_VALUE, true, 9); run_shortQuery(short_filterR, LongParameter, new Long(100), (short)100, false, 3); run_shortQuery(short_filterL, floatParameter, new Float(23000), (short)23000, true, 9); run_shortQuery(short_filterR, floatParameter, new Float(23000), (short)23000, false, 1); run_shortQuery(short_filterL, FloatParameter, new Float(-1000), (short)-1000, true, 2); run_shortQuery(short_filterR, FloatParameter, new Float(100), (short)100, false, 3); run_shortQuery(short_filterL, doubleParameter, new Double(-10000.0), (short)-10000, true, 1); run_shortQuery(short_filterR, doubleParameter, new Double(9999.0), (short)9999, false, 2); run_shortQuery(short_filterL, DoubleParameter, new Double(23.0), (short)23, true, 5); run_shortQuery(short_filterR, DoubleParameter, new Double(23.0), (short)23, false, 5); run_shortQuery(short_filterL, BigIntegerParameter, new BigInteger("10000"), (short)10000, true, 8); run_shortQuery(short_filterR, BigIntegerParameter, new BigInteger("30000"), (short)30000, false, 1); run_shortQuery(short_filterL, BigDecimalParameter, new BigDecimal("23.0"), (short)23, true, 5); run_shortQuery(short_filterR, BigDecimalParameter, new BigDecimal("23.0"), (short)23, false, 5); alltypes.setshort((short)100); run_shortQuery(short_filterObj, AllTypesParameter, alltypes, (short)100, true, 5); alltypes.setshort((short)23); run_shortQuery(short_filterObj, AllTypesParameter, alltypes, (short)23, true, 5); run_shortQuery(short_filterVal, null, null, (short)1000, true, 7); run_charQuery(char_filterL, charParameter, new Character(Character.MIN_VALUE), Character.MIN_VALUE, true, 0); run_charQuery(char_filterR, charParameter, new Character(Character.MAX_VALUE), Character.MAX_VALUE, false, 0); run_charQuery(char_filterL, charParameter, new Character('C'), 'C', true, 4); run_charQuery(char_filterR, charParameter, new Character('z'), 'z', false, 1); run_charQuery(char_filterL, CharacterParameter, new Character(' '), ' ', true, 1); run_charQuery(char_filterR, CharacterParameter, new Character('f'), 'f', false, 3); run_charQuery(char_filterL, byteParameter, new Byte((byte)Character.MIN_VALUE), (char)Character.MIN_VALUE, true, 0); run_charQuery(char_filterR, ByteParameter, new Byte((byte)'a'), 'a', false, 3); run_charQuery(char_filterL, shortParameter, new Short((short)'M'), 'M', true, 5); run_charQuery(char_filterR, shortParameter, new Short((short)'M'), 'M', false, 3); run_charQuery(char_filterL, ShortParameter, new Short((short)'A'), 'A', true, 2); run_charQuery(char_filterR, ShortParameter, new Short((short)'A'), 'A', false, 7); run_charQuery(char_filterL, intParameter, new Integer('z'), 'z', true, 7); run_charQuery(char_filterR, intParameter, new Integer('z'), 'z', false, 1); run_charQuery(char_filterL, IntegerParameter, new Integer('B'), 'B', true, 3); run_charQuery(char_filterR, IntegerParameter, new Integer('B'), 'B', false, 6); run_charQuery(char_filterL, floatParameter, new Float('f'), 'f', true, 7); run_charQuery(char_filterR, floatParameter, new Float(' '), ' ', false, 8); run_charQuery(char_filterL, FloatParameter, new Float('z'), 'z', true, 7); run_charQuery(char_filterR, FloatParameter, new Float('z'), 'z', false, 1); run_charQuery(char_filterL, doubleParameter, new Double('B'), 'B', true, 3); run_charQuery(char_filterR, doubleParameter, new Double('B'), 'B', false, 6); run_charQuery(char_filterL, DoubleParameter, new Double('A'), 'A', true, 2); run_charQuery(char_filterR, DoubleParameter, new Double('A'), 'A', false, 7); run_charQuery(char_filterL, BigIntegerParameter, new BigInteger("65"), 'A', true, 2); // 'A' == 65 run_charQuery(char_filterR, BigIntegerParameter, new BigInteger("122"), 'z', false, 1); // 'z' == 122 run_charQuery(char_filterL, BigDecimalParameter, new BigDecimal("65.00000"), 'A', true, 2); run_charQuery(char_filterR, BigDecimalParameter, new BigDecimal("77.0000"), 'M', false, 3); // 'M' == 77 alltypes.setchar('A'); run_charQuery(char_filterObj, AllTypesParameter, alltypes, 'A', true, 2); alltypes.setchar('b'); run_charQuery(char_filterObj, AllTypesParameter, alltypes, 'b', true, 7); run_charQuery(char_filterVal, null, null, 'M', true, 5); run_intQuery(int_filterL, intParameter, new Integer(AllTypes.veryLargeNegativeInt), AllTypes.veryLargeNegativeInt, true, 0); run_intQuery(int_filterR, intParameter, new Integer(AllTypes.veryLargePositiveInt), AllTypes.veryLargePositiveInt, false, 0); run_intQuery(int_filterR, intParameter, new Integer(23), 23, false, 6); run_intQuery(int_filterL, IntegerParameter, new Integer(1000000), 1000000, true, 8); run_intQuery(int_filterR, IntegerParameter, new Integer(1000), 1000, false, 3); run_intQuery(int_filterL, byteParameter, new Byte((byte)100), 100, true, 4); run_intQuery(int_filterR, byteParameter, new Byte((byte)0), 0, false, 6); run_intQuery(int_filterL, ByteParameter, new Byte((byte)100), 100, true, 4); run_intQuery(int_filterR, ByteParameter, new Byte((byte)0), 0, false, 6); run_intQuery(int_filterL, shortParameter, new Short((short)10000), 10000, true, 7); run_intQuery(int_filterR, shortParameter, new Short((short)-1000), -1000, false, 7); run_intQuery(int_filterL, ShortParameter, new Short((short)-1000), -1000, true, 2); run_intQuery(int_filterR, ShortParameter, new Short((short)10000), 10000, false, 2); run_intQuery(int_filterL, charParameter, new Character((char)100), 100, true, 4); run_intQuery(int_filterR, charParameter, new Character((char)0), 0, false, 6); run_intQuery(int_filterL, CharacterParameter, new Character((char)100), 100, true, 4); run_intQuery(int_filterR, CharacterParameter, new Character((char)10000), 10000, false, 2); run_intQuery(int_filterL, longParameter, new Long(AllTypes.veryLargePositiveInt), AllTypes.veryLargePositiveInt, true, 9); run_intQuery(int_filterR, longParameter, new Long(AllTypes.veryLargeNegativeInt), AllTypes.veryLargeNegativeInt, false, 9); run_intQuery(int_filterL, LongParameter, new Long(10000), 10000, true, 7); run_intQuery(int_filterR, LongParameter, new Long(43), 43, false, 6); run_intQuery(int_filterL, floatParameter, new Float(AllTypes.veryLargePositiveInt), AllTypes.veryLargePositiveInt, true, 9); run_intQuery(int_filterR, floatParameter, new Float(AllTypes.veryLargeNegativeInt), AllTypes.veryLargeNegativeInt, false, 9); run_intQuery(int_filterL, FloatParameter, new Float(10000), 10000, true, 7); run_intQuery(int_filterR, FloatParameter, new Float(43), 43, false, 6); run_intQuery(int_filterL, doubleParameter, new Double(AllTypes.veryLargePositiveInt), AllTypes.veryLargePositiveInt, true, 9); run_intQuery(int_filterR, doubleParameter, new Double(AllTypes.veryLargeNegativeInt), AllTypes.veryLargeNegativeInt, false, 9); run_intQuery(int_filterL, DoubleParameter, new Double(10000.0), 10000, true, 7); run_intQuery(int_filterR, DoubleParameter, new Double(43.0), 43, false, 6); run_intQuery(int_filterL, BigIntegerParameter, new BigInteger("1000000"), 1000000, true, 8); run_intQuery(int_filterR, BigIntegerParameter, new BigInteger("1000"), 1000, false, 3); run_intQuery(int_filterL, BigDecimalParameter, new BigDecimal("10000.0"), 10000, true, 7); run_intQuery(int_filterR, BigDecimalParameter, new BigDecimal("43.0"), 43, false, 6); alltypes.setint(100); run_intQuery(int_filterObj, AllTypesParameter, alltypes, 100, true, 4); run_intQuery(int_filterVal, null, null, 1000, false, 3); run_longQuery(long_filterL, longParameter, new Long(Long.MIN_VALUE), Long.MIN_VALUE, true, 0); run_longQuery(long_filterR, longParameter, new Long(Long.MAX_VALUE), Long.MAX_VALUE, false, 0); run_longQuery(long_filterL, LongParameter, new Long(100), 100, true, 5); run_longQuery(long_filterR, LongParameter, new Long(23), 23, false, 5); run_longQuery(long_filterL, byteParameter, new Byte((byte)100), 100, true, 5); run_longQuery(long_filterR, byteParameter, new Byte((byte)0), 0, false, 5); run_longQuery(long_filterL, ByteParameter, new Byte((byte)100), 100, true, 5); run_longQuery(long_filterR, ByteParameter, new Byte((byte)0), 0, false, 5); run_longQuery(long_filterL, shortParameter, new Short((short)-1000), -1000, true, 2); run_longQuery(long_filterR, shortParameter, new Short((short)1000), 1000, false, 2); run_longQuery(long_filterL, ShortParameter, new Short((short)100), 100, true, 5); run_longQuery(long_filterR, ShortParameter, new Short((short)32), 32, false, 5); run_longQuery(long_filterL, charParameter, new Character((char)0), 0, true, 4); run_longQuery(long_filterR, charParameter, new Character((char)100), 100, false, 3); run_longQuery(long_filterL, CharacterParameter, new Character((char)23), 23, true, 5); run_longQuery(long_filterR, CharacterParameter, new Character((char)0), 0, false, 5); run_longQuery(long_filterL, intParameter, new Integer(100), 100, true, 5); run_longQuery(long_filterR, intParameter, new Integer(0), 0, false, 5); run_longQuery(long_filterL, IntegerParameter, new Integer(23), 23, true, 5); run_longQuery(long_filterR, IntegerParameter, new Integer(1000000), 1000000, false, 1); run_longQuery(long_filterL, floatParameter, new Float(-1000000.0), -1000000, true, 1); run_longQuery(long_filterR, floatParameter, new Float((float)Long.MAX_VALUE), Long.MAX_VALUE, false, 0); run_longQuery(long_filterL, FloatParameter, new Float(100.0), 100, true, 5); run_longQuery(long_filterR, FloatParameter, new Float(32.0), 32, false, 5); run_longQuery(long_filterL, doubleParameter, new Double(-1000000.0), -1000000, true, 1); run_longQuery(long_filterR, doubleParameter, new Double((double)Long.MAX_VALUE), Long.MAX_VALUE, false, 0); run_longQuery(long_filterL, DoubleParameter, new Double(100.0), 100, true, 5); run_longQuery(long_filterR, DoubleParameter, new Double(32.0), 32, false, 5); run_longQuery(long_filterL, BigIntegerParameter, new BigInteger("23"), 23, true, 5); run_longQuery(long_filterR, BigIntegerParameter, new BigInteger("1000000"), 1000000, false, 1); run_longQuery(long_filterL, BigDecimalParameter, new BigDecimal("100.0"), 100, true, 5); run_longQuery(long_filterR, BigDecimalParameter, new BigDecimal("32.0"), 32, false, 5); alltypes.setlong(100); run_longQuery(long_filterObj, AllTypesParameter, alltypes, 100, false, 3); run_longQuery(long_filterVal, null, null, 1000000, false, 1); run_floatQuery(float_filterL, floatParameter, new Float(AllTypes.FLOAT_SMALLEST), AllTypes.FLOAT_SMALLEST, true, 0); run_floatQuery(float_filterR, floatParameter, new Float(AllTypes.FLOAT_LARGEST), AllTypes.FLOAT_LARGEST, false, 0); run_floatQuery(float_filterL, FloatParameter, new Float(4.0f), 4.0f, true, 4); run_floatQuery(float_filterR, FloatParameter, new Float(400.0f), 400.0f, false, 3); run_floatQuery(float_filterL, byteParameter, new Byte((byte)4), 4.0f, true, 4); run_floatQuery(float_filterR, byteParameter, new Byte((byte)23), 23.0f, false, 6); run_floatQuery(float_filterL, ByteParameter, new Byte((byte)34), 34.0f, true, 4); run_floatQuery(float_filterR, ByteParameter, new Byte((byte)100), 100.0f, false, 4); run_floatQuery(float_filterL, shortParameter, new Short((short)10), 10.0f, true, 4); run_floatQuery(float_filterR, shortParameter, new Short((short)23), 23.0f, false, 6); run_floatQuery(float_filterL, ShortParameter, new Short((short)34), 34.0f, true, 4); run_floatQuery(float_filterR, ShortParameter, new Short((short)100), 100.0f, false, 4); run_floatQuery(float_filterL, charParameter, new Character((char)20), 20.0f, true, 4); run_floatQuery(float_filterR, charParameter, new Character((char)23), 23.0f, false, 6); run_floatQuery(float_filterL, CharacterParameter, new Character((char)34), 34.0f, true, 4); run_floatQuery(float_filterR, CharacterParameter, new Character((char)100), 100.0f, false, 4); run_floatQuery(float_filterL, intParameter, new Integer(55000000), 55000000.0f, true, 8); run_floatQuery(float_filterR, intParameter, new Integer(23), 23.0f, false, 6); run_floatQuery(float_filterL, IntegerParameter, new Integer(34), 34.0f, true, 4); run_floatQuery(float_filterR, IntegerParameter, new Integer(100), 100.0f, false, 4); run_floatQuery(float_filterL, longParameter, new Long(55000000), 55000000.0f, true, 8); run_floatQuery(float_filterR, longParameter, new Long(23), 23.0f, false, 6); run_floatQuery(float_filterL, LongParameter, new Long(34), 34.0f, true, 4); run_floatQuery(float_filterR, LongParameter, new Long(100), 100.0f, false, 4); run_floatQuery(float_filterL, doubleParameter, new Double(55000000.0), 55000000.0f, true, 8); run_floatQuery(float_filterR, doubleParameter, new Double(-20.5), -20.5f, false, 7); run_floatQuery(float_filterL, DoubleParameter, new Double(2.0), 2.0f, true, 4); run_floatQuery(float_filterR, DoubleParameter, new Double(100.0), 100.0f, false, 4); run_floatQuery(float_filterL, BigIntegerParameter, new BigInteger("55000000"), 55000000.0f, true, 8); run_floatQuery(float_filterR, BigIntegerParameter, new BigInteger("23"), 23.0f, false, 6); run_floatQuery(float_filterL, BigDecimalParameter, new BigDecimal("55000000.0"), 55000000.0f, true, 8); run_floatQuery(float_filterR, BigDecimalParameter, new BigDecimal("-20.5"), -20.5f, false, 7); alltypes.setfloat(23.23f); run_floatQuery(float_filterObj, AllTypesParameter, alltypes, 23.23f, false, 6); run_floatQuery(float_filterVal, null, null, 100.0f, false, 4); run_doubleQuery(double_filterL, doubleParameter, new Double(AllTypes.DOUBLE_SMALLEST), AllTypes.DOUBLE_SMALLEST, true, 0); run_doubleQuery(double_filterR, doubleParameter, new Double(AllTypes.DOUBLE_LARGEST), AllTypes.DOUBLE_LARGEST, false, 0); run_doubleQuery(double_filterL, DoubleParameter, new Double(0.0), 0.0, true, 3); run_doubleQuery(double_filterR, DoubleParameter, new Double(23.34), 23.34, false, 6); run_doubleQuery(double_filterL, byteParameter, new Byte((byte)100), 100.0, true, 4); run_doubleQuery(double_filterR, byteParameter, new Byte((byte)0), 0.0, false, 6); run_doubleQuery(double_filterL, ByteParameter, new Byte((byte)23), 23.0, true, 4); run_doubleQuery(double_filterR, ByteParameter, new Byte((byte)100), 100.0, false, 4); run_doubleQuery(double_filterL, charParameter, new Character((char)100), 100.0, true, 4); run_doubleQuery(double_filterR, charParameter, new Character((char)0), 0.0, false, 6); run_doubleQuery(double_filterL, CharacterParameter, new Character((char)23), 23.0, true, 4); run_doubleQuery(double_filterR, CharacterParameter, new Character((char)100), 100.0, false, 4); run_doubleQuery(double_filterL, shortParameter, new Short((short)100), 100.0, true, 4); run_doubleQuery(double_filterR, shortParameter, new Short((short)0), 0.0, false, 6); run_doubleQuery(double_filterL, ShortParameter, new Short((short)23), 23.0, true, 4); run_doubleQuery(double_filterR, ShortParameter, new Short((short)100), 100.0, false, 4); run_doubleQuery(double_filterL, intParameter, new Integer(100), 100.0, true, 4); run_doubleQuery(double_filterR, intParameter, new Integer(0), 0.0, false, 6); run_doubleQuery(double_filterL, IntegerParameter, new Integer(5000), 5000.0, true, 7); run_doubleQuery(double_filterR, IntegerParameter, new Integer(-20), -20.0, false, 7); run_doubleQuery(double_filterL, longParameter, new Long(100), 100.0, true, 4); run_doubleQuery(double_filterR, longParameter, new Long(0), 0.0, false, 6); run_doubleQuery(double_filterL, LongParameter, new Long(5000), 5000.0, true, 7); run_doubleQuery(double_filterR, LongParameter, new Long(-20), -20.0, false, 7); run_doubleQuery(double_filterL, floatParameter, new Float(0.0f), 0.0f, true, 3); run_doubleQuery(double_filterR, floatParameter, new Float(100.0f), 100.0f, false, 4); run_doubleQuery(double_filterL, FloatParameter, new Float(100.0f), 100.0, true, 4); run_doubleQuery(double_filterR, FloatParameter, new Float(69.96f), 69.96, false, 6); run_doubleQuery(double_filterL, BigIntegerParameter, new BigInteger("5000"), 5000.0, true, 7); run_doubleQuery(double_filterR, BigIntegerParameter, new BigInteger("-20"), -20.0, false, 7); run_doubleQuery(double_filterL, BigDecimalParameter, new BigDecimal("100.0"), 100.0, true, 4); run_doubleQuery(double_filterR, BigDecimalParameter, new BigDecimal("69.96"), 69.96, false, 6); alltypes.setdouble(-25.5); run_doubleQuery(double_filterObj, AllTypesParameter, alltypes, -25.5, true, 2); run_doubleQuery(double_filterVal, null, null, 100.0, false, 4); run_ByteQuery(Byte_filterL, byteParameter, new Byte((byte)50), new Byte((byte)50), true, 5); run_ByteQuery(Byte_filterR, byteParameter, new Byte(Byte.MIN_VALUE), new Byte(Byte.MIN_VALUE), false, 9); run_ByteQuery(Byte_filterL, ByteParameter, new Byte((byte)20), new Byte((byte)20), true, 5); run_ByteQuery(Byte_filterR, ByteParameter, new Byte(Byte.MAX_VALUE), new Byte(Byte.MAX_VALUE), false, 0); run_ByteQuery(Byte_filterL, shortParameter, new Short((short)60), new Byte((byte)60), true, 7); run_ByteQuery(Byte_filterR, shortParameter, new Short((short)51), new Byte((byte)51), false, 3); run_ByteQuery(Byte_filterL, ShortParameter, new Short((short)-100), new Byte((byte)-100), true, 1); run_ByteQuery(Byte_filterR, ShortParameter, new Short((short)-100), new Byte((byte)-100), false, 8); run_ByteQuery(Byte_filterL, charParameter, new Character((char)101), new Byte((byte)101), true, 9); run_ByteQuery(Byte_filterR, charParameter, new Character((char)10), new Byte((byte)10), false, 5); run_ByteQuery(Byte_filterL, CharacterParameter, new Character((char)50), new Byte((byte)50), true, 5); run_ByteQuery(Byte_filterR, CharacterParameter, new Character((char)75), new Byte((byte)75), false, 2); run_ByteQuery(Byte_filterL, intParameter, new Integer(77), new Byte((byte)77), true, 8); run_ByteQuery(Byte_filterR, intParameter, new Integer(60), new Byte((byte)60), false, 3); run_ByteQuery(Byte_filterL, IntegerParameter, new Integer(40), new Byte((byte)40), true, 5); run_ByteQuery(Byte_filterR, IntegerParameter, new Integer(75), new Byte((byte)75), false, 2); run_ByteQuery(Byte_filterL, longParameter, new Long(50), new Byte((byte)50), true, 5); run_ByteQuery(Byte_filterR, longParameter, new Long(50), new Byte((byte)50), false, 3); run_ByteQuery(Byte_filterL, LongParameter, new Long(-100), new Byte((byte)-100), true, 1); run_ByteQuery(Byte_filterR, LongParameter, new Long(-100), new Byte((byte)-100), false, 8); run_ByteQuery(Byte_filterL, floatParameter, new Float(50), new Byte((byte)50), true, 5); run_ByteQuery(Byte_filterR, floatParameter, new Float(50), new Byte((byte)50), false, 3); run_ByteQuery(Byte_filterL, FloatParameter, new Float(-100), new Byte((byte)-100), true, 1); run_ByteQuery(Byte_filterR, FloatParameter, new Float(-100), new Byte((byte)-100), false, 8); run_ByteQuery(Byte_filterL, doubleParameter, new Double(50), new Byte((byte)50), true, 5); run_ByteQuery(Byte_filterR, doubleParameter, new Double(50), new Byte((byte)50), false, 3); run_ByteQuery(Byte_filterL, DoubleParameter, new Double(-100), new Byte((byte)-100), true, 1); run_ByteQuery(Byte_filterR, DoubleParameter, new Double(-100), new Byte((byte)-100), false, 8); run_ByteQuery(Byte_filterL, BigIntegerParameter, new BigInteger("50"), new Byte((byte)50), true, 5); run_ByteQuery(Byte_filterR, BigIntegerParameter, new BigInteger("-100"), new Byte((byte)-100), false, 8); run_ByteQuery(Byte_filterL, BigDecimalParameter, new BigDecimal("50.000000"), new Byte((byte)50), true, 5); run_ByteQuery(Byte_filterR, BigDecimalParameter, new BigDecimal("10.00000"), new Byte((byte)10), false, 5); Byte val = new Byte((byte)50); alltypes.setByte(val); run_ByteQuery(Byte_filterObj, AllTypesParameter, alltypes, val, false, 3); val = new Byte((byte)51); alltypes.setByte(val); run_ByteQuery(Byte_filterObj, AllTypesParameter, alltypes, val, false, 3); run_ByteQuery(Byte_filterVal, null, null, new Byte((byte)100), true, 8); run_ShortQuery(Short_filterL, shortParameter, new Short((short)100), new Short((short)100), true, 5); run_ShortQuery(Short_filterR, shortParameter, new Short((short)100), new Short((short)100), false, 3); run_ShortQuery(Short_filterL, ShortParameter, new Short(Short.MIN_VALUE), new Short(Short.MIN_VALUE), true, 0); run_ShortQuery(Short_filterR, ShortParameter, new Short((short)253), new Short((short)253), false, 3); run_ShortQuery(Short_filterR, shortParameter, new Short((short)1000), new Short((short)1000), false, 2); run_ShortQuery(Short_filterL, byteParameter, new Byte((byte)75), new Short((short)75), true, 5); run_ShortQuery(Short_filterR, byteParameter, new Byte((byte)75), new Short((short)75), false, 5); run_ShortQuery(Short_filterL, ByteParameter, new Byte((byte)100), new Short((short)100), true, 5); run_ShortQuery(Short_filterR, ByteParameter, new Byte((byte)100), new Short((short)100), false, 3); run_ShortQuery(Short_filterL, charParameter, new Character((char)75), new Short((short)75), true, 5); run_ShortQuery(Short_filterR, charParameter, new Character((char)75), new Short((short)75), false, 5); run_ShortQuery(Short_filterL, CharacterParameter, new Character((char)100), new Short((short)100), true, 5); run_ShortQuery(Short_filterR, CharacterParameter, new Character((char)200), new Short((short)200), false, 3); run_ShortQuery(Short_filterL, intParameter, new Integer(-10000), new Short((short)-10000), true, 1); run_ShortQuery(Short_filterR, intParameter, new Integer(-10000), new Short((short)-10000), false, 8); run_ShortQuery(Short_filterL, IntegerParameter, new Integer(10000), new Short((short)10000), true, 8); run_ShortQuery(Short_filterR, IntegerParameter, new Integer(10000), new Short((short)10000), false, 1); run_ShortQuery(Short_filterL, longParameter, new Long(20000), new Short((short) 20000), true, 9); run_ShortQuery(Short_filterR, longParameter, new Long(5000), new Short((short) 5000), false, 2); run_ShortQuery(Short_filterL, LongParameter, new Long(200), new Short((short)200), true, 7); run_ShortQuery(Short_filterR, LongParameter, new Long(500), new Short((short)500), false, 3); run_ShortQuery(Short_filterL, floatParameter, new Float(23000.0f), new Short((short)23000), true, 9); run_ShortQuery(Short_filterR, floatParameter, new Float(23000.0f), new Short((short)23000), false, 1); run_ShortQuery(Short_filterL, FloatParameter, new Float(10.0f), new Short((short)10), true, 5); run_ShortQuery(Short_filterR, FloatParameter, new Float(101.0f), new Short((short)101), false, 3); run_ShortQuery(Short_filterL, doubleParameter, new Double(-10000.0), new Short((short)-10000), true, 1); run_ShortQuery(Short_filterR, doubleParameter, new Double(-10000.0), new Short((short)-10000), false, 8); run_ShortQuery(Short_filterL, DoubleParameter, new Double(101.0), new Short((short)101), true, 7); run_ShortQuery(Short_filterR, DoubleParameter, new Double(23.0), new Short((short)23), false, 5); run_ShortQuery(Short_filterL, BigIntegerParameter, new BigInteger("10000"), new Short((short)10000), true, 8); run_ShortQuery(Short_filterR, BigIntegerParameter, new BigInteger("30000"), new Short((short)30000), false, 1); run_ShortQuery(Short_filterL, BigDecimalParameter, new BigDecimal("23.0"), new Short((short)23), true, 5); run_ShortQuery(Short_filterR, BigDecimalParameter, new BigDecimal("23.0"), new Short((short)23), false, 5); Short sval = new Short((short)100); alltypes.setShort(sval); run_ShortQuery(Short_filterObj, AllTypesParameter, alltypes, sval, false, 3); sval = new Short((short)23); alltypes.setShort(sval); run_ShortQuery(Short_filterObj, AllTypesParameter, alltypes, sval, false, 5); run_ShortQuery(Short_filterVal, null, null, new Short((short)-1000), true, 2); run_CharacterQuery(Character_filterL, charParameter, new Character(Character.MIN_VALUE), new Character(Character.MIN_VALUE), true, 0); run_CharacterQuery(Character_filterR, charParameter, new Character(Character.MAX_VALUE), new Character(Character.MAX_VALUE), false, 0); run_CharacterQuery(Character_filterL, charParameter, new Character('C'), new Character('C'), true, 4); run_CharacterQuery(Character_filterR, charParameter, new Character('z'), new Character('z'), false, 1); run_CharacterQuery(Character_filterL, CharacterParameter, new Character(' '), new Character(' '), true, 1); run_CharacterQuery(Character_filterR, CharacterParameter, new Character('f'), new Character('f'), false, 3); run_CharacterQuery(Character_filterL, byteParameter, new Byte((byte)Character.MIN_VALUE), new Character((char)Character.MIN_VALUE), true, 0); run_CharacterQuery(Character_filterR, ByteParameter, new Byte((byte)'a'), new Character('a'), false, 3); run_CharacterQuery(Character_filterL, shortParameter, new Short((short)'M'), new Character('M'), true, 5); run_CharacterQuery(Character_filterR, shortParameter, new Short((short)'F'), new Character('F'), false, 5); run_CharacterQuery(Character_filterL, ShortParameter, new Short((short)'A'), new Character('A'), true, 2); run_CharacterQuery(Character_filterR, ShortParameter, new Short((short)'A'), new Character('A'), false, 7); run_CharacterQuery(Character_filterL, intParameter, new Integer('z'), new Character('z'), true, 7); run_CharacterQuery(Character_filterR, intParameter, new Integer('z'), new Character('z'), false, 1); run_CharacterQuery(Character_filterL, IntegerParameter, new Integer('B'), new Character('B'), true, 3); run_CharacterQuery(Character_filterR, IntegerParameter, new Integer('B'), new Character('B'), false, 6); run_CharacterQuery(Character_filterL, longParameter, new Long('z'), new Character('z'), true, 7); run_CharacterQuery(Character_filterR, longParameter, new Long('z'), new Character('z'), false, 1); run_CharacterQuery(Character_filterL, LongParameter, new Long('B'), new Character('B'), true, 3); run_CharacterQuery(Character_filterR, LongParameter, new Long('B'), new Character('B'), false, 6); run_CharacterQuery(Character_filterL, floatParameter, new Float('z'), new Character('z'), true, 7); run_CharacterQuery(Character_filterR, floatParameter, new Float('z'), new Character('z'), false, 1); run_CharacterQuery(Character_filterL, FloatParameter, new Float('M'), new Character('M'), true, 5); run_CharacterQuery(Character_filterR, FloatParameter, new Float('X'), new Character('X'), false, 3); run_CharacterQuery(Character_filterL, doubleParameter, new Double('B'), new Character('B'), true, 3); run_CharacterQuery(Character_filterR, doubleParameter, new Double('B'), new Character('B'), false, 6); run_CharacterQuery(Character_filterL, DoubleParameter, new Double('A'), new Character('A'), true, 2); run_CharacterQuery(Character_filterR, DoubleParameter, new Double('A'), new Character('A'), false, 7); run_CharacterQuery(Character_filterL, BigIntegerParameter, new BigInteger("65"), new Character('A'), true, 2); // 'A' == 65 run_CharacterQuery(Character_filterR, BigIntegerParameter, new BigInteger("122"), new Character('z'), false, 1); // 'z' == 122 run_CharacterQuery(Character_filterL, BigDecimalParameter, new BigDecimal("65.00000"), new Character('A'), true, 2); run_CharacterQuery(Character_filterR, BigDecimalParameter, new BigDecimal("77.0000"), new Character('M'), false, 3); // 'M' == 77 alltypes.setCharacter(new Character('A')); run_CharacterQuery(Character_filterObj, AllTypesParameter, alltypes, new Character('A'), true, 2); alltypes.setCharacter(new Character('b')); run_CharacterQuery(Character_filterObj, AllTypesParameter, alltypes, new Character('b'), true, 7); run_CharacterQuery(Character_filterVal, null, null, new Character('z'), false, 1); run_IntegerQuery(Integer_filterL, intParameter, new Integer(AllTypes.veryLargeNegativeInt), new Integer(AllTypes.veryLargeNegativeInt), true, 0); run_IntegerQuery(Integer_filterR, intParameter, new Integer(AllTypes.veryLargePositiveInt), new Integer(AllTypes.veryLargePositiveInt), false, 0); run_IntegerQuery(Integer_filterR, intParameter, new Integer(23), new Integer(23), false, 6); run_IntegerQuery(Integer_filterL, IntegerParameter, new Integer(1000000), new Integer(1000000), true, 8); run_IntegerQuery(Integer_filterR, IntegerParameter, new Integer(1000), new Integer(1000), false, 3); run_IntegerQuery(Integer_filterL, byteParameter, new Byte((byte)100), new Integer(100), true, 4); run_IntegerQuery(Integer_filterR, byteParameter, new Byte((byte)0), new Integer(0), false, 6); run_IntegerQuery(Integer_filterL, ByteParameter, new Byte((byte)100), new Integer(100), true, 4); run_IntegerQuery(Integer_filterR, ByteParameter, new Byte((byte)0), new Integer(0), false, 6); run_IntegerQuery(Integer_filterL, shortParameter, new Short((short)10000), new Integer(10000), true, 7); run_IntegerQuery(Integer_filterR, shortParameter, new Short((short)-1000), new Integer(-1000), false, 7); run_IntegerQuery(Integer_filterL, ShortParameter, new Short((short)-1000), new Integer(-1000), true, 2); run_IntegerQuery(Integer_filterR, ShortParameter, new Short((short)-999), new Integer(-999), false, 7); run_IntegerQuery(Integer_filterL, charParameter, new Character((char)10000), new Integer(10000), true, 7); run_IntegerQuery(Integer_filterR, charParameter, new Character((char)10000), new Integer(10000), false, 2); run_IntegerQuery(Integer_filterL, CharacterParameter, new Character((char)100), new Integer(100), true, 4); run_IntegerQuery(Integer_filterR, CharacterParameter, new Character((char)10000), new Integer(10000), false, 2); run_IntegerQuery(Integer_filterL, longParameter, new Long(AllTypes.veryLargePositiveInt), new Integer(AllTypes.veryLargePositiveInt), true, 9); run_IntegerQuery(Integer_filterR, longParameter, new Long(AllTypes.veryLargeNegativeInt), new Integer(AllTypes.veryLargeNegativeInt), false, 9); run_IntegerQuery(Integer_filterL, LongParameter, new Long(10000), new Integer(10000), true, 7); run_IntegerQuery(Integer_filterR, LongParameter, new Long(43), new Integer(43), false, 6); run_IntegerQuery(Integer_filterL, floatParameter, new Float(AllTypes.veryLargePositiveInt), new Integer(AllTypes.veryLargePositiveInt), true, 9); run_IntegerQuery(Integer_filterR, floatParameter, new Float(AllTypes.veryLargeNegativeInt), new Integer(AllTypes.veryLargeNegativeInt), false, 9); run_IntegerQuery(Integer_filterL, FloatParameter, new Float(10000), new Integer(10000), true, 7); run_IntegerQuery(Integer_filterR, FloatParameter, new Float(43), new Integer(43), false, 6); run_IntegerQuery(Integer_filterL, doubleParameter, new Double(AllTypes.veryLargePositiveInt), new Integer(AllTypes.veryLargePositiveInt), true, 9); run_IntegerQuery(Integer_filterR, doubleParameter, new Double(AllTypes.veryLargeNegativeInt), new Integer(AllTypes.veryLargeNegativeInt), false, 9); run_IntegerQuery(Integer_filterL, DoubleParameter, new Double(10000), new Integer(10000), true, 7); run_IntegerQuery(Integer_filterR, DoubleParameter, new Double(1000001.0), new Integer(1000001), false, 1); run_IntegerQuery(Integer_filterL, BigIntegerParameter, new BigInteger("1000000"), new Integer(1000000), true, 8); run_IntegerQuery(Integer_filterR, BigIntegerParameter, new BigInteger("1000"), new Integer(1000), false, 3); run_IntegerQuery(Integer_filterL, BigDecimalParameter, new BigDecimal("10000.0"), new Integer(10000), true, 7); run_IntegerQuery(Integer_filterR, BigDecimalParameter, new BigDecimal("43.0"), new Integer(43), false, 6); alltypes.setInteger(new Integer(100)); run_IntegerQuery(Integer_filterObj, AllTypesParameter, alltypes, new Integer(100), false, 4); run_IntegerQuery(Integer_filterVal, null, null, new Integer(100), false, 4); run_LongQuery(Long_filterL, longParameter, new Long(Long.MIN_VALUE), new Long(Long.MIN_VALUE), true, 0); run_LongQuery(Long_filterR, longParameter, new Long(Long.MAX_VALUE), new Long(Long.MAX_VALUE), false, 0); run_LongQuery(Long_filterL, LongParameter, new Long(100), new Long(100), true, 5); run_LongQuery(Long_filterR, LongParameter, new Long(23), new Long(23), false, 5); run_LongQuery(Long_filterL, byteParameter, new Byte((byte)100), new Long(100), true, 5); run_LongQuery(Long_filterR, byteParameter, new Byte((byte)0), new Long(0), false, 5); run_LongQuery(Long_filterL, ByteParameter, new Byte((byte)100), new Long(100), true, 5); run_LongQuery(Long_filterR, ByteParameter, new Byte((byte)0), new Long(0), false, 5); run_LongQuery(Long_filterL, shortParameter, new Short((short)-1000 ), new Long(-1000), true, 2); run_LongQuery(Long_filterR, shortParameter, new Short((short)1000), new Long(1000), false, 2); run_LongQuery(Long_filterL, ShortParameter, new Short((short)101), new Long(101), true, 7); run_LongQuery(Long_filterR, ShortParameter, new Short((short)32), new Long(32), false, 5); run_LongQuery(Long_filterL, charParameter, new Character((char)0), new Long(0), true, 4); run_LongQuery(Long_filterR, charParameter, new Character((char)100), new Long(100), false, 3); run_LongQuery(Long_filterL, CharacterParameter, new Character((char)23), new Long(23), true, 5); run_LongQuery(Long_filterR, CharacterParameter, new Character((char)1110), new Long(1110), false, 2); run_LongQuery(Long_filterL, intParameter, new Integer(100), new Long(100), true, 5); run_LongQuery(Long_filterR, intParameter, new Integer(0), new Long(0), false, 5); run_LongQuery(Long_filterL, IntegerParameter, new Integer(23), new Long(23), true, 5); run_LongQuery(Long_filterR, IntegerParameter, new Integer(1000000), new Long(1000000), false, 1); run_LongQuery(Long_filterL, floatParameter, new Float(-1000000.0), new Long(-1000000), true, 1); run_LongQuery(Long_filterR, floatParameter, new Float((float)Long.MAX_VALUE), new Long(Long.MAX_VALUE), false, 0); run_LongQuery(Long_filterL, FloatParameter, new Float(100.0f), new Long(100), true, 5); run_LongQuery(Long_filterR, FloatParameter, new Float(32.0f), new Long(32), false, 5); run_LongQuery(Long_filterL, doubleParameter, new Double(-1000000.0), new Long(-1000000), true, 1); run_LongQuery(Long_filterR, doubleParameter, new Double((double)Long.MAX_VALUE), new Long(Long.MAX_VALUE), false, 0); run_LongQuery(Long_filterL, DoubleParameter, new Double(100.0), new Long(100), true, 5); run_LongQuery(Long_filterR, DoubleParameter, new Double(32.0), new Long(32), false, 5); run_LongQuery(Long_filterL, BigIntegerParameter, new BigInteger("23"), new Long(23), true, 5); run_LongQuery(Long_filterR, BigIntegerParameter, new BigInteger("1000000"), new Long(1000000), false, 1); run_LongQuery(Long_filterL, BigDecimalParameter, new BigDecimal("100.0"), new Long(100), true, 5); run_LongQuery(Long_filterR, BigDecimalParameter, new BigDecimal("32.0"), new Long(32), false, 5); alltypes.setLong(new Long(100)); run_LongQuery(Long_filterObj, AllTypesParameter, alltypes, new Long(100), true, 5); run_LongQuery(Long_filterVal, null, null, new Long(-1000), true, 2); run_FloatQuery(Float_filterL, floatParameter, new Float(-1000000000.0f), new Float(-1000000000.0f), true, 1); run_FloatQuery(Float_filterR, floatParameter, new Float(9000000000.0f), new Float(9000000000.0f), false, 1); run_FloatQuery(Float_filterL, FloatParameter, new Float(0.0), new Float(0.0f), true, 2); run_FloatQuery(Float_filterR, FloatParameter, new Float(4.0), new Float(4.0f), false, 7); run_FloatQuery(Float_filterL, byteParameter, new Byte((byte)0), new Float(0.0f), true, 2); run_FloatQuery(Float_filterR, byteParameter, new Byte((byte)23), new Float(23.0f), false, 7); run_FloatQuery(Float_filterL, ByteParameter, new Byte((byte)34), new Float(34.0f), true, 3); run_FloatQuery(Float_filterR, ByteParameter, new Byte((byte)100), new Float(100.0f), false, 5); run_FloatQuery(Float_filterL, shortParameter, new Short((short)0), new Float(0.0f), true, 2); run_FloatQuery(Float_filterR, shortParameter, new Short((short)23), new Float(23.0f), false, 7); run_FloatQuery(Float_filterL, ShortParameter, new Short((short)34), new Float(34.0f), true, 3); run_FloatQuery(Float_filterR, ShortParameter, new Short((short)100), new Float(100.0f), false, 5); run_FloatQuery(Float_filterL, charParameter, new Character((char)0), new Float(0.0f), true, 2); run_FloatQuery(Float_filterR, charParameter, new Character((char)23), new Float(23.0f), false, 7); run_FloatQuery(Float_filterL, CharacterParameter, new Character((char)34), new Float(34.0f), true, 3); run_FloatQuery(Float_filterR, CharacterParameter, new Character((char)100), new Float(100.0f), false, 5); run_FloatQuery(Float_filterL, intParameter, new Integer(50000000), new Float(50000000.0f), true, 7); run_FloatQuery(Float_filterR, intParameter, new Integer(23), new Float(23.0f), false, 7); run_FloatQuery(Float_filterL, IntegerParameter, new Integer(34), new Float(34.0f), true, 3); run_FloatQuery(Float_filterR, IntegerParameter, new Integer(100), new Float(100.0f), false, 5); run_FloatQuery(Float_filterL, longParameter, new Long(50000000), new Float(50000000.0f), true, 7); run_FloatQuery(Float_filterR, longParameter, new Long(23), new Float(23.0f), false, 7); run_FloatQuery(Float_filterL, LongParameter, new Long(34), new Float(34.0f), true, 3); run_FloatQuery(Float_filterR, LongParameter, new Long(100), new Float(100.0f), false, 5); run_FloatQuery(Float_filterL, doubleParameter, new Double(50000000.0f), new Float(50000000.0f), true, 7); run_FloatQuery(Float_filterR, doubleParameter, new Double(100.0f), new Float(100.0f), false, 5); run_FloatQuery(Float_filterL, DoubleParameter, new Double(0.0f), new Float(0.0f), true, 2); run_FloatQuery(Float_filterR, DoubleParameter, new Double(100.0f), new Float(100.0f), false, 5); run_FloatQuery(Float_filterL, BigIntegerParameter, new BigInteger("55000000"), new Float(55000000.0f), true, 8); run_FloatQuery(Float_filterR, BigIntegerParameter, new BigInteger("23"), new Float(23.0f), false, 7); run_FloatQuery(Float_filterL, BigDecimalParameter, new BigDecimal("55000000.0"), new Float(55000000.0f), true, 8); run_FloatQuery(Float_filterR, BigDecimalParameter, new BigDecimal("-20.5"), new Float(-20.5f), false, 8); alltypes.setFloat(new Float(23.23f)); run_FloatQuery(Float_filterObj, AllTypesParameter, alltypes, new Float(23.23f), false, 7); run_FloatQuery(Float_filterVal, null, null, new Float(100.0f), true, 3); run_DoubleQuery(Double_filterL, doubleParameter, new Double(-999999999999.0), new Double(-999999999999.0), true, 1); run_DoubleQuery(Double_filterR, doubleParameter, new Double(9999999999999.0), new Double(9999999999999.0), false, 1); run_DoubleQuery(Double_filterL, DoubleParameter, new Double(0.0), new Double(0.0), true, 3); run_DoubleQuery(Double_filterR, DoubleParameter, new Double(23.34), new Double(23.34), false, 6); run_DoubleQuery(Double_filterL, byteParameter, new Byte((byte)100), new Double(100.0), true, 4); run_DoubleQuery(Double_filterR, byteParameter, new Byte((byte)0), new Double(0.0), false, 6); run_DoubleQuery(Double_filterL, ByteParameter, new Byte((byte)-23), new Double(-23.0), true, 3); run_DoubleQuery(Double_filterR, ByteParameter, new Byte((byte)100), new Double(100.0), false, 4); run_DoubleQuery(Double_filterL, shortParameter, new Short((short)100), new Double(100.0), true, 4); run_DoubleQuery(Double_filterR, shortParameter, new Short((short)0), new Double(0.0), false, 6); run_DoubleQuery(Double_filterL, ShortParameter, new Short((short)23), new Double(23.0), true, 4); run_DoubleQuery(Double_filterR, ShortParameter, new Short((short)400), new Double(400.0), false, 3); run_DoubleQuery(Double_filterL, charParameter, new Character((char)100), new Double(100.0), true, 4); run_DoubleQuery(Double_filterR, charParameter, new Character((char)0), new Double(0.0), false, 6); run_DoubleQuery(Double_filterL, CharacterParameter, new Character((char)23), new Double(23.0), true, 4); run_DoubleQuery(Double_filterR, CharacterParameter, new Character((char)400), new Double(400.0), false, 3); run_DoubleQuery(Double_filterL, intParameter, new Integer(100), new Double(100.0), true, 4); run_DoubleQuery(Double_filterR, intParameter, new Integer(0), new Double(0.0), false, 6); run_DoubleQuery(Double_filterL, IntegerParameter, new Integer(23), new Double(23.0), true, 4); run_DoubleQuery(Double_filterR, IntegerParameter, new Integer(100), new Double(100.0), false, 4); run_DoubleQuery(Double_filterL, longParameter, new Long(100), new Double(100.0), true, 4); run_DoubleQuery(Double_filterR, longParameter, new Long(0), new Double(0.0), false, 6); run_DoubleQuery(Double_filterL, LongParameter, new Long(23), new Double(23.0), true, 4); run_DoubleQuery(Double_filterR, LongParameter, new Long(100), new Double(100.0), false, 4); run_DoubleQuery(Double_filterL, floatParameter, new Float(0.0f), new Double(0.0f), true, 3); run_DoubleQuery(Double_filterR, floatParameter, new Float(100.0f), new Double(100.0f), false, 4); run_DoubleQuery(Double_filterL, FloatParameter, new Float(100.0f), new Double(100.0f), true, 4); run_DoubleQuery(Double_filterR, FloatParameter, new Float(69.96f), new Double(69.96), false, 6); run_DoubleQuery(Double_filterL, BigIntegerParameter, new BigInteger("5000"), new Double(5000.0), true, 7); run_DoubleQuery(Double_filterR, BigIntegerParameter, new BigInteger("-20"), new Double(-20.0), false, 7); run_DoubleQuery(Double_filterL, BigDecimalParameter, new BigDecimal("100.0"), new Double(100.0), true, 4); run_DoubleQuery(Double_filterR, BigDecimalParameter, new BigDecimal("69.96"), new Double(69.96), false, 6); alltypes.setDouble(new Double(-999999999999.0)); run_DoubleQuery(Double_filterObj, AllTypesParameter, alltypes, new Double(-999999999999.0), true, 1); run_DoubleQuery(Double_filterVal, null, null, new Double(100.0), false, 4); run_StringQuery(String_filterL, StringParameter, new String("JDO"), new String("JDO"), true, 1); run_StringQuery(String_filterR, StringParameter, new String("JDBC"), new String("JDBC"), false, 9); alltypes.setString(new String("abcde")); run_StringQuery(String_filterObj, AllTypesParameter, alltypes, new String("abcde"), true, 7); run_StringQuery(String_filterVal1, null, null, new String("Java"), false, 4); run_StringQuery(String_filterVal2, null, null, new String(""), false, 9); BigDecimal bd = new BigDecimal("100.0"); run_BigDecimalQuery(BigDecimal_filterL, BigDecimalParameter, bd, bd, true, 4); bd = new BigDecimal("-234234.23333"); run_BigDecimalQuery(BigDecimal_filterR, BigDecimalParameter, bd, bd, false, 8); bd = new BigDecimal("989899.33304953"); run_BigDecimalQuery(BigDecimal_filterL, BigDecimalParameter, bd, bd, true, 7); bd = new BigDecimal("-1123123.22"); run_BigDecimalQuery(BigDecimal_filterR, BigDecimalParameter, bd, bd, false, 9); alltypes.setBigDecimal(bd); run_BigDecimalQuery(BigDecimal_filterObj, AllTypesParameter, alltypes, bd, true, 0); BigInteger bi = new BigInteger("987034534985043985"); run_BigIntegerQuery(BigInteger_filterL, BigIntegerParameter, bi, bi, true, 9); bi = new BigInteger("-999999999999999999"); run_BigIntegerQuery(BigInteger_filterR, BigIntegerParameter, bi, bi, false, 9); bi = new BigInteger("-9999999999999999999"); run_BigIntegerQuery(BigInteger_filterR, BigIntegerParameter, bi, bi, false, 10); bi = new BigInteger("1333330"); alltypes.setBigInteger(bi); run_BigIntegerQuery(BigInteger_filterObj, AllTypesParameter, alltypes, bi, false, 2); GregorianCalendar gc = new GregorianCalendar(TimeZone.getTimeZone("GMT"), Locale.UK); gc.clear(); gc.set(1999, Calendar.DECEMBER, 31, 9, 0, 0); Date d = gc.getTime(); run_DateQuery(Date_filterL, DateParameter, d, d, true, 7); gc.set(1992, Calendar.NOVEMBER, 22, 9, 0, 0); d = gc.getTime(); run_DateQuery(Date_filterR, DateParameter, d, d, false, 4); gc.set(1959, Calendar.OCTOBER, 9, 9, 0, 0); d = gc.getTime(); run_DateQuery(Date_filterR, DateParameter, d, d, false, 7); gc.set(1995, Calendar.JUNE, 14, 9, 0, 0); d = gc.getTime(); alltypes.setDate(d); run_DateQuery(Date_filterObj, AllTypesParameter, alltypes, d, false, 3); } private void run_byteQuery(String filter, String parameter, Object parameterValue, byte value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); byte val = obj.getbyte(); boolean correct_value = valueOnLeft ? value > val : val > value; if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL Greater Than test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL Greater Than test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_shortQuery(String filter, String parameter, Object parameterValue, short value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); short val = obj.getshort(); boolean correct_value = valueOnLeft ? value > val : val > value; if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL Greater Than test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL Greater Than test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_charQuery(String filter, String parameter, Object parameterValue, char value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); char val = obj.getchar(); boolean correct_value = valueOnLeft ? value > val : val > value; if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL Greater Than test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL Greater Than test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_intQuery(String filter, String parameter, Object parameterValue, int value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); int val = obj.getint(); boolean correct_value = valueOnLeft ? value > val : val > value; if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL Greater Than test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL Greater Than test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_longQuery(String filter, String parameter, Object parameterValue, long value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); long val = obj.getlong(); boolean correct_value = valueOnLeft ? value > val : val > value; if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL Greater Than test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL Greater Than test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_floatQuery(String filter, String parameter, Object parameterValue, float value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); float val = obj.getfloat(); boolean correct_value = valueOnLeft ? value > val : val > value; if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL Greater Than test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL Greater Than test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_doubleQuery(String filter, String parameter, Object parameterValue, double value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); double val = obj.getdouble(); boolean correct_value = valueOnLeft ? value > val : val > value; if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL Greater Than test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL Greater Than test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_ByteQuery(String filter, String parameter, Object parameterValue, Byte value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); Byte val = obj.getByte(); boolean correct_value = valueOnLeft ? (value.compareTo(val) > 0) : (val.compareTo(value) > 0); if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL Greater Than test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL Greater Than test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_ShortQuery(String filter, String parameter, Object parameterValue, Short value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); Short val = obj.getShort(); boolean correct_value = valueOnLeft ? (value.compareTo(val) > 0) : (val.compareTo(value) > 0); if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL Greater Than test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL Greater Than test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_CharacterQuery(String filter, String parameter, Object parameterValue, Character value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); Character val = obj.getCharacter(); boolean correct_value = valueOnLeft ? (value.compareTo(val) > 0) : (val.compareTo(value) > 0); if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL Greater Than test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL Greater Than test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_IntegerQuery(String filter, String parameter, Object parameterValue, Integer value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); Integer val = obj.getInteger(); boolean correct_value = valueOnLeft ? (value.compareTo(val) > 0) : (val.compareTo(value) > 0); if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL Greater Than test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL Greater Than test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_LongQuery(String filter, String parameter, Object parameterValue, Long value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); Long val = obj.getLong(); boolean correct_value = valueOnLeft ? (value.compareTo(val) > 0) : (val.compareTo(value) > 0); if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL Greater Than test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL Greater Than test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_FloatQuery(String filter, String parameter, Object parameterValue, Float value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); Float val = obj.getFloat(); boolean correct_value = valueOnLeft ? (value.compareTo(val) > 0) : (val.compareTo(value) > 0); if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL Greater Than test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL Greater Than test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_DoubleQuery(String filter, String parameter, Object parameterValue, Double value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); Double val = obj.getDouble(); boolean correct_value = valueOnLeft ? (value.compareTo(val) > 0) : (val.compareTo(value) > 0); if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL Greater Than test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL Greater Than test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_StringQuery(String filter, String parameter, Object parameterValue, String value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); String val = obj.getString(); boolean correct_value = valueOnLeft ? (value.compareTo(val) > 0) : (val.compareTo(value) > 0); if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL Greater Than test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL Greater Than test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_BigDecimalQuery(String filter, String parameter, Object parameterValue, BigDecimal value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); BigDecimal val = obj.getBigDecimal(); boolean correct_value = valueOnLeft ? (value.compareTo(val) > 0) : (val.compareTo(value) > 0); if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL Greater Than test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL Greater Than test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_BigIntegerQuery(String filter, String parameter, Object parameterValue, BigInteger value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); BigInteger val = obj.getBigInteger(); boolean correct_value = valueOnLeft ? (value.compareTo(val) > 0) : (val.compareTo(value) > 0); if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL Greater Than test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL Greater Than test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_DateQuery(String filter, String parameter, Object parameterValue, Date value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); Date val = obj.getDate(); boolean correct_value = valueOnLeft ? (value.compareTo(val) > 0) : (val.compareTo(value) > 0); if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL Greater Than test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL Greater Than test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } /** */ protected void localSetUp() { addTearDownClass(AllTypes.class); AllTypes.load(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/operators/GreaterThanOrEqual.java100664 242314 12500110373 27627 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.operators; import java.math.BigDecimal; import java.math.BigInteger; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; import java.util.Iterator; import java.util.Locale; import java.util.TimeZone; import org.apache.jdo.tck.pc.fieldtypes.AllTypes; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Greater Than or Equal Query Operator *
*Keywords: query *
*Assertion ID: A14.6.2-18. *
*Assertion Description: The greater than or equal operator (>=) is supported for all types as they are defined in the Java language. This includes the following types:
  • byte, short, int, long, char, Byte, Short Integer, Long, Character
  • float, double, Float, Double
  • BigDecimal, BigInteger
  • Date, String
The operation on object-valued fields of wrapper types (Boolean, Byte, Short, Integer, Long, Float, and Double), and numeric types (BigDecimal and BigInteger) use the wrapped values as operands. */ public class GreaterThanOrEqual extends ComparisonTests { private static String boolean_filterL = "value >= fld_boolean"; private static String boolean_filterR = "fld_boolean >= value"; private static String boolean_filterT = "fld_boolean >= true"; private static String boolean_filterF = "false >= fld_boolean"; private static String boolean_filterObj = "value.fld_boolean >= fld_boolean"; private static String byte_filterL = "value >= fld_byte"; private static String byte_filterR = "fld_byte >= value"; private static String byte_filterObj = "value.fld_byte >= fld_byte"; private static String byte_filterVal = "fld_byte >= 100"; private static String char_filterL = "value >= fld_char"; private static String char_filterR = "fld_char >= value"; private static String char_filterObj = "value.fld_char >= fld_char"; private static String char_filterVal = "'M' >= fld_char"; private static String double_filterL = "value >= fld_double"; private static String double_filterR = "fld_double >= value"; private static String double_filterObj = "value.fld_double >= fld_double"; private static String double_filterVal = "fld_double >= 100.0"; private static String float_filterL = "value >= fld_float"; private static String float_filterR = "fld_float >= value"; private static String float_filterObj = "fld_float >= value.fld_float"; private static String float_filterVal = "fld_float >= 100.0"; private static String int_filterL = "value >= fld_int"; private static String int_filterR = "fld_int >= value"; private static String int_filterObj = "value.fld_int >= fld_int"; private static String int_filterVal = "fld_int >= 1000"; private static String long_filterL = "value >= fld_long"; private static String long_filterR = "fld_long >= value"; private static String long_filterObj = "fld_long >= value.fld_long"; private static String long_filterVal = "fld_long >= 1000000"; private static String short_filterL = "value >= fld_short"; private static String short_filterR = "fld_short >= value"; private static String short_filterObj = "value.fld_short >= fld_short"; private static String short_filterVal = "1000 >= fld_short"; private static String Boolean_filterL = "value >= fld_Boolean"; private static String Boolean_filterR = "fld_Boolean >= value"; private static String Boolean_filterT = "fld_Boolean >= true"; private static String Boolean_filterF = "false >= fld_Boolean"; private static String Boolean_filterObj = "value.fld_Boolean >= fld_Boolean"; private static String Boolean_filterVal = "fld_Boolean >= false"; private static String Byte_filterL = "value >= fld_Byte"; private static String Byte_filterR = "fld_Byte >= value"; private static String Byte_filterObj = "fld_Byte >= value.fld_Byte"; private static String Byte_filterVal = "100 >= fld_Byte"; private static String Character_filterL = "value >= fld_Character"; private static String Character_filterR = "fld_Character >= value"; private static String Character_filterObj = "value.fld_Character >= fld_Character"; private static String Character_filterVal = "fld_Character >= 'z'"; private static String Double_filterL = "value >= fld_Double"; private static String Double_filterR = "fld_Double >= value"; private static String Double_filterObj = "value.fld_Double >= fld_Double"; private static String Double_filterVal = "fld_Double >= 100.0"; private static String Float_filterL = "value >= fld_Float"; private static String Float_filterR = "fld_Float >= value"; private static String Float_filterObj = "fld_Float >= value.fld_Float"; private static String Float_filterVal = "100.0f >= fld_Float"; private static String Integer_filterL = "value >= fld_Integer"; private static String Integer_filterR = "fld_Integer >= value"; private static String Integer_filterObj = "fld_Integer >= value.fld_Integer"; private static String Integer_filterVal = "fld_Integer >= 100"; private static String Long_filterL = "value >= fld_Long"; private static String Long_filterR = "fld_Long >= value"; private static String Long_filterObj = "value.fld_Long >= fld_Long"; private static String Long_filterVal = "-1000 >= fld_Long"; private static String Short_filterL = "value >= fld_Short"; private static String Short_filterR = "fld_Short >= value"; private static String Short_filterObj = "fld_Short >= value.fld_Short"; private static String Short_filterVal = "-1000 >= fld_Short"; private static String String_filterL = "value >= fld_String"; private static String String_filterR = "fld_String >= value"; private static String String_filterObj = "value.fld_String >= fld_String"; private static String String_filterVal1 = "fld_String >= \"Java\""; private static String String_filterVal2 = "fld_String >= \"\""; private static String Date_filterL = "value >= fld_Date"; private static String Date_filterR = "fld_Date >= value"; private static String Date_filterObj = "fld_Date >= value.fld_Date"; private static String BigDecimal_filterL = "value >= fld_BigDecimal"; private static String BigDecimal_filterR = "fld_BigDecimal >= value"; private static String BigDecimal_filterObj = "value.fld_BigDecimal >= fld_BigDecimal"; private static String BigInteger_filterL = "value >= fld_BigInteger"; private static String BigInteger_filterR = "fld_BigInteger >= value"; private static String BigInteger_filterObj = "fld_BigInteger >= value.fld_BigInteger"; /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-18 (GreaterThanOrEqual) failed: "; /** * The main 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(GreaterThanOrEqual.class); } /** */ public void test() { pm = getPM(); tx = pm.currentTransaction(); runQueries(); } /** */ private void runQueries() { AllTypes alltypes = new AllTypes(); run_byteQuery(byte_filterL, byteParameter, new Byte((byte)0), (byte)0, true, 4); run_byteQuery(byte_filterR, byteParameter, new Byte(Byte.MIN_VALUE), Byte.MIN_VALUE, false, 10); run_byteQuery(byte_filterL, ByteParameter, new Byte((byte)50), (byte)50, true, 7); run_byteQuery(byte_filterR, ByteParameter, new Byte(Byte.MAX_VALUE), Byte.MAX_VALUE, false, 1); run_byteQuery(byte_filterL, shortParameter, new Short((short)75), (byte)75, true, 8); run_byteQuery(byte_filterR, shortParameter, new Short((short)75), (byte)75, false, 3); run_byteQuery(byte_filterL, ShortParameter, new Short((short)10), (byte)10, true, 5); run_byteQuery(byte_filterR, ShortParameter, new Short((short)25), (byte)25, false, 5); run_byteQuery(byte_filterL, charParameter, new Character((char)101), (byte)101, true, 9); run_byteQuery(byte_filterR, charParameter, new Character((char)50), (byte)50, false, 5); run_byteQuery(byte_filterL, CharacterParameter, new Character((char)0), (byte)0, true, 4); run_byteQuery(byte_filterR, CharacterParameter, new Character((char)0), (byte)0, false, 7); run_byteQuery(byte_filterL, intParameter, new Integer(25), (byte)25, true, 5); run_byteQuery(byte_filterR, intParameter, new Integer(50), (byte)50, false, 5); run_byteQuery(byte_filterL, IntegerParameter, new Integer(-10), (byte)-10, true, 3); run_byteQuery(byte_filterR, IntegerParameter, new Integer(-100), (byte)-100, false, 9); run_byteQuery(byte_filterL, longParameter, new Long(50), (byte)50, true, 7); run_byteQuery(byte_filterR, longParameter, new Long(60), (byte)60, false, 3); run_byteQuery(byte_filterL, LongParameter, new Long(-100), (byte)-100, true, 2); run_byteQuery(byte_filterR, LongParameter, new Long(-100), (byte)-100, false, 9); run_byteQuery(byte_filterL, floatParameter, new Float(51), (byte)51, true, 7); run_byteQuery(byte_filterR, floatParameter, new Float(-20), (byte)-20, false, 8); run_byteQuery(byte_filterL, FloatParameter, new Float(-99), (byte)-99, true, 2); run_byteQuery(byte_filterR, FloatParameter, new Float(-100), (byte)-100, false, 9); run_byteQuery(byte_filterL, doubleParameter, new Double(50), (byte)50, true, 7); run_byteQuery(byte_filterR, doubleParameter, new Double(60), (byte)60, false, 3); run_byteQuery(byte_filterL, DoubleParameter, new Double(Byte.MAX_VALUE), Byte.MAX_VALUE, true, 10); run_byteQuery(byte_filterR, DoubleParameter, new Double(25), (byte)25, false, 5); run_byteQuery(byte_filterL, BigIntegerParameter, new BigInteger("50"), (byte)50, true, 7); run_byteQuery(byte_filterR, BigIntegerParameter, new BigInteger("-100"), (byte)-100, false, 9); run_byteQuery(byte_filterL, BigDecimalParameter, new BigDecimal("50.000000"), (byte)50, true, 7); run_byteQuery(byte_filterR, BigDecimalParameter, new BigDecimal("10.00000"), (byte)10, false, 6); alltypes.setbyte((byte)50); run_byteQuery(byte_filterObj, AllTypesParameter, alltypes, (byte)50, true, 7); alltypes.setbyte((byte)55); run_byteQuery(byte_filterObj, AllTypesParameter, alltypes, (byte)55, true, 7); run_byteQuery(byte_filterVal, null, null, (byte)100, false, 2); run_shortQuery(short_filterL, shortParameter, new Short((short)100), (short)100, true, 7); run_shortQuery(short_filterR, shortParameter, new Short((short)100), (short)100, false, 5); run_shortQuery(short_filterL, ShortParameter, new Short(Short.MIN_VALUE), Short.MIN_VALUE, true, 1); run_shortQuery(short_filterR, ShortParameter, new Short((short)253), (short)253, false, 3); run_shortQuery(short_filterR, shortParameter, new Short((short)1000), (short)1000, false, 3); run_shortQuery(short_filterL, byteParameter, new Byte((byte)75), (short)75, true, 5); run_shortQuery(short_filterR, byteParameter, new Byte((byte)-75), (short)-75, false, 6); run_shortQuery(short_filterL, ByteParameter, new Byte((byte)100), (short)100, true, 7); run_shortQuery(short_filterR, ByteParameter, new Byte((byte)100), (short)100, false, 5); run_shortQuery(short_filterL, charParameter, new Character((char)75), (short)75, true, 5); run_shortQuery(short_filterR, charParameter, new Character((char)9999), (short)9999, false, 2); run_shortQuery(short_filterL, CharacterParameter, new Character((char)1000), (short)1000, true, 8); run_shortQuery(short_filterR, CharacterParameter, new Character((char)10000), (short)10000, false, 2); run_shortQuery(short_filterL, intParameter, new Integer(-10000), (short)-10000, true, 2); run_shortQuery(short_filterR, intParameter, new Integer(-10000), (short)-10000, false, 9); run_shortQuery(short_filterL, IntegerParameter, new Integer(10000), (short)10000, true, 9); run_shortQuery(short_filterR, IntegerParameter, new Integer(30000), (short)30000, false, 1); run_shortQuery(short_filterL, longParameter, new Long(10000), (short) 10000, true, 9); run_shortQuery(short_filterR, longParameter, new Long(Short.MAX_VALUE), Short.MAX_VALUE, false, 1); run_shortQuery(short_filterL, LongParameter, new Long(Short.MAX_VALUE), Short.MAX_VALUE, true, 10); run_shortQuery(short_filterR, LongParameter, new Long(100), (short)100, false, 5); run_shortQuery(short_filterL, floatParameter, new Float(23000), (short)23000, true, 9); run_shortQuery(short_filterR, floatParameter, new Float(23000), (short)23000, false, 1); run_shortQuery(short_filterL, FloatParameter, new Float(-1000), (short)-1000, true, 3); run_shortQuery(short_filterR, FloatParameter, new Float(100), (short)100, false, 5); run_shortQuery(short_filterL, doubleParameter, new Double(-10000.0), (short)-10000, true, 2); run_shortQuery(short_filterR, doubleParameter, new Double(9999.0), (short)9999, false, 2); run_shortQuery(short_filterL, DoubleParameter, new Double(23.0), (short)23, true, 5); run_shortQuery(short_filterR, DoubleParameter, new Double(23.0), (short)23, false, 5); run_shortQuery(short_filterL, BigIntegerParameter, new BigInteger("10000"), (short)10000, true, 9); run_shortQuery(short_filterR, BigIntegerParameter, new BigInteger("30000"), (short)30000, false, 1); run_shortQuery(short_filterL, BigDecimalParameter, new BigDecimal("23.0"), (short)23, true, 5); run_shortQuery(short_filterR, BigDecimalParameter, new BigDecimal("23.0"), (short)23, false, 5); alltypes.setshort((short)100); run_shortQuery(short_filterObj, AllTypesParameter, alltypes, (short)100, true, 7); alltypes.setshort((short)23); run_shortQuery(short_filterObj, AllTypesParameter, alltypes, (short)23, true, 5); run_shortQuery(short_filterVal, null, null, (short)1000, true, 8); run_charQuery(char_filterL, charParameter, new Character(Character.MIN_VALUE), Character.MIN_VALUE, true, 1); run_charQuery(char_filterR, charParameter, new Character(Character.MAX_VALUE), Character.MAX_VALUE, false, 1); run_charQuery(char_filterL, charParameter, new Character('C'), 'C', true, 4); run_charQuery(char_filterR, charParameter, new Character('z'), 'z', false, 3); run_charQuery(char_filterL, CharacterParameter, new Character(' '), ' ', true, 2); run_charQuery(char_filterR, CharacterParameter, new Character('f'), 'f', false, 3); run_charQuery(char_filterL, byteParameter, new Byte((byte)Character.MIN_VALUE), (char)Character.MIN_VALUE, true, 1); run_charQuery(char_filterR, ByteParameter, new Byte((byte)'a'), 'a', false, 3); run_charQuery(char_filterL, shortParameter, new Short((short)'M'), 'M', true, 7); run_charQuery(char_filterR, shortParameter, new Short((short)'M'), 'M', false, 5); run_charQuery(char_filterL, ShortParameter, new Short((short)'A'), 'A', true, 3); run_charQuery(char_filterR, ShortParameter, new Short((short)'A'), 'A', false, 8); run_charQuery(char_filterL, intParameter, new Integer('z'), 'z', true, 9); run_charQuery(char_filterR, intParameter, new Integer('z'), 'z', false, 3); run_charQuery(char_filterL, IntegerParameter, new Integer('B'), 'B', true, 4); run_charQuery(char_filterR, IntegerParameter, new Integer('B'), 'B', false, 7); run_charQuery(char_filterL, floatParameter, new Float('f'), 'f', true, 7); run_charQuery(char_filterR, floatParameter, new Float(' '), ' ', false, 9); run_charQuery(char_filterL, FloatParameter, new Float('z'), 'z', true, 9); run_charQuery(char_filterR, FloatParameter, new Float('z'), 'z', false, 3); run_charQuery(char_filterL, doubleParameter, new Double('B'), 'B', true, 4); run_charQuery(char_filterR, doubleParameter, new Double('B'), 'B', false, 7); run_charQuery(char_filterL, DoubleParameter, new Double('A'), 'A', true, 3); run_charQuery(char_filterR, DoubleParameter, new Double('A'), 'A', false, 8); run_charQuery(char_filterL, BigIntegerParameter, new BigInteger("65"), 'A', true, 3); // 'A' == 65 run_charQuery(char_filterR, BigIntegerParameter, new BigInteger("122"), 'z', false, 3); // 'z' == 122 run_charQuery(char_filterL, BigDecimalParameter, new BigDecimal("65.00000"), 'A', true, 3); run_charQuery(char_filterR, BigDecimalParameter, new BigDecimal("77.0000"), 'M', false, 5); // 'M' == 77 alltypes.setchar('A'); run_charQuery(char_filterObj, AllTypesParameter, alltypes, 'A', true, 3); alltypes.setchar('b'); run_charQuery(char_filterObj, AllTypesParameter, alltypes, 'b', true, 7); run_charQuery(char_filterVal, null, null, 'M', true, 7); run_intQuery(int_filterL, intParameter, new Integer(AllTypes.veryLargeNegativeInt), AllTypes.veryLargeNegativeInt, true, 1); run_intQuery(int_filterR, intParameter, new Integer(AllTypes.veryLargePositiveInt), AllTypes.veryLargePositiveInt, false, 1); run_intQuery(int_filterR, intParameter, new Integer(23), 23, false, 6); run_intQuery(int_filterL, IntegerParameter, new Integer(1000000), 1000000, true, 9); run_intQuery(int_filterR, IntegerParameter, new Integer(1000), 1000, false, 4); run_intQuery(int_filterL, byteParameter, new Byte((byte)100), 100, true, 6); run_intQuery(int_filterR, byteParameter, new Byte((byte)0), 0, false, 7); run_intQuery(int_filterL, ByteParameter, new Byte((byte)100), 100, true, 6); run_intQuery(int_filterR, ByteParameter, new Byte((byte)0), 0, false, 7); run_intQuery(int_filterL, shortParameter, new Short((short)10000), 10000, true, 8); run_intQuery(int_filterR, shortParameter, new Short((short)-1000), -1000, false, 8); run_intQuery(int_filterL, ShortParameter, new Short((short)-1000), -1000, true, 3); run_intQuery(int_filterR, ShortParameter, new Short((short)10000), 10000, false, 3); run_intQuery(int_filterL, charParameter, new Character((char)100), 100, true, 6); run_intQuery(int_filterR, charParameter, new Character((char)0), 0, false, 7); run_intQuery(int_filterL, CharacterParameter, new Character((char)100), 100, true, 6); run_intQuery(int_filterR, CharacterParameter, new Character((char)10000), 10000, false, 3); run_intQuery(int_filterL, longParameter, new Long(AllTypes.veryLargePositiveInt), AllTypes.veryLargePositiveInt, true, 10); run_intQuery(int_filterR, longParameter, new Long(AllTypes.veryLargeNegativeInt), AllTypes.veryLargeNegativeInt, false, 10); run_intQuery(int_filterL, LongParameter, new Long(10000), 10000, true, 8); run_intQuery(int_filterR, LongParameter, new Long(43), 43, false, 6); run_intQuery(int_filterL, floatParameter, new Float(AllTypes.veryLargePositiveInt), AllTypes.veryLargePositiveInt, true, 10); run_intQuery(int_filterR, floatParameter, new Float(AllTypes.veryLargeNegativeInt), AllTypes.veryLargeNegativeInt, false, 10); run_intQuery(int_filterL, FloatParameter, new Float(10000), 10000, true, 8); run_intQuery(int_filterR, FloatParameter, new Float(43), 43, false, 6); run_intQuery(int_filterL, doubleParameter, new Double(AllTypes.veryLargePositiveInt), AllTypes.veryLargePositiveInt, true, 10); run_intQuery(int_filterR, doubleParameter, new Double(AllTypes.veryLargeNegativeInt), AllTypes.veryLargeNegativeInt, false, 10); run_intQuery(int_filterL, DoubleParameter, new Double(10000), 10000, true, 8); run_intQuery(int_filterR, DoubleParameter, new Double(43), 43, false, 6); run_intQuery(int_filterL, BigIntegerParameter, new BigInteger("1000000"), 1000000, true, 9); run_intQuery(int_filterR, BigIntegerParameter, new BigInteger("1000"), 1000, false, 4); run_intQuery(int_filterL, BigDecimalParameter, new BigDecimal("10000.0"), 10000, true, 8); run_intQuery(int_filterR, BigDecimalParameter, new BigDecimal("43.0"), 43, false, 6); alltypes.setint(100); run_intQuery(int_filterObj, AllTypesParameter, alltypes, 100, true, 6); run_intQuery(int_filterVal, null, null, 1000, false, 4); run_longQuery(long_filterL, longParameter, new Long(Long.MIN_VALUE), Long.MIN_VALUE, true, 1); run_longQuery(long_filterR, longParameter, new Long(Long.MAX_VALUE), Long.MAX_VALUE, false, 1); run_longQuery(long_filterL, LongParameter, new Long(100), 100, true, 7); run_longQuery(long_filterR, LongParameter, new Long(23), 23, false, 5); run_longQuery(long_filterL, byteParameter, new Byte((byte)100), 100, true, 7); run_longQuery(long_filterR, byteParameter, new Byte((byte)0), 0, false, 6); run_longQuery(long_filterL, ByteParameter, new Byte((byte)100), 100, true, 7); run_longQuery(long_filterR, ByteParameter, new Byte((byte)0), 0, false, 6); run_longQuery(long_filterL, shortParameter, new Short((short)-1000), -1000, true, 4); run_longQuery(long_filterR, shortParameter, new Short((short)1000), 1000, false, 3); run_longQuery(long_filterL, ShortParameter, new Short((short)100), 100, true, 7); run_longQuery(long_filterR, ShortParameter, new Short((short)32), 32, false, 5); run_longQuery(long_filterL, charParameter, new Character((char)0), 0, true, 5); run_longQuery(long_filterR, charParameter, new Character((char)100), 100, false, 5); run_longQuery(long_filterL, CharacterParameter, new Character((char)23), 23, true, 5); run_longQuery(long_filterR, CharacterParameter, new Character((char)0), 0, false, 6); run_longQuery(long_filterL, intParameter, new Integer(100), 100, true, 7); run_longQuery(long_filterR, intParameter, new Integer(0), 0, false, 6); run_longQuery(long_filterL, IntegerParameter, new Integer(23), 23, true, 5); run_longQuery(long_filterR, IntegerParameter, new Integer(1000000), 1000000, false, 2); run_longQuery(long_filterL, floatParameter, new Float(-1000000.0), -1000000, true, 2); run_longQuery(long_filterR, floatParameter, new Float((float)Long.MAX_VALUE), Long.MAX_VALUE, false, 1); run_longQuery(long_filterL, FloatParameter, new Float(100.0), 100, true, 7); run_longQuery(long_filterR, FloatParameter, new Float(32.0), 32, false, 5); run_longQuery(long_filterL, doubleParameter, new Double(-1000000.0), -1000000, true, 2); run_longQuery(long_filterR, doubleParameter, new Double((double)Long.MAX_VALUE), Long.MAX_VALUE, false, 1); run_longQuery(long_filterL, DoubleParameter, new Double(100.0), 100, true, 7); run_longQuery(long_filterR, DoubleParameter, new Double(32.0), 32, false, 5); run_longQuery(long_filterL, BigIntegerParameter, new BigInteger("23"), 23, true, 5); run_longQuery(long_filterR, BigIntegerParameter, new BigInteger("1000000"), 1000000, false, 2); run_longQuery(long_filterL, BigDecimalParameter, new BigDecimal("100.0"), 100, true, 7); run_longQuery(long_filterR, BigDecimalParameter, new BigDecimal("32.0"), 32, false, 5); alltypes.setlong(100); run_longQuery(long_filterObj, AllTypesParameter, alltypes, 100, false, 5); run_longQuery(long_filterVal, null, null, 1000000, false, 2); run_floatQuery(float_filterL, floatParameter, new Float(AllTypes.FLOAT_SMALLEST), AllTypes.FLOAT_SMALLEST, true, 1); run_floatQuery(float_filterR, floatParameter, new Float(AllTypes.FLOAT_LARGEST), AllTypes.FLOAT_LARGEST, false, 1); run_floatQuery(float_filterL, FloatParameter, new Float(4.0f), 4.0f, true, 4); run_floatQuery(float_filterR, FloatParameter, new Float(400.0f), 400.0f, false, 3); run_floatQuery(float_filterL, byteParameter, new Byte((byte)4), 4.0f, true, 4); run_floatQuery(float_filterR, byteParameter, new Byte((byte)23), 23.0f, false, 6); run_floatQuery(float_filterL, ByteParameter, new Byte((byte)34), 34.0f, true, 4); run_floatQuery(float_filterR, ByteParameter, new Byte((byte)100), 100.0f, false, 6); run_floatQuery(float_filterL, shortParameter, new Short((short)10), 10.0f, true, 4); run_floatQuery(float_filterR, shortParameter, new Short((short)23), 23.0f, false, 6); run_floatQuery(float_filterL, ShortParameter, new Short((short)34), 34.0f, true, 4); run_floatQuery(float_filterR, ShortParameter, new Short((short)100), 100.0f, false, 6); run_floatQuery(float_filterL, charParameter, new Character((char)20), 20.0f, true, 4); run_floatQuery(float_filterR, charParameter, new Character((char)23), 23.0f, false, 6); run_floatQuery(float_filterL, CharacterParameter, new Character((char)34), 34.0f, true, 4); run_floatQuery(float_filterR, CharacterParameter, new Character((char)100), 100.0f, false, 6); run_floatQuery(float_filterL, intParameter, new Integer(55000000), 55000000.0f, true, 8); run_floatQuery(float_filterR, intParameter, new Integer(23), 23.0f, false, 6); run_floatQuery(float_filterL, IntegerParameter, new Integer(34), 34.0f, true, 4); run_floatQuery(float_filterR, IntegerParameter, new Integer(100), 100.0f, false, 6); run_floatQuery(float_filterL, longParameter, new Long(55000000), 55000000.0f, true, 8); run_floatQuery(float_filterR, longParameter, new Long(23), 23.0f, false, 6); run_floatQuery(float_filterL, LongParameter, new Long(34), 34.0f, true, 4); run_floatQuery(float_filterR, LongParameter, new Long(100), 100.0f, false, 6); run_floatQuery(float_filterL, doubleParameter, new Double(55000000.0), 55000000.0f, true, 8); run_floatQuery(float_filterR, doubleParameter, new Double(-20.5), -20.5f, false, 7); run_floatQuery(float_filterL, DoubleParameter, new Double(2.0), 2.0f, true, 4); run_floatQuery(float_filterR, DoubleParameter, new Double(100.0), 100.0f, false, 6); run_floatQuery(float_filterL, BigIntegerParameter, new BigInteger("55000000"), 55000000.0f, true, 8); run_floatQuery(float_filterR, BigIntegerParameter, new BigInteger("23"), 23.0f, false, 6); run_floatQuery(float_filterL, BigDecimalParameter, new BigDecimal("55000000.0"), 55000000.0f, true, 8); run_floatQuery(float_filterR, BigDecimalParameter, new BigDecimal("-20.5"), -20.5f, false, 7); alltypes.setfloat(23.23f); run_floatQuery(float_filterObj, AllTypesParameter, alltypes, 23.23f, false, 6); run_floatQuery(float_filterVal, null, null, 100.0f, false, 6); run_doubleQuery(double_filterL, doubleParameter, new Double(AllTypes.DOUBLE_SMALLEST), AllTypes.DOUBLE_SMALLEST, true, 1); run_doubleQuery(double_filterR, doubleParameter, new Double(AllTypes.DOUBLE_LARGEST), AllTypes.DOUBLE_LARGEST, false, 1); run_doubleQuery(double_filterL, DoubleParameter, new Double(0.0), 0.0, true, 4); run_doubleQuery(double_filterR, DoubleParameter, new Double(23.34), 23.34, false, 6); run_doubleQuery(double_filterL, byteParameter, new Byte((byte)100), 100.0, true, 6); run_doubleQuery(double_filterR, byteParameter, new Byte((byte)0), 0.0, false, 7); run_doubleQuery(double_filterL, ByteParameter, new Byte((byte)23), 23.0, true, 4); run_doubleQuery(double_filterR, ByteParameter, new Byte((byte)100), 100.0, false, 6); run_doubleQuery(double_filterL, charParameter, new Character((char)100), 100.0, true, 6); run_doubleQuery(double_filterR, charParameter, new Character((char)0), 0.0, false, 7); run_doubleQuery(double_filterL, CharacterParameter, new Character((char)23), 23.0, true, 4); run_doubleQuery(double_filterR, CharacterParameter, new Character((char)100), 100.0, false, 6); run_doubleQuery(double_filterL, shortParameter, new Short((short)100), 100.0, true, 6); run_doubleQuery(double_filterR, shortParameter, new Short((short)0), 0.0, false, 7); run_doubleQuery(double_filterL, ShortParameter, new Short((short)23), 23.0, true, 4); run_doubleQuery(double_filterR, ShortParameter, new Short((short)100), 100.0, false, 6); run_doubleQuery(double_filterL, intParameter, new Integer(100), 100.0, true, 6); run_doubleQuery(double_filterR, intParameter, new Integer(0), 0.0, false, 7); run_doubleQuery(double_filterL, IntegerParameter, new Integer(5000), 5000.0, true, 7); run_doubleQuery(double_filterR, IntegerParameter, new Integer(-20), -20.0, false, 7); run_doubleQuery(double_filterL, longParameter, new Long(100), 100.0, true, 6); run_doubleQuery(double_filterR, longParameter, new Long(0), 0.0, false, 7); run_doubleQuery(double_filterL, LongParameter, new Long(5000), 5000.0, true, 7); run_doubleQuery(double_filterR, LongParameter, new Long(-20), -20.0, false, 7); run_doubleQuery(double_filterL, floatParameter, new Float(0.0f), 0.0f, true, 4); run_doubleQuery(double_filterR, floatParameter, new Float(100.0f), 100.0f, false, 6); run_doubleQuery(double_filterL, FloatParameter, new Float(100.0f), 100.0, true, 6); run_doubleQuery(double_filterR, FloatParameter, new Float(69.96f), 69.96, false, 6); run_doubleQuery(double_filterL, BigIntegerParameter, new BigInteger("5000"), 5000.0, true, 7); run_doubleQuery(double_filterR, BigIntegerParameter, new BigInteger("-20"), -20.0, false, 7); run_doubleQuery(double_filterL, BigDecimalParameter, new BigDecimal("100.0"), 100.0, true, 6); run_doubleQuery(double_filterR, BigDecimalParameter, new BigDecimal("69.96"), 69.96, false, 6); alltypes.setdouble(-25.5); run_doubleQuery(double_filterObj, AllTypesParameter, alltypes, -25.5, true, 3); run_doubleQuery(double_filterVal, null, null, 100.0, false, 6); run_ByteQuery(Byte_filterL, byteParameter, new Byte((byte)50), new Byte((byte)50), true, 7); run_ByteQuery(Byte_filterR, byteParameter, new Byte(Byte.MIN_VALUE), new Byte(Byte.MIN_VALUE), false, 10); run_ByteQuery(Byte_filterL, ByteParameter, new Byte((byte)20), new Byte((byte)20), true, 5); run_ByteQuery(Byte_filterR, ByteParameter, new Byte(Byte.MAX_VALUE), new Byte(Byte.MAX_VALUE), false, 1); run_ByteQuery(Byte_filterL, shortParameter, new Short((short)60), new Byte((byte)60), true, 7); run_ByteQuery(Byte_filterR, shortParameter, new Short((short)51), new Byte((byte)51), false, 3); run_ByteQuery(Byte_filterL, ShortParameter, new Short((short)-100), new Byte((byte)-100), true, 2); run_ByteQuery(Byte_filterR, ShortParameter, new Short((short)-100), new Byte((byte)-100), false, 9); run_ByteQuery(Byte_filterL, charParameter, new Character((char)101), new Byte((byte)101), true, 9); run_ByteQuery(Byte_filterR, charParameter, new Character((char)10), new Byte((byte)10), false, 6); run_ByteQuery(Byte_filterL, CharacterParameter, new Character((char)50), new Byte((byte)50), true, 7); run_ByteQuery(Byte_filterR, CharacterParameter, new Character((char)75), new Byte((byte)75), false, 3); run_ByteQuery(Byte_filterL, intParameter, new Integer(77), new Byte((byte)77), true, 8); run_ByteQuery(Byte_filterR, intParameter, new Integer(60), new Byte((byte)60), false, 3); run_ByteQuery(Byte_filterL, IntegerParameter, new Integer(40), new Byte((byte)40), true, 5); run_ByteQuery(Byte_filterR, IntegerParameter, new Integer(75), new Byte((byte)75), false, 3); run_ByteQuery(Byte_filterL, longParameter, new Long(50), new Byte((byte)50), true, 7); run_ByteQuery(Byte_filterR, longParameter, new Long(50), new Byte((byte)50), false, 5); run_ByteQuery(Byte_filterL, LongParameter, new Long(-100), new Byte((byte)-100), true, 2); run_ByteQuery(Byte_filterR, LongParameter, new Long(-100), new Byte((byte)-100), false, 9); run_ByteQuery(Byte_filterL, floatParameter, new Float(50), new Byte((byte)50), true, 7); run_ByteQuery(Byte_filterR, floatParameter, new Float(50), new Byte((byte)50), false, 5); run_ByteQuery(Byte_filterL, FloatParameter, new Float(-100), new Byte((byte)-100), true, 2); run_ByteQuery(Byte_filterR, FloatParameter, new Float(-100), new Byte((byte)-100), false, 9); run_ByteQuery(Byte_filterL, doubleParameter, new Double(50), new Byte((byte)50), true, 7); run_ByteQuery(Byte_filterR, doubleParameter, new Double(50), new Byte((byte)50), false, 5); run_ByteQuery(Byte_filterL, DoubleParameter, new Double(-100), new Byte((byte)-100), true, 2); run_ByteQuery(Byte_filterR, DoubleParameter, new Double(-100), new Byte((byte)-100), false, 9); run_ByteQuery(Byte_filterL, BigIntegerParameter, new BigInteger("50"), new Byte((byte)50), true, 7); run_ByteQuery(Byte_filterR, BigIntegerParameter, new BigInteger("-100"), new Byte((byte)-100), false, 9); run_ByteQuery(Byte_filterL, BigDecimalParameter, new BigDecimal("50.000000"), new Byte((byte)50), true, 7); run_ByteQuery(Byte_filterR, BigDecimalParameter, new BigDecimal("10.00000"), new Byte((byte)10), false, 6); Byte val = new Byte((byte)50); alltypes.setByte(val); run_ByteQuery(Byte_filterObj, AllTypesParameter, alltypes, val, false, 5); val = new Byte((byte)51); alltypes.setByte(val); run_ByteQuery(Byte_filterObj, AllTypesParameter, alltypes, val, false, 3); run_ByteQuery(Byte_filterVal, null, null, new Byte((byte)100), true, 9); run_ShortQuery(Short_filterL, shortParameter, new Short((short)100), new Short((short)100), true, 7); run_ShortQuery(Short_filterR, shortParameter, new Short((short)100), new Short((short)100), false, 5); run_ShortQuery(Short_filterL, ShortParameter, new Short(Short.MIN_VALUE), new Short(Short.MIN_VALUE), true, 1); run_ShortQuery(Short_filterR, ShortParameter, new Short((short)253), new Short((short)253), false, 3); run_ShortQuery(Short_filterR, shortParameter, new Short((short)1000), new Short((short)1000), false, 3); run_ShortQuery(Short_filterL, byteParameter, new Byte((byte)75), new Short((short)75), true, 5); run_ShortQuery(Short_filterR, byteParameter, new Byte((byte)75), new Short((short)75), false, 5); run_ShortQuery(Short_filterL, ByteParameter, new Byte((byte)100), new Short((short)100), true, 7); run_ShortQuery(Short_filterR, ByteParameter, new Byte((byte)100), new Short((short)100), false, 5); run_ShortQuery(Short_filterL, charParameter, new Character((char)75), new Short((short)75), true, 5); run_ShortQuery(Short_filterR, charParameter, new Character((char)75), new Short((short)75), false, 5); run_ShortQuery(Short_filterL, CharacterParameter, new Character((char)100), new Short((short)100), true, 7); run_ShortQuery(Short_filterR, CharacterParameter, new Character((char)200), new Short((short)200), false, 3); run_ShortQuery(Short_filterL, intParameter, new Integer(-10000), new Short((short)-10000), true, 2); run_ShortQuery(Short_filterR, intParameter, new Integer(-10000), new Short((short)-10000), false, 9); run_ShortQuery(Short_filterL, IntegerParameter, new Integer(10000), new Short((short)10000), true, 9); run_ShortQuery(Short_filterR, IntegerParameter, new Integer(10000), new Short((short)10000), false, 2); run_ShortQuery(Short_filterL, longParameter, new Long(20000), new Short((short) 20000), true, 9); run_ShortQuery(Short_filterR, longParameter, new Long(5000), new Short((short) 5000), false, 2); run_ShortQuery(Short_filterL, LongParameter, new Long(200), new Short((short)200), true, 7); run_ShortQuery(Short_filterR, LongParameter, new Long(500), new Short((short)500), false, 3); run_ShortQuery(Short_filterL, floatParameter, new Float(23000.0f), new Short((short)23000), true, 9); run_ShortQuery(Short_filterR, floatParameter, new Float(23000.0f), new Short((short)23000), false, 1); run_ShortQuery(Short_filterL, FloatParameter, new Float(10.0f), new Short((short)10), true, 5); run_ShortQuery(Short_filterR, FloatParameter, new Float(101.0f), new Short((short)101), false, 3); run_ShortQuery(Short_filterL, doubleParameter, new Double(-10000.0), new Short((short)-10000), true, 2); run_ShortQuery(Short_filterR, doubleParameter, new Double(-10000.0), new Short((short)-10000), false, 9); run_ShortQuery(Short_filterL, DoubleParameter, new Double(101.0), new Short((short)101), true, 7); run_ShortQuery(Short_filterR, DoubleParameter, new Double(23.0), new Short((short)23), false, 5); run_ShortQuery(Short_filterL, BigIntegerParameter, new BigInteger("10000"), new Short((short)10000), true, 9); run_ShortQuery(Short_filterR, BigIntegerParameter, new BigInteger("30000"), new Short((short)30000), false, 1); run_ShortQuery(Short_filterL, BigDecimalParameter, new BigDecimal("23.0"), new Short((short)23), true, 5); run_ShortQuery(Short_filterR, BigDecimalParameter, new BigDecimal("23.0"), new Short((short)23), false, 5); Short sval = new Short((short)100); alltypes.setShort(sval); run_ShortQuery(Short_filterObj, AllTypesParameter, alltypes, sval, false, 5); sval = new Short((short)23); alltypes.setShort(sval); run_ShortQuery(Short_filterObj, AllTypesParameter, alltypes, sval, false, 5); run_ShortQuery(Short_filterVal, null, null, new Short((short)-1000), true, 3); run_CharacterQuery(Character_filterL, charParameter, new Character(Character.MIN_VALUE), new Character(Character.MIN_VALUE), true, 1); run_CharacterQuery(Character_filterR, charParameter, new Character(Character.MAX_VALUE), new Character(Character.MAX_VALUE), false, 1); run_CharacterQuery(Character_filterL, charParameter, new Character('C'), new Character('C'), true, 4); run_CharacterQuery(Character_filterR, charParameter, new Character('z'), new Character('z'), false, 3); run_CharacterQuery(Character_filterL, CharacterParameter, new Character(' '), new Character(' '), true, 2); run_CharacterQuery(Character_filterR, CharacterParameter, new Character('f'), new Character('f'), false, 3); run_CharacterQuery(Character_filterL, byteParameter, new Byte((byte)Character.MIN_VALUE), new Character((char)Character.MIN_VALUE), true, 1); run_CharacterQuery(Character_filterR, ByteParameter, new Byte((byte)'a'), new Character('a'), false, 3); run_CharacterQuery(Character_filterL, shortParameter, new Short((short)'M'), new Character('M'), true, 7); run_CharacterQuery(Character_filterR, shortParameter, new Short((short)'F'), new Character('F'), false, 6); run_CharacterQuery(Character_filterL, ShortParameter, new Short((short)'A'), new Character('A'), true, 3); run_CharacterQuery(Character_filterR, ShortParameter, new Short((short)'A'), new Character('A'), false, 8); run_CharacterQuery(Character_filterL, intParameter, new Integer('z'), new Character('z'), true, 9); run_CharacterQuery(Character_filterR, intParameter, new Integer('z'), new Character('z'), false, 3); run_CharacterQuery(Character_filterL, IntegerParameter, new Integer('B'), new Character('B'), true, 4); run_CharacterQuery(Character_filterR, IntegerParameter, new Integer('B'), new Character('B'), false, 7); run_CharacterQuery(Character_filterL, longParameter, new Long('z'), new Character('z'), true, 9); run_CharacterQuery(Character_filterR, longParameter, new Long('z'), new Character('z'), false, 3); run_CharacterQuery(Character_filterL, LongParameter, new Long('B'), new Character('B'), true, 4); run_CharacterQuery(Character_filterR, LongParameter, new Long('B'), new Character('B'), false, 7); run_CharacterQuery(Character_filterL, floatParameter, new Float('z'), new Character('z'), true, 9); run_CharacterQuery(Character_filterR, floatParameter, new Float('z'), new Character('z'), false, 3); run_CharacterQuery(Character_filterL, FloatParameter, new Float('M'), new Character('M'), true, 7); run_CharacterQuery(Character_filterR, FloatParameter, new Float('X'), new Character('X'), false, 3); run_CharacterQuery(Character_filterL, doubleParameter, new Double('B'), new Character('B'), true, 4); run_CharacterQuery(Character_filterR, doubleParameter, new Double('B'), new Character('B'), false, 7); run_CharacterQuery(Character_filterL, DoubleParameter, new Double('A'), new Character('A'), true, 3); run_CharacterQuery(Character_filterR, DoubleParameter, new Double('A'), new Character('A'), false, 8); run_CharacterQuery(Character_filterL, BigIntegerParameter, new BigInteger("65"), new Character('A'), true, 3); // 'A' == 65 run_CharacterQuery(Character_filterR, BigIntegerParameter, new BigInteger("122"), new Character('z'), false, 3); // 'z' == 122 run_CharacterQuery(Character_filterL, BigDecimalParameter, new BigDecimal("65.00000"), new Character('A'), true, 3); run_CharacterQuery(Character_filterR, BigDecimalParameter, new BigDecimal("77.0000"), new Character('M'), false, 5); // 'M' == 77 alltypes.setCharacter(new Character('A')); run_CharacterQuery(Character_filterObj, AllTypesParameter, alltypes, new Character('A'), true, 3); alltypes.setCharacter(new Character('b')); run_CharacterQuery(Character_filterObj, AllTypesParameter, alltypes, new Character('b'), true, 7); run_CharacterQuery(Character_filterVal, null, null, new Character('z'), false, 3); run_IntegerQuery(Integer_filterL, intParameter, new Integer(AllTypes.veryLargeNegativeInt), new Integer(AllTypes.veryLargeNegativeInt), true, 1); run_IntegerQuery(Integer_filterR, intParameter, new Integer(AllTypes.veryLargePositiveInt), new Integer(AllTypes.veryLargePositiveInt), false, 1); run_IntegerQuery(Integer_filterR, intParameter, new Integer(23), new Integer(23), false, 6); run_IntegerQuery(Integer_filterL, IntegerParameter, new Integer(1000000), new Integer(1000000), true, 9); run_IntegerQuery(Integer_filterR, IntegerParameter, new Integer(1000), new Integer(1000), false, 4); run_IntegerQuery(Integer_filterL, byteParameter, new Byte((byte)100), new Integer(100), true, 6); run_IntegerQuery(Integer_filterR, byteParameter, new Byte((byte)0), new Integer(0), false, 7); run_IntegerQuery(Integer_filterL, ByteParameter, new Byte((byte)100), new Integer(100), true, 6); run_IntegerQuery(Integer_filterR, ByteParameter, new Byte((byte)0), new Integer(0), false, 7); run_IntegerQuery(Integer_filterL, shortParameter, new Short((short)10000), new Integer(10000), true, 8); run_IntegerQuery(Integer_filterR, shortParameter, new Short((short)-1000), new Integer(-1000), false, 8); run_IntegerQuery(Integer_filterL, ShortParameter, new Short((short)-1000), new Integer(-1000), true, 3); run_IntegerQuery(Integer_filterR, ShortParameter, new Short((short)-999), new Integer(-999), false, 7); run_IntegerQuery(Integer_filterL, charParameter, new Character((char)10000), new Integer(10000), true, 8); run_IntegerQuery(Integer_filterR, charParameter, new Character((char)10000), new Integer(10000), false, 3); run_IntegerQuery(Integer_filterL, CharacterParameter, new Character((char)100), new Integer(100), true, 6); run_IntegerQuery(Integer_filterR, CharacterParameter, new Character((char)10000), new Integer(10000), false, 3); run_IntegerQuery(Integer_filterL, longParameter, new Long(AllTypes.veryLargePositiveInt), new Integer(AllTypes.veryLargePositiveInt), true, 10); run_IntegerQuery(Integer_filterR, longParameter, new Long(AllTypes.veryLargeNegativeInt), new Integer(AllTypes.veryLargeNegativeInt), false, 10); run_IntegerQuery(Integer_filterL, LongParameter, new Long(10000), new Integer(10000), true, 8); run_IntegerQuery(Integer_filterR, LongParameter, new Long(43), new Integer(43), false, 6); run_IntegerQuery(Integer_filterL, floatParameter, new Float(AllTypes.veryLargePositiveInt), new Integer(AllTypes.veryLargePositiveInt), true, 10); run_IntegerQuery(Integer_filterR, floatParameter, new Float(AllTypes.veryLargeNegativeInt), new Integer(AllTypes.veryLargeNegativeInt), false, 10); run_IntegerQuery(Integer_filterL, FloatParameter, new Float(10000), new Integer(10000), true, 8); run_IntegerQuery(Integer_filterR, FloatParameter, new Float(43), new Integer(43), false, 6); run_IntegerQuery(Integer_filterL, doubleParameter, new Double(AllTypes.veryLargePositiveInt), new Integer(AllTypes.veryLargePositiveInt), true, 10); run_IntegerQuery(Integer_filterR, doubleParameter, new Double(AllTypes.veryLargeNegativeInt), new Integer(AllTypes.veryLargeNegativeInt), false, 10); run_IntegerQuery(Integer_filterL, DoubleParameter, new Double(10000), new Integer(10000), true, 8); run_IntegerQuery(Integer_filterR, DoubleParameter, new Double(1000001.0), new Integer(1000001), false, 1); run_IntegerQuery(Integer_filterL, BigIntegerParameter, new BigInteger("1000000"), new Integer(1000000), true, 9); run_IntegerQuery(Integer_filterR, BigIntegerParameter, new BigInteger("1000"), new Integer(1000), false, 4); run_IntegerQuery(Integer_filterL, BigDecimalParameter, new BigDecimal("10000.0"), new Integer(10000), true, 8); run_IntegerQuery(Integer_filterR, BigDecimalParameter, new BigDecimal("43.0"), new Integer(43), false, 6); alltypes.setInteger(new Integer(100)); run_IntegerQuery(Integer_filterObj, AllTypesParameter, alltypes, new Integer(100), false, 6); run_IntegerQuery(Integer_filterVal, null, null, new Integer(100), false, 6); run_LongQuery(Long_filterL, longParameter, new Long(Long.MIN_VALUE), new Long(Long.MIN_VALUE), true, 1); run_LongQuery(Long_filterR, longParameter, new Long(Long.MAX_VALUE), new Long(Long.MAX_VALUE), false, 1); run_LongQuery(Long_filterL, LongParameter, new Long(100), new Long(100), true, 7); run_LongQuery(Long_filterR, LongParameter, new Long(23), new Long(23), false, 5); run_LongQuery(Long_filterL, byteParameter, new Byte((byte)100), new Long(100), true, 7); run_LongQuery(Long_filterR, byteParameter, new Byte((byte)0), new Long(0), false, 6); run_LongQuery(Long_filterL, ByteParameter, new Byte((byte)100), new Long(100), true, 7); run_LongQuery(Long_filterR, ByteParameter, new Byte((byte)0), new Long(0), false, 6); run_LongQuery(Long_filterL, shortParameter, new Short((short)-1000 ), new Long(-1000), true, 4); run_LongQuery(Long_filterR, shortParameter, new Short((short)1000), new Long(1000), false, 3); run_LongQuery(Long_filterL, ShortParameter, new Short((short)101), new Long(101), true, 7); run_LongQuery(Long_filterR, ShortParameter, new Short((short)32), new Long(32), false, 5); run_LongQuery(Long_filterL, charParameter, new Character((char)0), new Long(0), true, 5); run_LongQuery(Long_filterR, charParameter, new Character((char)100), new Long(100), false, 5); run_LongQuery(Long_filterL, CharacterParameter, new Character((char)23), new Long(23), true, 5); run_LongQuery(Long_filterR, CharacterParameter, new Character((char)1110), new Long(1110), false, 2); run_LongQuery(Long_filterL, intParameter, new Integer(100), new Long(100), true, 7); run_LongQuery(Long_filterR, intParameter, new Integer(0), new Long(0), false, 6); run_LongQuery(Long_filterL, IntegerParameter, new Integer(23), new Long(23), true, 5); run_LongQuery(Long_filterR, IntegerParameter, new Integer(1000000), new Long(1000000), false, 2); run_LongQuery(Long_filterL, floatParameter, new Float(-1000000.0), new Long(-1000000), true, 2); run_LongQuery(Long_filterR, floatParameter, new Float((float)Long.MAX_VALUE), new Long(Long.MAX_VALUE), false, 1); run_LongQuery(Long_filterL, FloatParameter, new Float(100.0f), new Long(100), true, 7); run_LongQuery(Long_filterR, FloatParameter, new Float(32.0f), new Long(32), false, 5); run_LongQuery(Long_filterL, doubleParameter, new Double(-1000000.0), new Long(-1000000), true, 2); run_LongQuery(Long_filterR, doubleParameter, new Double((double)Long.MAX_VALUE), new Long(Long.MAX_VALUE), false, 1); run_LongQuery(Long_filterL, DoubleParameter, new Double(100.0), new Long(100), true, 7); run_LongQuery(Long_filterR, DoubleParameter, new Double(32.0), new Long(32), false, 5); run_LongQuery(Long_filterL, BigIntegerParameter, new BigInteger("23"), new Long(23), true, 5); run_LongQuery(Long_filterR, BigIntegerParameter, new BigInteger("1000000"), new Long(1000000), false, 2); run_LongQuery(Long_filterL, BigDecimalParameter, new BigDecimal("100.0"), new Long(100), true, 7); run_LongQuery(Long_filterR, BigDecimalParameter, new BigDecimal("32.0"), new Long(32), false, 5); alltypes.setLong(new Long(100)); run_LongQuery(Long_filterObj, AllTypesParameter, alltypes, new Long(100), true, 7); run_LongQuery(Long_filterVal, null, null, new Long(-1000), true, 4); run_FloatQuery(Float_filterL, floatParameter, new Float(-10000000000.0f), new Float(-10000000000.0f), true, 1); run_FloatQuery(Float_filterR, floatParameter, new Float(9000000000.0f), new Float(9000000000.0f), false, 1); run_FloatQuery(Float_filterL, FloatParameter, new Float(0.0), new Float(0.0f), true, 3); run_FloatQuery(Float_filterR, FloatParameter, new Float(4.0), new Float(4.0f), false, 7); run_FloatQuery(Float_filterL, byteParameter, new Byte((byte)0), new Float(0.0f), true, 3); run_FloatQuery(Float_filterR, byteParameter, new Byte((byte)23), new Float(23.0f), false, 7); run_FloatQuery(Float_filterL, ByteParameter, new Byte((byte)34), new Float(34.0f), true, 3); run_FloatQuery(Float_filterR, ByteParameter, new Byte((byte)100), new Float(100.0f), false, 7); run_FloatQuery(Float_filterL, shortParameter, new Short((short)0), new Float(0.0f), true, 3); run_FloatQuery(Float_filterR, shortParameter, new Short((short)23), new Float(23.0f), false, 7); run_FloatQuery(Float_filterL, ShortParameter, new Short((short)34), new Float(34.0f), true, 3); run_FloatQuery(Float_filterR, ShortParameter, new Short((short)100), new Float(100.0f), false, 7); run_FloatQuery(Float_filterL, charParameter, new Character((char)0), new Float(0.0f), true, 3); run_FloatQuery(Float_filterR, charParameter, new Character((char)23), new Float(23.0f), false, 7); run_FloatQuery(Float_filterL, CharacterParameter, new Character((char)34), new Float(34.0f), true, 3); run_FloatQuery(Float_filterR, CharacterParameter, new Character((char)100), new Float(100.0f), false, 7); run_FloatQuery(Float_filterL, intParameter, new Integer(50000000), new Float(50000000.0f), true, 8); run_FloatQuery(Float_filterR, intParameter, new Integer(23), new Float(23.0f), false, 7); run_FloatQuery(Float_filterL, IntegerParameter, new Integer(34), new Float(34.0f), true, 3); run_FloatQuery(Float_filterR, IntegerParameter, new Integer(100), new Float(100.0f), false, 7); run_FloatQuery(Float_filterL, longParameter, new Long(50000000), new Float(50000000.0f), true, 8); run_FloatQuery(Float_filterR, longParameter, new Long(23), new Float(23.0f), false, 7); run_FloatQuery(Float_filterL, LongParameter, new Long(34), new Float(34.0f), true, 3); run_FloatQuery(Float_filterR, LongParameter, new Long(100), new Float(100.0f), false, 7); run_FloatQuery(Float_filterL, doubleParameter, new Double(50000000.0f), new Float(50000000.0f), true, 8); run_FloatQuery(Float_filterR, doubleParameter, new Double(100.0f), new Float(100.0f), false, 7); run_FloatQuery(Float_filterL, DoubleParameter, new Double(0.0f), new Float(0.0f), true, 3); run_FloatQuery(Float_filterR, DoubleParameter, new Double(100.0f), new Float(100.0f), false, 7); run_FloatQuery(Float_filterL, BigIntegerParameter, new BigInteger("55000000"), new Float(55000000.0f), true, 8); run_FloatQuery(Float_filterR, BigIntegerParameter, new BigInteger("23"), new Float(23.0f), false, 7); run_FloatQuery(Float_filterL, BigDecimalParameter, new BigDecimal("55000000.0"), new Float(55000000.0f), true, 8); run_FloatQuery(Float_filterR, BigDecimalParameter, new BigDecimal("-20.5"), new Float(-20.5f), false, 8); alltypes.setFloat(new Float(23.23f)); run_FloatQuery(Float_filterObj, AllTypesParameter, alltypes, new Float(23.23f), false, 7); run_FloatQuery(Float_filterVal, null, null, new Float(100.0f), true, 5); run_DoubleQuery(Double_filterL, doubleParameter, new Double(-999999999999.0), new Double(-999999999999.0), true, 1); run_DoubleQuery(Double_filterR, doubleParameter, new Double(9999999999999.0), new Double(9999999999999.0), false, 1); run_DoubleQuery(Double_filterL, DoubleParameter, new Double(0.0), new Double(0.0), true, 4); run_DoubleQuery(Double_filterR, DoubleParameter, new Double(23.34), new Double(23.34), false, 6); run_DoubleQuery(Double_filterL, byteParameter, new Byte((byte)100), new Double(100.0), true, 6); run_DoubleQuery(Double_filterR, byteParameter, new Byte((byte)0), new Double(0.0), false, 7); run_DoubleQuery(Double_filterL, ByteParameter, new Byte((byte)-23), new Double(-23.0), true, 3); run_DoubleQuery(Double_filterR, ByteParameter, new Byte((byte)100), new Double(100.0), false, 6); run_DoubleQuery(Double_filterL, shortParameter, new Short((short)100), new Double(100.0), true, 6); run_DoubleQuery(Double_filterR, shortParameter, new Short((short)0), new Double(0.0), false, 7); run_DoubleQuery(Double_filterL, ShortParameter, new Short((short)23), new Double(23.0), true, 4); run_DoubleQuery(Double_filterR, ShortParameter, new Short((short)400), new Double(400.0), false, 3); run_DoubleQuery(Double_filterL, charParameter, new Character((char)100), new Double(100.0), true, 6); run_DoubleQuery(Double_filterR, charParameter, new Character((char)0), new Double(0.0), false, 7); run_DoubleQuery(Double_filterL, CharacterParameter, new Character((char)23), new Double(23.0), true, 4); run_DoubleQuery(Double_filterR, CharacterParameter, new Character((char)400), new Double(400.0), false, 3); run_DoubleQuery(Double_filterL, intParameter, new Integer(100), new Double(100.0), true, 6); run_DoubleQuery(Double_filterR, intParameter, new Integer(0), new Double(0.0), false, 7); run_DoubleQuery(Double_filterL, IntegerParameter, new Integer(23), new Double(23.0), true, 4); run_DoubleQuery(Double_filterR, IntegerParameter, new Integer(100), new Double(100.0), false, 6); run_DoubleQuery(Double_filterL, longParameter, new Long(100), new Double(100.0), true, 6); run_DoubleQuery(Double_filterR, longParameter, new Long(0), new Double(0.0), false, 7); run_DoubleQuery(Double_filterL, LongParameter, new Long(23), new Double(23.0), true, 4); run_DoubleQuery(Double_filterR, LongParameter, new Long(100), new Double(100.0), false, 6); run_DoubleQuery(Double_filterL, floatParameter, new Float(0.0f), new Double(0.0f), true, 4); run_DoubleQuery(Double_filterR, floatParameter, new Float(100.0f), new Double(100.0f), false, 6); run_DoubleQuery(Double_filterL, FloatParameter, new Float(100.0f), new Double(100.0f), true, 6); run_DoubleQuery(Double_filterR, FloatParameter, new Float(69.96f), new Double(69.96), false, 6); run_DoubleQuery(Double_filterL, BigIntegerParameter, new BigInteger("5000"), new Double(5000.0), true, 7); run_DoubleQuery(Double_filterR, BigIntegerParameter, new BigInteger("-20"), new Double(-20.0), false, 7); run_DoubleQuery(Double_filterL, BigDecimalParameter, new BigDecimal("100.0"), new Double(100.0), true, 6); run_DoubleQuery(Double_filterR, BigDecimalParameter, new BigDecimal("69.96"), new Double(69.96), false, 6); alltypes.setDouble(new Double(-999999999999.0)); run_DoubleQuery(Double_filterObj, AllTypesParameter, alltypes, new Double(-999999999999.0), true, 1); run_DoubleQuery(Double_filterVal, null, null, new Double(100.0), false, 6); run_StringQuery(String_filterL, StringParameter, new String("JDO"), new String("JDO"), true, 2); run_StringQuery(String_filterR, StringParameter, new String("JDBC"), new String("JDBC"), false, 9); alltypes.setString(new String("abcde")); run_StringQuery(String_filterObj, AllTypesParameter, alltypes, new String("abcde"), true, 8); run_StringQuery(String_filterVal1, null, null, new String("Java"), false, 6); run_StringQuery(String_filterVal2, null, null, new String(""), false, 10); BigDecimal bd = new BigDecimal("100.0"); run_BigDecimalQuery(BigDecimal_filterL, BigDecimalParameter, bd, bd, true, 6); bd = new BigDecimal("-234234.23333"); run_BigDecimalQuery(BigDecimal_filterR, BigDecimalParameter, bd, bd, false, 9); bd = new BigDecimal("989899.33304953"); run_BigDecimalQuery(BigDecimal_filterL, BigDecimalParameter, bd, bd, true, 7); bd = new BigDecimal("-1123123.22"); run_BigDecimalQuery(BigDecimal_filterR, BigDecimalParameter, bd, bd, false, 10); alltypes.setBigDecimal(bd); run_BigDecimalQuery(BigDecimal_filterObj, AllTypesParameter, alltypes, bd, true, 1); BigInteger bi = new BigInteger("987034534985043985"); run_BigIntegerQuery(BigInteger_filterL, BigIntegerParameter, bi, bi, true, 10); bi = new BigInteger("-999999999999999999"); run_BigIntegerQuery(BigInteger_filterR, BigIntegerParameter, bi, bi, false, 10); bi = new BigInteger("-9999999999999999999"); run_BigIntegerQuery(BigInteger_filterR, BigIntegerParameter, bi, bi, false, 10); bi = new BigInteger("1333330"); alltypes.setBigInteger(bi); run_BigIntegerQuery(BigInteger_filterObj, AllTypesParameter, alltypes, bi, false, 3); GregorianCalendar gc = new GregorianCalendar(TimeZone.getTimeZone("GMT"), Locale.UK); gc.clear(); gc.set(1999, Calendar.DECEMBER, 31, 9, 0, 0); Date d = gc.getTime(); run_DateQuery(Date_filterL, DateParameter, d, d, true, 8); gc.set(1992, Calendar.NOVEMBER, 22, 9, 0, 0); d = gc.getTime(); run_DateQuery(Date_filterR, DateParameter, d, d, false, 5); gc.set(1959, Calendar.OCTOBER, 9, 9, 0, 0); d = gc.getTime(); run_DateQuery(Date_filterR, DateParameter, d, d, false, 7); gc.set(1995, Calendar.JUNE, 14, 9, 0, 0); d = gc.getTime(); alltypes.setDate(d); run_DateQuery(Date_filterObj, AllTypesParameter, alltypes, d, false, 4); } private void run_byteQuery(String filter, String parameter, Object parameterValue, byte value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); byte val = obj.getbyte(); boolean correct_value = valueOnLeft ? value >= val : val >= value; if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL GreaterThanOrEqual test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL GreaterThanOrEqual test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_shortQuery(String filter, String parameter, Object parameterValue, short value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); short val = obj.getshort(); boolean correct_value = valueOnLeft ? value >= val : val >= value; if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL GreaterThanOrEqual test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL GreaterThanOrEqual test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_charQuery(String filter, String parameter, Object parameterValue, char value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); char val = obj.getchar(); boolean correct_value = valueOnLeft ? value >= val : val >= value; if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL GreaterThanOrEqual test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL GreaterThanOrEqual test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_intQuery(String filter, String parameter, Object parameterValue, int value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); int val = obj.getint(); boolean correct_value = valueOnLeft ? value >= val : val >= value; if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL GreaterThanOrEqual test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL GreaterThanOrEqual test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_longQuery(String filter, String parameter, Object parameterValue, long value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); long val = obj.getlong(); boolean correct_value = valueOnLeft ? value >= val : val >= value; if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL GreaterThanOrEqual test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL GreaterThanOrEqual test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_floatQuery(String filter, String parameter, Object parameterValue, float value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); float val = obj.getfloat(); boolean correct_value = valueOnLeft ? value >= val : val >= value; if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL GreaterThanOrEqual test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL GreaterThanOrEqual test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_doubleQuery(String filter, String parameter, Object parameterValue, double value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); double val = obj.getdouble(); boolean correct_value = valueOnLeft ? value >= val : val >= value; if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL GreaterThanOrEqual test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL GreaterThanOrEqual test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_ByteQuery(String filter, String parameter, Object parameterValue, Byte value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); Byte val = obj.getByte(); boolean correct_value = valueOnLeft ? (value.compareTo(val) >= 0) : (val.compareTo(value) >= 0); if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL GreaterThanOrEqual test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL GreaterThanOrEqual test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_ShortQuery(String filter, String parameter, Object parameterValue, Short value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); Short val = obj.getShort(); boolean correct_value = valueOnLeft ? (value.compareTo(val) >= 0) : (val.compareTo(value) >= 0); if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL GreaterThanOrEqual test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL GreaterThanOrEqual test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_CharacterQuery(String filter, String parameter, Object parameterValue, Character value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); Character val = obj.getCharacter(); boolean correct_value = valueOnLeft ? (value.compareTo(val) >= 0) : (val.compareTo(value) >= 0); if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL GreaterThanOrEqual test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL GreaterThanOrEqual test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_IntegerQuery(String filter, String parameter, Object parameterValue, Integer value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); Integer val = obj.getInteger(); boolean correct_value = valueOnLeft ? (value.compareTo(val) >= 0) : (val.compareTo(value) >= 0); if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL GreaterThanOrEqual test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL GreaterThanOrEqual test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_LongQuery(String filter, String parameter, Object parameterValue, Long value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); Long val = obj.getLong(); boolean correct_value = valueOnLeft ? (value.compareTo(val) >= 0) : (val.compareTo(value) >= 0); if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL GreaterThanOrEqual test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL GreaterThanOrEqual test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_FloatQuery(String filter, String parameter, Object parameterValue, Float value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); Float val = obj.getFloat(); boolean correct_value = valueOnLeft ? (value.compareTo(val) >= 0) : (val.compareTo(value) >= 0); if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL GreaterThanOrEqual test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL GreaterThanOrEqual test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_DoubleQuery(String filter, String parameter, Object parameterValue, Double value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); Double val = obj.getDouble(); boolean correct_value = valueOnLeft ? (value.compareTo(val) >= 0) : (val.compareTo(value) >= 0); if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL GreaterThanOrEqual test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL GreaterThanOrEqual test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_StringQuery(String filter, String parameter, Object parameterValue, String value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); String val = obj.getString(); boolean correct_value = valueOnLeft ? (value.compareTo(val) >= 0) : (val.compareTo(value) >= 0); if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL GreaterThanOrEqual test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL GreaterThanOrEqual test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_BigDecimalQuery(String filter, String parameter, Object parameterValue, BigDecimal value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); BigDecimal val = obj.getBigDecimal(); boolean correct_value = valueOnLeft ? (value.compareTo(val) >= 0) : (val.compareTo(value) >= 0); if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL GreaterThanOrEqual test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL GreaterThanOrEqual test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_BigIntegerQuery(String filter, String parameter, Object parameterValue, BigInteger value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); BigInteger val = obj.getBigInteger(); boolean correct_value = valueOnLeft ? (value.compareTo(val) >= 0) : (val.compareTo(value) >= 0); if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL GreaterThanOrEqual test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL GreaterThanOrEqual test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_DateQuery(String filter, String parameter, Object parameterValue, Date value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); Date val = obj.getDate(); boolean correct_value = valueOnLeft ? (value.compareTo(val) >= 0) : (val.compareTo(value) >= 0); if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL GreaterThanOrEqual test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL GreaterThanOrEqual test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } /** */ protected void localSetUp() { addTearDownClass(AllTypes.class); AllTypes.load(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/operators/Instanceof.java100664 7373 12500110373 26167 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.operators; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Instanceof operator. *
*Keywords: query *
*Assertion ID: A14.6.2-41. *
*Assertion Description: * instanceof operator */ public class Instanceof extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-41 (Instanceof) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ "mentor instanceof " + "org.apache.jdo.tck.pc.company.PartTimeEmployee", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ "mentor instanceof PartTimeEmployee", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ "import org.apache.jdo.tck.pc.company.PartTimeEmployee", /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** * The expected results of valid queries. */ private Object[] expectedResult = { getTransientCompanyModelInstancesAsList(new String[]{"emp2", "emp3"}), getTransientCompanyModelInstancesAsList(new String[]{"emp2", "emp3"}) }; /** * The main 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(Instanceof.class); } /** */ public void testPositive() { for (int i = 0; i < VALID_QUERIES.length; i++) { executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/operators/LessThan.java100664 241252 12500110373 25653 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.operators; import java.math.BigDecimal; import java.math.BigInteger; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; import java.util.Iterator; import java.util.Locale; import java.util.TimeZone; import org.apache.jdo.tck.pc.fieldtypes.AllTypes; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Less Than Query Operator *
*Keywords: query *
*Assertion ID: A14.6.2-17. *
*Assertion Description: The less than operator (<) is supported for all types as they are defined in the Java language. This includes the following types:
  • byte, short, int, long, char, Byte, Short Integer, Long, Character
  • float, double, Float, Double
  • BigDecimal, BigInteger
  • Date, String
The operation on object-valued fields of wrapper types (Boolean, Byte, Short, Integer, Long, Float, and Double), and numeric types (BigDecimal and BigInteger) use the wrapped values as operands. */ public class LessThan extends ComparisonTests { private static String boolean_filterL = "value < fld_boolean"; private static String boolean_filterR = "fld_boolean < value"; private static String boolean_filterT = "fld_boolean < true"; private static String boolean_filterF = "false < fld_boolean"; private static String boolean_filterObj = "value.fld_boolean < fld_boolean"; private static String byte_filterL = "value < fld_byte"; private static String byte_filterR = "fld_byte < value"; private static String byte_filterObj = "value.fld_byte < fld_byte"; private static String byte_filterVal = "fld_byte < 100"; private static String char_filterL = "value < fld_char"; private static String char_filterR = "fld_char < value"; private static String char_filterObj = "value.fld_char < fld_char"; private static String char_filterVal = "'M' < fld_char"; private static String double_filterL = "value < fld_double"; private static String double_filterR = "fld_double < value"; private static String double_filterObj = "value.fld_double < fld_double"; private static String double_filterVal = "fld_double < 100.0"; private static String float_filterL = "value < fld_float"; private static String float_filterR = "fld_float < value"; private static String float_filterObj = "fld_float < value.fld_float"; private static String float_filterVal = "fld_float < 100.0"; private static String int_filterL = "value < fld_int"; private static String int_filterR = "fld_int < value"; private static String int_filterObj = "value.fld_int < fld_int"; private static String int_filterVal = "fld_int < 1000"; private static String long_filterL = "value < fld_long"; private static String long_filterR = "fld_long < value"; private static String long_filterObj = "fld_long < value.fld_long"; private static String long_filterVal = "fld_long < 1000000"; private static String short_filterL = "value < fld_short"; private static String short_filterR = "fld_short < value"; private static String short_filterObj = "value.fld_short < fld_short"; private static String short_filterVal = "1000 < fld_short"; private static String Boolean_filterL = "value < fld_Boolean"; private static String Boolean_filterR = "fld_Boolean < value"; private static String Boolean_filterT = "fld_Boolean < true"; private static String Boolean_filterF = "false < fld_Boolean"; private static String Boolean_filterObj = "value.fld_Boolean < fld_Boolean"; private static String Boolean_filterVal = "fld_Boolean < false"; private static String Byte_filterL = "value < fld_Byte"; private static String Byte_filterR = "fld_Byte < value"; private static String Byte_filterObj = "fld_Byte < value.fld_Byte"; private static String Byte_filterVal = "100 < fld_Byte"; private static String Character_filterL = "value < fld_Character"; private static String Character_filterR = "fld_Character < value"; private static String Character_filterObj = "value.fld_Character < fld_Character"; private static String Character_filterVal = "fld_Character < 'z'"; private static String Double_filterL = "value < fld_Double"; private static String Double_filterR = "fld_Double < value"; private static String Double_filterObj = "value.fld_Double < fld_Double"; private static String Double_filterVal = "fld_Double < 100.0"; private static String Float_filterL = "value < fld_Float"; private static String Float_filterR = "fld_Float < value"; private static String Float_filterObj = "fld_Float < value.fld_Float"; private static String Float_filterVal = "100.0f < fld_Float"; private static String Integer_filterL = "value < fld_Integer"; private static String Integer_filterR = "fld_Integer < value"; private static String Integer_filterObj = "fld_Integer < value.fld_Integer"; private static String Integer_filterVal = "fld_Integer < 100"; private static String Long_filterL = "value < fld_Long"; private static String Long_filterR = "fld_Long < value"; private static String Long_filterObj = "value.fld_Long < fld_Long"; private static String Long_filterVal = "-1000 < fld_Long"; private static String Short_filterL = "value < fld_Short"; private static String Short_filterR = "fld_Short < value"; private static String Short_filterObj = "fld_Short < value.fld_Short"; private static String Short_filterVal = "-1000 < fld_Short"; private static String String_filterL = "value < fld_String"; private static String String_filterR = "fld_String < value"; private static String String_filterObj = "value.fld_String < fld_String"; private static String String_filterVal1 = "fld_String < \"Java\""; private static String String_filterVal2 = "fld_String < \"\""; private static String Date_filterL = "value < fld_Date"; private static String Date_filterR = "fld_Date < value"; private static String Date_filterObj = "fld_Date < value.fld_Date"; private static String BigDecimal_filterL = "value < fld_BigDecimal"; private static String BigDecimal_filterR = "fld_BigDecimal < value"; private static String BigDecimal_filterObj = "value.fld_BigDecimal < fld_BigDecimal"; private static String BigInteger_filterL = "value < fld_BigInteger"; private static String BigInteger_filterR = "fld_BigInteger < value"; private static String BigInteger_filterObj = "fld_BigInteger < value.fld_BigInteger"; /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-17 (LessThan) failed: "; /** * The main 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(LessThan.class); } /** */ public void test() { pm = getPM(); tx = pm.currentTransaction(); runQueries(); } /** */ private void runQueries() { AllTypes alltypes = new AllTypes(); run_byteQuery(byte_filterL, byteParameter, new Byte((byte)0), (byte)0, true, 6); run_byteQuery(byte_filterR, byteParameter, new Byte(Byte.MIN_VALUE), Byte.MIN_VALUE, false, 0); run_byteQuery(byte_filterL, ByteParameter, new Byte((byte)50), (byte)50, true, 3); run_byteQuery(byte_filterR, ByteParameter, new Byte(Byte.MAX_VALUE), Byte.MAX_VALUE, false, 9); run_byteQuery(byte_filterL, shortParameter, new Short((short)75), (byte)75, true, 2); run_byteQuery(byte_filterR, shortParameter, new Short((short)75), (byte)75, false, 7); run_byteQuery(byte_filterL, ShortParameter, new Short((short)10), (byte)10, true, 5); run_byteQuery(byte_filterR, ShortParameter, new Short((short)25), (byte)25, false, 5); run_byteQuery(byte_filterL, charParameter, new Character((char)101), (byte)101, true, 1); run_byteQuery(byte_filterR, charParameter, new Character((char)50), (byte)50, false, 5); run_byteQuery(byte_filterL, CharacterParameter, new Character((char)0), (byte)0, true, 6); run_byteQuery(byte_filterR, CharacterParameter, new Character((char)0), (byte)0, false, 3); run_byteQuery(byte_filterL, intParameter, new Integer(25), (byte)25, true, 5); run_byteQuery(byte_filterR, intParameter, new Integer(50), (byte)50, false, 5); run_byteQuery(byte_filterL, IntegerParameter, new Integer(-10), (byte)-10, true, 7); run_byteQuery(byte_filterR, IntegerParameter, new Integer(-100), (byte)-100, false, 1); run_byteQuery(byte_filterL, longParameter, new Long(50), (byte)50, true, 3); run_byteQuery(byte_filterR, longParameter, new Long(60), (byte)60, false, 7); run_byteQuery(byte_filterL, LongParameter, new Long(-100), (byte)-100, true, 8); run_byteQuery(byte_filterR, LongParameter, new Long(-100), (byte)-100, false, 1); run_byteQuery(byte_filterL, floatParameter, new Float(51), (byte)51, true, 3); run_byteQuery(byte_filterR, floatParameter, new Float(-20), (byte)-20, false, 2); run_byteQuery(byte_filterL, FloatParameter, new Float(-99), (byte)-99, true, 8); run_byteQuery(byte_filterR, FloatParameter, new Float(-100), (byte)-100, false, 1); run_byteQuery(byte_filterL, doubleParameter, new Double(50), (byte)50, true, 3); run_byteQuery(byte_filterR, doubleParameter, new Double(60), (byte)60, false, 7); run_byteQuery(byte_filterL, DoubleParameter, new Double(Byte.MAX_VALUE), Byte.MAX_VALUE, true, 0); run_byteQuery(byte_filterR, DoubleParameter, new Double(25), (byte)25, false, 5); run_byteQuery(byte_filterL, BigIntegerParameter, new BigInteger("50"), (byte)50, true, 3); run_byteQuery(byte_filterR, BigIntegerParameter, new BigInteger("-100"), (byte)-100, false, 1); run_byteQuery(byte_filterL, BigDecimalParameter, new BigDecimal("50.000000"), (byte)50, true, 3); run_byteQuery(byte_filterR, BigDecimalParameter, new BigDecimal("10.00000"), (byte)10, false, 4); alltypes.setbyte((byte)50); run_byteQuery(byte_filterObj, AllTypesParameter, alltypes, (byte)50, true, 3); alltypes.setbyte((byte)55); run_byteQuery(byte_filterObj, AllTypesParameter, alltypes, (byte)55, true, 3); run_byteQuery(byte_filterVal, null, null, (byte)100, false, 8); run_shortQuery(short_filterL, shortParameter, new Short((short)100), (short)100, true, 3); run_shortQuery(short_filterR, shortParameter, new Short((short)100), (short)100, false, 5); run_shortQuery(short_filterL, ShortParameter, new Short(Short.MIN_VALUE), Short.MIN_VALUE, true, 9); run_shortQuery(short_filterR, ShortParameter, new Short((short)253), (short)253, false, 7); run_shortQuery(short_filterR, shortParameter, new Short((short)1000), (short)1000, false, 7); run_shortQuery(short_filterL, byteParameter, new Byte((byte)75), (short)75, true, 5); run_shortQuery(short_filterR, byteParameter, new Byte((byte)-75), (short)-75, false, 4); run_shortQuery(short_filterL, ByteParameter, new Byte((byte)100), (short)100, true, 3); run_shortQuery(short_filterR, ByteParameter, new Byte((byte)100), (short)100, false, 5); run_shortQuery(short_filterL, charParameter, new Character((char)75), (short)75, true, 5); run_shortQuery(short_filterR, charParameter, new Character((char)9999), (short)9999, false, 8); run_shortQuery(short_filterL, CharacterParameter, new Character((char)1000), (short)1000, true, 2); run_shortQuery(short_filterR, CharacterParameter, new Character((char)10000), (short)10000, false, 8); run_shortQuery(short_filterL, intParameter, new Integer(-10000), (short)-10000, true, 8); run_shortQuery(short_filterR, intParameter, new Integer(-10000), (short)-10000, false, 1); run_shortQuery(short_filterL, IntegerParameter, new Integer(10000), (short)10000, true, 1); run_shortQuery(short_filterR, IntegerParameter, new Integer(30000), (short)30000, false, 9); run_shortQuery(short_filterL, longParameter, new Long(10000), (short) 10000, true, 1); run_shortQuery(short_filterR, longParameter, new Long(Short.MAX_VALUE), Short.MAX_VALUE, false, 9); run_shortQuery(short_filterL, LongParameter, new Long(Short.MAX_VALUE), Short.MAX_VALUE, true, 0); run_shortQuery(short_filterR, LongParameter, new Long(100), (short)100, false, 5); run_shortQuery(short_filterL, floatParameter, new Float(23000), (short)23000, true, 1); run_shortQuery(short_filterR, floatParameter, new Float(23000), (short)23000, false, 9); run_shortQuery(short_filterL, FloatParameter, new Float(-1000), (short)-1000, true, 7); run_shortQuery(short_filterR, FloatParameter, new Float(100), (short)100, false, 5); run_shortQuery(short_filterL, doubleParameter, new Double(-10000.0), (short)-10000, true, 8); run_shortQuery(short_filterR, doubleParameter, new Double(9999.0), (short)9999, false, 8); run_shortQuery(short_filterL, DoubleParameter, new Double(23.0), (short)23, true, 5); run_shortQuery(short_filterR, DoubleParameter, new Double(23.0), (short)23, false, 5); run_shortQuery(short_filterL, BigIntegerParameter, new BigInteger("10000"), (short)10000, true, 1); run_shortQuery(short_filterR, BigIntegerParameter, new BigInteger("30000"), (short)30000, false, 9); run_shortQuery(short_filterL, BigDecimalParameter, new BigDecimal("23.0"), (short)23, true, 5); run_shortQuery(short_filterR, BigDecimalParameter, new BigDecimal("23.0"), (short)23, false, 5); alltypes.setshort((short)100); run_shortQuery(short_filterObj, AllTypesParameter, alltypes, (short)100, true, 3); alltypes.setshort((short)23); run_shortQuery(short_filterObj, AllTypesParameter, alltypes, (short)23, true, 5); run_shortQuery(short_filterVal, null, null, (short)1000, true, 2); run_charQuery(char_filterL, charParameter, new Character(Character.MIN_VALUE), Character.MIN_VALUE, true, 9); run_charQuery(char_filterR, charParameter, new Character(Character.MAX_VALUE), Character.MAX_VALUE, false, 9); run_charQuery(char_filterL, charParameter, new Character('C'), 'C', true, 6); run_charQuery(char_filterR, charParameter, new Character('z'), 'z', false, 7); run_charQuery(char_filterL, CharacterParameter, new Character(' '), ' ', true, 8); run_charQuery(char_filterR, CharacterParameter, new Character('f'), 'f', false, 7); run_charQuery(char_filterL, byteParameter, new Byte((byte)Character.MIN_VALUE), (char)Character.MIN_VALUE, true, 9); run_charQuery(char_filterR, ByteParameter, new Byte((byte)'a'), 'a', false, 7); run_charQuery(char_filterL, shortParameter, new Short((short)'M'), 'M', true, 3); run_charQuery(char_filterR, shortParameter, new Short((short)'M'), 'M', false, 5); run_charQuery(char_filterL, ShortParameter, new Short((short)'A'), 'A', true, 7); run_charQuery(char_filterR, ShortParameter, new Short((short)'A'), 'A', false, 2); run_charQuery(char_filterL, intParameter, new Integer('z'), 'z', true, 1); run_charQuery(char_filterR, intParameter, new Integer('z'), 'z', false, 7); run_charQuery(char_filterL, IntegerParameter, new Integer('B'), 'B', true, 6); run_charQuery(char_filterR, IntegerParameter, new Integer('B'), 'B', false, 3); run_charQuery(char_filterL, floatParameter, new Float('f'), 'f', true, 3); run_charQuery(char_filterR, floatParameter, new Float(' '), ' ', false, 1); run_charQuery(char_filterL, FloatParameter, new Float('z'), 'z', true, 1); run_charQuery(char_filterR, FloatParameter, new Float('z'), 'z', false, 7); run_charQuery(char_filterL, doubleParameter, new Double('B'), 'B', true, 6); run_charQuery(char_filterR, doubleParameter, new Double('B'), 'B', false, 3); run_charQuery(char_filterL, DoubleParameter, new Double('A'), 'A', true, 7); run_charQuery(char_filterR, DoubleParameter, new Double('A'), 'A', false, 2); run_charQuery(char_filterL, BigIntegerParameter, new BigInteger("65"), 'A', true, 7); // 'A' == 65 run_charQuery(char_filterR, BigIntegerParameter, new BigInteger("122"), 'z', false, 7); // 'z' == 122 run_charQuery(char_filterL, BigDecimalParameter, new BigDecimal("65.00000"), 'A', true, 7); run_charQuery(char_filterR, BigDecimalParameter, new BigDecimal("77.0000"), 'M', false, 5); // 'M' == 77 alltypes.setchar('A'); run_charQuery(char_filterObj, AllTypesParameter, alltypes, 'A', true, 7); alltypes.setchar('b'); run_charQuery(char_filterObj, AllTypesParameter, alltypes, 'b', true, 3); run_charQuery(char_filterVal, null, null, 'M', true, 3); run_intQuery(int_filterL, intParameter, new Integer(AllTypes.veryLargeNegativeInt), AllTypes.veryLargeNegativeInt, true, 9); run_intQuery(int_filterR, intParameter, new Integer(AllTypes.veryLargePositiveInt), AllTypes.veryLargePositiveInt, false, 9); run_intQuery(int_filterR, intParameter, new Integer(23), 23, false, 4); run_intQuery(int_filterL, IntegerParameter, new Integer(1000000), 1000000, true, 1); run_intQuery(int_filterR, IntegerParameter, new Integer(1000), 1000, false, 6); run_intQuery(int_filterL, byteParameter, new Byte((byte)100), 100, true, 4); run_intQuery(int_filterR, byteParameter, new Byte((byte)0), 0, false, 3); run_intQuery(int_filterL, ByteParameter, new Byte((byte)100), 100, true, 4); run_intQuery(int_filterR, ByteParameter, new Byte((byte)0), 0, false, 3); run_intQuery(int_filterL, shortParameter, new Short((short)10000), 10000, true, 2); run_intQuery(int_filterR, shortParameter, new Short((short)-1000), -1000, false, 2); run_intQuery(int_filterL, ShortParameter, new Short((short)-1000), -1000, true, 7); run_intQuery(int_filterR, ShortParameter, new Short((short)10000), 10000, false, 7); run_intQuery(int_filterL, charParameter, new Character((char)100), 100, true, 4); run_intQuery(int_filterR, charParameter, new Character((char)0), 0, false, 3); run_intQuery(int_filterL, CharacterParameter, new Character((char)100), 100, true, 4); run_intQuery(int_filterR, CharacterParameter, new Character((char)10000), 10000, false, 7); run_intQuery(int_filterL, longParameter, new Long(AllTypes.veryLargePositiveInt), AllTypes.veryLargePositiveInt, true, 0); run_intQuery(int_filterR, longParameter, new Long(AllTypes.veryLargeNegativeInt), AllTypes.veryLargeNegativeInt, false, 0); run_intQuery(int_filterL, LongParameter, new Long(10000), 10000, true, 2); run_intQuery(int_filterR, LongParameter, new Long(43), 43, false, 4); run_intQuery(int_filterL, floatParameter, new Float(AllTypes.veryLargePositiveInt), AllTypes.veryLargePositiveInt, true, 0); run_intQuery(int_filterR, floatParameter, new Float(AllTypes.veryLargeNegativeInt), AllTypes.veryLargeNegativeInt, false, 0); run_intQuery(int_filterL, FloatParameter, new Float(10000), 10000, true, 2); run_intQuery(int_filterR, FloatParameter, new Float(43), 43, false, 4); run_intQuery(int_filterL, doubleParameter, new Double(AllTypes.veryLargePositiveInt), AllTypes.veryLargePositiveInt, true, 0); run_intQuery(int_filterR, doubleParameter, new Double(AllTypes.veryLargeNegativeInt), AllTypes.veryLargeNegativeInt, false, 0); run_intQuery(int_filterL, DoubleParameter, new Double(10000), 10000, true, 2); run_intQuery(int_filterR, DoubleParameter, new Double(43), 43, false, 4); run_intQuery(int_filterL, BigIntegerParameter, new BigInteger("1000000"), 1000000, true, 1); run_intQuery(int_filterR, BigIntegerParameter, new BigInteger("1000"), 1000, false, 6); run_intQuery(int_filterL, BigDecimalParameter, new BigDecimal("10000.0"), 10000, true, 2); run_intQuery(int_filterR, BigDecimalParameter, new BigDecimal("43.0"), 43, false, 4); alltypes.setint(100); run_intQuery(int_filterObj, AllTypesParameter, alltypes, 100, true, 4); run_intQuery(int_filterVal, null, null, 1000, false, 6); run_longQuery(long_filterL, longParameter, new Long(Long.MIN_VALUE), Long.MIN_VALUE, true, 9); run_longQuery(long_filterR, longParameter, new Long(Long.MAX_VALUE), Long.MAX_VALUE, false, 9); run_longQuery(long_filterL, LongParameter, new Long(100), 100, true, 3); run_longQuery(long_filterR, LongParameter, new Long(23), 23, false, 5); run_longQuery(long_filterL, byteParameter, new Byte((byte)100), 100, true, 3); run_longQuery(long_filterR, byteParameter, new Byte((byte)0), 0, false, 4); run_longQuery(long_filterL, ByteParameter, new Byte((byte)100), 100, true, 3); run_longQuery(long_filterR, ByteParameter, new Byte((byte)0), 0, false, 4); run_longQuery(long_filterL, shortParameter, new Short((short)-1000), -1000, true, 6); run_longQuery(long_filterR, shortParameter, new Short((short)1000), 1000, false, 7); run_longQuery(long_filterL, ShortParameter, new Short((short)100), 100, true, 3); run_longQuery(long_filterR, ShortParameter, new Short((short)32), 32, false, 5); run_longQuery(long_filterL, charParameter, new Character((char)0), 0, true, 5); run_longQuery(long_filterR, charParameter, new Character((char)100), 100, false, 5); run_longQuery(long_filterL, CharacterParameter, new Character((char)23), 23, true, 5); run_longQuery(long_filterR, CharacterParameter, new Character((char)0), 0, false, 4); run_longQuery(long_filterL, intParameter, new Integer(100), 100, true, 3); run_longQuery(long_filterR, intParameter, new Integer(0), 0, false, 4); run_longQuery(long_filterL, IntegerParameter, new Integer(23), 23, true, 5); run_longQuery(long_filterR, IntegerParameter, new Integer(1000000), 1000000, false, 8); run_longQuery(long_filterL, floatParameter, new Float(-1000000.0), -1000000, true, 8); run_longQuery(long_filterR, floatParameter, new Float((float)Long.MAX_VALUE), Long.MAX_VALUE, false, 9); run_longQuery(long_filterL, FloatParameter, new Float(100.0), 100, true, 3); run_longQuery(long_filterR, FloatParameter, new Float(32.0), 32, false, 5); run_longQuery(long_filterL, doubleParameter, new Double(-1000000.0), -1000000, true, 8); run_longQuery(long_filterR, doubleParameter, new Double((double)Long.MAX_VALUE), Long.MAX_VALUE, false, 9); run_longQuery(long_filterL, DoubleParameter, new Double(100.0), 100, true, 3); run_longQuery(long_filterR, DoubleParameter, new Double(32.0), 32, false, 5); run_longQuery(long_filterL, BigIntegerParameter, new BigInteger("23"), 23, true, 5); run_longQuery(long_filterR, BigIntegerParameter, new BigInteger("1000000"), 1000000, false, 8); run_longQuery(long_filterL, BigDecimalParameter, new BigDecimal("100.0"), 100, true, 3); run_longQuery(long_filterR, BigDecimalParameter, new BigDecimal("32.0"), 32, false, 5); alltypes.setlong(100); run_longQuery(long_filterObj, AllTypesParameter, alltypes, 100, false, 5); run_longQuery(long_filterVal, null, null, 1000000, false, 8); run_floatQuery(float_filterL, floatParameter, new Float(AllTypes.FLOAT_SMALLEST), AllTypes.FLOAT_SMALLEST, true, 9); run_floatQuery(float_filterR, floatParameter, new Float(AllTypes.FLOAT_LARGEST), AllTypes.FLOAT_LARGEST, false, 9); run_floatQuery(float_filterL, FloatParameter, new Float(4.0f), 4.0f, true, 6); run_floatQuery(float_filterR, FloatParameter, new Float(400.0f), 400.0f, false, 7); run_floatQuery(float_filterL, byteParameter, new Byte((byte)4), 4.0f, true, 6); run_floatQuery(float_filterR, byteParameter, new Byte((byte)23), 23.0f, false, 4); run_floatQuery(float_filterL, ByteParameter, new Byte((byte)34), 34.0f, true, 6); run_floatQuery(float_filterR, ByteParameter, new Byte((byte)100), 100.0f, false, 4); run_floatQuery(float_filterL, shortParameter, new Short((short)10), 10.0f, true, 6); run_floatQuery(float_filterR, shortParameter, new Short((short)23), 23.0f, false, 4); run_floatQuery(float_filterL, ShortParameter, new Short((short)34), 34.0f, true, 6); run_floatQuery(float_filterR, ShortParameter, new Short((short)100), 100.0f, false, 4); run_floatQuery(float_filterL, charParameter, new Character((char)20), 20.0f, true, 6); run_floatQuery(float_filterR, charParameter, new Character((char)23), 23.0f, false, 4); run_floatQuery(float_filterL, CharacterParameter, new Character((char)34), 34.0f, true, 6); run_floatQuery(float_filterR, CharacterParameter, new Character((char)100), 100.0f, false, 4); run_floatQuery(float_filterL, intParameter, new Integer(55000000), 55000000.0f, true, 2); run_floatQuery(float_filterR, intParameter, new Integer(23), 23.0f, false, 4); run_floatQuery(float_filterL, IntegerParameter, new Integer(34), 34.0f, true, 6); run_floatQuery(float_filterR, IntegerParameter, new Integer(100), 100.0f, false, 4); run_floatQuery(float_filterL, longParameter, new Long(55000000), 55000000.0f, true, 2); run_floatQuery(float_filterR, longParameter, new Long(23), 23.0f, false, 4); run_floatQuery(float_filterL, LongParameter, new Long(34), 34.0f, true, 6); run_floatQuery(float_filterR, LongParameter, new Long(100), 100.0f, false, 4); run_floatQuery(float_filterL, doubleParameter, new Double(55000000.0), 55000000.0f, true, 2); run_floatQuery(float_filterR, doubleParameter, new Double(-20.5), -20.5f, false, 3); run_floatQuery(float_filterL, DoubleParameter, new Double(2.0), 2.0f, true, 6); run_floatQuery(float_filterR, DoubleParameter, new Double(100.0), 100.0f, false, 4); run_floatQuery(float_filterL, BigIntegerParameter, new BigInteger("55000000"), 55000000.0f, true, 2); run_floatQuery(float_filterR, BigIntegerParameter, new BigInteger("23"), 23.0f, false, 4); run_floatQuery(float_filterL, BigDecimalParameter, new BigDecimal("55000000.0"), 55000000.0f, true, 2); run_floatQuery(float_filterR, BigDecimalParameter, new BigDecimal("-20.5"), -20.5f, false, 3); alltypes.setfloat(23.23f); run_floatQuery(float_filterObj, AllTypesParameter, alltypes, 23.23f, false, 4); run_floatQuery(float_filterVal, null, null, 100.0f, false, 4); run_doubleQuery(double_filterL, doubleParameter, new Double(AllTypes.DOUBLE_SMALLEST), AllTypes.DOUBLE_SMALLEST, true, 9); run_doubleQuery(double_filterR, doubleParameter, new Double(AllTypes.DOUBLE_LARGEST), AllTypes.DOUBLE_LARGEST, false, 9); run_doubleQuery(double_filterL, DoubleParameter, new Double(0.0), 0.0, true, 6); run_doubleQuery(double_filterR, DoubleParameter, new Double(23.34), 23.34, false, 4); run_doubleQuery(double_filterL, byteParameter, new Byte((byte)100), 100.0, true, 4); run_doubleQuery(double_filterR, byteParameter, new Byte((byte)0), 0.0, false, 3); run_doubleQuery(double_filterL, ByteParameter, new Byte((byte)23), 23.0, true, 6); run_doubleQuery(double_filterR, ByteParameter, new Byte((byte)100), 100.0, false, 4); run_doubleQuery(double_filterL, charParameter, new Character((char)100), 100.0, true, 4); run_doubleQuery(double_filterR, charParameter, new Character((char)0), 0.0, false, 3); run_doubleQuery(double_filterL, CharacterParameter, new Character((char)23), 23.0, true, 6); run_doubleQuery(double_filterR, CharacterParameter, new Character((char)100), 100.0, false, 4); run_doubleQuery(double_filterL, shortParameter, new Short((short)100), 100.0, true, 4); run_doubleQuery(double_filterR, shortParameter, new Short((short)0), 0.0, false, 3); run_doubleQuery(double_filterL, ShortParameter, new Short((short)23), 23.0, true, 6); run_doubleQuery(double_filterR, ShortParameter, new Short((short)100), 100.0, false, 4); run_doubleQuery(double_filterL, intParameter, new Integer(100), 100.0, true, 4); run_doubleQuery(double_filterR, intParameter, new Integer(0), 0.0, false, 3); run_doubleQuery(double_filterL, IntegerParameter, new Integer(5000), 5000.0, true, 3); run_doubleQuery(double_filterR, IntegerParameter, new Integer(-20), -20.0, false, 3); run_doubleQuery(double_filterL, longParameter, new Long(100), 100.0, true, 4); run_doubleQuery(double_filterR, longParameter, new Long(0), 0.0, false, 3); run_doubleQuery(double_filterL, LongParameter, new Long(5000), 5000.0, true, 3); run_doubleQuery(double_filterR, LongParameter, new Long(-20), -20.0, false, 3); run_doubleQuery(double_filterL, floatParameter, new Float(0.0f), 0.0f, true, 6); run_doubleQuery(double_filterR, floatParameter, new Float(100.0f), 100.0f, false, 4); run_doubleQuery(double_filterL, FloatParameter, new Float(100.0f), 100.0, true, 4); run_doubleQuery(double_filterR, FloatParameter, new Float(69.96f), 69.96, false, 4); run_doubleQuery(double_filterL, BigIntegerParameter, new BigInteger("5000"), 5000.0, true, 3); run_doubleQuery(double_filterR, BigIntegerParameter, new BigInteger("-20"), -20.0, false, 3); run_doubleQuery(double_filterL, BigDecimalParameter, new BigDecimal("100.0"), 100.0, true, 4); run_doubleQuery(double_filterR, BigDecimalParameter, new BigDecimal("69.96"), 69.96, false, 4); alltypes.setdouble(-25.5); run_doubleQuery(double_filterObj, AllTypesParameter, alltypes, -25.5, true, 7); run_doubleQuery(double_filterVal, null, null, 100.0, false, 4); run_ByteQuery(Byte_filterL, byteParameter, new Byte((byte)50), new Byte((byte)50), true, 3); run_ByteQuery(Byte_filterR, byteParameter, new Byte(Byte.MIN_VALUE), new Byte(Byte.MIN_VALUE), false, 0); run_ByteQuery(Byte_filterL, ByteParameter, new Byte((byte)20), new Byte((byte)20), true, 5); run_ByteQuery(Byte_filterR, ByteParameter, new Byte(Byte.MAX_VALUE), new Byte(Byte.MAX_VALUE), false, 9); run_ByteQuery(Byte_filterL, shortParameter, new Short((short)60), new Byte((byte)60), true, 3); run_ByteQuery(Byte_filterR, shortParameter, new Short((short)51), new Byte((byte)51), false, 7); run_ByteQuery(Byte_filterL, ShortParameter, new Short((short)-100), new Byte((byte)-100), true, 8); run_ByteQuery(Byte_filterR, ShortParameter, new Short((short)-100), new Byte((byte)-100), false, 1); run_ByteQuery(Byte_filterL, charParameter, new Character((char)101), new Byte((byte)101), true, 1); run_ByteQuery(Byte_filterR, charParameter, new Character((char)10), new Byte((byte)10), false, 4); run_ByteQuery(Byte_filterL, CharacterParameter, new Character((char)50), new Byte((byte)50), true, 3); run_ByteQuery(Byte_filterR, CharacterParameter, new Character((char)75), new Byte((byte)75), false, 7); run_ByteQuery(Byte_filterL, intParameter, new Integer(77), new Byte((byte)77), true, 2); run_ByteQuery(Byte_filterR, intParameter, new Integer(60), new Byte((byte)60), false, 7); run_ByteQuery(Byte_filterL, IntegerParameter, new Integer(40), new Byte((byte)40), true, 5); run_ByteQuery(Byte_filterR, IntegerParameter, new Integer(75), new Byte((byte)75), false, 7); run_ByteQuery(Byte_filterL, longParameter, new Long(50), new Byte((byte)50), true, 3); run_ByteQuery(Byte_filterR, longParameter, new Long(50), new Byte((byte)50), false, 5); run_ByteQuery(Byte_filterL, LongParameter, new Long(-100), new Byte((byte)-100), true, 8); run_ByteQuery(Byte_filterR, LongParameter, new Long(-100), new Byte((byte)-100), false, 1); run_ByteQuery(Byte_filterL, floatParameter, new Float(50), new Byte((byte)50), true, 3); run_ByteQuery(Byte_filterR, floatParameter, new Float(50), new Byte((byte)50), false, 5); run_ByteQuery(Byte_filterL, FloatParameter, new Float(-100), new Byte((byte)-100), true, 8); run_ByteQuery(Byte_filterR, FloatParameter, new Float(-100), new Byte((byte)-100), false, 1); run_ByteQuery(Byte_filterL, doubleParameter, new Double(50), new Byte((byte)50), true, 3); run_ByteQuery(Byte_filterR, doubleParameter, new Double(50), new Byte((byte)50), false, 5); run_ByteQuery(Byte_filterL, DoubleParameter, new Double(-100), new Byte((byte)-100), true, 8); run_ByteQuery(Byte_filterR, DoubleParameter, new Double(-100), new Byte((byte)-100), false, 1); run_ByteQuery(Byte_filterL, BigIntegerParameter, new BigInteger("50"), new Byte((byte)50), true, 3); run_ByteQuery(Byte_filterR, BigIntegerParameter, new BigInteger("-100"), new Byte((byte)-100), false, 1); run_ByteQuery(Byte_filterL, BigDecimalParameter, new BigDecimal("50.000000"), new Byte((byte)50), true, 3); run_ByteQuery(Byte_filterR, BigDecimalParameter, new BigDecimal("10.000000"), new Byte((byte)10), false, 4); Byte val = new Byte((byte)50); alltypes.setByte(val); run_ByteQuery(Byte_filterObj, AllTypesParameter, alltypes, val, false, 5); val = new Byte((byte)51); alltypes.setByte(val); run_ByteQuery(Byte_filterObj, AllTypesParameter, alltypes, val, false, 7); run_ByteQuery(Byte_filterVal, null, null, new Byte((byte)100), true, 1); run_ShortQuery(Short_filterL, shortParameter, new Short((short)100), new Short((short)100), true, 3); run_ShortQuery(Short_filterR, shortParameter, new Short((short)100), new Short((short)100), false, 5); run_ShortQuery(Short_filterL, ShortParameter, new Short(Short.MIN_VALUE), new Short(Short.MIN_VALUE), true, 9); run_ShortQuery(Short_filterR, ShortParameter, new Short((short)253), new Short((short)253), false, 7); run_ShortQuery(Short_filterR, shortParameter, new Short((short)1000), new Short((short)1000), false, 7); run_ShortQuery(Short_filterL, byteParameter, new Byte((byte)75), new Short((short)75), true, 5); run_ShortQuery(Short_filterR, byteParameter, new Byte((byte)75), new Short((short)75), false, 5); run_ShortQuery(Short_filterL, ByteParameter, new Byte((byte)100), new Short((short)100), true, 3); run_ShortQuery(Short_filterR, ByteParameter, new Byte((byte)100), new Short((short)100), false, 5); run_ShortQuery(Short_filterL, charParameter, new Character((char)75), new Short((short)75), true, 5); run_ShortQuery(Short_filterR, charParameter, new Character((char)75), new Short((short)75), false, 5); run_ShortQuery(Short_filterL, CharacterParameter, new Character((char)100), new Short((short)100), true, 3); run_ShortQuery(Short_filterR, CharacterParameter, new Character((char)200), new Short((short)200), false, 7); run_ShortQuery(Short_filterL, intParameter, new Integer(-10000), new Short((short)-10000), true, 8); run_ShortQuery(Short_filterR, intParameter, new Integer(-10000), new Short((short)-10000), false, 1); run_ShortQuery(Short_filterL, IntegerParameter, new Integer(10000), new Short((short)10000), true, 1); run_ShortQuery(Short_filterR, IntegerParameter, new Integer(10000), new Short((short)10000), false, 8); run_ShortQuery(Short_filterL, longParameter, new Long(20000), new Short((short) 20000), true, 1); run_ShortQuery(Short_filterR, longParameter, new Long(5000), new Short((short) 5000), false, 8); run_ShortQuery(Short_filterL, LongParameter, new Long(200), new Short((short)200), true, 3); run_ShortQuery(Short_filterR, LongParameter, new Long(500), new Short((short)500), false, 7); run_ShortQuery(Short_filterL, floatParameter, new Float(23000.0f), new Short((short)23000), true, 1); run_ShortQuery(Short_filterR, floatParameter, new Float(23000.0f), new Short((short)23000), false, 9); run_ShortQuery(Short_filterL, FloatParameter, new Float(10.0f), new Short((short)10), true, 5); run_ShortQuery(Short_filterR, FloatParameter, new Float(101.0f), new Short((short)101), false, 7); run_ShortQuery(Short_filterL, doubleParameter, new Double(-10000.0), new Short((short)-10000), true, 8); run_ShortQuery(Short_filterR, doubleParameter, new Double(-10000.0), new Short((short)-10000), false, 1); run_ShortQuery(Short_filterL, DoubleParameter, new Double(101.0), new Short((short)101), true, 3); run_ShortQuery(Short_filterR, DoubleParameter, new Double(23.0), new Short((short)23), false, 5); run_ShortQuery(Short_filterL, BigIntegerParameter, new BigInteger("10000"), new Short((short)10000), true, 1); run_ShortQuery(Short_filterR, BigIntegerParameter, new BigInteger("30000"), new Short((short)30000), false, 9); run_ShortQuery(Short_filterL, BigDecimalParameter, new BigDecimal("23.0"), new Short((short)23), true, 5); run_ShortQuery(Short_filterR, BigDecimalParameter, new BigDecimal("23.0"), new Short((short)23), false, 5); Short sval = new Short((short)100); alltypes.setShort(sval); run_ShortQuery(Short_filterObj, AllTypesParameter, alltypes, sval, false, 5); sval = new Short((short)23); alltypes.setShort(sval); run_ShortQuery(Short_filterObj, AllTypesParameter, alltypes, sval, false, 5); run_ShortQuery(Short_filterVal, null, null, new Short((short)-1000), true, 7); run_CharacterQuery(Character_filterL, charParameter, new Character(Character.MIN_VALUE), new Character(Character.MIN_VALUE), true, 9); run_CharacterQuery(Character_filterR, charParameter, new Character(Character.MAX_VALUE), new Character(Character.MAX_VALUE), false, 9); run_CharacterQuery(Character_filterL, charParameter, new Character('C'), new Character('C'), true, 6); run_CharacterQuery(Character_filterR, charParameter, new Character('z'), new Character('z'), false, 7); run_CharacterQuery(Character_filterL, CharacterParameter, new Character(' '), new Character(' '), true, 8); run_CharacterQuery(Character_filterR, CharacterParameter, new Character('f'), new Character('f'), false, 7); run_CharacterQuery(Character_filterL, byteParameter, new Byte((byte)Character.MIN_VALUE), new Character((char)Character.MIN_VALUE), true, 9); run_CharacterQuery(Character_filterR, ByteParameter, new Byte((byte)'a'), new Character('a'), false, 7); run_CharacterQuery(Character_filterL, shortParameter, new Short((short)'M'), new Character('M'), true, 3); run_CharacterQuery(Character_filterR, shortParameter, new Short((short)'F'), new Character('F'), false, 4); run_CharacterQuery(Character_filterL, ShortParameter, new Short((short)'A'), new Character('A'), true, 7); run_CharacterQuery(Character_filterR, ShortParameter, new Short((short)'A'), new Character('A'), false, 2); run_CharacterQuery(Character_filterL, intParameter, new Integer('z'), new Character('z'), true, 1); run_CharacterQuery(Character_filterR, intParameter, new Integer('z'), new Character('z'), false, 7); run_CharacterQuery(Character_filterL, IntegerParameter, new Integer('B'), new Character('B'), true, 6); run_CharacterQuery(Character_filterR, IntegerParameter, new Integer('B'), new Character('B'), false, 3); run_CharacterQuery(Character_filterL, longParameter, new Long('z'), new Character('z'), true, 1); run_CharacterQuery(Character_filterR, longParameter, new Long('z'), new Character('z'), false, 7); run_CharacterQuery(Character_filterL, LongParameter, new Long('B'), new Character('B'), true, 6); run_CharacterQuery(Character_filterR, LongParameter, new Long('B'), new Character('B'), false, 3); run_CharacterQuery(Character_filterL, floatParameter, new Float('z'), new Character('z'), true, 1); run_CharacterQuery(Character_filterR, floatParameter, new Float('z'), new Character('z'), false, 7); run_CharacterQuery(Character_filterL, FloatParameter, new Float('M'), new Character('M'), true, 3); run_CharacterQuery(Character_filterR, FloatParameter, new Float('X'), new Character('X'), false, 7); run_CharacterQuery(Character_filterL, doubleParameter, new Double('B'), new Character('B'), true, 6); run_CharacterQuery(Character_filterR, doubleParameter, new Double('B'), new Character('B'), false, 3); run_CharacterQuery(Character_filterL, DoubleParameter, new Double('A'), new Character('A'), true, 7); run_CharacterQuery(Character_filterR, DoubleParameter, new Double('A'), new Character('A'), false, 2); run_CharacterQuery(Character_filterL, BigIntegerParameter, new BigInteger("65"), new Character('A'), true, 7); // 'A' == 65 run_CharacterQuery(Character_filterR, BigIntegerParameter, new BigInteger("122"), new Character('z'), false, 7); // 'z' == 122 run_CharacterQuery(Character_filterL, BigDecimalParameter, new BigDecimal("65.00000"), new Character('A'), true, 7); run_CharacterQuery(Character_filterR, BigDecimalParameter, new BigDecimal("77.0000"), new Character('M'), false, 5); // 'M' == 77 alltypes.setCharacter(new Character('A')); run_CharacterQuery(Character_filterObj, AllTypesParameter, alltypes, new Character('A'), true, 7); alltypes.setCharacter(new Character('b')); run_CharacterQuery(Character_filterObj, AllTypesParameter, alltypes, new Character('b'), true, 3); run_CharacterQuery(Character_filterVal, null, null, new Character('z'), false, 7); run_IntegerQuery(Integer_filterL, intParameter, new Integer(AllTypes.veryLargeNegativeInt), new Integer(AllTypes.veryLargeNegativeInt), true, 9); run_IntegerQuery(Integer_filterR, intParameter, new Integer(AllTypes.veryLargePositiveInt), new Integer(AllTypes.veryLargePositiveInt), false, 9); run_IntegerQuery(Integer_filterR, intParameter, new Integer(23), new Integer(23), false, 4); run_IntegerQuery(Integer_filterL, IntegerParameter, new Integer(1000000), new Integer(1000000), true, 1); run_IntegerQuery(Integer_filterR, IntegerParameter, new Integer(1000), new Integer(1000), false, 6); run_IntegerQuery(Integer_filterL, byteParameter, new Byte((byte)100), new Integer(100), true, 4); run_IntegerQuery(Integer_filterR, byteParameter, new Byte((byte)0), new Integer(0), false, 3); run_IntegerQuery(Integer_filterL, ByteParameter, new Byte((byte)100), new Integer(100), true, 4); run_IntegerQuery(Integer_filterR, ByteParameter, new Byte((byte)0), new Integer(0), false, 3); run_IntegerQuery(Integer_filterL, shortParameter, new Short((short)10000), new Integer(10000), true, 2); run_IntegerQuery(Integer_filterR, shortParameter, new Short((short)-1000), new Integer(-1000), false, 2); run_IntegerQuery(Integer_filterL, ShortParameter, new Short((short)-1000), new Integer(-1000), true, 7); run_IntegerQuery(Integer_filterR, ShortParameter, new Short((short)-999), new Integer(-999), false, 3); run_IntegerQuery(Integer_filterL, charParameter, new Character((char)10000), new Integer(10000), true, 2); run_IntegerQuery(Integer_filterR, charParameter, new Character((char)10000), new Integer(10000), false, 7); run_IntegerQuery(Integer_filterL, CharacterParameter, new Character((char)100), new Integer(100), true, 4); run_IntegerQuery(Integer_filterR, CharacterParameter, new Character((char)10000), new Integer(10000), false, 7); run_IntegerQuery(Integer_filterL, longParameter, new Long(AllTypes.veryLargePositiveInt), new Integer(AllTypes.veryLargePositiveInt), true, 0); run_IntegerQuery(Integer_filterR, longParameter, new Long(AllTypes.veryLargeNegativeInt), new Integer(AllTypes.veryLargeNegativeInt), false, 0); run_IntegerQuery(Integer_filterL, LongParameter, new Long(10000), new Integer(10000), true, 2); run_IntegerQuery(Integer_filterR, LongParameter, new Long(43), new Integer(43), false, 4); run_IntegerQuery(Integer_filterL, floatParameter, new Float(AllTypes.veryLargePositiveInt), new Integer(AllTypes.veryLargePositiveInt), true, 0); run_IntegerQuery(Integer_filterR, floatParameter, new Float(AllTypes.veryLargeNegativeInt), new Integer(AllTypes.veryLargeNegativeInt), false, 0); run_IntegerQuery(Integer_filterL, FloatParameter, new Float(10000), new Integer(10000), true, 2); run_IntegerQuery(Integer_filterR, FloatParameter, new Float(43), new Integer(43), false, 4); run_IntegerQuery(Integer_filterL, doubleParameter, new Double(AllTypes.veryLargePositiveInt), new Integer(AllTypes.veryLargePositiveInt), true, 0); run_IntegerQuery(Integer_filterR, doubleParameter, new Double(AllTypes.veryLargeNegativeInt), new Integer(AllTypes.veryLargeNegativeInt), false, 0); run_IntegerQuery(Integer_filterL, DoubleParameter, new Double(10000), new Integer(10000), true, 2); run_IntegerQuery(Integer_filterR, DoubleParameter, new Double(1000001.0), new Integer(1000001), false, 9); run_IntegerQuery(Integer_filterL, BigIntegerParameter, new BigInteger("1000000"), new Integer(1000000), true, 1); run_IntegerQuery(Integer_filterR, BigIntegerParameter, new BigInteger("1000"), new Integer(1000), false, 6); run_IntegerQuery(Integer_filterL, BigDecimalParameter, new BigDecimal("10000.0"), new Integer(10000), true, 2); run_IntegerQuery(Integer_filterR, BigDecimalParameter, new BigDecimal("43.0"), new Integer(43), false, 4); alltypes.setInteger(new Integer(100)); run_IntegerQuery(Integer_filterObj, AllTypesParameter, alltypes, new Integer(100), false, 4); run_IntegerQuery(Integer_filterVal, null, null, new Integer(100), false, 4); run_LongQuery(Long_filterL, longParameter, new Long(Long.MIN_VALUE), new Long(Long.MIN_VALUE), true, 9); run_LongQuery(Long_filterR, longParameter, new Long(Long.MAX_VALUE), new Long(Long.MAX_VALUE), false, 9); run_LongQuery(Long_filterL, LongParameter, new Long(100), new Long(100), true, 3); run_LongQuery(Long_filterR, LongParameter, new Long(23), new Long(23), false, 5); run_LongQuery(Long_filterL, byteParameter, new Byte((byte)100), new Long(100), true, 3); run_LongQuery(Long_filterR, byteParameter, new Byte((byte)0), new Long(0), false, 4); run_LongQuery(Long_filterL, ByteParameter, new Byte((byte)100), new Long(100), true, 3); run_LongQuery(Long_filterR, ByteParameter, new Byte((byte)0), new Long(0), false, 4); run_LongQuery(Long_filterL, shortParameter, new Short((short)-1000 ), new Long(-1000), true, 6); run_LongQuery(Long_filterR, shortParameter, new Short((short)1000), new Long(1000), false, 7); run_LongQuery(Long_filterL, ShortParameter, new Short((short)101), new Long(101), true, 3); run_LongQuery(Long_filterR, ShortParameter, new Short((short)32), new Long(32), false, 5); run_LongQuery(Long_filterL, charParameter, new Character((char)0), new Long(0), true, 5); run_LongQuery(Long_filterR, charParameter, new Character((char)100), new Long(100), false, 5); run_LongQuery(Long_filterL, CharacterParameter, new Character((char)23), new Long(23), true, 5); run_LongQuery(Long_filterR, CharacterParameter, new Character((char)1110), new Long(1110), false, 8); run_LongQuery(Long_filterL, intParameter, new Integer(100), new Long(100), true, 3); run_LongQuery(Long_filterR, intParameter, new Integer(0), new Long(0), false, 4); run_LongQuery(Long_filterL, IntegerParameter, new Integer(23), new Long(23), true, 5); run_LongQuery(Long_filterR, IntegerParameter, new Integer(1000000), new Long(1000000), false, 8); run_LongQuery(Long_filterL, floatParameter, new Float(-1000000.0), new Long(-1000000), true, 8); run_LongQuery(Long_filterR, floatParameter, new Float((float)Long.MAX_VALUE), new Long(Long.MAX_VALUE), false, 9); run_LongQuery(Long_filterL, FloatParameter, new Float(100.0f), new Long(100), true, 3); run_LongQuery(Long_filterR, FloatParameter, new Float(32.0f), new Long(32), false, 5); run_LongQuery(Long_filterL, doubleParameter, new Double(-1000000.0), new Long(-1000000), true, 8); run_LongQuery(Long_filterR, doubleParameter, new Double((double)Long.MAX_VALUE), new Long(Long.MAX_VALUE), false, 9); run_LongQuery(Long_filterL, DoubleParameter, new Double(100.0), new Long(100), true, 3); run_LongQuery(Long_filterR, DoubleParameter, new Double(32.0), new Long(32), false, 5); run_LongQuery(Long_filterL, BigIntegerParameter, new BigInteger("23"), new Long(23), true, 5); run_LongQuery(Long_filterR, BigIntegerParameter, new BigInteger("1000000"), new Long(1000000), false, 8); run_LongQuery(Long_filterL, BigDecimalParameter, new BigDecimal("100.0"), new Long(100), true, 3); run_LongQuery(Long_filterR, BigDecimalParameter, new BigDecimal("32.0"), new Long(32), false, 5); alltypes.setLong(new Long(100)); run_LongQuery(Long_filterObj, AllTypesParameter, alltypes, new Long(100), true, 3); run_LongQuery(Long_filterVal, null, null, new Long(-1000), true, 6); run_FloatQuery(Float_filterL, floatParameter, new Float(-10000000000.0f), new Float(-10000000000.0f), true, 9); run_FloatQuery(Float_filterR, floatParameter, new Float(9000000000.0f), new Float(9000000000.0f), false, 9); run_FloatQuery(Float_filterL, FloatParameter, new Float(0.0), new Float(0.0f), true, 7); run_FloatQuery(Float_filterR, FloatParameter, new Float(4.0), new Float(4.0f), false, 3); run_FloatQuery(Float_filterL, byteParameter, new Byte((byte)0), new Float(0.0f), true, 7); run_FloatQuery(Float_filterR, byteParameter, new Byte((byte)23), new Float(23.0f), false, 3); run_FloatQuery(Float_filterL, ByteParameter, new Byte((byte)34), new Float(34.0f), true, 7); run_FloatQuery(Float_filterR, ByteParameter, new Byte((byte)100), new Float(100.0f), false, 3); run_FloatQuery(Float_filterL, shortParameter, new Short((short)0), new Float(0.0f), true, 7); run_FloatQuery(Float_filterR, shortParameter, new Short((short)23), new Float(23.0f), false, 3); run_FloatQuery(Float_filterL, ShortParameter, new Short((short)34), new Float(34.0f), true, 7); run_FloatQuery(Float_filterR, ShortParameter, new Short((short)100), new Float(100.0f), false, 3); run_FloatQuery(Float_filterL, charParameter, new Character((char)0), new Float(0.0f), true, 7); run_FloatQuery(Float_filterR, charParameter, new Character((char)23), new Float(23.0f), false, 3); run_FloatQuery(Float_filterL, CharacterParameter, new Character((char)34), new Float(34.0f), true, 7); run_FloatQuery(Float_filterR, CharacterParameter, new Character((char)100), new Float(100.0f), false, 3); run_FloatQuery(Float_filterL, intParameter, new Integer(50000000), new Float(50000000.0f), true, 2); run_FloatQuery(Float_filterR, intParameter, new Integer(23), new Float(23.0f), false, 3); run_FloatQuery(Float_filterL, IntegerParameter, new Integer(34), new Float(34.0f), true, 7); run_FloatQuery(Float_filterR, IntegerParameter, new Integer(100), new Float(100.0f), false, 3); run_FloatQuery(Float_filterL, longParameter, new Long(50000000), new Float(50000000.0f), true, 2); run_FloatQuery(Float_filterR, longParameter, new Long(23), new Float(23.0f), false, 3); run_FloatQuery(Float_filterL, LongParameter, new Long(34), new Float(34.0f), true, 7); run_FloatQuery(Float_filterR, LongParameter, new Long(100), new Float(100.0f), false, 3); run_FloatQuery(Float_filterL, doubleParameter, new Double(50000000.0f), new Float(50000000.0f), true, 2); run_FloatQuery(Float_filterR, doubleParameter, new Double(100.0f), new Float(100.0f), false, 3); run_FloatQuery(Float_filterL, DoubleParameter, new Double(0.0f), new Float(0.0f), true, 7); run_FloatQuery(Float_filterR, DoubleParameter, new Double(100.0f), new Float(100.0f), false, 3); run_FloatQuery(Float_filterL, BigIntegerParameter, new BigInteger("55000000"), new Float(55000000.0f), true, 2); run_FloatQuery(Float_filterR, BigIntegerParameter, new BigInteger("23"), new Float(23.0f), false, 3); run_FloatQuery(Float_filterL, BigDecimalParameter, new BigDecimal("55000000.0"), new Float(55000000.0f), true, 2); run_FloatQuery(Float_filterR, BigDecimalParameter, new BigDecimal("-25.5"), new Float(-25.5f), false, 1); alltypes.setFloat(new Float(23.23f)); run_FloatQuery(Float_filterObj, AllTypesParameter, alltypes, new Float(23.23f), false, 3); run_FloatQuery(Float_filterVal, null, null, new Float(100.0f), true, 5); run_DoubleQuery(Double_filterL, doubleParameter, new Double(-999999999999.0), new Double(-999999999999.0), true, 9); run_DoubleQuery(Double_filterR, doubleParameter, new Double(9999999999999.0), new Double(9999999999999.0), false, 9); run_DoubleQuery(Double_filterL, DoubleParameter, new Double(0.0), new Double(0.0), true, 6); run_DoubleQuery(Double_filterR, DoubleParameter, new Double(23.34), new Double(23.34), false, 4); run_DoubleQuery(Double_filterL, byteParameter, new Byte((byte)100), new Double(100.0), true, 4); run_DoubleQuery(Double_filterR, byteParameter, new Byte((byte)0), new Double(0.0), false, 3); run_DoubleQuery(Double_filterL, ByteParameter, new Byte((byte)-23), new Double(-23.0), true, 7); run_DoubleQuery(Double_filterR, ByteParameter, new Byte((byte)100), new Double(100.0), false, 4); run_DoubleQuery(Double_filterL, shortParameter, new Short((short)100), new Double(100.0), true, 4); run_DoubleQuery(Double_filterR, shortParameter, new Short((short)0), new Double(0.0), false, 3); run_DoubleQuery(Double_filterL, ShortParameter, new Short((short)23), new Double(23.0), true, 6); run_DoubleQuery(Double_filterR, ShortParameter, new Short((short)400), new Double(400.0), false, 7); run_DoubleQuery(Double_filterL, charParameter, new Character((char)100), new Double(100.0), true, 4); run_DoubleQuery(Double_filterR, charParameter, new Character((char)0), new Double(0.0), false, 3); run_DoubleQuery(Double_filterL, CharacterParameter, new Character((char)23), new Double(23.0), true, 6); run_DoubleQuery(Double_filterR, CharacterParameter, new Character((char)400), new Double(400.0), false, 7); run_DoubleQuery(Double_filterL, intParameter, new Integer(100), new Double(100.0), true, 4); run_DoubleQuery(Double_filterR, intParameter, new Integer(0), new Double(0.0), false, 3); run_DoubleQuery(Double_filterL, IntegerParameter, new Integer(23), new Double(23.0), true, 6); run_DoubleQuery(Double_filterR, IntegerParameter, new Integer(100), new Double(100.0), false, 4); run_DoubleQuery(Double_filterL, longParameter, new Long(100), new Double(100.0), true, 4); run_DoubleQuery(Double_filterR, longParameter, new Long(0), new Double(0.0), false, 3); run_DoubleQuery(Double_filterL, LongParameter, new Long(23), new Double(23.0), true, 6); run_DoubleQuery(Double_filterR, LongParameter, new Long(100), new Double(100.0), false, 4); run_DoubleQuery(Double_filterL, floatParameter, new Float(0.0f), new Double(0.0f), true, 6); run_DoubleQuery(Double_filterR, floatParameter, new Float(100.0f), new Double(100.0f), false, 4); run_DoubleQuery(Double_filterL, FloatParameter, new Float(100.0f), new Double(100.0f), true, 4); run_DoubleQuery(Double_filterR, FloatParameter, new Float(69.96f), new Double(69.96), false, 4); run_DoubleQuery(Double_filterL, BigIntegerParameter, new BigInteger("5000"), new Double(5000.0), true, 3); run_DoubleQuery(Double_filterR, BigIntegerParameter, new BigInteger("-20"), new Double(-20.0), false, 3); run_DoubleQuery(Double_filterL, BigDecimalParameter, new BigDecimal("100.0"), new Double(100.0), true, 4); run_DoubleQuery(Double_filterR, BigDecimalParameter, new BigDecimal("69.96"), new Double(69.96), false, 4); alltypes.setDouble(new Double(-999999999999.0)); run_DoubleQuery(Double_filterObj, AllTypesParameter, alltypes, new Double(-999999999999.0), true, 9); run_DoubleQuery(Double_filterVal, null, null, new Double(100.0), false, 4); run_StringQuery(String_filterL, StringParameter, new String("JDO"), new String("JDO"), true, 8); run_StringQuery(String_filterR, StringParameter, new String("JDBC"), new String("JDBC"), false, 1); alltypes.setString(new String("abcde")); run_StringQuery(String_filterObj, AllTypesParameter, alltypes, new String("abcde"), true, 2); run_StringQuery(String_filterVal1, null, null, new String("Java"), false, 4); run_StringQuery(String_filterVal2, null, null, new String(""), false, 0); BigDecimal bd = new BigDecimal("100.0"); run_BigDecimalQuery(BigDecimal_filterL, BigDecimalParameter, bd, bd, true, 4); bd = new BigDecimal("-234234.23333"); run_BigDecimalQuery(BigDecimal_filterR, BigDecimalParameter, bd, bd, false, 1); bd = new BigDecimal("989899.33304953"); run_BigDecimalQuery(BigDecimal_filterL, BigDecimalParameter, bd, bd, true, 3); bd = new BigDecimal("-1123123.22"); run_BigDecimalQuery(BigDecimal_filterR, BigDecimalParameter, bd, bd, false, 0); alltypes.setBigDecimal(bd); run_BigDecimalQuery(BigDecimal_filterObj, AllTypesParameter, alltypes, bd, true, 9); BigInteger bi = new BigInteger("987034534985043985"); run_BigIntegerQuery(BigInteger_filterL, BigIntegerParameter, bi, bi, true, 0); bi = new BigInteger("-999999999999999999"); run_BigIntegerQuery(BigInteger_filterR, BigIntegerParameter, bi, bi, false, 0); bi = new BigInteger("-9999999999999999999"); run_BigIntegerQuery(BigInteger_filterR, BigIntegerParameter, bi, bi, false, 0); bi = new BigInteger("1333330"); alltypes.setBigInteger(bi); run_BigIntegerQuery(BigInteger_filterObj, AllTypesParameter, alltypes, bi, false, 7); GregorianCalendar gc = new GregorianCalendar(TimeZone.getTimeZone("GMT"), Locale.UK); gc.clear(); gc.set(1999, Calendar.DECEMBER, 31, 9, 0, 0); Date d = gc.getTime(); run_DateQuery(Date_filterL, DateParameter, d, d, true, 2); gc.set(1992, Calendar.NOVEMBER, 22, 9, 0, 0); d = gc.getTime(); run_DateQuery(Date_filterR, DateParameter, d, d, false, 5); gc.set(1959, Calendar.OCTOBER, 9, 9, 0, 0); d = gc.getTime(); run_DateQuery(Date_filterR, DateParameter, d, d, false, 3); gc.set(1995, Calendar.JUNE, 14, 9, 0, 0); d = gc.getTime(); alltypes.setDate(d); run_DateQuery(Date_filterObj, AllTypesParameter, alltypes, d, false, 6); } private void run_byteQuery(String filter, String parameter, Object parameterValue, byte value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); byte val = obj.getbyte(); boolean correct_value = valueOnLeft ? value < val : val < value; if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL LessThan test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL LessThan test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_shortQuery(String filter, String parameter, Object parameterValue, short value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); short val = obj.getshort(); boolean correct_value = valueOnLeft ? value < val : val < value; if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL LessThan test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL LessThan test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_charQuery(String filter, String parameter, Object parameterValue, char value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); char val = obj.getchar(); boolean correct_value = valueOnLeft ? value < val : val < value; if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL LessThan test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL LessThan test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_intQuery(String filter, String parameter, Object parameterValue, int value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); int val = obj.getint(); boolean correct_value = valueOnLeft ? value < val : val < value; if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL LessThan test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL LessThan test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_longQuery(String filter, String parameter, Object parameterValue, long value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); long val = obj.getlong(); boolean correct_value = valueOnLeft ? value < val : val < value; if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL LessThan test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL LessThan test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_floatQuery(String filter, String parameter, Object parameterValue, float value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); float val = obj.getfloat(); boolean correct_value = valueOnLeft ? value < val : val < value; if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL LessThan test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL LessThan test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_doubleQuery(String filter, String parameter, Object parameterValue, double value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); double val = obj.getdouble(); boolean correct_value = valueOnLeft ? value < val : val < value; if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL LessThan test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL LessThan test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_ByteQuery(String filter, String parameter, Object parameterValue, Byte value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); Byte val = obj.getByte(); boolean correct_value = valueOnLeft ? (value.compareTo(val) < 0) : (val.compareTo(value) < 0); if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL LessThan test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL LessThan test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_ShortQuery(String filter, String parameter, Object parameterValue, Short value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); Short val = obj.getShort(); boolean correct_value = valueOnLeft ? (value.compareTo(val) < 0) : (val.compareTo(value) < 0); if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL LessThan test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL LessThan test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_CharacterQuery(String filter, String parameter, Object parameterValue, Character value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); Character val = obj.getCharacter(); boolean correct_value = valueOnLeft ? (value.compareTo(val) < 0) : (val.compareTo(value) < 0); if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL LessThan test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL LessThan test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_IntegerQuery(String filter, String parameter, Object parameterValue, Integer value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); Integer val = obj.getInteger(); boolean correct_value = valueOnLeft ? (value.compareTo(val) < 0) : (val.compareTo(value) < 0); if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL LessThan test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL LessThan test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_LongQuery(String filter, String parameter, Object parameterValue, Long value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); Long val = obj.getLong(); boolean correct_value = valueOnLeft ? (value.compareTo(val) < 0) : (val.compareTo(value) < 0); if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL LessThan test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL LessThan test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_FloatQuery(String filter, String parameter, Object parameterValue, Float value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); Float val = obj.getFloat(); boolean correct_value = valueOnLeft ? (value.compareTo(val) < 0) : (val.compareTo(value) < 0); if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL LessThan test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL LessThan test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_DoubleQuery(String filter, String parameter, Object parameterValue, Double value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); Double val = obj.getDouble(); boolean correct_value = valueOnLeft ? (value.compareTo(val) < 0) : (val.compareTo(value) < 0); if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL LessThan test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL LessThan test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_StringQuery(String filter, String parameter, Object parameterValue, String value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); String val = obj.getString(); boolean correct_value = valueOnLeft ? (value.compareTo(val) < 0) : (val.compareTo(value) < 0); if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL LessThan test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL LessThan test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_BigDecimalQuery(String filter, String parameter, Object parameterValue, BigDecimal value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); BigDecimal val = obj.getBigDecimal(); boolean correct_value = valueOnLeft ? (value.compareTo(val) < 0) : (val.compareTo(value) < 0); if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL LessThan test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL LessThan test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_BigIntegerQuery(String filter, String parameter, Object parameterValue, BigInteger value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); BigInteger val = obj.getBigInteger(); boolean correct_value = valueOnLeft ? (value.compareTo(val) < 0) : (val.compareTo(value) < 0); if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL LessThan test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL LessThan test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_DateQuery(String filter, String parameter, Object parameterValue, Date value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); Date val = obj.getDate(); boolean correct_value = valueOnLeft ? (value.compareTo(val) < 0) : (val.compareTo(value) < 0); if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL LessThan test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL LessThan test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } /** */ protected void localSetUp() { addTearDownClass(AllTypes.class); AllTypes.load(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/operators/LessThanOrEqual.java100664 242621 12500110373 27145 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.operators; import java.math.BigDecimal; import java.math.BigInteger; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; import java.util.Iterator; import java.util.Locale; import java.util.TimeZone; import org.apache.jdo.tck.pc.fieldtypes.AllTypes; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Less Than or Equal Query Operator *
*Keywords: query *
*Assertion ID: A14.6.2-19. *
*Assertion Description: The less than or equal operator (<=) is supported for all types as they are defined in the Java language. This includes the following types:
  • byte, short, int, long, char, Byte, Short Integer, Long, Character
  • float, double, Float, Double
  • BigDecimal, BigInteger
  • Date, String
The operation on object-valued fields of wrapper types (Boolean, Byte, Short, Integer, Long, Float, and Double), and numeric types (BigDecimal and BigInteger) use the wrapped values as operands. */ public class LessThanOrEqual extends ComparisonTests { private static String boolean_filterL = "value <= fld_boolean"; private static String boolean_filterR = "fld_boolean <= value"; private static String boolean_filterT = "fld_boolean <= true"; private static String boolean_filterF = "false <= fld_boolean"; private static String boolean_filterObj = "value.fld_boolean <= fld_boolean"; private static String byte_filterL = "value <= fld_byte"; private static String byte_filterR = "fld_byte <= value"; private static String byte_filterObj = "value.fld_byte <= fld_byte"; private static String byte_filterVal = "fld_byte <= 100"; private static String char_filterL = "value <= fld_char"; private static String char_filterR = "fld_char <= value"; private static String char_filterObj = "value.fld_char <= fld_char"; private static String char_filterVal = "'M' <= fld_char"; private static String double_filterL = "value <= fld_double"; private static String double_filterR = "fld_double <= value"; private static String double_filterObj = "value.fld_double <= fld_double"; private static String double_filterVal = "fld_double <= 100.0"; private static String float_filterL = "value <= fld_float"; private static String float_filterR = "fld_float <= value"; private static String float_filterObj = "fld_float <= value.fld_float"; private static String float_filterVal = "fld_float <= 100.0"; private static String int_filterL = "value <= fld_int"; private static String int_filterR = "fld_int <= value"; private static String int_filterObj = "value.fld_int <= fld_int"; private static String int_filterVal = "fld_int <= 1000"; private static String long_filterL = "value <= fld_long"; private static String long_filterR = "fld_long <= value"; private static String long_filterObj = "fld_long <= value.fld_long"; private static String long_filterVal = "fld_long <= 1000000"; private static String short_filterL = "value <= fld_short"; private static String short_filterR = "fld_short <= value"; private static String short_filterObj = "value.fld_short <= fld_short"; private static String short_filterVal = "1000 <= fld_short"; private static String Boolean_filterL = "value <= fld_Boolean"; private static String Boolean_filterR = "fld_Boolean <= value"; private static String Boolean_filterT = "fld_Boolean <= true"; private static String Boolean_filterF = "false <= fld_Boolean"; private static String Boolean_filterObj = "value.fld_Boolean <= fld_Boolean"; private static String Boolean_filterVal = "fld_Boolean <= false"; private static String Byte_filterL = "value <= fld_Byte"; private static String Byte_filterR = "fld_Byte <= value"; private static String Byte_filterObj = "fld_Byte <= value.fld_Byte"; private static String Byte_filterVal = "100 <= fld_Byte"; private static String Character_filterL = "value <= fld_Character"; private static String Character_filterR = "fld_Character <= value"; private static String Character_filterObj = "value.fld_Character <= fld_Character"; private static String Character_filterVal = "fld_Character <= 'z'"; private static String Double_filterL = "value <= fld_Double"; private static String Double_filterR = "fld_Double <= value"; private static String Double_filterObj = "value.fld_Double <= fld_Double"; private static String Double_filterVal = "fld_Double <= 100.0"; private static String Float_filterL = "value <= fld_Float"; private static String Float_filterR = "fld_Float <= value"; private static String Float_filterObj = "fld_Float <= value.fld_Float"; private static String Float_filterVal = "100.0f <= fld_Float"; private static String Integer_filterL = "value <= fld_Integer"; private static String Integer_filterR = "fld_Integer <= value"; private static String Integer_filterObj = "fld_Integer <= value.fld_Integer"; private static String Integer_filterVal = "fld_Integer <= 100"; private static String Long_filterL = "value <= fld_Long"; private static String Long_filterR = "fld_Long <= value"; private static String Long_filterObj = "value.fld_Long <= fld_Long"; private static String Long_filterVal = "-1000 <= fld_Long"; private static String Short_filterL = "value <= fld_Short"; private static String Short_filterR = "fld_Short <= value"; private static String Short_filterObj = "fld_Short <= value.fld_Short"; private static String Short_filterVal = "-1000 <= fld_Short"; private static String String_filterL = "value <= fld_String"; private static String String_filterR = "fld_String <= value"; private static String String_filterObj = "value.fld_String <= fld_String"; private static String String_filterVal1 = "fld_String <= \"Java\""; private static String String_filterVal2 = "fld_String <= \"\""; private static String Date_filterL = "value <= fld_Date"; private static String Date_filterR = "fld_Date <= value"; private static String Date_filterObj = "fld_Date <= value.fld_Date"; private static String BigDecimal_filterL = "value <= fld_BigDecimal"; private static String BigDecimal_filterR = "fld_BigDecimal <= value"; private static String BigDecimal_filterObj = "value.fld_BigDecimal <= fld_BigDecimal"; private static String BigInteger_filterL = "value <= fld_BigInteger"; private static String BigInteger_filterR = "fld_BigInteger <= value"; private static String BigInteger_filterObj = "fld_BigInteger <= value.fld_BigInteger"; /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-19 (LessThanOrEqual) failed: "; /** * The main 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(LessThanOrEqual.class); } /** */ public void test() { pm = getPM(); tx = pm.currentTransaction(); runQueries(); } /** */ private void runQueries() { AllTypes alltypes = new AllTypes(); run_byteQuery(byte_filterL, byteParameter, new Byte((byte)0), (byte)0, true, 7); run_byteQuery(byte_filterR, byteParameter, new Byte(Byte.MIN_VALUE), Byte.MIN_VALUE, false, 1); run_byteQuery(byte_filterL, ByteParameter, new Byte((byte)50), (byte)50, true, 5); run_byteQuery(byte_filterR, ByteParameter, new Byte(Byte.MAX_VALUE), Byte.MAX_VALUE, false, 10); run_byteQuery(byte_filterL, shortParameter, new Short((short)75), (byte)75, true, 3); run_byteQuery(byte_filterR, shortParameter, new Short((short)75), (byte)75, false, 8); run_byteQuery(byte_filterL, ShortParameter, new Short((short)10), (byte)10, true, 6); run_byteQuery(byte_filterR, ShortParameter, new Short((short)25), (byte)25, false, 5); run_byteQuery(byte_filterL, charParameter, new Character((char)101), (byte)101, true, 1); run_byteQuery(byte_filterR, charParameter, new Character((char)50), (byte)50, false, 7); run_byteQuery(byte_filterL, CharacterParameter, new Character((char)0), (byte)0, true, 7); run_byteQuery(byte_filterR, CharacterParameter, new Character((char)0), (byte)0, false, 4); run_byteQuery(byte_filterL, intParameter, new Integer(25), (byte)25, true, 5); run_byteQuery(byte_filterR, intParameter, new Integer(50), (byte)50, false, 7); run_byteQuery(byte_filterL, IntegerParameter, new Integer(-10), (byte)-10, true, 8); run_byteQuery(byte_filterR, IntegerParameter, new Integer(-100), (byte)-100, false, 2); run_byteQuery(byte_filterL, longParameter, new Long(50), (byte)50, true, 5); run_byteQuery(byte_filterR, longParameter, new Long(60), (byte)60, false, 7); run_byteQuery(byte_filterL, LongParameter, new Long(-100), (byte)-100, true, 9); run_byteQuery(byte_filterR, LongParameter, new Long(-100), (byte)-100, false, 2); run_byteQuery(byte_filterL, floatParameter, new Float(51), (byte)51, true, 3); run_byteQuery(byte_filterR, floatParameter, new Float(-20), (byte)-20, false, 2); run_byteQuery(byte_filterL, FloatParameter, new Float(-99), (byte)-99, true, 8); run_byteQuery(byte_filterR, FloatParameter, new Float(-100), (byte)-100, false, 2); run_byteQuery(byte_filterL, doubleParameter, new Double(50), (byte)50, true, 5); run_byteQuery(byte_filterR, doubleParameter, new Double(60), (byte)60, false, 7); run_byteQuery(byte_filterL, DoubleParameter, new Double(Byte.MAX_VALUE), Byte.MAX_VALUE, true, 1); run_byteQuery(byte_filterR, DoubleParameter, new Double(25), (byte)25, false, 5); run_byteQuery(byte_filterL, BigIntegerParameter, new BigInteger("50"), (byte)50, true, 5); run_byteQuery(byte_filterR, BigIntegerParameter, new BigInteger("-100"), (byte)-100, false, 2); run_byteQuery(byte_filterL, BigDecimalParameter, new BigDecimal("50.000000"), (byte)50, true, 5); run_byteQuery(byte_filterR, BigDecimalParameter, new BigDecimal("10.00000"), (byte)10, false, 5); alltypes.setbyte((byte)50); run_byteQuery(byte_filterObj, AllTypesParameter, alltypes, (byte)50, true, 5); alltypes.setbyte((byte)55); run_byteQuery(byte_filterObj, AllTypesParameter, alltypes, (byte)55, true, 3); run_byteQuery(byte_filterVal, null, null, (byte)100, false, 9); run_shortQuery(short_filterL, shortParameter, new Short((short)100), (short)100, true, 5); run_shortQuery(short_filterR, shortParameter, new Short((short)100), (short)100, false, 7); run_shortQuery(short_filterL, ShortParameter, new Short(Short.MIN_VALUE), Short.MIN_VALUE, true, 10); run_shortQuery(short_filterR, ShortParameter, new Short((short)253), (short)253, false, 7); run_shortQuery(short_filterR, shortParameter, new Short((short)1000), (short)1000, false, 8); run_shortQuery(short_filterL, byteParameter, new Byte((byte)75), (short)75, true, 5); run_shortQuery(short_filterR, byteParameter, new Byte((byte)-75), (short)-75, false, 4); run_shortQuery(short_filterL, ByteParameter, new Byte((byte)100), (short)100, true, 5); run_shortQuery(short_filterR, ByteParameter, new Byte((byte)100), (short)100, false, 7); run_shortQuery(short_filterL, charParameter, new Character((char)75), (short)75, true, 5); run_shortQuery(short_filterR, charParameter, new Character((char)9999), (short)9999, false, 8); run_shortQuery(short_filterL, CharacterParameter, new Character((char)1000), (short)1000, true, 3); run_shortQuery(short_filterR, CharacterParameter, new Character((char)10000), (short)10000, false, 9); run_shortQuery(short_filterL, intParameter, new Integer(-10000), (short)-10000, true, 9); run_shortQuery(short_filterR, intParameter, new Integer(-10000), (short)-10000, false, 2); run_shortQuery(short_filterL, IntegerParameter, new Integer(10000), (short)10000, true, 2); run_shortQuery(short_filterR, IntegerParameter, new Integer(30000), (short)30000, false, 9); run_shortQuery(short_filterL, longParameter, new Long(10000), (short) 10000, true, 2); run_shortQuery(short_filterR, longParameter, new Long(Short.MAX_VALUE), Short.MAX_VALUE, false, 10); run_shortQuery(short_filterL, LongParameter, new Long(Short.MAX_VALUE), Short.MAX_VALUE, true, 1); run_shortQuery(short_filterR, LongParameter, new Long(100), (short)100, false, 7); run_shortQuery(short_filterL, floatParameter, new Float(23000), (short)23000, true, 1); run_shortQuery(short_filterR, floatParameter, new Float(23000), (short)23000, false, 9); run_shortQuery(short_filterL, FloatParameter, new Float(-1000), (short)-1000, true, 8); run_shortQuery(short_filterR, FloatParameter, new Float(100), (short)100, false, 7); run_shortQuery(short_filterL, doubleParameter, new Double(-10000.0), (short)-10000, true, 9); run_shortQuery(short_filterR, doubleParameter, new Double(9999.0), (short)9999, false, 8); run_shortQuery(short_filterL, DoubleParameter, new Double(23.0), (short)23, true, 5); run_shortQuery(short_filterR, DoubleParameter, new Double(23.0), (short)23, false, 5); run_shortQuery(short_filterL, BigIntegerParameter, new BigInteger("10000"), (short)10000, true, 2); run_shortQuery(short_filterR, BigIntegerParameter, new BigInteger("30000"), (short)30000, false, 9); run_shortQuery(short_filterL, BigDecimalParameter, new BigDecimal("23.0"), (short)23, true, 5); run_shortQuery(short_filterR, BigDecimalParameter, new BigDecimal("23.0"), (short)23, false, 5); alltypes.setshort((short)100); run_shortQuery(short_filterObj, AllTypesParameter, alltypes, (short)100, true, 5); alltypes.setshort((short)23); run_shortQuery(short_filterObj, AllTypesParameter, alltypes, (short)23, true, 5); run_shortQuery(short_filterVal, null, null, (short)1000, true, 3); run_charQuery(char_filterL, charParameter, new Character(Character.MIN_VALUE), Character.MIN_VALUE, true, 10); run_charQuery(char_filterR, charParameter, new Character(Character.MAX_VALUE), Character.MAX_VALUE, false, 10); run_charQuery(char_filterL, charParameter, new Character('C'), 'C', true, 6); run_charQuery(char_filterR, charParameter, new Character('z'), 'z', false, 9); run_charQuery(char_filterL, CharacterParameter, new Character(' '), ' ', true, 9); run_charQuery(char_filterR, CharacterParameter, new Character('f'), 'f', false, 7); run_charQuery(char_filterL, byteParameter, new Byte((byte)Character.MIN_VALUE), (char)Character.MIN_VALUE, true, 10); run_charQuery(char_filterR, ByteParameter, new Byte((byte)'a'), 'a', false, 7); run_charQuery(char_filterL, shortParameter, new Short((short)'M'), 'M', true, 5); run_charQuery(char_filterR, shortParameter, new Short((short)'M'), 'M', false, 7); run_charQuery(char_filterL, ShortParameter, new Short((short)'A'), 'A', true, 8); run_charQuery(char_filterR, ShortParameter, new Short((short)'A'), 'A', false, 3); run_charQuery(char_filterL, intParameter, new Integer('z'), 'z', true, 3); run_charQuery(char_filterR, intParameter, new Integer('z'), 'z', false, 9); run_charQuery(char_filterL, IntegerParameter, new Integer('B'), 'B', true, 7); run_charQuery(char_filterR, IntegerParameter, new Integer('B'), 'B', false, 4); run_charQuery(char_filterL, longParameter, new Long('z'), 'z', true, 3); run_charQuery(char_filterR, longParameter, new Long('z'), 'z', false, 9); run_charQuery(char_filterL, LongParameter, new Long('B'), 'B', true, 7); run_charQuery(char_filterR, LongParameter, new Long('B'), 'B', false, 4); run_charQuery(char_filterL, floatParameter, new Float('f'), 'f', true, 3); run_charQuery(char_filterR, floatParameter, new Float(' '), ' ', false, 2); run_charQuery(char_filterL, FloatParameter, new Float('z'), 'z', true, 3); run_charQuery(char_filterR, FloatParameter, new Float('z'), 'z', false, 9); run_charQuery(char_filterL, doubleParameter, new Double('B'), 'B', true, 7); run_charQuery(char_filterR, doubleParameter, new Double('B'), 'B', false, 4); run_charQuery(char_filterL, DoubleParameter, new Double('A'), 'A', true, 8); run_charQuery(char_filterR, DoubleParameter, new Double('A'), 'A', false, 3); run_charQuery(char_filterL, BigIntegerParameter, new BigInteger("65"), 'A', true, 8); // 'A' == 65 run_charQuery(char_filterR, BigIntegerParameter, new BigInteger("122"), 'z', false, 9); // 'z' == 122 run_charQuery(char_filterL, BigDecimalParameter, new BigDecimal("65.00000"), 'A', true, 8); run_charQuery(char_filterR, BigDecimalParameter, new BigDecimal("77.0000"), 'M', false, 7); // 'M' == 77 alltypes.setchar('A'); run_charQuery(char_filterObj, AllTypesParameter, alltypes, 'A', true, 8); alltypes.setchar('b'); run_charQuery(char_filterObj, AllTypesParameter, alltypes, 'b', true, 3); run_charQuery(char_filterVal, null, null, 'M', true, 5); run_intQuery(int_filterL, intParameter, new Integer(AllTypes.veryLargeNegativeInt), AllTypes.veryLargeNegativeInt, true, 10); run_intQuery(int_filterR, intParameter, new Integer(AllTypes.veryLargePositiveInt), AllTypes.veryLargePositiveInt, false, 10); run_intQuery(int_filterR, intParameter, new Integer(23), 23, false, 4); run_intQuery(int_filterL, IntegerParameter, new Integer(1000000), 1000000, true, 2); run_intQuery(int_filterR, IntegerParameter, new Integer(1000), 1000, false, 7); run_intQuery(int_filterL, byteParameter, new Byte((byte)100), 100, true, 6); run_intQuery(int_filterR, byteParameter, new Byte((byte)0), 0, false, 4); run_intQuery(int_filterL, ByteParameter, new Byte((byte)100), 100, true, 6); run_intQuery(int_filterR, ByteParameter, new Byte((byte)0), 0, false, 4); run_intQuery(int_filterL, shortParameter, new Short((short)10000), 10000, true, 3); run_intQuery(int_filterR, shortParameter, new Short((short)-1000), -1000, false, 3); run_intQuery(int_filterL, ShortParameter, new Short((short)-1000), -1000, true, 8); run_intQuery(int_filterR, ShortParameter, new Short((short)10000), 10000, false, 8); run_intQuery(int_filterL, charParameter, new Character((char)100), 100, true, 6); run_intQuery(int_filterR, charParameter, new Character((char)0), 0, false, 4); run_intQuery(int_filterL, CharacterParameter, new Character((char)100), 100, true, 6); run_intQuery(int_filterR, CharacterParameter, new Character((char)10000), 10000, false, 8); run_intQuery(int_filterL, longParameter, new Long(AllTypes.veryLargePositiveInt), AllTypes.veryLargePositiveInt, true, 1); run_intQuery(int_filterR, longParameter, new Long(AllTypes.veryLargeNegativeInt), AllTypes.veryLargeNegativeInt, false, 1); run_intQuery(int_filterL, LongParameter, new Long(10000), 10000, true, 3); run_intQuery(int_filterR, LongParameter, new Long(43), 43, false, 4); run_intQuery(int_filterL, floatParameter, new Float(AllTypes.veryLargePositiveInt), AllTypes.veryLargePositiveInt, true, 1); run_intQuery(int_filterR, floatParameter, new Float(AllTypes.veryLargeNegativeInt), AllTypes.veryLargeNegativeInt, false, 1); run_intQuery(int_filterL, FloatParameter, new Float(10000), 10000, true, 3); run_intQuery(int_filterR, FloatParameter, new Float(43), 43, false, 4); run_intQuery(int_filterL, doubleParameter, new Double(AllTypes.veryLargePositiveInt), AllTypes.veryLargePositiveInt, true, 1); run_intQuery(int_filterR, doubleParameter, new Double(AllTypes.veryLargeNegativeInt), AllTypes.veryLargeNegativeInt, false, 1); run_intQuery(int_filterL, DoubleParameter, new Double(10000), 10000, true, 3); run_intQuery(int_filterR, DoubleParameter, new Double(43), 43, false, 4); run_intQuery(int_filterL, BigIntegerParameter, new BigInteger("1000000"), 1000000, true, 2); run_intQuery(int_filterR, BigIntegerParameter, new BigInteger("1000"), 1000, false, 7); run_intQuery(int_filterL, BigDecimalParameter, new BigDecimal("10000.0"), 10000, true, 3); run_intQuery(int_filterR, BigDecimalParameter, new BigDecimal("43.0"), 43, false, 4); alltypes.setint(100); run_intQuery(int_filterObj, AllTypesParameter, alltypes, 100, true, 6); run_intQuery(int_filterVal, null, null, 1000, false, 7); run_longQuery(long_filterL, longParameter, new Long(Long.MIN_VALUE), Long.MIN_VALUE, true, 10); run_longQuery(long_filterR, longParameter, new Long(Long.MAX_VALUE), Long.MAX_VALUE, false, 10); run_longQuery(long_filterL, LongParameter, new Long(100), 100, true, 5); run_longQuery(long_filterR, LongParameter, new Long(23), 23, false, 5); run_longQuery(long_filterL, byteParameter, new Byte((byte)100), 100, true, 5); run_longQuery(long_filterR, byteParameter, new Byte((byte)0), 0, false, 5); run_longQuery(long_filterL, ByteParameter, new Byte((byte)100), 100, true, 5); run_longQuery(long_filterR, ByteParameter, new Byte((byte)0), 0, false, 5); run_longQuery(long_filterL, shortParameter, new Short((short)-1000), -1000, true, 8); run_longQuery(long_filterR, shortParameter, new Short((short)1000), 1000, false, 8); run_longQuery(long_filterL, ShortParameter, new Short((short)100), 100, true, 5); run_longQuery(long_filterR, ShortParameter, new Short((short)32), 32, false, 5); run_longQuery(long_filterL, charParameter, new Character((char)0), 0, true, 6); run_longQuery(long_filterR, charParameter, new Character((char)100), 100, false, 7); run_longQuery(long_filterL, CharacterParameter, new Character((char)23), 23, true, 5); run_longQuery(long_filterR, CharacterParameter, new Character((char)0), 0, false, 5); run_longQuery(long_filterL, intParameter, new Integer(100), 100, true, 5); run_longQuery(long_filterR, intParameter, new Integer(0), 0, false, 5); run_longQuery(long_filterL, IntegerParameter, new Integer(23), 23, true, 5); run_longQuery(long_filterR, IntegerParameter, new Integer(1000000), 1000000, false, 9); run_longQuery(long_filterL, floatParameter, new Float(-1000000.0), -1000000, true, 9); run_longQuery(long_filterR, floatParameter, new Float((float)Long.MAX_VALUE), Long.MAX_VALUE, false, 10); run_longQuery(long_filterL, FloatParameter, new Float(100.0), 100, true, 5); run_longQuery(long_filterR, FloatParameter, new Float(32.0), 32, false, 5); run_longQuery(long_filterL, doubleParameter, new Double(-1000000.0), -1000000, true, 9); run_longQuery(long_filterR, doubleParameter, new Double((double)Long.MAX_VALUE), Long.MAX_VALUE, false, 10); run_longQuery(long_filterL, DoubleParameter, new Double(100.0), 100, true, 5); run_longQuery(long_filterR, DoubleParameter, new Double(32.0), 32, false, 5); run_longQuery(long_filterL, BigIntegerParameter, new BigInteger("23"), 23, true, 5); run_longQuery(long_filterR, BigIntegerParameter, new BigInteger("1000000"), 1000000, false, 9); run_longQuery(long_filterL, BigDecimalParameter, new BigDecimal("100.0"), 100, true, 5); run_longQuery(long_filterR, BigDecimalParameter, new BigDecimal("32.0"), 32, false, 5); alltypes.setlong(100); run_longQuery(long_filterObj, AllTypesParameter, alltypes, 100, false, 7); run_longQuery(long_filterVal, null, null, 1000000, false, 9); run_floatQuery(float_filterL, floatParameter, new Float(AllTypes.FLOAT_SMALLEST), AllTypes.FLOAT_SMALLEST, true, 10); run_floatQuery(float_filterR, floatParameter, new Float(AllTypes.FLOAT_LARGEST), AllTypes.FLOAT_LARGEST, false, 10); run_floatQuery(float_filterL, FloatParameter, new Float(4.0f), 4.0f, true, 6); run_floatQuery(float_filterR, FloatParameter, new Float(400.0f), 400.0f, false, 7); run_floatQuery(float_filterL, byteParameter, new Byte((byte)4), 4.0f, true, 6); run_floatQuery(float_filterR, byteParameter, new Byte((byte)23), 23.0f, false, 4); run_floatQuery(float_filterL, ByteParameter, new Byte((byte)34), 34.0f, true, 6); run_floatQuery(float_filterR, ByteParameter, new Byte((byte)100), 100.0f, false, 6); run_floatQuery(float_filterL, shortParameter, new Short((short)10), 10.0f, true, 6); run_floatQuery(float_filterR, shortParameter, new Short((short)23), 23.0f, false, 4); run_floatQuery(float_filterL, ShortParameter, new Short((short)34), 34.0f, true, 6); run_floatQuery(float_filterR, ShortParameter, new Short((short)100), 100.0f, false, 6); run_floatQuery(float_filterL, charParameter, new Character((char)20), 20.0f, true, 6); run_floatQuery(float_filterR, charParameter, new Character((char)23), 23.0f, false, 4); run_floatQuery(float_filterL, CharacterParameter, new Character((char)34), 34.0f, true, 6); run_floatQuery(float_filterR, CharacterParameter, new Character((char)100), 100.0f, false, 6); run_floatQuery(float_filterL, intParameter, new Integer(55000000), 55000000.0f, true, 2); run_floatQuery(float_filterR, intParameter, new Integer(23), 23.0f, false, 4); run_floatQuery(float_filterL, IntegerParameter, new Integer(34), 34.0f, true, 6); run_floatQuery(float_filterR, IntegerParameter, new Integer(100), 100.0f, false, 6); run_floatQuery(float_filterL, longParameter, new Long(55000000), 55000000.0f, true, 2); run_floatQuery(float_filterR, longParameter, new Long(23), 23.0f, false, 4); run_floatQuery(float_filterL, LongParameter, new Long(34), 34.0f, true, 6); run_floatQuery(float_filterR, LongParameter, new Long(100), 100.0f, false, 6); run_floatQuery(float_filterL, doubleParameter, new Double(55000000.0), 55000000.0f, true, 2); run_floatQuery(float_filterR, doubleParameter, new Double(-20.5), -20.5f, false, 3); run_floatQuery(float_filterL, DoubleParameter, new Double(2.0), 2.0f, true, 6); run_floatQuery(float_filterR, DoubleParameter, new Double(100.0), 100.0f, false, 6); run_floatQuery(float_filterL, BigIntegerParameter, new BigInteger("55000000"), 55000000.0f, true, 2); run_floatQuery(float_filterR, BigIntegerParameter, new BigInteger("23"), 23.0f, false, 4); run_floatQuery(float_filterL, BigDecimalParameter, new BigDecimal("55000000.0"), 55000000.0f, true, 2); run_floatQuery(float_filterR, BigDecimalParameter, new BigDecimal("-20.5"), -20.5f, false, 3); alltypes.setfloat(23.23f); run_floatQuery(float_filterObj, AllTypesParameter, alltypes, 23.23f, false, 4); run_floatQuery(float_filterVal, null, null, 100.0f, false, 6); run_doubleQuery(double_filterL, doubleParameter, new Double(AllTypes.DOUBLE_SMALLEST), AllTypes.DOUBLE_SMALLEST, true, 10); run_doubleQuery(double_filterR, doubleParameter, new Double(AllTypes.DOUBLE_LARGEST), AllTypes.DOUBLE_LARGEST, false, 10); run_doubleQuery(double_filterL, DoubleParameter, new Double(0.0), 0.0, true, 7); run_doubleQuery(double_filterR, DoubleParameter, new Double(23.34), 23.34, false, 4); run_doubleQuery(double_filterL, byteParameter, new Byte((byte)100), 100.0, true, 6); run_doubleQuery(double_filterR, byteParameter, new Byte((byte)0), 0.0, false, 4); run_doubleQuery(double_filterL, ByteParameter, new Byte((byte)23), 23.0, true, 6); run_doubleQuery(double_filterR, ByteParameter, new Byte((byte)100), 100.0, false, 6); run_doubleQuery(double_filterL, charParameter, new Character((char)100), 100.0, true, 6); run_doubleQuery(double_filterR, charParameter, new Character((char)0), 0.0, false, 4); run_doubleQuery(double_filterL, CharacterParameter, new Character((char)23), 23.0, true, 6); run_doubleQuery(double_filterR, CharacterParameter, new Character((char)100), 100.0, false, 6); run_doubleQuery(double_filterL, shortParameter, new Short((short)100), 100.0, true, 6); run_doubleQuery(double_filterR, shortParameter, new Short((short)0), 0.0, false, 4); run_doubleQuery(double_filterL, ShortParameter, new Short((short)23), 23.0, true, 6); run_doubleQuery(double_filterR, ShortParameter, new Short((short)100), 100.0, false, 6); run_doubleQuery(double_filterL, intParameter, new Integer(100), 100.0, true, 6); run_doubleQuery(double_filterR, intParameter, new Integer(0), 0.0, false, 4); run_doubleQuery(double_filterL, IntegerParameter, new Integer(5000), 5000.0, true, 3); run_doubleQuery(double_filterR, IntegerParameter, new Integer(-20), -20.0, false, 3); run_doubleQuery(double_filterL, longParameter, new Long(100), 100.0, true, 6); run_doubleQuery(double_filterR, longParameter, new Long(0), 0.0, false, 4); run_doubleQuery(double_filterL, LongParameter, new Long(5000), 5000.0, true, 3); run_doubleQuery(double_filterR, LongParameter, new Long(-20), -20.0, false, 3); run_doubleQuery(double_filterL, floatParameter, new Float(0.0f), 0.0f, true, 7); run_doubleQuery(double_filterR, floatParameter, new Float(100.0f), 100.0f, false, 6); run_doubleQuery(double_filterL, FloatParameter, new Float(100.0f), 100.0, true, 6); run_doubleQuery(double_filterR, FloatParameter, new Float(69.96f), 69.96, false, 4); run_doubleQuery(double_filterL, BigIntegerParameter, new BigInteger("5000"), 5000.0, true, 3); run_doubleQuery(double_filterR, BigIntegerParameter, new BigInteger("-20"), -20.0, false, 3); run_doubleQuery(double_filterL, BigDecimalParameter, new BigDecimal("100.0"), 100.0, true, 6); run_doubleQuery(double_filterR, BigDecimalParameter, new BigDecimal("69.96"), 69.96, false, 4); alltypes.setdouble(-25.5); run_doubleQuery(double_filterObj, AllTypesParameter, alltypes, -25.5, true, 8); run_doubleQuery(double_filterVal, null, null, 100.0, false, 6); run_ByteQuery(Byte_filterL, byteParameter, new Byte((byte)50), new Byte((byte)50), true, 5); run_ByteQuery(Byte_filterR, byteParameter, new Byte(Byte.MIN_VALUE), new Byte(Byte.MIN_VALUE), false, 1); run_ByteQuery(Byte_filterL, ByteParameter, new Byte((byte)20), new Byte((byte)20), true, 5); run_ByteQuery(Byte_filterR, ByteParameter, new Byte(Byte.MAX_VALUE), new Byte(Byte.MAX_VALUE), false, 10); run_ByteQuery(Byte_filterL, shortParameter, new Short((short)60), new Byte((byte)60), true, 3); run_ByteQuery(Byte_filterR, shortParameter, new Short((short)51), new Byte((byte)51), false, 7); run_ByteQuery(Byte_filterL, ShortParameter, new Short((short)-100), new Byte((byte)-100), true, 9); run_ByteQuery(Byte_filterR, ShortParameter, new Short((short)-100), new Byte((byte)-100), false, 2); run_ByteQuery(Byte_filterL, charParameter, new Character((char)101), new Byte((byte)101), true, 1); run_ByteQuery(Byte_filterR, charParameter, new Character((char)10), new Byte((byte)10), false, 5); run_ByteQuery(Byte_filterL, CharacterParameter, new Character((char)50), new Byte((byte)50), true, 5); run_ByteQuery(Byte_filterR, CharacterParameter, new Character((char)75), new Byte((byte)75), false, 8); run_ByteQuery(Byte_filterL, intParameter, new Integer(77), new Byte((byte)77), true, 2); run_ByteQuery(Byte_filterR, intParameter, new Integer(60), new Byte((byte)60), false, 7); run_ByteQuery(Byte_filterL, IntegerParameter, new Integer(40), new Byte((byte)40), true, 5); run_ByteQuery(Byte_filterR, IntegerParameter, new Integer(75), new Byte((byte)75), false, 8); run_ByteQuery(Byte_filterL, longParameter, new Long(50), new Byte((byte)50), true, 5); run_ByteQuery(Byte_filterR, longParameter, new Long(50), new Byte((byte)50), false, 7); run_ByteQuery(Byte_filterL, LongParameter, new Long(-100), new Byte((byte)-100), true, 9); run_ByteQuery(Byte_filterR, LongParameter, new Long(-100), new Byte((byte)-100), false, 2); run_ByteQuery(Byte_filterL, floatParameter, new Float(50), new Byte((byte)50), true, 5); run_ByteQuery(Byte_filterR, floatParameter, new Float(50), new Byte((byte)50), false, 7); run_ByteQuery(Byte_filterL, FloatParameter, new Float(-100), new Byte((byte)-100), true, 9); run_ByteQuery(Byte_filterR, FloatParameter, new Float(-100), new Byte((byte)-100), false, 2); run_ByteQuery(Byte_filterL, doubleParameter, new Double(50), new Byte((byte)50), true, 5); run_ByteQuery(Byte_filterR, doubleParameter, new Double(50), new Byte((byte)50), false, 7); run_ByteQuery(Byte_filterL, DoubleParameter, new Double(-100), new Byte((byte)-100), true, 9); run_ByteQuery(Byte_filterR, DoubleParameter, new Double(-100), new Byte((byte)-100), false, 2); run_ByteQuery(Byte_filterL, BigIntegerParameter, new BigInteger("50"), new Byte((byte)50), true, 5); run_ByteQuery(Byte_filterR, BigIntegerParameter, new BigInteger("-100"), new Byte((byte)-100), false, 2); run_ByteQuery(Byte_filterL, BigDecimalParameter, new BigDecimal("50.000000"), new Byte((byte)50), true, 5); run_ByteQuery(Byte_filterR, BigDecimalParameter, new BigDecimal("10.00000"), new Byte((byte)10), false, 5); Byte val = new Byte((byte)50); alltypes.setByte(val); run_ByteQuery(Byte_filterObj, AllTypesParameter, alltypes, val, false, 7); val = new Byte((byte)51); alltypes.setByte(val); run_ByteQuery(Byte_filterObj, AllTypesParameter, alltypes, val, false, 7); run_ByteQuery(Byte_filterVal, null, null, new Byte((byte)100), true, 2); run_ShortQuery(Short_filterL, shortParameter, new Short((short)100), new Short((short)100), true, 5); run_ShortQuery(Short_filterR, shortParameter, new Short((short)100), new Short((short)100), false, 7); run_ShortQuery(Short_filterL, ShortParameter, new Short(Short.MIN_VALUE), new Short(Short.MIN_VALUE), true, 10); run_ShortQuery(Short_filterR, ShortParameter, new Short((short)253), new Short((short)253), false, 7); run_ShortQuery(Short_filterR, shortParameter, new Short((short)1000), new Short((short)1000), false, 8); run_ShortQuery(Short_filterL, byteParameter, new Byte((byte)75), new Short((short)75), true, 5); run_ShortQuery(Short_filterR, byteParameter, new Byte((byte)75), new Short((short)75), false, 5); run_ShortQuery(Short_filterL, ByteParameter, new Byte((byte)100), new Short((short)100), true, 5); run_ShortQuery(Short_filterR, ByteParameter, new Byte((byte)100), new Short((short)100), false, 7); run_ShortQuery(Short_filterL, charParameter, new Character((char)75), new Short((short)75), true, 5); run_ShortQuery(Short_filterR, charParameter, new Character((char)75), new Short((short)75), false, 5); run_ShortQuery(Short_filterL, CharacterParameter, new Character((char)100), new Short((short)100), true, 5); run_ShortQuery(Short_filterR, CharacterParameter, new Character((char)200), new Short((short)200), false, 7); run_ShortQuery(Short_filterL, intParameter, new Integer(-10000), new Short((short)-10000), true, 9); run_ShortQuery(Short_filterR, intParameter, new Integer(-10000), new Short((short)-10000), false, 2); run_ShortQuery(Short_filterL, IntegerParameter, new Integer(10000), new Short((short)10000), true, 2); run_ShortQuery(Short_filterR, IntegerParameter, new Integer(10000), new Short((short)10000), false, 9); run_ShortQuery(Short_filterL, longParameter, new Long(20000), new Short((short) 20000), true, 1); run_ShortQuery(Short_filterR, longParameter, new Long(5000), new Short((short) 5000), false, 8); run_ShortQuery(Short_filterL, LongParameter, new Long(200), new Short((short)200), true, 3); run_ShortQuery(Short_filterR, LongParameter, new Long(500), new Short((short)500), false, 7); run_ShortQuery(Short_filterL, floatParameter, new Float(23000.0f), new Short((short)23000), true, 1); run_ShortQuery(Short_filterR, floatParameter, new Float(23000.0f), new Short((short)23000), false, 9); run_ShortQuery(Short_filterL, FloatParameter, new Float(10.0f), new Short((short)10), true, 5); run_ShortQuery(Short_filterR, FloatParameter, new Float(101.0f), new Short((short)101), false, 7); run_ShortQuery(Short_filterL, doubleParameter, new Double(-10000.0), new Short((short)-10000), true, 9); run_ShortQuery(Short_filterR, doubleParameter, new Double(-10000.0), new Short((short)-10000), false, 2); run_ShortQuery(Short_filterL, DoubleParameter, new Double(101.0), new Short((short)101), true, 3); run_ShortQuery(Short_filterR, DoubleParameter, new Double(23.0), new Short((short)23), false, 5); run_ShortQuery(Short_filterL, BigIntegerParameter, new BigInteger("10000"), new Short((short)10000), true, 2); run_ShortQuery(Short_filterR, BigIntegerParameter, new BigInteger("30000"), new Short((short)30000), false, 9); run_ShortQuery(Short_filterL, BigDecimalParameter, new BigDecimal("23.0"), new Short((short)23), true, 5); run_ShortQuery(Short_filterR, BigDecimalParameter, new BigDecimal("23.0"), new Short((short)23), false, 5); Short sval = new Short((short)100); alltypes.setShort(sval); run_ShortQuery(Short_filterObj, AllTypesParameter, alltypes, sval, false, 7); sval = new Short((short)23); alltypes.setShort(sval); run_ShortQuery(Short_filterObj, AllTypesParameter, alltypes, sval, false, 5); run_ShortQuery(Short_filterVal, null, null, new Short((short)-1000), true, 8); run_CharacterQuery(Character_filterL, charParameter, new Character(Character.MIN_VALUE), new Character(Character.MIN_VALUE), true, 10); run_CharacterQuery(Character_filterR, charParameter, new Character(Character.MAX_VALUE), new Character(Character.MAX_VALUE), false, 10); run_CharacterQuery(Character_filterL, charParameter, new Character('C'), new Character('C'), true, 6); run_CharacterQuery(Character_filterR, charParameter, new Character('z'), new Character('z'), false, 9); run_CharacterQuery(Character_filterL, CharacterParameter, new Character(' '), new Character(' '), true, 9); run_CharacterQuery(Character_filterR, CharacterParameter, new Character('f'), new Character('f'), false, 7); run_CharacterQuery(Character_filterL, byteParameter, new Byte((byte)Character.MIN_VALUE), new Character((char)Character.MIN_VALUE), true, 10); run_CharacterQuery(Character_filterR, ByteParameter, new Byte((byte)'a'), new Character('a'), false, 7); run_CharacterQuery(Character_filterL, shortParameter, new Short((short)'M'), new Character('M'), true, 5); run_CharacterQuery(Character_filterR, shortParameter, new Short((short)'F'), new Character('F'), false, 5); run_CharacterQuery(Character_filterL, ShortParameter, new Short((short)'A'), new Character('A'), true, 8); run_CharacterQuery(Character_filterR, ShortParameter, new Short((short)'A'), new Character('A'), false, 3); run_CharacterQuery(Character_filterL, intParameter, new Integer('z'), new Character('z'), true, 3); run_CharacterQuery(Character_filterR, intParameter, new Integer('z'), new Character('z'), false, 9); run_CharacterQuery(Character_filterL, IntegerParameter, new Integer('B'), new Character('B'), true, 7); run_CharacterQuery(Character_filterR, IntegerParameter, new Integer('B'), new Character('B'), false, 4); run_CharacterQuery(Character_filterL, longParameter, new Long('z'), new Character('z'), true, 3); run_CharacterQuery(Character_filterR, longParameter, new Long('z'), new Character('z'), false, 9); run_CharacterQuery(Character_filterL, LongParameter, new Long('B'), new Character('B'), true, 7); run_CharacterQuery(Character_filterR, LongParameter, new Long('B'), new Character('B'), false, 4); run_CharacterQuery(Character_filterL, floatParameter, new Float('z'), new Character('z'), true, 3); run_CharacterQuery(Character_filterR, floatParameter, new Float('z'), new Character('z'), false, 9); run_CharacterQuery(Character_filterL, FloatParameter, new Float('M'), new Character('M'), true, 5); run_CharacterQuery(Character_filterR, FloatParameter, new Float('X'), new Character('X'), false, 7); run_CharacterQuery(Character_filterL, doubleParameter, new Double('B'), new Character('B'), true, 7); run_CharacterQuery(Character_filterR, doubleParameter, new Double('B'), new Character('B'), false, 4); run_CharacterQuery(Character_filterL, DoubleParameter, new Double('A'), new Character('A'), true, 8); run_CharacterQuery(Character_filterR, DoubleParameter, new Double('A'), new Character('A'), false, 3); run_CharacterQuery(Character_filterL, BigIntegerParameter, new BigInteger("65"), new Character('A'), true, 8); // 'A' == 65 run_CharacterQuery(Character_filterR, BigIntegerParameter, new BigInteger("122"), new Character('z'), false, 9); // 'z' == 122 run_CharacterQuery(Character_filterL, BigDecimalParameter, new BigDecimal("65.00000"), new Character('A'), true, 8); run_CharacterQuery(Character_filterR, BigDecimalParameter, new BigDecimal("77.0000"), new Character('M'), false, 7); // 'M' == 77 alltypes.setCharacter(new Character('A')); run_CharacterQuery(Character_filterObj, AllTypesParameter, alltypes, new Character('A'), true, 8); alltypes.setCharacter(new Character('b')); run_CharacterQuery(Character_filterObj, AllTypesParameter, alltypes, new Character('b'), true, 3); run_CharacterQuery(Character_filterVal, null, null, new Character('z'), false, 9); run_IntegerQuery(Integer_filterL, intParameter, new Integer(AllTypes.veryLargeNegativeInt), new Integer(AllTypes.veryLargeNegativeInt), true, 10); run_IntegerQuery(Integer_filterR, intParameter, new Integer(AllTypes.veryLargePositiveInt), new Integer(AllTypes.veryLargePositiveInt), false, 10); run_IntegerQuery(Integer_filterR, intParameter, new Integer(23), new Integer(23), false, 4); run_IntegerQuery(Integer_filterL, IntegerParameter, new Integer(1000000), new Integer(1000000), true, 2); run_IntegerQuery(Integer_filterR, IntegerParameter, new Integer(1000), new Integer(1000), false, 7); run_IntegerQuery(Integer_filterL, byteParameter, new Byte((byte)100), new Integer(100), true, 6); run_IntegerQuery(Integer_filterR, byteParameter, new Byte((byte)0), new Integer(0), false, 4); run_IntegerQuery(Integer_filterL, ByteParameter, new Byte((byte)100), new Integer(100), true, 6); run_IntegerQuery(Integer_filterR, ByteParameter, new Byte((byte)0), new Integer(0), false, 4); run_IntegerQuery(Integer_filterL, shortParameter, new Short((short)10000), new Integer(10000), true, 3); run_IntegerQuery(Integer_filterR, shortParameter, new Short((short)-1000), new Integer(-1000), false, 3); run_IntegerQuery(Integer_filterL, ShortParameter, new Short((short)-1000), new Integer(-1000), true, 8); run_IntegerQuery(Integer_filterR, ShortParameter, new Short((short)-999), new Integer(-999), false, 3); run_IntegerQuery(Integer_filterL, charParameter, new Character((char)10000), new Integer(10000), true, 3); run_IntegerQuery(Integer_filterR, charParameter, new Character((char)10000), new Integer(10000), false, 8); run_IntegerQuery(Integer_filterL, CharacterParameter, new Character((char)100), new Integer(100), true, 6); run_IntegerQuery(Integer_filterR, CharacterParameter, new Character((char)10000), new Integer(10000), false, 8); run_IntegerQuery(Integer_filterL, longParameter, new Long(AllTypes.veryLargePositiveInt), new Integer(AllTypes.veryLargePositiveInt), true, 1); run_IntegerQuery(Integer_filterR, longParameter, new Long(AllTypes.veryLargeNegativeInt), new Integer(AllTypes.veryLargeNegativeInt), false, 1); run_IntegerQuery(Integer_filterL, LongParameter, new Long(10000), new Integer(10000), true, 3); run_IntegerQuery(Integer_filterR, LongParameter, new Long(43), new Integer(43), false, 4); run_IntegerQuery(Integer_filterL, floatParameter, new Float(AllTypes.veryLargePositiveInt), new Integer(AllTypes.veryLargePositiveInt), true, 1); run_IntegerQuery(Integer_filterR, floatParameter, new Float(AllTypes.veryLargeNegativeInt), new Integer(AllTypes.veryLargeNegativeInt), false, 1); run_IntegerQuery(Integer_filterL, FloatParameter, new Float(10000), new Integer(10000), true, 3); run_IntegerQuery(Integer_filterR, FloatParameter, new Float(43), new Integer(43), false, 4); run_IntegerQuery(Integer_filterL, doubleParameter, new Double(AllTypes.veryLargePositiveInt), new Integer(AllTypes.veryLargePositiveInt), true, 1); run_IntegerQuery(Integer_filterR, doubleParameter, new Double(AllTypes.veryLargeNegativeInt), new Integer(AllTypes.veryLargeNegativeInt), false, 1); run_IntegerQuery(Integer_filterL, DoubleParameter, new Double(10000), new Integer(10000), true, 3); run_IntegerQuery(Integer_filterR, DoubleParameter, new Double(1000001.0), new Integer(1000001), false, 9); run_IntegerQuery(Integer_filterL, BigIntegerParameter, new BigInteger("1000000"), new Integer(1000000), true, 2); run_IntegerQuery(Integer_filterR, BigIntegerParameter, new BigInteger("1000"), new Integer(1000), false, 7); run_IntegerQuery(Integer_filterL, BigDecimalParameter, new BigDecimal("10000.0"), new Integer(10000), true, 3); run_IntegerQuery(Integer_filterR, BigDecimalParameter, new BigDecimal("43.0"), new Integer(43), false, 4); alltypes.setInteger(new Integer(100)); run_IntegerQuery(Integer_filterObj, AllTypesParameter, alltypes, new Integer(100), false, 6); run_IntegerQuery(Integer_filterVal, null, null, new Integer(100), false, 6); run_LongQuery(Long_filterL, longParameter, new Long(Long.MIN_VALUE), new Long(Long.MIN_VALUE), true, 10); run_LongQuery(Long_filterR, longParameter, new Long(Long.MAX_VALUE), new Long(Long.MAX_VALUE), false, 10); run_LongQuery(Long_filterL, LongParameter, new Long(100), new Long(100), true, 5); run_LongQuery(Long_filterR, LongParameter, new Long(23), new Long(23), false, 5); run_LongQuery(Long_filterL, byteParameter, new Byte((byte)100), new Long(100), true, 5); run_LongQuery(Long_filterR, byteParameter, new Byte((byte)0), new Long(0), false, 5); run_LongQuery(Long_filterL, ByteParameter, new Byte((byte)100), new Long(100), true, 5); run_LongQuery(Long_filterR, ByteParameter, new Byte((byte)0), new Long(0), false, 5); run_LongQuery(Long_filterL, shortParameter, new Short((short)-1000 ), new Long(-1000), true, 8); run_LongQuery(Long_filterR, shortParameter, new Short((short)1000), new Long(1000), false, 8); run_LongQuery(Long_filterL, ShortParameter, new Short((short)101), new Long(101), true, 3); run_LongQuery(Long_filterR, ShortParameter, new Short((short)32), new Long(32), false, 5); run_LongQuery(Long_filterL, charParameter, new Character((char)0), new Long(0), true, 6); run_LongQuery(Long_filterR, charParameter, new Character((char)100), new Long(100), false, 7); run_LongQuery(Long_filterL, CharacterParameter, new Character((char)23), new Long(23), true, 5); run_LongQuery(Long_filterR, CharacterParameter, new Character((char)1110), new Long(1110), false, 8); run_LongQuery(Long_filterL, intParameter, new Integer(100), new Long(100), true, 5); run_LongQuery(Long_filterR, intParameter, new Integer(0), new Long(0), false, 5); run_LongQuery(Long_filterL, IntegerParameter, new Integer(23), new Long(23), true, 5); run_LongQuery(Long_filterR, IntegerParameter, new Integer(1000000), new Long(1000000), false, 9); run_LongQuery(Long_filterL, floatParameter, new Float(-1000000.0), new Long(-1000000), true, 9); run_LongQuery(Long_filterR, floatParameter, new Float((float)Long.MAX_VALUE), new Long(Long.MAX_VALUE), false, 10); run_LongQuery(Long_filterL, FloatParameter, new Float(100.0f), new Long(100), true, 5); run_LongQuery(Long_filterR, FloatParameter, new Float(32.0f), new Long(32), false, 5); run_LongQuery(Long_filterL, doubleParameter, new Double(-1000000.0), new Long(-1000000), true, 9); run_LongQuery(Long_filterR, doubleParameter, new Double((double)Long.MAX_VALUE), new Long(Long.MAX_VALUE), false, 10); run_LongQuery(Long_filterL, DoubleParameter, new Double(100.0), new Long(100), true, 5); run_LongQuery(Long_filterR, DoubleParameter, new Double(32.0), new Long(32), false, 5); run_LongQuery(Long_filterL, BigIntegerParameter, new BigInteger("23"), new Long(23), true, 5); run_LongQuery(Long_filterR, BigIntegerParameter, new BigInteger("1000000"), new Long(1000000), false, 9); run_LongQuery(Long_filterL, BigDecimalParameter, new BigDecimal("100.0"), new Long(100), true, 5); run_LongQuery(Long_filterR, BigDecimalParameter, new BigDecimal("32.0"), new Long(32), false, 5); alltypes.setLong(new Long(100)); run_LongQuery(Long_filterObj, AllTypesParameter, alltypes, new Long(100), true, 5); run_LongQuery(Long_filterVal, null, null, new Long(-1000), true, 8); run_FloatQuery(Float_filterL, floatParameter, new Float(-1000000000.0f), new Float(-1000000000.0f), true, 9); run_FloatQuery(Float_filterR, floatParameter, new Float(100.0f), new Float(100.0f), false, 5); run_FloatQuery(Float_filterL, FloatParameter, new Float(0.0), new Float(0.0f), true, 8); run_FloatQuery(Float_filterR, FloatParameter, new Float(4.0), new Float(4.0f), false, 3); run_FloatQuery(Float_filterL, byteParameter, new Byte((byte)0), new Float(0.0f), true, 8); run_FloatQuery(Float_filterR, byteParameter, new Byte((byte)23), new Float(23.0f), false, 3); run_FloatQuery(Float_filterL, ByteParameter, new Byte((byte)34), new Float(34.0f), true, 7); run_FloatQuery(Float_filterR, ByteParameter, new Byte((byte)100), new Float(100.0f), false, 5); run_FloatQuery(Float_filterL, shortParameter, new Short((short)0), new Float(0.0f), true, 8); run_FloatQuery(Float_filterR, shortParameter, new Short((short)23), new Float(23.0f), false, 3); run_FloatQuery(Float_filterL, ShortParameter, new Short((short)34), new Float(34.0f), true, 7); run_FloatQuery(Float_filterR, ShortParameter, new Short((short)100), new Float(100.0f), false, 5); run_FloatQuery(Float_filterL, charParameter, new Character((char)0), new Float(0.0f), true, 8); run_FloatQuery(Float_filterR, charParameter, new Character((char)23), new Float(23.0f), false, 3); run_FloatQuery(Float_filterL, CharacterParameter, new Character((char)34), new Float(34.0f), true, 7); run_FloatQuery(Float_filterR, CharacterParameter, new Character((char)100), new Float(100.0f), false, 5); run_FloatQuery(Float_filterL, intParameter, new Integer(50000000), new Float(50000000.0f), true, 3); run_FloatQuery(Float_filterR, intParameter, new Integer(23), new Float(23.0f), false, 3); run_FloatQuery(Float_filterL, IntegerParameter, new Integer(34), new Float(34.0f), true, 7); run_FloatQuery(Float_filterR, IntegerParameter, new Integer(100), new Float(100.0f), false, 5); run_FloatQuery(Float_filterL, longParameter, new Long(50000000), new Float(50000000.0f), true, 3); run_FloatQuery(Float_filterR, longParameter, new Long(23), new Float(23.0f), false, 3); run_FloatQuery(Float_filterL, LongParameter, new Long(34), new Float(34.0f), true, 7); run_FloatQuery(Float_filterR, LongParameter, new Long(100), new Float(100.0f), false, 5); run_FloatQuery(Float_filterL, doubleParameter, new Double(50000000.0f), new Float(50000000.0f), true, 3); run_FloatQuery(Float_filterR, doubleParameter, new Double(100.0f), new Float(100.0f), false, 5); run_FloatQuery(Float_filterL, DoubleParameter, new Double(0.0f), new Float(0.0f), true, 8); run_FloatQuery(Float_filterR, DoubleParameter, new Double(100.0f), new Float(100.0f), false, 5); run_FloatQuery(Float_filterL, BigIntegerParameter, new BigInteger("55000000"), new Float(55000000.0f), true, 2); run_FloatQuery(Float_filterR, BigIntegerParameter, new BigInteger("23"), new Float(23.0f), false, 3); run_FloatQuery(Float_filterL, BigDecimalParameter, new BigDecimal("55000000.0"), new Float(55000000.0f), true, 2); run_FloatQuery(Float_filterR, BigDecimalParameter, new BigDecimal("-20.5"), new Float(-20.5f), false, 2); alltypes.setFloat(new Float(23.23f)); run_FloatQuery(Float_filterObj, AllTypesParameter, alltypes, new Float(23.23f), false, 3); run_FloatQuery(Float_filterVal, null, null, new Float(100.0f), true, 7); run_DoubleQuery(Double_filterL, doubleParameter, new Double(-999999999999.0), new Double(-999999999999.0), true, 9); run_DoubleQuery(Double_filterR, doubleParameter, new Double(9999999999999.0), new Double(9999999999999.0), false, 9); run_DoubleQuery(Double_filterL, DoubleParameter, new Double(0.0), new Double(0.0), true, 7); run_DoubleQuery(Double_filterR, DoubleParameter, new Double(23.34), new Double(23.34), false, 4); run_DoubleQuery(Double_filterL, byteParameter, new Byte((byte)100), new Double(100.0), true, 6); run_DoubleQuery(Double_filterR, byteParameter, new Byte((byte)0), new Double(0.0), false, 4); run_DoubleQuery(Double_filterL, ByteParameter, new Byte((byte)-23), new Double(-23.0), true, 7); run_DoubleQuery(Double_filterR, ByteParameter, new Byte((byte)100), new Double(100.0), false, 6); run_DoubleQuery(Double_filterL, shortParameter, new Short((short)100), new Double(100.0), true, 6); run_DoubleQuery(Double_filterR, shortParameter, new Short((short)0), new Double(0.0), false, 4); run_DoubleQuery(Double_filterL, ShortParameter, new Short((short)23), new Double(23.0), true, 6); run_DoubleQuery(Double_filterR, ShortParameter, new Short((short)400), new Double(400.0), false, 7); run_DoubleQuery(Double_filterL, charParameter, new Character((char)100), new Double(100.0), true, 6); run_DoubleQuery(Double_filterR, charParameter, new Character((char)0), new Double(0.0), false, 4); run_DoubleQuery(Double_filterL, CharacterParameter, new Character((char)23), new Double(23.0), true, 6); run_DoubleQuery(Double_filterR, CharacterParameter, new Character((char)400), new Double(400.0), false, 7); run_DoubleQuery(Double_filterL, intParameter, new Integer(100), new Double(100.0), true, 6); run_DoubleQuery(Double_filterR, intParameter, new Integer(0), new Double(0.0), false, 4); run_DoubleQuery(Double_filterL, IntegerParameter, new Integer(23), new Double(23.0), true, 6); run_DoubleQuery(Double_filterR, IntegerParameter, new Integer(100), new Double(100.0), false, 6); run_DoubleQuery(Double_filterL, longParameter, new Long(100), new Double(100.0), true, 6); run_DoubleQuery(Double_filterR, longParameter, new Long(0), new Double(0.0), false, 4); run_DoubleQuery(Double_filterL, LongParameter, new Long(23), new Double(23.0), true, 6); run_DoubleQuery(Double_filterR, LongParameter, new Long(100), new Double(100.0), false, 6); run_DoubleQuery(Double_filterL, floatParameter, new Float(0.0f), new Double(0.0f), true, 7); run_DoubleQuery(Double_filterR, floatParameter, new Float(100.0f), new Double(100.0f), false, 6); run_DoubleQuery(Double_filterL, FloatParameter, new Float(100.0f), new Double(100.0f), true, 6); run_DoubleQuery(Double_filterR, FloatParameter, new Float(69.96f), new Double(69.96), false, 4); run_DoubleQuery(Double_filterL, BigIntegerParameter, new BigInteger("5000"), new Double(5000.0), true, 3); run_DoubleQuery(Double_filterR, BigIntegerParameter, new BigInteger("-20"), new Double(-20.0), false, 3); run_DoubleQuery(Double_filterL, BigDecimalParameter, new BigDecimal("100.0"), new Double(100.0), true, 6); run_DoubleQuery(Double_filterR, BigDecimalParameter, new BigDecimal("69.96"), new Double(69.96), false, 4); alltypes.setDouble(new Double(-999999999999.0)); run_DoubleQuery(Double_filterObj, AllTypesParameter, alltypes, new Double(-999999999999.0), true, 9); run_DoubleQuery(Double_filterVal, null, null, new Double(100.0), false, 6); run_StringQuery(String_filterL, StringParameter, new String("JDO"), new String("JDO"), true, 9); run_StringQuery(String_filterR, StringParameter, new String("JDBC"), new String("JDBC"), false, 1); alltypes.setString(new String("abcde")); run_StringQuery(String_filterObj, AllTypesParameter, alltypes, new String("abcde"), true, 3); run_StringQuery(String_filterVal1, null, null, new String("Java"), false, 6); run_StringQuery(String_filterVal2, null, null, new String(""), false, 1); BigDecimal bd = new BigDecimal("100.0"); run_BigDecimalQuery(BigDecimal_filterL, BigDecimalParameter, bd, bd, true, 6); bd = new BigDecimal("-234234.23333"); run_BigDecimalQuery(BigDecimal_filterR, BigDecimalParameter, bd, bd, false, 2); bd = new BigDecimal("989899.33304953"); run_BigDecimalQuery(BigDecimal_filterL, BigDecimalParameter, bd, bd, true, 3); bd = new BigDecimal("-1123123.22"); run_BigDecimalQuery(BigDecimal_filterR, BigDecimalParameter, bd, bd, false, 1); alltypes.setBigDecimal(bd); run_BigDecimalQuery(BigDecimal_filterObj, AllTypesParameter, alltypes, bd, true, 10); BigInteger bi = new BigInteger("987034534985043985"); run_BigIntegerQuery(BigInteger_filterL, BigIntegerParameter, bi, bi, true, 1); bi = new BigInteger("-999999999999999999"); run_BigIntegerQuery(BigInteger_filterR, BigIntegerParameter, bi, bi, false, 1); bi = new BigInteger("-9999999999999999999"); run_BigIntegerQuery(BigInteger_filterR, BigIntegerParameter, bi, bi, false, 0); bi = new BigInteger("1333330"); alltypes.setBigInteger(bi); run_BigIntegerQuery(BigInteger_filterObj, AllTypesParameter, alltypes, bi, false, 8); GregorianCalendar gc = new GregorianCalendar(TimeZone.getTimeZone("GMT"), Locale.UK); gc.clear(); gc.set(1999, Calendar.DECEMBER, 31, 9, 0, 0); Date d = gc.getTime(); run_DateQuery(Date_filterL, DateParameter, d, d, true, 3); gc.set(1992, Calendar.NOVEMBER, 22, 9, 0, 0); d = gc.getTime(); run_DateQuery(Date_filterR, DateParameter, d, d, false, 6); gc.set(1959, Calendar.OCTOBER, 9, 9, 0, 0); d = gc.getTime(); run_DateQuery(Date_filterR, DateParameter, d, d, false, 3); gc.set(1995, Calendar.JUNE, 14, 9, 0, 0); d = gc.getTime(); alltypes.setDate(d); run_DateQuery(Date_filterObj, AllTypesParameter, alltypes, d, false, 7); } private void run_byteQuery(String filter, String parameter, Object parameterValue, byte value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); byte val = obj.getbyte(); boolean correct_value = valueOnLeft ? value <= val : val <= value; if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL LessThanOrEqual test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL LessThanOrEqual test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_shortQuery(String filter, String parameter, Object parameterValue, short value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); short val = obj.getshort(); boolean correct_value = valueOnLeft ? value <= val : val <= value; if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL LessThanOrEqual test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL LessThanOrEqual test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_charQuery(String filter, String parameter, Object parameterValue, char value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); char val = obj.getchar(); boolean correct_value = valueOnLeft ? value <= val : val <= value; if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL LessThanOrEqual test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL LessThanOrEqual test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_intQuery(String filter, String parameter, Object parameterValue, int value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); int val = obj.getint(); boolean correct_value = valueOnLeft ? value <= val : val <= value; if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL LessThanOrEqual test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL LessThanOrEqual test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_longQuery(String filter, String parameter, Object parameterValue, long value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); long val = obj.getlong(); boolean correct_value = valueOnLeft ? value <= val : val <= value; if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL LessThanOrEqual test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL LessThanOrEqual test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_floatQuery(String filter, String parameter, Object parameterValue, float value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); float val = obj.getfloat(); boolean correct_value = valueOnLeft ? value <= val : val <= value; if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL LessThanOrEqual test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL LessThanOrEqual test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_doubleQuery(String filter, String parameter, Object parameterValue, double value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); double val = obj.getdouble(); boolean correct_value = valueOnLeft ? value <= val : val <= value; if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL LessThanOrEqual test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL LessThanOrEqual test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_ByteQuery(String filter, String parameter, Object parameterValue, Byte value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); Byte val = obj.getByte(); boolean correct_value = valueOnLeft ? (value.compareTo(val) <= 0) : (val.compareTo(value) <= 0); if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL LessThanOrEqual test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL LessThanOrEqual test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_ShortQuery(String filter, String parameter, Object parameterValue, Short value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); Short val = obj.getShort(); boolean correct_value = valueOnLeft ? (value.compareTo(val) <= 0) : (val.compareTo(value) <= 0); if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL LessThanOrEqual test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL LessThanOrEqual test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_CharacterQuery(String filter, String parameter, Object parameterValue, Character value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); Character val = obj.getCharacter(); boolean correct_value = valueOnLeft ? (value.compareTo(val) <= 0) : (val.compareTo(value) <= 0); if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL LessThanOrEqual test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL LessThanOrEqual test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_IntegerQuery(String filter, String parameter, Object parameterValue, Integer value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); Integer val = obj.getInteger(); boolean correct_value = valueOnLeft ? (value.compareTo(val) <= 0) : (val.compareTo(value) <= 0); if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL LessThanOrEqual test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL LessThanOrEqual test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_LongQuery(String filter, String parameter, Object parameterValue, Long value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); Long val = obj.getLong(); boolean correct_value = valueOnLeft ? (value.compareTo(val) <= 0) : (val.compareTo(value) <= 0); if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL LessThanOrEqual test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL LessThanOrEqual test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_FloatQuery(String filter, String parameter, Object parameterValue, Float value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); Float val = obj.getFloat(); boolean correct_value = valueOnLeft ? (value.compareTo(val) <= 0) : (val.compareTo(value) <= 0); if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL LessThanOrEqual test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL LessThanOrEqual test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_DoubleQuery(String filter, String parameter, Object parameterValue, Double value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); Double val = obj.getDouble(); boolean correct_value = valueOnLeft ? (value.compareTo(val) <= 0) : (val.compareTo(value) <= 0); if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL LessThanOrEqual test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL LessThanOrEqual test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_StringQuery(String filter, String parameter, Object parameterValue, String value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); String val = obj.getString(); boolean correct_value = valueOnLeft ? (value.compareTo(val) <= 0) : (val.compareTo(value) <= 0); if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL LessThanOrEqual test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL LessThanOrEqual test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_BigDecimalQuery(String filter, String parameter, Object parameterValue, BigDecimal value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); BigDecimal val = obj.getBigDecimal(); boolean correct_value = valueOnLeft ? (value.compareTo(val) <= 0) : (val.compareTo(value) <= 0); if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL LessThanOrEqual test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL LessThanOrEqual test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_BigIntegerQuery(String filter, String parameter, Object parameterValue, BigInteger value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); BigInteger val = obj.getBigInteger(); boolean correct_value = valueOnLeft ? (value.compareTo(val) <= 0) : (val.compareTo(value) <= 0); if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL LessThanOrEqual test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL LessThanOrEqual test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_DateQuery(String filter, String parameter, Object parameterValue, Date value, boolean valueOnLeft, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); Date val = obj.getDate(); boolean correct_value = valueOnLeft ? (value.compareTo(val) <= 0) : (val.compareTo(value) <= 0); if( !correct_value ){ fail(ASSERTION_FAILED, "JDOQL LessThanOrEqual test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL LessThanOrEqual test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } /** */ protected void localSetUp() { addTearDownClass(AllTypes.class); AllTypes.load(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/operators/LogicalComplement.java100664 7010 12500110373 27460 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.operators; import java.util.Collection; import java.util.HashSet; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PrimitiveTypes; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: LogicalComplement Query Operator *
*Keywords: query *
*Assertion ID: A14.6.2-32. *
*Assertion Description: The logical complement operator (!) is supported for all types as they are defined in the Java language. This includes the following types:
  • Boolean, boolean
*/ public class LogicalComplement extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-32 (LogicalComplement) failed: "; /** * The main 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(LogicalComplement.class); } /** */ public void testPositive() { PersistenceManager pm = getPM(); if (debug) logger.debug("\nExecuting test LogicalComplement() ..."); Transaction tx = pm.currentTransaction(); tx.begin(); Collection instancesLess3 = (Collection)pm.newQuery( PrimitiveTypes.class, "id < 3").execute(); Collection allEvenInstances = (Collection)pm.newQuery( PrimitiveTypes.class, "booleanNull == false").execute(); Collection allInstances = (Collection)pm.newQuery( PrimitiveTypes.class, "true").execute(); Collection empty = new HashSet(); // case !false runSimplePrimitiveTypesQuery("! false", pm, allInstances, ASSERTION_FAILED); // case !true runSimplePrimitiveTypesQuery("! true", pm, empty, ASSERTION_FAILED); // case !boolean runSimplePrimitiveTypesQuery("! booleanNotNull", pm, allEvenInstances, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("! (id >= 3)", pm, instancesLess3, ASSERTION_FAILED); // case ! Boolean runSimplePrimitiveTypesQuery("! booleanNull", pm, allEvenInstances, ASSERTION_FAILED); tx.commit(); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PrimitiveTypes.class); loadAndPersistPrimitiveTypes(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/operators/Modulo.java100664 12023 12500110373 25341 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.operators; import java.util.Collection; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Person; import org.apache.jdo.tck.pc.mylib.PrimitiveTypes; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Modulo operator. *
*Keywords: query *
*Assertion ID: A14.6.2-40. *
*Assertion Description: * modulo operator */ public class Modulo extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-40 (Modulo) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ "personid % 2 == 0", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** * The expected results of valid queries. */ private Object[] expectedResult = { getTransientCompanyModelInstancesAsList(new String[]{"emp2", "emp4"}) }; /** * The main 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(Modulo.class); } /** */ public void testPositive() { for (int i = 0; i < VALID_QUERIES.length; i++) { executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); } runTestUsingPrimitiveTypes(); } /** */ private void runTestUsingPrimitiveTypes() { PersistenceManager pm = getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); Collection instance4 = (Collection)pm.newQuery( PrimitiveTypes.class, "id == 10").execute(); runSimplePrimitiveTypesQuery("id % 10 == 0", pm, instance4, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("byteNotNull % 10 == 0", pm, instance4, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("shortNotNull % 10 == 0", pm, instance4, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("intNotNull % 10 == 0", pm, instance4, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("longNotNull % 10 == 0", pm, instance4, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("byteNull % 10 == 0", pm, instance4, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("shortNull % 10 == 0", pm, instance4, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("intNull % 10 == 0", pm, instance4, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("longNull % 10 == 0", pm, instance4, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("bigInteger % 10 == 0", pm, instance4, ASSERTION_FAILED); tx.commit(); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); addTearDownClass(PrimitiveTypes.class); PersistenceManager pm = getPM(); loadAndPersistCompanyModel(pm); loadAndPersistPrimitiveTypes(pm); } } tck/src/java/org/apache/jdo/tck/query/jdoql/operators/Multiplication.java100664 11507 12500110373 27105 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.operators; import java.util.Collection; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PrimitiveTypes; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Multiplication Query Operator *
*Keywords: query *
*Assertion ID: A14.6.2-30. *
*Assertion Description: The multiplication operator (*) is supported for all types as they are defined in the Java language. This includes the following types:
  • byte, short, int, long, char, Byte, Short Integer, Long, Character
  • float, double, Float, Double
  • BigDecimal, BigInteger
The operation on object-valued fields of wrapper types (Boolean, Byte, Short, Integer, Long, Float, and Double), and numeric types (BigDecimal and BigInteger) use the wrapped values as operands. */ public class Multiplication extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-30 (Multiplication) failed: "; /** * The main 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(Multiplication.class); } /** */ public void testPositive() { PersistenceManager pm = getPM(); if (debug) logger.debug("\nExecuting test Multiplication() ..."); Transaction tx = pm.currentTransaction(); tx.begin(); Collection instance4 = (Collection)pm.newQuery( PrimitiveTypes.class, "id == 4").execute(); runSimplePrimitiveTypesQuery("id * 2 == 8", pm, instance4, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("byteNotNull * 2 == 8", pm, instance4, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("shortNotNull * 2 == 8", pm, instance4, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("intNotNull * 2 == 8", pm, instance4, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("longNotNull * 2 == 8", pm, instance4, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("floatNotNull * 2 == 8", pm, instance4, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("doubleNotNull * 2 == 8", pm, instance4, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("byteNull * 2 == 8", pm, instance4, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("shortNull * 2 == 8", pm, instance4, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("intNull * 2 == 8", pm, instance4, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("longNull * 2 == 8", pm, instance4, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("floatNull * 2 == 8", pm, instance4, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("doubleNull * 2 == 8", pm, instance4, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("bigDecimal * 2 == 8", pm, instance4, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("bigInteger * 2 == 8", pm, instance4, ASSERTION_FAILED); tx.commit(); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PrimitiveTypes.class); loadAndPersistPrimitiveTypes(getPM()); } }tck/src/java/org/apache/jdo/tck/query/jdoql/operators/NotEquals.java100664 243242 12500110373 26046 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.operators; import java.math.BigDecimal; import java.math.BigInteger; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; import java.util.Iterator; import java.util.Locale; import java.util.TimeZone; import org.apache.jdo.tck.pc.fieldtypes.AllTypes; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Not Equals Query Operator *
*Keywords: query *
*Assertion ID: A14.6.2-15. *
*Assertion Description: The not equal operator (!=) is supported for the following types:
  • byte, short, int, long, char, Byte, Short Integer, Long, Character
  • float, double, Float, Double
  • BigDecimal, BigInteger
  • Boolean, boolean
  • any class instance or array
  • Date, String
The operation on object-valued fields of wrapper types (Boolean, Byte, Short, Integer, Long, Float, and Double), and numeric types (BigDecimal and BigInteger) use the wrapped values as operands. Inequality comparison of object-valued fields of PersistenceCapable types use the JDO Identity comparison of the references. Thus, two objects will compare not equal if they have different JDO Identity. Equality comparison of object-valued fields of non-PersistenceCapable types uses the equals method of the field type. */ public class NotEquals extends ComparisonTests { private static String boolean_filterL = "value != fld_boolean"; private static String boolean_filterR = "fld_boolean != value"; private static String boolean_filterT = "fld_boolean != true"; private static String boolean_filterF = "false != fld_boolean"; private static String boolean_filterObj = "value.fld_boolean != fld_boolean"; private static String byte_filterL = "value != fld_byte"; private static String byte_filterR = "fld_byte != value"; private static String byte_filterObj = "value.fld_byte != fld_byte"; private static String byte_filterVal = "fld_byte != 100"; private static String char_filterL = "value != fld_char"; private static String char_filterR = "fld_char != value"; private static String char_filterObj = "value.fld_char != fld_char"; private static String char_filterVal = "'M' != fld_char"; private static String double_filterL = "value != fld_double"; private static String double_filterR = "fld_double != value"; private static String double_filterObj = "value.fld_double != fld_double"; private static String double_filterVal = "fld_double != 100.0"; private static String float_filterL = "value != fld_float"; private static String float_filterR = "fld_float != value"; private static String float_filterObj = "fld_float != value.fld_float"; private static String float_filterVal = "fld_float != 100.0"; private static String int_filterL = "value != fld_int"; private static String int_filterR = "fld_int != value"; private static String int_filterObj = "value.fld_int != fld_int"; private static String int_filterVal = "fld_int != 1000"; private static String long_filterL = "value != fld_long"; private static String long_filterR = "fld_long != value"; private static String long_filterObj = "fld_long != value.fld_long"; private static String long_filterVal = "fld_long != 1000000"; private static String short_filterL = "value != fld_short"; private static String short_filterR = "fld_short != value"; private static String short_filterObj = "value.fld_short != fld_short"; private static String short_filterVal = "1000 != fld_short"; private static String Boolean_filterL = "value != fld_Boolean"; private static String Boolean_filterR = "fld_Boolean != value"; private static String Boolean_filterT = "fld_Boolean != true"; private static String Boolean_filterF = "false != fld_Boolean"; private static String Boolean_filterObj = "value.fld_Boolean != fld_Boolean"; private static String Boolean_filterVal = "fld_Boolean != false"; private static String Byte_filterL = "value != fld_Byte"; private static String Byte_filterR = "fld_Byte != value"; private static String Byte_filterObj = "fld_Byte != value.fld_Byte"; private static String Byte_filterVal = "100 != fld_Byte"; private static String Character_filterL = "value != fld_Character"; private static String Character_filterR = "fld_Character != value"; private static String Character_filterObj = "value.fld_Character != fld_Character"; private static String Character_filterVal = "fld_Character != 'z'"; private static String Double_filterL = "value != fld_Double"; private static String Double_filterR = "fld_Double != value"; private static String Double_filterObj = "value.fld_Double != fld_Double"; private static String Double_filterVal = "fld_Double != 100.0"; private static String Float_filterL = "value != fld_Float"; private static String Float_filterR = "fld_Float != value"; private static String Float_filterObj = "fld_Float != value.fld_Float"; private static String Float_filterVal = "100.0f != fld_Float"; private static String Integer_filterL = "value != fld_Integer"; private static String Integer_filterR = "fld_Integer != value"; private static String Integer_filterObj = "fld_Integer != value.fld_Integer"; private static String Integer_filterVal = "fld_Integer != 100"; private static String Long_filterL = "value != fld_Long"; private static String Long_filterR = "fld_Long != value"; private static String Long_filterObj = "value.fld_Long != fld_Long"; private static String Long_filterVal = "-1000 != fld_Long"; private static String Short_filterL = "value != fld_Short"; private static String Short_filterR = "fld_Short != value"; private static String Short_filterObj = "fld_Short != value.fld_Short"; private static String Short_filterVal = "-1000 != fld_Short"; private static String String_filterL = "value != fld_String"; private static String String_filterR = "fld_String != value"; private static String String_filterObj = "value.fld_String != fld_String"; private static String String_filterVal1 = "fld_String != \"Java\""; private static String String_filterVal2 = "fld_String != \"\""; private static String Locale_filterL = "value != fld_Locale"; private static String Locale_filterR = "fld_Locale != value"; private static String Locale_filterObj = "value.fld_Locale != fld_Locale"; private static String Date_filterL = "value != fld_Date"; private static String Date_filterR = "fld_Date != value"; private static String Date_filterObj = "fld_Date != value.fld_Date"; private static String BigDecimal_filterL = "value != fld_BigDecimal"; private static String BigDecimal_filterR = "fld_BigDecimal != value"; private static String BigDecimal_filterObj = "value.fld_BigDecimal != fld_BigDecimal"; private static String BigInteger_filterL = "value != fld_BigInteger"; private static String BigInteger_filterR = "fld_BigInteger != value"; private static String BigInteger_filterObj = "fld_BigInteger != value.fld_BigInteger"; /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-15 (NotEquals) failed: "; /** * The main 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(NotEquals.class); } /** */ public void test() { pm = getPM(); tx = pm.currentTransaction(); runQueries(); } /** */ private void runQueries() { Boolean trueBoolean = new Boolean(true); Boolean falseBoolean = new Boolean(false); run_booleanQuery(boolean_filterL, booleanParameter, trueBoolean, true, 6); run_booleanQuery(boolean_filterL, booleanParameter, falseBoolean, false, 4); run_booleanQuery(boolean_filterR, booleanParameter, trueBoolean, true, 6); run_booleanQuery(boolean_filterR, booleanParameter, falseBoolean, false, 4); run_booleanQuery(boolean_filterL, BooleanParameter, trueBoolean, true, 6); run_booleanQuery(boolean_filterL, BooleanParameter, falseBoolean, false, 4); run_booleanQuery(boolean_filterR, BooleanParameter, trueBoolean, true, 6); run_booleanQuery(boolean_filterR, BooleanParameter, falseBoolean, false, 4); run_booleanQuery(boolean_filterT, null, null, true, 6); run_booleanQuery(boolean_filterF, null, null, false, 4); AllTypes alltypes = new AllTypes(); alltypes.setboolean(true); run_booleanQuery(boolean_filterObj, AllTypesParameter, alltypes, true, 6); alltypes.setboolean(false); run_booleanQuery(boolean_filterObj, AllTypesParameter, alltypes, false, 4); run_byteQuery(byte_filterL, byteParameter, new Byte((byte)50), (byte)50, 8); run_byteQuery(byte_filterR, byteParameter, new Byte(Byte.MIN_VALUE), Byte.MIN_VALUE, 9); run_byteQuery(byte_filterL, ByteParameter, new Byte((byte)20), (byte)20, 10); run_byteQuery(byte_filterR, ByteParameter, new Byte(Byte.MAX_VALUE), Byte.MAX_VALUE, 9); run_byteQuery(byte_filterL, shortParameter, new Short((short)50), (byte)50, 8); run_byteQuery(byte_filterR, shortParameter, new Short((short)50), (byte)50, 8); run_byteQuery(byte_filterL, ShortParameter, new Short((short)-100), (byte)-100, 9); run_byteQuery(byte_filterR, ShortParameter, new Short((short)-100), (byte)-100, 9); run_byteQuery(byte_filterL, charParameter, new Character((char)50), (byte)50, 8); run_byteQuery(byte_filterR, charParameter, new Character((char)50), (byte)50, 8); run_byteQuery(byte_filterL, CharacterParameter, new Character((char)50), (byte)50, 8); run_byteQuery(byte_filterR, CharacterParameter, new Character((char)100), (byte)100, 9); run_byteQuery(byte_filterL, intParameter, new Integer(50), (byte)50, 8); run_byteQuery(byte_filterR, intParameter, new Integer(50), (byte)50, 8); run_byteQuery(byte_filterL, IntegerParameter, new Integer(-100), (byte)-100, 9); run_byteQuery(byte_filterR, IntegerParameter, new Integer(-100), (byte)-100, 9); run_byteQuery(byte_filterL, longParameter, new Long(50), (byte)50, 8); run_byteQuery(byte_filterR, longParameter, new Long(50), (byte)50, 8); run_byteQuery(byte_filterL, LongParameter, new Long(-100), (byte)-100, 9); run_byteQuery(byte_filterR, LongParameter, new Long(-100), (byte)-100, 9); run_byteQuery(byte_filterL, floatParameter, new Float(50), (byte)50, 8); run_byteQuery(byte_filterR, floatParameter, new Float(50), (byte)50, 8); run_byteQuery(byte_filterL, FloatParameter, new Float(-100), (byte)-100, 9); run_byteQuery(byte_filterR, FloatParameter, new Float(-100), (byte)-100, 9); run_byteQuery(byte_filterL, doubleParameter, new Double(50), (byte)50, 8); run_byteQuery(byte_filterR, doubleParameter, new Double(50), (byte)50, 8); run_byteQuery(byte_filterL, DoubleParameter, new Double(-100), (byte)-100, 9); run_byteQuery(byte_filterR, DoubleParameter, new Double(-100), (byte)-100, 9); run_byteQuery(byte_filterL, BigIntegerParameter, new BigInteger("50"), (byte)50, 8); run_byteQuery(byte_filterR, BigIntegerParameter, new BigInteger("-100"), (byte)-100, 9); run_byteQuery(byte_filterL, BigDecimalParameter, new BigDecimal("100.0"), (byte)100, 9); run_byteQuery(byte_filterR, BigDecimalParameter, new BigDecimal("10.0"), (byte)10, 9); alltypes.setbyte((byte)50); run_byteQuery(byte_filterObj, AllTypesParameter, alltypes, (byte)50, 8); alltypes.setbyte((byte)45); run_byteQuery(byte_filterObj, AllTypesParameter, alltypes, (byte)45, 10); run_byteQuery(byte_filterVal, null, null, (byte)100, 9); run_shortQuery(short_filterL, shortParameter, new Short((short)100), (short)100, 8); run_shortQuery(short_filterR, shortParameter, new Short((short)100), (short)100, 8); run_shortQuery(short_filterL, ShortParameter, new Short(Short.MIN_VALUE), Short.MIN_VALUE, 9); run_shortQuery(short_filterR, ShortParameter, new Short((short)253), (short)253, 10); run_shortQuery(short_filterR, shortParameter, new Short((short)1000), (short)1000, 9); run_shortQuery(short_filterL, byteParameter, new Byte((byte)75), (short)75, 10); run_shortQuery(short_filterR, byteParameter, new Byte((byte)75), (short)75, 10); run_shortQuery(short_filterL, ByteParameter, new Byte((byte)100), (short)100, 8); run_shortQuery(short_filterR, ByteParameter, new Byte((byte)100), (short)100, 8); run_shortQuery(short_filterL, charParameter, new Character((char)75), (short)75, 10); run_shortQuery(short_filterR, charParameter, new Character((char)75), (short)75, 10); run_shortQuery(short_filterL, CharacterParameter, new Character((char)100), (short)100, 8); run_shortQuery(short_filterR, CharacterParameter, new Character((char)100), (short)100, 8); run_shortQuery(short_filterL, intParameter, new Integer(-10000), (short)-10000, 9); run_shortQuery(short_filterR, intParameter, new Integer(-10000), (short)-10000, 9); run_shortQuery(short_filterL, IntegerParameter, new Integer(10000), (short)10000, 9); run_shortQuery(short_filterR, IntegerParameter, new Integer(10000), (short)10000, 9); run_shortQuery(short_filterL, longParameter, new Long(10000), (short) 10000, 9); run_shortQuery(short_filterR, longParameter, new Long(10000), (short) 10000, 9); run_shortQuery(short_filterL, LongParameter, new Long(100), (short)100, 8); run_shortQuery(short_filterR, LongParameter, new Long(100), (short)100, 8); run_shortQuery(short_filterL, floatParameter, new Float(23000), (short)23000, 10); run_shortQuery(short_filterR, floatParameter, new Float(23000), (short)23000, 10); run_shortQuery(short_filterL, FloatParameter, new Float(100), (short)100, 8); run_shortQuery(short_filterR, FloatParameter, new Float(100), (short)100, 8); run_shortQuery(short_filterL, doubleParameter, new Double(-10000), (short)-10000, 9); run_shortQuery(short_filterR, doubleParameter, new Double(-10000), (short)-10000, 9); run_shortQuery(short_filterL, DoubleParameter, new Double(23), (short)23, 10); run_shortQuery(short_filterR, DoubleParameter, new Double(23), (short)23, 10); run_shortQuery(short_filterL, BigIntegerParameter, new BigInteger("999"), (short)999, 10); run_shortQuery(short_filterR, BigIntegerParameter, new BigInteger("-1000"), (short)-1000, 9); run_shortQuery(short_filterL, BigDecimalParameter, new BigDecimal("100.0"), (short)100, 8); run_shortQuery(short_filterR, BigDecimalParameter, new BigDecimal("0.0"), (short)0, 9); alltypes.setshort((short)100); run_shortQuery(short_filterObj, AllTypesParameter, alltypes, (short)100, 8); alltypes.setshort((short)23); run_shortQuery(short_filterObj, AllTypesParameter, alltypes, (short)23, 10); run_shortQuery(short_filterVal, null, null, (short)1000, 9); run_charQuery(char_filterL, charParameter, new Character(Character.MIN_VALUE), Character.MIN_VALUE, 9); run_charQuery(char_filterR, charParameter, new Character(Character.MAX_VALUE), Character.MAX_VALUE, 9); run_charQuery(char_filterL, charParameter, new Character('C'), 'C', 10); run_charQuery(char_filterR, charParameter, new Character('z'), 'z', 8); run_charQuery(char_filterL, CharacterParameter, new Character(' '), ' ', 9); run_charQuery(char_filterR, CharacterParameter, new Character('f'), 'f', 10); run_charQuery(char_filterL, byteParameter, new Byte((byte)Character.MIN_VALUE), (char)Character.MIN_VALUE, 9); run_charQuery(char_filterR, byteParameter, new Byte((byte)122), 'z', 8); run_charQuery(char_filterL, ByteParameter, new Byte((byte)'a'), 'a', 10); run_charQuery(char_filterR, ByteParameter, new Byte((byte)'a'), 'a', 10); run_charQuery(char_filterL, shortParameter, new Short((short)'M'), 'M', 8); run_charQuery(char_filterR, shortParameter, new Short((short)'M'), 'M', 8); run_charQuery(char_filterL, ShortParameter, new Short((short)'A'), 'A', 9); run_charQuery(char_filterR, ShortParameter, new Short((short)'A'), 'A', 9); run_charQuery(char_filterL, intParameter, new Integer('z'), 'z', 8); run_charQuery(char_filterR, intParameter, new Integer('z'), 'z', 8); run_charQuery(char_filterL, IntegerParameter, new Integer('B'), 'B', 9); run_charQuery(char_filterR, IntegerParameter, new Integer('B'), 'B', 9); run_charQuery(char_filterL, longParameter, new Long('z'), 'z', 8); run_charQuery(char_filterR, longParameter, new Long('z'), 'z', 8); run_charQuery(char_filterL, LongParameter, new Long('B'), 'B', 9); run_charQuery(char_filterR, LongParameter, new Long('B'), 'B', 9); run_charQuery(char_filterL, floatParameter, new Float(123.222), 'x', 10); run_charQuery(char_filterR, floatParameter, new Float(123.222), 'x', 10); run_charQuery(char_filterL, FloatParameter, new Float('z'), 'z', 8); run_charQuery(char_filterR, FloatParameter, new Float('z'), 'z', 8); run_charQuery(char_filterL, doubleParameter, new Double('B'), 'B', 9); run_charQuery(char_filterR, doubleParameter, new Double('B'), 'B', 9); run_charQuery(char_filterL, DoubleParameter, new Double('A'), 'A', 9); run_charQuery(char_filterR, DoubleParameter, new Double('A'), 'A', 9); run_charQuery(char_filterL, BigIntegerParameter, new BigInteger("65"), 'A', 9); // 'A' == 65 run_charQuery(char_filterR, BigIntegerParameter, new BigInteger("122"), 'z', 8); // 'z' == 122 run_charQuery(char_filterL, BigDecimalParameter, new BigDecimal("65.0"), 'A', 9); run_charQuery(char_filterR, BigDecimalParameter, new BigDecimal("77.0"), 'M', 8); // 'M' == 77 alltypes.setchar('A'); run_charQuery(char_filterObj, AllTypesParameter, alltypes, 'A', 9); alltypes.setchar('b'); run_charQuery(char_filterObj, AllTypesParameter, alltypes, 'b', 10); run_charQuery(char_filterVal, null, null, 'M', 8); run_intQuery(int_filterL, intParameter, new Integer(AllTypes.veryLargeNegativeInt), AllTypes.veryLargeNegativeInt, 9); run_intQuery(int_filterR, intParameter, new Integer(AllTypes.veryLargePositiveInt), AllTypes.veryLargePositiveInt, 9); run_intQuery(int_filterR, intParameter, new Integer(23), 23, 10); run_intQuery(int_filterL, IntegerParameter, new Integer(1000000), 1000000, 9); run_intQuery(int_filterR, IntegerParameter, new Integer(1000), 1000, 9); run_intQuery(int_filterL, byteParameter, new Byte((byte)100), 100, 8); run_intQuery(int_filterR, byteParameter, new Byte((byte)0), 0, 9); run_intQuery(int_filterL, ByteParameter, new Byte((byte)100), 100, 8); run_intQuery(int_filterR, ByteParameter, new Byte((byte)0), 0, 9); run_intQuery(int_filterL, shortParameter, new Short((short)10000), 10000, 9); run_intQuery(int_filterR, shortParameter, new Short((short)-1000), -1000, 9); run_intQuery(int_filterL, ShortParameter, new Short((short)-1000), -1000, 9); run_intQuery(int_filterR, ShortParameter, new Short((short)10000), 10000, 9); run_intQuery(int_filterL, charParameter, new Character((char)10000), 10000, 9); run_intQuery(int_filterR, charParameter, new Character((char)0), 0, 9); run_intQuery(int_filterL, CharacterParameter, new Character((char)100), 100, 8); run_intQuery(int_filterR, CharacterParameter, new Character((char)10000), 10000, 9); run_intQuery(int_filterL, longParameter, new Long(AllTypes.veryLargePositiveInt), AllTypes.veryLargePositiveInt, 9); run_intQuery(int_filterR, longParameter, new Long(AllTypes.veryLargeNegativeInt), AllTypes.veryLargeNegativeInt, 9); run_intQuery(int_filterL, LongParameter, new Long(10000), 10000, 9); run_intQuery(int_filterR, LongParameter, new Long(43), 43, 10); run_intQuery(int_filterL, floatParameter, new Float(AllTypes.veryLargePositiveInt), AllTypes.veryLargePositiveInt, 9); run_intQuery(int_filterR, floatParameter, new Float(AllTypes.veryLargeNegativeInt), AllTypes.veryLargeNegativeInt, 9); run_intQuery(int_filterL, FloatParameter, new Float(10000), 10000, 9); run_intQuery(int_filterR, FloatParameter, new Float(43), 43, 10); run_intQuery(int_filterL, doubleParameter, new Double(AllTypes.veryLargePositiveInt), AllTypes.veryLargePositiveInt, 9); run_intQuery(int_filterR, doubleParameter, new Double(AllTypes.veryLargeNegativeInt), AllTypes.veryLargeNegativeInt, 9); run_intQuery(int_filterL, DoubleParameter, new Double(10000), 10000, 9); run_intQuery(int_filterR, DoubleParameter, new Double(43), 43, 10); run_intQuery(int_filterL, BigIntegerParameter, new BigInteger("1000000"), 1000000, 9); run_intQuery(int_filterR, BigIntegerParameter, new BigInteger("-1000000"), -1000000, 9); run_intQuery(int_filterL, BigDecimalParameter, new BigDecimal("1000000.0"), 1000000, 9); run_intQuery(int_filterR, BigDecimalParameter, new BigDecimal("-1000000.0"), -1000000, 9); alltypes.setint(100); run_intQuery(int_filterObj, AllTypesParameter, alltypes, 100, 8); run_intQuery(int_filterVal, null, null, 1000, 9); run_longQuery(long_filterL, longParameter, new Long(Long.MIN_VALUE), Long.MIN_VALUE, 9); run_longQuery(long_filterR, longParameter, new Long(Long.MAX_VALUE), Long.MAX_VALUE, 9); run_longQuery(long_filterL, LongParameter, new Long(100), 100, 8); run_longQuery(long_filterR, LongParameter, new Long(23), 23, 10); run_longQuery(long_filterL, byteParameter, new Byte((byte)100), 100, 8); run_longQuery(long_filterR, byteParameter, new Byte((byte)0), 0, 9); run_longQuery(long_filterL, ByteParameter, new Byte((byte)100), 100, 8); run_longQuery(long_filterR, ByteParameter, new Byte((byte)0), 0, 9); run_longQuery(long_filterL, shortParameter, new Short((short)-1000 ), -1000, 8); run_longQuery(long_filterR, shortParameter, new Short((short)1000), 1000, 9); run_longQuery(long_filterL, ShortParameter, new Short((short)100), 100, 8); run_longQuery(long_filterR, ShortParameter, new Short((short)32), 32, 10); run_longQuery(long_filterL, charParameter, new Character((char)0), 0, 9); run_longQuery(long_filterR, charParameter, new Character((char)100), 100, 8); run_longQuery(long_filterL, CharacterParameter, new Character((char)23), 23, 10); run_longQuery(long_filterR, CharacterParameter, new Character((char)0), 0, 9); run_longQuery(long_filterL, intParameter, new Integer(100), 100, 8); run_longQuery(long_filterR, intParameter, new Integer(0), 0, 9); run_longQuery(long_filterL, IntegerParameter, new Integer(23), 23, 10); run_longQuery(long_filterR, IntegerParameter, new Integer(1000000), 1000000, 9); run_longQuery(long_filterL, floatParameter, new Float(-1000000.0), -1000000, 9); // run_longQuery(long_filterR, floatParameter, new Float((float)Long.MAX_VALUE), Long.MAX_VALUE, 9); run_longQuery(long_filterL, FloatParameter, new Float(100), 100, 8); run_longQuery(long_filterR, FloatParameter, new Float(32), 32, 10); run_longQuery(long_filterL, doubleParameter, new Double(-1000000.0), -1000000, 9); // run_longQuery(long_filterR, doubleParameter, new Double((double)Long.MAX_VALUE), Long.MAX_VALUE, 9); run_longQuery(long_filterL, DoubleParameter, new Double(100), 100, 8); run_longQuery(long_filterR, DoubleParameter, new Double(32), 32, 10); run_longQuery(long_filterL, BigIntegerParameter, new BigInteger("1000000"), 1000000, 9); run_longQuery(long_filterR, BigIntegerParameter, new BigInteger("-1000000"), -1000000, 9); run_longQuery(long_filterL, BigDecimalParameter, new BigDecimal("10000.0"), 10000, 10); run_longQuery(long_filterR, BigDecimalParameter, new BigDecimal("-1000000.0"), -1000000, 9); alltypes.setlong(100); run_longQuery(long_filterObj, AllTypesParameter, alltypes, 100, 8); run_longQuery(long_filterVal, null, null, 1000000, 9); run_floatQuery(float_filterL, floatParameter, new Float(100.0f), 100.0f, 8); run_floatQuery(float_filterR, floatParameter, new Float(100.0f), 100.0f, 8); run_floatQuery(float_filterL, FloatParameter, new Float(0.0), 0.0f, 9); run_floatQuery(float_filterR, FloatParameter, new Float(4.0), 4.0f, 10); run_floatQuery(float_filterL, byteParameter, new Byte((byte)0), 0.0f, 9); run_floatQuery(float_filterR, byteParameter, new Byte((byte)23), 23.0f, 10); run_floatQuery(float_filterL, ByteParameter, new Byte((byte)34), 34.0f, 10); run_floatQuery(float_filterR, ByteParameter, new Byte((byte)100), 100.0f, 8); run_floatQuery(float_filterL, shortParameter, new Short((short)0), 0.0f, 9); run_floatQuery(float_filterR, shortParameter, new Short((short)23), 23.0f, 10); run_floatQuery(float_filterL, ShortParameter, new Short((short)34), 34.0f, 10); run_floatQuery(float_filterR, ShortParameter, new Short((short)100), 100.0f, 8); run_floatQuery(float_filterL, charParameter, new Character((char)0), 0.0f, 9); run_floatQuery(float_filterR, charParameter, new Character((char)23), 23.0f, 10); run_floatQuery(float_filterL, CharacterParameter, new Character((char)34), 34.0f, 10); run_floatQuery(float_filterR, CharacterParameter, new Character((char)100), 100.0f, 8); run_floatQuery(float_filterL, intParameter, new Integer(50000000), 50000000.0f, 9); run_floatQuery(float_filterR, intParameter, new Integer(23), 23.0f, 10); run_floatQuery(float_filterL, IntegerParameter, new Integer(34), 34.0f, 10); run_floatQuery(float_filterR, IntegerParameter, new Integer(100), 100.0f, 8); run_floatQuery(float_filterL, longParameter, new Long(50000000), 50000000.0f, 9); run_floatQuery(float_filterR, longParameter, new Long(23), 23.0f, 10); run_floatQuery(float_filterL, LongParameter, new Long(34), 34.0f, 10); run_floatQuery(float_filterR, LongParameter, new Long(100), 100.0f, 8); run_floatQuery(float_filterL, doubleParameter, new Double(50000000.0f), 50000000.0f, 9); run_floatQuery(float_filterR, doubleParameter, new Double(0.0f), 0.0f, 9); run_floatQuery(float_filterL, DoubleParameter, new Double(0.0f), 0.0f, 9); run_floatQuery(float_filterR, DoubleParameter, new Double(100.0f), 100.0f, 8); run_floatQuery(float_filterL, BigIntegerParameter, new BigInteger("0"), 0.0f, 9); run_floatQuery(float_filterR, BigIntegerParameter, new BigInteger("1000000000"), 1000000000.0f, 9); run_floatQuery(float_filterL, BigDecimalParameter, new BigDecimal("-234.23"), -234.23f, 9); run_floatQuery(float_filterR, BigDecimalParameter, new BigDecimal("100.0"), 100.0f, 8); alltypes.setfloat(23.23f); run_floatQuery(float_filterObj, AllTypesParameter, alltypes, 23.23f, 10); run_floatQuery(float_filterVal, null, null, 100.0f, 8); run_doubleQuery(double_filterL, doubleParameter, new Double(350.5), 350.5, 9); run_doubleQuery(double_filterR, doubleParameter, new Double(350.5), 350.5, 9); run_doubleQuery(double_filterL, DoubleParameter, new Double(0.0), 0.0, 9); run_doubleQuery(double_filterR, DoubleParameter, new Double(23.34), 23.34, 10); run_doubleQuery(double_filterL, byteParameter, new Byte((byte)100), 100.0, 8); run_doubleQuery(double_filterR, byteParameter, new Byte((byte)0), 0.0, 9); run_doubleQuery(double_filterL, ByteParameter, new Byte((byte)23), 23.0, 10); run_doubleQuery(double_filterR, ByteParameter, new Byte((byte)100), 100.0, 8); run_doubleQuery(double_filterL, shortParameter, new Short((short)100), 100.0, 8); run_doubleQuery(double_filterR, shortParameter, new Short((short)0), 0.0, 9); run_doubleQuery(double_filterL, ShortParameter, new Short((short)23), 23.0, 10); run_doubleQuery(double_filterR, ShortParameter, new Short((short)100), 100.0, 8); run_doubleQuery(double_filterL, intParameter, new Integer(100), 100.0, 8); run_doubleQuery(double_filterR, intParameter, new Integer(0), 0.0, 9); run_doubleQuery(double_filterL, IntegerParameter, new Integer(23), 23.0, 10); run_doubleQuery(double_filterR, IntegerParameter, new Integer(100), 100.0, 8); run_doubleQuery(double_filterL, longParameter, new Long(100), 100.0, 8); run_doubleQuery(double_filterR, longParameter, new Long(0), 0.0, 9); run_doubleQuery(double_filterL, LongParameter, new Long(23), 23.0, 10); run_doubleQuery(double_filterR, LongParameter, new Long(100), 100.0, 8); run_doubleQuery(double_filterL, floatParameter, new Float(0.0f), 0.0, 9); run_doubleQuery(double_filterR, floatParameter, new Float(100.0f), 100.0, 8); run_doubleQuery(double_filterL, FloatParameter, new Float(100.0f), 100.0, 8); run_doubleQuery(double_filterR, FloatParameter, new Float(69.96f), 69.96, 10); run_doubleQuery(double_filterL, BigIntegerParameter, new BigInteger("50000000"), 50000000.0, 9); run_doubleQuery(double_filterR, BigIntegerParameter, new BigInteger("1000000000"), 1000000000.0, 9); run_doubleQuery(double_filterL, BigDecimalParameter, new BigDecimal("350.5"), 350.5, 9); run_doubleQuery(double_filterR, BigDecimalParameter, new BigDecimal("-234234.234"), -234234.234, 9); alltypes.setdouble(0.0); run_doubleQuery(double_filterObj, AllTypesParameter, alltypes, 0.0, 9); run_doubleQuery(double_filterVal, null, null, 100.0, 8); run_BooleanQuery(Boolean_filterL, booleanParameter, trueBoolean, trueBoolean, 6); run_BooleanQuery(Boolean_filterL, booleanParameter, falseBoolean, falseBoolean, 4); run_BooleanQuery(Boolean_filterR, booleanParameter, trueBoolean, trueBoolean, 6); run_BooleanQuery(Boolean_filterR, booleanParameter, falseBoolean, falseBoolean, 4); run_BooleanQuery(Boolean_filterL, BooleanParameter, trueBoolean, trueBoolean, 6); run_BooleanQuery(Boolean_filterL, BooleanParameter, falseBoolean, falseBoolean, 4); run_BooleanQuery(Boolean_filterR, BooleanParameter, trueBoolean, trueBoolean, 6); run_BooleanQuery(Boolean_filterR, BooleanParameter, falseBoolean, falseBoolean, 4); run_BooleanQuery(Boolean_filterT, null, trueBoolean, trueBoolean, 6); run_BooleanQuery(Boolean_filterF, null, falseBoolean, falseBoolean, 4); alltypes.setBoolean(trueBoolean); run_BooleanQuery(Boolean_filterObj, AllTypesParameter, alltypes, trueBoolean, 6); alltypes.setBoolean(falseBoolean); run_BooleanQuery(Boolean_filterObj, AllTypesParameter, alltypes, falseBoolean, 4); run_ByteQuery(Byte_filterL, byteParameter, new Byte((byte)50), new Byte((byte)50), 8); run_ByteQuery(Byte_filterR, byteParameter, new Byte(Byte.MIN_VALUE), new Byte(Byte.MIN_VALUE), 9); run_ByteQuery(Byte_filterL, ByteParameter, new Byte((byte)20), new Byte((byte)20), 10); run_ByteQuery(Byte_filterR, ByteParameter, new Byte(Byte.MAX_VALUE), new Byte(Byte.MAX_VALUE), 9); run_ByteQuery(Byte_filterL, shortParameter, new Short((short)50), new Byte((byte)50), 8); run_ByteQuery(Byte_filterR, shortParameter, new Short((short)50), new Byte((byte)50), 8); run_ByteQuery(Byte_filterL, ShortParameter, new Short((short)-100), new Byte((byte)-100), 9); run_ByteQuery(Byte_filterR, ShortParameter, new Short((short)-100), new Byte((byte)-100), 9); run_ByteQuery(Byte_filterL, charParameter, new Character((char)50), new Byte((byte)50), 8); run_ByteQuery(Byte_filterR, charParameter, new Character((char)50), new Byte((byte)50), 8); run_ByteQuery(Byte_filterL, CharacterParameter, new Character((char)50), new Byte((byte)50), 8); run_ByteQuery(Byte_filterR, CharacterParameter, new Character((char)75), new Byte((byte)75), 9); run_ByteQuery(Byte_filterL, intParameter, new Integer(50), new Byte((byte)50), 8); run_ByteQuery(Byte_filterR, intParameter, new Integer(50), new Byte((byte)50), 8); run_ByteQuery(Byte_filterL, IntegerParameter, new Integer(50), new Byte((byte)50), 8); run_ByteQuery(Byte_filterR, IntegerParameter, new Integer(75), new Byte((byte)75), 9); run_ByteQuery(Byte_filterL, longParameter, new Long(50), new Byte((byte)50), 8); run_ByteQuery(Byte_filterR, longParameter, new Long(50), new Byte((byte)50), 8); run_ByteQuery(Byte_filterL, LongParameter, new Long(-100), new Byte((byte)-100), 9); run_ByteQuery(Byte_filterR, LongParameter, new Long(-100), new Byte((byte)-100), 9); run_ByteQuery(Byte_filterL, floatParameter, new Float(50), new Byte((byte)50), 8); run_ByteQuery(Byte_filterR, floatParameter, new Float(50), new Byte((byte)50), 8); run_ByteQuery(Byte_filterL, FloatParameter, new Float(-100), new Byte((byte)-100), 9); run_ByteQuery(Byte_filterR, FloatParameter, new Float(-100), new Byte((byte)-100), 9); run_ByteQuery(Byte_filterL, doubleParameter, new Double(50), new Byte((byte)50), 8); run_ByteQuery(Byte_filterR, doubleParameter, new Double(50), new Byte((byte)50), 8); run_ByteQuery(Byte_filterL, DoubleParameter, new Double(-100), new Byte((byte)-100), 9); run_ByteQuery(Byte_filterR, DoubleParameter, new Double(-100), new Byte((byte)-100), 9); run_ByteQuery(Byte_filterL, BigIntegerParameter, new BigInteger("50"), new Byte((byte)50), 8); run_ByteQuery(Byte_filterR, BigIntegerParameter, new BigInteger("-100"), new Byte((byte)-100), 9); run_ByteQuery(Byte_filterL, BigDecimalParameter, new BigDecimal("100.0"), new Byte((byte)100), 9); run_ByteQuery(Byte_filterR, BigDecimalParameter, new BigDecimal("10.0"), new Byte((byte)10), 9); Byte val = new Byte((byte)50); alltypes.setByte(val); run_ByteQuery(Byte_filterObj, AllTypesParameter, alltypes, val, 8); val = new Byte((byte)45); alltypes.setByte(val); run_ByteQuery(Byte_filterObj, AllTypesParameter, alltypes, val, 10); run_ByteQuery(Byte_filterVal, null, null, new Byte((byte)100), 9); run_ShortQuery(Short_filterL, shortParameter, new Short((short)100), new Short((short)100), 8); run_ShortQuery(Short_filterR, shortParameter, new Short((short)100), new Short((short)100), 8); run_ShortQuery(Short_filterL, ShortParameter, new Short(Short.MIN_VALUE), new Short(Short.MIN_VALUE), 9); run_ShortQuery(Short_filterR, ShortParameter, new Short((short)253), new Short((short)253), 10); run_ShortQuery(Short_filterR, shortParameter, new Short((short)1000), new Short((short)1000), 9); run_ShortQuery(Short_filterL, byteParameter, new Byte((byte)75), new Short((short)75), 10); run_ShortQuery(Short_filterR, byteParameter, new Byte((byte)75), new Short((short)75), 10); run_ShortQuery(Short_filterL, ByteParameter, new Byte((byte)100), new Short((short)100), 8); run_ShortQuery(Short_filterR, ByteParameter, new Byte((byte)100), new Short((short)100), 8); run_ShortQuery(Short_filterL, charParameter, new Character((char)75), new Short((short)75), 10); run_ShortQuery(Short_filterR, charParameter, new Character((char)75), new Short((short)75), 10); run_ShortQuery(Short_filterL, CharacterParameter, new Character((char)100), new Short((short)100), 8); run_ShortQuery(Short_filterR, CharacterParameter, new Character((char)100), new Short((short)100), 8); run_ShortQuery(Short_filterL, intParameter, new Integer(-10000), new Short((short)-10000), 9); run_ShortQuery(Short_filterR, intParameter, new Integer(-10000), new Short((short)-10000), 9); run_ShortQuery(Short_filterL, IntegerParameter, new Integer(10000), new Short((short)10000), 9); run_ShortQuery(Short_filterR, IntegerParameter, new Integer(10000), new Short((short)10000), 9); run_ShortQuery(Short_filterL, longParameter, new Long(10000), new Short((short) 10000), 9); run_ShortQuery(Short_filterR, longParameter, new Long(10000), new Short((short) 10000), 9); run_ShortQuery(Short_filterL, LongParameter, new Long(100), new Short((short)100), 8); run_ShortQuery(Short_filterR, LongParameter, new Long(100), new Short((short)100), 8); run_ShortQuery(Short_filterL, floatParameter, new Float(23000), new Short((short)23000), 10); run_ShortQuery(Short_filterR, floatParameter, new Float(23000), new Short((short)23000), 10); run_ShortQuery(Short_filterL, FloatParameter, new Float(100), new Short((short)100), 8); run_ShortQuery(Short_filterR, FloatParameter, new Float(100), new Short((short)100), 8); run_ShortQuery(Short_filterL, doubleParameter, new Double(-10000), new Short((short)-10000), 9); run_ShortQuery(Short_filterR, doubleParameter, new Double(-10000), new Short((short)-10000), 9); run_ShortQuery(Short_filterL, DoubleParameter, new Double(23), new Short((short)23), 10); run_ShortQuery(Short_filterR, DoubleParameter, new Double(23), new Short((short)23), 10); run_ShortQuery(Short_filterL, BigIntegerParameter, new BigInteger("999"), new Short((short)999), 10); run_ShortQuery(Short_filterR, BigIntegerParameter, new BigInteger("-1000"), new Short((short)-1000), 9); run_ShortQuery(Short_filterL, BigDecimalParameter, new BigDecimal("100.0"), new Short((short)100), 8); run_ShortQuery(Short_filterR, BigDecimalParameter, new BigDecimal("10000.0"), new Short((short)10000), 9); Short sval = new Short((short)100); alltypes.setShort(sval); run_ShortQuery(Short_filterObj, AllTypesParameter, alltypes, sval, 8); sval = new Short((short)23); alltypes.setShort(sval); run_ShortQuery(Short_filterObj, AllTypesParameter, alltypes, sval, 10); run_ShortQuery(Short_filterVal, null, null, new Short((short)-1000), 9); run_CharacterQuery(Character_filterL, charParameter, new Character(Character.MIN_VALUE), new Character(Character.MIN_VALUE), 9); run_CharacterQuery(Character_filterR, charParameter, new Character(Character.MAX_VALUE), new Character(Character.MAX_VALUE), 9); run_CharacterQuery(Character_filterL, charParameter, new Character('C'), new Character('C'), 10); run_CharacterQuery(Character_filterR, charParameter, new Character('z'), new Character('z'), 8); run_CharacterQuery(Character_filterL, CharacterParameter, new Character(' '), new Character(' '), 9); run_CharacterQuery(Character_filterR, CharacterParameter, new Character('f'), new Character('f'), 10); run_CharacterQuery(Character_filterL, byteParameter, new Byte((byte)Character.MIN_VALUE), new Character((char)Character.MIN_VALUE), 9); run_CharacterQuery(Character_filterR, ByteParameter, new Byte((byte)'a'), new Character('a'), 10); run_CharacterQuery(Character_filterL, shortParameter, new Short((short)'M'), new Character('M'), 8); run_CharacterQuery(Character_filterR, shortParameter, new Short((short)'F'), new Character('F'), 9); run_CharacterQuery(Character_filterL, ShortParameter, new Short((short)'A'), new Character('A'), 9); run_CharacterQuery(Character_filterR, ShortParameter, new Short((short)'A'), new Character('A'), 9); run_CharacterQuery(Character_filterL, intParameter, new Integer('z'), new Character('z'), 8); run_CharacterQuery(Character_filterR, intParameter, new Integer('z'), new Character('z'), 8); run_CharacterQuery(Character_filterL, IntegerParameter, new Integer('B'), new Character('B'), 9); run_CharacterQuery(Character_filterR, IntegerParameter, new Integer('B'), new Character('B'), 9); run_CharacterQuery(Character_filterL, longParameter, new Long('z'), new Character('z'), 8); run_CharacterQuery(Character_filterR, longParameter, new Long('z'), new Character('z'), 8); run_CharacterQuery(Character_filterL, LongParameter, new Long('B'), new Character('B'), 9); run_CharacterQuery(Character_filterR, LongParameter, new Long('B'), new Character('B'), 9); run_CharacterQuery(Character_filterL, floatParameter, new Float(123.222), new Character('x'), 10); run_CharacterQuery(Character_filterR, floatParameter, new Float(123.222), new Character('x'), 10); run_CharacterQuery(Character_filterL, FloatParameter, new Float('z'), new Character('z'), 8); run_CharacterQuery(Character_filterR, FloatParameter, new Float('z'), new Character('z'), 8); run_CharacterQuery(Character_filterL, doubleParameter, new Double('B'), new Character('B'), 9); run_CharacterQuery(Character_filterR, doubleParameter, new Double('B'), new Character('B'), 9); run_CharacterQuery(Character_filterL, DoubleParameter, new Double('A'), new Character('A'), 9); run_CharacterQuery(Character_filterR, DoubleParameter, new Double('A'), new Character('A'), 9); run_CharacterQuery(Character_filterL, BigIntegerParameter, new BigInteger("65"), new Character('A'), 9); // 'A' == 65 run_CharacterQuery(Character_filterR, BigIntegerParameter, new BigInteger("122"), new Character('z'), 8); // 'z' == 122 run_CharacterQuery(Character_filterL, BigDecimalParameter, new BigDecimal("65.000000"), new Character('A'), 9); run_CharacterQuery(Character_filterR, BigDecimalParameter, new BigDecimal("77.0"), new Character('M'), 8); // 'M' == 77 alltypes.setCharacter(new Character('A')); run_CharacterQuery(Character_filterObj, AllTypesParameter, alltypes, new Character('A'), 9); alltypes.setCharacter(new Character('b')); run_CharacterQuery(Character_filterObj, AllTypesParameter, alltypes, new Character('b'), 10); run_CharacterQuery(Character_filterVal, null, null, new Character('z'), 8); run_IntegerQuery(Integer_filterL, intParameter, new Integer(AllTypes.veryLargeNegativeInt), new Integer(AllTypes.veryLargeNegativeInt), 9); run_IntegerQuery(Integer_filterR, intParameter, new Integer(AllTypes.veryLargePositiveInt), new Integer(AllTypes.veryLargePositiveInt), 9); run_IntegerQuery(Integer_filterR, intParameter, new Integer(23), new Integer(23), 10); run_IntegerQuery(Integer_filterL, IntegerParameter, new Integer(1000000), new Integer(1000000), 9); run_IntegerQuery(Integer_filterR, IntegerParameter, new Integer(1000), new Integer(1000), 9); run_IntegerQuery(Integer_filterL, byteParameter, new Byte((byte)100), new Integer(100), 8); run_IntegerQuery(Integer_filterR, byteParameter, new Byte((byte)0), new Integer(0), 9); run_IntegerQuery(Integer_filterL, ByteParameter, new Byte((byte)100), new Integer(100), 8); run_IntegerQuery(Integer_filterR, ByteParameter, new Byte((byte)0), new Integer(0), 9); run_IntegerQuery(Integer_filterL, shortParameter, new Short((short)10000), new Integer(10000), 9); run_IntegerQuery(Integer_filterR, shortParameter, new Short((short)-1000), new Integer(-1000), 9); run_IntegerQuery(Integer_filterL, ShortParameter, new Short((short)-1000), new Integer(-1000), 9); run_IntegerQuery(Integer_filterL, charParameter, new Character((char)10000), new Integer(10000), 9); run_IntegerQuery(Integer_filterR, charParameter, new Character((char)100), new Integer(100), 8); run_IntegerQuery(Integer_filterL, CharacterParameter, new Character((char)10000), new Integer(10000), 9); run_IntegerQuery(Integer_filterR, CharacterParameter, new Character((char)10000), new Integer(10000), 9); run_IntegerQuery(Integer_filterL, longParameter, new Long(AllTypes.veryLargePositiveInt), new Integer(AllTypes.veryLargePositiveInt), 9); run_IntegerQuery(Integer_filterR, longParameter, new Long(AllTypes.veryLargeNegativeInt), new Integer(AllTypes.veryLargeNegativeInt), 9); run_IntegerQuery(Integer_filterL, LongParameter, new Long(10000), new Integer(10000), 9); run_IntegerQuery(Integer_filterR, LongParameter, new Long(43), new Integer(43), 10); run_IntegerQuery(Integer_filterL, floatParameter, new Float(AllTypes.veryLargePositiveInt), new Integer(AllTypes.veryLargePositiveInt), 9); run_IntegerQuery(Integer_filterR, floatParameter, new Float(AllTypes.veryLargeNegativeInt), new Integer(AllTypes.veryLargeNegativeInt), 9); run_IntegerQuery(Integer_filterL, FloatParameter, new Float(10000), new Integer(10000), 9); run_IntegerQuery(Integer_filterR, FloatParameter, new Float(43), new Integer(43), 10); run_IntegerQuery(Integer_filterL, doubleParameter, new Double(AllTypes.veryLargePositiveInt), new Integer(AllTypes.veryLargePositiveInt), 9); run_IntegerQuery(Integer_filterR, doubleParameter, new Double(AllTypes.veryLargeNegativeInt), new Integer(AllTypes.veryLargeNegativeInt), 9); run_IntegerQuery(Integer_filterL, DoubleParameter, new Double(10000), new Integer(10000), 9); run_IntegerQuery(Integer_filterR, DoubleParameter, new Double(43), new Integer(43), 10); run_IntegerQuery(Integer_filterL, BigIntegerParameter, new BigInteger("1000000"), new Integer(1000000), 9); run_IntegerQuery(Integer_filterR, BigIntegerParameter, new BigInteger("-1000000"), new Integer(-1000000), 9); run_IntegerQuery(Integer_filterL, BigDecimalParameter, new BigDecimal("1000000.0"), new Integer(1000000), 9); run_IntegerQuery(Integer_filterR, BigDecimalParameter, new BigDecimal("-100000.0"), new Integer(-100000), 10); alltypes.setInteger(new Integer(100)); run_IntegerQuery(Integer_filterObj, AllTypesParameter, alltypes, new Integer(100), 8); run_IntegerQuery(Integer_filterVal, null, null, new Integer(100), 8); run_LongQuery(Long_filterL, longParameter, new Long(Long.MIN_VALUE), new Long(Long.MIN_VALUE), 9); run_LongQuery(Long_filterR, longParameter, new Long(Long.MAX_VALUE), new Long(Long.MAX_VALUE), 9); run_LongQuery(Long_filterL, LongParameter, new Long(100), new Long(100), 8); run_LongQuery(Long_filterR, LongParameter, new Long(23), new Long(23), 10); run_LongQuery(Long_filterL, byteParameter, new Byte((byte)100), new Long(100), 8); run_LongQuery(Long_filterR, byteParameter, new Byte((byte)0), new Long(0), 9); run_LongQuery(Long_filterL, ByteParameter, new Byte((byte)100), new Long(100), 8); run_LongQuery(Long_filterR, ByteParameter, new Byte((byte)0), new Long(0), 9); run_LongQuery(Long_filterL, shortParameter, new Short((short)-1000 ), new Long(-1000), 8); run_LongQuery(Long_filterR, shortParameter, new Short((short)1000), new Long(1000), 9); run_LongQuery(Long_filterL, ShortParameter, new Short((short)100), new Long(100), 8); run_LongQuery(Long_filterR, ShortParameter, new Short((short)32), new Long(32), 10); run_LongQuery(Long_filterL, charParameter, new Character((char)0), new Long(0), 9); run_LongQuery(Long_filterR, charParameter, new Character((char)100), new Long(100), 8); run_LongQuery(Long_filterL, CharacterParameter, new Character((char)23), new Long(23), 10); run_LongQuery(Long_filterR, CharacterParameter, new Character((char)0), new Long(0), 9); run_LongQuery(Long_filterL, intParameter, new Integer(100), new Long(100), 8); run_LongQuery(Long_filterR, intParameter, new Integer(0), new Long(0), 9); run_LongQuery(Long_filterL, IntegerParameter, new Integer(23), new Long(23), 10); run_LongQuery(Long_filterR, IntegerParameter, new Integer(1000000), new Long(1000000), 9); run_LongQuery(Long_filterL, floatParameter, new Float(-1000000.0), new Long(-1000000), 9); // run_LongQuery(Long_filterR, floatParameter, new Float((float)Long.MAX_VALUE), new Long(Long.MAX_VALUE), 9); run_LongQuery(Long_filterL, FloatParameter, new Float(100), new Long(100), 8); run_LongQuery(Long_filterR, FloatParameter, new Float(32), new Long(32), 10); run_LongQuery(Long_filterL, doubleParameter, new Double(-1000000.0), new Long(-1000000), 9); // run_LongQuery(Long_filterR, doubleParameter, new Double((double)Long.MAX_VALUE), new Long(Long.MAX_VALUE), 9); run_LongQuery(Long_filterL, DoubleParameter, new Double(100), new Long(100), 8); run_LongQuery(Long_filterR, DoubleParameter, new Double(32), new Long(32), 10); run_LongQuery(Long_filterL, BigIntegerParameter, new BigInteger("1000000"), new Long(1000000), 9); run_LongQuery(Long_filterR, BigIntegerParameter, new BigInteger("-1000000"), new Long(-1000000), 9); run_LongQuery(Long_filterL, BigDecimalParameter, new BigDecimal("-1000.0"), new Long(-1000), 8); run_LongQuery(Long_filterR, BigDecimalParameter, new BigDecimal("-1000000.0"), new Long(-1000000), 9); alltypes.setLong(new Long(100)); run_LongQuery(Long_filterObj, AllTypesParameter, alltypes, new Long(100), 8); run_LongQuery(Long_filterVal, null, null, new Long(-1000), 8); run_FloatQuery(Float_filterL, floatParameter, new Float(100.0f), new Float(100.0f), 8); run_FloatQuery(Float_filterR, floatParameter, new Float(100.0f), new Float(100.0f), 8); run_FloatQuery(Float_filterL, FloatParameter, new Float(0.0), new Float(0.0f), 9); run_FloatQuery(Float_filterR, FloatParameter, new Float(4.0), new Float(4.0f), 10); run_FloatQuery(Float_filterL, byteParameter, new Byte((byte)0), new Float(0.0f), 9); run_FloatQuery(Float_filterR, byteParameter, new Byte((byte)23), new Float(23.0f), 10); run_FloatQuery(Float_filterL, ByteParameter, new Byte((byte)34), new Float(34.0f), 10); run_FloatQuery(Float_filterR, ByteParameter, new Byte((byte)100), new Float(100.0f), 8); run_FloatQuery(Float_filterL, shortParameter, new Short((short)0), new Float(0.0f), 9); run_FloatQuery(Float_filterR, shortParameter, new Short((short)23), new Float(23.0f), 10); run_FloatQuery(Float_filterL, ShortParameter, new Short((short)34), new Float(34.0f), 10); run_FloatQuery(Float_filterR, ShortParameter, new Short((short)100), new Float(100.0f), 8); run_FloatQuery(Float_filterL, charParameter, new Character((char)0), new Float(0.0f), 9); run_FloatQuery(Float_filterR, charParameter, new Character((char)23), new Float(23.0f), 10); run_FloatQuery(Float_filterL, CharacterParameter, new Character((char)34), new Float(34.0f), 10); run_FloatQuery(Float_filterR, CharacterParameter, new Character((char)100), new Float(100.0f), 8); run_FloatQuery(Float_filterL, intParameter, new Integer(50000000), new Float(50000000.0f), 9); run_FloatQuery(Float_filterR, intParameter, new Integer(23), new Float(23.0f), 10); run_FloatQuery(Float_filterL, IntegerParameter, new Integer(34), new Float(34.0f), 10); run_FloatQuery(Float_filterR, IntegerParameter, new Integer(100), new Float(100.0f), 8); run_FloatQuery(Float_filterL, longParameter, new Long(50000000), new Float(50000000.0f), 9); run_FloatQuery(Float_filterR, longParameter, new Long(23), new Float(23.0f), 10); run_FloatQuery(Float_filterL, LongParameter, new Long(34), new Float(34.0f), 10); run_FloatQuery(Float_filterR, LongParameter, new Long(100), new Float(100.0f), 8); run_FloatQuery(Float_filterL, doubleParameter, new Double(50000000.0f), new Float(50000000.0f), 9); run_FloatQuery(Float_filterR, doubleParameter, new Double(100.0f), new Float(100.0f), 8); run_FloatQuery(Float_filterL, DoubleParameter, new Double(0.0f), new Float(0.0f), 9); run_FloatQuery(Float_filterR, DoubleParameter, new Double(100.0f), new Float(100.0f), 8); run_FloatQuery(Float_filterL, BigIntegerParameter, new BigInteger("50000000"), new Float(50000000.0f), 9); run_FloatQuery(Float_filterR, BigIntegerParameter, new BigInteger("1000000000"), new Float(1000000000.0f), 9); run_FloatQuery(Float_filterL, BigDecimalParameter, new BigDecimal("350.5"), new Float(350.5f), 9); run_FloatQuery(Float_filterR, BigDecimalParameter, new BigDecimal("50000000.0"), new Float(50000000.0f), 9); alltypes.setFloat(new Float(23.23f)); run_FloatQuery(Float_filterObj, AllTypesParameter, alltypes, new Float(23.23f), 10); run_FloatQuery(Float_filterVal, null, null, new Float(100.0f), 8); run_DoubleQuery(Double_filterL, doubleParameter, new Double(-25.5), new Double(-25.5), 9); run_DoubleQuery(Double_filterR, doubleParameter, new Double(-25.5), new Double(-25.5), 9); run_DoubleQuery(Double_filterL, DoubleParameter, new Double(0.0), new Double(0.0), 9); run_DoubleQuery(Double_filterR, DoubleParameter, new Double(23.34), new Double(23.34), 10); run_DoubleQuery(Double_filterL, byteParameter, new Byte((byte)100), new Double(100.0), 8); run_DoubleQuery(Double_filterR, byteParameter, new Byte((byte)0), new Double(0.0), 9); run_DoubleQuery(Double_filterL, ByteParameter, new Byte((byte)23), new Double(23.0), 10); run_DoubleQuery(Double_filterR, ByteParameter, new Byte((byte)100), new Double(100.0), 8); run_DoubleQuery(Double_filterL, shortParameter, new Short((short)100), new Double(100.0), 8); run_DoubleQuery(Double_filterR, shortParameter, new Short((short)0), new Double(0.0), 9); run_DoubleQuery(Double_filterL, ShortParameter, new Short((short)23), new Double(23.0), 10); run_DoubleQuery(Double_filterR, ShortParameter, new Short((short)100), new Double(100.0), 8); run_DoubleQuery(Double_filterL, charParameter, new Character((char)100), new Double(100.0), 8); run_DoubleQuery(Double_filterR, charParameter, new Character((char)0), new Double(0.0), 9); run_DoubleQuery(Double_filterL, CharacterParameter, new Character((char)23), new Double(23.0), 10); run_DoubleQuery(Double_filterR, CharacterParameter, new Character((char)100), new Double(100.0), 8); run_DoubleQuery(Double_filterL, intParameter, new Integer(100), new Double(100.0), 8); run_DoubleQuery(Double_filterR, intParameter, new Integer(0), new Double(0.0), 9); run_DoubleQuery(Double_filterL, IntegerParameter, new Integer(23), new Double(23.0), 10); run_DoubleQuery(Double_filterR, IntegerParameter, new Integer(100), new Double(100.0), 8); run_DoubleQuery(Double_filterL, longParameter, new Long(100), new Double(100.0), 8); run_DoubleQuery(Double_filterR, longParameter, new Long(0), new Double(0.0), 9); run_DoubleQuery(Double_filterL, LongParameter, new Long(23), new Double(23.0), 10); run_DoubleQuery(Double_filterR, LongParameter, new Long(100), new Double(100.0), 8); run_DoubleQuery(Double_filterL, floatParameter, new Float(0.0f), new Double(0.0), 9); run_DoubleQuery(Double_filterR, floatParameter, new Float(100.0f), new Double(100.0), 8); run_DoubleQuery(Double_filterL, FloatParameter, new Float(100.0f), new Double(100.0), 8); run_DoubleQuery(Double_filterR, FloatParameter, new Float(69.96f), new Double(69.96), 10); run_DoubleQuery(Double_filterL, BigIntegerParameter, new BigInteger("50000000"), new Double(50000000.0f), 9); run_DoubleQuery(Double_filterR, BigIntegerParameter, new BigInteger("1000000000"), new Double(1000000000.0f), 9); run_DoubleQuery(Double_filterL, BigDecimalParameter, new BigDecimal("350.5"), new Double(350.5f), 9); run_DoubleQuery(Double_filterR, BigDecimalParameter, new BigDecimal("50000000.0"), new Double(50000000.0f), 9); alltypes.setDouble(new Double(0.0)); run_DoubleQuery(Double_filterObj, AllTypesParameter, alltypes, new Double(0.0), 9); run_DoubleQuery(Double_filterVal, null, null, new Double(100.0), 8); run_StringQuery(String_filterL, StringParameter, new String("JDO"), new String("JDO"), 9); run_StringQuery(String_filterR, StringParameter, new String("JDBC"), new String("JDBC"), 10); alltypes.setString(new String("abcde")); run_StringQuery(String_filterObj, AllTypesParameter, alltypes, new String("abcde"), 9); run_StringQuery(String_filterVal1, null, null, new String("Java"), 8); run_StringQuery(String_filterVal2, null, null, new String(""), 9); run_LocaleQuery(Locale_filterL, LocaleParameter, Locale.CANADA_FRENCH, Locale.CANADA_FRENCH, 10); run_LocaleQuery(Locale_filterR, LocaleParameter, Locale.US, Locale.US, 9); alltypes.setLocale(Locale.UK); run_LocaleQuery(Locale_filterObj, AllTypesParameter, alltypes, Locale.UK, 9); BigDecimal bd = new BigDecimal("100.0"); run_BigDecimalQuery(BigDecimal_filterL, BigDecimalParameter, bd, bd, 8); bd = new BigDecimal("-234234.23333"); run_BigDecimalQuery(BigDecimal_filterR, BigDecimalParameter, bd, bd, 9); bd = new BigDecimal("989899.33304953"); run_BigDecimalQuery(BigDecimal_filterL, BigDecimalParameter, bd, bd, 10); bd = new BigDecimal("-1123123.22"); run_BigDecimalQuery(BigDecimal_filterR, BigDecimalParameter, bd, bd, 9); alltypes.setBigDecimal(bd); run_BigDecimalQuery(BigDecimal_filterObj, AllTypesParameter, alltypes, bd, 9); BigInteger bi = new BigInteger("987034534985043985"); run_BigIntegerQuery(BigInteger_filterL, BigIntegerParameter, bi, bi, 9); bi = new BigInteger("-999999999999999999"); run_BigIntegerQuery(BigInteger_filterR, BigIntegerParameter, bi, bi, 9); bi = new BigInteger("-99999999999999999"); run_BigIntegerQuery(BigInteger_filterR, BigIntegerParameter, bi, bi, 10); bi = new BigInteger("1333330"); alltypes.setBigInteger(bi); run_BigIntegerQuery(BigInteger_filterObj, AllTypesParameter, alltypes, bi, 9); GregorianCalendar gc = new GregorianCalendar(TimeZone.getTimeZone("GMT"), Locale.UK); gc.clear(); gc.set(1999, Calendar.DECEMBER, 31, 9, 0, 0); Date d = gc.getTime(); run_DateQuery(Date_filterL, DateParameter, d, d, 9); gc.set(1992, Calendar.NOVEMBER, 22, 9, 0, 0); d = gc.getTime(); run_DateQuery(Date_filterR, DateParameter, d, d, 9); gc.set(1959, Calendar.OCTOBER, 9, 9, 0, 0); d = gc.getTime(); run_DateQuery(Date_filterR, DateParameter, d, d, 10); gc.set(1995, Calendar.JUNE, 14, 9, 0, 0); d = gc.getTime(); alltypes.setDate(d); run_DateQuery(Date_filterObj, AllTypesParameter, alltypes, d, 9); } private void run_booleanQuery(String filter, String parameter, Object parameterValue, boolean value, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while(iter.hasNext()){ AllTypes obj = (AllTypes) iter.next(); boolean val = obj.getboolean(); if( val == value ){ fail(ASSERTION_FAILED, "JDOQL NotEquals test returns object with incorrect value", filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL NotEquals test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_byteQuery(String filter, String parameter, Object parameterValue, byte value, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); byte val = obj.getbyte(); if( val == value ){ fail(ASSERTION_FAILED, "JDOQL NotEquals test returns incorrect value, retrieved value: " + val + ", byte parameter value: " + value + ", Object parameter value: " + parameterValue, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL NotEquals test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_shortQuery(String filter, String parameter, Object parameterValue, short value, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); short val = obj.getshort(); if( val == value ){ fail(ASSERTION_FAILED, "JDOQL NotEquals test returns incorrect value, retrieved value: " + val + ", short parameter value: " + value + ", Object parameter value: " + parameterValue, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL NotEquals test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_charQuery(String filter, String parameter, Object parameterValue, char value, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); char val = obj.getchar(); if( val == value ){ fail(ASSERTION_FAILED, "JDOQL NotEquals test returns incorrect value, retrieved value: " + val + ", char parameter value: " + value + ", char integer value: " + (int)value + ", Object parameter value: " + parameterValue, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL NotEquals test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_intQuery(String filter, String parameter, Object parameterValue, int value, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); int val = obj.getint(); if( val == value ){ fail(ASSERTION_FAILED, "JDOQL NotEquals test returns incorrect value, retrieved value: " + val + ", int parameter value: "+ value + ", Object parameter value: " + parameterValue, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL NotEquals test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_longQuery(String filter, String parameter, Object parameterValue, long value, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); long val = obj.getlong(); if( val == value ){ fail(ASSERTION_FAILED, "JDOQL NotEquals test returns incorrect value, retrieved value: " + val + ", long parameter value: " + value + ", Object parameter value: " + parameterValue, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL NotEquals test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_floatQuery(String filter, String parameter, Object parameterValue, float value, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); float val = obj.getfloat(); if( val == value ){ fail(ASSERTION_FAILED, "JDOQL NotEquals test returns incorrect value, retrieved value: " + val + ", float parameter value: " + value + ", Object parameter value: " + parameterValue, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL NotEquals test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_doubleQuery(String filter, String parameter, Object parameterValue, double value, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); double val = obj.getdouble(); if( val == value ){ fail(ASSERTION_FAILED, "JDOQL NotEquals test returns incorrect value, retrieved value: " + val + ", double parameter value: " + value + ", Object parameter value: " + parameterValue, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL NotEquals test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_BooleanQuery(String filter, String parameter, Object parameterValue, Boolean value, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while(iter.hasNext()){ AllTypes obj = (AllTypes) iter.next(); Boolean val = obj.getBoolean(); if( val.equals(value) ){ fail(ASSERTION_FAILED, "JDOQL NotEquals test returns object with incorrect value, retrieved value: " + val + ", Boolean parameter value: " + value + ", Object parameter value: " + parameterValue, filter, parameter); } cnt++; } if( cnt != expected_count ) fail(ASSERTION_FAILED, "JDOQL NotEquals test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); query.close(query_result); tx.rollback(); } private void run_ByteQuery(String filter, String parameter, Object parameterValue, Byte value, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); Byte val = obj.getByte(); if( val.equals(value) ){ fail(ASSERTION_FAILED, "JDOQL NotEquals test returns incorrect value, retrieved value: " + val + ", Byte parameter value: " + value + ", Object parameter value: " + parameterValue, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL NotEquals test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_ShortQuery(String filter, String parameter, Object parameterValue, Short value, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); Short val = obj.getShort(); if( val.equals(value) ){ fail(ASSERTION_FAILED, "JDOQL NotEquals test returns incorrect value, retrieved value: " + val + ", Short parameter value: " + value + ", Object parameter value: " + parameterValue, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL NotEquals test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_CharacterQuery(String filter, String parameter, Object parameterValue, Character value, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); Character val = obj.getCharacter(); if( val.equals(value) ){ fail(ASSERTION_FAILED, "JDOQL NotEquals test returns incorrect value, retrieved value: " + val + ", Character parameter value: " + value + ", Object parameter value: " + parameterValue, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL NotEquals test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_IntegerQuery(String filter, String parameter, Object parameterValue, Integer value, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); Integer val = obj.getInteger(); if( val.equals(value) ){ fail(ASSERTION_FAILED, "JDOQL NotEquals test returns incorrect value, retrieved value: " + val + ", Integer parameter value: " + value + ", Object parameter value: " + parameterValue, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL NotEquals test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_LongQuery(String filter, String parameter, Object parameterValue, Long value, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); Long val = obj.getLong(); if( val.equals(value) ){ fail(ASSERTION_FAILED, "JDOQL NotEquals test returns incorrect value, retrieved value: " + val + ", Long parameter value: " + value + ", Object parameter value: " + parameterValue, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL NotEquals test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_FloatQuery(String filter, String parameter, Object parameterValue, Float value, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); Float val = obj.getFloat(); if( val.equals(value) ){ fail(ASSERTION_FAILED, "JDOQL NotEquals test returns incorrect value, retrieved value: " + val + ", Float parameter value: " + value + ", Object parameter value: " + parameterValue, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL NotEquals test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_DoubleQuery(String filter, String parameter, Object parameterValue, Double value, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); Double val = obj.getDouble(); if( val.equals(value) ){ fail(ASSERTION_FAILED, "JDOQL NotEquals test returns incorrect value, retrieved value: " + val + ", Double parameter value: " + value + ", Object parameter value: " + parameterValue, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL NotEquals test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_StringQuery(String filter, String parameter, Object parameterValue, String value, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); String val = obj.getString(); if( val.equals(value) ){ fail(ASSERTION_FAILED, "JDOQL NotEquals test returns incorrect value, retrieved value: " + val + ", parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL NotEquals test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_LocaleQuery(String filter, String parameter, Object parameterValue, Locale value, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); Locale val = obj.getLocale(); if( val.equals(value) ){ fail(ASSERTION_FAILED, "JDOQL NotEquals test returns incorrect value, retrieved value: " + val + ", parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL NotEquals test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_BigDecimalQuery(String filter, String parameter, Object parameterValue, BigDecimal value, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); BigDecimal val = obj.getBigDecimal(); if( val.equals(value) ){ fail(ASSERTION_FAILED, "JDOQL NotEquals test returns incorrect value, retrieved value: " + val + ", parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL NotEquals test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_BigIntegerQuery(String filter, String parameter, Object parameterValue, BigInteger value, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); BigInteger val = obj.getBigInteger(); if( val.equals(value) ){ fail(ASSERTION_FAILED, "JDOQL NotEquals test returns incorrect value, retrieved value: " + val + ", parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL NotEquals test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } private void run_DateQuery(String filter, String parameter, Object parameterValue, Date value, int expected_count) { tx.begin(); runQuery(pm, filter, parameter, parameterValue, ASSERTION_FAILED); if( query_result == null ) return; Iterator iter = query_result.iterator(); int cnt = 0; while( iter.hasNext() ){ AllTypes obj = (AllTypes) iter.next(); Date val = obj.getDate(); if( val.equals(value) ){ fail(ASSERTION_FAILED, "JDOQL NotEquals test returns incorrect value, retrieved value: " + val + ", parameter value: " + value, filter, parameter); } cnt++; } if( cnt != expected_count ){ fail(ASSERTION_FAILED, "JDOQL NotEquals test returns wrong number of instances, expected " + expected_count + ", got " + cnt, filter, parameter); } query.close(query_result); tx.rollback(); } /** */ protected void localSetUp() { addTearDownClass(AllTypes.class); AllTypes.load(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/operators/PromotionOfNumericOperands.java100664 7154 12500110373 31365 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.operators; import java.util.Collection; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PrimitiveTypes; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Promotion of Numeric Operands for Comparisons *
*Keywords: query *
*Assertion ID: A14.6.2-39. *
*Assertion Description: Numeric operands can be promoted for comparison and arithmetic operations. */ public class PromotionOfNumericOperands extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-39 (PromotionOfNumericOperands) failed: "; /** * The main 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(PromotionOfNumericOperands.class); } /** */ public void testPositive() { PersistenceManager pm = getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); Collection instance9 = (Collection)pm.newQuery( PrimitiveTypes.class, "id == 9").execute(); // comparison double == int runSimplePrimitiveTypesQuery("doubleNotNull == 9", pm, instance9, ASSERTION_FAILED); // comparison Double == int runSimplePrimitiveTypesQuery("doubleNull == 9", pm, instance9, ASSERTION_FAILED); // comparison BigInteger == int runSimplePrimitiveTypesQuery("bigInteger == 9", pm, instance9, ASSERTION_FAILED); // comparison BigDecimal == int runSimplePrimitiveTypesQuery("bigDecimal == 9", pm, instance9, ASSERTION_FAILED); // promotion in arithmetic operation: int + byte == int runSimplePrimitiveTypesQuery("1 + byteNotNull == 10", pm, instance9, ASSERTION_FAILED); // promotion in arithmetic operation: int - short == long runSimplePrimitiveTypesQuery("10 - shortNotNull == 1L", pm, instance9, ASSERTION_FAILED); // promotion in arithmetic operation: long - Integer == int runSimplePrimitiveTypesQuery("10L - intNull == 1", pm, instance9, ASSERTION_FAILED); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PrimitiveTypes.class); loadAndPersistPrimitiveTypes(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/operators/SignInversion.java100664 12150 12500110373 26700 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.operators; import java.util.Collection; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PrimitiveTypes; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Sign Inversion Query Operator *
*Keywords: query *
*Assertion ID: A14.6.2-29. *
*Assertion Description: The numeric sign inversion operator (-) is supported for all types as they are defined in the Java language. This includes the following types:
  • byte, short, int, long, char, Byte, Short Integer, Long, Character
  • float, double, Float, Double
  • BigDecimal, BigInteger
The operation on object-valued fields of wrapper types (Boolean, Byte, Short, Integer, Long, Float, and Double), and numeric types (BigDecimal and BigInteger) use the wrapped values as operands. */ public class SignInversion extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-29 (SignInversion) failed: "; /** * The main 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(SignInversion.class); } /** */ public void testPositive() { PersistenceManager pm = getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); Collection instance9 = (Collection)pm.newQuery( PrimitiveTypes.class, "id == 9").execute(); Collection allOddInstances = (Collection)pm.newQuery( PrimitiveTypes.class, "booleanNull").execute(); runSimplePrimitiveTypesQuery("-id == -9", pm, instance9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("-byteNotNull == -9", pm, instance9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("-shortNotNull == -9", pm, instance9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("-intNotNull == -9", pm, instance9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("-longNotNull == -9", pm, instance9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("-floatNotNull == -9", pm, instance9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("-doubleNotNull == -9", pm, instance9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("-byteNull == -9", pm, instance9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("-shortNull == -9", pm, instance9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("-intNull == -9", pm, instance9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("-longNull == -9", pm, instance9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("-floatNull == -9", pm, instance9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("-doubleNull == -9", pm, instance9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("-bigDecimal == -9", pm, instance9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("-bigInteger == -9", pm, instance9, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("-charNull == -79", pm, allOddInstances, ASSERTION_FAILED); runSimplePrimitiveTypesQuery("-charNotNull == -79", pm, allOddInstances, ASSERTION_FAILED); tx.commit(); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PrimitiveTypes.class); loadAndPersistPrimitiveTypes(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/operators/StringConcatenation.java100664 10260 12500110373 30057 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.operators; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: String Concatenation Query Operator *
*Keywords: query *
*Assertion ID: A14.6.2-27. *
*Assertion Description: The String concatenation operator (+) is supported for the String type only. */ public class StringConcatenation extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-27 (StringConcatenation) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { // string literal + string literal new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ "firstname == \"emp1\" + \"First\"", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // string field + string literal new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ "firstname + \"Ext\" == param", /*VARIABLES*/ null, /*PARAMETERS*/ "String param", /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** * The expected results of valid queries. */ private Object[] expectedResult = { // string literal + string literal getTransientCompanyModelInstancesAsList(new String[]{"emp1"}), // string field + string literal getTransientCompanyModelInstancesAsList(new String[]{"emp1"}) }; /** Parameters of valid queries. */ private Object[][] parameters = { // string literal + string literal null, // string field + string literal {"emp1FirstExt"} }; /** * The main 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(StringConcatenation.class); } /** */ public void testPositive() { for (int i = 0; i < VALID_QUERIES.length; i++) { executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[i], parameters[i], expectedResult[i]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[i], parameters[i], expectedResult[i]); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/operators/UnaryPlus.java100664 5732 12500110373 26035 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.operators; import java.util.Collection; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PrimitiveTypes; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Unary Addition Query Operator *
*Keywords: query *
*Assertion ID: A14.6.2-25. *
*Assertion Description: The unary addition operator (+) is supported for all types as they are defined in the Java language. This includes the following types:
  • byte, short, int, long, char, Byte, Short Integer, Long, Character
  • float, double, Float, Double
  • BigDecimal, BigInteger
The operation on object-valued fields of wrapper types (Boolean, Byte, Short, Integer, Long, Float, and Double), and numeric types (BigDecimal and BigInteger) use the wrapped values as operands. */ public class UnaryPlus extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-25 (UnaryPlus) failed: "; /** * The main 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(UnaryPlus.class); } /** */ public void testPositive() { PersistenceManager pm = getPM(); if (debug) logger.debug("\nExecuting test BinaryAddition() ..."); Transaction tx = pm.currentTransaction(); tx.begin(); Collection instance9 = (Collection)pm.newQuery( PrimitiveTypes.class, "id == 9").execute(); runSimplePrimitiveTypesQuery("+id == 9", pm, instance9, ASSERTION_FAILED); tx.commit(); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PrimitiveTypes.class); loadAndPersistPrimitiveTypes(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/OrderingSpecification.java100664 22207 12500110373 26343 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql; import java.util.ArrayList; import java.util.List; import java.util.ListIterator; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.DentalInsurance; import org.apache.jdo.tck.pc.fieldtypes.AllTypes; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Ordering Specification *
*Keywords: query *
*Assertion ID: A14.6.6-1. *
*Assertion Description: The Query ordering specification includes a list of one or more ordering declarations separated by commas. Each ordering declaration includes an expression whose type is one of:
  • primitive types except boolean
  • wrapper types except Boolean
  • BigDecimal
  • BigInteger
  • String
  • Date
followed by one of the following words: "ascending" or *"descending" which indicates the ordering of the values for that expression. Ordering might be specified including navigation. The name of the field to be used in ordering via navigation through single-valued fields is specified by the Java language syntax of field_name.field_name....field_name. */ public class OrderingSpecification extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.6-1 (OrderingSpecification) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { // nulls first new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ DentalInsurance.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ "this.lifetimeOrthoBenefit ascending nulls first", /*FROM*/ null, /*TO*/ null), // nulls last new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ DentalInsurance.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ "this.lifetimeOrthoBenefit ascending nulls last", /*FROM*/ null, /*TO*/ null) }; /** * The expected results of valid queries. */ private Object[] expectedResult = { // nulls first getTransientCompanyModelInstancesAsList(new String[]{ "dentalIns99", "dentalIns1", "dentalIns2", "dentalIns3", "dentalIns4", "dentalIns5"}), // nulls last getTransientCompanyModelInstancesAsList(new String[]{ "dentalIns1", "dentalIns2", "dentalIns3", "dentalIns4", "dentalIns5", "dentalIns99"}) }; /** * The main 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(OrderingSpecification.class); } /** */ public void testPositiveCompanyQueries() { for (int i = 0; i < VALID_QUERIES.length; i++) { executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); } } /** */ public void testPositive() { PersistenceManager pm = getPM(); runTestOrderingSpecification01(pm); runTestOrderingSpecification02(pm); checkOrderingTypes(pm); } /** */ void runTestOrderingSpecification01(PersistenceManager pm) { if (debug) logger.debug("\nExecuting test OrderingSpecification01() ..."); Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(); query.setClass(PCPoint.class); query.setCandidates(pm.getExtent(PCPoint.class, false)); query.setOrdering("x ascending"); Object results = query.execute(); // check query result printOutput(results, inserted); checkQueryResultWithOrder(ASSERTION_FAILED, "null", results, inserted); if(debug) logger.debug("Test OrderingSpecification01(): Passed"); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ void runTestOrderingSpecification02(PersistenceManager pm) { if(debug) logger.debug("\nExecuting test OrderingSpecification02() ..."); Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(); query.setClass(PCPoint.class); query.setCandidates(pm.getExtent(PCPoint.class, false)); query.setOrdering("x descending"); Object results = query.execute(); // check query result List expected = new ArrayList(); ListIterator li = inserted.listIterator(inserted.size()); // construct expected results by iterating inserted objects backwards while (li.hasPrevious()) { Object obj = li.previous(); expected.add(obj); } expected = getFromInserted(expected); printOutput(results, expected); checkQueryResultWithOrder(ASSERTION_FAILED, "null", results, expected); if(debug) logger.debug("Test OrderingSpecification02(): Passed"); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ void checkOrderingTypes(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); Class clazz = PCPoint.class; try { tx.begin(); Query query = pm.newQuery(); query.setClass(AllTypes.class); query.setCandidates(pm.getExtent(AllTypes.class, false)); StringBuffer buffer = new StringBuffer(); buffer.append(" fld_byte ascending"); buffer.append(", fld_char ascending"); buffer.append(", fld_double ascending"); buffer.append(", fld_float ascending"); buffer.append(", fld_int ascending"); buffer.append(", fld_long ascending"); buffer.append(", fld_short ascending"); buffer.append(", fld_Byte descending"); buffer.append(", fld_Character descending"); buffer.append(", fld_Double descending"); buffer.append(", fld_Float ascending"); buffer.append(", fld_Integer descending"); buffer.append(", fld_Long descending"); buffer.append(", fld_Short descending"); buffer.append(", fld_String descending"); buffer.append(", fld_Date descending"); buffer.append(", fld_BigDecimal descending"); buffer.append(", fld_BigInteger ascending"); query.setOrdering(buffer.toString()); Object results = query.execute(); // Just check whether query compiles tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint.class); loadAndPersistPCPoints(getPM()); addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/parameters/BoundParameterCheck.java100664 6005 12500110373 30060 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.parameters; import javax.jdo.JDOUserException; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Each parameter named in the parameter declaration must be bound *to a value when executing the query. *
*Keywords: query parameter check *
*Assertion ID: A14.3-3. *
*Assertion Description: Each parameter named in the parameter *declaration must be bound to a value when executing the query. */ public class BoundParameterCheck extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.3-3 (BoundParameterCheck) failed: "; /** * The main 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(BoundParameterCheck.class); } /** */ public void test() { pm = getPM(); checkQueryParameters(pm); pm.close(); pm = null; } /** */ void checkQueryParameters(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(); query.setClass(PCPoint.class); query.setCandidates(pm.getExtent(PCPoint.class, false)); query.declareParameters( "int a" ); query.setFilter( "x == 0" ); try { Object results = query.execute(); fail(ASSERTION_FAILED, "Query.execute with unbound parameter should throw JDOUserExecption."); } catch (JDOUserException ex) { // expected exception if (debug) { logger.debug("expected exception: " + ex); } } tx.rollback(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/query/jdoql/parameters/ImplicitParameters.java100664 14213 12500110373 30030 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.parameters; import java.util.Arrays; import java.util.List; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.pc.company.Person; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Implicit parameters. *
*Keywords: query *
*Assertion ID: A14.6.3-3. *
*Assertion Description: * Parameters implicitly declared (in the result, filter, grouping, ordering, * or range) are identified by prepending a ":" to the parameter * everywhere it appears. All parameter types can be determined * by one of the following techniques: */ public class ImplicitParameters extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.3-3 (ImplicitParameters) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "this, :param", /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ "firstname == :param", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "department.name", /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ "department.name HAVING COUNT(this) >= :minValue", /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ ":zero", /*TO*/ ":five") }; private static String parameter = "parameterInResult"; /** * The expected results of valid queries. */ private Object[] expectedResult = { getExpectedResultOfFirstQuery( getTransientCompanyModelInstancesAsList(new String[] { "emp1", "emp2", "emp3", "emp4", "emp5"})), getTransientCompanyModelInstancesAsList(new String[]{"emp1"}), /* Note: "Development" is not a bean name! */ Arrays.asList(new Object[]{"Development"}), getTransientCompanyModelInstancesAsList(new String[] { "emp1", "emp2", "emp3", "emp4", "emp5"}) }; /** * The main 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(ImplicitParameters.class); } /** */ public void testResult() { int index = 0; executeQuery(index, new Object[] {parameter}); } /** */ public void testFilter() { int index = 1; executeQuery(index, new Object[] {"emp1First"}); } /** */ public void testGrouping() { int index = 2; executeQuery(index, new Object[] {new Long(3)}); } /** */ public void testRange() { int index = 3; executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index], new Object[] {new Long(0), new Long(5)}, expectedResult[index]); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } /** */ private void executeQuery(int index, Object[] parameters) { executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[index], parameters, expectedResult[index]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index], parameters, expectedResult[index]); } private List getExpectedResultOfFirstQuery(List instances) { Object[] expectedResult = new Object[instances.size()]; for (int i = 0; i < expectedResult.length; i++) { expectedResult[i] = new Object[] {instances.get(i), parameter}; } return Arrays.asList(expectedResult); } } tck/src/java/org/apache/jdo/tck/query/jdoql/parameters/MixedParameters.java100664 10754 12500110373 27332 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.parameters; import org.apache.jdo.tck.pc.company.Person; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Mixed parameters. *
*Keywords: query *
*Assertion ID: A14.6.3-2. *
*Assertion Description: * Parameters must all be declared explicitly via declareParameters * or all be declared implicitly in the filter. */ public class MixedParameters extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.3-2 (MixedParameters) failed: "; /** * The array of invalid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] INVALID_QUERIES = { new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ "firstname == param", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ "firstname == param1 && lastname == :param2", /*VARIABLES*/ null, /*PARAMETERS*/ "String param1", /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ "firstname == param", /*VARIABLES*/ null, /*PARAMETERS*/ "String param", /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ "firstname == :param", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** * The main 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(MixedParameters.class); } /** */ public void testPositive() { for (int i = 0; i < VALID_QUERIES.length; i++) { compileAPIQuery(ASSERTION_FAILED, VALID_QUERIES[i], true); compileSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[i], true); } } public void testNegative() { for (int i = 0; i < INVALID_QUERIES.length; i++) { compileAPIQuery(ASSERTION_FAILED, INVALID_QUERIES[i], false); compileSingleStringQuery(ASSERTION_FAILED, INVALID_QUERIES[i], false); } } } tck/src/java/org/apache/jdo/tck/query/jdoql/parameters/OrderOfParameters.java100664 6652 12500110373 27606 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.parameters; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Person; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Order of Parameters. *
*Keywords: query *
*Assertion ID: A14.6.13-3. *
*Assertion Description: * If implicit parameters are used, their order of appearance in the query * determines their order for binding to positional parameters for execution. */ public class OrderOfParameters extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.13-3 (OrderOfParameters) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ "firstname == :param1 & lastname == :param2", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** * The expected results of valid queries. */ private Object[] expectedResult = { getTransientCompanyModelInstancesAsList(new String[]{"emp1"}) }; /** Parameters of valid queries. */ private Object[][] parameters = { {"emp1First", "emp1Last"} }; /** * The main 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(OrderOfParameters.class); } /** */ public void testPositive() { for (int i = 0; i < VALID_QUERIES.length; i++) { executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[i], parameters[i], expectedResult[i]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[i], parameters[i], expectedResult[i]); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/parameters/ParameterBoundToDifferentPM.java100664 6743 12500110373 31522 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.parameters; import javax.jdo.JDOUserException; import javax.jdo.PersistenceManager; import javax.jdo.Query; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Department; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Element Returned in Query Result *
*Keywords: query *
*Assertion ID: A14.6.1-8. *
*Assertion Description: * If a persistent instance associated with another PersistenceManager is * passed as a parameter, JDOUserException is thrown during execute(). */ public class ParameterBoundToDifferentPM extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.1-8 (ParameterBoundToDifferentPM) failed: "; /** * The main 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(ParameterBoundToDifferentPM.class); } /** */ public void testNegative() { // get parameter dept1 getPM().currentTransaction().begin(); Department dept1 = (Department) getPersistentCompanyModelInstance("dept1"); getPM().currentTransaction().commit(); // pass parameter dept1 to query of different pm PersistenceManager pm2 = pmf.getPersistenceManager(); pm2.currentTransaction().begin(); try { Query q = pm2.newQuery(Employee.class, "department == d"); q.declareParameters("Department d"); try { q.execute(dept1); } finally { q.closeAll(); } fail(ASSERTION_FAILED, "Query.execute should throw a JDOUserException if a query " + "parameter is bound to a different PersistenceManager"); } catch (JDOUserException ex) { // expected exception if (debug) logger.debug("caught expected exception " + ex); } finally { if ((pm2 != null) && !pm2.isClosed()) { if (pm2.currentTransaction().isActive()) { pm2.currentTransaction().rollback(); } pm2.close(); } } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } ././@LongLink100644 0 0 161 12500111677 10251 Lustar 0 0 tck/src/java/org/apache/jdo/tck/query/jdoql/parameters/ParameterDeclaredWithSameNameAsFieldOfCandidateClass.javatck/src/java/org/apache/jdo/tck/query/jdoql/parameters/ParameterDeclaredWithSameNameAsFieldOfCandida100664 12452 12500110373 34105 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.parameters; import java.util.ArrayList; import java.util.List; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Parameter Declared with Same Name as Field of Candidate Class *
*Keywords: query *
*Assertion ID: A14.4-2. *
*Assertion Description: A field of the candidate class of a *Query can be hidden if a parameter is declared with the same name. */ public class ParameterDeclaredWithSameNameAsFieldOfCandidateClass extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.4-2 (ParameterDeclaredWithSameNameAsFieldOfCandidateClass) failed: "; /** * The main 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(ParameterDeclaredWithSameNameAsFieldOfCandidateClass.class); } /** */ public void testPositve() { PersistenceManager pm = getPM(); runTestParameterDeclaredWithSameNameAsFieldOfCandidateClass01(pm); runTestParameterDeclaredWithSameNameAsFieldOfCandidateClass02(pm); } /** */ void runTestParameterDeclaredWithSameNameAsFieldOfCandidateClass01( PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(); query.setClass(PCPoint.class); query.setCandidates(pm.getExtent(PCPoint.class, false)); query.declareParameters("Integer x"); query.setFilter("x == x"); Object results = query.execute(new java.lang.Integer(2)); // check query result List expected = new ArrayList(); Object p1 = new PCPoint(0, 0); Object p2 = new PCPoint(1, 1); Object p3 = new PCPoint(2, 2); Object p4 = new PCPoint(3, 3); Object p5 = new PCPoint(4, 4); expected.add(p1); expected.add(p2); expected.add(p3); expected.add(p4); expected.add(p5); expected = getFromInserted(expected); printOutput(results, expected); checkQueryResultWithoutOrder(ASSERTION_FAILED, "x == x", results, expected); if (debug) logger.debug("\nTest ParameterDeclaredWithSameNameAsFieldOfCandidateClass - Passed"); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ void runTestParameterDeclaredWithSameNameAsFieldOfCandidateClass02( PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(); query.setClass(PCPoint.class); query.setCandidates(pm.getExtent(PCPoint.class, false)); query.declareParameters("Integer y"); query.setFilter("y == y"); Object results = query.execute(new java.lang.Integer(2)); // check query result List expected = new ArrayList(); Object p1 = new PCPoint(0, 0); Object p2 = new PCPoint(1, 1); Object p3 = new PCPoint(2, 2); Object p4 = new PCPoint(3, 3); Object p5 = new PCPoint(4, 4); expected.add(p1); expected.add(p2); expected.add(p3); expected.add(p4); expected.add(p5); expected = getFromInserted(expected); printOutput(results, expected); checkQueryResultWithoutOrder(ASSERTION_FAILED, "y == y", results, expected); if (debug) logger.debug("\nTest ParameterDeclaredWithSameNameAsFieldOfCandidateClass - Passed"); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint.class); loadAndPersistPCPoints(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/parameters/PrimitiveParameterPassedAsNull.java100664 5444 12500110373 32310 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.parameters; import javax.jdo.JDOUserException; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PrimitiveTypes; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Primtive type parameter executed null value *
*Keywords: query *
*Assertion ID: A14.6.3-1. *
*Assertion Description: * If a parameter type is specified as a primitive, the parameter value * passed to execute() must not be null or a JDOUserException is thrown. */ public class PrimitiveParameterPassedAsNull extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.3-1 (PrimitiveParameterPassedAsNull) failed: "; /** * The main 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(PrimitiveParameterPassedAsNull.class); } /** */ public void testPositive() { PersistenceManager pm = getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); Query q = pm.newQuery(PrimitiveTypes.class, "intNotNull == param"); q.declareParameters("int param"); try { q.execute(null); fail(ASSERTION_FAILED, "query.execute should throw JDOUserException if the actual " + "value of a primitive type parameter is null"); } catch (JDOUserException ex) { if(debug) logger.debug("caught expected exception " + ex); } tx.commit(); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PrimitiveTypes.class); loadAndPersistPrimitiveTypes(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/ParenthesesMarkOperatorPrecedence.java100664 32150 12500110373 30655 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql; import java.util.ArrayList; import java.util.List; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Parentheses Mark Operator Precedence *
*Keywords: query *
*Assertion ID: A14.6.2-37. *
*Assertion Description: Parentheses can be used to explicitly mark operator precedence. */ public class ParenthesesMarkOperatorPrecedence extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-37 (ParenthesesMarkOperatorPrecedence) failed: "; /** * The main 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(ParenthesesMarkOperatorPrecedence.class); } /** */ public void testPositive() { PersistenceManager pm = getPM(); runTestParenthesesMarkOperatorPrecedence01(pm); runTestParenthesesMarkOperatorPrecedence02(pm); runTestParenthesesMarkOperatorPrecedence03(pm); runTestParenthesesMarkOperatorPrecedence04(pm); runTestParenthesesMarkOperatorPrecedence05(pm); runTestParenthesesMarkOperatorPrecedence06(pm); runTestParenthesesMarkOperatorPrecedence07(pm); runTestParenthesesMarkOperatorPrecedence08(pm); runTestParenthesesMarkOperatorPrecedence09(pm); } /** */ void runTestParenthesesMarkOperatorPrecedence01(PersistenceManager pm) { if(debug) logger.debug("\nExecuting Test ParenthesesMarkOperatorPrecedence01..."); Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(); query.setClass(PCPoint.class); query.setCandidates(pm.getExtent(PCPoint.class, false)); query.setFilter("x == (1 + 1)"); Object results = query.execute(); // check query result List expected = new ArrayList(); Object p3 = new PCPoint(2, 2); expected.add(p3); expected = getFromInserted(expected); printOutput(results, expected); checkQueryResultWithoutOrder(ASSERTION_FAILED, "x == (1 + 1)", results, expected); if(debug) logger.debug("Test ParenthesesMarkOperatorPrecedence01 - Passed"); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ void runTestParenthesesMarkOperatorPrecedence02(PersistenceManager pm) { if(debug) logger.debug("\nExecuting Test ParenthesesMarkOperatorPrecedence01..."); Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(); query.setClass(PCPoint.class); query.setCandidates(pm.getExtent(PCPoint.class, false)); query.setFilter("x == (1 + 1) * 2"); Object results = query.execute(); // check query result List expected = new ArrayList(); Object p5 = new PCPoint(4, 4); expected.add(p5); expected = getFromInserted(expected); printOutput(results, expected); checkQueryResultWithoutOrder(ASSERTION_FAILED, "x == (1 + 1) * 2", results, expected); if(debug) logger.debug("Test ParenthesesMarkOperatorPrecedence02 - Passed"); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ void runTestParenthesesMarkOperatorPrecedence03(PersistenceManager pm) { if(debug) logger.debug("\nExecuting Test ParenthesesMarkOperatorPrecedence03..."); Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(); query.setClass(PCPoint.class); query.setCandidates(pm.getExtent(PCPoint.class, false)); query.setFilter("x == (9 - 1) * (3 + 5) / 32"); Object results = query.execute(); // check query result List expected = new ArrayList(); Object p3 = new PCPoint(2, 2); expected.add(p3); expected = getFromInserted(expected); printOutput(results, expected); checkQueryResultWithoutOrder(ASSERTION_FAILED, "x == (9 - 1) * (3 + 5) / 32", results, expected); if(debug) logger.debug("Test ParenthesesMarkOperatorPrecedence03 - Passed"); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ void runTestParenthesesMarkOperatorPrecedence04(PersistenceManager pm) { if(debug) logger.debug("\nExecuting Test ParenthesesMarkOperatorPrecedence04..."); Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(); query.setClass(PCPoint.class); query.setCandidates(pm.getExtent(PCPoint.class, false)); query.setFilter("x == 2 && y == 2"); Object results = query.execute(); // check query result List expected = new ArrayList(); Object p3 = new PCPoint(2, 2); expected.add(p3); expected = getFromInserted(expected); printOutput(results, expected); checkQueryResultWithoutOrder(ASSERTION_FAILED, "x == 2 && y == 2", results, expected); if(debug) logger.debug("Test ParenthesesMarkOperatorPrecedence04 - Passed"); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ void runTestParenthesesMarkOperatorPrecedence05(PersistenceManager pm) { if(debug) logger.debug("\nExecuting Test ParenthesesMarkOperatorPrecedence05..."); Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(); query.setClass(PCPoint.class); query.setCandidates(pm.getExtent(PCPoint.class, false)); query.setFilter("x == (1 + 1) || y == (1002 - 1000)"); Object results = query.execute(); // check query result List expected = new ArrayList(); Object p3 = new PCPoint(2, 2); expected.add(p3); expected = getFromInserted(expected); printOutput(results, expected); checkQueryResultWithoutOrder(ASSERTION_FAILED, "x == (1 + 1) || y == (1002 - 1000)", results, expected); if(debug) logger.debug("Test ParenthesesMarkOperatorPrecedence05 - Passed"); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ void runTestParenthesesMarkOperatorPrecedence06(PersistenceManager pm) { if(debug) logger.debug("\nExecuting Test ParenthesesMarkOperatorPrecedence06..."); Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(); query.setClass(PCPoint.class); query.setCandidates(pm.getExtent(PCPoint.class, false)); query.setFilter("x == (1 * 2) && true"); Object results = query.execute(); // check query result List expected = new ArrayList(); Object p3 = new PCPoint(2, 2); expected.add(p3); expected = getFromInserted(expected); printOutput(results, expected); checkQueryResultWithoutOrder(ASSERTION_FAILED, "x == (1 * 2) && true", results, expected); if(debug) logger.debug("Test ParenthesesMarkOperatorPrecedence06 - Passed"); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ void runTestParenthesesMarkOperatorPrecedence07(PersistenceManager pm) { if(debug) logger.debug("\nExecuting Test ParenthesesMarkOperatorPrecedence07..."); Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(); query.setClass(PCPoint.class); query.setCandidates(pm.getExtent(PCPoint.class, false)); query.setFilter("x == (10000 / 5000) || false"); Object results = query.execute(); // check query result List expected = new ArrayList(); Object p3 = new PCPoint(2, 2); expected.add(p3); expected = getFromInserted(expected); printOutput(results, expected); checkQueryResultWithoutOrder(ASSERTION_FAILED, "x == (10000 / 5000) || false", results, expected); if(debug) logger.debug("Test ParenthesesMarkOperatorPrecedence07 - Passed"); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ void runTestParenthesesMarkOperatorPrecedence08(PersistenceManager pm) { if(debug) logger.debug("\nExecuting Test ParenthesesMarkOperatorPrecedence08..."); Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(); query.setClass(PCPoint.class); query.setCandidates(pm.getExtent(PCPoint.class, false)); query.setFilter("(x == 2) == true"); Object results = query.execute(); // check query result List expected = new ArrayList(); Object p3 = new PCPoint(2, 2); expected.add(p3); expected = getFromInserted(expected); printOutput(results, expected); checkQueryResultWithoutOrder(ASSERTION_FAILED, "(x == 2) == true", results, expected); if(debug) logger.debug("Test ParenthesesMarkOperatorPrecedence08 - Passed"); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ void runTestParenthesesMarkOperatorPrecedence09(PersistenceManager pm) { if(debug) logger.debug("\nExecuting Test ParenthesesMarkOperatorPrecedence09..."); Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(); query.setClass(PCPoint.class); query.setCandidates(pm.getExtent(PCPoint.class, false)); query.setFilter("(x == ((21 - 1/1)/10 + 1)) | (false && true)"); Object results = query.execute(); // check query result List expected = new ArrayList(); Object p4 = new PCPoint(3, 3); expected.add(p4); expected = getFromInserted(expected); printOutput(results, expected); checkQueryResultWithoutOrder(ASSERTION_FAILED, "(x == ((21 - 1/1)/10 + 1)) | (false && true)", results, expected); if(debug) logger.debug("Test ParenthesesMarkOperatorPrecedence09 - Passed"); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint.class); loadAndPersistPCPoints(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/PositiveRange.java100664 11374 12500110373 24653 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Person; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Positive Range. *
*Keywords: query *
*Assertion ID: A14.6.8-1. *
*Assertion Description: * setRange(long fromIncl, long toExcl) */ public class PositiveRange extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.8-1 (PositiveRange) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ "personid ASCENDING", /*FROM*/ 0, /*TO*/ 5), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ "personid ASCENDING", /*FROM*/ 0, /*TO*/ 4), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ "personid ASCENDING", /*FROM*/ 1, /*TO*/ 5), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ "personid ASCENDING", /*FROM*/ 1, /*TO*/ 4) }; /** * The expected results of valid queries. */ private Object[] expectedResult = { getTransientCompanyModelInstancesAsList(new String[]{ "emp1", "emp2", "emp3", "emp4", "emp5"}), getTransientCompanyModelInstancesAsList(new String[]{ "emp1", "emp2", "emp3", "emp4"}), getTransientCompanyModelInstancesAsList(new String[]{ "emp2", "emp3", "emp4", "emp5"}), getTransientCompanyModelInstancesAsList(new String[]{ "emp2", "emp3", "emp4"}) }; /** * The main 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(PositiveRange.class); } /** */ public void testPositive() { for (int i = 0; i < VALID_QUERIES.length; i++) { executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/QueryIsSerializable.java100664 14070 12500110373 26020 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Query is Serializable *
*Keywords: query *
*Assertion ID: A14.3-7 A14.6-1. *
*Assertion Description: The class implementing the Query *interface must be serializable. The serialized fields include the candidate *class, the filter, parameter declarations, variable declarations, imports, *and ordering specification. */ public class QueryIsSerializable extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.3-7 A14.6-1 (QueryIsSerializable) failed: "; /** * The main 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(QueryIsSerializable.class); } /** */ public void testPositive() throws Exception { PersistenceManager pm = getPM(); runTestQueryIsSerializable01(pm); runTestQueryIsSerializable02(pm); runTestQueryIsSerializable03(pm); } /** */ void runTestQueryIsSerializable01(PersistenceManager pm) { if (debug) logger.debug("\nExecuting test QueryIsSerializable01() ..."); Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(); if (query instanceof Serializable) { if (debug) { logger.debug("Query extends serializable interface."); } } else { fail(ASSERTION_FAILED, "Query does not extends serializable interface."); } tx.rollback(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ void runTestQueryIsSerializable02(PersistenceManager pm) throws Exception { if (debug) logger.debug("\nExecuting test QueryIsSerializable02() ..."); Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(); query.setClass(PCPoint.class); query.setCandidates(pm.getExtent(PCPoint.class, false)); query.setFilter("x == 3"); query.compile(); ObjectOutputStream oos = null; try { if (debug) logger.debug("Attempting to serialize Query object."); oos = new ObjectOutputStream( new FileOutputStream(SERIALZED_QUERY)); oos.writeObject(query); if (debug) logger.debug("Query object serialized."); } finally { if (oos != null) { try { oos.flush();} catch(Exception ex) {} try { oos.close();} catch(Exception ex) {} } } tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ void runTestQueryIsSerializable03(PersistenceManager pm) throws Exception { if (debug) logger.debug("\nExecuting test QueryIsSerializable03() ..."); Object restoredQuery = null; ObjectInputStream ois = null; try { if (debug) logger.debug("Attempting to de-serialize Query object."); ois = new ObjectInputStream( new FileInputStream("query.ser")); restoredQuery = ois.readObject(); if (debug) logger.debug("Query object restored."); } finally { if (ois != null) { try { ois.close();} catch(Exception ex) {} } } Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(restoredQuery); query.setCandidates(pm.getExtent(PCPoint.class, false)); query.compile(); Object results = query.execute(); // check query result List expected = new ArrayList(); Object p4 = new PCPoint(3, 3); expected.add(p4); expected = getFromInserted(expected); printOutput(results, expected); checkQueryResultWithoutOrder(ASSERTION_FAILED, results, expected); if (debug) logger.debug("Test QueryIsSerializable03(): Passed"); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint.class); loadAndPersistPCPoints(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/QueryResultPassedToAnotherQuery.java100664 14605 12500110373 30412 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql; import java.util.ArrayList; import java.util.Collection; import java.util.List; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Query Result Passed to Another Query *
*Keywords: query *
*Assertion ID: A14.6.1-4. *
*Assertion Description: The collection returned by *Query.execute can be passed to another Query. */ public class QueryResultPassedToAnotherQuery extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.1-4 (QueryResultPassedToAnotherQuery) failed: "; /** * The main 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(QueryResultPassedToAnotherQuery.class); } Collection resultCln; /** */ public void testPositive() { PersistenceManager pm = getPM(); setResultCollection(pm); runTestQueryResultPassedToAnotherQuery01(pm); runTestQueryResultPassedToAnotherQuery02(pm); runTestQueryResultPassedToAnotherQuery03(pm); pm.close(); pm = null; } /** */ void setResultCollection(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(); query.setClass(PCPoint.class); query.setCandidates(pm.getExtent(PCPoint.class, false)); resultCln = (Collection)query.execute(); // Create a new collection for the result collection. // This ensures that the result collection may be iterated // outside of the scope of the current transaction. resultCln = new ArrayList(resultCln); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ void runTestQueryResultPassedToAnotherQuery01(PersistenceManager pm) { if (debug) logger.debug("\nExecuting test QueryResultPassedToAnotherQuery01()..."); Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(); query.setClass(PCPoint.class); query.setCandidates(resultCln); query.setFilter("x == 1"); Object results = query.execute(); // check query result List expected = new ArrayList(); Object p2 = new PCPoint(1, 1); expected.add(p2); expected = getFromInserted(expected); printOutput(results, expected); checkQueryResultWithoutOrder(ASSERTION_FAILED, "x == 1", results, expected); if (debug) logger.debug("Test QueryResultPassedToAnotherQuery01: Passed"); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ void runTestQueryResultPassedToAnotherQuery02(PersistenceManager pm) { if (debug) logger.debug("\nExecuting test QueryResultPassedToAnotherQuery02()..."); Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(PCPoint.class, resultCln); query.setFilter("x == 1"); Object results = query.execute(); // check query result List expected = new ArrayList(); Object p2 = new PCPoint(1, 1); expected.add(p2); expected = getFromInserted(expected); printOutput(results, expected); checkQueryResultWithoutOrder(ASSERTION_FAILED, "x == 1", results, expected); if (debug) logger.debug("Test QueryResultPassedToAnotherQuery02: Passed"); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ void runTestQueryResultPassedToAnotherQuery03(PersistenceManager pm) { if (debug) logger.debug("\nExecuting test QueryResultPassedToAnotherQuery03()..."); Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(PCPoint.class, resultCln, "x == 1"); Object results = query.execute(); // check query result List expected = new ArrayList(); Object p2 = new PCPoint(1, 1); expected.add(p2); expected = getFromInserted(expected); printOutput(results, expected); checkQueryResultWithoutOrder(ASSERTION_FAILED, "x == 1", results, expected); if (debug) logger.debug("Test QueryResultPassedToAnotherQuery03: Passed"); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint.class); loadAndPersistPCPoints(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/QueryWithNoFilter.java100664 6473 12500110373 25464 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql; import java.util.ArrayList; import java.util.List; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Query with no Filter *
*Keywords: query *
*Assertion ID: A14.6.2-1. *
*Assertion Description: If the Query filter is not *specified, then it defaults to true, which has the effect of *filtering the input Collection only for class type. */ public class QueryWithNoFilter extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-1 (QueryWithNoFilter) failed: "; /** * The main 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(QueryWithNoFilter.class); } /** */ public void testPositive() { PersistenceManager pm = getPM(); if(debug) logger.debug("\nExecuting test QueryWithNoFilter() ..."); Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(); query.setClass(PCPoint.class); query.setCandidates(pm.getExtent(PCPoint.class, false)); Object results = query.execute(); // check query result List expected = new ArrayList(); Object p1 = new PCPoint(0, 0); Object p2 = new PCPoint(1, 1); Object p3 = new PCPoint(2, 2); Object p4 = new PCPoint(3, 3); Object p5 = new PCPoint(4, 4); expected.add(p1); expected.add(p2); expected.add(p3); expected.add(p4); expected.add(p5); expected = getFromInserted(expected); printOutput(results, expected); checkQueryResultWithoutOrder(ASSERTION_FAILED, results, expected); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint.class); loadAndPersistPCPoints(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/RangeAsString.java100664 11400 12500110373 24571 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Person; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Range as String. *
*Keywords: query *
*Assertion ID: A14.6.8-3. *
*Assertion Description: * setRange(String range); */ public class RangeAsString extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.8-3 (RangeAsString) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ "personid ASCENDING", /*FROM*/ "0", /*TO*/ "5"), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ "personid ASCENDING", /*FROM*/ "0", /*TO*/ "4"), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ "personid ASCENDING", /*FROM*/ "1", /*TO*/ "5"), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ "personid ASCENDING", /*FROM*/ "1", /*TO*/ "4") }; /** * The expected results of valid queries. */ private Object[] expectedResult = { getTransientCompanyModelInstancesAsList(new String[]{ "emp1", "emp2", "emp3", "emp4", "emp5"}), getTransientCompanyModelInstancesAsList(new String[]{ "emp1", "emp2", "emp3", "emp4"}), getTransientCompanyModelInstancesAsList(new String[]{ "emp2", "emp3", "emp4", "emp5"}), getTransientCompanyModelInstancesAsList(new String[]{ "emp2", "emp3", "emp4"}) }; /** * The main 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(RangeAsString.class); } /** */ public void testPositive() { for (int i = 0; i < VALID_QUERIES.length; i++) { executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } ././@LongLink100644 0 0 147 12500111677 10255 Lustar 0 0 tck/src/java/org/apache/jdo/tck/query/jdoql/RestoredSerializedQueryInstanceLosesAssociationWithPM.javatck/src/java/org/apache/jdo/tck/query/jdoql/RestoredSerializedQueryInstanceLosesAssociationWithPM.ja100664 7311 12500110373 34333 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import javax.jdo.JDOException; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Restored Serialized Query Instance Loses Association With PM *
*Keywords: query *
*Assertion ID: A14.3-8. *
*Assertion Description: If a serialized instance is restored, it loses its association with its former PersistenceManager. */ public class RestoredSerializedQueryInstanceLosesAssociationWithPM extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.3-8 (RestoredSerializedQueryInstanceLosesAssociationWithPM) failed: "; /** * The main 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(RestoredSerializedQueryInstanceLosesAssociationWithPM.class); } /** */ public void test() throws Exception { pm = getPM(); checkRestoredQueryInstance(pm); pm.close(); pm = null; } /** */ void checkRestoredQueryInstance(PersistenceManager pm) throws Exception { Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(); Class clazz = org.apache.jdo.tck.pc.company.Project.class; query.setClass(clazz); query.setCandidates(pm.getExtent(clazz, false)); query.declareVariables("org.apache.jdo.tck.pc.company.Person a; org.apache.jdo.tck.pc.company.Person b" ); query.setFilter("reviewers.contains(a) && a.firstname==\"brazil\" || reviewers.contains(b) && b.firstname==\"brazil\"" ); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(baos); oos.writeObject(query); ObjectInputStream ois = new ObjectInputStream( new ByteArrayInputStream(baos.toByteArray())); query = (Query) ois.readObject(); try { Object results = query.execute(); fail(ASSERTION_FAILED, "A deserialized query instance should not execute successfully without associating that instance to a persistence manager"); } catch (JDOException e) { if (debug) logger.debug("Caught expected " + e); } } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/query/jdoql/SeparateNamespaceForTypeNames.java100664 11110 12500110373 27736 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Department; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Namespace of Type Names Separate From Fields, Variables, Parameters *
*Keywords: query *
*Assertion ID: A14.4-1. *
*Assertion Description: Type names have their own namespace that is separate from the namespace for fields, variables and parameters. */ public class SeparateNamespaceForTypeNames extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.4-1 (SeparateNamespaceForTypeNames) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { // query having a parameter with the same name as a type new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ "department == Department", /*VARIABLES*/ null, /*PARAMETERS*/ "Department Department", /*IMPORTS*/ "import org.apache.jdo.tck.pc.company.Department", /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // query having a parameter with the same name as a type new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Department.class, /*EXCLUDE*/ null, /*WHERE*/ "employees.contains(Employee) && Employee.firstname == \"emp1First\"", /*VARIABLES*/ "Employee Employee", /*PARAMETERS*/ null, /*IMPORTS*/ "import org.apache.jdo.tck.pc.company.Employee", /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), }; /** * The expected results of valid queries. */ private Object[] expectedResult = { // query having a parameter with the same name as a type getTransientCompanyModelInstancesAsList(new String[]{"emp1", "emp2", "emp3"}), // query having a parameter with the same name as a type getTransientCompanyModelInstancesAsList(new String[]{"dept1"}) }; /** Parameters of valid queries. */ private Object[][] parameters = { // query having a parameter with the same name as a type {getPersistentCompanyModelInstance("dept1")}, // query having a parameter with the same name as a type null }; /** * The main 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(SeparateNamespaceForTypeNames.class); } /** */ public void testPositive() { for (int i = 0; i < VALID_QUERIES.length; i++) { executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[i], parameters[i], expectedResult[i]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[i], parameters[i], expectedResult[i]); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/subqueries/AggregateOnSize.java100664 6612 12500110373 27260 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.subqueries; import java.util.Arrays; import java.util.List; import javax.jdo.PersistenceManager; import javax.jdo.Query; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Department; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Test using an aggregate on a size expression *
*Keywords: query aggregate size *
*Assertion ID: *
*Assertion Description: */ public class AggregateOnSize extends SubqueriesTest { /** */ private static final String ASSERTION_FAILED = "Assertion (AggregateOnSize) failed: "; /** * The main 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(AggregateOnSize.class); } /** */ public void testMaxAndSizeInSubquery() throws Exception { PersistenceManager pm = getPM(); List expectedResult = getTransientCompanyModelInstancesAsList( new String[]{"dept1"}); // Select departments with the maximum number of employees String singleStringJDOQL = "SELECT FROM " + Department.class.getName() + " WHERE this.employees.size() == " + "(SELECT MAX(d.employees.size()) FROM " + Department.class.getName() + " d)"; // API query Query sub = pm.newQuery(Department.class); sub.setResult("MAX(this.employees.size())"); Query apiQuery = pm.newQuery(Department.class); apiQuery.setFilter("this.employees.size() == number"); apiQuery.addSubquery(sub, "long number", null); executeJDOQuery(ASSERTION_FAILED, apiQuery, singleStringJDOQL, false, null, expectedResult, true); // API query against memory model List allDepartments = getAllPersistentInstances(pm, Department.class); apiQuery.setCandidates(allDepartments); executeJDOQuery(ASSERTION_FAILED, apiQuery, singleStringJDOQL, false, null, expectedResult, true); // single String JDOQL Query singleStringQuery = pm.newQuery(singleStringJDOQL); executeJDOQuery(ASSERTION_FAILED, singleStringQuery, singleStringJDOQL, false, null, expectedResult, true); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/subqueries/CorrelatedSubqueries.java100664 7321 12500110373 30374 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.subqueries; import java.util.List; import javax.jdo.PersistenceManager; import javax.jdo.Query; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Correlated Subqueries Without Parameters *
*Keywords: query *
*Assertion ID: A14.6.2-56 *
*Assertion Description: * A correlated subquery is a subquery which contains references to expressions * in the outer query. If the correlation can be expressed as a restriction of * the candidate collection of the subquery, no parameters are needed. */ public class CorrelatedSubqueries extends SubqueriesTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-56 (CorrelatedSubqueries) failed: "; /** * The main 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(CorrelatedSubqueries.class); } /** */ public void testPositive() throws Exception { PersistenceManager pm = getPM(); List expectedResult = getTransientCompanyModelInstancesAsList( new String[]{"emp1", "emp2", "emp4", "emp6", "emp7", "emp10"}); // Select employees who work more than the average of // their department employees. String singleStringJDOQL = "SELECT FROM " + Employee.class.getName() + " WHERE this.weeklyhours > " + "(SELECT AVG(e.weeklyhours) FROM this.department.employees e)"; // API query Query sub = pm.newQuery(Employee.class); sub.setResult("avg(this.weeklyhours)"); Query apiQuery = pm.newQuery(Employee.class); apiQuery.setFilter("this.weeklyhours> averageWeeklyhours"); apiQuery.addSubquery(sub, "double averageWeeklyhours", "this.department.employees"); executeJDOQuery(ASSERTION_FAILED, apiQuery, singleStringJDOQL, false, null, expectedResult, true); // API query against memory model List allEmployees = getAllEmployees(pm); apiQuery.setCandidates(allEmployees); executeJDOQuery(ASSERTION_FAILED, apiQuery, singleStringJDOQL, false, null, expectedResult, true); // single String JDOQL Query singleStringQuery = pm.newQuery(singleStringJDOQL); executeJDOQuery(ASSERTION_FAILED, singleStringQuery, singleStringJDOQL, false, null, expectedResult, true); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/subqueries/CorrelatedSubqueriesWithParameters.java100664 17025 12500110373 33276 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.subqueries; import java.util.Calendar; import java.util.Date; import java.util.List; import java.util.Locale; import java.util.TimeZone; import javax.jdo.PersistenceManager; import javax.jdo.Query; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Support for subqueries in JDOQL *
*Keywords: query *
*Assertion ID: A14.6.2-57. *
*Assertion Description: * If the correlation cannot be expressed as a restriction of the candidate * collection, the correlation is expressed as one or more parameters in the * subquery which are bound to expressions of the outer query. */ public class CorrelatedSubqueriesWithParameters extends SubqueriesTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-57 (CorrelatedSubqueriesWithParameters) failed: "; /** * The main 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(CorrelatedSubqueriesWithParameters.class); } /** */ public void testPositive() throws Exception { PersistenceManager pm = getPM(); runTestSubqueries01(pm); runTestSubqueries02(pm); runTestSubqueries03(pm); } /** * Test subquery: */ void runTestSubqueries01(PersistenceManager pm) { List expectedResult = getTransientCompanyModelInstancesAsList( new String[]{"emp2", "emp6", "emp9"}); // Select employees who work more than the average of the employees // in their department having the same manager String singleStringJDOQL = "SELECT FROM " + Employee.class.getName() + " WHERE this.weeklyhours > " + "(SELECT AVG(e.weeklyhours) FROM this.department.employees e " + " WHERE e.manager == this.manager)"; // API query Query sub = pm.newQuery(Employee.class); sub.setResult("avg(this.weeklyhours)"); sub.setFilter("this.manager == :manager"); Query apiQuery = pm.newQuery(Employee.class); apiQuery.setFilter("this.weeklyhours> averageWeeklyhours"); apiQuery.addSubquery(sub, "double averageWeeklyhours", "this.department.employees", "this.manager"); executeJDOQuery(ASSERTION_FAILED, apiQuery, singleStringJDOQL, false, null, expectedResult, true); // API query against memory model List allEmployees = getAllEmployees(pm); apiQuery.setCandidates(allEmployees); executeJDOQuery(ASSERTION_FAILED, apiQuery, singleStringJDOQL, false, null, expectedResult, true); // single String JDOQL Query singleStringQuery = pm.newQuery(singleStringJDOQL); executeJDOQuery(ASSERTION_FAILED, singleStringQuery, singleStringJDOQL, false, null, expectedResult, true); } /** */ void runTestSubqueries02(PersistenceManager pm) { List expectedResult = getTransientCompanyModelInstancesAsList( new String[]{"emp2", "emp10"}); // Select employees hired after a particular date who work more // than the average of all employees of the same manager String singleStringJDOQL = "SELECT FROM " + Employee.class.getName() + " WHERE this.hiredate > :hired && this.weeklyhours > " + "(SELECT AVG(e.weeklyhours) FROM " + Employee.class.getName() + " e WHERE e.manager == this.manager)"; Calendar cal = Calendar.getInstance(Locale.US); cal.set(2002, Calendar.SEPTEMBER, 1, 0, 0, 0); Date hired = cal.getTime(); // API query Query sub = pm.newQuery(Employee.class); sub.setResult("avg(this.weeklyhours)"); sub.setFilter("this.manager == :manager"); Query apiQuery = pm.newQuery(Employee.class); apiQuery.setFilter("this.hiredate > :hired && this.weeklyhours> averageWeeklyhours"); apiQuery.addSubquery(sub, "double averageWeeklyhours", null, "this.manager"); executeJDOQuery(ASSERTION_FAILED, apiQuery, singleStringJDOQL, false, new Object[] {hired}, expectedResult, true); // API query against memory model List allEmployees = getAllEmployees(pm); apiQuery.setCandidates(allEmployees); executeJDOQuery(ASSERTION_FAILED, apiQuery, singleStringJDOQL, false, new Object[]{hired} , expectedResult, true); // single String JDOQL Query singleStringQuery = pm.newQuery(singleStringJDOQL); executeJDOQuery(ASSERTION_FAILED, singleStringQuery, singleStringJDOQL, false, new Object[]{hired}, expectedResult, true); } /** */ void runTestSubqueries03(PersistenceManager pm) { List expectedResult = getTransientCompanyModelInstancesAsList( new String[]{"emp2", "emp6", "emp9", "emp10"}); // Select employees who work more than the average of all // employees of the same manager String singleStringJDOQL = "SELECT FROM " + Employee.class.getName() + " WHERE this.weeklyhours > " + "(SELECT AVG(e.weeklyhours) FROM " + Employee.class.getName() + " e WHERE e.manager == this.manager)"; // API query Query sub = pm.newQuery(Employee.class); sub.setResult("avg(this.weeklyhours)"); sub.setFilter("this.manager == :manager"); Query apiQuery = pm.newQuery(Employee.class); apiQuery.setFilter("this.weeklyhours > averageWeeklyhours"); apiQuery.addSubquery(sub, "double averageWeeklyhours", null, "this.manager"); executeJDOQuery(ASSERTION_FAILED, apiQuery, singleStringJDOQL, false, null, expectedResult, true); // API query against memory model List allEmployees = getAllEmployees(pm); apiQuery.setCandidates(allEmployees); executeJDOQuery(ASSERTION_FAILED, apiQuery, singleStringJDOQL, false, null, expectedResult, true); // single String JDOQL Query singleStringQuery = pm.newQuery(singleStringJDOQL); executeJDOQuery(ASSERTION_FAILED, singleStringQuery, singleStringJDOQL, false, null, expectedResult, true); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/subqueries/MultipleCallsReplaceSubquery.java100664 7270 12500110373 32051 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.subqueries; import java.util.List; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Multiple Calls of addSubquery Replaces Previous Instance *
*Keywords: query *
*Assertion ID: A14.6.2-51. *
*Assertion Description: * If the same value of variableDeclaration is used to add multiple subqueries, * the subquery replaces the previous subquery for the same named variable. */ public class MultipleCallsReplaceSubquery extends SubqueriesTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-51 (MultipleCallsReplaceSubquery) failed: "; /** * The main 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(MultipleCallsReplaceSubquery.class); } /** */ public void testPositive() throws Exception { PersistenceManager pm = getPM(); List expectedResult = getTransientCompanyModelInstancesAsList( new String[]{"emp1","emp2","emp4","emp5","emp6","emp7","emp10"}); // select employees who work more than the average of all employees String singleStringJDOQL = "SELECT FROM " + Employee.class.getName() + " WHERE this.weeklyhours > " + "(SELECT AVG(e.weeklyhours) FROM " + Employee.class.getName() + " e)"; // API query // Query returning the weeklyhours of employee with id 1 Query tmp = pm.newQuery(Employee.class); tmp.setResult("this.weeklyhours"); tmp.setFilter("this.id == 1"); // Query returning the avg of weeklyhours of all employees Query sub = pm.newQuery(Employee.class); sub.setResult("avg(this.weeklyhours)"); Query apiQuery = pm.newQuery(Employee.class); apiQuery.setFilter("this.weeklyhours> averageWeeklyhours"); apiQuery.addSubquery(tmp, "double averageWeeklyhours", null); // second call of addSubquery using the same variable // should replace the previous setting, so apiQuery should // represent the query of singleStringJDOQL apiQuery.addSubquery(sub, "double averageWeeklyhours", null); executeJDOQuery(ASSERTION_FAILED, apiQuery, singleStringJDOQL, false, null, expectedResult, true); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/subqueries/NonCorrelatedSubqueries.java100664 13037 12500110373 31070 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.subqueries; import java.util.Calendar; import java.util.Date; import java.util.List; import java.util.Locale; import java.util.TimeZone; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Non-correlated Subqueries *
*Keywords: query *
*Assertion ID: A14.6.2-55. *
*Assertion Description: * If the subquery has no references to expressions in the outer query * the subquery is noncorrelated. */ public class NonCorrelatedSubqueries extends SubqueriesTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-55 (NonCorrelatedSubqueries) failed: "; /** * The main 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(NonCorrelatedSubqueries.class); } /** */ public void testPositive() throws Exception { PersistenceManager pm = getPM(); runTestSubqueries01(pm); runTestSubqueries02(pm); } /** */ void runTestSubqueries01(PersistenceManager pm) { List expectedResult = getTransientCompanyModelInstancesAsList( new String[]{"emp1","emp2","emp4","emp5","emp6","emp7","emp10"}); // select employees who work more than the average of all employees String singleStringJDOQL = "SELECT FROM " + Employee.class.getName() + " WHERE this.weeklyhours > " + "(SELECT AVG(e.weeklyhours) FROM " + Employee.class.getName() + " e)"; // API query Query sub = pm.newQuery(Employee.class); sub.setResult("avg(this.weeklyhours)"); Query apiQuery = pm.newQuery(Employee.class); apiQuery.setFilter("this.weeklyhours> averageWeeklyhours"); apiQuery.addSubquery(sub, "double averageWeeklyhours", null); executeJDOQuery(ASSERTION_FAILED, apiQuery, singleStringJDOQL, false, null, expectedResult, true); // API query against memory model List allEmployees = getAllEmployees(pm); apiQuery.setCandidates(allEmployees); executeJDOQuery(ASSERTION_FAILED, apiQuery, singleStringJDOQL, false, null, expectedResult, true); // single String JDOQL Query singleStringQuery = pm.newQuery(singleStringJDOQL); executeJDOQuery(ASSERTION_FAILED, singleStringQuery, singleStringJDOQL, false, null, expectedResult, true); } /** */ void runTestSubqueries02(PersistenceManager pm) { List expectedResult = getTransientCompanyModelInstancesAsList( new String[]{"emp2", "emp5", "emp10"}); // Select employees hired after a particular date who work more // than the average of all employees String singleStringJDOQL = "SELECT FROM " + Employee.class.getName() + " WHERE this.hiredate > :hired && " + "this.weeklyhours> (SELECT AVG(e.weeklyhours) FROM " + Employee.class.getName() + " e)"; Calendar cal = Calendar.getInstance(Locale.US); cal.set(2002, Calendar.SEPTEMBER, 1, 0, 0, 0); Date hired = cal.getTime(); // API query Query sub = pm.newQuery(Employee.class); sub.setResult("avg(this.weeklyhours)"); Query apiQuery = pm.newQuery(Employee.class); apiQuery.setFilter("this.hiredate > :hired && this.weeklyhours > averageWeeklyhours"); apiQuery.addSubquery(sub, "double averageWeeklyhours", null); executeJDOQuery(ASSERTION_FAILED, apiQuery, singleStringJDOQL, false, new Object[]{hired}, expectedResult, true); // API query against memory model List allEmployees = getAllEmployees(pm); apiQuery.setCandidates(allEmployees); executeJDOQuery(ASSERTION_FAILED, apiQuery, singleStringJDOQL, false, new Object[]{hired}, expectedResult, true); // single String JDOQL Query singleStringQuery = pm.newQuery(singleStringJDOQL); executeJDOQuery(ASSERTION_FAILED, singleStringQuery, singleStringJDOQL, false, new Object[]{hired}, expectedResult, true); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/subqueries/NullCandidateCollectionExpression.java100664 7327 12500110373 33051 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.subqueries; import java.util.List; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Null Candidate Collection Expression in addSubquery *
*Keywords: query *
*Assertion ID: A14.6.2-53. *
*Assertion Description: * The candidateCollectionExpression is the expression from the outer query that * represents the candidates over which the subquery is evaluated. If the * trimmed value is the empty String, or the parameter is null, then the * candidate collection is the extent of the candidate class. */ public class NullCandidateCollectionExpression extends SubqueriesTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-53 (NullCandidateCollectionExpression) failed: "; /** * The main 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(NullCandidateCollectionExpression.class); } /** */ public void testPositive() throws Exception { PersistenceManager pm = getPM(); List expectedResult = getTransientCompanyModelInstancesAsList( new String[]{"emp1","emp2","emp4","emp5","emp6","emp7","emp10"}); // select employees who work more than the average of all employees String singleStringJDOQL = "SELECT FROM " + Employee.class.getName() + " WHERE this.weeklyhours > " + "(SELECT AVG(e.weeklyhours) FROM " + Employee.class.getName() + " e)"; // API query Query sub = pm.newQuery(Employee.class); sub.setResult("avg(this.weeklyhours)"); Query apiQuery = pm.newQuery(Employee.class); apiQuery.setFilter("this.weeklyhours > averageWeeklyhours"); // null candidate collection apiQuery.addSubquery(sub, "double averageWeeklyhours", null); executeJDOQuery(ASSERTION_FAILED, apiQuery, singleStringJDOQL, false, null, expectedResult, true); apiQuery = pm.newQuery(Employee.class); apiQuery.setFilter("this.weeklyhours > averageWeeklyhours"); // empty candidate collection apiQuery.addSubquery(sub, "double averageWeeklyhours", " "); executeJDOQuery(ASSERTION_FAILED, apiQuery, singleStringJDOQL, false, null, expectedResult, true); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/subqueries/NullSubqueryParameter.java100664 6412 12500110373 30553 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.subqueries; import java.util.List; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Null Subquery Parameter. *
*Keywords: query *
*Assertion ID: A14.6.2-52. *
*Assertion Description: * If the subquery parameter is null, the variable is unset, effectively * making the variable named in the variableDeclaration unbound. */ public class NullSubqueryParameter extends SubqueriesTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-52 (NullSubqueryParameter) failed: "; /** * The main 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(NullSubqueryParameter.class); } /** */ public void testPositive() throws Exception { PersistenceManager pm = getPM(); List expectedResult = getTransientCompanyModelInstancesAsList( new String[]{"emp1", "emp2", "emp4", "emp6", "emp7", "emp10"}); String singleStringJDOQL = "SELECT FROM " + Employee.class.getName() + " WHERE this.weeklyhours == emp.weeklyhours && " + "emp.firstname == 'emp1First' VARIABLES Employee emp"; // API query Query apiQuery = pm.newQuery(Employee.class); apiQuery.setFilter("this.weeklyhours == emp.weeklyhours && emp.firstname == 'emp1First'"); // null subquery parameter apiQuery.addSubquery(null, Employee.class.getName() + " emp", null); executeJDOQuery(ASSERTION_FAILED, apiQuery, singleStringJDOQL, false, null, expectedResult, true); // single String JDOQL Query singleStringQuery = pm.newQuery(singleStringJDOQL); executeJDOQuery(ASSERTION_FAILED, singleStringQuery, singleStringJDOQL, false, null, expectedResult, true); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/subqueries/NullVariableDeclaration.java100664 6020 12500110373 30761 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.subqueries; import java.util.List; import javax.jdo.JDOException; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Null Variable Declaration in addSubquery *
*Keywords: query *
*Assertion ID: A14.6.2-53. *
*Assertion Description: * If the trimmed value is the empty String, or the parameter is null, * then JDOUserException is thrown. */ public class NullVariableDeclaration extends SubqueriesTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-53 (NullVariableDeclaration) failed: "; /** * The main 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(NullVariableDeclaration.class); } /** */ public void testNegative() throws Exception { PersistenceManager pm = getPM(); runTestNullVariable(pm); runTestEmptyVariable(pm); } /** */ void runTestNullVariable(PersistenceManager pm) { Query apiQuery = pm.newQuery(Employee.class); try { apiQuery.addSubquery(null, null, null); apiQuery.compile(); fail(ASSERTION_FAILED, "addSubquery called with a null varible declaration must throw a JDOUserException."); } catch (JDOException ex) { // expected JDOException } } /** */ void runTestEmptyVariable(PersistenceManager pm) { Query apiQuery = pm.newQuery(Employee.class); try { apiQuery.addSubquery(null, " ", null); apiQuery.compile(); fail(ASSERTION_FAILED, "addSubquery called with an empty varible declaration must throw a JDOUserException."); } catch (JDOException ex) { // expected JDOException } } } tck/src/java/org/apache/jdo/tck/query/jdoql/subqueries/SubqueriesTest.java100664 5135 12500110373 27230 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.subqueries; import java.util.List; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.pc.company.Employee; /** * Superclass for all subquery test classes. */ public abstract class SubqueriesTest extends QueryTest { /** */ public static final String SUBQUERIES_TEST_COMPANY_TESTDATA = "org/apache/jdo/tck/pc/company/companyForSubqueriesTests.xml"; /** * Returns the name of the company test data resource. * @return name of the company test data resource. */ protected String getCompanyTestDataResource() { return SUBQUERIES_TEST_COMPANY_TESTDATA; } /** * Helper method retuning all Employee instances. * @param pm the PersistenceManager * @return a List including all persistent Employee instances */ protected List getAllEmployees(PersistenceManager pm) { return getAllPersistentInstances(pm, Employee.class); } /** * Helper method retuning all persistent instances of the specified class. * Note, this methods executes a JDO query in a new transaction. * @param pm the PersistenceManager * @param pcClass the persistent capable class * @return a List including all persistent instances of the specified class. */ protected List getAllPersistentInstances(PersistenceManager pm, Class pcClass) { Transaction tx = pm.currentTransaction(); try { tx.begin(); List all = (List)pm.newQuery(pcClass).execute(); tx.commit(); return all; } finally { if ((tx != null) && tx.isActive()) { tx.rollback(); } } } } tck/src/java/org/apache/jdo/tck/query/jdoql/subqueries/UnmodifiedSubqueryInstance.java100664 12374 12500110373 31574 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.subqueries; import java.util.List; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Unmodified Subquery Instance. *
*Keywords: query *
*Assertion ID: A14.6.2-50. *
*Assertion Description: * The Query parameter instance is unmodified as a result of the addSubquery * or subsequent execution of the outer Query. Only some of the parameter query * parts are copied for use as the subquery. The parts copied include the * candidate class, filter, parameter declarations, variable declarations, * imports, ordering specification, uniqueness, result specification, and * grouping specification. The association with a PersistenceManager, the * candidate collection or extent, result class, and range limits are not used. */ public class UnmodifiedSubqueryInstance extends SubqueriesTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-50 (UnmodifiedSubqueryInstance) failed: "; /** * The main 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(UnmodifiedSubqueryInstance.class); } /** */ public void testPositive() throws Exception { PersistenceManager pm = getPM(); runTestUnmodifiedSubquery(pm); runTestDifferentPM(pm); } /** */ void runTestUnmodifiedSubquery(PersistenceManager pm) { List expectedResult = getTransientCompanyModelInstancesAsList( new String[]{"emp1","emp2","emp4","emp5","emp6","emp7","emp10"}); Double averageWeeklyHours = new Double(33.5); // select average weeklyhours of all employees String singleStringJDOQLSubquery = "SELECT AVG(e.weeklyhours) FROM Employee e"; // select employees who work more than the average of all employees String singleStringJDOQL = "SELECT FROM " + Employee.class.getName() + " WHERE this.weeklyhours > " + "(" + singleStringJDOQLSubquery + ")"; // execute subquery Query sub = pm.newQuery(Employee.class); sub.setResult("avg(this.weeklyhours)"); executeJDOQuery(ASSERTION_FAILED, sub, singleStringJDOQLSubquery, false, null, averageWeeklyHours, true); // execute API query Query apiQuery = pm.newQuery(Employee.class); apiQuery.setFilter("this.weeklyhours> averageWeeklyhours"); apiQuery.addSubquery(sub, "double averageWeeklyhours", null); executeJDOQuery(ASSERTION_FAILED, apiQuery, singleStringJDOQL, false, null, expectedResult, true); // execute subquery again executeJDOQuery(ASSERTION_FAILED, sub, singleStringJDOQLSubquery, false, null, averageWeeklyHours, true); } /** */ void runTestDifferentPM(PersistenceManager pm) { List expectedResult = getTransientCompanyModelInstancesAsList( new String[]{"emp1","emp2","emp4","emp5","emp6","emp7","emp10"}); // select employees who work more than the average of all employees String singleStringJDOQL = "SELECT FROM " + Employee.class.getName() + " WHERE this.weeklyhours > " + "(SELECT AVG(e.weeklyhours) FROM " + Employee.class.getName() + " e)"; // create subquery instance using different pm PersistenceManager newPM = pm.getPersistenceManagerFactory().getPersistenceManager(); Query sub = newPM.newQuery(Employee.class); sub.setResult("avg(this.weeklyhours)"); Query apiQuery = pm.newQuery(Employee.class); apiQuery.setFilter("this.weeklyhours> averageWeeklyhours"); apiQuery.addSubquery(sub, "double averageWeeklyhours", null); executeJDOQuery(ASSERTION_FAILED, apiQuery, singleStringJDOQL, false, null, expectedResult, true); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/variables/MixedVariables.java100664 11662 12500110373 26743 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.variables; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Mixed Variables. *
*Keywords: query *
*Assertion ID: A14.6.5-3. *
*Assertion Description: * All variables must be explicitly declared, * or all variables must be implicitly declared. */ public class MixedVariables extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.5-3 (MixedVariables) failed: "; /** * The array of invalid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] INVALID_QUERIES = { new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ "(team.contains(e) & e.firstname == 'emp1First') & " + "(projects.contains(p) & p.name == 'orange')", /*VARIABLES*/ "Employee e", /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ "(team.contains(e) & e.firstname == 'emp1First') & " + "(projects.contains(p) & p.name == 'orange')", /*VARIABLES*/ "Employee e; Project p", /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ "(team.contains(e) & e.firstname == 'emp1First') & " + "(projects.contains(p) & p.name == 'orange')", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** * The expected results of valid queries. */ private Object[] expectedResult = { getTransientCompanyModelInstancesAsList(new String[]{"emp2"}), getTransientCompanyModelInstancesAsList(new String[]{"emp2"}) }; /** * The main 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(MixedVariables.class); } /** */ public void testPositive() { for (int i = 0; i < VALID_QUERIES.length; i++) { executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); } } public void testNegative() { for (int i = 0; i < INVALID_QUERIES.length; i++) { compileAPIQuery(ASSERTION_FAILED, INVALID_QUERIES[i], false); compileSingleStringQuery(ASSERTION_FAILED, INVALID_QUERIES[i], false); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/variables/UnconstrainedVariable.java100664 7102 12500110373 30300 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.variables; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Unconstrained Variables. *
*Keywords: query *
*Assertion ID: A14.6.5-1. *
*Assertion Description: * A variable that is not constrained with an explicit contains clause * is constrained by the extent of the persistence capable class * (including subclasses). */ public class UnconstrainedVariable extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.5-1 (UnconstrainedVariable) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ "this.hireDate > e.hireDate & e.personid = id", /*VARIABLES*/ "Employee e", /*PARAMETERS*/ "int id", /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** * The expected results of valid queries. */ private Object[] expectedResult = { getTransientCompanyModelInstancesAsList(new String[]{ "emp2", "emp3", "emp4"}) }; /** Parameters of valid queries. */ private Object[][] parameters = { {new Integer(1)}, }; /** * The main 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(UnconstrainedVariable.class); } /** */ public void testPositive() { if (isUnconstrainedVariablesSupported()) { for (int i = 0; i < VALID_QUERIES.length; i++) { executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[i], parameters[i], expectedResult[i]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[i], parameters[i], expectedResult[i]); } } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } ././@LongLink100644 0 0 157 12500111677 10256 Lustar 0 0 tck/src/java/org/apache/jdo/tck/query/jdoql/variables/VariableDeclaredWithSameNameAsFieldOfCandidateClass.javatck/src/java/org/apache/jdo/tck/query/jdoql/variables/VariableDeclaredWithSameNameAsFieldOfCandidate100664 7044 12500110373 34031 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.variables; import javax.jdo.JDOUserException; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Variable Declared with Same Name as Field of Candidate Class *
*Keywords: query *
*Assertion ID: A14.4-3. *
*Assertion Description: A field of the candidate class of a Query can be hidden if a variable is declared with the same name. */ public class VariableDeclaredWithSameNameAsFieldOfCandidateClass extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.4-3 (VariableDeclaredWithSameNameAsFieldOfCandidateClass) failed: "; /** * The main 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(VariableDeclaredWithSameNameAsFieldOfCandidateClass.class); } /** */ public void test() { pm = getPM(); checkQueryVariables(pm); pm.close(); pm = null; } /** */ void checkQueryVariables(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); Class clazz = org.apache.jdo.tck.pc.company.Project.class; try { tx.begin(); Query query = pm.newQuery(); query.setClass(clazz); query.setCandidates(pm.getExtent(clazz, false)); try { query.declareVariables( "org.apache.jdo.tck.pc.company.Person reviewers;" ); query.setFilter( "reviewers.contains(reviewers)" ); Object results = query.execute(); fail(ASSERTION_FAILED, "Variable declaration \"Person reviewers\" did not hide field Person.reviewers"); } catch (JDOUserException e) { // expected exception if (debug) logger.debug( "Caught expected " + e); } } finally { if (tx.isActive()) tx.rollback(); } try { tx.begin(); Query query = pm.newQuery(); query.setClass(clazz); query.setCandidates(pm.getExtent(clazz, false)); query.declareVariables( "org.apache.jdo.tck.pc.company.Person reviewers;" ); query.setFilter( "this.reviewers.contains(reviewers) && reviewers.firstname==\"brazil\"" ); Object results = query.execute(); } finally { if (tx.isActive()) tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/query/jdoql/variables/VariablesAndFields.java100664 15315 12500110373 27525 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.variables; import java.util.LinkedList; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.pc.company.Person; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Variables and Fields. *
*Keywords: query *
*Assertion ID: A14.6.5-4. *
*Assertion Description: * Names in the filter are treated as parameters if they are explicitly * declared via declareParameters or if they begin with ":". * Names are treated as variable names if they are explicitly declared * via declareVariables. * Names are treated as field or property names if they are fields or * properties of the candidate class. * Names are treated as class names if they exist in the package of the * candidate class, have been imported, or if they are in the java.lang * package. e.g. Integer. * Otherwise, names are treated as implicitly defined variable names. */ public class VariablesAndFields extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.5-4 (VariablesAndFields) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ "team.contains(e) & " + "e.firstname == 'emp1First'", /*VARIABLES*/ "Employee e", /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ "team.contains(e) & " + "e.firstname == 'emp1First'", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ "firstname == 'emp1First'", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ "team.contains(manager) & " + "manager.firstname == 'emp1First'", /*VARIABLES*/ "Employee manager", /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ "team.contains(manager) & " + "manager.firstname == 'emp1First'", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /* Note: the variable name is the same as the class * name except for capitalization. This is legal. */ /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ "team.contains(employee) & " + "employee.firstname == 'emp1First'", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** * The expected results of valid queries. */ private Object[] expectedResult = { getTransientCompanyModelInstancesAsList(new String[]{"emp2"}), getTransientCompanyModelInstancesAsList(new String[]{"emp2"}), getTransientCompanyModelInstancesAsList(new String[]{"emp1"}), getTransientCompanyModelInstancesAsList(new String[]{"emp2"}), new LinkedList(), getTransientCompanyModelInstancesAsList(new String[]{"emp2"}) }; /** * The main 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(VariablesAndFields.class); } /** */ public void testPositive() { for (int i = 0; i < VALID_QUERIES.length; i++) { executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/jdoql/variables/VariablesWithoutExtent.java100664 10036 12500110373 30522 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql.variables; import java.util.LinkedList; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Person; import org.apache.jdo.tck.pc.query.NoExtent; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Variables without Extent. *
*Keywords: query *
*Assertion ID: A14.6.5-2. *
*Assertion Description: * If the class does not manage an Extent, * then no results will satisfy the query. */ public class VariablesWithoutExtent extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.5-2 (VariablesWithoutExtent) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ "this.personid = noExtent.id", /*VARIABLES*/ "NoExtent noExtent", /*PARAMETERS*/ null, /*IMPORTS*/ "import org.apache.jdo.tck.pc.query.NoExtent;", /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** * The expected results of valid queries. */ private Object[] expectedResult = { new LinkedList() }; /** * The main 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(VariablesWithoutExtent.class); } /** */ public void testPositive() { if (isUnconstrainedVariablesSupported()) { for (int i = 0; i < VALID_QUERIES.length; i++) { executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); } } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); NoExtent noExtent = new NoExtent(1); makePersistent(noExtent); addTearDownInstance(noExtent); } /** * Makes the given instance persistent. * @param o the instance to be made persistent. */ private void makePersistent(Object o) { PersistenceManager pm = getPM(); Transaction transaction = pm.currentTransaction(); transaction.begin(); try { pm.makePersistent(o); transaction.commit(); } finally { if (transaction.isActive()) { transaction.rollback(); } } } } tck/src/java/org/apache/jdo/tck/query/jdoql/WhiteSpaceIsACharacterAndIgnored.java100664 12136 12500110373 30272 0ustarmbouschenstaff 0 0 /* * 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.query.jdoql; import java.util.ArrayList; import java.util.Collection; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: White Space is a Character and is Ignored *
*Keywords: query *
*Assertion ID: A14.6.2-6. *
*Assertion Description: White space (non-printing characters space, *tab, carriage return, and line feed) is a separator and is otherwise ignored *in a Query filter. */ public class WhiteSpaceIsACharacterAndIgnored extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.2-6 (WhiteSpaceIsACharacterAndIgnored) failed: "; /** * The main 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(WhiteSpaceIsACharacterAndIgnored.class); } Collection expected = null; /** */ public void testPositive() { PersistenceManager pm = getPM(); initExpectedResult(pm, "x == 0"); // Escape Sequence runTestWhiteSpaceIsACharacterAndIgnored01(pm, "x\t == 0"); runTestWhiteSpaceIsACharacterAndIgnored01(pm, "x\n == 0"); runTestWhiteSpaceIsACharacterAndIgnored01(pm, "x\f == 0"); runTestWhiteSpaceIsACharacterAndIgnored01(pm, "x\r == 0"); runTestWhiteSpaceIsACharacterAndIgnored01(pm, "x\n == \t 0 \r"); // Unicode runTestWhiteSpaceIsACharacterAndIgnored01(pm, "x\u0009 == 0"); runTestWhiteSpaceIsACharacterAndIgnored01(pm, "x\u000c == 0"); runTestWhiteSpaceIsACharacterAndIgnored01(pm, "x\u0020 == 0"); // Octal Escape runTestWhiteSpaceIsACharacterAndIgnored01(pm, "x\11 == 0"); runTestWhiteSpaceIsACharacterAndIgnored01(pm, "x\12 == 0"); runTestWhiteSpaceIsACharacterAndIgnored01(pm, "x\14 == 0"); runTestWhiteSpaceIsACharacterAndIgnored01(pm, "x\15 == 0"); runTestWhiteSpaceIsACharacterAndIgnored01(pm, "x\40 == 0"); pm.close(); pm = null; } /** */ void initExpectedResult(PersistenceManager pm, String filter) { Transaction tx = pm.currentTransaction(); try { tx.begin(); Query query = pm.newQuery(); query.setClass(PCPoint.class); query.setCandidates(pm.getExtent(PCPoint.class, false)); query.setFilter(filter); expected = (Collection) query.execute(); // Create a new collection for the expected result. // This ensures that the expected result may be iterated // outside of the scope of the current transaction. expected = new ArrayList(expected); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ void runTestWhiteSpaceIsACharacterAndIgnored01(PersistenceManager pm, String filter) { Transaction tx = pm.currentTransaction(); Collection results = null; try { tx.begin(); Query query = pm.newQuery(); query.setClass(PCPoint.class); query.setCandidates(pm.getExtent(PCPoint.class, false)); query.setFilter(filter); results = (Collection) query.execute(); printOutput(results, expected); checkQueryResultWithoutOrder(ASSERTION_FAILED, filter, results, expected); if (debug) logger.debug("Test WhiteSpaceIsACharacterAndIgnored01(\"" + filter + "\"): Passed"); tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint.class); loadAndPersistPCPoints(getPM()); } } tck/src/java/org/apache/jdo/tck/query/QueryElementHolder.java100664 32174 12500110373 24541 0ustarmbouschenstaff 0 0 /* * 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.query; import javax.jdo.Extent; import javax.jdo.PersistenceManager; import javax.jdo.Query; /** * This class is an abstraction of a JDOQL query, * which may be represented as a single string * (e.g. SELECT FROM Person WHERE personid == 1) or * as an API query using methods on class {@link Query}.

* * The class may be used as the factory of a JDO {@link Query} instance * using method {@link QueryElementHolder#getAPIQuery(PersistenceManager)} or * method {@link QueryElementHolder#getSingleStringQuery(PersistenceManager)}.

* * Instances of this class are capable to hold all elements of a JDOQL query, * e.g. the candidate class, the filter, etc. These elements are passed * calling the constructor. It is valid to pass null as a value * for JDOQL querys elements. Such elements are not transfered into a * JDO {@link javax.jdo.Query} instance. * Instead, the default of JDO {@link javax.jdo.Query} instance is taken. */ public class QueryElementHolder { // fields holding JDOQL query elements private Boolean unique; private String result; private Class resultClass; private Class candidateClass; private Boolean excludeSubClasses; private String filter; private String variables; private String parameters; private String imports; private String grouping; private String ordering; private String fromString; private String toString; private Long fromLong; private Long toLong; /** * Returns an instance of this class holding the given arguments * such as the candidate class, the filter, etc. * The given arguments represent JDOQL query elements. * It is valid to pass null as a value * for JDOQL querys elements. Such elements are not transfered into a * JDO {@link javax.jdo.Query} instance. * Instead, the default of JDO {@link javax.jdo.Query} instance is taken. * @param unique the JDOQL unique query element * @param result the JDOQL result query element * @param resultClass the JDOQL result class query element * @param candidateClass the JDOQL candidate class query element * @param excludeSubClasses the JDOQL exclude subclasses query element * @param filter the JDOQL filter query element * @param variables the JDOQL variables query element * @param parameters the JDOQL parameters query element * @param imports the JDOQL imports query element * @param grouping the JDOQL grouping query element * @param ordering the JDOQL ordering query element * @param from the JDOQL range from query element * @param to the JDOQL range to query element */ public QueryElementHolder(Boolean unique, String result, Class resultClass, Class candidateClass, Boolean excludeSubClasses, String filter, String variables, String parameters, String imports, String grouping, String ordering, String from, String to) { if (from == null ^ to == null) { throw new IllegalArgumentException( "Arguments from and to must both be null, " + "or must not be null both."); } this.unique = unique; this.result = result; this.resultClass = resultClass; this.candidateClass = candidateClass; this.excludeSubClasses = excludeSubClasses; this.filter = filter; this.variables = variables; this.parameters = parameters; this.imports = imports; this.grouping = grouping; this.ordering = ordering; this.fromString = from; this.toString = to; } /** * Returns an instance of this class holding the given arguments * such as the candidate class, the filter, etc. * The given arguments represent JDOQL query elements. * It is valid to pass null as a value * for JDOQL querys elements. Such elements are not transfered into a * JDO {@link javax.jdo.Query} instance. * Instead, the default of JDO {@link javax.jdo.Query} instance is taken. * @param unique the JDOQL unique query element * @param result the JDOQL result query element * @param resultClass the JDOQL result class query element * @param candidateClass the JDOQL candidate class query element * @param excludeSubClasses the JDOQL exclude subclasses query element * @param filter the JDOQL filter query element * @param variables the JDOQL variables query element * @param parameters the JDOQL parameters query element * @param imports the JDOQL imports query element * @param grouping the JDOQL grouping query element * @param ordering the JDOQL ordering query element * @param from the JDOQL from query element * @param to the JDOQL to query element */ public QueryElementHolder(Boolean unique, String result, Class resultClass, Class candidateClass, Boolean excludeSubClasses, String filter, String variables, String parameters, String imports, String grouping, String ordering, long from, long to) { this.unique = unique; this.result = result; this.resultClass = resultClass; this.candidateClass = candidateClass; this.excludeSubClasses = excludeSubClasses; this.filter = filter; this.variables = variables; this.parameters = parameters; this.imports = imports; this.grouping = grouping; this.ordering = ordering; this.fromLong = new Long(from); this.toLong = new Long(to); } /** * Returns the single string JDOQL representation. * @see Object#toString() */ public String toString() { return "SELECT " + toString("UNIQUE", this.unique) + toString(this.result) + toString("INTO", this.resultClass) + toString("FROM", this.candidateClass) + toString("EXCLUDE SUBCLASSES", this.excludeSubClasses) + toString("WHERE", this.filter) + toString("VARIABLES", this.variables) + toString("PARAMETERS", this.parameters) + toString(this.imports) + toString("GROUP BY", this.grouping) + toString("ORDER BY", this.ordering) + rangeToString(); } /** * Creates a JDO {@link javax.jdo.Query} instance using the JDOQL query elements * of this instance. The returned instance is created calling * {@link PersistenceManager#newQuery(String)}. * The passed {@link String} instance is the * single string representation of this, * e.g. SELECT FROM Person WHERE personid == 1. * @param pm the persistence manager * @return the JDO query instance */ public Query getSingleStringQuery(PersistenceManager pm) { return pm.newQuery(toString()); } /** * Creates a JDO {@link javax.jdo.Query} instance using the JDOQL query elements * of this instance. The returned instance is created calling * {@link PersistenceManager#newQuery(Extent)}. * Afterwards, all query elements of this are transfered * into that instance using API methods like * {@link javax.jdo.Query#setFilter(java.lang.String)} etc. * @param pm the persistence manager * @return the JDO query instance */ public Query getAPIQuery(PersistenceManager pm) { Extent extent = this.excludeSubClasses != null ? pm.getExtent(this.candidateClass, !this.excludeSubClasses.booleanValue()) : pm.getExtent(this.candidateClass); Query query = pm.newQuery(extent); if (this.unique != null) { query.setUnique(this.unique.booleanValue()); } if (this.result != null ) { query.setResult(this.result); } if (this.resultClass != null) { query.setResultClass(this.resultClass); } if (this.filter != null) { query.setFilter(this.filter); } if (this.variables != null) { query.declareVariables(this.variables); } if (this.parameters != null) { query.declareParameters(this.parameters); } if (this.imports != null ) { query.declareImports(this.imports); } if (this.grouping != null) { query.setGrouping(this.grouping); } if (this.ordering != null) { query.setOrdering(this.ordering); } rangeToAPI(query); return query; } /** * Returns the unique JDOQL query element. * @return the unique JDOQL query element. */ public boolean isUnique() { return this.unique != null && this.unique.booleanValue(); } /** * Returns the unique JDOQL query element. * @return the unique JDOQL query element. */ public boolean hasOrdering() { return this.ordering != null; } /** * Returns the candtidate class JDOQL query element. * @return the candtidate class JDOQL query element. */ public Class getCandidateClass() { return this.candidateClass; } /** * Delegates to {@link QueryElementHolder#toString(String, String) * if argument clazz does not equal null, * otherwise returns an empty string. * @param prefix the prefix of the returned string. * @param clazz the returned string has the class name as a suffix. * @return the string. */ private String toString(String prefix, Class clazz) { return (clazz != null? toString(prefix, clazz.getName()) : ""); } /** * Returns a string prefixed by argument prefix and * suffixed by the string representation of argument bool, * if argument bool does not equal null. * Otherwise, an empty string is returned. * @param prefix the prefix of the returned string. * @param bool the returned string has the string representation * of the value as a suffix. * @return the string. */ private String toString(String prefix, Boolean bool) { return bool!=null && bool.booleanValue() ? prefix + ' ' : ""; } /** * Returns a string prefixed by argument prefix and * suffixed by argument suffix, * if argument suffix does not equal null. * Otherwise, an empty string is returned. * @param prefix the prefix of the returned string. * @param suffix the suffix of the returned string. * @return the string. */ private String toString(String prefix, String suffix) { return (suffix != null ? prefix + ' ' + suffix + ' ' : ""); } /** * Returns a string prefixed by argument prefix, * if argument prefix does not equal null. * Otherwise, an empty string is returned. * @param prefix the prefix of the returned string. * @return the string. */ private String toString(String prefix) { return (prefix != null ? prefix + ' ' : ""); } /** * Returns the single string representation * of the JDOQL query element range. * If that element is null, * then an empty string is returned. * @return the single string representation * of the JDOQL query element range or null, */ private String rangeToString() { String result = ""; if (this.fromString != null && this.toString != null) { result = "RANGE " + this.fromString + ',' + this.toString; } else if (this.fromLong != null && this.toLong != null) { result = "RANGE " + this.fromLong + ',' + this.toLong; } return result; } /** * Calls API method {@link javax.jdo.Query#setRange(String)} or * {@link javax.jdo.Query#setRange(long, long)} depending on * which of the from/to fields are set. * @param query the query instance */ private void rangeToAPI(Query query) { if (this.fromString != null && this.toString != null) { query.setRange(this.fromString + ',' + this.toString); } else if (this.fromLong != null && this.toLong != null) { query.setRange(this.fromLong.longValue(), this.toLong.longValue()); } } } tck/src/java/org/apache/jdo/tck/query/QueryTest.java100664 167663 12500110373 22765 0ustarmbouschenstaff 0 0 /* * 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.query; import java.math.BigDecimal; import java.math.BigInteger; import java.text.MessageFormat; import java.util.ArrayList; import java.util.Arrays; import java.util.Calendar; import java.util.Collection; import java.util.Iterator; import java.util.List; import java.util.Map; import javax.jdo.JDOException; import javax.jdo.JDOUserException; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.AbstractReaderTest; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.mylib.MylibReader; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.pc.mylib.PrimitiveTypes; import org.apache.jdo.tck.util.ConversionHelper; import org.apache.jdo.tck.util.EqualityHelper; public abstract class QueryTest extends AbstractReaderTest { /** */ public static final String SERIALZED_QUERY = "query.ser"; /** */ public static final String COMPANY_TESTDATA = "org/apache/jdo/tck/pc/company/companyForQueryTests.xml"; /** */ public static final String MYLIB_TESTDATA = "org/apache/jdo/tck/pc/mylib/mylibForQueryTests.xml"; /** * List of inserted instances (see methods insertPCPoints and * getFromInserted). */ protected List inserted = new ArrayList(); /** * The company model reader is used * to read company model instances from an XML file. * Instances refered by this reader are made persistent by * {@link QueryTest#loadAndPersistCompanyModel(PersistenceManager)}. */ private CompanyModelReader companyModelReaderForPersistentInstances; /** * The company model reader is used * to read company model instances from an XML file. * Instances refered by this reader remain transient. */ private CompanyModelReader companyModelReaderForTransientInstances; /** * The mylib reader is used to read mylib instances from an XML file. * Instances refered by this reader are made persistent by * {@link QueryTest#loadAndPersistMylib(PersistenceManager)}. */ private MylibReader mylibReaderForPersistentInstances; /** * The mylib reader is used to read mylib instances from an XML file. * Instances refered by this reader are made persistent by */ private MylibReader mylibReaderForTransientInstances; // Helper methods to create persistent PCPoint instances /** */ public void loadAndPersistPCPoints(PersistenceManager pm) { insertPCPoints(pm, 5); } /** */ protected void insertPCPoints(PersistenceManager pm, int numInsert) { Transaction tx = pm.currentTransaction(); try { tx.begin(); for(int i = 0; itrue * if o1 and o2 equal. * This method is capable to compare object arrays, * collections of object arrays, maps of object arrays. * This method implements a narrowing in case of floating point values. * In case of big decimals it calls * {@link BigDecimal#compareTo(java.lang.Object)}. * It allows o1 and/or o2 * to be null. * @param o1 the first object * @param o2 the second object * @return true if o1 and o2 equal. */ protected boolean equals(Object o1, Object o2) { boolean result; if (o1 == o2) { result = true; } else if ((o1 instanceof Object[]) && (o2 instanceof Object[])) { result = equalsObjectArray((Object[])o1, (Object[])o2); } else if ((o1 instanceof List) && (o2 instanceof List)) { result = equalsList((List)o1, (List)o2); } else if ((o1 instanceof Collection) && (o2 instanceof Collection)) { result = equalsCollection((Collection)o1, (Collection)o2); } else if ((o1 instanceof Map) && (o2 instanceof Map)) { result = equalsMap((Map)o1, (Map)o2); } else if ((o1 instanceof Float) && (o2 instanceof Float)) { result = closeEnough(((Float)o1).floatValue(), ((Float)o2).floatValue()); } else if ((o1 instanceof Double) && (o2 instanceof Double)) { result = closeEnough(((Double)o1).floatValue(), ((Double)o2).floatValue()); } else if ((o1 instanceof BigDecimal) && (o2 instanceof BigDecimal)) { result = ((BigDecimal)o1).compareTo((BigDecimal)o2) == 0; } else if (o1 != null) { result = o1.equals(o2); } else { // Due to the first if and due to the last if, we have: // o1 == null && o2 != null result = false; } return result; } /** * Returns true * if o1 and o2 equal. * This method iterates over both object arrays and calls * {@link QueryTest#equals(Object, Object)} passing * corresponding instances. * {@link QueryTest#equals(Object, Object)} is called rather than * {@link Object#equals(java.lang.Object)} because object arrays * having equal elements cannot be compared calling * {@link Object#equals(java.lang.Object)}. * This method does not allow o1 and o2 * to be null both. * @param o1 the first object array * @param o2 the second object array * @return true if o1 and o2 equal. */ protected boolean equalsObjectArray(Object[] o1, Object[] o2) { boolean result = true; if (o1 != o2) { if (o1.length != o2.length) { result = false; } else { for (int i = 0; i < o1.length; i++ ) { if (!equals(o1[i], o2[i])) { result = false; break; } } } } return result; } /** * Returns true * if o1 and o2 equal. * This method iterates both lists and * calls {@link QueryTest#equals(Object, Object)} on corresponding elements. * {@link QueryTest#equals(Object, Object)} is called rather than * {@link Object#equals(java.lang.Object)} because object arrays * having equal elements cannot be compared calling * {@link Object#equals(java.lang.Object)}. * This method does not allow o1 and o2 * to be null both. * @param o1 the first list * @param o2 the second list * @return true if o1 and o2 equal. */ protected boolean equalsList(List o1, List o2) { boolean result = true; if (o1 != o2) { if (o1.size() != o2.size()) { result = false; } else { Iterator i = o1.iterator(); Iterator ii = o2.iterator(); while (i.hasNext()) { Object firstObject = i.next(); Object secondObject = ii.next(); if (!equals(firstObject, secondObject)) { result = false; break; } } } } return result; } /** * Returns true * if o1 and o2 equal. * This method iterates over the first collection and * checks if each instance is contained in the second collection * by calling remove(Collection, Object). This guarantees that * the cardinality of each instance in the first collection matches * the cardinality of each instance in the second collection. * This method does not allow o1 and o2 * to be null both. * @param o1 the first collection * @param o2 the second collection * @return true if o1 and o2 equal. */ protected boolean equalsCollection(Collection o1, Collection o2) { // make a copy of o2 so we can destroy it Collection o2copy = new ArrayList(); Iterator i2 = o2.iterator(); while (i2.hasNext()) { o2copy.add(i2.next()); } boolean result = true; if (o1 != o2) { if (o1.size() != o2.size()) { result = false; } else { for (Iterator i = o1.iterator(); i.hasNext(); ) { Object oo1 = i.next(); if (!remove(o2copy, oo1)) { result = false; break; } } } } return result; } /** * Returns true * if o1 and o2 equal. * This method checks if the key sets and the value sets of both * maps equal calling equalsCollection(Collection, Collection). * This method does not allow o1 and o2 * to be null both. * @param o1 the first map * @param o2 the second map * @return true if o1 and o2 equal. */ protected boolean equalsMap(Map o1, Map o2) { boolean result = true; if (o1 != o2) { if (o1.size() != o2.size()) { result = false; } else { for (Iterator i = o1.entrySet().iterator(); i.hasNext(); ) { Map.Entry entry = (Map.Entry) i.next(); Object key = entry.getKey(); Object value = entry.getValue(); Object value2 = o2.get(key); if (!equals(value, value2)) { result = false; break; } } } } return result; } /** * Returns true if o is contained * in the given collection. * This method iterates the given collection and calls * {@link QueryTest#equals(Object, Object)} for each instance. * {@link QueryTest#equals(Object, Object)} is called rather than * {@link Object#equals(java.lang.Object)} because object arrays * having equal elements cannot be compared calling * {@link Object#equals(java.lang.Object)}. * @param col the collection * @param o the object * @return true if o is contained * in the given collection. */ private boolean contains(Collection col, Object o) { for (Iterator i = col.iterator(); i.hasNext(); ) { if (equals(o, i.next())) { return true; } } return false; } /** * Returns true if o is contained * in the given collection and was removed. * This method iterates the given collection and calls * {@link QueryTest#equals(Object, Object)} for each instance. * {@link QueryTest#equals(Object, Object)} is called rather than * {@link Object#equals(java.lang.Object)} because object arrays * having equal elements cannot be compared calling * {@link Object#equals(java.lang.Object)}. * @param col the collection * @param o the object * @return true if o is contained * in the given collection and was removed. */ private boolean remove(Collection col, Object o) { for (Iterator i = col.iterator(); i.hasNext(); ) { if (equals(o, i.next())) { i.remove(); return true; } } return false; } /** Returns true if the specified float values are close * enough to be considered to be equal for a deep equals * comparison. Floating point values are not exact, so comparing them * using == might not return useful results. This method * checks that both double values are within some percent of each * other. * @param d1 one double to be tested for close enough * @param d2 the other double to be tested for close enough * @return true if the specified values are close enough. */ public boolean closeEnough(double d1, double d2) { if (d1 == d2) return true; double diff = Math.abs(d1 - d2); return diff < Math.abs((d1 + d2) * EqualityHelper.DOUBLE_EPSILON); } /** * Returns true if the specified float values are close * enough to be considered to be equal for a deep equals * comparison. Floating point values are not exact, so comparing them * using == might not return useful results. This method * checks that both float values are within some percent of each * other. * @param f1 one float to be tested for close enough * @param f2 the other float to be tested for close enough * @return true if the specified values are close enough. */ public boolean closeEnough(float f1, float f2) { if (f1 == f2) return true; float diff = Math.abs(f1 - f2); return diff < Math.abs((f1 + f2) * EqualityHelper.FLOAT_EPSILON); } /** * Returns the size of the object. If it is a multivalued object * (Collection, Map, or array) return the number of elements. If not, * return 1. */ protected int size(Object o) { if (o instanceof Collection) { return ((Collection)o).size(); } if (o instanceof Object[]) { return ((Object[])o).length; } if (o instanceof Map) { return ((Map)o).size(); } return 1; } // Debugging helper methods /** */ protected void printOutput(Object results, Collection expected) { if (!debug) return; Iterator iter = null; PCPoint pcp = null; if (results == null) { logger.debug("Query returns null"); } if (!(results instanceof Collection)) { logger.debug("Query result is not a collection: " + results.getClass().getName()); } logger.debug("Retrived Objects are:"); iter = ((Collection)results).iterator(); while (iter.hasNext()) { pcp = (PCPoint)iter.next(); logger.debug("X = " + pcp.getX() + "\tY = " + pcp.getY()); } logger.debug("Expected Objects are:"); iter = ((Collection)expected).iterator(); while (iter.hasNext()) { pcp = (PCPoint)iter.next(); logger.debug("X = " + pcp.getX() + "\tY = " + pcp.getY()); } } // compile query methods /** * Compiles the given query element holder instance as a JDO API query. * Argument positive determines if the compilation is supposed * to succeed or to fail. If true and the compilation fails, * then the test case fails prompting argument assertion. * If false and the compilation succeeds, * then the test case fails prompting argument assertion. * Otherwise the test case succeeds. * @param assertion the assertion to prompt if the test case fails. * @param queryElementHolder the query to execute. * @param positive determines if the compilation is supposed * to succeed or to fail. */ protected void compileAPIQuery(String assertion, QueryElementHolder queryElementHolder, boolean positive) { if (logger.isDebugEnabled()) { logger.debug("Compiling API query: " + queryElementHolder); } compile(assertion, queryElementHolder, false, queryElementHolder.toString(), positive); } /** * Compiles the given query element holder instance * as a JDO single string query. * Argument positive determines if the compilation is supposed * to succeed or to fail. If true and the compilation fails, * then the test case fails prompting argument assertion. * If false and the compilation succeeds, * then the test case fails prompting argument assertion. * Otherwise the test case succeeds. * @param assertion the assertion to prompt if the test case fails. * @param queryElementHolder the query to execute. * @param positive determines if the compilation is supposed * to succeed or to fail. */ protected void compileSingleStringQuery(String assertion, QueryElementHolder queryElementHolder, boolean positive) { if (logger.isDebugEnabled()) logger.debug("Compiling single string query: " + queryElementHolder); compile(assertion, queryElementHolder, true, queryElementHolder.toString(), positive); } /** * Compiles the given single string query. * Argument positive determines if the compilation is supposed * to succeed or to fail. If true and the compilation fails, * then the test case fails prompting argument assertion. * If false and the compilation succeeds, * then the test case fails prompting argument assertion. * Otherwise the test case succeeds. * @param assertion the assertion to prompt if the test case fails. * @param singleStringQuery the single string query * @param positive determines if the compilation is supposed * to succeed or to fail. */ protected void compileSingleStringQuery(String assertion, String singleStringQuery, boolean positive) { if (logger.isDebugEnabled()) logger.debug("Compiling single string query: " + singleStringQuery); compile(assertion, null, true, singleStringQuery, positive); } /** * Compiles the given query element holder instance * as a JDO API query or single string query, * depending on argument asSingleString. * Argument singleStringQuery is used to support queries * which cannot be expressed as query element holder instances. * That argument is ignored if argument queryElementHolder * is set. * Argument positive determines if the compilation is supposed * to succeed or to fail. If true and the compilation fails, * then the test case fails prompting argument assertion. * If false and the compilation succeeds, * then the test case fails prompting argument assertion. * Otherwise the test case succeeds. * @param assertion the assertion to prompt if the test case fails. * @param queryElementHolder the query to compile. * @param asSingleString determines if the query specified by * queryElementHolder is compiled as single string query * or as API query. * @param singleStringQuery the query to compile * as a JDO single string query if there is no query element holder. * @param positive determines if the compilation is supposed * to succeed or to fail. */ private void compile(String assertion, QueryElementHolder queryElementHolder, boolean asSingleString, String singleStringQuery, boolean positive) { getPM(); try { Query query; if (queryElementHolder != null) { if (asSingleString) { query = queryElementHolder.getSingleStringQuery(pm); } else { query = queryElementHolder.getAPIQuery(pm); } } else { query = getPM().newQuery(singleStringQuery); } compile(assertion, query, singleStringQuery, positive); } catch (JDOUserException e) { // This exception handler considers a JDOUserException // to be thrown in newQuery methods. // A JDOUserException may be expected in case of negative tests. if (positive) { fail(assertion + "Query '" + queryElementHolder + "' must be compilable. The exception message is: " + e.getMessage()); } } } /** * Compiles the given query instance. * Argument positive determines if the compilation is supposed * to succeed or to fail. * If true and the compilation fails, * then the test case fails prompting arguments assertion * and queryText. * If false and the compilation succeeds, * then the test case fails prompting argument assertion * and queryText. * Otherwise the test case succeeds. * @param assertion * @param query * @param queryText * @param positive */ protected void compile(String assertion, Query query, String queryText, boolean positive) { getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); try { query.compile(); if (!positive) { fail(assertion, "Query compilation must throw JDOUserException: " + queryText); } } catch (JDOUserException e) { if (positive) { fail(assertion, "Query '" + queryText + "' must be compilable. The exception message is: " + e.getMessage()); } } finally { if (tx.isActive()) { tx.rollback(); } } } // execute query methods /** * Executes the given query element holder instance as a JDO API query. * The result of that query is compared against the given argument * expectedResult. * If the expected result does not match the returned query result, * then the test case fails prompting argument assertion. * @param assertion the assertion to prompt if the test case fails. * @param queryElementHolder the query to execute. * @param expectedResult the expected query result. */ protected void executeAPIQuery(String assertion, QueryElementHolder queryElementHolder, Object expectedResult) { executeAPIQuery(assertion, queryElementHolder, null, expectedResult); } /** * Executes the given query element holder instance as a JDO API query. * The result of that query is compared against the given argument * expectedResult. * If the expected result does not match the returned query result, * then the test case fails prompting argument assertion. * @param assertion the assertion to prompt if the test case fails. * @param queryElementHolder the query to execute. * @param parameters the parmaters of the query. * @param expectedResult the expected query result. */ protected void executeAPIQuery(String assertion, QueryElementHolder queryElementHolder, Object[] parameters, Object expectedResult) { if (logger.isDebugEnabled()) { logger.debug("Executing API query: " + queryElementHolder); } execute(assertion, queryElementHolder, false, parameters, expectedResult); } /** * Executes the given query element holder instance * as a JDO single string query. * The result of that query is compared against the given argument * expectedResult. * If the expected result does not match the returned query result, * then the test case fails prompting argument assertion. * @param assertion the assertion to prompt if the test case fails. * @param queryElementHolder the query to execute. * @param expectedResult the expected query result. */ protected void executeSingleStringQuery(String assertion, QueryElementHolder queryElementHolder, Object expectedResult) { executeSingleStringQuery(assertion, queryElementHolder, null, expectedResult); } /** * Executes the given query element holder instance * as a JDO single string query. * The result of that query is compared against the given argument * expectedResult. * If the expected result does not match the returned query result, * then the test case fails prompting argument assertion. * @param assertion the assertion to prompt if the test case fails. * @param queryElementHolder the query to execute. * @param parameters the parmaters of the query. * @param expectedResult the expected query result. */ protected void executeSingleStringQuery(String assertion, QueryElementHolder queryElementHolder, Object[] parameters, Object expectedResult) { if (logger.isDebugEnabled()) logger.debug("Executing single string query: " + queryElementHolder); execute(assertion, queryElementHolder, true, parameters, expectedResult); } /** * Converts the given query element holder instance * to a JDO query instance, * based on argument asSingleString. * Afterwards, delegates to method * {@link QueryTest#execute(String, Query, String, boolean, Object[], Object, boolean)}. * @param assertion the assertion to prompt if the test case fails. * @param queryElementHolder the query to execute. * @param asSingleString determines if the query is executed as * single string query or as API query. * @param parameters the parmaters of the query. * @param expectedResult the expected query result. * @return the query result */ private Object execute(String assertion, QueryElementHolder queryElementHolder, boolean asSingleString, Object parameters, Object expectedResult) { getPM(); Query query = asSingleString ? queryElementHolder.getSingleStringQuery(pm) : queryElementHolder.getAPIQuery(pm); Object result = execute(assertion, query, queryElementHolder.toString(), queryElementHolder.hasOrdering(), parameters, expectedResult, true); return result; } /** * Executes the given query instance delegating to * execute(String, Query, String, boolean, Object, Object, boolean). * Logs argument singleStringQuery * if debug logging is enabled. * @param assertion the assertion to prompt if the test case fails. * @param query the query to execute. * @param singleStringQuery the single string representation of the query. * This parameter is only used as part of the falure message. * @param hasOrdering indicates if the query has an ordering clause. * @param parameters the parmaters of the query. * @param expectedResult the expected query result. * @param positive indicates if query execution is supposed to fail * @return the query result */ protected Object executeJDOQuery(String assertion, Query query, String singleStringQuery, boolean hasOrdering, Object[] parameters, Object expectedResult, boolean positive) { if (logger.isDebugEnabled()) { logger.debug("Executing JDO query: " + singleStringQuery); } return execute(assertion, query, singleStringQuery, hasOrdering, parameters, expectedResult, positive); } /** * Executes the given SQL string as a JDO SQL query. * The result of that query is compared against the given argument * expectedResult. * If the expected result does not match the returned query result, * then the test case fails prompting argument assertion. * Argument unique indicates, if the query is supposed * to return a single result. * Argument sql may contain the substring "{0}". * All occurences of this substring are replaced * by the value of PMF property "javax.jdo.mapping.Schema". * @param assertion the assertion to prompt if the test case fails. * @param sql the SQL string. * @param candidateClass the candidate class. * @param resultClass the result class. * @param parameters the parameters of the query. * @param expectedResult the expected query result. * @param unique indicates, if the query is supposed * to return a single result. */ protected void executeSQLQuery(String assertion, String sql, Class candidateClass, Class resultClass, boolean positive, Object parameters, Object expectedResult, boolean unique) { String schema = getPMFProperty("javax.jdo.mapping.Schema"); sql = MessageFormat.format(sql, new Object[]{schema}); if (logger.isDebugEnabled()) logger.debug("Executing SQL query: " + sql); Query query = getPM().newQuery("javax.jdo.query.SQL", sql); if (unique) { query.setUnique(unique); } if (candidateClass != null) { query.setClass(candidateClass); } if (resultClass != null) { query.setResultClass(resultClass); } execute(assertion, query, sql, false, parameters, expectedResult, positive); } /** * Executes the given query instance. * If argument parameters is an object array, * then it is passed as an argument * to the method {@link Query#executeWithArray(java.lang.Object[])}. * If argument parameters is a map, * then it is passed as an argument * to the method {@link Query#executeWithMap(java.util.Map)}. * If argument parameters is a list, * then the list elements are passed as arguments * to the execute methods taking actual parameter values. * If argument parameters is null, * then method {@link Query#execute()} is called * on the given query instance instead.

* * The result of query execution is compared against the argument * expectedResult. If the two values differ, * then this method throws an {@link AssertionFailedError} and * the calling test case fails prompting argument * assertion.

* * If argument positive is false, * then the test case invoking this method is considered to be * a negative test case. * Then, query execution is expected to throw a {@link JDOUserException}. * If query execution succeeds in this case, then this method throws * an {@link AssertionFailedError} and the calling test case fails * prompting argument assertion.

* * @param assertion the assertion to prompt if the test case fails. * @param query the query to execute. * @param singleStringQuery the single string representation of the query. * This parameter is only used as part of the falure message. * @param hasOrdering indicates if the query has an ordering clause. * @param parameters the parmaters of the query. * @param expectedResult the expected query result. * @param positive indicates if query execution is supposed to fail * @return the query result */ private Object execute(String assertion, Query query, String singleStringQuery, boolean hasOrdering, Object parameters, Object expectedResult, boolean positive) { Object result = null; getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); try { try { if (parameters == null) { result = query.execute(); } else if (parameters instanceof Object[]) { result = query.executeWithArray((Object[])parameters); } else if (parameters instanceof Map) { result = query.executeWithMap((Map)parameters); } else if (parameters instanceof List) { List list = (List) parameters; switch (list.size()) { case 1: result = query.execute(list.get(0)); break; case 2: result = query.execute(list.get(0), list.get(1)); break; case 3: result = query.execute( list.get(0), list.get(1), list.get(2)); break; default: throw new IllegalArgumentException( "Argument parameters is a list " + "and must have 1, 2, or 3 elements."); } } else { throw new IllegalArgumentException("Argument parameters " + "must be instance of List, Map, Object[], or null."); } if (logger.isDebugEnabled()) { logger.debug("Query result: " + ConversionHelper. convertObjectArrayElements(result)); } if (positive) { if (hasOrdering) { checkQueryResultWithOrder(assertion, singleStringQuery, result, expectedResult); } else { checkQueryResultWithoutOrder(assertion, singleStringQuery, result, expectedResult); } } else { fail(assertion, "Query must throw JDOUserException: " + singleStringQuery); } } finally { query.close(result); } } catch (JDOUserException e) { if (positive) { String msg = "JDOUserException thrown while executing query:\n" + singleStringQuery; throw new JDOException(msg, e); } } catch (JDOException e) { String msg = "JDOException thrown while executing query:\n" + singleStringQuery; throw new JDOException(msg, e); } finally { if (tx.isActive()) { tx.rollback(); } } return result; } /** * Converts the given query element holder instance to a * JDO query instance. * Calls {@link Query#deletePersistentAll()}, or * {@link Query#deletePersistentAll(java.util.Map)}, or * {@link Query#deletePersistentAll(java.lang.Object[])} * depending on the type of argument parameters. * If the number of deleted objects does not * match expectedNrOfDeletedObjects, * then the test case fails prompting argument assertion. * @param assertion the assertion to prompt if the test case fails. * @param queryElementHolder the query to execute. * @param parameters the parmaters of the query. * @param expectedNrOfDeletedObjects the expected number of deleted objects. */ protected void deletePersistentAllByAPIQuery(String assertion, QueryElementHolder queryElementHolder, Object parameters, long expectedNrOfDeletedObjects) { if (logger.isDebugEnabled()) { logger.debug("Deleting persistent by API query: " + queryElementHolder); } delete(assertion, queryElementHolder, false, parameters, expectedNrOfDeletedObjects); } /** * Converts the given query element holder instance to a * JDO query instance. * Calls {@link Query#deletePersistentAll()}, or * {@link Query#deletePersistentAll(java.util.Map)}, or * {@link Query#deletePersistentAll(java.lang.Object[])} * depending on the type of argument parameters. * If the number of deleted objects does not * match expectedNrOfDeletedObjects, * then the test case fails prompting argument assertion. * @param assertion the assertion to prompt if the test case fails. * @param queryElementHolder the query to execute. * @param parameters the parmaters of the query. * @param expectedNrOfDeletedObjects the expected number of deleted objects. */ protected void deletePersistentAllBySingleStringQuery(String assertion, QueryElementHolder queryElementHolder, Object parameters, long expectedNrOfDeletedObjects) { if (logger.isDebugEnabled()) { logger.debug("Deleting persistent by single string query: " + queryElementHolder); } delete(assertion, queryElementHolder, true, parameters, expectedNrOfDeletedObjects); } /** * Converts the given query element holder instance to a * JDO query based on argument asSingleString. * Calls {@link Query#deletePersistentAll()}, or * {@link Query#deletePersistentAll(java.util.Map), or * {@link Query#deletePersistentAll(java.lang.Object[]) * depending on the type of argument parameters. * If the number of deleted objects does not * match expectedNrOfDeletedObjects, * then the test case fails prompting argument assertion. * @param assertion the assertion to prompt if the test case fails. * @param queryElementHolder the query to execute. * @param asSingleString determines if the query is executed as * single string query or as API query. * @param parameters the parmaters of the query. * @param expectedNrOfDeletedObjects the expected number of deleted objects. */ private void delete(String assertion, QueryElementHolder queryElementHolder, boolean asSingleString, Object parameters, long expectedNrOfDeletedObjects) { getPM(); Query query = asSingleString ? queryElementHolder.getSingleStringQuery(pm) : queryElementHolder.getAPIQuery(pm); delete(assertion, query, queryElementHolder.toString(), parameters, expectedNrOfDeletedObjects); boolean positive = expectedNrOfDeletedObjects >= 0; if (positive) { execute(assertion, queryElementHolder, asSingleString, parameters, queryElementHolder.isUnique() ? null : new ArrayList()); } } /** * Calls {@link Query#deletePersistentAll()}, or * {@link Query#deletePersistentAll(java.util.Map), or * {@link Query#deletePersistentAll(java.lang.Object[]) * depending on the type of argument parameters. * If the number of deleted objects does not * match expectedNrOfDeletedObjects, * then the test case fails prompting argument assertion. * Argument singleStringQuery is only used as part * of the failure message. * @param assertion the assertion to prompt if the test case fails. * @param query the query to execute. * @param singleStringQuery the single string representation of the query. * @param parameters the parmaters of the query. * @param expectedNrOfDeletedObjects the expected number of deleted objects. */ private void delete(String assertion, Query query, String singleStringQuery, Object parameters, long expectedNrOfDeletedObjects) { boolean positive = expectedNrOfDeletedObjects >= 0; getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); try { try { long nr; if (parameters == null) { nr = query.deletePersistentAll(); } else if (parameters instanceof Object[]) { nr = query.deletePersistentAll((Object[])parameters); } else if (parameters instanceof Map) { nr = query.deletePersistentAll((Map)parameters); } else { throw new IllegalArgumentException("Argument parameters " + "must be instance of Object[], Map, or null."); } if (logger.isDebugEnabled()) { logger.debug(nr + " objects deleted."); } if (positive) { if (nr != expectedNrOfDeletedObjects) { fail(assertion, "deletePersistentAll returned " + nr + ", expected is " + expectedNrOfDeletedObjects + ". Query: " + singleStringQuery); } } else { fail(assertion, "deletePersistentAll must throw JDOUserException: " + singleStringQuery); } } finally { query.closeAll(); } tx.commit(); } catch (JDOUserException e) { if (positive) { String msg = "JDOUserException thrown while executing query:\n" + singleStringQuery; throw new JDOException(msg, e); } } catch (JDOException e) { String msg = "JDOException thrown while executing query:\n" + singleStringQuery; throw new JDOException(msg, e); } finally { if (tx.isActive()) { tx.rollback(); } } } } tck/src/java/org/apache/jdo/tck/query/result/AggregateResult.java100664 46370 12500110373 25372 0ustarmbouschenstaff 0 0 /* * 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.query.result; import java.math.BigDecimal; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.DentalInsurance; import org.apache.jdo.tck.pc.company.FullTimeEmployee; import org.apache.jdo.tck.pc.company.Person; import org.apache.jdo.tck.pc.company.Project; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Aggregate Result. *
*Keywords: query *
*Assertion ID: A14.6.9-6. *
*Assertion Description: * Count returns Long. Sum returns Long for integral types and * the field's type for other Number types * (BigDecimal, BigInteger, Float, and Double). * Sum is invalid if applied to non-Number types. * Avg, min, and max return the type of the expression. */ public class AggregateResult extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.9-6 (AggregateResult) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { // COUNT(this) new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "COUNT(this)", /*INTO*/ null, /*FROM*/ FullTimeEmployee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // COUNT(this) new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "COUNT(this)", /*INTO*/ null, /*FROM*/ FullTimeEmployee.class, /*EXCLUDE*/ null, /*WHERE*/ "personid == 0", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // COUNT(manager) new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "COUNT(manager)", /*INTO*/ null, /*FROM*/ FullTimeEmployee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // COUNT(manager.personid) new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "COUNT(manager.personid)", /*INTO*/ null, /*FROM*/ FullTimeEmployee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // COUNT(DISTINCT manager) new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "COUNT(DISTINCT manager)", /*INTO*/ null, /*FROM*/ FullTimeEmployee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // SUM(long) new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "SUM(personid)", /*INTO*/ null, /*FROM*/ FullTimeEmployee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // SUM(double) new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "SUM(salary)", /*INTO*/ null, /*FROM*/ FullTimeEmployee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // SUM(BigDecimal) new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "SUM(budget)", /*INTO*/ null, /*FROM*/ Project.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // SUM(budget) new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "SUM(budget)", /*INTO*/ null, /*FROM*/ Project.class, /*EXCLUDE*/ null, /*WHERE*/ "projid == 0", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // SUM(((FullTimeEmployee)manager).salary) new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "SUM(((FullTimeEmployee)manager).salary)", /*INTO*/ null, /*FROM*/ FullTimeEmployee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // SUM(DISTINCT ((FullTimeEmployee)manager).salary) new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "SUM(DISTINCT ((FullTimeEmployee)manager).salary)", /*INTO*/ null, /*FROM*/ FullTimeEmployee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // MIN(long) new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "MIN(personid)", /*INTO*/ null, /*FROM*/ FullTimeEmployee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // MIN(double) new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "MIN(salary)", /*INTO*/ null, /*FROM*/ FullTimeEmployee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // MIN(BigDecimal) new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "MIN(budget)", /*INTO*/ null, /*FROM*/ Project.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // MIN(budget) new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "MIN(budget)", /*INTO*/ null, /*FROM*/ Project.class, /*EXCLUDE*/ null, /*WHERE*/ "projid == 0", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // MIN(((FullTimeEmployee)manager).salary) new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "MIN(((FullTimeEmployee)manager).salary)", /*INTO*/ null, /*FROM*/ FullTimeEmployee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // MAX(long) new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "MAX(personid)", /*INTO*/ null, /*FROM*/ FullTimeEmployee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // MAX(double) new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "MAX(salary)", /*INTO*/ null, /*FROM*/ FullTimeEmployee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // MAX(BigDecimal) new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "MAX(budget)", /*INTO*/ null, /*FROM*/ Project.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // MAX(budget) new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "MAX(budget)", /*INTO*/ null, /*FROM*/ Project.class, /*EXCLUDE*/ null, /*WHERE*/ "projid == 0", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // MAX(((FullTimeEmployee)manager).salary) new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "MAX(((FullTimeEmployee)manager).salary)", /*INTO*/ null, /*FROM*/ FullTimeEmployee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // AVG(long) new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "AVG(personid)", /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // AVG(double) new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "AVG(salary)", /*INTO*/ null, /*FROM*/ FullTimeEmployee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // AVG(BigDecimal) new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "AVG(lifetimeOrthoBenefit)", /*INTO*/ null, /*FROM*/ DentalInsurance.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // AVG(lifetimeOrthoBenefit) new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "AVG(lifetimeOrthoBenefit)", /*INTO*/ null, /*FROM*/ DentalInsurance.class, /*EXCLUDE*/ null, /*WHERE*/ "insid == 0", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // AVG(((FullTimeEmployee)manager).salary) new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "AVG(((FullTimeEmployee)manager).salary)", /*INTO*/ null, /*FROM*/ FullTimeEmployee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // AVG(DISTINCT ((FullTimeEmployee)manager).salary) new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "AVG(DISTINCT ((FullTimeEmployee)manager).salary)", /*INTO*/ null, /*FROM*/ FullTimeEmployee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** * The array of invalid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] INVALID_QUERIES = { // SUM new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "SUM(firstname)", /*INTO*/ null, /*FROM*/ FullTimeEmployee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** * The expected results of valid queries. */ private Object[] expectedResult = { // COUNT(this) new Long(3), // COUNT(this) new Long(0), // COUNT(manager) new Long(2), // COUNT(manager.personid) new Long(2), // COUNT(DISTINCT manager) new Long(1), // SUM(long) new Long(1+2+5), // SUM(double) new Double(20000.0+10000.0+45000.0), // SUM(BigDecimal) new BigDecimal("2500000.99").add (new BigDecimal("50000.00")).add(new BigDecimal("2000.99")), // SUM(budget) null, // SUM(((FullTimeEmployee)manager).salary) new Double(20000), // SUM(DISTINCT ((FullTimeEmployee)manager).salary) new Double(10000), // MIN(long) new Long(1), // MIN(double) new Double(10000.0), // MIN(BigDecimal) new BigDecimal("2000.99"), // MIN(budget) null, // MIN(((FullTimeEmployee)manager).salary) new Double(10000), // MAX(long) new Long(5), // MAX(double) new Double(45000.0), // MAX(BigDecimal) new BigDecimal("2500000.99"), // MAX(budget) null, // MAX(((FullTimeEmployee)manager).salary) new Double(10000), // AVG(long) new Double(3), // AVG(double) new Double(25000.0), // AVG(BigDecimal) new Double("99.997"), // AVG(lifetimeOrthoBenefit) null, // AVG(((FullTimeEmployee)manager).salary) new Double(10000), // AVG(DISTINCT ((FullTimeEmployee)manager).salary) new Double(10000) }; /** * The main 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(AggregateResult.class); } /** */ public void testCount() { for(int i = 0; i < 5; i++) { executeQuery(i); } } /** */ public void testSUM() { for(int i = 5; i < 11; i++) { executeQuery(i); } } /** */ public void testMIN() { for(int i = 11; i < 16; i++) { executeQuery(i); } } /** */ public void testMAX() { for(int i = 16; i < 21; i++) { executeQuery(i); } } /** */ public void testAVG() { for(int i = 21; i < 27; i++) { executeQuery(i); } } public void testNegative() { for (int i = 0; i < INVALID_QUERIES.length; i++) { compileAPIQuery(ASSERTION_FAILED, INVALID_QUERIES[i], false); compileSingleStringQuery(ASSERTION_FAILED, INVALID_QUERIES[i], false); } } /** */ private void executeQuery(int index) { executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/result/classes/FullName.java100664 6641 12500110373 25422 0ustarmbouschenstaff 0 0 /* * 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.query.result.classes; import org.apache.jdo.tck.util.EqualityHelper; /** * JDOQL result class having bean properties firstname, * firstName, lastname, and lastName. * These properties are used by JDO query tests in result clauses. * There are two different bean properties on each field, * firstname and lastname * because some result clauses in JDO query tests specify * those properties in AS clauses. */ public class FullName { private String firstName; private String lastName; public FullName() {} public FullName(String firstName, String lastName) { this.firstName = firstName; this.lastName = lastName; } /** * @see Object#hashCode() */ public int hashCode() { int result = 0; result += this.firstName != null ? this.firstName.hashCode() : 0; result += this.lastName != null ? this.lastName.hashCode() : 0; return result; } /** * @see Object#equals(java.lang.Object) */ public boolean equals(Object o) { if (!(o instanceof FullName)) return false; FullName other = (FullName) o; return EqualityHelper.equals(this.firstName, other.firstName) && EqualityHelper.equals(this.lastName, other.lastName); } /** * @see Object#toString() */ public String toString() { return this.firstName + ' ' + this.lastName; } /** * @return Returns the firstName. */ public String getFirstName() { return firstName; } /** * @param firstName The firstName to set. */ public void setFirstName(String firstName) { this.firstName = firstName; } /** * @return Returns the lastName. */ public String getLastName() { return lastName; } /** * @param lastName The lastName to set. */ public void setLastName(String lastName) { this.lastName = lastName; } /** * @return Returns the firstName. */ public String getFirstname() { return firstName; } /** * @param firstname The firstName to set. */ public void setFirstname(String firstname) { this.firstName = firstname; } /** * @return Returns the lastName. */ public String getLastname() { return lastName; } /** * @param lastname The lastName to set. */ public void setLastname(String lastname) { this.lastName = lastname; } } tck/src/java/org/apache/jdo/tck/query/result/classes/LongString.java100664 4527 12500110373 26006 0ustarmbouschenstaff 0 0 /* * 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.query.result.classes; import org.apache.jdo.tck.util.EqualityHelper; /** * JDOQL result class having bean properties s and l. * These properties are used by JDO query tests in result clauses. */ public class LongString { private long l; private String s; public LongString() {} public LongString(long l, String s) { this.l = l; this.s = s; } /** * @see Object#hashCode() */ public int hashCode() { int result = 0; result += this.s != null ? this.s.hashCode() : 0; result += (int) (this.l % Integer.MAX_VALUE); return result; } /** * @see Object#equals(java.lang.Object) */ public boolean equals(Object o) { if (!(o instanceof LongString)) return false; LongString other = (LongString) o; return this.l == other.l && EqualityHelper.equals(this.s, other.s); } /** * @see Object#toString() */ public String toString() { return getClass().getName() + '(' + this.l + ", " + this.s + ')'; } /** * @return Returns the l. */ public long getL() { return l; } /** * @param l The l to set. */ public void setL(long l) { this.l = l; } /** * @return Returns the s. */ public String getS() { return s; } /** * @param s The s to set. */ public void setS(String s) { this.s = s; } } tck/src/java/org/apache/jdo/tck/query/result/classes/MissingNoArgsConstructor.java100664 3534 12500110373 30706 0ustarmbouschenstaff 0 0 /* * 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.query.result.classes; /** * JDOQL result class not having a no-args constructor. */ public class MissingNoArgsConstructor { private long l; public MissingNoArgsConstructor(int l) { this.l = l; } /** * @see Object#hashCode() */ public int hashCode() { int result = 0; result += (int) (this.l % Integer.MAX_VALUE); return result; } /** * @see Object#equals(java.lang.Object) */ public boolean equals(Object o) { if (!(o instanceof MissingNoArgsConstructor)) return false; MissingNoArgsConstructor other = (MissingNoArgsConstructor) o; return this.l == other.l; } /** * @see Object#toString() */ public String toString() { return getClass().getName() + '(' + l + ')'; } /** * @return Returns the l. */ public long getL() { return l; } /** * @param l The l to set. */ public void setL(int l) { this.l = l; } } tck/src/java/org/apache/jdo/tck/query/result/classes/NoFieldsNoMethods.java100664 1701 12500110373 27233 0ustarmbouschenstaff 0 0 /* * 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.query.result.classes; /** * JDOQL result class not having any fields and methods. */ public class NoFieldsNoMethods { } tck/src/java/org/apache/jdo/tck/query/result/classes/PublicLongField.java100664 3115 12500110373 26712 0ustarmbouschenstaff 0 0 /* * 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.query.result.classes; /** * JDOQL result class having a public lonf field. */ public class PublicLongField { public long l; public PublicLongField() {} public PublicLongField(long l) { this.l = l; } /** * @see Object#hashCode() */ public int hashCode() { return (int) (this.l % Integer.MAX_VALUE); } /** * @see Object#equals(java.lang.Object) */ public boolean equals(Object o) { if (!(o instanceof PublicLongField)) return false; PublicLongField other = (PublicLongField) o; return this.l == other.l; } /** * @see Object#toString() */ public String toString() { return getClass().getName() + '(' + this.l + ')'; } } tck/src/java/org/apache/jdo/tck/query/result/classes/PublicPutMethod.java100664 3373 12500110373 26766 0ustarmbouschenstaff 0 0 /* * 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.query.result.classes; import java.util.HashMap; import java.util.Map; /** * JDOQL result class having a public lonf field. */ public class PublicPutMethod { private Map map = new HashMap(); public PublicPutMethod() {} public PublicPutMethod(Map map) { this.map = map; } public void put(Object key, Object value) { this.map.put(key, value); } /** * @see Object#hashCode() */ public int hashCode() { return this.map.hashCode(); } /** * @see Object#equals(java.lang.Object) */ public boolean equals(Object o) { if (!(o instanceof PublicPutMethod)) return false; PublicPutMethod other = (PublicPutMethod) o; return this.map.equals(other.map); } /** * @see Object#toString() */ public String toString() { return getClass().getName() + '(' + this.map + ')'; } } tck/src/java/org/apache/jdo/tck/query/result/DefaultResult.java100664 6226 12500110373 25044 0ustarmbouschenstaff 0 0 /* * 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.query.result; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Person; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Default Result. *
*Keywords: query *
*Assertion ID: A14.6.9-8. *
*Assertion Description: * If not specified, the result defaults to distinct this as C. */ public class DefaultResult extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.9-8 (DefaultResult) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** * The expected results of valid queries. */ private Object[] expectedResult = { getTransientCompanyModelInstancesAsList(new String[]{ "emp1", "emp2", "emp3", "emp4", "emp5"}) }; /** * The main 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(DefaultResult.class); } /** */ public void testPositive() { for (int i = 0; i < VALID_QUERIES.length; i++) { executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/result/DefaultUnique.java100664 23030 12500110373 25044 0ustarmbouschenstaff 0 0 /* * 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.query.result; import java.math.BigDecimal; import java.util.Arrays; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.DentalInsurance; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.pc.company.Project; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Default Unique. *
*Keywords: query *
*Assertion ID: A14.6.11-2. *
*Assertion Description: * The default Unique setting is true for aggregate results * without a grouping expression, and false otherwise. */ public class DefaultUnique extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.11-2 (DefaultUnique) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // aggregate queries new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "COUNT(department)", /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "avg(lifetimeOrthoBenefit)", /*INTO*/ null, /*FROM*/ DentalInsurance.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "MIN(budget)", /*INTO*/ null, /*FROM*/ Project.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "max (budget)", /*INTO*/ null, /*FROM*/ Project.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "SUM (budget)", /*INTO*/ null, /*FROM*/ Project.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // aggregate queries with grouping new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "count(department)", /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ "department", /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "AVG(lifetimeOrthoBenefit)", /*INTO*/ null, /*FROM*/ DentalInsurance.class, /*EXCLUDE*/ null, /*WHERE*/ "employee != null", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ "employee.department", /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "min(lifetimeOrthoBenefit)", /*INTO*/ null, /*FROM*/ DentalInsurance.class, /*EXCLUDE*/ null, /*WHERE*/ "employee != null", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ "employee.department", /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "MAX(lifetimeOrthoBenefit)", /*INTO*/ null, /*FROM*/ DentalInsurance.class, /*EXCLUDE*/ null, /*WHERE*/ "employee != null", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ "employee.department", /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "sum(lifetimeOrthoBenefit)", /*INTO*/ null, /*FROM*/ DentalInsurance.class, /*EXCLUDE*/ null, /*WHERE*/ "employee != null", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ "employee.department", /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** * The expected results of valid queries. */ private Object[] expectedResult = { getTransientCompanyModelInstancesAsList(new String[]{ "emp1", "emp2", "emp3", "emp4", "emp5"}), // results for aggregate queries new Long(5), new Double("99.997"), new BigDecimal("2000.99"), new BigDecimal("2500000.99"), new BigDecimal("2552001.98"), // results for aggregate queries with grouping Arrays.asList(new Object[]{new Long(3), new Long(2)}), Arrays.asList(new Object[]{new Double("99.996"), new Double("99.9985")}), Arrays.asList(new Object[]{new BigDecimal("99.995"), new BigDecimal("99.998")}), Arrays.asList(new Object[]{new BigDecimal("99.997"), new BigDecimal("99.999")}), Arrays.asList(new Object[]{new BigDecimal("299.988"), new BigDecimal("199.997")}) }; /** * The main 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(DefaultUnique.class); } /** */ public void testThis() { int index = 0; executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); } /** */ public void testAggregateNoGrouping() { final int firstIndex = 1; final int lastIndex = 5; for (int index = firstIndex; index <= lastIndex; index++) { executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); } } /** */ public void testAggregateGrouping() { final int firstIndex = 6; final int lastIndex = 10; for (int index = firstIndex; index <= lastIndex; index++) { executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/result/DistinctCandidateInstances.java100664 11711 12500110373 27522 0ustarmbouschenstaff 0 0 /* * 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.query.result; import java.util.ArrayList; import java.util.List; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.pc.company.Person; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Distinct Candidate Instances. *
*Keywords: query *
*Assertion ID: A14.6.9-2. *
*Assertion Description: * Queries against an extent always consider only distinct candidate instances, * regardless of whether distinct is specified. * Queries against a collection might contain duplicate candidate instances; * the distinct keyword removes duplicates from the candidate collection * in this case. */ public class DistinctCandidateInstances extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.9-2 (DistintCandidateInstances) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ "Project p", /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "DISTINCT", /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ "Project p", /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** * The expected results of valid queries. */ private Object[] expectedResult = { getTransientCompanyModelInstancesAsList(new String[]{"emp1", "emp1"}), getTransientCompanyModelInstancesAsList(new String[]{"emp1"}) }; /** * The main 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(DistinctCandidateInstances.class); } /** */ public void testExtentQueries() { if (isUnconstrainedVariablesSupported()) { for (int i = 0; i < VALID_QUERIES.length; i++) { executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); } } } /** */ public void testCollectionQueries() { String singleStringQuery = "SELECT FROM " + Person.class.getName(); String singleStringDistinctQuery = "SELECT DISTINCT FROM " + Person.class.getName(); List candidates = getPersistentCompanyModelInstancesAsList( new String[]{"emp1", "emp1"}); Query query = pm.newQuery(); query.setClass(Person.class); query.setCandidates(candidates); query.setResult("this"); executeJDOQuery(ASSERTION_FAILED, query, singleStringQuery, false, null, expectedResult[0], true); query.setResult("DISTINCT this"); executeJDOQuery(ASSERTION_FAILED, query, singleStringDistinctQuery, false, null, expectedResult[1], true); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/result/DistinctQuery.java100664 12435 12500110373 25107 0ustarmbouschenstaff 0 0 /* * 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.query.result; import java.util.Arrays; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Disctinct Query. *
*Keywords: query *
*Assertion ID: A14.6.9-1. *
*Assertion Description: * If distinct is specified, the query result does not include any duplicates. * If the result parameter specifies more than one result expression, * duplicates are those with matching values for each result expression. */ public class DistinctQuery extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.9-1 (DistinctQuery) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "department", /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "DISTINCT department", /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "department.deptid, department.name", /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "DISTINCT department.deptid, department.name", /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** * The expected results of valid queries. */ private Object[] expectedResult = { getTransientCompanyModelInstancesAsList(new String[]{ "dept1", "dept1", "dept1", "dept2", "dept2"}), getTransientCompanyModelInstancesAsList(new String[]{ "dept1", "dept2"}), Arrays.asList(new Object[] { new Object[]{new Long(1),"Development"}, new Object[]{new Long(1),"Development"}, new Object[]{new Long(1),"Development"}, new Object[]{new Long(2),"Human Resources"}, new Object[]{new Long(2),"Human Resources"}}), Arrays.asList(new Object[] { new Object[]{new Long(1),"Development"}, new Object[]{new Long(2),"Human Resources"}}) }; /** * The main 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(DistinctQuery.class); } /** */ public void testPositive() { for (int i = 0; i < VALID_QUERIES.length; i++) { executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/result/Grouping.java100664 11026 12500110373 24065 0ustarmbouschenstaff 0 0 /* * 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.query.result; import java.util.Arrays; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.FullTimeEmployee; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Grouping. *
*Keywords: query *
*Assertion ID: A14.6.10-1. *
*Assertion Description: * When grouping is specified, each result expression must be one of: * an expression contained in the grouping expression; * or, an aggregate expression evaluated once per group. * The query groups all elements where all expressions * specified in setGrouping have the same values. * The query result consists of one element per group. */ public class Grouping extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.10-1 (Grouping) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "department, SUM(salary)", /*INTO*/ null, /*FROM*/ FullTimeEmployee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ "department", /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** * The array of invalid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] INVALID_QUERIES = { new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "department, salary", /*INTO*/ null, /*FROM*/ FullTimeEmployee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ "department", /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** * The expected results of valid queries. */ private Object[] expectedResult = { Arrays.asList(new Object[] { new Object[] {getTransientCompanyModelInstance("dept1"), new Double(30000.0)}, new Object[] {getTransientCompanyModelInstance("dept2"), new Double(45000.0)}}) }; /** * The main 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(Grouping.class); } /** */ public void testPositive() { for (int i = 0; i < VALID_QUERIES.length; i++) { executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); } } /** */ public void testNegative() { for (int i = 0; i < INVALID_QUERIES.length; i++) { compileAPIQuery(ASSERTION_FAILED, INVALID_QUERIES[i], false); compileSingleStringQuery(ASSERTION_FAILED, INVALID_QUERIES[i], false); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/result/IfElseResult.java100664 15213 12500110373 24643 0ustarmbouschenstaff 0 0 /* * 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.query.result; import java.util.Arrays; import java.math.BigDecimal; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.DentalInsurance; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.pc.company.Project; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: IfElseResult. *
*Keywords: query *
*Assertion ID: . *
*Assertion Description: */ public class IfElseResult extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion (IfElseResult) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "IF (this.employee == null) 'No employee' ELSE this.employee.lastname", /*INTO*/ null, /*FROM*/ DentalInsurance.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ "this.insid ascending", /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "IF (this.members.size() > 2) this.budget * 1.2 ELSE this.budget * 1.1", /*INTO*/ null, /*FROM*/ Project.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ "this.projid ascending", /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "IF (this.reviewers.isEmpty()) 'No reviewer' ELSE IF (this.reviewers.size() == 1) 'Single reviewer' ELSE 'Reviewer team'", /*INTO*/ null, /*FROM*/ Project.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ "this.projid ascending", /*FROM*/ null, /*TO*/ null) }; /** * The array of invalid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] INVALID_QUERIES = { // Invalid type of condition expression new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "IF (this.firstname) 0 ELSE 1", /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // missing ELSE new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "IF (this.employee == null) 0", /*INTO*/ null, /*FROM*/ DentalInsurance.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // type of THEN expr must be the same as type of ELSE expr new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "IF (this.employee == null) 'Michael' ELSE this.employee", /*INTO*/ null, /*FROM*/ DentalInsurance.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** * The expected results of valid queries. */ private Object[] expectedResult = { Arrays.asList(new Object[] { "emp1Last", "emp2Last", "emp3Last", "emp4Last", "emp5Last", "No employee" }), Arrays.asList(new Object[] { new BigDecimal("3000001.188"), new BigDecimal("55000"), new BigDecimal("2201.089") }), Arrays.asList(new Object[] { "No reviewer", "Reviewer team", "Single reviewer" }) }; /** * The main 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(NullResults.class); } /** */ public void testPositive() { for (int index = 0; index < VALID_QUERIES.length; index++) { executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); } } /** */ public void testNegative() { for (int i = 0; i < INVALID_QUERIES.length; i++) { compileAPIQuery(ASSERTION_FAILED, INVALID_QUERIES[i], false); compileSingleStringQuery(ASSERTION_FAILED, INVALID_QUERIES[i], false); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/result/ImmutableQueryResult.java100664 14323 12500110373 26442 0ustarmbouschenstaff 0 0 /* * 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.query.result; import java.util.Collection; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PrimitiveTypes; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Changing query result fails. *
*Keywords: query *
*Assertion ID: A14.6.1-7. *
*Assertion Description: * Executing any operation on the result that might change it throws * UnsupportedOperationException. */ public class ImmutableQueryResult extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.1-7 (ImmutableQueryResult) failed: "; /** * The main 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(ImmutableQueryResult.class); } /** */ public void testPositive() { PersistenceManager pm = getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); // get PrimitiveTypes instance with id 5 Collection instance5Collection = (Collection)pm.newQuery( PrimitiveTypes.class, "id == 5").execute(); PrimitiveTypes instance5 = (PrimitiveTypes)instance5Collection.iterator().next(); // get query result collection Collection result = (Collection)pm.newQuery( PrimitiveTypes.class, "id > 3").execute(); // method add try { result.add(new Integer(1)); fail(ASSERTION_FAILED, "Method add called on a query result show throw " + "UnsupportedOperationException"); } catch (UnsupportedOperationException ex) { // expected exception if (debug) logger.debug("Method add called on a query result throws " + "expected exception " + ex); } // method addAll try { result.addAll(instance5Collection); fail(ASSERTION_FAILED, "Method addAll called on a query result show throw " + "UnsupportedOperationException"); } catch (UnsupportedOperationException ex) { // expected exception if (debug) logger.debug("Method addAll called on a query result throws " + "expected exception " + ex); } // method clear try { result.clear(); fail(ASSERTION_FAILED, "Method clear called on a query result show throw " + "UnsupportedOperationException"); } catch (UnsupportedOperationException ex) { // expected exception if (debug) logger.debug("Method clear called on a query result throws " + "expected exception " + ex); } // method remove try { result.remove(instance5); fail(ASSERTION_FAILED, "Method remove called on a query result show throw " + "UnsupportedOperationException"); } catch (UnsupportedOperationException ex) { // expected exception if (debug) logger.debug("Method remove called on a query result throws " + "expected exception " + ex); } // method removeAll try { result.removeAll(instance5Collection); fail(ASSERTION_FAILED, "Method removeAll called on a query result show throw " + "UnsupportedOperationException"); } catch (UnsupportedOperationException ex) { // expected exception if (debug) logger.debug("Method removeAll called on a query result " + "throws expected exception " + ex); } // method retainAll try { result.retainAll(instance5Collection); fail(ASSERTION_FAILED, "Method retainAll called on a query result show throw " + "UnsupportedOperationException"); } catch (UnsupportedOperationException ex) { // expected exception if (debug) logger.debug("Method retainAll called on a query result " + "throws expected exception " + ex); } // method iterator.remove try { result.iterator().remove(); fail(ASSERTION_FAILED, "Method remove called on an iterator obtained from a query " + "result show throw UnsupportedOperationException"); } catch (UnsupportedOperationException ex) { // expected exception if (debug) logger.debug( "Method remove called on an iterator obtained " + "from a query result throws expected exception " + ex); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PrimitiveTypes.class); loadAndPersistPrimitiveTypes(getPM()); } } tck/src/java/org/apache/jdo/tck/query/result/MethodsInResult.java100664 20300 12500110373 25357 0ustarmbouschenstaff 0 0 /* * 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.query.result; import java.math.BigInteger; import java.util.Arrays; import javax.jdo.PersistenceManager; import javax.jdo.Query; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Department; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Test using methods in the result expression *
*Keywords: query result *
*Assertion ID: A14.6.9-5. *
*Assertion Description: * The result expressions include: * method expression: the value of an expression calling any of the methods allowed in * queries applied to fields is returned. */ public class MethodsInResult extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.9-5 (MethodsInResult) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { // collection.size() new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "this.employees.size()", /*INTO*/ null, /*FROM*/ Department.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ "this.name ascending", /*FROM*/ null, /*TO*/ null), // map.size() new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "this.phoneNumbers.size()", /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ "this.lastname ascending, this.firstname ascending", /*FROM*/ null, /*TO*/ null), // MAX(collection.size()) new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "MAX(this.employees.size())", /*INTO*/ null, /*FROM*/ Department.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // map.get() new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "this.phoneNumbers.get('home')", /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ "this.lastname ascending, this.firstname ascending", /*FROM*/ null, /*TO*/ null), // String.substring() new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "this.firstname.substring(1,4)", /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ "this.lastname ascending, this.firstname ascending", /*FROM*/ null, /*TO*/ null), // String.indexOf() new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "this.firstname.indexOf('First')", /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ "this.lastname ascending, this.firstname ascending", /*FROM*/ null, /*TO*/ null) }; /** * The expected results of valid queries. */ private Object[] expectedResult = { // collection.size() Arrays.asList(new Object[] { new Integer(3), new Integer(2) }), // map.size() Arrays.asList(new Object[] { new Integer(2), new Integer(2), new Integer(2), new Integer(2), new Integer(2) }), // MAX(collection.size()) new Integer(3), // map.get() Arrays.asList(new Object[] { "1111", "2222", "3333", "3343", "3363" }), // String.substring() Arrays.asList(new Object[] { "mp1", "mp2", "mp3", "mp4", "mp5" }), // String.indexOf() //Arrays.asList(new Object[] { new BigInteger("4"), new BigInteger("4"), new BigInteger("4"), new BigInteger("4"), new BigInteger("4") }), Arrays.asList(new Object[] { new Integer(4), new Integer(4), new Integer(4), new Integer(4), new Integer(4) }), }; /** * The main 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(MethodsInResult.class); } public void testCollectionSizeInResult() throws Exception { int index = 0; executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); } public void testMapSizeInResult() throws Exception { int index = 1; executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); } public void testMaxAndSizeInResult() throws Exception { int index = 2; executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); } public void testMapGetInResult() throws Exception { int index = 3; executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); } public void testSubstringInResult() throws Exception { int index = 4; executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); } public void testIndexOfInResult() throws Exception { int index = 5; executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/result/NPEInResultExpr.java100664 10117 12500110373 25242 0ustarmbouschenstaff 0 0 /* * 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.query.result; import java.util.Arrays; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Department; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: NullPointerException in Result Expression. *
*Keywords: query *
*Assertion ID: A14.6.9-4. *
*Assertion Description: * If any result is a navigational expression, * and a non-terminal field or variable has a null value for a particular set * of conditions (the result calculation would throw NullPointerException), * then the result is null for that result expression. */ public class NPEInResultExpr extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.9-4 (NPEInResultExpr) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "manager.lastname", /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "e.manager.lastname", /*INTO*/ null, /*FROM*/ Department.class, /*EXCLUDE*/ null, /*WHERE*/ "employees.contains(e)", /*VARIABLES*/ "Employee e", /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** * The expected results of valid queries. */ private Object[] expectedResult = { //Note: None of the entries below are bean names! Arrays.asList(new Object[]{ "emp2Last", null, "emp2Last", "emp2Last", "emp2Last"}), Arrays.asList(new Object[]{ "emp2Last", null, "emp2Last", "emp2Last", "emp2Last"}) }; /** * The main 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(NPEInResultExpr.class); } /** */ public void testPositive() { for (int i = 0; i < VALID_QUERIES.length; i++) { executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/result/NullResults.java100664 11332 12500110373 24567 0ustarmbouschenstaff 0 0 /* * 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.query.result; import java.util.Arrays; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Null Results. *
*Keywords: query *
*Assertion ID: A14.6.9-7. *
*Assertion Description: * If the returned value from a query specifying a result is null, * this indicates that the expression specified as the result was null. */ public class NullResults extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.9-7 (NullResults) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { new QueryElementHolder( /*UNIQUE*/ Boolean.TRUE, /*RESULT*/ "manager", /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ "lastname == 'emp2Last'", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "manager", /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ "lastname == 'emp2Last'", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "DISTINCT manager", /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** * The expected results of valid queries. */ private Object[] expectedResult = { null, Arrays.asList(new Object[]{null}), getTransientCompanyModelInstancesAsList(new String[]{"emp2", null}) }; /** * The main 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(NullResults.class); } /** */ public void testUnique() { int index = 0; executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); } /** */ public void testNavigation() { int index = 1; executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); } /** */ public void testDistinctNavigation() { int index = 2; executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/result/ProjectedSCODoesNotTrackChanges.java100664 13711 12500110373 30334 0ustarmbouschenstaff 0 0 /* * 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.query.result; import java.util.Calendar; import java.util.Date; import javax.jdo.JDOHelper; import javax.jdo.Query; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.Address; import org.apache.jdo.tck.pc.company.Company; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Projected Second Class Objects Do Not Track Their Changes *
*Keywords: embedded query *
*Assertion ID: A14.6.9-9. *
*Assertion Description: * If an SCO field is in the result, the projected field is not owned by any persistent * instance, and modifying the SCO value has no effect on any persistent instance. * If an FCO field is in the result, the projected field is a persistent instance, and * modifications made to the instance are reflected as changes to the datastore per * transaction requirements. */ public class ProjectedSCODoesNotTrackChanges extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.9-3 (ProjectedSCODoesNotTrackChanges) failed: "; private static final Date expectedDate; static { Calendar cal = Calendar.getInstance(); cal.set(1970, 0, 1, 0, 0, 0); cal.set(Calendar.MILLISECOND, 0); expectedDate = cal.getTime(); } /** * The main 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(ProjectedSCODoesNotTrackChanges.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(Company.class); } private Company getPersistentNewInstance(long companyid) { Company obj = new Company(companyid, "MyCompany", expectedDate, new Address(0,"","","","","")); pm.makePersistent(obj); // obj should transition to persistent-new int curr = currentState(obj); if( curr != PERSISTENT_NEW ){ fail(ASSERTION_FAILED, "Unable to create persistent-new instance " + "from transient instance via makePersistent(), state is " + states[curr]); } return obj; } /** This tests that when an embedded field is selected * and modified, there is no change in the owned instance. */ public void testEmbeddedField() { String testZip = "94040"; pm = getPM(); pm.currentTransaction().begin(); Company comp = getPersistentNewInstance(0); pm.currentTransaction().commit(); // Select address, modify, and commit pm.currentTransaction().begin(); Query query = pm.newQuery(Company.class, "name.startsWith(\"MyCompany\")"); query.setResult("address"); query.setUnique(true); Address myCompanyAddress = (Address) query.execute(); myCompanyAddress.setZipcode(testZip); if (JDOHelper.isDirty((Object)comp)) { appendMessage("Expected Company instance not to be dirty; " + "actual state is " + getStateOfInstance((Object)comp)); } pm.currentTransaction().commit(); // Check value of address pm.currentTransaction().begin(); Address persistedCompanyAddress = (Address) query.execute(); String actualZip = persistedCompanyAddress.getZipcode(); if (actualZip.equals(testZip)) { appendMessage("Expected projected field value is " + testZip + "; actual value is " + actualZip); } logger.debug("MyCompany's zipcode is '" + actualZip + "'"); pm.currentTransaction().commit(); failOnError(); } /** This tests that when a Date field is selected * and modified, there is no change in the owned instance. */ public void testDateField() { pm = getPM(); pm.currentTransaction().begin(); Company comp = getPersistentNewInstance(0); pm.currentTransaction().commit(); // Select date, modify, and commit pm.currentTransaction().begin(); Query query = pm.newQuery(Company.class, "name.startsWith(\"MyCompany\")"); query.setResult("founded"); query.setUnique(true); Date retrievedDate = (Date) query.execute(); retrievedDate.setTime(123789L); if (JDOHelper.isDirty((Object)comp)) { appendMessage("Expected Company instance not to be dirty; " + "actual state is " + getStateOfInstance((Object)comp)); } pm.currentTransaction().commit(); // Check value of date pm.currentTransaction().begin(); Date actualDate = (Date) query.execute(); if (!actualDate.equals(expectedDate)) { appendMessage("Expected projected field value is " + expectedDate + "; actual value is " + actualDate + "; modified retrieved value is " + retrievedDate); } logger.debug("MyCompany's founded date is '" + actualDate + "'"); pm.currentTransaction().commit(); failOnError(); } } tck/src/java/org/apache/jdo/tck/query/result/ResultClassRequirements.java100664 36421 12500110373 27151 0ustarmbouschenstaff 0 0 /* * 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.query.result; import java.math.BigDecimal; import java.util.Arrays; import java.util.Map; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.FullTimeEmployee; import org.apache.jdo.tck.pc.company.Project; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.query.result.classes.LongString; import org.apache.jdo.tck.query.result.classes.MissingNoArgsConstructor; import org.apache.jdo.tck.query.result.classes.NoFieldsNoMethods; import org.apache.jdo.tck.query.result.classes.PublicLongField; import org.apache.jdo.tck.query.result.classes.PublicPutMethod; import org.apache.jdo.tck.util.BatchTestRunner; import org.apache.jdo.tck.util.ConversionHelper; /** *Title: Result Class Requirements. *
*Keywords: query *
*Assertion ID: A14.6.12-1. *
*Assertion Description: * The result class may be one of the java.lang classes ... */ public class ResultClassRequirements extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.12-1 (ResultClassRequirements) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { // Long new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "personid", /*INTO*/ Long.class, /*FROM*/ FullTimeEmployee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // Double new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "salary", /*INTO*/ Double.class, /*FROM*/ FullTimeEmployee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // BigDecimal new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "budget", /*INTO*/ BigDecimal.class, /*FROM*/ Project.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // java.util.Date new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "hiredate", /*INTO*/ java.util.Date.class, /*FROM*/ FullTimeEmployee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // Map new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "personid AS id, lastname AS name", /*INTO*/ Map.class, /*FROM*/ FullTimeEmployee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // user defined result class new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "personid AS l, lastname AS s", /*INTO*/ LongString.class, /*FROM*/ FullTimeEmployee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // constructor new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "new LongString(personid, lastname)", /*INTO*/ null, /*FROM*/ FullTimeEmployee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ "import org.apache.jdo.tck.query.result.classes.LongString;", /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // constructor without constructor call new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "personid, lastname", /*INTO*/ LongString.class, /*FROM*/ FullTimeEmployee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // public fields new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "personid AS l", /*INTO*/ PublicLongField.class, /*FROM*/ FullTimeEmployee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // public put method new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "personid, lastname", /*INTO*/ PublicPutMethod.class, /*FROM*/ FullTimeEmployee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** * The array of invalid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] INVALID_QUERIES = { // JDK class new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "personid, lastname", /*INTO*/ Long.class, /*FROM*/ FullTimeEmployee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // JDK class, non assignment compatible new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "this", /*INTO*/ Long.class, /*FROM*/ FullTimeEmployee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // TCK class, salary field is not assignment compatible new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "personid AS l, salary AS s", /*INTO*/ LongString.class, /*FROM*/ FullTimeEmployee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // TCK class, non existing constructor new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "new LongString(personid)", /*INTO*/ null, /*FROM*/ FullTimeEmployee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ "import org.apache.jdo.tck.query.result.classes.LongString;", /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // TCK class, no no-args constructor new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "personid", /*INTO*/ MissingNoArgsConstructor.class, /*FROM*/ FullTimeEmployee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // TCK class, no no-args constructor new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "personid", /*INTO*/ NoFieldsNoMethods.class, /*FROM*/ FullTimeEmployee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), }; // Two dimensional arrays to be converted to maps // in the expected result. private static Object[][] emp1Map = {{"id", new Long(1)}, {"name", "emp1Last"}}; private static Object[][] emp2Map = {{"id", new Long(2)}, {"name", "emp2Last"}}; private static Object[][] emp5Map = {{"id", new Long(5)}, {"name", "emp5Last"}}; private static Object[][] publicPutMethod1 = {{"personid", new Long(1)}, {"lastname", "emp1Last"}}; private static Object[][] publicPutMethod2 = {{"personid", new Long(2)}, {"lastname", "emp2Last"}}; private static Object[][] publicPutMethod5 = {{"personid", new Long(5)}, {"lastname", "emp5Last"}}; /** * The expected results of valid queries. */ private Object[] expectedResult = { // Long Arrays.asList(new Object[]{new Long(1), new Long(2), new Long(5)}), // Double Arrays.asList(new Object[]{ new Double(20000.0), new Double(10000.0), new Double(45000.0)}), // BigDecimal Arrays.asList(new Object[]{new BigDecimal("2500000.99"), new BigDecimal("50000.00"), new BigDecimal("2000.99")}), // java.util.Date Arrays.asList(new Object[]{ CompanyModelReader.stringToUtilDate("1/Jan/1999"), CompanyModelReader.stringToUtilDate("1/Jul/2003"), CompanyModelReader.stringToUtilDate("15/Aug/1998")}), // Map Arrays.asList(new Object[]{ ConversionHelper.arrayToMap(emp1Map), ConversionHelper.arrayToMap(emp2Map), ConversionHelper.arrayToMap(emp5Map)}), // user defined result class Arrays.asList(new Object[]{ new LongString(1, "emp1Last"), new LongString(2, "emp2Last"), new LongString(5, "emp5Last")}), // constructor Arrays.asList(new Object[]{ new LongString(1, "emp1Last"), new LongString(2, "emp2Last"), new LongString(5, "emp5Last")}), // constructor without constructor call Arrays.asList(new Object[]{ new LongString(1, "emp1Last"), new LongString(2, "emp2Last"), new LongString(5, "emp5Last")}), // public fields Arrays.asList(new Object[]{ new PublicLongField(1), new PublicLongField(2), new PublicLongField(5)}), // public put method Arrays.asList(new Object[]{ new PublicPutMethod(ConversionHelper.arrayToMap(publicPutMethod1)), new PublicPutMethod(ConversionHelper.arrayToMap(publicPutMethod2)), new PublicPutMethod(ConversionHelper.arrayToMap(publicPutMethod5))}) }; /** * The main 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(ResultClassRequirements.class); } /** */ public void testLong() { int index = 0; executeQuery(index); } /** */ public void testDouble() { int index = 1; executeQuery(index); } /** */ public void testBigDecimal() { int index = 2; executeQuery(index); } /** */ public void testDate() { int index = 3; executeQuery(index); } /** */ public void testMap() { int index = 4; executeQuery(index); } /** */ public void testUserDefinedResultClass() { int index = 5; executeQuery(index); } /** */ public void testConstructor() { int index = 6; executeQuery(index); index++; executeQuery(index); } /** */ public void testFields() { int index = 8; executeQuery(index); } /** */ public void testPut() { int index = 9; executeQuery(index); } /** */ public void testNegative() { for (int i = 0; i < INVALID_QUERIES.length; i++) { compileAPIQuery(ASSERTION_FAILED, INVALID_QUERIES[i], false); compileSingleStringQuery(ASSERTION_FAILED, INVALID_QUERIES[i], false); } } /** */ private void executeQuery(int index) { executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/result/ResultExpressions.java100664 41360 12500110373 26020 0ustarmbouschenstaff 0 0 /* * 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.query.result; import java.util.Arrays; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Department; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.pc.company.Person; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Result Expressions. *
*Keywords: query *
*Assertion ID: A14.6.9-5. *
*Assertion Description: * The result expressions include: ... * The result expression can be explicitly cast using the (cast) operator. */ public class ResultExpressions extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.9-5 (ResultExpressions) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { // this new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "this", /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // field new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "personid", /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // variable.field new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "p.projid", /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ "projects.contains(p) && personid == 1", /*VARIABLES*/ "Project p", /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // variable new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "p", /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ "projects.contains(p) && personid == 1", /*VARIABLES*/ "Project p", /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // COUNT(this) new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "COUNT(this)", /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // COUNT(variable) new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "COUNT(p)", /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ "projects.contains(p) && personid == 1", /*VARIABLES*/ "Project p", /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // SUM new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "SUM(personid)", /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // MIN new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "MIN(personid)", /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // MAX new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "MAX(personid)", /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // AVG new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "AVG(personid)", /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // field expression new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "personid + 1", /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // navigational expression this new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "this.personid", /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // navigational expression variable new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "p.projid", /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ "projects.contains(p) && personid == 1", /*VARIABLES*/ "Project p", /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // navigational expression parameter new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "p.projid", /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ "personid == 1", /*VARIABLES*/ null, /*PARAMETERS*/ "Project p", /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // navigational expression field new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "department.deptid", /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ "personid == 1", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // parameter new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "p", /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ "personid == 1", /*VARIABLES*/ null, /*PARAMETERS*/ "Project p", /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // cast new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "(FullTimeEmployee)manager", /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ "personid == 1", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** * The array of invalid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] INVALID_QUERIES = { // unknown field x new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "x", /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // field salary is declared in a subclass of the candidate class new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "salary", /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // project collection field new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "employees", /*INTO*/ null, /*FROM*/ Department.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // project map field new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "phoneNumbers", /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** * The expected results of valid queries. */ private Object[] expectedResult = { // this getTransientCompanyModelInstancesAsList(new String[]{ "emp1", "emp2", "emp3", "emp4", "emp5"}), // field Arrays.asList(new Object[]{new Long(1), new Long(2), new Long(3), new Long(4), new Long(5)}), // variable.field Arrays.asList(new Object[]{new Long(1)}), // variable getTransientCompanyModelInstancesAsList(new String[]{"proj1"}), // COUNT(this) new Long(5), // COUNT(variable) new Long(1), // SUM new Long(1+2+3+4+5), // MIN new Long(1), // MAX new Long(5), // AVG new Double(3), // field expression Arrays.asList(new Object[]{new Long(2), new Long(3), new Long(4), new Long(5), new Long(6)}), // navigational expression this Arrays.asList(new Object[]{new Long(1), new Long(2), new Long(3), new Long(4), new Long(5)}), // navigational expression variable Arrays.asList(new Object[]{new Long(1)}), // navigational expression parameter Arrays.asList(new Object[]{new Long(1)}), // navigational expression field Arrays.asList(new Object[]{new Long(1)}), // parameter getTransientCompanyModelInstancesAsList(new String[]{"proj1"}), // cast getTransientCompanyModelInstancesAsList(new String[]{"emp2"}) }; /** * The main 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(ResultExpressions.class); } /** */ public void testThis() { int index = 0; executeQuery(index, null); } /** */ public void testField() { int index = 1; executeQuery(index, null); } /** */ public void testVariableField() { int index = 2; executeQuery(index, null); } /** */ public void testVariable() { int index = 3; executeQuery(index, null); } /** */ public void testCountThis() { int index = 4; executeQuery(index, null); } /** */ public void testCountVariable() { int index = 5; executeQuery(index, null); } /** */ public void testSum() { int index = 6; executeQuery(index, null); } /** */ public void testMin() { int index = 7; executeQuery(index, null); } /** */ public void testMax() { int index = 8; executeQuery(index, null); } /** */ public void testAvg() { int index = 9; executeQuery(index, null); } /** */ public void testFieldExpression() { int index = 10; executeQuery(index, null); } /** */ public void testNavigationalExpressionThis() { int index = 11; executeQuery(index, null); } /** */ public void testNavigationalExpressionVariable() { int index = 12; executeQuery(index, null); } /** */ public void testNavigationalExpressionParameter() { int index = 13; Object[] parameters = getPersistentCompanyModelInstances(new String[]{"proj1"}); executeQuery(index, parameters); } /** */ public void testNavigationalExpressionField() { int index = 14; executeQuery(index, null); } /** */ public void testParameter() { int index = 15; Object[] parameters = getPersistentCompanyModelInstances(new String[]{"proj1"}); executeQuery(index, parameters); } /** */ public void testCast() { int index = 16; executeQuery(index, null); } /** */ public void testNegative() { for (int i = 0; i < INVALID_QUERIES.length; i++) { compileAPIQuery(ASSERTION_FAILED, INVALID_QUERIES[i], false); compileSingleStringQuery(ASSERTION_FAILED, INVALID_QUERIES[i], false); } } /** */ private void executeQuery(int index, Object[] parameters) { executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[index], parameters, expectedResult[index]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index], parameters, expectedResult[index]); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/result/ShapeOfResult.java100664 25035 12500110373 25024 0ustarmbouschenstaff 0 0 /* * 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.query.result; import java.util.Arrays; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Person; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.query.result.classes.FullName; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Shape of Result. *
*Keywords: query *
*Assertion ID: A14.6.12-2. *
*Assertion Description: * Table 6: Shape of Result (C is the candidate class) */ public class ShapeOfResult extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.12-2 (ShapeOfResult) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { // result: null new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // result: this AS C new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "this AS Person", /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // result: null, unique: true new QueryElementHolder( /*UNIQUE*/ Boolean.TRUE, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ "personid == 1", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // result: this AS C, unique: true new QueryElementHolder( /*UNIQUE*/ Boolean.TRUE, /*RESULT*/ "this AS Person", /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ "personid == 1", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // result: expression of type T new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "firstname", /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // result: expression of type T, unique: true new QueryElementHolder( /*UNIQUE*/ Boolean.TRUE, /*RESULT*/ "firstname", /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ "personid == 1", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // result: multiple expressions of type T new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "firstname, lastname", /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // result: multiple expressions of type T, unique: true new QueryElementHolder( /*UNIQUE*/ Boolean.TRUE, /*RESULT*/ "firstname, lastname", /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ "personid == 1", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // result: multiple expressions of type T, result class new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "firstname, lastname", /*INTO*/ FullName.class, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // result: multiple expressions of type T, result class, unique: true new QueryElementHolder( /*UNIQUE*/ Boolean.TRUE, /*RESULT*/ "firstname, lastname", /*INTO*/ FullName.class, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ "personid == 1", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), }; /** * The expected results of valid queries. */ private Object[] expectedResult = { // result: null getTransientCompanyModelInstancesAsList(new String[]{ "emp1", "emp2", "emp3", "emp4", "emp5"}), // result: this AS C getTransientCompanyModelInstancesAsList(new String[]{ "emp1", "emp2", "emp3", "emp4", "emp5"}), // result: null, unique: true getTransientCompanyModelInstance("emp1"), // result: this AS C, unique: true getTransientCompanyModelInstance("emp1"), // result: expression of type T Arrays.asList(new Object[]{"emp1First", "emp2First", "emp3First", "emp4First", "emp5First"}), // result: expression of type T, unique: true "emp1First", // result: multiple expressions of type T Arrays.asList(new Object[]{ new Object[]{"emp1First", "emp1Last"}, new Object[]{"emp2First", "emp2Last"}, new Object[]{"emp3First", "emp3Last"}, new Object[]{"emp4First", "emp4Last"}, new Object[]{"emp5First", "emp5Last"}}), // result: multiple expressions of type T, unique: true new Object[]{"emp1First", "emp1Last"}, // result: multiple expressions of type T, result class Arrays.asList(new Object[]{ new FullName("emp1First", "emp1Last"), new FullName("emp2First", "emp2Last"), new FullName("emp3First", "emp3Last"), new FullName("emp4First", "emp4Last"), new FullName("emp5First", "emp5Last")}), // result: multiple expressions of type T, result class, unique: true new FullName("emp1First", "emp1Last") }; /** * The main 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(ShapeOfResult.class); } /** */ public void testNoResult() { int index = 0; execute(index, expectedResult[index]); } /** */ public void testThisAsC() { int index = 1; execute(index, expectedResult[index]); } /** */ public void testNoResultUnique() { int index = 2; execute(index, expectedResult[index]); } /** */ public void testThisAsCUnique() { int index = 3; execute(index, expectedResult[index]); } /** */ public void testSingleExpression() { int index = 4; execute(index, expectedResult[index]); } /** */ public void testSingleExpressionUnique() { int index = 5; execute(index, expectedResult[index]); } /** */ public void testMultipleExpressions() { int index = 6; execute(index, expectedResult[index]); } /** */ public void testMultipleExpressionsUnique() { int index = 7; execute(index, expectedResult[index]); } /** */ public void testMultipleExpressionsResultClass() { int index = 8; execute(index, expectedResult[index]); } /** */ public void testMultipleExpressionResultClassUnique() { int index = 9; execute(index, expectedResult[index]); } /** */ private void execute(int index, Object expected) { executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[index], expected); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index], expected); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/result/Unique.java100664 11446 12500110373 23547 0ustarmbouschenstaff 0 0 /* * 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.query.result; import javax.jdo.Query; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Person; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Unique. *
*Keywords: query *
*Assertion ID: A14.6.11-1. *
*Assertion Description: * When the value of the Unique flag is true, * then the result of a query is a single value, * with null used to indicate that none of the instances * in the candidates satisfied the filter. * If more than one instance satisfies the filter, * and the range is not limited to one result, * then execute throws a JDOUserException. */ public class Unique extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.11-1 (Unique) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { new QueryElementHolder( /*UNIQUE*/ Boolean.TRUE, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ "personid == 1", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ Boolean.TRUE, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ "personid == 0", /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ Boolean.TRUE, /*RESULT*/ null, /*INTO*/ null, /*FROM*/ Person.class, /*EXCLUDE*/ null, /*WHERE*/ null, /*VARIABLES*/ null, /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ "personid ASCENDING", /*FROM*/ "0", /*TO*/ "1"), }; /** * The expected results of valid queries. */ private Object[] expectedResult = { getTransientCompanyModelInstance("emp1"), null, getTransientCompanyModelInstance("emp1") }; /** * The main 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(Unique.class); } /** */ public void testPositive() { for (int i = 0; i < VALID_QUERIES.length; i++) { executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[i], expectedResult[i]); } } public void testNegative() { String singleString = "SELECT UNIQUE FROM " + Person.class.getName(); Query query = getPM().newQuery(Person.class); query.setUnique(true); executeJDOQuery(ASSERTION_FAILED, query, singleString, false, null, null, false); query = getPM().newQuery(singleString); executeJDOQuery(ASSERTION_FAILED, query, singleString, false, null, null, false); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/result/VariableInResult.java100664 20264 12500110373 25512 0ustarmbouschenstaff 0 0 /* * 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.query.result; import java.util.Arrays; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Department; import org.apache.jdo.tck.pc.company.Employee; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Variable in Result. *
*Keywords: query *
*Assertion ID: A14.6.9-3. *
*Assertion Description: * If a variable or a field of a variable is included in the result, * either directly or via navigation through the variable, * then the semantics of the contains clause that include the variable change. * In this case, all values of the variable * that satisfy the filter are included in the result. * Result expressions begin with either an instance of the candidate class * (with an explicit or implicit "this") or an instance of a variable * (using the variable name). The candidate tuples are the cartesian product * of the candidate class and all variables used in the result. The result * tuples are the tuples of the candidate class and all variables used * in the result that satisfy the filter. * The result is the collection of result expressions projected from the * result tuples. */ public class VariableInResult extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.9-3 (VariableInResult) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "distinct e", /*INTO*/ null, /*FROM*/ Department.class, /*EXCLUDE*/ null, /*WHERE*/ "employees.contains(e)", /*VARIABLES*/ "Employee e", /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "distinct p.projid, p.name", /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ "projects.contains(p) & p.name == 'orange'", /*VARIABLES*/ "Project p", /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "p.projid, p.name", /*INTO*/ null, /*FROM*/ Employee.class, /*EXCLUDE*/ null, /*WHERE*/ "projects.contains(p) & p.name == 'orange'", /*VARIABLES*/ "Project p", /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "e", /*INTO*/ null, /*FROM*/ Department.class, /*EXCLUDE*/ null, /*WHERE*/ "employees.contains(e)", /*VARIABLES*/ "Employee e", /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), // SELECT e FROM Department WHERE deptid==2 & employees.contains(e) VARIABLES Employee e new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "e", /*INTO*/ null, /*FROM*/ Department.class, /*EXCLUDE*/ null, /*WHERE*/ "deptid == 2 & employees.contains(e)", /*VARIABLES*/ "Employee e", /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** * The expected results of valid queries. */ private Object emp1 = getTransientCompanyModelInstance("emp1"); private Object emp2 = getTransientCompanyModelInstance("emp2"); private Object emp3 = getTransientCompanyModelInstance("emp3"); private Object emp4 = getTransientCompanyModelInstance("emp4"); private Object emp5 = getTransientCompanyModelInstance("emp5"); private Object proj1 = getTransientCompanyModelInstance("proj1"); private Object proj2 = getTransientCompanyModelInstance("proj2"); private Object proj3 = getTransientCompanyModelInstance("proj3"); private Object[] expectedResult = { getTransientCompanyModelInstancesAsList( new String[]{"emp1","emp2","emp3","emp4","emp5"}), // Note: "orange" is not a bean name! Arrays.asList(new Object[]{ new Object[]{new Long(1), "orange"}}), Arrays.asList(new Object[]{ new Object[]{new Long(1), "orange"}, new Object[]{new Long(1), "orange"}, new Object[]{new Long(1), "orange"}}), getTransientCompanyModelInstancesAsList( new String[]{"emp1","emp2","emp3","emp4","emp5"}), getTransientCompanyModelInstancesAsList( new String[]{"emp4","emp5"}) }; /** * The main 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(VariableInResult.class); } /** */ public void testDistinctNoNavigation() { int index = 0; executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); } /** */ public void testDistinctNavigation() { int index = 1; executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); } /** */ public void testNavigation() { int index = 2; executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); } /** */ public void testNoNavigation() { int index = 3; executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); } /** */ public void testMultipleProjectionWithConstraints() { int index = 4; executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/result/VariableInResultMultipleNavigation.java100664 17717 12500110373 31257 0ustarmbouschenstaff 0 0 /* * 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.query.result; import java.util.Arrays; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Company; import org.apache.jdo.tck.pc.company.Department; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Variable in Result. *
*Keywords: query *
*Assertion ID: A14.6.9-3. *
*Assertion Description: * If a variable or a field of a variable is included in the result, * either directly or via navigation through the variable, * then the semantics of the contains clause that include the variable change. * In this case, all values of the variable * that satisfy the filter are included in the result. * Result expressions begin with either an instance of the candidate class * (with an explicit or implicit "this") or an instance of a variable * (using the variable name). The candidate tuples are the cartesian product * of the candidate class and all variables used in the result. The result * tuples are the tuples of the candidate class and all variables used * in the result that satisfy the filter. * The result is the collection of result expressions projected from the * result tuples. * * This test differs from VariableInResult by extending the navigation * of variables. It navigates from the candidate Department class to include * fields in the corresponding Company. It navigates from the candidate * Company class to Department, Employee, and Project. */ public class VariableInResultMultipleNavigation extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.9-3 (VariableInResult) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "this, d, e, p", /*INTO*/ null, /*FROM*/ Company.class, /*EXCLUDE*/ null, /*WHERE*/ "name == \"Sun Microsystems, Inc.\" && departments.contains(d) && d.employees.contains(e) && e.projects.contains(p)", /*VARIABLES*/ "Department d; Employee e; Project p", /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "this, e, p", /*INTO*/ null, /*FROM*/ Company.class, /*EXCLUDE*/ null, /*WHERE*/ "name == \"Sun Microsystems, Inc.\" && departments.contains(d) && d.employees.contains(e) && e.projects.contains(p)", /*VARIABLES*/ "Department d; Employee e; Project p", /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "d, e, p", /*INTO*/ null, /*FROM*/ Company.class, /*EXCLUDE*/ null, /*WHERE*/ "name == \"Sun Microsystems, Inc.\" && departments.contains(d) && d.employees.contains(e) && e.projects.contains(p)", /*VARIABLES*/ "Department d; Employee e; Project p", /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** * The expected results of valid queries. */ private Object company1 = getTransientCompanyModelInstance("company1"); private Object emp1 = getTransientCompanyModelInstance("emp1"); private Object emp2 = getTransientCompanyModelInstance("emp2"); private Object emp3 = getTransientCompanyModelInstance("emp3"); private Object emp4 = getTransientCompanyModelInstance("emp4"); private Object emp5 = getTransientCompanyModelInstance("emp5"); private Object proj1 = getTransientCompanyModelInstance("proj1"); private Object proj2 = getTransientCompanyModelInstance("proj2"); private Object proj3 = getTransientCompanyModelInstance("proj3"); private Object dept1 = getTransientCompanyModelInstance("dept1"); private Object dept2 = getTransientCompanyModelInstance("dept2"); private Object[] expectedResult = { Arrays.asList(new Object[] { new Object[] {company1, dept1, emp1, proj1}, new Object[] {company1, dept1, emp2, proj1}, new Object[] {company1, dept1, emp3, proj1}, new Object[] {company1, dept1, emp2, proj2}, new Object[] {company1, dept1, emp3, proj2}, new Object[] {company1, dept2, emp4, proj3}, new Object[] {company1, dept2, emp5, proj3}}), Arrays.asList(new Object[] { new Object[] {company1, emp1, proj1}, new Object[] {company1, emp2, proj1}, new Object[] {company1, emp3, proj1}, new Object[] {company1, emp2, proj2}, new Object[] {company1, emp3, proj2}, new Object[] {company1, emp4, proj3}, new Object[] {company1, emp5, proj3}}), Arrays.asList(new Object[] { new Object[] {dept1, emp1, proj1}, new Object[] {dept1, emp2, proj1}, new Object[] {dept1, emp3, proj1}, new Object[] {dept1, emp2, proj2}, new Object[] {dept1, emp3, proj2}, new Object[] {dept2, emp4, proj3}, new Object[] {dept2, emp5, proj3}}) }; /** * The main 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(VariableInResult.class); } /** */ public void testNavigationWithCompanyAndDepartmentAndEmployeeAndProject() { int index = 0; executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); } /** */ public void testNavigationWithCompanyAndEmployeeAndProject() { int index = 1; executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); } /** */ public void testNavigationWithDepartmentAndEmployeeAndProject() { int index = 2; executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); } /** * @see QueryTest#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/result/VariableInResultNavigation.java100664 22700 12500110373 27527 0ustarmbouschenstaff 0 0 /* * 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.query.result; import java.util.Arrays; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Company; import org.apache.jdo.tck.pc.company.Department; import org.apache.jdo.tck.query.QueryElementHolder; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Variable in Result. *
*Keywords: query *
*Assertion ID: A14.6.9-3. *
*Assertion Description: * If a variable or a field of a variable is included in the result, * either directly or via navigation through the variable, * then the semantics of the contains clause that include the variable change. * In this case, all values of the variable * that satisfy the filter are included in the result. * Result expressions begin with either an instance of the candidate class * (with an explicit or implicit "this") or an instance of a variable * (using the variable name). The candidate tuples are the cartesian product * of the candidate class and all variables used in the result. The result * tuples are the tuples of the candidate class and all variables used * in the result that satisfy the filter. * The result is the collection of result expressions projected from the * result tuples. * * This test differs from VariableInResult by extending the navigation * of variables. It navigates from the candidate Department class to include * fields in the corresponding Company. It navigates from the candidate * Company class to Department, Employee, and Project. */ public class VariableInResultNavigation extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.6.9-3 (VariableInResult) failed: "; /** * The array of valid queries which may be executed as * single string queries and as API queries. */ private static final QueryElementHolder[] VALID_QUERIES = { new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "e, p", /*INTO*/ null, /*FROM*/ Department.class, /*EXCLUDE*/ null, /*WHERE*/ "employees.contains(e) && e.projects.contains(p) && p.name == 'orange'", /*VARIABLES*/ "Employee e; Project p", /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "e, p", /*INTO*/ null, /*FROM*/ Department.class, /*EXCLUDE*/ null, /*WHERE*/ "employees.contains(e) && e.projects.contains(p)", /*VARIABLES*/ "Employee e; Project p", /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "this, e, p", /*INTO*/ null, /*FROM*/ Department.class, /*EXCLUDE*/ null, /*WHERE*/ "employees.contains(e) && e.projects.contains(p)", /*VARIABLES*/ "Employee e; Project p", /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "e, p", /*INTO*/ null, /*FROM*/ Department.class, /*EXCLUDE*/ null, /*WHERE*/ "deptid == 1 && employees.contains(e) && e.projects.contains(p)", /*VARIABLES*/ "Employee e; Project p", /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null), new QueryElementHolder( /*UNIQUE*/ null, /*RESULT*/ "e, p", /*INTO*/ null, /*FROM*/ Department.class, /*EXCLUDE*/ null, /*WHERE*/ "company.name == \"Sun Microsystems, Inc.\" && employees.contains(e) && e.projects.contains(p)", /*VARIABLES*/ "Employee e; Project p", /*PARAMETERS*/ null, /*IMPORTS*/ null, /*GROUP BY*/ null, /*ORDER BY*/ null, /*FROM*/ null, /*TO*/ null) }; /** * The expected results of valid queries. */ private Object emp1 = getTransientCompanyModelInstance("emp1"); private Object emp2 = getTransientCompanyModelInstance("emp2"); private Object emp3 = getTransientCompanyModelInstance("emp3"); private Object emp4 = getTransientCompanyModelInstance("emp4"); private Object emp5 = getTransientCompanyModelInstance("emp5"); private Object proj1 = getTransientCompanyModelInstance("proj1"); private Object proj2 = getTransientCompanyModelInstance("proj2"); private Object proj3 = getTransientCompanyModelInstance("proj3"); private Object dept1 = getTransientCompanyModelInstance("dept1"); private Object dept2 = getTransientCompanyModelInstance("dept2"); private Object[] expectedResult = { Arrays.asList(new Object[] { new Object[] {emp1, proj1}, new Object[] {emp2, proj1}, new Object[] {emp3, proj1}}), Arrays.asList(new Object[] { new Object[] {emp1, proj1}, new Object[] {emp2, proj1}, new Object[] {emp3, proj1}, new Object[] {emp2, proj2}, new Object[] {emp3, proj2}, new Object[] {emp4, proj3}, new Object[] {emp5, proj3}}), Arrays.asList(new Object[] { new Object[] {dept1, emp1, proj1}, new Object[] {dept1, emp2, proj1}, new Object[] {dept1, emp3, proj1}, new Object[] {dept1, emp2, proj2}, new Object[] {dept1, emp3, proj2}, new Object[] {dept2, emp4, proj3}, new Object[] {dept2, emp5, proj3}}), Arrays.asList(new Object[] { new Object[] {emp1, proj1}, new Object[] {emp2, proj1}, new Object[] {emp3, proj1}, new Object[] {emp2, proj2}, new Object[] {emp3, proj2}}), Arrays.asList(new Object[] { new Object[] {emp1, proj1}, new Object[] {emp2, proj1}, new Object[] {emp3, proj1}, new Object[] {emp2, proj2}, new Object[] {emp3, proj2}, new Object[] {emp4, proj3}, new Object[] {emp5, proj3}}) }; /** * The main 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(VariableInResult.class); } /** */ public void testNavigationWithConstraint() { int index = 0; executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); } /** */ public void testNavigationWithoutConstraint() { int index = 1; executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); } /** */ public void testNavigationWithThis() { int index = 2; executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); } /** */ public void testNavigationWithThisConstraint() { int index = 3; executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); } /** */ public void testNavigationWithCompanyConstraint() { int index = 4; executeAPIQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); executeSingleStringQuery(ASSERTION_FAILED, VALID_QUERIES[index], expectedResult[index]); } /** * @see QueryTest#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/sql/AllowedAPIMethods.java100664 17037 12500110373 25031 0ustarmbouschenstaff 0 0 /* * 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.query.sql; import java.text.MessageFormat; import java.util.Arrays; import javax.jdo.JDOUserException; import javax.jdo.Query; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Department; import org.apache.jdo.tck.pc.company.Person; import org.apache.jdo.tck.pc.mylib.MylibReader; import org.apache.jdo.tck.pc.mylib.PrimitiveTypes; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.query.result.classes.FullName; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Allowed API Methods. *
*Keywords: query *
*Assertion ID: A14.7-2. *
*Assertion Description: * The only methods that can be used are setClass * to establish the candidate class, * setUnique to declare that there is only one result row, * and setResultClass to establish the result class. */ public class AllowedAPIMethods extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.7-2 (AllowedAPIMethods) failed: "; /** * The main 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(AllowedAPIMethods.class); } /** The array of valid SQL queries. */ private static final String[] VALID_SQL_QUERIES = { "SELECT * FROM {0}.PrimitiveTypes", "SELECT * FROM {0}.departments", "SELECT * FROM {0}.persons", "SELECT FIRSTNAME, LASTNAME FROM {0}.persons WHERE PERSONID = 1", "SELECT FIRSTNAME, LASTNAME FROM {0}.persons" }; /** * The expected results of valid SQL queries. */ private Object[] expectedResult = { getTransientMylibInstancesAsList(new String[]{ "primitiveTypesPositive", "primitiveTypesNegative", "primitiveTypesCharacterStringLiterals"}), getTransientCompanyModelInstancesAsList(new String[]{"dept1", "dept2"}), getTransientCompanyModelInstancesAsList(new String[]{ "emp1", "emp2", "emp3", "emp4", "emp5"}), new Object[]{"emp1First", "emp1Last"}, Arrays.asList(new Object[]{ new FullName("emp1First", "emp1Last"), new FullName("emp2First", "emp2Last"), new FullName("emp3First", "emp3Last"), new FullName("emp4First", "emp4Last"), new FullName("emp5First", "emp5Last")}) }; /** */ public void testSetClass() { if (isSQLSupported()) { int index = 0; executeSQLQuery(ASSERTION_FAILED, VALID_SQL_QUERIES[index], PrimitiveTypes.class, null, true, null, expectedResult[index], false); index = 1; executeSQLQuery(ASSERTION_FAILED, VALID_SQL_QUERIES[index], Department.class, null, true, null, expectedResult[index], false); index = 2; executeSQLQuery(ASSERTION_FAILED, VALID_SQL_QUERIES[index], Person.class, null, true, null, expectedResult[index], false); } } /** */ public void testSetUnique() { if (isSQLSupported()) { int index = 3; executeSQLQuery(ASSERTION_FAILED, VALID_SQL_QUERIES[index], null, null, true, null, expectedResult[index], true); } } /** */ public void testSetResultClass() { if (isSQLSupported()) { int index = 4; executeSQLQuery(ASSERTION_FAILED, VALID_SQL_QUERIES[index], null, FullName.class, true, null, expectedResult[index], false); } } /** */ public void testNegative() { if (isSQLSupported()) { String schema = getPMFProperty("javax.jdo.mapping.Schema"); // Note that the SQL query below is valid. // The query is not executed. // Instead, the method uses a query instance // to check prohibited setters. String sql = "SELECT PERSONID FROM {0}.persons"; sql = MessageFormat.format(sql, new Object[]{schema}); Query query = getPM().newQuery("javax.jdo.query.SQL", sql); checkProhibitedSetters(query); } } private void checkProhibitedSetters(Query query) { checkSetResult(query); checkSetFilter(query); checkDeclareVariables(query); checkDeclareParameters(query); checkDeclareImports(query); checkSetGrouping(query); checkSetOrdering(query); } private void checkSetResult(Query query) { try { query.setResult("firstname, lastname"); methodFailed("setResult()"); } catch (JDOUserException e) { } } private void checkSetFilter(Query query) { try { query.setFilter("WHERE personid = 1"); methodFailed("setFilter()"); } catch (JDOUserException e) { } } private void checkDeclareVariables(Query query) { try { query.declareVariables("Employee emp"); methodFailed("declareVariables()"); } catch (JDOUserException e) { } } private void checkDeclareParameters(Query query) { try { query.declareParameters("Employee emp"); methodFailed("declareParameters()"); } catch (JDOUserException e) { } } private void checkDeclareImports(Query query) { try { query.declareImports("import org.apache.jdo.tck.pc.company.Employee"); methodFailed("declareImports()"); } catch (JDOUserException e) { } } private void checkSetGrouping(Query query) { try { query.setGrouping("firstname"); methodFailed("setGrouping()"); } catch (JDOUserException e) { } } private void checkSetOrdering(Query query) { try { query.setOrdering("firstname ASCENDING"); methodFailed("setOrdering()"); } catch (JDOUserException e) { } } private void methodFailed(String method) { fail(ASSERTION_FAILED + method + " on a SQL query must throw JDOUserException." ); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); addTearDownClass(MylibReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); loadAndPersistMylib(getPM()); } } tck/src/java/org/apache/jdo/tck/query/sql/ExecuteWithMap.java100664 15631 12500110373 24456 0ustarmbouschenstaff 0 0 /* * 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.query.sql; import java.util.HashMap; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.company.Person; import org.apache.jdo.tck.pc.mylib.MylibReader; import org.apache.jdo.tck.pc.mylib.PrimitiveTypes; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: ExecuteWithMap *
*Keywords: query *
*Assertion ID: A14.7-5. *
*Assertion Description: * If the parameter list is a Map, then the keys of the Map * must be instances of Integer whose intValue is 1..n. * The value in the Map corresponding to the key whose intValue is 1 * is bound to the first ? in the SQL statement, and so forth. */ public class ExecuteWithMap extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.7-5 (ExecuteWithMap)"; /** * The main 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(ExecuteWithMap.class); } /** The array of valid SQL queries. */ private static final String[] VALID_SQL_QUERIES = { "SELECT * FROM {0}.PrimitiveTypes WHERE intNotNull = ? " + "OR stringNull = ?", "SELECT * FROM {0}.persons WHERE FIRSTNAME = ? AND LASTNAME = ?" + " AND MIDDLENAME = ? AND CITY = ?", "SELECT * FROM {0}.persons WHERE FIRSTNAME = ? AND LASTNAME = ?" + " AND MIDDLENAME = ? AND CITY = ?", "SELECT * FROM {0}.persons WHERE FIRSTNAME = ? AND LASTNAME = ?" + " AND MIDDLENAME = ? AND CITY = ?" }; /** * The expected results of valid SQL queries. */ private Object[] expectedResult = { getTransientMylibInstancesAsList(new String[]{ "primitiveTypesPositive", "primitiveTypesCharacterStringLiterals"}), getTransientCompanyModelInstancesAsList(new String[]{"emp2"}), getTransientCompanyModelInstancesAsList(new String[]{"emp2"}), getTransientCompanyModelInstancesAsList(new String[]{"emp2"}) }; /** * Maps of parameter values */ private static HashMap hm1 = new HashMap(); private static HashMap hm2 = new HashMap(); private static HashMap hm3 = new HashMap(); private static HashMap hm4 = new HashMap(); private static HashMap illegalMapMissingKeyTwo = new HashMap(); private static HashMap illegalMapStartsWithZero = new HashMap(); private static HashMap illegalMapStringKeys = new HashMap(); static { // valid parameter values hm1.put(new Integer(1), new Integer(4)); hm1.put(new Integer(2), "Even"); hm2.put(new Integer(1), "emp2First"); hm2.put(new Integer(2), "emp2Last"); hm2.put(new Integer(3), "emp2Middle"); hm2.put(new Integer(4), "New York"); hm3 = (HashMap) hm2.clone(); // extra entry okay, should be ignored by impl hm3.put(new Integer(0), "emp2First"); hm4 = (HashMap) hm2.clone(); // extra entry okay, should be ignored by impl hm4.put(new Integer(5), "New York"); // invalid parameter values illegalMapMissingKeyTwo.put(new Integer(1), "emp2First"); illegalMapMissingKeyTwo.put(new Integer(3), "emp2Last"); illegalMapMissingKeyTwo.put(new Integer(4), "emp2Middle"); illegalMapMissingKeyTwo.put(new Integer(5), "New York"); illegalMapStartsWithZero.put(new Integer(0), "emp2First"); illegalMapStartsWithZero.put(new Integer(1), "emp2Last"); illegalMapStartsWithZero.put(new Integer(2), "emp2Middle"); illegalMapStartsWithZero.put(new Integer(3), "New York"); illegalMapStringKeys.put(new String("1dog"), "emp2First"); illegalMapStringKeys.put(new String("2dog"), "emp2Last"); illegalMapStringKeys.put(new String("3dog"), "emp2Middle"); illegalMapStringKeys.put(new String("4dog"), "New York"); }; private static HashMap[] parameterMap = new HashMap[]{hm1, hm2, hm3, hm4}; /** */ public void testSetClass() { if (isSQLSupported()) { int index = 0; executeSQLQuery(ASSERTION_FAILED, VALID_SQL_QUERIES[index], PrimitiveTypes.class, null, true, parameterMap[index], expectedResult[index], false); index = 1; executeSQLQuery(ASSERTION_FAILED, VALID_SQL_QUERIES[index], Person.class, null, true, parameterMap[index], expectedResult[index], false); index = 2; executeSQLQuery(ASSERTION_FAILED, VALID_SQL_QUERIES[index], Person.class, null, true, parameterMap[index], expectedResult[index], false); index = 3; executeSQLQuery(ASSERTION_FAILED, VALID_SQL_QUERIES[index], Person.class, null, true, parameterMap[index], expectedResult[index], false); } } /** */ public void testNegative() { if (isSQLSupported()) { String query = "SELECT * FROM {0}.persons WHERE FIRSTNAME = ? " + "AND LASTNAME = ? AND MIDDLENAME = ? AND CITY = ? " + "AND FUNDINGDEPT = ?"; String singleStringQuery = query; executeSQLQuery(ASSERTION_FAILED, query, Person.class, null, false, illegalMapMissingKeyTwo, null, false); executeSQLQuery(ASSERTION_FAILED, query, Person.class, null, false, illegalMapStartsWithZero, null, false); executeSQLQuery(ASSERTION_FAILED, query, Person.class, null, false, illegalMapStringKeys, null, false); } } /** * @see QueryTest#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); addTearDownClass(MylibReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); loadAndPersistMylib(getPM()); } } tck/src/java/org/apache/jdo/tck/query/sql/NewQuery.java100664 5640 12500110373 23320 0ustarmbouschenstaff 0 0 /* * 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.query.sql; import java.util.Arrays; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: New SQL Query. *
*Keywords: query *
*Assertion ID: A14.7-1. *
*Assertion Description: * In this case, the factory method that takes the language string and * Object is used: newQuery (String language, Object query). * The language parameter is javax.jdo.query.SQL and * the query parameter is the SQL query string. */ public class NewQuery extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.7-1 (NewQuery) failed: "; /** * The main 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(NewQuery.class); } /** The array of valid SQL queries. */ private static final String[] VALID_SQL_QUERIES = { "SELECT firstname, lastname FROM {0}.persons WHERE personid = ?" }; /** * The expected results of valid SQL queries. */ private Object[] expectedResult = { Arrays.asList(new Object[]{ new Object[]{"emp1First", "emp1Last"}}) }; /** Parameters of valid SQL queries. */ private static Object[][] parameters = { {new Integer(1)} }; /** */ public void testPositive() { if (isSQLSupported()) { for (int i = 0; i < VALID_SQL_QUERIES.length; i++) { executeSQLQuery(ASSERTION_FAILED, VALID_SQL_QUERIES[i], null, null, true, parameters[i], expectedResult[i], false); } } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/sql/NoCandidateClass.java100664 6402 12500110373 24675 0ustarmbouschenstaff 0 0 /* * 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.query.sql; import java.util.Arrays; import javax.jdo.Query; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: No Candidate Class. *
*Keywords: query *
*Assertion ID: A14.7-3. *
*Assertion Description: * SQL queries can be defined without a candidate class. * These queries can be found by name using the factory method newNamedQuery, * specifying the class as null, * or can be constructed without a candidate class. */ public class NoCandidateClass extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.7-3 (CandidateClass) failed: "; /** * The main 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(NoCandidateClass.class); } /** The array of valid SQL queries. */ private static final String[] VALID_SQL_QUERIES = { "SELECT firstname, lastname FROM {0}.persons" }; /** * The expected results of valid SQL queries. */ private Object[] expectedResult = { Arrays.asList(new Object[]{ new Object[]{"emp1First", "emp1Last"}, new Object[]{"emp2First", "emp2Last"}, new Object[]{"emp3First", "emp3Last"}, new Object[]{"emp4First", "emp4Last"}, new Object[]{"emp5First", "emp5Last"}}) }; /** */ public void testNamedQuery() { if (isSQLSupported()) { int index = 0; Query query = getPM().newNamedQuery(null, "SQLQuery"); executeJDOQuery(ASSERTION_FAILED, query, "Named SQL query", false, null, expectedResult[index], true); } } /** */ public void testNoCandidateClass() { if (isSQLSupported()) { int index = 0; executeSQLQuery(ASSERTION_FAILED, VALID_SQL_QUERIES[index], null, null, true, null, expectedResult[index], false); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); } } tck/src/java/org/apache/jdo/tck/query/sql/ShapeOfResult.java100664 15236 12500110373 24307 0ustarmbouschenstaff 0 0 /* * 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.query.sql; import java.text.MessageFormat; import java.util.Arrays; import javax.jdo.Query; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.CompanyModelReader; import org.apache.jdo.tck.pc.mylib.MylibReader; import org.apache.jdo.tck.pc.mylib.PrimitiveTypes; import org.apache.jdo.tck.query.QueryTest; import org.apache.jdo.tck.query.result.classes.FullName; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Shape of Result. *
*Keywords: query *
*Assertion ID: A14.7-4. *
*Assertion Description: * Table 7: Shape of Result of SQL Query */ public class ShapeOfResult extends QueryTest { /** */ private static final String ASSERTION_FAILED = "Assertion A14.7-4 (ShapeOfResult) failed: "; /** * The main 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(ShapeOfResult.class); } /** The array of valid SQL queries. */ private static final String[] VALID_SQL_QUERIES = { // candidate class "SELECT * FROM {0}.PrimitiveTypes", // candidate class, unique "SELECT * FROM {0}.PrimitiveTypes where id = 1", // single column "SELECT firstname FROM {0}.persons", // single column, unique "SELECT firstname FROM {0}.persons WHERE personid = 1", // mutiple columns "SELECT firstname, lastname FROM {0}.persons", // mutiple columns, unique "SELECT firstname, lastname FROM {0}.persons WHERE personid = 1", // result class "SELECT firstname, lastname FROM {0}.persons", // result class, unique "SELECT firstname, lastname FROM {0}.persons WHERE personid = 1" }; /** * The expected results of valid SQL queries. */ private Object[] expectedResult = { // candidate class getTransientMylibInstancesAsList(new String[]{ "primitiveTypesPositive", "primitiveTypesNegative", "primitiveTypesCharacterStringLiterals"}), // candidate class, unique getTransientMylibInstance("primitiveTypesPositive"), // single column Arrays.asList(new Object[]{"emp1First", "emp2First", "emp3First", "emp4First", "emp5First"}), // single column, unique "emp1First", // mutiple columns Arrays.asList(new Object[]{ new Object[]{"emp1First", "emp1Last"}, new Object[]{"emp2First", "emp2Last"}, new Object[]{"emp3First", "emp3Last"}, new Object[]{"emp4First", "emp4Last"}, new Object[]{"emp5First", "emp5Last"}}), // mutiple columns, unique new Object[]{"emp1First", "emp1Last"}, // result class Arrays.asList(new Object[]{ new FullName("emp1First", "emp1Last"), new FullName("emp2First", "emp2Last"), new FullName("emp3First", "emp3Last"), new FullName("emp4First", "emp4Last"), new FullName("emp5First", "emp5Last")}), // result class, unique new FullName("emp1First", "emp1Last") }; /** */ public void testCanidateClass() { if (isSQLSupported()) { int index = 0; executeSQLQuery(ASSERTION_FAILED, VALID_SQL_QUERIES[index], PrimitiveTypes.class, null, true, null, expectedResult[index], false); index++; executeSQLQuery(ASSERTION_FAILED, VALID_SQL_QUERIES[index], PrimitiveTypes.class, null, true, null, expectedResult[index], true); } } /** */ public void testSingleColumn() { if (isSQLSupported()) { int index = 2; executeSQLQuery(ASSERTION_FAILED, VALID_SQL_QUERIES[index], null, null, true, null, expectedResult[index], false); index++; executeSQLQuery(ASSERTION_FAILED, VALID_SQL_QUERIES[index], null, null, true, null, expectedResult[index], true); } } /** */ public void testMultipleColumn() { if (isSQLSupported()) { int index = 4; executeSQLQuery(ASSERTION_FAILED, VALID_SQL_QUERIES[index], null, null, true, null, expectedResult[index], false); index++; executeSQLQuery(ASSERTION_FAILED, VALID_SQL_QUERIES[index], null, null, true, null, expectedResult[index], true); } } /** */ public void testResultClass() { if (isSQLSupported()) { int index = 6; executeSQLQuery(ASSERTION_FAILED, VALID_SQL_QUERIES[index], null, FullName.class, true, null, expectedResult[index], false); index++; executeSQLQuery(ASSERTION_FAILED, VALID_SQL_QUERIES[index], null, FullName.class, true, null, expectedResult[index], true); } } /** */ public void testNegative() { if (isSQLSupported()) { String schema = getPMFProperty("javax.jdo.mapping.Schema"); String sql = MessageFormat.format( "SELECT stringNull FROM {0}.PrimitiveTypes", new Object[]{schema}); Query query = getPM().newQuery("javax.jdo.query.SQL", sql); query.setClass(PrimitiveTypes.class); compile(ASSERTION_FAILED, query, sql, false); } } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(CompanyModelReader.getTearDownClasses()); addTearDownClass(MylibReader.getTearDownClasses()); loadAndPersistCompanyModel(getPM()); loadAndPersistMylib(getPM()); } } tck/src/java/org/apache/jdo/tck/transactions/AfterCompletionMethodCalledWhenCommitted.java100664 10025 12500110373 32347 0ustarmbouschenstaff 0 0 /* * 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.transactions; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import javax.transaction.Status; import javax.transaction.Synchronization; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: After Completion Method Called When Committed *
*Keywords: transactions *
*Assertion ID: A13.4.3-6. *
*Assertion Description: The afterCompletionmethod of the Synchronization instance registered with a Transaction will be called during the behavior specified for the transaction completion method commit with a value of Status.STATUS_COMMITTE */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 10/11/01 1.0 */ public class AfterCompletionMethodCalledWhenCommitted extends JDO_Test implements Synchronization { private boolean afterCompletionCalled; private Transaction tx; /** */ private static final String ASSERTION_FAILED = "Assertion A13.4.3-6 (AfterCompletionMethodCalledWhenCommitted) failed: "; /** * The main 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(AfterCompletionMethodCalledWhenCommitted.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint.class); } /** */ public void test() { pm = getPM(); runTestAfterCompletionMethodCalledWhenCommitted(pm); pm.close(); pm = null; } /** */ public void beforeCompletion() { try { if (debug) logger.debug("before Complition isActive returns" + tx.isActive()); } catch (Exception ex) { fail(ASSERTION_FAILED, "tx.isActive called in beforeCompletion throws unexpected exception: " + ex); } } /** */ public void afterCompletion(int status) { if (status == javax.transaction.Status.STATUS_COMMITTED) { afterCompletionCalled = true; } else { fail(ASSERTION_FAILED, "afterCompletion: incorrect status, expected " + Status.STATUS_COMMITTED + ", got " + status); } } /** test transactions.setSynchronization() */ void runTestAfterCompletionMethodCalledWhenCommitted(PersistenceManager pm) { tx = pm.currentTransaction(); try { tx.begin(); PCPoint p1 = new PCPoint(1,3); pm.makePersistent(p1); tx.setSynchronization(this); afterCompletionCalled = false ; tx.commit(); tx = null; if (!afterCompletionCalled) { fail(ASSERTION_FAILED, "commit didn't invoke afterCompletion method"); } } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/transactions/AfterCompletionMethodCalledWhenRolledback.java100664 10061 12500110373 32464 0ustarmbouschenstaff 0 0 /* * 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.transactions; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import javax.transaction.Status; import javax.transaction.Synchronization; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: After Completion Method Called When Rolledback *
*Keywords: transactions *
*Assertion ID: A13.4.3-7. *
*Assertion Description: * The afterCompletion method of the Synchronization instance registered with a * Transaction will be called after the behavior specified for the method * rollback with a value of Status.STATUS_ROLLEDBACK. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 10/11/01 1.0 */ public class AfterCompletionMethodCalledWhenRolledback extends JDO_Test implements Synchronization { private boolean afterCompletionCalled; private Transaction tx; /** */ private static final String ASSERTION_FAILED = "Assertion A13.4.3-7 (AfterCompletionMethodCalledWhenRolledback) failed: "; /** * The main 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(AfterCompletionMethodCalledWhenRolledback.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint.class); } /** */ public void test() { pm = getPM(); runTestAfterCompletionMethodCalledWhenRolledback(pm); pm.close(); pm = null; } /** */ public void beforeCompletion() { try { if (debug) logger.debug("before Complition isActive returns :" + tx.isActive()); } catch (Exception ex) { fail(ASSERTION_FAILED, "tx.isActive called in beforeCompletion throws unexpected exception: " + ex); } } /** */ public void afterCompletion(int status) { if (status == javax.transaction.Status.STATUS_ROLLEDBACK) { afterCompletionCalled = true; } else { fail(ASSERTION_FAILED, "afterCompletion: incorrect status, expected " + Status.STATUS_ROLLEDBACK + ", got " + status); } } /** test transactions.setSynchronization() */ void runTestAfterCompletionMethodCalledWhenRolledback(PersistenceManager pm) { tx = pm.currentTransaction(); try { tx.begin(); PCPoint p1 = new PCPoint(1,3); pm.makePersistent(p1); tx.setSynchronization(this); afterCompletionCalled = false ; tx.rollback(); tx = null; if (!afterCompletionCalled) { fail(ASSERTION_FAILED, "rollback didn't invoke afterCompletion method"); } } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/transactions/AfterSetRollbackOnlyCommitFails.java100664 4315 12500110373 30464 0ustarmbouschenstaff 0 0 /* * 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.transactions; import javax.jdo.JDOFatalDataStoreException; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Test AfterSetRollbackOnlyCommitFails *
*Keywords: rollback commit setRollbackOnly *
*Assertion IDs: A13.4.5-1 *
*Assertion Description: Once a transaction has been marked for rollback via setRollbackOnly, the commit method will always fail with JDOFatalDataStoreException. */ public class AfterSetRollbackOnlyCommitFails extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A13.4.5-1 (AfterSetRollbackOnlyCommitFails) failed: "; /** * The main 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(AfterSetRollbackOnlyCommitFails.class); } /** */ public void test() { getPM(); Transaction tx = pm.currentTransaction(); tx.begin(); tx.setRollbackOnly(); try { tx.commit(); fail(ASSERTION_FAILED, "Failed to catch expected JDOFatalDataStoreException."); } catch (JDOFatalDataStoreException ex) { // Good catch! } } } tck/src/java/org/apache/jdo/tck/transactions/BeforeCompletionMethodCalled.java100664 7170 12500110373 30007 0ustarmbouschenstaff 0 0 /* * 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.transactions; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import javax.transaction.Status; import javax.transaction.Synchronization; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Before Completion Method Called *
*Keywords: transactions *
*Assertion ID: A13.4.3-4. *
*Assertion Description: The beforeCompletion method of the Synchronization instance registered with a Transaction will be called during the behavior specified for the transaction completion method commit. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 10/15/01 1.0 */ public class BeforeCompletionMethodCalled extends JDO_Test implements Synchronization { private boolean beforeCompletionCalled; /** */ private static final String ASSERTION_FAILED = "Assertion A13.4.3-4 (BeforeCompletionMethodCalled) failed: "; /** * The main 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(BeforeCompletionMethodCalled.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint.class); } /** */ public void test() { pm = getPM(); runTestBeforeCompletionMethodCalled(pm); pm.close(); pm = null; } /** */ public void beforeCompletion(){ beforeCompletionCalled = true; if (debug) logger.debug ("beforeCompletion called "); } /** */ public void afterCompletion(int status) { if (status != javax.transaction.Status.STATUS_COMMITTED) { fail(ASSERTION_FAILED, "afterCompletion: incorrect status, expected " + Status.STATUS_COMMITTED + ", got " + status); } } /** test transactions.setSynchronization() */ void runTestBeforeCompletionMethodCalled(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); PCPoint p1 = new PCPoint(1,3); pm.makePersistent(p1); tx.setSynchronization(this); beforeCompletionCalled = false ; tx.commit(); tx = null; if (!beforeCompletionCalled) { fail(ASSERTION_FAILED, "commit didn't invoke beforeCompletion method"); } } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/transactions/BeforeCompletionMethodNotCalledBeforeRollback.java100664 7204 12500110373 33263 0ustarmbouschenstaff 0 0 /* * 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.transactions; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import javax.transaction.Status; import javax.transaction.Synchronization; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Before Completion Method Not Called Before Rolledback *
*Keywords: transactions *
*Assertion ID: A13.4.3-5. *
*Assertion Description: The beforeCompletion method of the Synchronization instance registered with a Transaction will not be called before rollback. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 10/15/01 1.0 */ public class BeforeCompletionMethodNotCalledBeforeRollback extends JDO_Test implements Synchronization { private boolean beforeCompletionCalled; /** */ private static final String ASSERTION_FAILED = "Assertion A13.4.3-5 (BeforeCompletionMethodNotCalledBeforeRollback) failed: "; /** * The main 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(BeforeCompletionMethodNotCalledBeforeRollback.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint.class); } /** */ public void test() { pm = getPM(); runTestBeforeCompletionMethodNotCalledBeforeRollback(pm); pm.close(); pm = null; } /** */ public void beforeCompletion() { beforeCompletionCalled = true ; } /** */ public void afterCompletion(int status) { if (status != javax.transaction.Status.STATUS_ROLLEDBACK) { fail(ASSERTION_FAILED, "afterCompletion: incorrect status, expected " + Status.STATUS_ROLLEDBACK + ", got " + status); } } /** test transactions.rollback() */ void runTestBeforeCompletionMethodNotCalledBeforeRollback(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); PCPoint p1 = new PCPoint(1,3); pm.makePersistent(p1); tx.setSynchronization(this); beforeCompletionCalled = false ; tx.rollback(); tx = null; if (beforeCompletionCalled) { fail(ASSERTION_FAILED, "rollback invoked beforeCompletion, but it should not."); } } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/transactions/Commit.java100664 11377 12500110373 23561 0ustarmbouschenstaff 0 0 /* * 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.transactions; import javax.jdo.JDOHelper; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import javax.transaction.Status; import javax.transaction.Synchronization; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Commit *
*Keywords: transactions *
*Assertion ID: A13.4.4-1. *
*Assertion Description: The commit method performs the following operations:

  • calls the beforeCompletion method of the Synchronization instance registered with the Transaction;
  • flushes dirty persistent instances;
  • notifies the underlying data store to commit the transaction (this cannot be tested)
  • transitions persistent instances according to the life cycle specification;
  • calls the afterCompletion method of the Synchronization instance registered with the Transaction with the results of the data store commit operation.
*/ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 10/15/01 1.0 */ public class Commit extends JDO_Test implements Synchronization { private boolean beforeCompletionCalled; private boolean afterCompletionCalled; /** */ private static final String ASSERTION_FAILED = "Assertion A13.4.4-1 (Commit) failed: "; /** * The main 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(Commit.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint.class); } /** */ public void test() { pm = getPM(); runTestCommit(pm); pm.close(); pm = null; } /** */ public void beforeCompletion(){ beforeCompletionCalled = true; if (debug) logger.debug("beforeCompletion called "); } /** */ public void afterCompletion(int status) { if (status == Status.STATUS_COMMITTED) { afterCompletionCalled = true; if (debug) logger.debug("afterCompletion called\n "); } else { fail(ASSERTION_FAILED, "afterCompletion: incorrect status, expected " + Status.STATUS_COMMITTED + ", got " + status); } } /** test transactions.setSynchronization() */ void runTestCommit(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); PCPoint p1 = new PCPoint(1,3); pm.makePersistent(p1); if (!JDOHelper.isDirty(p1)) { fail(ASSERTION_FAILED, "P-NEW instance expected to be dirty, JDOHelper.isDirty returns false."); } tx.setSynchronization(this); beforeCompletionCalled = false; afterCompletionCalled = false; tx.commit(); tx = null; if (JDOHelper.isDirty(p1)) { fail(ASSERTION_FAILED, "P-NEW instance should transition to HOLLOW or P-NONTX and then it should not be dirty, JDOHelper.isDirty returns true."); } if (!beforeCompletionCalled) { fail(ASSERTION_FAILED, "commit didn't invoke beforeCompletion method"); } if (!afterCompletionCalled) { fail(ASSERTION_FAILED, "commit didn't invoke afterCompletion method"); } } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/transactions/GetPersistenceManager.java100664 5703 12500110373 26524 0ustarmbouschenstaff 0 0 /* * 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.transactions; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Get Persistence Manager *
*Keywords: transactions *
*Assertion ID: A13.4.1-1. *
*Assertion Description: The transactions.getPersistenceManager method returns associated persistence manager if the object parameter ia not null and implements persistenceCapable. evaluating to true when == is used. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 9/26/01 1.0 */ public class GetPersistenceManager extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A13.4.1-1 (GetPersistenceManager) failed: "; /** * The main 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(GetPersistenceManager.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint.class); } /** */ public void test() { pm = getPM(); runTestGetPersistenceManager(pm); pm.close(); pm = null; } /** test transactions.getPersistenceManager() */ void runTestGetPersistenceManager(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); PCPoint p1 = new PCPoint(1,3); pm.makePersistent(p1); PersistenceManager pm1 = tx.getPersistenceManager(); tx.commit(); tx = null; if (pm1 != pm) fail(ASSERTION_FAILED, "tx.getPersistenceManager() returned unexpected pm, expected " + pm + ", got " + pm1); } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/transactions/GetRetainValues.java100664 6226 12500110373 25350 0ustarmbouschenstaff 0 0 /* * 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.transactions; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Get Retain Values *
*Keywords: transactions *
*Assertion ID: A13.4.2-17. *
*Assertion Description: Transaction.getRetainValues returns the currently active setting for the RetainValues flag. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 10/09/01 1.0 */ public class GetRetainValues extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A13.4.2-17 (GetRetainValues) failed: "; /** * The main 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(GetRetainValues.class); } /** */ public void test() { pm = getPM(); runTestGetRetainValues(pm); pm.close(); pm = null; } /** test transaction.getRetainValues()*/ public void runTestGetRetainValues(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.setRetainValues(true); tx.begin(); if (!tx.getRetainValues()) { fail(ASSERTION_FAILED, "tx.getRetainValues returns false after setting the flag to true."); } tx.commit(); if (!tx.getRetainValues()) { fail(ASSERTION_FAILED, "tx.getRetainValues returns false after setting the flag to true."); } tx.setRetainValues(false); tx.begin(); if (tx.getRetainValues()) { fail(ASSERTION_FAILED, "tx.getRetainValues returns true after setting the flag to false."); } tx.commit(); if (tx.getRetainValues()) { fail(ASSERTION_FAILED, "tx.getRetainValues returns true after setting the flag to false."); } } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/transactions/GetRollbackOnlyReturnsFalseUntilSet.java100664 5207 12500110373 31365 0ustarmbouschenstaff 0 0 /* * 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.transactions; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Test GetRollbackOnlyReturnsFalseUntilSet *
*Keywords: commit setRollbackOnly getRollbackOnly *
*Assertion IDs: A13.4.5-2 *
*Assertion Description: When a transaction is not active, and after a transaction is begun, getRollbackOnly will return false. Once setRollbackOnly has been called, it will return true until commit or rollback is called. */ public class GetRollbackOnlyReturnsFalseUntilSet extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A13.4.5-2 (GetRollbackOnlyReturnsFalseUntilSet) failed: "; /** * The main 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(GetRollbackOnlyReturnsFalseUntilSet.class); } /** */ public void test() { getPM(); Transaction tx = pm.currentTransaction(); assertFalse(ASSERTION_FAILED + "getRollbackOnly returned true before transaction begin.", tx.getRollbackOnly()); tx.begin(); assertFalse(ASSERTION_FAILED + "getRollbackOnly returned true before setRollbackOnly.", tx.getRollbackOnly()); tx.setRollbackOnly(); assertTrue(ASSERTION_FAILED + "getRollbackOnly returned false after setRollbackOnly.", tx.getRollbackOnly()); tx.rollback(); assertFalse(ASSERTION_FAILED + "getRollbackOnly returned true after transaction rollback.", tx.getRollbackOnly()); } } tck/src/java/org/apache/jdo/tck/transactions/GetSynchronization.java100664 7436 12500110373 26153 0ustarmbouschenstaff 0 0 /* * 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.transactions; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import javax.transaction.Synchronization; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Get Synchronization *
*Keywords: transactions *
*Assertion ID: A13.4.3-8. *
*Assertion Description: A call to Transaction.getSynchronization retrieves the Synchronization instance that has been registered via setSynchronization. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 10/11/01 1.0 */ public class GetSynchronization extends JDO_Test implements Synchronization { private Transaction tx; /** */ private static final String ASSERTION_FAILED = "Assertion A13.4.3-8 (GetSynchronization) failed: "; /** * The main 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(GetSynchronization.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint.class); } /** */ public void beforeCompletion(){ try { if (debug) logger.debug("before Complition isActive returns :" + tx.isActive()); } catch (Exception ex) { fail(ASSERTION_FAILED, "tx.isActive called in beforeCompletion throws unexpected exception: " + ex); } } /** */ public void afterCompletion(int status) { try { if (debug) logger.debug("after Complition isActive returns :" + tx.isActive()); } catch (Exception ex) { fail(ASSERTION_FAILED, "tx.isActive called in afterCompletion throws unexpected exception: " + ex); } } /** */ public void test() { pm = getPM(); runTestGetSynchronization(pm); pm.close(); pm = null; } /** test transactions.getSynchronization() */ void runTestGetSynchronization(PersistenceManager pm) { tx = pm.currentTransaction(); try { tx.begin(); PCPoint p1 = new PCPoint(1,3); pm.makePersistent(p1); tx.setSynchronization(this); Synchronization s = tx.getSynchronization(); if (s != this) { fail(ASSERTION_FAILED, "wrong synchronization instance, expected " + this + ", got " + s); } tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/transactions/IsActive.java100664 5632 12500110373 24015 0ustarmbouschenstaff 0 0 /* * 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.transactions; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Is Active *
*Keywords: transactions *
*Assertion ID: A13.4.1-2. *
*Assertion Description: The transactions.isActive method tells whether there is an active transaction. There will be an active transaction if the begin method has been executed but neither commit nor rollback has been executed. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 10/09/01 1.0 */ public class IsActive extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A13.4.1-2 (IsActive) failed: "; /** * The main 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(IsActive.class); } /** */ public void test() { pm = getPM(); runTestIsActive(pm); pm.close(); pm = null; } /** test transactions.isActive() */ void runTestIsActive(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); if (!tx.isActive()) { fail(ASSERTION_FAILED, "tx.isActive returns false after tx.begin"); } tx.commit(); if (tx.isActive()) { fail(ASSERTION_FAILED, "tx.isActive returns true after tx.commit"); } tx.begin(); tx.rollback(); if (tx.isActive()) { fail(ASSERTION_FAILED, "tx.isActive returns true after tx.rollback"); } tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/transactions/IsActiveUntilAfterCompletionMethodCalled.java100664 10037 12500110373 32326 0ustarmbouschenstaff 0 0 /* * 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.transactions; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import javax.transaction.Synchronization; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Is Active Until After Completion Method Called *
*Keywords: transactions *
*Assertion ID: A13.4.1-3. *
*Assertion Description: Transaction.isActive returns true after the transaction has been started, until the afterCompletion synchronization method is called */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 10/09/01 1.0 */ public class IsActiveUntilAfterCompletionMethodCalled extends JDO_Test implements Synchronization { private Transaction tx; /** */ private static final String ASSERTION_FAILED = "Assertion A13.4.1-3 (IsActiveUntilAfterCompletionMethodCalled) failed: "; /** * The main 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(IsActiveUntilAfterCompletionMethodCalled.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint.class); } /** */ public void beforeCompletion() { try { if (!tx.isActive()) { fail(ASSERTION_FAILED, "tx.isActive returns false in beforeCompletion."); } } catch (Exception ex) { fail(ASSERTION_FAILED, "tx.isActive called in beforeCompletion throws unexpected exception: " + ex); } } /** */ public void afterCompletion(int status) { try { if (tx.isActive()) { fail(ASSERTION_FAILED, "tx.isActive returns true in afterCompletion."); } } catch (Exception ex) { fail(ASSERTION_FAILED, "tx.isActive called in afterCompletion throws unexpected exception: " + ex); } } /** */ public void test() { pm = getPM(); runTestIsActiveUntilAfterCompletionMethodCalled(pm); pm.close(); pm = null; } /** test transactions.isActive() */ void runTestIsActiveUntilAfterCompletionMethodCalled(PersistenceManager pm) { tx = pm.currentTransaction(); try { tx.begin(); PCPoint p1 = new PCPoint(1,3); pm.makePersistent(p1); tx.setSynchronization(this); if (!tx.isActive()) { fail(ASSERTION_FAILED, "tx.isActive returns false after tx.begin before tx.commit is completed."); } tx.commit(); if (tx.isActive()) { fail(ASSERTION_FAILED, "tx.isActive returns true after tx.commit."); } } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/transactions/Rollback.java100664 11657 12500110373 24063 0ustarmbouschenstaff 0 0 /* * 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.transactions; import javax.jdo.JDOHelper; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import javax.transaction.Status; import javax.transaction.Synchronization; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.mylib.PCPoint; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Rollback *
*Keywords: transactions *
*Assertion ID: A13.4.4-2. *
*Assertion Description: The rollback method performs the following operations:
  • rolls back changes made in this transaction from the data store;
  • transitions persistent instances according to the life cycle specification;
  • calls the afterCompletion method of the Synchronization instance registered with the Transaction.
*/ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 10/17/01 1.0 */ public class Rollback extends JDO_Test implements Synchronization { private boolean beforeCompletionCalled; private boolean afterCompletionCalled; /** */ private static final String ASSERTION_FAILED = "Assertion A13.4.4-2 (Rollback) failed: "; /** * The main 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(Rollback.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(PCPoint.class); } /** */ public void beforeCompletion(){ beforeCompletionCalled = true; if (debug) logger.debug ("beforeCompletion called "); } /** */ public void afterCompletion(int status) { if (status == javax.transaction.Status.STATUS_ROLLEDBACK) { afterCompletionCalled = true; if (debug) logger.debug("afterCompletion called\n "); } else { fail(ASSERTION_FAILED, "afterCompletion: incorrect status, expected " + Status.STATUS_ROLLEDBACK + ", got " + status); } } /** */ public void test() { pm = getPM(); runTestRollback(pm); pm.close(); pm = null; } /** test transactions.setSynchronization() */ void runTestRollback(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); PCPoint p1 = new PCPoint(1,3); pm.makePersistent(p1); tx.commit(); tx.begin(); p1.setX(55); if (!JDOHelper.isDirty(p1)) { fail(ASSERTION_FAILED, "JDOHelper.isDirty returns false when called for dirty instance."); } tx.setSynchronization(this); beforeCompletionCalled = false; afterCompletionCalled = false ; tx.rollback(); if (JDOHelper.isDirty(p1)) { fail(ASSERTION_FAILED, "P-NEW instance should transition to HOLLOW or P-NONTX and then it should not be dirty, JDOHelper.isDirty returns true."); } tx.setSynchronization(null); tx.begin(); int x = p1.getX(); tx.commit(); if (x != 1) { fail(ASSERTION_FAILED, "tx.rollback should rollback change of ip1.x, expected 1, got " + x); } if (beforeCompletionCalled) { fail(ASSERTION_FAILED, "rollback did invoke beforeCompletion method."); } if (!afterCompletionCalled) { fail(ASSERTION_FAILED, "commit didn't invoke afterCompletion method."); } } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/transactions/SetIsolationLevel.java100664 14201 12500110373 25723 0ustarmbouschenstaff 0 0 /* * 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.transactions; import javax.jdo.Constants; import javax.jdo.JDOUnsupportedOptionException; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title:Set isolation level of transaction *
*Keywords: persistencemanagerfactory *
*Assertion IDs: A11.1-xxxx, A11.1-xxxx. *
*Assertion Description: * Transaction.getIsolationLevel() returns the value * of the isolation level. * Transaction.setIsolationLevel(String) sets the value * of the isolation level. */ public class SetIsolationLevel extends JDO_Test implements Constants { /** */ private static final String ASSERTION_29_FAILED = "Assertion A13.4.2-29 (setIsolationLevel) failed: "; /** */ private static final String ASSERTION_25_FAILED = "Assertion A13.4.2-25 (setIsolationLevel) failed: "; /** All specified isolation levels */ private static final String[] isolationLevels = new String[] { TX_READ_UNCOMMITTED, TX_READ_COMMITTED, TX_REPEATABLE_READ, TX_SNAPSHOT, TX_SERIALIZABLE }; /** * The main 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(SetIsolationLevel.class); } /** */ protected void localSetUp() { pm = getPM(); } /** Set IsolationLevel to all values. */ public void testSetIsolationLevelOutsideTransaction() { // iterate through all possible IsolationLevels for (int i = 0; i < isolationLevels.length; ++i) { String isolationLevel = isolationLevels[i]; setIsolationLevel(isolationLevel); } closePMF(pmf); failOnError(); } /** Set IsolationLevel to all values within datastore transaction. */ public void testSetIsolationLevelWithActiveDataStoreTransaction() { pm.currentTransaction().setOptimistic(false); pm.currentTransaction().begin(); // iterate through all possible IsolationLevels for (int i = 0; i < isolationLevels.length; ++i) { String isolationLevel = isolationLevels[i]; try { pm.currentTransaction().setIsolationLevel(isolationLevel); appendMessage(ASSERTION_25_FAILED + "active datastore transaction; no exception thrown for " + "setIsolationLevel(" + isolationLevel + ")."); } catch (JDOUnsupportedOptionException ex) { // good catch } catch (Throwable t) { appendMessage(ASSERTION_25_FAILED + "active datastore transaction; " + "JDOUnsupportedOptionException not thrown for " + "setIsolationLevel(" + isolationLevel + "). Unexpected exception: \n" + t); } } pm.currentTransaction().commit(); closePMF(pmf); failOnError(); } /** Set IsolationLevel to all values within optimistic transaction. */ public void testSetIsolationLevelWithActiveOptimisticTransaction() { if (!isOptimisticSupported()) { printUnsupportedOptionalFeatureNotTested( "testSetIsolationLevelWithActiveOptimisticTransaction", "Optimistic"); return; } pm.currentTransaction().setOptimistic(true); pm.currentTransaction().begin(); // iterate through all possible IsolationLevels for (int i = 0; i < isolationLevels.length; ++i) { String isolationLevel = isolationLevels[i]; setIsolationLevel(isolationLevel); } pm.currentTransaction().commit(); closePMF(pmf); failOnError(); } /** */ private void setIsolationLevel(String level) { Transaction tx = pm.currentTransaction(); String property = PROPERTY_TRANSACTION_ISOLATION_LEVEL + "." + level; if (isSupported(property)) { tx.setIsolationLevel(level); String actual = tx.getIsolationLevel(); if (!validLevelSubstitution(level, actual)) { appendMessage(ASSERTION_29_FAILED + "\nIsolationLevel set to " + level + "; value returned by Transaction is " + actual); } } else { try { tx.setIsolationLevel(level); // no exception thrown; bad appendMessage(ASSERTION_29_FAILED + "\nThe expected JDOUserException was not thrown."); } catch (JDOUnsupportedOptionException ex) { // good catch return; } catch (Throwable t) { // wrong exception thrown; bad appendMessage(ASSERTION_29_FAILED + "active datastore transaction; " + "JDOUnsupportedOptionException not thrown for " + "setIsolationLevel(" + level + "). Unexpected exception: \n" + t); return; } } } } tck/src/java/org/apache/jdo/tck/transactions/SetNontransactionalRead.java100664 13235 12500110373 27111 0ustarmbouschenstaff 0 0 /* * 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.transactions; import java.util.Collection; import java.util.Date; import java.util.Iterator; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.Company; import org.apache.jdo.tck.pc.company.Department; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Set Nontransactional Read *
*Keywords: transactions *
*Assertion ID: A13.4.2-9. *
*Assertion Description: If an implementation supports nontransactional read, then a call to Transaction.setNontransactionalRead with a parameter value of true will set the flag to true and allows persistent instances to be read outside of a transaction. Queries and navigation will be allowed without an active transaction. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 10/18/01 1.0 */ public class SetNontransactionalRead extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A13.4.2-9 (SetNontransactionalRead) failed: "; /** * The main 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(SetNontransactionalRead.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(Department.class); addTearDownClass(Company.class); } /** */ public void test() { pm = getPM(); runTestSetNontransactionalRead(pm); pm.close(); pm = null; } /** test transactions.setNonteansactionalRead() */ public void runTestSetNontransactionalRead(PersistenceManager pm) { if (!isNontransactionalReadSupported()) { if (debug) logger.debug("Implementation does not support non transactional read"); return; } Transaction tx = pm.currentTransaction(); try { tx.setNontransactionalRead(true); tx.begin(); Company c = new Company(1L, "MyCompany", new Date(), null); Department d = new Department(999, "MyDepartment", c); pm.makePersistent(c); pm.makePersistent(d); Object oid = pm.getObjectId(d); if (!tx.getNontransactionalRead()) { fail(ASSERTION_FAILED, "tx.getNontransactionalRead returns false after setting the flag to true."); } tx.commit(); if (!tx.getNontransactionalRead()) { fail(ASSERTION_FAILED, "tx.getNontransactionalRead returns false after setting the flag to true."); } // make sure transaction is not active if (tx.isActive()) { fail(ASSERTION_FAILED, "transaction still active after tx.commit."); } tx = null; // read department d = (Department)pm.getObjectById(oid, true); long deptid = d.getDeptid(); if (deptid != 999) { fail("Reading department outside of a transaction returns unexpected value of d.deptid, expected 999, got " + deptid); } // navigate from department to company c = (Company)d.getCompany(); if (c == null) { fail("Navigating from department to company outside of a transaction returns null."); } String companyName = c.getName(); if (!"MyCompany".equals(companyName)) { fail("Navigated company returns unexpected value of c.name, expected MyCompany, got " + companyName); } // run query Query q = pm.newQuery(Department.class); q.setFilter("name == \"MyDepartment\""); Collection result = (Collection)q.execute(); Iterator i = result.iterator(); if (!i.hasNext()) { fail(ASSERTION_FAILED, "Query outside of a transaction returned empty collection."); } d = (Department)i.next(); String deptName = d.getName(); if (!"MyDepartment".equals(deptName)) { fail("Department in query result returns unexpected value of d.name, expected MyDepartment, got " + deptName); } if (i.hasNext()) { fail(ASSERTION_FAILED, "Query outside of a transaction returns more than one instance."); } } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/transactions/SetNontransactionalReadCalledDuringTxCompletion.java100664 11172 12500110373 33733 0ustarmbouschenstaff 0 0 /* * 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.transactions; import javax.jdo.JDOUserException; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import javax.transaction.Synchronization; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Set Nontransactional Read Called During TX Completion *
*Keywords: transactions *
*Assertion ID: A13.4.2-1. *
*Assertion Description: If the setNontransactionalRead method of the Transaction interface is called during commit or rollback processing (within the beforeCompletion and afterCompletion synchronization methods), a JDOUserException is thrown. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 10/18/01 1.0 */ public class SetNontransactionalReadCalledDuringTxCompletion extends JDO_Test implements Synchronization { private Transaction tx; private boolean nonTransactionalReadFlag; /** */ private static final String ASSERTION_FAILED = "Assertion A13.4.2-1 (SetNontransactionalReadCalledDuringTxCompletion) failed: "; /** * The main 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(SetNontransactionalReadCalledDuringTxCompletion.class); } /** */ public void beforeCompletion() { if (debug) logger.debug("beforeCompletion."); try { tx.setNontransactionalRead(nonTransactionalReadFlag); fail(ASSERTION_FAILED, "tx.setNontransactionalRead called in beforeCompletion should throw JDOUserException."); } catch (JDOUserException ex) { // expected exception if (debug) logger.debug("caught expected exception " + ex); } catch (Exception ex) { fail(ASSERTION_FAILED, "tx.setNontransactionalRead called in beforeCompletion throws unexpected exception: " + ex); } } /** */ public void afterCompletion(int status) { if (debug) logger.debug("afterCompletion."); try { tx.setNontransactionalRead(nonTransactionalReadFlag); } catch (JDOUserException ex) { // TBD: need to remove this catch block as soon as the JDORI is // fixed see 'Issue 61: Transaction.isActive issues' if (debug) logger.debug("caught exception " + ex); } catch (Exception ex) { fail(ASSERTION_FAILED, "tx.setNontransactionalRead called in afterCompletion throws unexpected exception: " + ex); } } /** */ public void test() { pm = getPM(); runTestSetNontransactionalReadCalledDuringTxCompletion(pm); pm.close(); pm = null; } /** test transactions.setNonteansactionalRead() */ public void runTestSetNontransactionalReadCalledDuringTxCompletion(PersistenceManager pm) { /** if (!isNontransactionalReadSupported()) { if (verbose) println("Implementation does not support non transactional read"); return; } */ tx = pm.currentTransaction(); try { tx.setSynchronization(this); nonTransactionalReadFlag = false; tx.begin(); tx.commit(); if (isNontransactionalReadSupported()) { nonTransactionalReadFlag = true; tx.begin(); tx.commit(); } tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/transactions/SetNontransactionalReadTrueWhenNotSupported.java100664 6130 12500110373 33136 0ustarmbouschenstaff 0 0 /* * 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.transactions; import javax.jdo.JDOUnsupportedOptionException; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Set Nontransactional Read True When Not Supported *
*Keywords: transactions *
*Assertion ID: A13.4.2-5. *
*Assertion Description: If an implementation does not support nontransactional read, then a call to Transaction.setNontransactionalRead with a parameter value of true will * cause a JDOUnsupportedOptionException to be thrown. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 10/18/01 1.0 */ public class SetNontransactionalReadTrueWhenNotSupported extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A13.4.2-5 (SetNontransactionalReadTrueWhenNotSupported) failed: "; /** * The main 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(SetNontransactionalReadTrueWhenNotSupported.class); } /** */ public void test() { pm = getPM(); runTestSetNontransactionalReadTrueWhenNotSupported(pm); pm.close(); pm = null; } /* test transactions.setNonteansactionalRead() * */ public void runTestSetNontransactionalReadTrueWhenNotSupported( PersistenceManager pm) { if (isNontransactionalReadSupported()) { if (debug) logger.debug("Implementation does support non transactional read."); return; } Transaction tx = pm.currentTransaction(); try { tx.setNontransactionalRead(true); fail(ASSERTION_FAILED, "tx.setNontransactionalRead(true) should throw JDOUnsupportedOptionException, if the implementation does not support non transactional read."); } catch (JDOUnsupportedOptionException ex) { // expected excepted if (debug) logger.debug("caught expected exception " + ex); } } } tck/src/java/org/apache/jdo/tck/transactions/SetNontransactionalWriteCalledDuringTxCompletion.java100664 11074 12500110373 34153 0ustarmbouschenstaff 0 0 /* * 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.transactions; import javax.jdo.JDOUserException; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import javax.transaction.Synchronization; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Set Nontransactional Write Called During TX Completion *
*Keywords: transactions *
*Assertion ID: A13.4.2-1. *
*Assertion Description: If the setNontransactionalWrite method of the Transaction interface is called during commit or rollback processing (within the beforeCompletion and afterCompletion synchronization methods), a JDOUserException is thrown. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 10/18/01 1.0 */ public class SetNontransactionalWriteCalledDuringTxCompletion extends JDO_Test implements Synchronization { private Transaction tx; private boolean nonTransactionalWriteFlag; /** */ private static final String ASSERTION_FAILED = "Assertion A13.4.2-2 (SetNontransactionalWriteCalledDuringTxCompletion) failed: "; /** * The main 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(SetNontransactionalWriteCalledDuringTxCompletion.class); } /** */ public void beforeCompletion() { if (debug) logger.debug("beforeCompletion."); try { tx.setNontransactionalWrite(nonTransactionalWriteFlag); fail(ASSERTION_FAILED, "tx.setNontransactionalWrite called in beforeCompletion should throw JDOUserException."); } catch (JDOUserException ex) { // expected exception if (debug) logger.debug("Caught expected exception " + ex); } catch (Exception ex) { fail(ASSERTION_FAILED, "tx.setNontransactionalWrite called in beforeCompletion throws unexpected exception: " + ex); } } /** */ public void afterCompletion(int status) { if (debug) logger.debug("afterCompletion."); try { tx.setNontransactionalWrite(nonTransactionalWriteFlag); } catch (JDOUserException ex) { // TBD: need to remove this catch block as soon as the JDORI is // fixed see 'Issue 61: Transaction.isActive issues' if (debug) logger.debug("caught exception " + ex); } catch (Exception ex) { fail(ASSERTION_FAILED, "tx.setNontransactionalWrite called in afterCompletion throws unexpected exception: " + ex); } } /** */ public void test() { pm = getPM(); runTestSetNontransactionalWriteCalledDuringTxCompletion(pm); pm.close(); pm = null; } /** test transactions.setNonteansactionalWrite() */ public void runTestSetNontransactionalWriteCalledDuringTxCompletion(PersistenceManager pm) { tx = pm.currentTransaction(); try { tx.setSynchronization(this); nonTransactionalWriteFlag = false; tx.begin(); tx.commit(); if (isNontransactionalWriteSupported()) { nonTransactionalWriteFlag = true; tx.begin(); tx.commit(); } else if (debug) logger.debug("Implementation does not support nontransactional write"); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/transactions/SetOptimistic.java100664 7662 12500110373 25113 0ustarmbouschenstaff 0 0 /* * 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.transactions; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Set Optimistic *
*Keywords: transactions *
*Assertion ID: A13.4.2-14. *
*Assertion Description: A call to Transaction.setOptimistic causes the optimistic setting passed to replace the optimistic setting currently active, if the Optimistic optional feature is supported. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 10/09/01 1.0 */ public class SetOptimistic extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A13.4.2-14 (SetOptimistic) failed: "; /** * The main 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(SetOptimistic.class); } /** */ public void test() { pm = getPM(); runTestSetOptimistic(pm); runTestSetOptimisticToInverse(pm); pm.close(); pm = null; } /** */ public void runTestSetOptimistic(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { if (isOptimisticSupported()) { tx.setOptimistic(true); tx.begin(); if (!tx.getOptimistic()) { fail(ASSERTION_FAILED, "tx.getOptimistic() returns false after setting the flag to true."); } tx.commit(); if (!tx.getOptimistic()) { fail(ASSERTION_FAILED, "tx.getOptimistic() returns false after setting the flag to true."); } } tx.setOptimistic(false); tx.begin(); if (tx.getOptimistic()) { fail(ASSERTION_FAILED, "tx.getOptimistic() returns true after setting the flag to false."); } tx.commit(); if (tx.getOptimistic()) { fail(ASSERTION_FAILED, "tx.getOptimistic() returns true after setting the flag to false."); } } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } /** */ void runTestSetOptimisticToInverse(PersistenceManager pm) { if (!isOptimisticSupported()) { if (debug) logger.debug("Optimistic not supported."); return; } Transaction tx = pm.currentTransaction(); boolean orig = tx.getOptimistic(); tx.setOptimistic(!orig); if (tx.getOptimistic() == orig) { fail(ASSERTION_FAILED, "changing the optimistic flag by calling tx.setOptimistic does not have a effect."); } if ((tx != null) && tx.isActive()) { tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/transactions/SetOptimisticCalledDuringTxCompletion.java100664 7736 12500110373 31741 0ustarmbouschenstaff 0 0 /* * 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.transactions; import javax.jdo.JDOUserException; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import javax.transaction.Synchronization; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Set Optimistic Called During TX Completion *
*Keywords: transactions *
*Assertion ID: A13.4.2-3. *
*Assertion Description: If the setOptimistic method of the Transaction interface is called during commit or rollback processing (within the beforeCompletion and afterCompletion synchronization methods), a JDOUserException is thrown. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 10/20/01 1.0 * */ public class SetOptimisticCalledDuringTxCompletion extends JDO_Test implements Synchronization { private Transaction tx; private boolean optimisticFlag; /** */ private static final String ASSERTION_FAILED = "Assertion A13.4.2-3 (SetOptimisticCalledDuringTxCompletion) failed: "; /** * The main 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(SetOptimisticCalledDuringTxCompletion.class); } /** */ public void beforeCompletion(){ if (debug) logger.debug ("beforeCompletion"); try { tx.setOptimistic(optimisticFlag); fail(ASSERTION_FAILED, "tx.setOptimistic called in beforeCompletion should throw JDOUserException."); } catch (JDOUserException ex) { // expected exception if (debug) logger.debug("caught expected exception " + ex); } catch (Exception ex) { fail(ASSERTION_FAILED, "tx.setOptimistic called in beforeCompletion throws unexpected exception: " + ex); } } /** */ public void afterCompletion(int status) { if (debug) logger.debug("afterCompletion"); try { tx.setOptimistic(optimisticFlag); } catch (Exception ex) { fail(ASSERTION_FAILED, "tx.setOptimistic called in afterCompletion throws unexpected exception: " + ex); } } /** */ public void test() { pm = getPM(); runTestSetOptimisticCalledDuringTxCompletion(pm); pm.close(); pm = null; } /** test transactions.setOptimistic() */ void runTestSetOptimisticCalledDuringTxCompletion(PersistenceManager pm) { tx = pm.currentTransaction(); try { tx.setSynchronization(this); optimisticFlag = false; tx.begin(); tx.commit(); if (isOptimisticSupported()) { optimisticFlag = true; tx.begin(); tx.commit(); } tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/transactions/SetOptimisticDuringTransaction.java100664 6626 12500110373 30471 0ustarmbouschenstaff 0 0 /* * 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.transactions; import javax.jdo.JDOUserException; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Set Optimistic During Transaction *
*Keywords: transactions *
*Assertion ID: A13.4.2-15. *
*Assertion Description: If Transaction.setOptimistic is called while there is an active transaction, a JDOUserException is thrown. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 10/09/01 1.0 */ public class SetOptimisticDuringTransaction extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A13.4.2-15 (SetOptimisticDuringTransaction) failed: "; /** * The main 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(SetOptimisticDuringTransaction.class); } /** */ public void test() { pm = getPM(); runTestSetOptimisticDuringTransaction(pm); pm.close(); pm = null; } /** */ void runTestSetOptimisticDuringTransaction(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); // try to call tx.setOptimistic(true) if (isOptimisticSupported()) { try { tx.setOptimistic(true); fail(ASSERTION_FAILED, "calling tx.setOptimistic in the context of an active transaction should throw a JDOUserException."); } catch (JDOUserException ex) { // expected exception if (debug) logger.debug("caught expected exception " + ex); } } // try to call tx.setOptimistic(false) try { tx.setOptimistic(false); fail(ASSERTION_FAILED, "calling tx.setOptimistic in the context of an active transaction should throw a JDOUserException."); } catch (JDOUserException ex) { // expected exception if (debug) logger.debug("caught expected exception " + ex); } tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/transactions/SetOptimisticTrueWhenNotSupported.java100664 5541 12500110373 31156 0ustarmbouschenstaff 0 0 /* * 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.transactions; import javax.jdo.JDOUnsupportedOptionException; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Set Optimistic True When Not Supported *
*Keywords: transactions *
*Assertion ID: A13.4.2-7. *
*Assertion Description: If the optional feature Optimistic is not supported, then a call to Transaction.setOptimistic with a value of true will throw a JDOUnsupportedOptionException. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 10/18/01 1.0 */ public class SetOptimisticTrueWhenNotSupported extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A13.4.2-7 (SetOptimisticTrueWhenNotSupported) failed: "; /** * The main 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(SetOptimisticTrueWhenNotSupported.class); } /** */ public void test() { pm = getPM(); runTestSetOptimisticTrueWhenNotSupported(pm); pm.close(); pm = null; } /** */ void runTestSetOptimisticTrueWhenNotSupported(PersistenceManager pm) { if (isOptimisticSupported()) { if (debug) logger.debug("Optimistic supported."); return; } Transaction tx = pm.currentTransaction(); try { tx.setOptimistic(true); fail(ASSERTION_FAILED, "tx.setOptimistic(true) should throw JDOUnsupportedOptionException, if the implementation does not support optimistic transactions."); } catch (JDOUnsupportedOptionException ex) { // expected excepted if (debug) logger.debug("caught expected exception " + ex); } } } tck/src/java/org/apache/jdo/tck/transactions/SetRetainValues.java100664 5130 12500110373 25355 0ustarmbouschenstaff 0 0 /* * 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.transactions; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Set Retain Values *
*Keywords: transactions *
*Assertion ID: A13.4.2-18. *
*Assertion Description: The retainValues setting passed to setRetainValues replaces the retainValues setting currently active. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 10/09/01 1.0 */ public class SetRetainValues extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A13.4.2-18 (SetRetainValues) failed: "; /** * The main 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(SetRetainValues.class); } /** */ public void test() { pm = getPM(); runTestSetRetainValues(pm); pm.close(); pm = null; } /** */ void runTestSetRetainValues(PersistenceManager pm) { if (!isRetainValuesSupported()) { if (debug) logger.debug("RetainValues not supported."); return; } Transaction tx = pm.currentTransaction(); boolean orig = tx.getRetainValues(); tx.setRetainValues(!orig); if (tx.getRetainValues() == orig) { fail(ASSERTION_FAILED, "changing the retainValues flag by calling tx.setRetainValues does not have a effect."); } if ((tx != null) && tx.isActive()) { tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/transactions/SetRetainValuesCalledDuringTxCompletion.java100664 10340 12500110373 32220 0ustarmbouschenstaff 0 0 /* * 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.transactions; import javax.jdo.JDOUserException; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import javax.transaction.Synchronization; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Set Optimistic Called During TX Completion *
*Keywords: transactions *
*Assertion ID: A13.4.2-4. *
*Assertion Description: If the setOptimistic method of the Transaction interface is called during * commit or rollback processing (within the beforeCompletion and * afterCompletion synchronization methods), a JDOUserException is thrown. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 10/20/01 1.0 */ public class SetRetainValuesCalledDuringTxCompletion extends JDO_Test implements Synchronization { private Transaction tx; private boolean retainValuesFlag; /** */ private static final String ASSERTION_FAILED = "Assertion A13.4.2-4 (SetRetainValuesCalledDuringTxCompletion) failed: "; /** * The main 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(SetRetainValuesCalledDuringTxCompletion.class); } /** */ public void beforeCompletion(){ if (debug) logger.debug ("beforeCompletion"); try { tx.setRetainValues(retainValuesFlag); fail(ASSERTION_FAILED, "tx.setRetainValues called in beforeCompletion should throw JDOUserException."); } catch (JDOUserException ex) { // expected exception if (debug) logger.debug("caught expected exception " + ex); } catch (Exception ex) { fail(ASSERTION_FAILED, "tx.setRetainValues called in beforeCompletion throws unexpected exception: " + ex); } } /** */ public void afterCompletion(int status) { if (debug) logger.debug ("afterCompletion"); try { tx.setRetainValues(retainValuesFlag); } catch (JDOUserException ex) { // TBD: need to remove this catch block as soon as the JDORI is // fixed see 'Issue 61: Transaction.isActive issues' if (debug) logger.debug("caught exception " + ex); } catch (Exception ex) { fail(ASSERTION_FAILED, "tx.setRetainValues called in afterCompletion throws unexpected exception: " + ex); } } /** */ public void test() { pm = getPM(); runTestSetRetainValuesCalledDuringTxCompletion(pm); pm.close(); pm = null; } /** */ void runTestSetRetainValuesCalledDuringTxCompletion(PersistenceManager pm) { tx = pm.currentTransaction(); try { tx.setSynchronization(this); retainValuesFlag = false; tx.begin(); tx.commit(); if (isRetainValuesSupported()) { retainValuesFlag = true; tx.begin(); tx.commit(); } tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/transactions/SetRetainValuesTrueWhenNotSupported.java100664 5635 12500110373 31440 0ustarmbouschenstaff 0 0 /* * 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.transactions; import javax.jdo.JDOUnsupportedOptionException; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Set Retain Values True When Not Supported *
*Keywords: transactions *
*Assertion ID: A13.4.2-8. *
*Assertion Description: If the optional feature RetainValues is not supported, then a call to Transaction.setRetainValues with a value of true will cause a JDOUnsupportedOptionException to be thrown. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 10/22/01 1.0 */ public class SetRetainValuesTrueWhenNotSupported extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A13.4.2-8 (SetRetainValuesTrueWhenNotSupported) failed: "; /** * The main 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(SetRetainValuesTrueWhenNotSupported.class); } /** */ public void test() { pm = getPM(); runTestSetRetainValuesTrueWhenNotSupported(pm); pm.close(); pm = null; } /** test transactions.setRetainValues() */ void runTestSetRetainValuesTrueWhenNotSupported(PersistenceManager pm) { if (isRetainValuesSupported()) { if (debug) logger.debug("RetainValues supported."); return; } Transaction tx = pm.currentTransaction(); try { tx.setRetainValues(true); fail(ASSERTION_FAILED, "tx.setRetainValues(true) should throw JDOUnsupportedOptionException, if the implementation does not support retainValues."); } catch (JDOUnsupportedOptionException ex) { // expected excepted if (debug) logger.debug("caught expected exception " + ex); } } } tck/src/java/org/apache/jdo/tck/transactions/SetSynchronization.java100664 7514 12500110373 26164 0ustarmbouschenstaff 0 0 /* * 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.transactions; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import javax.transaction.Synchronization; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Set Synchronization *
*Keywords: transactions *
*Assertion ID: A13.4.3-1. *
*Assertion Description: A call to Transaction.setSynchronization registers a Synchronization instance with the Transaction for transaction completion notifications. Any Synchronization instance already registered will be replaced. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 10/11/01 1.0 */ public class SetSynchronization extends JDO_Test implements Synchronization { private Transaction tx; /** */ private static final String ASSERTION_FAILED = "Assertion A13.4.3-1 (SetSynchronization) failed: "; /** * The main 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(SetSynchronization.class); } /** */ public void beforeCompletion(){ try { if (debug) logger.debug("before Complition isActive returns :" + tx.isActive()); } catch (Exception ex) { fail(ASSERTION_FAILED, "tx.isActive called in beforeCompletion throws unexpected exception: " + ex); } } /** */ public void afterCompletion(int status) { try { if (debug) logger.debug("after Complition isActive returns :" + tx.isActive()); } catch (Exception ex) { fail(ASSERTION_FAILED, "tx.isActive called in afterCompletion throws unexpected exception: " + ex); } } /** */ public void test() { pm = getPM(); runTestSetSynchronization(pm); pm.close(); pm = null; } /** */ void runTestSetSynchronization(PersistenceManager pm) { tx = pm.currentTransaction(); try { tx.begin(); Synchronization orig = tx.getSynchronization(); tx.setSynchronization(this); Synchronization current = tx.getSynchronization(); if (current == orig) { fail(ASSERTION_FAILED, "tx.setSynchronization does not replace Synchronization instances registered with the transaction."); } if (current != this) { fail(ASSERTION_FAILED, "unexpected sxnchronization isntance, expected " + this + ", got " + current); } tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/transactions/SetSynchronizationToNull.java100664 6113 12500110373 27314 0ustarmbouschenstaff 0 0 /* * 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.transactions; import javax.jdo.PersistenceManager; import javax.jdo.Transaction; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: Set Synchronization To Null *
*Keywords: transactions *
*Assertion ID: A13.4.3-2. *
*Assertion Description: If the parameter to Transaction.setSynchronization is null, then no instance will be notified. */ /* * Revision History * ================ * Author : Date : Version * Azita Kamangar 10/11/01 1.0 */ public class SetSynchronizationToNull extends JDO_Test implements javax.transaction.Synchronization { /** */ private static final String ASSERTION_FAILED = "Assertion A13.4.3-2 (SetSynchronizationToNull) failed: "; /** * The main 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(SetSynchronizationToNull.class); } /** */ public void beforeCompletion(){ fail(ASSERTION_FAILED, "Instance should not be registered, thus this beforeCompletion methgod should not be called."); } /** */ public void afterCompletion(int status) { fail(ASSERTION_FAILED, "Instance should not be registered, thus this afterCompletion methgod should not be called."); } /** */ public void test() { pm = getPM(); runTestSetSynchronizationToNull(pm); pm.close(); pm = null; } /** */ void runTestSetSynchronizationToNull(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.begin(); tx.setSynchronization(this); tx.setSynchronization(null); if (tx.getSynchronization() != null) { fail(ASSERTION_FAILED, "tx.setSynchronization(null) should overwrite previous registered synchronization instance."); } tx.commit(); tx = null; } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/transactions/WhenNontransactionalReadIsFalse.java100664 12156 12500110373 30527 0ustarmbouschenstaff 0 0 /* * 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.transactions; import java.util.Collection; import java.util.Date; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import javax.jdo.JDOUserException; import org.apache.jdo.tck.JDO_Test; import org.apache.jdo.tck.pc.company.Company; import org.apache.jdo.tck.pc.company.Department; import org.apache.jdo.tck.util.BatchTestRunner; /** *Title: When Nontransactional Read Is False *
*Keywords: transactions *
*Assertion ID: A13.4.2-10. *
*Assertion Description: If this flag is set to false, then queries and field read access (including navigation) outside an active transaction throw a JDOUserException. */ /* * Revision History * ================ * Author : Date : Version * Michelle Caisse 11/11/04 1.0 */ public class WhenNontransactionalReadIsFalse extends JDO_Test { /** */ private static final String ASSERTION_FAILED = "Assertion A13.4.2-10 (WhenNontransactionalReadIsFalse) failed: "; /** * The main 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(WhenNontransactionalReadIsFalse.class); } /** * @see JDO_Test#localSetUp() */ protected void localSetUp() { addTearDownClass(Department.class); addTearDownClass(Company.class); } /** */ public void test() { pm = getPM(); runTestWhenNontransactionalReadIsFalse(pm); pm.close(); pm = null; } /** test transactions.setNontransactionalReadIsFalse() */ public void runTestWhenNontransactionalReadIsFalse(PersistenceManager pm) { Transaction tx = pm.currentTransaction(); try { tx.setNontransactionalRead(false); tx.begin(); Company c = new Company(1L, "MyCompany", new Date(), null); Department d = new Department(999, "MyDepartment", c); pm.makePersistent(c); pm.makePersistent(d); if (tx.getNontransactionalRead()) { fail(ASSERTION_FAILED, "tx.getNontransactionalRead before commit returns true after setting the flag to false."); } tx.commit(); if (tx.getNontransactionalRead()) { fail(ASSERTION_FAILED, "tx.getNontransactionalRead after commit returns true after setting the flag to false."); } // make sure transaction is not active if (tx.isActive()) { fail(ASSERTION_FAILED, "transaction still active after tx.commit."); } tx = null; try { // read department name String name = d.getName(); fail(ASSERTION_FAILED, "Field read permitted outside an active transaction when NontransactionalRead is false."); } catch (JDOUserException juex) { if (debug) logger.debug(" Caught expected JDOUserException " + juex); } try { // navigate from department to company c = (Company)d.getCompany(); fail(ASSERTION_FAILED, "Navigation permitted outside an active transaction when NontransactionalRead is false."); } catch (JDOUserException juex) { if (debug) logger.debug(" Caught expected JDOUserException " + juex); } try { // run query Query q = pm.newQuery(Department.class); q.setFilter("name == \"MyDepartment\""); Collection result = (Collection)q.execute(); fail(ASSERTION_FAILED, "Query permitted outside an active transaction when NontransactionalRead is false."); } catch (JDOUserException juex) { if (debug) logger.debug(" Caught expected JDOUserException " + juex); } } finally { if ((tx != null) && tx.isActive()) tx.rollback(); } } } tck/src/java/org/apache/jdo/tck/util/BatchResultPrinter.java100664 20351 12500110374 24353 0ustarmbouschenstaff 0 0 /* * 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.util; import java.io.PrintStream; import java.text.DecimalFormat; import java.util.Arrays; import java.util.Enumeration; import java.util.HashMap; import java.util.Map; import junit.framework.AssertionFailedError; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestFailure; import junit.framework.TestResult; import junit.textui.ResultPrinter; /** * Default result printer implementation for running tests in batch mode. * * @author Michael Bouschen */ public class BatchResultPrinter extends ResultPrinter { private static final DecimalFormat THREE_DIGITS_FORMATTER = new DecimalFormat("000"); /** The stream to delegate the output. */ private ConsoleFileOutput consoleFileOutput; /** The time elapsed to run a test suite. */ private long runtime; /** */ public BatchResultPrinter(ConsoleFileOutput consoleFileOutput) { this(new PrintStream(consoleFileOutput)); this.consoleFileOutput = consoleFileOutput; } /** */ public BatchResultPrinter(PrintStream writer) { super(writer); } /** Called in case of a test error. */ public void addError(Test test, Throwable t) { getWriter().print(" ERROR"); } /** Called in case of a test failure. */ public void addFailure(Test test, AssertionFailedError t) { getWriter().print(" FAILURE"); } /** Called when a test case is finished. */ public void endTest(Test test) { getWriter().println(); } /** Called when a test case is started. */ public void startTest(Test test) { String testName; if (test instanceof TestCase) { testName = getClassBaseName(test) + "." + ((TestCase)test).getName(); } else { testName = test.toString(); } getWriter().print("RUN " + testName + '\t'); getWriter().flush(); } /** * @see ResultPrinter#elapsedTimeAsString(long) */ protected String elapsedTimeAsString(long runTime) { return THREE_DIGITS_FORMATTER.format((double)runTime/1000); } /** */ protected void printHeader(long runTime) { this.runtime = runTime; getWriter().println("Description: " + System.getProperty("jdo.tck.description")); getWriter().println("Time: "+elapsedTimeAsString(runTime)); } /** */ protected void printFooter(TestResult result) { String message = null; if (this.consoleFileOutput != null) { message = getResultMessage(result, this.consoleFileOutput); String directory = this.consoleFileOutput.getDirectory(); ResultSummary.appendTCKResultMessage(directory, message); ResultSummary.save(directory, result); } else { message = getResultMessage(result); } if (!result.wasSuccessful()) { getWriter().println("FAILURES!!!"); printErrorSummary(result); } getWriter().println(message); getWriter().println("Excluded tests: " + System.getProperty("jdo.tck.exclude")); } // helper method /** * Returns the result message for the given result instance and * the given console file output instance. * @param result the result instance * @param consoleFileOutput the console file output instance * @return the result message */ private String getResultMessage(TestResult result, ConsoleFileOutput consoleFileOutput) { String message = this.consoleFileOutput.getFileName() + ':'; message += System.getProperty("line.separator") + " "; message += getResultMessage(result); return message; } /** * Returns the result message for the given result instance. * @param result the result instance * @return the result message */ private String getResultMessage(TestResult result) { boolean success = result.wasSuccessful(); String message = success ? "OK " : "** "; message += "Tests run: " + THREE_DIGITS_FORMATTER.format(result.runCount()) + ", Time: "+elapsedTimeAsString(this.runtime)+" seconds."; if (!success) { message += " Failures: "+result.failureCount() + ", Errors: "+result.errorCount(); } return message; } /** * @return Name of the class of the given object without package prefix */ private String getClassBaseName(Object obj) { if (obj == null) return null; String className = obj.getClass().getName(); int index = className.lastIndexOf('.'); if (index != -1) { className = className.substring(index + 1); } return className; } private void printErrorSummary(TestResult result) { Object[] array = getSortedArrayOfErrorSummaryEntries(result); if (array.length>0) { getWriter().println("Error summary:"); for (int i=0; i *
  • 0: success *
  • 1: failure, the test shows an unexpected behavior *
  • 2: exception, the test throws an unhandled excption * * * @author Michael Bouschen */ public class BatchTestRunner extends TestRunner { /** Name of the system property to specify the result printer class. */ public static final String RESULTPRINTER_PROPERTY = "ResultPrinterClass"; /** Default of the system property ResultPrinterClass. */ public static final String RESULTPRINTER_DEFAULT = BatchResultPrinter.class.getName(); /** */ public static final String LOG_DIRECTORY; static { String directory = System.getProperty("jdo.tck.log.directory"); if (directory!=null && !directory.endsWith(File.separator)) { directory += File.separator; } LOG_DIRECTORY = directory; } /** * Constructor. * It creates a result printer instance based on the system property * and delegates to the constructor taking a result printer argument. */ public BatchTestRunner() { super(); setPrinter(getResultPrinter()); } /** * Constructor. Uses the specified resultPrinter to format the test result. */ public BatchTestRunner(ResultPrinter resultPrinter) { super(resultPrinter); } /** Runs all test methods from the specified class. */ public static void run(Class clazz) { run(new TestSuite(clazz)); } /** Runs the specified test or test suite */ public static TestResult run(Test test) { return new BatchTestRunner().doRun(test); } /** Runs the specified test and waits until the user types RETURN. */ public static void runAndWait(Test suite) { new BatchTestRunner().doRun(suite, true); } /** Runs the specified test or test suite and closes the pmf. */ public TestResult doRun(Test test) { TestResult result = null; try { result = doRun(test, false); JDO_Test.dumpSupportedOptions(LOG_DIRECTORY + "configuration"); } finally { JDO_Test.closePMF(); } return result; } /** * Runs in batch mode and sets an exit code. If the specified String * array includes a single fully qualified class name, this test class * is executed. */ public static void main(String args[]) { try { TestResult r = new BatchTestRunner().start(args); if (!r.wasSuccessful()) System.exit(FAILURE_EXIT); System.exit(SUCCESS_EXIT); } catch(Exception e) { System.err.println(e.getMessage()); System.exit(EXCEPTION_EXIT); } } /** */ public TestResult start(String[] args) { Test suite = null; if ((args == null) || args.length == 0) { String conf = System.getProperty("jdo.tck.cfg"); throw new JDOFatalException( "Missing JDO TCK test classes for configuration '" + conf + "'. Please check the property 'jdo.tck.classes'."); } else if (args.length == 1) { suite = getTest(args[0]); } else { suite = getTestSuite(args); } return doRun(suite); } /** * Returns a JUnit TestSuite instance for the classes of the specified * list of class names. */ protected TestSuite getTestSuite(String[] classNames) { TestSuite testSuite = new TestSuite(); for (int i = 0; i < classNames.length; i++) { String className = classNames[i]; try { testSuite.addTestSuite(Class.forName(className)); } catch (ClassNotFoundException ex) { System.out.println( "Cannot find test class '" + className + "'."); } } return testSuite; } /** * Returns a result printer instance. The system property * ResultPrinterClass specifies the class of the returned instanec. The * class must extend junit.textui.ResultPrinter. */ protected ResultPrinter getResultPrinter() { String className = System.getProperty(RESULTPRINTER_PROPERTY); if (className != null) { className = className.trim(); if (className.length() != 0) { String msg = null; try { // get class instance Class clazz = Class.forName(className); Constructor ctor = null; OutputStream stream = null; // choose constructor taking ConsoleFileOutput arg if (!Boolean.getBoolean("no.log.file")) { try { ctor = clazz.getConstructor( new Class[] { ConsoleFileOutput.class } ); stream = new ConsoleFileOutput(); } catch (NoSuchMethodException ex) { ctor = null; } } // choose constructor taking PrintStream arg if (ctor == null) { ctor = clazz.getConstructor( new Class[] { PrintStream.class } ); stream = System.out; } return (ResultPrinter)ctor.newInstance( new Object[] { stream }); } catch (ClassNotFoundException ex) { // specified ResultPrinter class not msg = "Cannot find specified result printer class " + className + "."; } catch (NoSuchMethodException ex) { msg = "Class " + className + " does not provide constructor taking a PrintStream."; } catch (InstantiationException ex) { msg = "Class " + className + " is abstract."; } catch (IllegalAccessException ex) { msg = "Constructor taking a PrintStream of class " + className + " is not accessible."; } catch (InvocationTargetException ex) { msg = "Constructor call results in exception " + ex + "."; } // ResultPrinter class specified, but not avaiable System.out.println(msg); ResultPrinter printer = getDefaultResultPrinter(); System.out.println("Using default result printer of class " + printer.getClass().getName()); } } // ResultPrinter class not specified => use default return getDefaultResultPrinter(); } /** * Returns an instance of the default result printer class * BatchResultPrinter. */ protected ResultPrinter getDefaultResultPrinter() { return new BatchResultPrinter(System.out); } /** * Returns a file name which is determined by method * {@link BatchTestRunner#changeFileName(String)}. * The file name has suffix .txt. * @return the file name * @throws IOException */ public static String getFileName() { return changeFileName("junit.txt"); } /** * Returns a file name which is constructed by values * of some system properties appended by the given file name. * The system properties evaluated are: *
      *
    • jdo.tck.log.directory: Specifies the directory for the file.
    • *
    • jdo.tck.database, jdo.tck.cfg: * The values of these properties prepend the given file name.
    • *
    • jdo.tck.identitytype: The value of this property is replaced by * "app" if it equals "applicationidentity", * else it is replaced by "dsid".
    • *
    * The returned file name is constructed as follows:
    * /-- * Values of properties which do not exist default to "". * @param fileName the file name * @return the changed file name */ public static String changeFileName(String fileName) { String directory = LOG_DIRECTORY; String db = System.getProperty("jdo.tck.database"); String identityType = System.getProperty("jdo.tck.identitytype"); if (identityType!=null) { if (identityType.equals("applicationidentity")) { identityType = "app"; } else { identityType = "dsid"; } } String configuration = System.getProperty("jdo.tck.cfg"); if (configuration!=null) { int index = configuration.indexOf('.'); if (index!=-1) { configuration = configuration.substring(0, index); } } directory = fixPartialFileName(directory); db = fixPartialFileName(db, '-', new String[]{identityType, configuration, fileName}); identityType = fixPartialFileName(identityType, '-', new String[]{configuration, fileName}); configuration = fixPartialFileName(configuration, '-', new String[]{fileName}); return directory + db + identityType + configuration + fileName; } private static String fixPartialFileName(String str) { if (str==null) { str = ""; } return str; } private static String fixPartialFileName(String str, char c, String[] values) { str = fixPartialFileName(str); if (!str.equals("")) { for (int i = 0; i < values.length; i++) { String value = values[i]; if (value!=null && !value.equals("") && !value.startsWith(".")) { str += c; break; } } } return str; } } tck/src/java/org/apache/jdo/tck/util/ClassGenerator.java100664 103577 12500110374 23537 0ustarmbouschenstaff 0 0 /* * 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.util; import java.io.*; public class ClassGenerator { private final String [] fieldTypes = {"boolean", "byte", "short", "int", "long", "char", "float", "double", "Boolean", "Character", "Byte", "Short", "Integer", "Long", "Float", "Double", "String", "Locale", "Date", "BigDecimal", "BigInteger", "Object", "SimpleClass", "SimpleInterface" }; //includes a place holder for default package access private final String [] accessSpecifiers = {"private ", "public ", "protected ", "" }; private final String [] fieldModifiers = {"", "static ", "transient ", "final ", "volatile ", "static transient ", "static final ", "static volatile ", "transient final ", "transient volatile ", "static transient final ", "static transient volatile " }; private final String [] xmlPersistenceModifiers = {"", "persistence-modifier=\"none\"", "persistence-modifier=\"persistent\"", "persistence-modifier=\"transactional\""}; private final String [] xmlEmbeddedModifiers = {"", "embedded=\"true\"", "embedded=\"false\""}; private final String [] collectionTypes = {"Collection", "Map", "Set", "List", "HashSet", "ArrayList", "HashMap", "Hashtable", "LinkedList", "TreeMap", "TreeSet", "Vector", "Array"}; //Note: Any updates to elementtypes should include an update to elementsWithPackageInfo private final String [] elementTypes = {"Object", "SimpleClass", "SimpleInterface", "String", "Date", "Locale", "BigDecimal", "BigInteger", "Byte", "Double", "Float", "Integer", "Long", "Short"}; private final String [] elementsWithPackageInfo = {"java.lang.Object", "org.apache.jdo.tck.pc.fieldtypes.SimpleClass", "org.apache.jdo.tck.pc.fieldtypes.SimpleInterface", "java.lang.String", "java.util.Date", "java.util.Locale", "java.math.BigDecimal", "java.math.BigInteger", "java.lang.Byte", "java.lang.Double", "java.lang.Float", "java.lang.Integer","java.lang.Long", "java.lang.Short"}; private StringBuffer fieldSpecs = new StringBuffer(2000); private StringBuffer isPersistent = new StringBuffer(200); private StringBuffer isStatic = new StringBuffer(200); private StringBuffer isFinalArray = new StringBuffer(2000); // can accomodate only 4000 fields, have to increase the capacity if the fields exceed 4000 private static boolean [] isFinal = new boolean[4000]; void generate() throws Exception { final String twoSpaces = " "; final String space = " "; for (int i=0; i < fieldTypes.length; i++) { String classFile = (isPrimitive(fieldTypes[i]) ? "FieldsOfPrimitive" : "FieldsOf") + fieldTypes[i]; FileOutputStream xmlFout = new FileOutputStream(classFile + ".jdo.n"); PrintWriter xmlPw = new PrintWriter(xmlFout); FileOutputStream xmlFout1 = new FileOutputStream(classFile + ".jdo.a"); PrintWriter xmlPw1 = new PrintWriter(xmlFout1); FileOutputStream xmlFout2 = new FileOutputStream(classFile + ".jdo.d"); PrintWriter xmlPw2 = new PrintWriter(xmlFout2); startXmlMetaData(xmlPw); startXmlMetaData(xmlPw1); startXmlMetaData(xmlPw2); startXmlClass(xmlPw, classFile, 0); startXmlClass(xmlPw1, classFile, 1); startXmlClass(xmlPw2, classFile, 2); FileOutputStream fout = new FileOutputStream(classFile + ".java"); PrintWriter pw = new PrintWriter(fout); startClass(pw, classFile); int fieldCounter = 0; for(int j=0; j < accessSpecifiers.length; j++) { for (int k=0; k < fieldModifiers.length; k++) { for(int l = 0; l < xmlPersistenceModifiers.length; l++) { // do not generate persistence modifiers (persistent or transactional or none) // for fields that cannot be persisted if( (fieldModifiers[k].indexOf("static") >= 0 || fieldModifiers[k].indexOf("final") >= 0 ) && !xmlPersistenceModifiers[l].equals("")) continue; /* original code if(!isPersistenceCapable(fieldModifiers[k]) && !xmlPersistenceModifiers[l].equals("")) continue; */ for(int m=0; m < xmlEmbeddedModifiers.length; m++) { // generate persistence modifiers (persistent or transactional or none) // only for fields that can be persisted // generate embedded modifiers only for persistent fields boolean fieldIsPersistent = !( fieldModifiers[k].indexOf("static") >= 0 || fieldModifiers[k].indexOf("final") >= 0 || xmlPersistenceModifiers[l].indexOf("none") >= 0 || xmlPersistenceModifiers[l].indexOf("transactional") >= 0 || (fieldModifiers[k].indexOf("transient") >= 0 && xmlPersistenceModifiers[l].indexOf("persistent") == -1) ); if(!xmlEmbeddedModifiers[m].equals("") && !fieldIsPersistent ) continue; StringBuffer sb = new StringBuffer(); sb.append(twoSpaces); sb.append(accessSpecifiers[j]); sb.append(fieldModifiers[k]); sb.append(fieldTypes[i]); sb.append(space); String fieldName = (fieldTypes[i] + fieldCounter++); //temporary fix to get around the bug in the enhancer code if(!(xmlEmbeddedModifiers[m].equals("") && xmlPersistenceModifiers[l].equals(""))) { printXmlField(xmlPw, "name=\"" + fieldName + "\" " + xmlPersistenceModifiers[l]+ " " + xmlEmbeddedModifiers[m]); printXmlField(xmlPw1, "name=\"" + fieldName + "\" " + xmlPersistenceModifiers[l]+ " " + xmlEmbeddedModifiers[m]); printXmlField(xmlPw2, "name=\"" + fieldName + "\" " + xmlPersistenceModifiers[l]+ " " + xmlEmbeddedModifiers[m]); }//end temporary fix sb.append(fieldName); buildisPersistentArray(fieldIsPersistent); // add to isPersistentArray buildisStaticArray(isStatic(fieldModifiers[k])); // add to isStaticArray buildFieldSpecs(xmlPersistenceModifiers[l].replace('"',' ') + " " + xmlEmbeddedModifiers[m].replace('"',' ') + sb.toString()); // add to the field specs array isFinal[fieldCounter-1] = fieldModifiers[k].indexOf("final") >= 0; if(isFinal[fieldCounter-1]) sb.append(getInitializerForFinalTypes(fieldTypes[i])); buildisFinalArray(isFinal[fieldCounter-1]); sb.append(";"); pw.println(sb.toString()); } } } } writeisPersistentArray(pw); writeisStaticArray(pw); writeisFinalArray(pw); writeFieldSpecs(pw); writeMethodGetLength(pw); writeMethodGet(pw, fieldTypes[i], fieldCounter); writeMethodSet(pw, fieldTypes[i], fieldCounter); endClass(pw); pw.close(); fout.close(); endXmlClass(xmlPw); endXmlClass(xmlPw1); endXmlClass(xmlPw2); endXmlMetaDeta(xmlPw); endXmlMetaDeta(xmlPw1); endXmlMetaDeta(xmlPw2); xmlPw.close(); xmlFout.close(); xmlPw1.close(); xmlFout1.close(); xmlPw2.close(); xmlFout2.close(); } } private void startClass(PrintWriter pw, String className) { pw.println("package org.apache.jdo.tck.pc.fieldtypes;"); pw.println(""); pw.println(getImportStatements(className)); pw.println("public class " + className + " { " ); pw.println(" public int identifier;"); } private void endClass(PrintWriter pw) { pw.println(""); pw.println("}"); } private void startXmlMetaData(PrintWriter pw) { pw.println(""); pw.println(""); pw.println(""); pw.println(""); } private void endXmlMetaDeta(PrintWriter pw) { pw.println(""); pw.println(""); } private void startXmlClass(PrintWriter pw, String className, int type) { switch(type) { case(0): pw.println(""); break; case(1): pw.println(""); break; case(2): pw.println(""); break; default: System.out.println("Unsupported Type"); } } private void endXmlClass(PrintWriter pw) { pw.println(""); } // need to check if we should support extents // fieldName includes modifiers private void printXmlField(PrintWriter pw, String fieldName) { pw.println(""); pw.println(""); } // fieldname does not include any modifiers. // element type includes package informaiton. private void printXmlCollectionFieldWithEmbeddedElement(PrintWriter pw, String fieldName, String elementType, String embeddedValue) { pw.println(""); pw.print(""); pw.println(""); pw.println(""); } private void printXmlArrayFieldWithEmbeddedElement(PrintWriter pw, String fieldName, String embeddedValue) { pw.println(""); pw.println(""); pw.println(""); pw.println(""); } private void printXmlMapField(PrintWriter pw, String fieldName, String keyType, String embeddedKey, String valueType, String embeddedValue) { pw.println(""); pw.print(""); pw.println(""); pw.println(""); } private String getInitializerForFinalTypes(String fieldType) throws Exception { if (fieldType.equals("char")) return " = 'a'"; //primitive character, return 'a'; else if (fieldType.equals("boolean")) return " = false"; //primitive boolean, return 'a'; else if (Character.isLowerCase(fieldType.charAt(0))) return " = 5"; // return 0 for all other primitive types else if (fieldType.equals("Byte")) return " = new Byte((byte)5)"; else if (fieldType.equals("Boolean")) return " = new Boolean(false)"; else if (fieldType.equals("Character")) return " = new Character('a')"; else if (fieldType.equals("Short")) return " = new Short((short)5)"; else if (fieldType.equals("Integer")) return " = new Integer((int)5)"; else if (fieldType.equals("Long")) return " = new Long((long)5)"; else if (fieldType.equals("Float")) return " = new Float((float)5)"; else if (fieldType.equals("Double")) return " = new Double((double)5)"; else if (fieldType.equals("String")) return " = new String(\"JDO TCK\")"; else if (fieldType.equals("Locale")) return " = Locale.US"; else if (fieldType.equals("BigDecimal")) return " = new BigDecimal(100.15)"; else if (fieldType.equals("BigInteger")) return " = new BigInteger(\"100\")"; else if (fieldType.equals("Collection")) return " = new HashSet()"; else if (fieldType.equals("Set")) return " = new HashSet()"; else if (fieldType.equals("HashSet")) return " = new HashSet()"; else if (fieldType.equals("Object")) return " = new Object()"; else if (fieldType.equals("SimpleClass")) return " = new SimpleClass()"; else if (fieldType.equals("SimpleInterface")) return " = new SimpleClass()"; else if (fieldType.equals("Date")) return " = new Date()"; else throw new Exception("Unsupported FieldType " + fieldType); } private String getImportStatements(String fieldType) { if (fieldType.equals("FieldsOfLocale")) return "import java.util.*;"; if (fieldType.equals("FieldsOfDate")) return "import java.util.*;"; else if (fieldType.equals("FieldsOfBigDecimal")) return "import java.math.*;"; else if (fieldType.equals("FieldsOfBigInteger")) return "import java.math.*;"; else if (fieldType.equals("FieldsOfCollection")) return "import java.util.*;"; else if (fieldType.equals("FieldsOfSet")) return "import java.util.*;"; else if (fieldType.equals("FieldsOfHashSet")) return "import java.util.*;"; else if (fieldType.indexOf("Collections") >=0) return "import java.util.*;\r\nimport java.math.*;"; else return ""; } private boolean isPrimitive(String fieldType) { if (Character.isUpperCase(fieldType.charAt(0))) return false; else return true; } private boolean isPersistenceCapable(String fieldModifier) { if (fieldModifier.indexOf("static") >= 0 || fieldModifier.indexOf("final") >= 0 || fieldModifier.indexOf("transient") >= 0) return false; else return true; } private boolean isStatic(String fieldModifier) { if (fieldModifier.indexOf("static") >= 0) return true; else return false; } private boolean isFinal(String fieldModifier) { return fieldModifier.indexOf("final") >= 0; } private void buildisPersistentArray(boolean value) { if(isPersistent.length() != 0) isPersistent.append(","); if(value) isPersistent.append("true"); else isPersistent.append("false"); } private void buildisStaticArray(boolean value) { if(isStatic.length() != 0) isStatic.append(","); if(value) isStatic.append("true"); else isStatic.append("false"); } private void buildisFinalArray(boolean value) { if(isFinalArray.length() != 0) isFinalArray.append(","); if(value) isFinalArray.append("true"); else isFinalArray.append("false"); } private void writeisPersistentArray(PrintWriter pw) { // have to go through this hoopla because pw.println(fieldSpecs.toString()); outputs only // 1024 characters char [] charArray = new char[isPersistent.length()]; isPersistent.getChars(0,isPersistent.length(),charArray,0); pw.println(""); pw.println("public static final boolean [] isPersistent = { "); int fieldCounter=0; for(int i = 0; i < charArray.length; i++) { pw.print(charArray[i]); if(charArray[i] == ',') { fieldCounter++; if(fieldCounter == 10) { pw.println(""); pw.flush(); fieldCounter = 0; } } } pw.println(""); pw.println(" };"); isPersistent = new StringBuffer(2000); } private void writeisStaticArray(PrintWriter pw) { // have to go through this hoopla because pw.println(fieldSpecs.toString()); outputs only // 1024 characters char [] charArray = new char[isStatic.length()]; isStatic.getChars(0,isStatic.length(),charArray,0); pw.println(""); pw.println("public static final boolean [] isStatic = { "); int fieldCounter=0; for(int i = 0; i < charArray.length; i++) { pw.print(charArray[i]); if(charArray[i] == ',') { fieldCounter++; if(fieldCounter == 10) { pw.println(""); pw.flush(); fieldCounter = 0; } } } pw.println(""); pw.println(" };"); isStatic = new StringBuffer(2000); } private void writeisFinalArray(PrintWriter pw) { // have to go through this hoopla because pw.println(fieldSpecs.toString()); outputs only // 1024 characters char [] charArray = new char[isFinalArray.length()]; isFinalArray.getChars(0,isFinalArray.length(),charArray,0); pw.println(""); pw.println("public static final boolean [] isFinal = { "); int fieldCounter=0; for(int i = 0; i < charArray.length; i++) { pw.print(charArray[i]); if(charArray[i] == ',') { fieldCounter++; if(fieldCounter == 10) { pw.println(""); pw.flush(); fieldCounter = 0; } } } pw.println(""); pw.println(" };"); isFinalArray = new StringBuffer(2000); } private void buildFieldSpecs(String field) { if(fieldSpecs.length() != 0) fieldSpecs.append(","); fieldSpecs.append("\""); fieldSpecs.append(field.trim()); fieldSpecs.append("\""); } private void writeFieldSpecs(PrintWriter pw) { // have to go through this hoopla because pw.println(fieldSpecs.toString()); outputs only // 1024 characters char [] charArray = new char[fieldSpecs.length()]; fieldSpecs.getChars(0,fieldSpecs.length(),charArray,0); pw.println(""); pw.println(" public static final String [] fieldSpecs = { "); pw.print(" "); for(int i = 0; i < charArray.length; i++) { pw.print(charArray[i]); if(charArray[i] == ',') { pw.println(""); pw.print(" "); pw.flush(); } } pw.println(""); pw.println(" };"); fieldSpecs = new StringBuffer(2000); } private void writeMethodGetLength(PrintWriter pw) { pw.println(" public int getLength()"); pw.println(" {"); pw.println(" return fieldSpecs.length;"); pw.println(" }"); } private void writeMethodGet(PrintWriter pw, String fieldType, int numberOfFields) { pw.println(" public " +fieldType+ " get(int index)"); pw.println(" {"); pw.println(" switch (index)"); pw.println(" {"); for(int i = 0; i < numberOfFields; i++) { pw.println(" case(" + i + "):"); pw.println(" return " + fieldType + i +";"); } pw.println(" default:"); pw.println(" throw new IndexOutOfBoundsException();"); pw.println(" }"); pw.println(" }"); } private void writeMethodGet(PrintWriter pw, String fieldType, String[] fieldNames, int numFields) { pw.println(" public " +fieldType+ " get(int index)"); pw.println(" {"); pw.println(" switch (index)"); pw.println(" {"); for(int i = 0; i < numFields; i++) { pw.println(" case(" + i + "):"); pw.println(" return " + fieldNames[i] +";"); } pw.println(" default:"); pw.println(" throw new IndexOutOfBoundsException();"); pw.println(" }"); pw.println(" }"); } private void writeMethodSet(PrintWriter pw, String fieldType, int numberOfFields) { pw.println(" public boolean set(int index," + fieldType + " value"+ ")"); pw.println(" {"); pw.println(" if(fieldSpecs[index].indexOf(\"final\") != -1)"); pw.println(" return false;"); pw.println(" switch (index)"); pw.println(" {"); for(int i = 0; i < numberOfFields; i++) { if(!isFinal[i]) { pw.println(" case(" + i + "):"); pw.println(" " + fieldType + i + "= value" + ";"); pw.println(" break;" ); } } pw.println(" default:"); pw.println(" throw new IndexOutOfBoundsException();"); pw.println(" }"); pw.println(" return true;"); pw.println(" }"); } private void writeMethodSet(PrintWriter pw, String fieldType, String [] fieldNames, int numFields) { pw.println(" public boolean set(int index," + fieldType + " value"+ ")"); pw.println(" {"); pw.println(" if(fieldSpecs[index].indexOf(\"final\") != -1)"); pw.println(" return false;"); pw.println(" switch (index)"); pw.println(" {"); for(int i = 0; i < numFields; i++) { // if(!isFinal[i]) { pw.println(" case(" + i + "):"); pw.println(" " + fieldNames[i] + "= value" + ";"); pw.println(" break;" ); // } } pw.println(" default:"); pw.println(" throw new IndexOutOfBoundsException();"); pw.println(" }"); pw.println(" return true;"); pw.println(" }"); } private void writeMethodSetForArray(PrintWriter pw, String fieldType, String [] fieldNames, int numFields) { pw.println(" public boolean set(int index," + fieldType + " value"+ ")"); pw.println(" {"); pw.println(" if(fieldSpecs[index].indexOf(\"final\") != -1)"); pw.println(" return false;"); pw.println(" switch (index)"); pw.println(" {"); for(int i = 0; i < numFields; i++) { // if(!isFinal[i]) { String fieldName = fieldNames[i]; String valueType; pw.println(" case(" + i + "):"); int indexOfValueType = fieldName.indexOf("Of") + 2; String valueTypeWithNumber = fieldName.substring(indexOfValueType); int lastIndexOfValueType = 0; for (int j=valueTypeWithNumber.length() -1; j>=0; j--) { if (Character.isDigit(valueTypeWithNumber.charAt(j))) { continue; }else { lastIndexOfValueType = j; break; } } valueType = valueTypeWithNumber.substring(0, lastIndexOfValueType+1); pw.println(" " + fieldNames[i] + "= (" +valueType + " []) value ;"); pw.println(" break;" ); // } } pw.println(" default:"); pw.println(" throw new IndexOutOfBoundsException();"); pw.println(" }"); pw.println(" return true;"); pw.println(" }"); } // generates Collection files for the different collectionTypes // also, updates the corresponding xml files // called by generate, after it is done dealing with the generic field types void generateCollections() throws Exception { final String [] embeddedElements = {"", "true", "false"}; final String [] embeddedElementsForFieldSpec = {"", "embedded-element=true", "embedded-element=false"}; for(int i=0; i < collectionTypes.length; i++) { // Map has a lot of combinations, generate it separately if(collectionTypes[i].indexOf("Map") >= 0 || collectionTypes[i].equals("Hashtable")) { generateMapCollection(collectionTypes[i]); } else // Array and the other collections { String classFile = collectionTypes[i] + "Collections"; FileOutputStream fout = new FileOutputStream(classFile + ".java"); PrintWriter pw = new PrintWriter(fout); FileOutputStream xmlFout = new FileOutputStream(classFile + ".jdo.n"); PrintWriter xmlPw = new PrintWriter(xmlFout); FileOutputStream xmlFout1 = new FileOutputStream(classFile + ".jdo.a"); PrintWriter xmlPw1 = new PrintWriter(xmlFout1); FileOutputStream xmlFout2 = new FileOutputStream(classFile + ".jdo.d"); PrintWriter xmlPw2 = new PrintWriter(xmlFout2); startClass(pw, classFile); startXmlMetaData(xmlPw); startXmlMetaData(xmlPw1); startXmlMetaData(xmlPw2); startXmlClass(xmlPw, classFile, 0); startXmlClass(xmlPw1, classFile, 1); startXmlClass(xmlPw2, classFile, 2); int fieldCounter=0; String fieldNames [] = new String [elementTypes.length * embeddedElements.length]; for(int j=0; j < elementTypes.length; j++) { if( elementTypes[j].equals("Locale") && collectionTypes[i].equals("TreeSet") ) continue; for(int k=0; k < embeddedElements.length; k++) { if(collectionTypes[i].equals("Array")) { if(!embeddedElements[k].equals("")) { fieldNames[fieldCounter] = collectionTypes[i] + "Of" + elementTypes[j] + fieldCounter; // pw.println(" public " + "Object [] "+ fieldNames[fieldCounter] +";"); pw.println(" public " + elementTypes[j] +" [] " + fieldNames[fieldCounter] +";"); printXmlArrayFieldWithEmbeddedElement(xmlPw, fieldNames[fieldCounter], embeddedElements[k]); printXmlArrayFieldWithEmbeddedElement(xmlPw1, fieldNames[fieldCounter], embeddedElements[k]); printXmlArrayFieldWithEmbeddedElement(xmlPw2, fieldNames[fieldCounter], embeddedElements[k]); buildFieldSpecs(embeddedElementsForFieldSpec[k] + " " + "public " + elementTypes[j] +" [] " + fieldNames[fieldCounter]); // add to the field specs array*/ fieldCounter++; } } else // Collection { fieldNames[fieldCounter] = collectionTypes[i] + "Of" + elementTypes[j] + fieldCounter; pw.println(" public " + collectionTypes[i] +" "+ fieldNames[fieldCounter] +";"); printXmlCollectionFieldWithEmbeddedElement(xmlPw, fieldNames[fieldCounter], elementsWithPackageInfo[j], embeddedElements[k]); printXmlCollectionFieldWithEmbeddedElement(xmlPw1, fieldNames[fieldCounter], elementsWithPackageInfo[j], embeddedElements[k]); printXmlCollectionFieldWithEmbeddedElement(xmlPw2, fieldNames[fieldCounter], elementsWithPackageInfo[j], embeddedElements[k]); buildFieldSpecs(embeddedElementsForFieldSpec[k] + " " + "public " + collectionTypes[i] +" "+ fieldNames[fieldCounter]); // add to the field specs array*/ fieldCounter++; } } } writeFieldSpecs(pw); writeMethodGetLength(pw); writeMethodGet(pw, collectionTypes[i].equals("Array")? "Object [] " : collectionTypes[i], fieldNames, fieldCounter); if(collectionTypes[i].equals("Array")) writeMethodSetForArray(pw, "Object [] ", fieldNames, fieldCounter); else writeMethodSet(pw, collectionTypes[i], fieldNames, fieldCounter); endClass(pw); pw.close(); fout.close(); endXmlClass(xmlPw); endXmlClass(xmlPw1); endXmlClass(xmlPw2); endXmlMetaDeta(xmlPw); endXmlMetaDeta(xmlPw1); endXmlMetaDeta(xmlPw2); xmlPw.close(); xmlFout.close(); xmlPw1.close(); xmlFout1.close(); xmlPw2.close(); xmlFout2.close(); } } } private void generateMapCollection(String mapName) throws Exception { final String [] keyTypes1 = {"String"}; final String [] valueTypes1 = {"Object", "SimpleClass", "SimpleInterface", "String", "Date", "Locale", "BigDecimal", "BigInteger", "Byte", "Double", "Float", "Integer", "Long", "Short"}; final String [] keyTypes2 = {"Object", "SimpleClass", "SimpleInterface", "String", "Date", "BigDecimal", "BigInteger", "Byte", "Double", "Float", "Integer", "Long", "Short"}; final String [] valueTypes2 = {"String"}; final String [][] keyTypes = {keyTypes1, keyTypes2}; final String [][] valueTypes = {valueTypes1, valueTypes2}; String [] classNameArray = {mapName + "StringKey" + "Collections", mapName + "StringValue" + "Collections"}; for(int i=0; i < classNameArray.length; i++) { String classFile = classNameArray[i]; FileOutputStream fout = new FileOutputStream(classFile + ".java"); PrintWriter pw = new PrintWriter(fout); FileOutputStream xmlFout = new FileOutputStream(classFile + ".jdo.n"); PrintWriter xmlPw = new PrintWriter(xmlFout); FileOutputStream xmlFout1 = new FileOutputStream(classFile + ".jdo.a"); PrintWriter xmlPw1 = new PrintWriter(xmlFout1); FileOutputStream xmlFout2 = new FileOutputStream(classFile + ".jdo.d"); PrintWriter xmlPw2 = new PrintWriter(xmlFout2); startClass(pw, classFile); startXmlMetaData(xmlPw); startXmlMetaData(xmlPw1); startXmlMetaData(xmlPw2); startXmlClass(xmlPw, classFile, 0); startXmlClass(xmlPw1, classFile, 1); startXmlClass(xmlPw2, classFile, 2); fillMapCollection(keyTypes[i], valueTypes[i],mapName, pw, xmlPw, xmlPw1, xmlPw2); endClass(pw); pw.close(); fout.close(); endXmlClass(xmlPw); endXmlClass(xmlPw1); endXmlClass(xmlPw2); endXmlMetaDeta(xmlPw); endXmlMetaDeta(xmlPw1); endXmlMetaDeta(xmlPw2); xmlPw.close(); xmlFout.close(); xmlPw1.close(); xmlFout1.close(); xmlPw2.close(); xmlFout2.close(); } } private void fillMapCollection(String [] keyTypes, String [] valueTypes, String mapName, PrintWriter pw, PrintWriter xmlPw, PrintWriter xmlPw1, PrintWriter xmlPw2) { final String [] embeddedKeys = {"", "true", "false"}; final String [] embeddedValues = embeddedKeys; final String [] embeddedKeyForFieldSpec = {"", "embedded-key=true", "embedded-key=false"}; final String [] embeddedValueForFieldSpec = {"", "embedded-value=true", "embedded-value=false"}; int fieldCounter=0; String fieldNames [] = new String [keyTypes.length * embeddedKeys.length * valueTypes.length * embeddedValues.length]; for(int i = 0; i < keyTypes.length; i++) { for(int j = 0; j < embeddedKeys.length; j++) { for(int k = 0; k < valueTypes.length; k++) { for(int l = 0; l < embeddedValues.length; l++) { if( keyTypes[i].equals("") && embeddedKeys[j].equals("") && valueTypes[k].equals("") && embeddedValues[l].equals("")) continue; fieldNames[fieldCounter] = mapName+ "Of" + keyTypes[i] +"_"+valueTypes[k] + fieldCounter; pw.println(" public " + mapName +" " + fieldNames[fieldCounter] +";"); printXmlMapField(xmlPw, fieldNames[fieldCounter], keyTypes[i], embeddedKeys[j], valueTypes[k], embeddedValues[l]); printXmlMapField(xmlPw1, fieldNames[fieldCounter], keyTypes[i], embeddedKeys[j], valueTypes[k], embeddedValues[l]); printXmlMapField(xmlPw2, fieldNames[fieldCounter], keyTypes[i], embeddedKeys[j], valueTypes[k], embeddedValues[l]); buildFieldSpecs(embeddedKeyForFieldSpec[j] + " " + embeddedValueForFieldSpec[l] + " " + "public " + mapName +" "+ fieldNames[fieldCounter]); // add to the field specs array*/ fieldCounter++; } } } } writeFieldSpecs(pw); writeMethodGetLength(pw); writeMethodGet(pw, mapName, fieldNames, fieldCounter); writeMethodSet(pw, mapName, fieldNames, fieldCounter); } public static void main(String[] args) { ClassGenerator classGenerator = new ClassGenerator(); try { classGenerator.generate(); classGenerator.generateCollections(); } catch (Exception e) { System.out.println(e); e.printStackTrace(); } } } tck/src/java/org/apache/jdo/tck/util/ConsoleFileOutput.java100664 4674 12500110374 24204 0ustarmbouschenstaff 0 0 /* * 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.util; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; import java.io.PrintStream; /** * Creates an output stream that delegates to * {@link System#out} and to a file output stream. * The file name of the file output stream is determined * by method {@link BatchTestRunner#getFileName()}. */ class ConsoleFileOutput extends OutputStream { private String fileName; private final PrintStream systemOut = System.out; private FileOutputStream fileOut; ConsoleFileOutput() { this.fileName = BatchTestRunner.getFileName(); try { this.fileOut = new FileOutputStream(this.fileName); } catch (IOException e) { System.err.println("Cannot create log file "+this.fileName+". "+e); } } /* * @see java.io.OutputStream#write(int) */ public void write(int b) throws IOException { this.systemOut.write(b); this.fileOut.write(b); } /** * @see java.io.OutputStream#close() */ public void close() throws IOException { this.fileOut.close(); this.systemOut.close(); } /** * @see java.io.OutputStream#flush() */ public void flush() throws IOException { this.systemOut.flush(); this.fileOut.flush(); } String getFileName() { return new File(this.fileName).getName(); } String getDirectory() { String result = new File(this.fileName).getParent(); if (!result.endsWith(File.separator)) result += File.separator; return result; } } tck/src/java/org/apache/jdo/tck/util/ConversionHelper.java100664 13550 12500110374 24057 0ustarmbouschenstaff 0 0 /* * 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.util; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Date; import java.util.HashMap; import java.util.Iterator; import java.util.Locale; import java.util.Map; import java.util.TimeZone; import javax.jdo.JDOFatalException; /** * Provides consersion functionality. */ public class ConversionHelper { /** * Converts the given value to a {@link java.util.Date}. * @param pattern the pattern * @param timezone the timezone * @param locale the locale * @param value the value * @return the date * @throws JDOFatalException if the conversion fails */ public static Date toUtilDate(String pattern, String timezone, Locale locale, String value) { SimpleDateFormat formatter = new SimpleDateFormat(pattern, locale); formatter.setTimeZone(TimeZone.getTimeZone(timezone)); try { return formatter.parse(value); } catch (ParseException e) { throw new JDOFatalException("", e); } } public static Date toUtilDate(String pattern, Locale locale, String value) { SimpleDateFormat formatter = new SimpleDateFormat(pattern, locale); try { return formatter.parse(value); } catch (ParseException e) { throw new JDOFatalException("", e); } } /** * Converts the given array into a {@link Map}. * The first dimension represents the map entries, * the second dimension holds the keys and values, e.g. * { {"key1", "value1"}, {"key2", {"value2"} }. * @param array the array * @return the map */ public static Map arrayToMap(Object[][] array) { Map map = new HashMap(); for (int i = 0; i < array.length; i++) { map.put(array[i][0], array[i][1]); } return map; } /** * Returns a collection containing all elements * in the given collection. * Recursively converts all elements of type Object[] * in the given collection to collections * in the returned collection. * @param collection the collection * @return the converted collection */ public static Collection convertsElementsOfTypeObjectArray(Collection collection) { Collection result = new ArrayList(); for (Iterator i = collection.iterator(); i.hasNext(); ) { Object current = convertObjectArrayElements(i.next()); result.add(current); } return result; } /** * Returns a map containing all entries * in the given map. * Recursively converts all entries having keys and/or values * of type Object[] in the given map to collections * in the returned map. * @param map the map * @return the converted map */ public static Map convertsElementsOfTypeObjectArray(Map map) { Map result = new HashMap(); for (Iterator i = map.entrySet().iterator(); i.hasNext(); ) { Map.Entry entry = (Map.Entry) i.next(); Object key = convertObjectArrayElements(entry.getKey()); Object value = convertObjectArrayElements(entry.getValue()); result.put(key, value); } return result; } /** * Recursively converts all elements of type Object[] * Collection, or Map. * @see #convertObjectArrayElements(Object[]) * @see #convertsElementsOfTypeObjectArray(Collection) * @see #convertsElementsOfTypeObjectArray(Map) * @param object the object to convert * @return the converted parameter */ public static Object convertObjectArrayElements(Object object) { Object result; if (object instanceof Object[]) { result = Arrays.asList( convertObjectArrayElements((Object[])object)); } else if (object instanceof Collection) { result = convertsElementsOfTypeObjectArray((Collection)object); } else if (object instanceof Map) { result = convertsElementsOfTypeObjectArray((Map)object); } else { result = object; } return result; } /** * Recursively converts all elements of type Object[] * in the given array and retuns that array. * @param array the array * @return the converted array */ public static Object[] convertObjectArrayElements(Object[] array) { for (int i = 0; i < array.length; i++ ) { array[i] = convertObjectArrayElements(array[i]); } return array; } /** * Converts the given array to a string array. * @param array the object array * @return the string array */ public static String[] toStringArray(Object[] array) { String[] result = new String[array.length]; System.arraycopy(array, 0, result, 0, result.length); return result; } } tck/src/java/org/apache/jdo/tck/util/DeepEquality.java100664 6575 12500110374 23156 0ustarmbouschenstaff 0 0 /* * 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.util; import java.util.Comparator; /** * This DeepEquality interface defines a method indicating * whether some other object is "deep equal to" this object. *

    * Two objects are deep equal, if all the fields are deep equal. The * sematics of deep equal on the fields depends of the field type: *

      *
    • fields of type boolean or an integral type are deep * equal, if they compare true using ==
    • *
    • fields of type float and double are deep * equal, if they are close enough as defined by methods closeEnough * provided by class EqualityHelper
    • *
    • fields of Java wrapper classes are equal if their wrapped primitive * values are deep equal
    • *
    • fields of type BigDecimal are equal, if compareTo returns 0
    • *
    • collection fields are deep equal, if they have the same size and * their corresponding elements compare deep equal after sorting using the * natural ordering.
    • *
    • map fields compare deep equal, if they have the same size and both * keys and values compare deep equal after sorting the entries using the * natural ordering of the keys.
    • *
    • fields of type DeepEquality are deep equal, if method * deepEquals returns true
    • *
    • fields of other types are deep equal, if method equals * returns true
    • *
    * The EqualityHelper instance passed to the * deepEquals method keeps track of instances that have * already been processed to avoid endless recursion for cyclic data * structures. * * @author Michael Bouschen * @since 1.1 */ public interface DeepEquality { /** * Returns true if all the fields of this instance are * deep equal to the corresponding fields of the other Object. This * means that all non-relationship fields are equal to the * corresponging fields in the other Object, and all relationship * fields are deep equal. Recursion is stopped in the equality helper * method that compares objects. * @param other the object with which to compare. * @param helper EqualityHelper to keep track of instances that have * already been processed. * @return true if all the fields are deep equal; * false otherwise. * @throws ClassCastException if the specified instances' type prevents * it from being compared to this instance. */ public boolean deepCompareFields(Object other, EqualityHelper helper); } tck/src/java/org/apache/jdo/tck/util/EqualityHelper.java100664 103544 12500110374 23552 0ustarmbouschenstaff 0 0 /* * 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.util; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.Comparator; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Stack; import java.math.BigDecimal; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /** * This is a utility class to support equality checking. An EqualityHelper * object defines the context of a deepEquals call, because it keeps track * of objects that have already been processed. This avoids endless * recursion when comparing cyclic data structures for deep equality. *

    * Furthermore, EqualityHelper provides convenience methods for checking * deep equality, equality and close enough (for floating point values). * * @author Michael Bouschen * @since 1.1 */ public class EqualityHelper { /** Logger */ protected Log logger = LogFactory.getFactory().getInstance("org.apache.jdo.tck"); /** true if debug logging in enabled. */ protected boolean debug = logger.isDebugEnabled(); /** Used when comparing float values close enough. */ public static float FLOAT_EPSILON = (float)Math.pow(2.0, -20.0); /** Used when comparing double values close enough. */ public static double DOUBLE_EPSILON = Math.pow(2.0, -52.0); /** Message for null vs. not null */ static final String msgMeNull = "\nExpected null, actual not null"; /** Message for not null vs. null */ static final String msgOtherNull = "\nExpected not null, actual null"; /** Message for incompatible types */ static final String msgIncompatibleTypes = "\nIncompatible types for comparison"; /** Message for wrong class for counting via iterator */ static final String msgParameterMustBeCollectionOrMap = "Parameter must be a Collection or Map."; /** Comparator used in method deepEquals comparing maps. This comparator * is used to order Maps whose keys are Comparable so the entries can be * compared using deepCompareFields. */ private static Comparator entryKeyComparator = new Comparator() { public int compare(Object o1, Object o2) { Object key1 = ((Map.Entry)o1).getKey(); Object key2 = ((Map.Entry)o2).getKey(); return ((Comparable)key1).compareTo(key2); } }; /** * Utility counter for maps and collections */ static int countIterator(Object o) { int result = 0; Iterator it; if (o instanceof Collection) { it = ((Collection)o).iterator(); } else if (o instanceof Map) { it = ((Map)o).entrySet().iterator(); } else { throw new ClassCastException(msgParameterMustBeCollectionOrMap); } while (it.hasNext()) { it.next(); result++; } return result; } /** Comparator used in method deepEquals comparing maps of * DeepEquality. */ private static class DeepEqualityEntryKeyComparator implements Comparator { Comparator comparator; DeepEqualityEntryKeyComparator(Comparator comp) { this.comparator = comparator; } public int compare(Object o1, Object o2) { Object key1 = ((Map.Entry)o1).getKey(); Object key2 = ((Map.Entry)o2).getKey(); return comparator.compare(key1, key2); } } /** Collection of instances that have been processed already in the * context of this EqualityHelper instance */ private Collection processed = new HashSet(); /** StringBuffer of logged differences. */ StringBuffer unequalBuffer = new StringBuffer(); /** * Context is a stack of navigational paths. */ Stack contextStack = new Stack(); // Methods to support keeping track of instances that have been // processed already. /** Returns true if the specified instance has been * processed already in the context of this * EqualityHelper. * @param obj the instance to be checked. * @return true if the instance has been processed * already; false otherwise. */ public boolean isProcessed(Object obj) { return processed.contains(obj); } /** Marks the specified instance as processed in the context of this * EqualityHelper. This means the instance is added to the * collection of processed instances. * @param obj instance marked as processed */ public void markProcessed(Object obj) { processed.add(obj); } /** Clears the collection of processed instances of this * EqualityHelper. No instance is marked as processed in * the context of this EqualityHelper after calling this * method. */ public void clearProcessed() { processed.clear(); } // Deep equality support methods /** Returns true if the specified instances are "deep * equal". * @param me one object to be tested for deep equality * @param other the other object to be tested for deep equality * @return true if the objects are deep equal. */ public boolean deepEquals(DeepEquality me, DeepEquality other) { if (me == other) return true; if ((me == null) || (other == null)) return false; if (isProcessed(me)) return true; markProcessed(me); return me.deepCompareFields(other, this); } /** Returns true if the specified instances are "deep * equal". The method compares the two instances via the deepEquals * method if they implement DeepEquals; compares the two instances via * deepEquals if they implement Collection or Map, and otherwise * compares the instances using equals. * @param me one object to be tested for deep equality * @param other the other object to be tested for deep equality * @return true if the objects are deep equal. */ public boolean deepEquals(Object me, Object other) { if (me == other) return true; if ((me == null) || (other == null)) return false; if ((me instanceof DeepEquality) && (other instanceof DeepEquality)) return deepEquals((DeepEquality)me, (DeepEquality)other); if ((me instanceof Collection) && (other instanceof Collection)) return deepEquals((Collection)me, (Collection)other); if ((me instanceof Map) && (other instanceof Map)) return deepEquals((Map)me, (Map)other); return me.equals(other); } /** Returns true if the specified collections are "deep * equal". Two collections are deep equal, if they have the same size * and their corresponding elements are deep equal after sorting * using the natural ordering of the elements. The method throws a * ClassCastException if the elements are not Comparable * or if they are not mutually comparable. * @param mine one collection to be tested for deep equality * @param other the other collection to be tested for deep equality * @return true if the collections are deep equal. * @throws ClassCastException if the collections contain elements that * are not mutually comparable. */ public boolean deepEquals(Collection mine, Collection other) { if (mine == other) return true; if ((mine == null) || (other == null)) return false; // Return false, if the size differs if (mine.size() != other.size()) return false; if (mine.size() == 0) return true; // Now check the elements List myList = new ArrayList(mine); Collections.sort(myList); List otherList = new ArrayList(other); /* Any collection of elements to be compared must implement Comparator * to avoid the other side having to implement Comparable. */ Comparator comparator = (Comparator)myList.get(0); Collections.sort(otherList, comparator); for (int i = 0; i < myList.size(); i++) { if (!deepEquals(myList.get(i), otherList.get(i))) return false; } return true; } /** Returns true if the specified maps are "deep * equal". Two maps are deep equal, if they have the same size and the * values of the corresponding keys compare deep equal. The method * throws a ClassCastException if keys or values are not * Comparable or if they are not mutually comparable. * @param mine one map to be tested for deep equality * @param other the other map to be tested for deep equality * @return true if the maps are deep equal. * @throws ClassCastException if the maps contain keys or values that * are not mutually comparable. */ public boolean deepEquals(Map mine, Map other) { if (mine == other) return true; if ((mine == null) || (other == null)) return false; // Return false, if the size differs if (mine.size() != other.size()) return false; if (mine.size() == 0) return true; // Now check the elements List myList = new ArrayList(mine.entrySet()); Collections.sort(myList, entryKeyComparator); List otherList = new ArrayList(other.entrySet()); /* Any collection of elements to be compared must implement Comparator * to avoid the other side having to implement Comparable. */ Comparator comparator = (Comparator)((Map.Entry)myList.get(0)).getKey(); Collections.sort(otherList, new DeepEqualityEntryKeyComparator(comparator)); for (int i = 0; i < myList.size(); i++) { Map.Entry entry1 = (Map.Entry)myList.get(i); Map.Entry entry2 = (Map.Entry)otherList.get(i); // compare the keys if (!deepEquals(entry1.getKey(), entry2.getKey())) return false; // compare the values if (!deepEquals(entry1.getValue(), entry2.getValue())) return false; } return true; } // Shallow equality support methods /** Returns true if the specified collections are "shallow * equal". Two collections are shallow equal, if they have the same size * and their corresponding elements are equal after sorting using the * natural ordering. * @param mine one collection to be tested for shallow equality * @param other the other collection to be tested for shallow equality * @return true if the collections are deep equal. */ public boolean shallowEquals(Collection mine, Collection other) { if (mine == other) return true; if ((mine == null) || (other == null)) return false; // Return false, if the size differs if (mine.size() != other.size()) return false; if (mine.size() == 0) return true; // Now check the elements List myList = new ArrayList(mine); Collections.sort(myList); List otherList = new ArrayList(other); /* Any collection of elements to be compared must implement Comparator * to avoid the other side having to implement Comparable. */ Comparator comparator = (Comparator)myList.get(0); Collections.sort(otherList, comparator); return myList.equals(otherList); } // Deep equality support methods with logging public String getUnequalBuffer() { return unequalBuffer.toString(); } /** * Context is nested via navigation through relationships. */ void pushContext(String ctx) { contextStack.push(ctx); } String popContext() { return (String)contextStack.pop(); } /** Log differences between objects that don't compare equal. * @param o1 the first object * @param o2 the second object * @param where the field where the objects are found */ void logUnequal(Object o1, Object o2, String where) { unequalBuffer.append("Context: "); Iterator it = contextStack.iterator(); StringBuffer offset = new StringBuffer("\n"); while (it.hasNext()) { unequalBuffer.append(it.next()); unequalBuffer.append("-> "); offset.append(" "); } unequalBuffer.append(where); unequalBuffer.append(offset.toString()); unequalBuffer.append("expected '"); unequalBuffer.append(o1); unequalBuffer.append("'"); unequalBuffer.append(offset.toString()); unequalBuffer.append(" actual '"); unequalBuffer.append(o2); unequalBuffer.append("'\n"); } /** Returns true if the specified instances are "deep * equal". If unequal, log the location of the inequality. * @param me one object to be tested for deep equality * @param other the other object to be tested for deep equality * @param where the location of the inequality (provided by the caller) * @return true if the objects are deep equal. */ public boolean deepEquals(DeepEquality me, Object other, String where) { if (me == other) return true; if (me == null) { logUnequal(me, other, where + msgMeNull); return false; } if (other == null) { logUnequal(me, other, where + msgOtherNull); return false; } if (isProcessed(me)) return true; markProcessed(me); pushContext(where); boolean result = true; if (!me.deepCompareFields(other, this)) { //logUnequal(me, other, where); result = false; } popContext(); return result; } /** Returns true if the specified instances are "deep * equal". The method compares the two instances via the deepEquals * method if they implement DeepEquals; compares the two instances via * deepEquals if they implement Collection or Map, and otherwise * compares the instances using equals. * @param me one object to be tested for deep equality * @param other the other object to be tested for deep equality * @param where the location of the inequality (provided by the caller) * @return true if the objects are deep equal. */ public boolean deepEquals(Object me, Object other, String where) { if (me == other) return true; if (me == null) { logUnequal(me, other, where + msgMeNull); return false; } if (other == null) { logUnequal(me, other, where + msgOtherNull); return false; } if (me instanceof DeepEquality) { return deepEquals((DeepEquality)me, other, where); } else if ((me instanceof Collection) && (other instanceof Collection)) { return deepEquals((Collection)me, (Collection)other, where); } else if ((me instanceof Map) && (other instanceof Map)) { return deepEquals((Map)me, (Map)other, where); } else { return equals(me, other, where); } } /** Returns true if the specified collections are "deep * equal". Two collections are deep equal, if they have the same size * and their corresponding elements are deep equal after sorting * using the natural ordering of the elements. The method throws a * ClassCastException if the elements are not Comparable * or if they are not mutually comparable. * @param me one collection to be tested for deep equality * @param other the other collection to be tested for deep equality * @param where the location of the inequality (provided by the caller) * @return true if the collections are deep equal. * @throws ClassCastException if the collections contain elements that * are not mutually comparable. */ public boolean deepEquals(Collection me, Collection other, String where) { if (me == other) return true; if (me == null) { logUnequal(me, other, where + msgMeNull); return false; } if (other == null) { logUnequal(me, other, where + msgOtherNull); return false; } int mysize = me.size(); int othersize = other.size(); // Return false, if the size differs if (mysize != othersize) { int count = countIterator(other); logUnequal(me, other, where + "\nSize mismatch: expected size= " + me.size() + ", original size= " + othersize + ", current size= " + other.size() + ", counted size= " + count); return false; } if (mysize == 0) return true; // Now check each element for equality or deep equality List myList = new ArrayList(me); // Use the natural ordering of me; must implement Comparable Collections.sort(myList); List otherList = new ArrayList(other); /* Any collection of elements to be compared must implement Comparator * to avoid the other side having to implement Comparable. */ Comparator comparator = (Comparator)myList.get(0); Collections.sort(otherList, comparator); boolean result = true; for (int i = 0; i < myList.size(); i++) { DeepEquality o1 = (DeepEquality)myList.get(i); Object o2 = otherList.get(i); /* Compare corresponding elements of the ordered list. */ if (!deepEquals(o1, o2, where + "[" + i + "]")) { result = false; } } return result; } /** Returns true if the specified maps are "deep * equal". Two maps are deep equal, if they have the same size and the * values of the corresponding keys compare deep equal. The method * throws a ClassCastException if keys or values are not * Comparable or if they are not mutually comparable. * @param me one map to be tested for deep equality * @param other the other map to be tested for deep equality * @param where the location of the inequality (provided by the caller) * @return true if the maps are deep equal. * @throws ClassCastException if the maps contain keys or values that * are not mutually comparable. */ public boolean deepEquals(Map me, Map other, String where) { if (me == other) return true; if (me == null) { logUnequal(me, other, where + msgMeNull); return false; } if (other == null) { logUnequal(me, other, where + msgOtherNull); return false; } // Return false, if the size differs int mysize = me.size(); int othersize = other.size(); if (mysize != othersize) { int count = countIterator(other); logUnequal(me, other, where + "\nSize mismatch: expected size= " + me.size() + ", original size= " + othersize + ", current size= " + other.size() + ", counted size= " + count); return false; } if (mysize == 0) return true; // Now check the elements List myList = new ArrayList(me.entrySet()); // Use the natural ordering of me; must implement Comparable Collections.sort(myList, entryKeyComparator); List otherList = new ArrayList(other.entrySet()); Comparator comparator = entryKeyComparator; // Use the Comparator to avoid the other side implementing Comparable Object key = ((Map.Entry)myList.get(0)).getKey(); if (key instanceof Comparator) { comparator = new DeepEqualityEntryKeyComparator((Comparator)key); } Collections.sort(otherList, comparator); boolean result = true; for (int i = 0; i < myList.size(); i++) { Map.Entry entry1 = (Map.Entry)myList.get(i); Object key1 = entry1.getKey(); Object value1 = entry1.getValue(); Map.Entry entry2 = (Map.Entry)otherList.get(i); Object key2 = entry2.getKey(); Object value2 = entry2.getValue(); // compare the keys if (!deepEquals(key1, key2, where + "[" + i + "].key")) { result = false; } // compare the values if (!deepEquals(value1, value2, where + "[" + i + "].value")) { result = false; } } return result; } // Shallow equality support methods /** Returns true if the specified collections are "shallow * equal". Two collections are shallow equal, if they have the same size * and their corresponding elements are equal after sorting using the * natural ordering. * @param me one collection to be tested for shallow equality * @param other the other collection to be tested for shallow equality * @param where the location of the inequality (provided by the caller) * @return true if the collections are deep equal. */ public boolean shallowEquals(Collection me, Collection other, String where) { if (me == other) return true; if (me == null) { logUnequal(me, other, where + msgMeNull); return false; } if (other == null) { logUnequal(me, other, where + msgOtherNull); return false; } // Return false, if the size differs int mysize = me.size(); int othersize = other.size(); if (mysize != othersize) { // debug size... Iterator it = other.iterator(); int count = 0; while (it.hasNext()) { it.next(); ++count; } logUnequal(me, other, where + "\nSize mismatch: expected size= " + me.size() + ", original size= " + othersize + ", current size= " + other.size() + ", counted size= " + count); return false; } if (me.size() == 0) return true; // Now check the elements List myList = new ArrayList(me); Collections.sort(myList); List otherList = new ArrayList(other); /* Any collection of elements to be compared must implement Comparator * to avoid the other side having to implement Comparable. */ Comparator comparator = (Comparator)myList.get(0); Collections.sort(otherList, comparator); boolean result = myList.equals(otherList); if (!result) logUnequal(me, other, where + "\nCollections do not compare equal"); return result; } // Equality support methods /** Returns true if the specified objects are equal. * This is a helper method checking for identical and null * objects before delegating to the regular equals method. * @param o1 one object to be tested for equality * @param o2 the other object to be tested for equality * @param where the location of the inequality (provided by the caller) * @return true if the specified objects are equal. */ public boolean equals(Object o1, Object o2, String where) { if (o1 == o2) return true; if (o1 == null) { logUnequal(o1, o2, where + msgMeNull); return false; } if (o2 == null) { logUnequal(o1, o2, where + msgOtherNull); return false; } if (!o1.equals(o2)) { logUnequal(o1, o2, where); return false; } return true; } /** Returns true, if compare called for the specified * BigDecimal objects returns 0. Please note, two * BigDecimal instances are not equal (using equals) if their scale * differs, and this method compares the values, ignoring scale. * @param o1 one object to be tested for equality * @param o2 the other object to be tested for equality * @param where the location of the inequality (provided by the caller) * @return true if the specified BigDecimal objects are * equal. */ public boolean equals(BigDecimal o1, BigDecimal o2, String where) { if (o1 == o2) return true; if ((o1 == null) || (o2 == null)) { logUnequal(o1, o2, where); return false; } boolean result = o1.equals(o2); if (!result) logUnequal(o1, o2, where); return result; } /** Returns true, if two parameters are equal. * @param p1 one to be tested for equality * @param p2 the other to be tested for equality * @param where the location of the inequality (provided by the caller) * @return true if the parameters are equal. */ public boolean equals(boolean p1, boolean p2, String where) { if (p1 != p2) { logUnequal(Boolean.toString(p1), Boolean.toString(p2), where); return false; } return true; } /** Returns true, if two parameters are equal. * @param p1 one to be tested for equality * @param p2 the other to be tested for equality * @param where the location of the inequality (provided by the caller) * @return true if the parameters are equal. */ public boolean equals(char p1, char p2, String where) { if (p1 != p2) { logUnequal(Character.toString(p1), Character.toString(p2), where); return false; } return true; } /** Returns true, if two parameters are equal. * @param p1 one to be tested for equality * @param p2 the other to be tested for equality * @param where the location of the inequality (provided by the caller) * @return true if the parameters are equal. */ public boolean equals(byte p1, byte p2, String where) { if (p1 != p2) { logUnequal(Byte.toString(p1), Byte.toString(p2), where); return false; } return true; } /** Returns true, if two parameters are equal. * @param p1 one to be tested for equality * @param p2 the other to be tested for equality * @param where the location of the inequality (provided by the caller) * @return true if the parameters are equal. */ public boolean equals(short p1, short p2, String where) { if (p1 != p2) { logUnequal(Short.toString(p1), Short.toString(p2), where); return false; } return true; } /** Returns true, if two parameters are equal. * @param p1 one to be tested for equality * @param p2 the other to be tested for equality * @param where the location of the inequality (provided by the caller) * @return true if the parameters are equal. */ public boolean equals(int p1, int p2, String where) { if (p1 != p2) { logUnequal(Integer.toString(p1), Integer.toString(p2), where); return false; } return true; } /** Returns true, if two parameters are equal. * @param p1 one to be tested for equality * @param p2 the other to be tested for equality * @param where the location of the inequality (provided by the caller) * @return true if the parameters are equal. */ public boolean equals(long p1, long p2, String where) { if (p1 != p2) { logUnequal(Long.toString(p1), Long.toString(p2), where); return false; } return true; } /** Returns true if the specified objects are equal. * This is a helper method checking for identical and null * objects before delegating to the regular equals method. * @param o1 one object to be tested for equality * @param o2 the other object to be tested for equality * @return true if the specified objects are equal. */ public static boolean equals(Object o1, Object o2) { if (o1 == o2) { return true; } if (o1 == null || o2 == null) { return false; } return o1.equals(o2); } // Methods to support "close enough" comparison /** Returns true if the specified objects are close * enough to be considered to be equal for a deep equals * comparison. The method delegates to the method taking double * or float values if the specified objects are Float or Double * wrappers. Otherwise it delegates to equals. * @param o1 one object to be tested for close enough * @param o2 the other object to be tested for close enough * @param where the location of the inequality (provided by the caller) * @return true if the specified values are close enough. */ public boolean closeEnough(Object o1, Object o2, String where) { if (o1 == o2) return true; if ((o1 == null) || (o2 == null)) { logUnequal(o1, o2, where); return false; } boolean result = true; if ((o1 instanceof Double) && (o2 instanceof Double)) { return closeEnough(((Double)o1).doubleValue(), ((Double)o2).doubleValue(), where); } else if ((o1 instanceof Float) && (o2 instanceof Float)) { return closeEnough(((Float)o1).floatValue(), ((Float)o2).floatValue(), where); } else if ((o1 instanceof BigDecimal) && (o2 instanceof BigDecimal)) { return ((BigDecimal)o1).compareTo((BigDecimal)o2) == 0; } else { result = o1.equals(o2); } if (!result) logUnequal(o1, o2, where); return result; } /** Returns true if the specified float values are close * enough to be considered to be equal for a deep equals * comparison. Floating point values are not exact, so comparing them * using == might not return useful results. This method * checks that both double values are within some percent of each * other. * @param d1 one double to be tested for close enough * @param d2 the other double to be tested for close enough * @param where the location of the inequality (provided by the caller) * @return true if the specified values are close enough. */ public boolean closeEnough(double d1, double d2, String where) { if (d1 == d2) return true; double diff = Math.abs(d1 - d2); boolean result = diff < Math.abs((d1 + d2) * DOUBLE_EPSILON); if (!result) logUnequal(Double.toString(d1), Double.toString(d2), where); return result; } /** * Returns true if the specified float values are close * enough to be considered to be equal for a deep equals * comparison. Floating point values are not exact, so comparing them * using == might not return useful results. This method * checks that both float values are within some percent of each * other. * @param f1 one float to be tested for close enough * @param f2 the other float to be tested for close enough * @param where the location of the inequality (provided by the caller) * @return true if the specified values are close enough. */ public boolean closeEnough(float f1, float f2, String where) { if (f1 == f2) return true; float diff = Math.abs(f1 - f2); boolean result = diff < Math.abs((f1 + f2) * FLOAT_EPSILON); if (!result) logUnequal(Float.toString(f1), Float.toString(f2), where); return result; } // Methods to support compare methods as specified in Comparator /** * Compares its two arguments for order. Returns a negative integer, zero, * or a positive integer as the first argument is less than, equal to, or * greater than the second. * @param l1 the first long to be compared * @param l2 the second long to be compared * @return a negative integer, zero, or a positive integer as the first * argument is less than, equal to, or greater than the second. */ public static int compare (long l1, long l2) { return (l1 < l2 ? -1 : (l1 == l2 ? 0 : 1)); } } tck/src/java/org/apache/jdo/tck/util/GetSupportedOptions.java100664 3206 12500110374 24550 0ustarmbouschenstaff 0 0 /* * 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.util; import java.util.Collection; import java.util.Iterator; import javax.jdo.PersistenceManagerFactory; public class GetSupportedOptions { public static void main(String[] args) throws Exception { if( args.length == 0 ){ System.err.println("Must pass name of PMF as an argument"); System.exit(-1); } String PMFclassname = args[0]; Class PMFclass = Class.forName(PMFclassname); PersistenceManagerFactory pmf = (PersistenceManagerFactory) PMFclass.newInstance(); Collection options = pmf.supportedOptions(); System.out.println("Supported options are:"); Iterator iter = options.iterator(); while( iter.hasNext() ){ String val = (String) iter.next(); System.out.println(val); } } } tck/src/java/org/apache/jdo/tck/util/JDOJdk14Logger.java100664 6523 12500110374 23126 0ustarmbouschenstaff 0 0 /* * 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.util; import java.io.InputStream; import java.io.IOException; import java.security.AccessController; import java.security.PrivilegedAction; import java.util.logging.LogManager; import javax.jdo.JDOFatalUserException; import org.apache.commons.logging.impl.Jdk14Logger; /** * JDO-specific subclass of the apache commons logging Log * implementation that wraps the standard JDK 1.4 logging. * This class configures the JDK LogManager using a properties file * called logging.properties found via the CLASSPATH. * * @author Michael Bouschen * @since 1.1 * @version 1.1 */ public class JDOJdk14Logger extends Jdk14Logger { /** Logging properties file name. */ public static final String PROPERIES_FILE = "logging.properties"; /** Indicates whether JDK 1.4 logging has been configured by this class. */ private static boolean configured = false; /** * Constructor checking whether JDK 1.4 logging should be * configuared after calling super constructor. */ public JDOJdk14Logger(String name) { super(name); if (!configured) { configured = true; configureJDK14Logger(); } } /** * Configures JDK 1.4 LogManager. */ private void configureJDK14Logger() { final LogManager logManager = LogManager.getLogManager(); final ClassLoader cl = getClass().getClassLoader(); AccessController.doPrivileged(new PrivilegedAction() { public Object run () { try { InputStream config = cl.getResourceAsStream(PROPERIES_FILE); logManager.readConfiguration(config); return null; } catch (IOException ex) { throw new JDOFatalUserException( "A IOException was thrown when trying to read the " + "logging configuration file " + PROPERIES_FILE + ".", ex); } catch (SecurityException ex) { throw new JDOFatalUserException( "A SecurityException was thrown when trying to read " + "the logging configuration file " + PROPERIES_FILE + ". In order to configure JDK 1.4 logging, you must " + "grant java.util.logging.LoggingPermission(control) " + "to the codeBase containing the JDO TCK.", ex); } } }); } } tck/src/java/org/apache/jdo/tck/util/ResultSummary.java100664 17326 12500110374 23433 0ustarmbouschenstaff 0 0 /* * 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.util; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.PrintStream; import java.io.Serializable; import javax.jdo.JDOFatalException; import junit.framework.TestResult; /** * A serializable class used to store test results in a file. */ public class ResultSummary implements Serializable { private static final long serialVersionUID = 1L; /** The name of the file to store a serialized instance of this class. */ private static final String FILE_NAME_OF_RESULT_SUMMARY = "ResultSummary.ser"; /** The name of the TCK result file. */ private static final String RESULT_FILE_NAME = "TCK-results.txt"; /* The number of all configurations. */ private int nrOfTotalConfigurations = 0; /* The number of failed configurations. */ private int nrOfFailedConfigurations = 0; /* The total number of tests. */ private int totalTestCount = 0; /* The total number of failures. */ private int totalFailureCount = 0; /* The total number of errors. */ private int totalErrorCount = 0; /** * Deserializes an instance and prints that instance to * {@link System#out} and the TCK result file. * Finally deletes the file of the serialized instance. * @param args the first element contains the directory * where the test result is stored. */ public static void main(String[] args) { // print result summary String directory = args[0] + File.separator; ResultSummary resultSummary = ResultSummary.load(directory); String newLine = System.getProperty("line.separator"); String resultMessage = resultSummary != null ? resultSummary.toString() : "No tests were run."; String message = "-------" + newLine + resultMessage; appendTCKResultMessage(directory, message); System.out.println(resultMessage); System.out.println("See file '"+ directory + RESULT_FILE_NAME + "' for details."); // delete file String fileName = args[0] + File.separator + FILE_NAME_OF_RESULT_SUMMARY; File file = new File(fileName); file.delete(); } /** * Appends the given message to the TCK result file in the given directory. * @param directory the directory * @param message the message */ static void appendTCKResultMessage(String directory, String message) { String fileName = directory + RESULT_FILE_NAME; PrintStream resultStream = null; try { resultStream = new PrintStream( new FileOutputStream(fileName, true)); resultStream.println(message); } catch (FileNotFoundException e) { throw new JDOFatalException("Cannot create file "+fileName, e); } finally { if (resultStream != null) resultStream.close(); } } /** * Creates an instance for the given result object and * serializes that instance to a file in the geven directory. * @param directory the directory * @param result the result object */ static void save(String directory, TestResult result) { ResultSummary resultSummary = load(directory); if (resultSummary == null) { resultSummary = new ResultSummary(); } resultSummary.increment(result); resultSummary.save(directory); } /** * Returns a deserialized instance stored in the given direcotry. * @param directory the directory * @return the deserialized instance */ private static ResultSummary load(String directory) { ResultSummary result; String fileName = directory + FILE_NAME_OF_RESULT_SUMMARY; ObjectInputStream ois = null; try { try { ois = new ObjectInputStream(new FileInputStream(fileName)); result = (ResultSummary) ois.readObject(); } finally { if (ois != null) { ois.close(); } } } catch (FileNotFoundException e) { result = null; } catch (IOException e) { throw new JDOFatalException( "Cannot deserialize result summary in file " +fileName, e); } catch (ClassNotFoundException e) { throw new JDOFatalException( "Cannot deserialize result summary in file " +fileName, e); } return result; } /** * Increments fields of this instance based on the given result object. * @param result the result object */ private void increment(TestResult result) { this.nrOfTotalConfigurations++; this.totalTestCount += result.runCount(); if (!result.wasSuccessful()) { this.nrOfFailedConfigurations++; this.totalFailureCount += result.failureCount(); this.totalErrorCount += result.errorCount(); } } /** * Serializes this instance to a file in the given directory. * @param directory the directory */ private void save(String directory) { String fileName = directory + FILE_NAME_OF_RESULT_SUMMARY; ObjectOutputStream oos = null; try { try { oos = new ObjectOutputStream(new FileOutputStream(fileName)); oos.writeObject(this); } finally { if (oos != null) { oos.close(); } } } catch (FileNotFoundException e) { throw new JDOFatalException( "Cannot create file " + fileName, e); } catch (IOException e) { throw new JDOFatalException( "Cannot serialize result summary to file " + fileName, e); } } /** * @see Object#toString() */ public String toString() { String newLine = System.getProperty("line.separator"); StringBuffer result = new StringBuffer(); result.append("Total tests run: ").append(totalTestCount).append("."); if (this.nrOfFailedConfigurations==0) { result.append(newLine); result.append("All (").append(this.nrOfTotalConfigurations); result.append(") configurations passed."); } else { result.append(" Failures: ").append(totalFailureCount); result.append(", Errors: ").append(totalErrorCount).append("."); result.append(newLine); result.append(this.nrOfFailedConfigurations).append(" of "); result.append(this.nrOfTotalConfigurations); result.append(" configurations failed."); } return result.toString(); } } tck/src/java/org/apache/jdo/tck/util/RogueBarrier.java100664 12555 12500110374 23166 0ustarmbouschenstaff 0 0 /* * 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.util; /** * Allows a set of threads to wait for all to reach a common barrier * point. * *

    The RogueBarrier uses a rigorous breakage model: * No thread can leave a barrier point prematurely. All attempts to * interrupt an awaiting thread via an {@link InterruptedException} * are being ignored. * * @author Martin Zaun */ public class RogueBarrier { /** The internal synchronization object */ private final Object lock = new Object(); /** The number of parties needed to trip the barrier */ private final int parties; /** The current generation's trip condition (need a boolean holder) */ private boolean[] tripped = new boolean[1]; /** The number of parties still waiting for */ private int missing; /** * Creates a new RogueBarrier that will trip when the * given number of parties (threads) are waiting upon it. * * @param parties the number of threads that must invoke {@link #await} * before the barrier is tripped. * * @throws IllegalArgumentException if parties is less than 1. */ public RogueBarrier(int parties) { if (parties <= 0) { throw new IllegalArgumentException("Argument for parties must be positive."); } this.parties = parties; missing = parties; } /** * Waits until all parties have invoked await on this barrier. * * @return the arrival index of the current thread, where index * parties - 1 indicates the first to arrive and * zero indicates the last to arrive. */ public int await() { synchronized (lock) { //assert (parties > 0); //System.out.println("thread = " + Thread.currentThread().getId()); // if tripping, reset barrier and notify waiting threads final int index = --missing; if (index == 0) { tripped[0] = true; // notify current generation lock.notifyAll(); tripped = new boolean[1]; // start new generation missing = parties; return 0; } // wait until tripped final boolean[] myTripped = tripped; // my generation's condition do { try { lock.wait(); } catch (InterruptedException ie) { // swallow } } while (!myTripped[0]); return index; } } static public class Test extends Thread { static private final int parties = 1000; static private final RogueBarrier b = new RogueBarrier(parties); static private int count; public void run() { final int i0 = b.await(); if (i0 == 0) { System.out.println(" incrementing count to " + parties + " ..."); } synchronized (Test.class) { count++; } final int i1 = b.await(); synchronized (Test.class) { if (i1 == 0) { System.out.println(" count = " + count); } //assert (count == parties+1); } final int i2 = b.await(); if (i2 == 0) { System.out.println(" decrementing count to zero ..."); } synchronized (Test.class) { count--; } final int i3 = b.await(); synchronized (Test.class) { if (i3 == 0) { System.out.println(" count = " + count); } //assert (count == 0); } b.await(); } static public void test() { System.out.println("--> RogueBarrier$Test.test()"); // start threads final Thread threads[] = new Test[parties]; for (int i = 0; i < parties; i++) { threads[i] = new Test(); threads[i].start(); } // wait for all threads to finish for (int i = 0; i < parties; i++) { while (true) { try { threads[i].join(); break; } catch (InterruptedException e) { } } } System.out.println("<-- RogueBarrier$Test.test()"); } static public void main(String[] args) { Test.test(); } } } tck/src/java/org/apache/jdo/tck/util/signature/Formatter.java100664 16024 12500110374 24535 0ustarmbouschenstaff 0 0 /* * 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.util.signature; import java.lang.reflect.Member; import java.lang.reflect.Modifier; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.lang.reflect.Constructor; /** * A helper class for building exhaustive string descriptions of * class, field, constructor, or method declarations. * * @author Martin Zaun */ class Formatter { /** * Returns a string formatting an array of names as * comma-separated list. */ static public String toString(String prefix, String[] names) { final StringBuffer s = new StringBuffer(); if (names != null && names.length > 0) { s.append(prefix == null ? "" : prefix).append(names[0]); for (int i = 1; i < names.length; i++) { s.append(", ").append(names[i]); } } return s.toString(); } /** * Returns a string formatting an array of class objects as * comma-separated list of (Java) user type names. */ static public String toString(String prefix, Class[] cls) { final StringBuffer s = new StringBuffer(); if (cls != null && cls.length > 0) { String n = TypeHelper.userTypeName(cls[0].getName()); s.append(prefix == null ? "" : prefix).append(n); for (int i = 1; i < cls.length; i++) { n = TypeHelper.userTypeName(cls[i].getName()); s.append(", ").append(n); } } return s.toString(); } /** * Returns an exhaustive string description of a Field * presenting types as (Java) user type names. */ static public String toString(Field field, Object value) { final StringBuffer s = new StringBuffer(); s.append(Modifier.toString(field.getModifiers())).append(" "); s.append(TypeHelper.userTypeName(field.getType().getName())); s.append(" "); s.append(field.getName()); s.append(value == null ? "" : " = " + value); return s.toString(); } /** * Returns an combined string description of a field declaration. */ static public String toString(int mods, String type, String name, String value) { final StringBuffer s = new StringBuffer(); s.append(Modifier.toString(mods)).append(" "); s.append(type).append(" "); s.append(name); s.append(value == null ? "" : " = " + value); return s.toString(); } /** * Returns an exhaustive string description of a * Constructor presenting types as (Java) user type names. */ static public String toString(Constructor ctor) { final StringBuffer s = new StringBuffer(); s.append(Modifier.toString(ctor.getModifiers())).append(" "); s.append(ctor.getName()).append("("); s.append(toString("", ctor.getParameterTypes())).append(")"); s.append(toString(" throws ", ctor.getExceptionTypes())); return s.toString(); } /** * Returns an exhaustive string description of a Method * presenting types as (Java) user type names. */ static public String toString(Method method) { final StringBuffer s = new StringBuffer(); s.append(Modifier.toString(method.getModifiers())).append(" "); final String r = method.getReturnType().getName(); s.append(TypeHelper.userTypeName(r)).append(" "); s.append(method.getName()).append("("); s.append(toString("", method.getParameterTypes())).append(")"); s.append(toString(" throws ", method.getExceptionTypes())); if (method.getDeclaringClass().isAnnotation() && method.getDefaultValue() != null) { s.append(" default \"" + method.getDefaultValue() + "\""); } return s.toString(); } /** * Returns an combined string description of a constructor or * method declaration. */ static public String toString(int mods, String result, String name, String[] params, String[] excepts) { final StringBuffer s = new StringBuffer(); s.append(Modifier.toString(mods)).append(" "); s.append(result == null ? "" : result).append(" "); s.append(name).append("(").append(toString("", params)).append(")"); s.append(toString(" throws ", excepts)); return s.toString(); } /** * Returns an exhaustive string description of a Class * presenting types as (Java) user type names. */ static public String toString(Class cls) { final StringBuffer s = new StringBuffer(); s.append(Modifier.toString(cls.getModifiers())); s.append(cls.isInterface() ? " " : " class ").append(cls.getName()); final Class superc = cls.getSuperclass(); final Class[] interf = cls.getInterfaces(); if (cls.isInterface()) { s.append(toString(" extends ", interf)); } else { s.append(superc == null ? "" : " extends " + superc.getName()); s.append(toString(" implements ", interf)); } return s.toString(); } /** * Returns an combined string description of a class header declaration. */ static public String toString(int mods, String name, String[] ext, String[] impl) { final StringBuffer s = new StringBuffer(); s.append(Modifier.toString(mods)); final boolean isInterface = ((mods & Modifier.INTERFACE) != 0); s.append(isInterface ? " " : " class ").append(name); s.append(toString(" extends ", ext)); s.append(toString(" implements ", impl)); return s.toString(); } /** * Returns an exhaustive string description of a Member * presenting types as (Java) user type names. */ static public String toString(Member member) { final String s; if (member instanceof Field) { s = toString((Field)member, null); } else if (member instanceof Constructor) { s = toString((Constructor)member); } else if (member instanceof Method) { s = toString((Method)member); } else { s = null; } return s; } } tck/src/java/org/apache/jdo/tck/util/signature/SignatureVerifier.java100664 171356 12500110374 26261 0ustarmbouschenstaff 0 0 /* * 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.util.signature; import java.lang.reflect.Array; import java.lang.reflect.Member; import java.lang.reflect.Modifier; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.lang.reflect.Constructor; import java.util.Iterator; import java.util.Set; import java.util.List; import java.util.Arrays; import java.util.ArrayList; import java.util.TreeSet; import java.util.HashSet; import java.text.ParseException; import java.io.PrintWriter; import java.io.IOException; import java.io.File; import java.io.FileReader; import java.io.LineNumberReader; /** * Tests classes for correct signatures. * * @author Martin Zaun */ public class SignatureVerifier { /** The new-line character on this system. */ static protected final String NL = System.getProperty("line.separator"); /** All modifiers defined in java.lang.reflect.Modifier. * This field is used to filter out vm-specific modifiers * such as found in Sun's vm to identify Enum and Annotation. */ static protected final int ALL_MODIFIERS = Modifier.ABSTRACT | Modifier.FINAL | Modifier.INTERFACE | Modifier.NATIVE | Modifier.PRIVATE | Modifier.PROTECTED | Modifier.PUBLIC | Modifier.STATIC | Modifier.STRICT | Modifier.SYNCHRONIZED | Modifier.TRANSIENT | Modifier.VOLATILE; /** Pseudo modifier for annotation */ static protected final int ANNOTATION = 0x2000; /** Pseudo modifier for enum */ static protected final int ENUM = 0x4000; /** A writer for standard output. */ protected final PrintWriter log; /** Flag to print error output only. */ private boolean quiet; /** Flag to also print verbose output. */ private boolean verbose; /** The parse to be used for parsing signature descriptor files. */ protected final Parser parser = new Parser(); /** The classloader to be used for loading types. */ protected final ClassLoader classLoader; /** The currently tested Class. */ protected Class cls; /** All untested, declared members of the current class. */ protected final Set members = new HashSet(); /** Collects names of loadable classes. */ private final Set loading = new TreeSet(); /** Collects names of unloadable classes. */ private final Set notLoading = new TreeSet(); /** Counts tested features (class, constructor, fields, methods). */ private int tested; /** Counts missing members (constructor, fields, methods). */ private int missing; /** Counts non-matching features (class, constructor, fields, methods). */ private int mismatch; /** Counts matching features (class, constructor, fields, methods). */ private int matching; /** Counts public non-standard members (constructor, fields, methods). */ private int nonStandard; /** Counts other reported problems (e.g., accessing field values). */ private int otherProblems; /** Constructs a test instance. */ public SignatureVerifier(ClassLoader loader, PrintWriter log, boolean quiet, boolean verbose) { classLoader = this.getClass().getClassLoader(); this.log = log; this.quiet = quiet; this.verbose = (!quiet && verbose); } /** Constructs a test instance. */ public SignatureVerifier(PrintWriter log, boolean quiet, boolean verbose) { this(SignatureVerifier.class.getClassLoader(), log, quiet, verbose); } // ---------------------------------------------------------------------- // Local Logging Methods // ---------------------------------------------------------------------- /** Prints an error message. */ protected void logError(String msg) { log.println(msg); } /** Prints an info message. */ protected void logInfo(String msg) { if (!quiet) { log.println(msg); } } /** Prints a verbose message. */ protected void logVerbose(String msg) { if (verbose) { log.println(msg); } } // ---------------------------------------------------------------------- // Test Methods // ---------------------------------------------------------------------- /** * Tests the signature of classes (in the specified classloader) against * a list of signature descriptor files; returns with a status code. * @param descrFileNames list of signature descriptor file names * @return zero if all tests have passed and no problems were detected */ public int test(List descrFileNames) throws IOException, ParseException { // check argument if (descrFileNames == null || descrFileNames.isEmpty()) { final String m = ("ERROR: No signature descriptor file to parse."); logError(m); return -1; } // clear statistics loading.clear(); notLoading.clear(); tested = 0; missing = 0; mismatch = 0; matching = 0; nonStandard = 0; otherProblems = 0; // process descriptor files parser.parse(descrFileNames); report(); // return a positive value in case of any problems return (notLoading.size() + missing + mismatch + nonStandard + otherProblems); } /** * Reports the results of the last signature test run. */ public void report() { logInfo(""); logInfo("Signature Test Results"); logInfo("======================"); logInfo(""); logInfo(" tested features: " + tested); logInfo(""); logInfo("Successes:"); logInfo(" matching features: " + matching); logInfo(" loadable classes: " + loading.size()); logInfo(""); logInfo("Failures:"); logInfo(" missing features: " + missing); logInfo(" non-matching features: " + mismatch); logInfo(" non-standard features: " + nonStandard); logInfo(" unloadable classes: " + notLoading.size()); logInfo(" other problems: " + otherProblems); logInfo(""); } // ---------------------------------------------------------------------- // Test Logic // ---------------------------------------------------------------------- /** Handles class loading problems. */ protected void handleNotLoading(Throwable t) { notLoading.add(t.getMessage().replace('/', '.')); final String m = ("--- failed loading class;" + NL + " caught: " + t); logError(m); } /** Handles missing members. */ protected void handleMissing(String msg, String exp) { missing++; final String m = ("--- " + msg + NL + " expected: " + exp + NL + " class: " + Formatter.toString(cls)); logError(m); } /** Handles non-matching features. */ protected void handleMismatch(String msg, String exp, String fnd) { mismatch++; final String m = ("--- " + msg + NL + " expected: " + exp + NL + " found: " + fnd + NL + " class: " + Formatter.toString(cls)); logError(m); } /** Handles public non-standard features. */ protected void handleNonStandard(String msg, String fnd) { nonStandard++; final String m = ("--- " + msg + NL + " found: " + fnd + NL + " class: " + Formatter.toString(cls)); logError(m); } /** Handles other problems. */ protected void handleProblem(String msg, String exp) { otherProblems++; final String m = ("--- " + msg + NL + " expected: " + exp + NL + " class: " + Formatter.toString(cls)); logError(m); } /** Handles a perfect feature match. */ protected void handleMatch(String msg, String fnd) { matching++; final String m = ("+++ " + msg + fnd); logVerbose(m); } /** Returns the class objects for given (Java) user type names. */ protected Class[] getClasses(String[] userTypeName) { final Class[] cls = new Class[userTypeName.length]; for (int i = userTypeName.length - 1; i >= 0; i--) { cls[i] = getClass(userTypeName[i]); } return cls; } /** Returns the class object for a given (Java) user type name. */ protected Class getClass(String userTypeName) { // use helper for retrieving class objects for primitive types Class cls = TypeHelper.primitiveClass(userTypeName); if (cls != null) { return cls; } // load class try { final String r = TypeHelper.reflectionTypeName(userTypeName); cls = Class.forName(r, false, classLoader); loading.add(userTypeName); } catch (LinkageError err) { handleNotLoading(err); } catch (ClassNotFoundException ex) { handleNotLoading(ex); } return cls; } /** Check an expected value expression (the value of a static field * or the default value of an annotation method), comparing it to * the actual value from the Field or Method object. * Only supports primitive, enum, empty array of enum, empty array of * annotation, and String. * @param value the String form of the value from the signature file * @param type the type as declared in the class * @param actual the actual value * @return the description of the expected value, or null if ok * @throws java.lang.NumberFormatException */ protected String checkValue(String value, String type, Object actual) throws NumberFormatException { // note array type boolean isArray = false; if (type.endsWith("[]")) { isArray = true; type = type.substring(0, type.length() - 2); // remove { from beginning and } from end value = value.substring(1, value.length() - 1); } // first check primitive type final Object exp; Class expClass; final boolean ok; if (type.equals("byte")) { if (isArray) { ok = actual.getClass().getComponentType().equals(byte.class); } else { ok = Byte.valueOf(value).equals(actual); } } else if (type.equals("short")) { if (isArray) { ok = actual.getClass().getComponentType().equals(short.class); } else { ok = Short.valueOf(value).equals(actual); } } else if (type.equals("int")) { if (isArray) { ok = actual.getClass().getComponentType().equals(int.class); } else { ok = Integer.valueOf(value).equals(actual); } } else if (type.equals("long")) { if (isArray) { ok = actual.getClass().getComponentType().equals(long.class); } else { ok = Long.valueOf(value).equals(actual); } } else if (type.equals("float")) { if (isArray) { ok = actual.getClass().getComponentType().equals(float.class); } else { ok = Float.valueOf(value).equals(actual); } } else if (type.equals("double")) { if (isArray) { ok = actual.getClass().getComponentType().equals(double.class); } else { ok = Double.valueOf(value).equals(actual); } } else if (type.equals("char")) { if (isArray) { ok = actual.getClass().getComponentType().equals(char.class); } else { ok = new Character(value.charAt(1)).equals(actual); } // next check Class } else if (type.equals("java.lang.Class")) { if (isArray) { ok = actual.getClass().getComponentType().equals(Class.class); } else { // strip ".class" from type name int offset = value.indexOf(".class"); value = value.substring(0, offset); ok = getClass(value).equals(actual); } // next check String } else if (type.equals("java.lang.String")) { if (isArray) { ok = actual.getClass().getComponentType().equals(String.class); } else { // cut off '\"' chars at begin and end final String s; if (value.length() > 1) { s = value.substring(1, value.length() - 1); } else { s = ""; } ok = (String.valueOf(s)).equals(actual); } // now check non-java.lang annotations and enums } else { expClass = getClass(type); if (isArray) { // check if the actual component type is the right class // don't check the actual values because only empty arrays // are supported. ok = actual.getClass().getComponentType().equals(expClass); } else if (expClass.isAnnotation()) { // check whether the type isAssignableFrom the class of the actual value, // if type is an annotation. The actual value is a dynamic proxy, // so an equals comparison does not work. ok = expClass.isAssignableFrom(actual.getClass()); } else { // get the actual value which must be a static class.field Object expectedValue = null; try { // now get actual value // separate value name into class and field name int lastDot = value.lastIndexOf("."); String expectedClassName = value.substring(0, lastDot); String expectedFieldName = value.substring(lastDot + 1, value.length()); // get Class object from class name Class expectedClass = getClass(expectedClassName); if (expectedClass == null) throw new ClassNotFoundException(); // get Field object from Class and field name Field expectedField = expectedClass.getField(expectedFieldName); expectedValue = expectedField.get(null); } catch (NoSuchFieldException ex) { handleNotLoading(ex); } catch (SecurityException ex) { handleNotLoading(ex); } catch (IllegalArgumentException ex) { handleNotLoading(ex); } catch (IllegalAccessException ex) { handleNotLoading(ex); } catch (ClassNotFoundException ex) { handleNotLoading(ex); } ok = expectedValue.equals(actual); } } // return message if not ok if (ok) return null; else return value; } /** Validates a field against a prescribed signature. */ protected void checkField(int mods, String type, String name, String value) { tested++; type = TypeHelper.qualifiedUserTypeName(type); // get field final Field field; try { field = cls.getDeclaredField(name); } catch (NoSuchFieldException ex) { handleMissing( "missing field: ", Formatter.toString(mods, type, name, value)); return; } catch (LinkageError err) { handleNotLoading(err); return; } // check modifiers if (cls.isInterface()) { // fields interfaces are implicitly public, static, and final mods |= Modifier.PUBLIC; mods |= Modifier.STATIC; mods |= Modifier.FINAL; } if (mods != convertModifiers(field)) { handleMismatch( "field declaration: non-matching modifiers;", Formatter.toString(mods, type, name, null), Formatter.toString(field, null)); } // check type if (!TypeHelper.isNameMatch(type, field.getType())) { handleMismatch( "field declaration: non-matching type;", Formatter.toString(mods, type, name, null), Formatter.toString(field, null)); } // check field value if any Object actualValue = null; if (value != null) { // only support for public, static, and final fields final int m = (Modifier.PUBLIC | Modifier.STATIC | Modifier.FINAL); if ((mods & m) == 0) { handleProblem("field declaration: ignoring field value " + "definition in descriptor file;", Formatter.toString(mods, type, name, value)); } else { // compare field's expected with found value try { actualValue = field.get(null); } catch (IllegalAccessException ex) { handleProblem("field declaration: cannot access field " + "value, exception: " + ex + ";", Formatter.toString(mods, type, name, value)); } String error = checkValue(value, type, actualValue); if (error != null) { handleMismatch( "field declaration: non-matching values;", Formatter.toString(mods, type, name, error), Formatter.toString(field, "\"" + actualValue + "\"")); } } } // field OK members.remove(field); handleMatch("has field: ", Formatter.toString(field, actualValue)); } /** Validates a constructor against a prescribed signature. */ protected void checkConstructor(int mods, String[] params, String[] excepts) { tested++; params = TypeHelper.qualifiedUserTypeNames(params); excepts = TypeHelper.qualifiedUserTypeNames(excepts); // get parameter classes final Class[] prms = getClasses(params); if (prms == null) { return; } // get constructor final Constructor ctor; try { ctor = cls.getDeclaredConstructor(prms); } catch (NoSuchMethodException ex) { String name = cls.getName(); final int i = name.lastIndexOf('.'); name = (i < 0 ? name : name.substring(i)); handleMissing( "missing constructor: ", Formatter.toString(mods, null, name, params, excepts)); return; } catch (LinkageError err) { handleNotLoading(err); return; } // check modifiers if (mods != ctor.getModifiers()) { handleMismatch( "constructor declaration: non-matching modifiers;", Formatter.toString(mods, null, cls.getName(), params, excepts), Formatter.toString(ctor)); } // check exceptions if (!TypeHelper.isNameMatch(excepts, ctor.getExceptionTypes())) { handleMismatch( "method declaration: non-matching exceptions;", Formatter.toString(mods, null, cls.getName(), params, excepts), Formatter.toString(ctor)); } // constructor OK members.remove(ctor); handleMatch("has constructor: ", Formatter.toString(ctor)); } /** Validates a method against a prescribed signature. */ protected void checkMethod(int mods, String result, String name, String[] params, String[] excepts, String value) { tested++; params = TypeHelper.qualifiedUserTypeNames(params); excepts = TypeHelper.qualifiedUserTypeNames(excepts); result = TypeHelper.qualifiedUserTypeName(result); // get parameter classes final Class[] prms = getClasses(params); if (prms == null) { return; } // get method final Method method; try { method = cls.getDeclaredMethod(name, prms); } catch (NoSuchMethodException ex) { handleMissing( "missing method: ", Formatter.toString(mods, result, name, params, excepts)); return; } catch (LinkageError err) { handleNotLoading(err); return; } // check modifiers if (cls.isInterface()) { // methods in interfaces are implicitly public and abstract final mods |= Modifier.PUBLIC; mods |= Modifier.ABSTRACT; } Class resultType = getClass(result); if (resultType.isAnnotation()) { // add ANNOTATION modifier if the result type is an annotation mods |= ANNOTATION; } if (mods != convertModifiers(method)) { handleMismatch( "method declaration: non-matching modifiers;", Formatter.toString(mods, result, name, params, excepts), Formatter.toString(method)); } // check return type if (!TypeHelper.isNameMatch(result, method.getReturnType())) { handleMismatch( "method declaration: non-matching return type", Formatter.toString(mods, result, name, params, excepts), Formatter.toString(method)); } // check exceptions if (!TypeHelper.isNameMatch(excepts, method.getExceptionTypes())) { handleMismatch( "method declaration: non-matching exceptions;", Formatter.toString(mods, result, name, params, excepts), Formatter.toString(method)); } // check default value of an annotation element (method) if (value != null) { Object actualValue = null; try { actualValue = method.getDefaultValue(); } catch (Exception ex) { handleProblem("method declaration: cannot access default " + "value, exception: " + ex + ";", Formatter.toString(mods, result, name, value)); } // check value expected versus actual String wrong = checkValue(value, result, actualValue); if (wrong != null) { handleMismatch( "method declaration: non-matching default value;", Formatter.toString(mods, result, name + "() default ", wrong), Formatter.toString(method)); } } // method OK members.remove(method); handleMatch("has method: ", Formatter.toString(method)); } /** Validates a class declaration against a prescribed signature. */ protected void checkClass(int mods, String name, String[] ext, String[] impl) { logVerbose(""); logVerbose("testing " + Formatter.toString(mods, name, ext, impl)); tested++; ext = TypeHelper.qualifiedUserTypeNames(ext); impl = TypeHelper.qualifiedUserTypeNames(impl); // get and assign currently processed class cls = getClass(name); if (cls == null) { return; // can't load class } // collect all declared members of current class members.clear(); try { members.addAll(Arrays.asList(cls.getDeclaredFields())); members.addAll(Arrays.asList(cls.getDeclaredConstructors())); members.addAll(Arrays.asList(cls.getDeclaredMethods())); } catch (LinkageError err) { handleNotLoading(err); } // check modifiers final boolean isInterface = ((mods & Modifier.INTERFACE) != 0); if (isInterface) { mods |= Modifier.ABSTRACT; } if (mods != convertModifiers(cls)) { handleMismatch( "class declaration: non-matching modifiers;", Formatter.toString(mods, name, ext, impl), Formatter.toString(cls)); } // check superclass and extended/implemented interfaces final Class superclass = cls.getSuperclass(); final Class[] interfaces = cls.getInterfaces(); if (isInterface) { //assert (impl.length == 0); if (!TypeHelper.isNameMatch(ext, interfaces)) { handleMismatch( "interface declaration: non-matching interfaces;", Formatter.toString(mods, name, ext, impl), Formatter.toString(cls)); } } else { //assert (ext.length <= 1); final String s = (ext.length == 0 ? "java.lang.Object" : ext[0]); if (!TypeHelper.isNameMatch(s, superclass)) { handleMismatch( "class declaration: non-matching superclass;", Formatter.toString(mods, name, ext, impl), Formatter.toString(cls)); } if (!TypeHelper.isNameMatch(impl, interfaces)) { handleMismatch( "class declaration: non-matching interfaces;", Formatter.toString(mods, name, ext, impl), Formatter.toString(cls)); } } handleMatch("has class: ", Formatter.toString(cls)); } /** Runs checks on a class after its members have been validated. */ protected void postCheckClass() { if (cls == null) { return; // nothing to do if class couldn't be loaded } // check for public non-standard members for (Iterator i = members.iterator(); i.hasNext();) { final Member m = (Member)i.next(); if ((m.getModifiers() & Modifier.PUBLIC) != 0) { handleNonStandard("non-standard, public member;", Formatter.toString(m)); } } } /** Return modifiers for the class, but handling enum and annotation * as if they had a special modifier. * @param cls the class * @return modifiers of the class with extra flags for enum and annotation */ protected int convertModifiers(Class cls) { int result = cls.getModifiers(); // first remove extraneous stuff result &= ALL_MODIFIERS; // if enum, set pseudo enum flag if (cls.isEnum()) result |= ENUM; // if annotation, set pseudo annotation flag if (cls.isAnnotation()) result |= ANNOTATION; return result; } /** Return modifiers for the method, but handling enum and annotation * as if they had a special modifier. * @param method the method * @return modifiers of the class with extra flags for enum and annotation */ protected int convertModifiers(Method method) { int result = method.getModifiers(); // first remove extraneous stuff result &= ALL_MODIFIERS; // if enum return type, set pseudo enum flag if (method.getReturnType().isEnum()) result |= ENUM; // if annotation, set pseudo annotation flag if (method.getReturnType().isAnnotation()) result |= ANNOTATION; // if return type is an enum class, un-set FINAL modifier in all methods // because in Java 5, methods are generated as final; in Java 6, not if (method.getDeclaringClass().isEnum()) result &= ~Modifier.FINAL; return result; } /** Return modifiers for the field, but handling enum * as if it had a special modifier. * @param field the field * @return modifiers of the class with extra flag for enum */ protected int convertModifiers(Field field) { int result = field.getModifiers(); // first remove extraneous stuff result &= ALL_MODIFIERS; // if enum, set pseudo enum flag if (field.isEnumConstant()) result |= ENUM; return result; } // ---------------------------------------------------------------------- // Parser for Signature Descriptor Files // ---------------------------------------------------------------------- /** * For parsing of signature descriptor files. */ protected class Parser { /** The current descriptor file being parsed. */ private File descriptorFile; /** The line number reader for the current descriptor file. */ private LineNumberReader ir; /** A look-ahead token to be read next. */ private String nextToken; /** Returns an error message reporting an unextected end of file. */ protected String msgUnexpectedEOF() { return ("unexpected end of file at line: " + ir.getLineNumber() + ", file: " + descriptorFile.getPath()); } /** Returns an error message reporting an unextected token. */ protected String msgUnexpectedToken(String t) { return ("unexpected token: '" + t + "'" + " in line: " + ir.getLineNumber() + ", file: " + descriptorFile.getPath()); } /** Retrieves the look-ahead token to be parsed next. */ protected String getLookAhead() { final String t = nextToken; nextToken = null; return t; } /** Sets the look-ahead token to be parsed next. */ protected void setLookAhead(String t) { //assert (nextToken == null); nextToken = t; } /** * Skips any "white space" and /* style comments * and returns whether there are more * characters to be parsed. */ protected boolean skip() throws IOException { Character c; Character cnext; // Permitted states are white, commentSlashStar, commentSlashSlash String state = "white"; final Character SLASH = '/'; final Character STAR = '*'; while (true) { c = peek(); if (c == null) return false; if (state.equals("commentSlashStar") && STAR.equals(c)) { cnext = peek(); if (cnext == null) return false; if (SLASH.equals(cnext)) { state = "white"; } continue; } if (state.equals("white")) { if (SLASH.equals(c)) { cnext = peek(); if (cnext == null) return false; if (STAR.equals(cnext)) { state = "commentSlashStar"; continue; } if (SLASH.equals(cnext)) { state = "commentSlashSlash"; continue; } } if (!Character.isWhitespace(c)) { break; } } if (state.equals("commentSlashSlash") && (c == Character.LINE_SEPARATOR || c == '\n' || c == '\r')) { state = "white"; continue; } } ir.reset(); return true; } /** * Returns next char, or null if there is none */ protected Character peek() throws IOException { ir.mark(1); int i; if ((i = ir.read()) < 0) { return null; } return Character.valueOf((char)i); } /** * Scans for an (unqualified) identifier. * @return null if the next token is not an identifier */ protected String scanIdentifier() throws IOException, ParseException { // parse stored token if any String t; if ((t = getLookAhead()) != null) { if (!Character.isJavaIdentifierStart(t.charAt(0))) { setLookAhead(t); // not an identifier return null; } return t; } // parse first char if (!skip()) { throw new ParseException(msgUnexpectedEOF(), 0); } ir.mark(1); char c = (char)ir.read(); if (!Character.isJavaIdentifierStart(c)) { ir.reset(); // not start of an identifier return null; } // parse remaining chars final StringBuffer sb = new StringBuffer(); do { sb.append(c); int i; ir.mark(1); if ((i = ir.read()) < 0) break; c = (char)i; } while (Character.isJavaIdentifierPart(c)); ir.reset(); // not part of an identifier return sb.toString(); } /** * Scans for a number literal. * @return null if the next token is not a number */ protected String scanNumberLiteral() throws IOException, ParseException { // parse stored token if any String t; if ((t = getLookAhead()) != null) { if (!(t.charAt(0) == '-' || Character.isDigit(t.charAt(0)))) { setLookAhead(t); // not a number literal return null; } return t; } // parse first char if (!skip()) { throw new ParseException(msgUnexpectedEOF(), 0); } ir.mark(1); char c = (char)ir.read(); if (Character.isDigit(c)) { } else if (c == '-') { skip(); } else { ir.reset(); // not start of a number return null; } // parse remaining chars final StringBuffer sb = new StringBuffer(); do { sb.append(c); int i; ir.mark(1); if ((i = ir.read()) < 0) break; c = (char)i; } while (Character.isLetterOrDigit(c) || c == '-' || c == '.'); ir.reset(); // not part of a number return sb.toString(); } /** * Scans for a character literal. * @return null if the next token is not a character */ protected String scanCharacterLiteral() throws IOException, ParseException { // parse stored token if any String t; if ((t = getLookAhead()) != null) { if (t.charAt(0) != '\'') { setLookAhead(t); // not a char literal return null; } return t; } // parse first char if (!skip()) { throw new ParseException(msgUnexpectedEOF(), 0); } ir.mark(1); char c = (char)ir.read(); if (c != '\'') { ir.reset(); // not start of a char literal return null; } // parse remaining two chars final StringBuffer sb = new StringBuffer(); for (int j = 0; j < 2; j++) { sb.append(c); int i; if ((i = ir.read()) < 0) { throw new ParseException(msgUnexpectedEOF(), 0); } c = (char)i; } if (c != '\'') { throw new ParseException(msgUnexpectedToken(String.valueOf(c)), 0); } sb.append(c); // keep '\'' part of a char literal return sb.toString(); } /** * Scans for a string literal. * @return null if the next token is not a string */ protected String scanStringLiteral() throws IOException, ParseException { // parse stored token if any String t; if ((t = getLookAhead()) != null) { if (t.charAt(0) != '\"') { setLookAhead(t); // not a string literal return null; } return t; } // parse first char if (!skip()) { throw new ParseException(msgUnexpectedEOF(), 0); } ir.mark(1); char c = (char)ir.read(); if (c != '\"') { ir.reset(); // not start of a string literal return null; } // parse remaining chars final StringBuffer sb = new StringBuffer(); do { sb.append(c); int i; if ((i = ir.read()) < 0) { throw new ParseException(msgUnexpectedEOF(), 0); } c = (char)i; } while (c != '\"'); // not supported: nested '\"' char sequences sb.append(c); // keep '\"' part of a string literal return sb.toString(); } /** * Scans for an array literal. * Limitation: only the empty array "{}" can be scanned. * @return null if the next token is not an array */ protected String scanArrayLiteral() throws IOException, ParseException { // parse stored token if any String t; if ((t = getLookAhead()) != null) { if (t.charAt(0) != '{' || t.charAt(1) != '}') { setLookAhead(t); // not an array literal return null; } return t; } // parse first char if (!skip()) { throw new ParseException(msgUnexpectedEOF(), 0); } ir.mark(1); char c = (char)ir.read(); if (c != '{') { ir.reset(); // not start of an array literal return null; } c = (char)ir.read(); if (c != '}') { ir.reset(); // not end of an array literal return null; } return "{}"; } /** * Scans for an at-sign * @return null if the next token is not an at-sign */ protected String scanAtSign() throws IOException, ParseException { // parse stored token if any String t; if ((t = getLookAhead()) != null) { if (t.charAt(0) != '@') { setLookAhead(t); // not an at-sign return null; } return t; } // parse first char if (!skip()) { throw new ParseException(msgUnexpectedEOF(), 0); } ir.mark(1); char c = (char)ir.read(); if (c != '@') { ir.reset(); // not an at-sign return null; } return "@"; } /** * Returns the next token to be parsed. * @return never null */ protected String parseToken() throws IOException, ParseException { String t; if ((t = getLookAhead()) != null) { } else if ((t = scanIdentifier()) != null) { } else if ((t = scanNumberLiteral()) != null) { } else if ((t = scanStringLiteral()) != null) { } else if ((t = scanCharacterLiteral()) != null) { } else if ((t = scanAtSign()) != null) { } else { setLookAhead(t); // not an identifier, number, or string // next non-white char if (!skip()) { throw new ParseException(msgUnexpectedEOF(), 0); } t = String.valueOf((char)ir.read()); } //log.println("parseToken() : '" + t + "'"); return t; } /** * Parses the next token and validates it against an expected one. * @return never null */ protected String demandToken(String token) throws IOException, ParseException { final String t = parseToken(); if (!t.equals(token)) { throw new ParseException(msgUnexpectedToken(t), 0); } return t; } /** * Parses a literal. * @return null if the next token is not a literal */ protected String parseLiteral() throws IOException, ParseException { String t; if ((t = scanNumberLiteral()) != null) { } else if ((t = scanStringLiteral()) != null) { } else if ((t = scanCharacterLiteral()) != null) { } else if ((t = scanArrayLiteral()) != null) { } //log.println("parseLiteral() : '" + t + "'"); return t; } /** * Parses the next token and validates that it is a literal. * @return never null */ protected String demandLiteral() throws IOException, ParseException { final String l = parseLiteral(); if (l == null) { throw new ParseException(msgUnexpectedToken(parseToken()), 0); } return l; } /** * Parses the next token and validates that it is a constant, * which is either a literal or a static member. * @return the description of the field */ protected String demandConstant() throws IOException, ParseException { final String literal = parseLiteral(); if (literal != null) { return literal; } final String field = demandIdentifier(); if (field == null) { throw new ParseException(msgUnexpectedToken(parseToken()), 0); } return field; } /** * Parses an annotation which is an at-sign followed by a fully qualified interface name. * @return null if the next token is not an annotation, otherwise return * the annotation type name without the at-sign. */ protected String parseAnnotation() throws IOException, ParseException { String t; // parse stored token if any if ((t = getLookAhead()) != null) { if (t.charAt(0) != '@') { setLookAhead(t); // not a annotation return null; } } else if ((t = scanAtSign()) != null) { } else { return null; } final String identifier = demandIdentifier(); if (identifier == null) { throw new ParseException(msgUnexpectedToken(parseToken()), 0); } return identifier; } /** * Parses the default value specification of an annotation element and validates * that it is an element value, which is either an annotation or a constant. * @return never null */ protected String demandElementValue() throws IOException, ParseException { final String annotation = parseAnnotation(); if (annotation != null) { return annotation; } final String constant = demandConstant(); if (constant == null) { throw new ParseException(msgUnexpectedToken(parseToken()), 0); } return constant; } /** * Parses any available Java modifiers. * @return an int value with the parsed modifiers' bit set */ protected int parseModifiers() throws IOException, ParseException { int m = 0; while (true) { // parse known modifiers final String t = parseToken(); if (t.equals("abstract")) m |= Modifier.ABSTRACT; else if (t.equals("annotation")) m |= (ANNOTATION + Modifier.ABSTRACT + Modifier.INTERFACE); else if (t.equals("enum")) m |= ENUM; else if (t.equals("final")) m |= Modifier.FINAL; else if (t.equals("interface")) m |= Modifier.INTERFACE; else if (t.equals("native")) m |= Modifier.NATIVE; else if (t.equals("private")) m |= Modifier.PRIVATE; else if (t.equals("protected")) m |= Modifier.PROTECTED; else if (t.equals("public")) m |= Modifier.PUBLIC; else if (t.equals("static")) m |= Modifier.STATIC; else if (t.equals("strictfp")) m |= Modifier.STRICT; else if (t.equals("synchronized")) m |= Modifier.SYNCHRONIZED; else if (t.equals("transient")) m |= Modifier.TRANSIENT; else if (t.equals("varargs")) m |= Modifier.TRANSIENT; else if (t.equals("volatile")) m |= Modifier.VOLATILE; else { setLookAhead(t); // not a modifier break; } } //log.println("parseModifiers() : '" + Modifier.toString(m) + "'"); return m; } /** * Parses a (qualified) identifier. * @return null if the next token is not an identifier */ protected String parseIdentifier() throws IOException, ParseException { String t = scanIdentifier(); if (t != null) { // parse dot-connected identifiers final StringBuffer id = new StringBuffer(t); String tt = parseToken(); while (tt.equals(".")) { id.append("."); tt = parseIdentifier(); if (tt == null) { throw new ParseException(msgUnexpectedToken(tt), 0); } id.append(tt); tt = parseToken(); } setLookAhead(tt); // not a dot token t = id.toString(); } //log.println("parseIdentifier() : '" + t + "'"); return t; } /** * Parses the next token(s) and validates that it is an identifier. * @return never null */ protected String demandIdentifier() throws IOException, ParseException { final String id = parseIdentifier(); if (id == null) { throw new ParseException(msgUnexpectedToken(parseToken()), 0); } return id; } /** * Parses a comma-separated list of identifiers. * @return never null */ protected String[] demandIdentifierList() throws IOException, ParseException { final ArrayList ids = new ArrayList(); ids.add(demandIdentifier()); String t; while ((t = parseToken()).equals(",")) { ids.add(demandIdentifier()); } setLookAhead(t); // not an identifier return (String[])ids.toArray(new String[ids.size()]); } /** * Parses a type expression. * @return null if the next token is not a type */ protected String parseType() throws IOException, ParseException { String t = parseIdentifier(); if (t != null) { // parse array dimensions final StringBuffer type = new StringBuffer(t); while ((t = parseToken()).equals("[")) { demandToken("]"); type.append("[]"); } setLookAhead(t); // not an open bracket token t = type.toString(); } //log.println("parseType() : '" + t + "'"); return t; } /** * Parses the next token and validates that it is a type expression. * @return never null */ protected String demandType() throws IOException, ParseException { final String id = parseType(); if (id == null) { throw new ParseException(msgUnexpectedToken(parseToken()), 0); } return id; } /** * Parses a comma-separated parameter list. * @return never null */ protected String[] parseParameterList() throws IOException, ParseException { final ArrayList types = new ArrayList(); String t = parseType(); if (t != null) { types.add(t); parseIdentifier(); // optional parameter name while ((t = parseToken()).equals(",")) { types.add(demandType()); parseIdentifier(); // optional parameter name } setLookAhead(t); // not a comma token } return (String[])types.toArray(new String[types.size()]); } /** * Parses a class member declaration and provides the information * to a field, constructor, or method handler. * @return null if there's no member declaration */ protected String parseMember() throws IOException, ParseException { // parse optional modifiers, type, and member name final int mods = parseModifiers(); final String typeOrName = parseType(); if (typeOrName == null) { if (mods != 0) { throw new ParseException(msgUnexpectedEOF(), 0); } return null; // no member to parse } final String memberName = parseIdentifier(); // null if constructor // parse optional field value or parameter+exception list final String value; final String[] params; final String[] excepts; { final String tvp = parseToken(); if (tvp.equals(";")) { value = null; params = null; excepts = null; } else if (tvp.equals("=")) { // parse field value value = demandLiteral(); demandToken(";"); params = null; excepts = null; } else if (tvp.equals("(")) { // parse optional parameter and exception list params = parseParameterList(); demandToken(")"); final String tt = parseToken(); if (tt.equals("throws")) { excepts = demandIdentifierList(); demandToken(";"); value = null; } else if (tt.equals(";")) { excepts = new String[]{}; value = null; } else if (tt.equals("default")) { value = demandElementValue(); demandToken(";"); excepts = new String[]{}; } else { throw new ParseException(msgUnexpectedToken(tt), 0); } } else { throw new ParseException(msgUnexpectedToken(tvp), 0); } } // verify field, constructor, or method String name = memberName; if (params == null) { checkField(mods, typeOrName, memberName, value); } else { if (memberName == null) { name = typeOrName; checkConstructor(mods, params, excepts); } else { checkMethod(mods, typeOrName, memberName, params, excepts, value); } } //log.println("parseMember() : " + name); return name; } /** * Parses a class definition and provides the information * to a handler. * @return null if there's no class definition */ @SuppressWarnings("empty-statement") protected String parseClass() throws IOException, ParseException { // parse optional modifiers, class token, and class name if (!skip()) { return null; // eof, no class to parse } final int mods = parseModifiers(); final String tc = parseToken(); if (!tc.equals("class")) { // token 'interface' parsed as modifier setLookAhead(tc); } final String name = demandIdentifier(); // parse optional extends and implements clauses final String[] ext; final String[] impl; { String tei = parseToken(); if (tei.equals("extends")) { ext = demandIdentifierList(); tei = parseToken(); } else { ext = new String[]{}; } if (((mods & Modifier.INTERFACE) == 0) && tei.equals("implements")) { impl = demandIdentifierList(); tei = parseToken(); } else { impl = new String[]{}; } if (!tei.equals("{")) { throw new ParseException(msgUnexpectedToken(tei), 0); } } // verify class header checkClass(mods, name, ext, impl); // process members; empty-statement intentional while (parseMember() != null); demandToken("}"); // verify class postCheckClass(); //log.println("parseClass() : " + name); return name; } /** * Parses a list of signature descriptor files and processes * the class definitions. * @param descrFileNames list of signature descriptor file names */ @SuppressWarnings("empty-statement") public void parse(List descrFileNames) throws IOException, ParseException { for (Iterator i = descrFileNames.iterator(); i.hasNext();) { final String fileName = (String)i.next(); logInfo(""); logInfo("parsing descriptor file: " + fileName); try { descriptorFile = new File(fileName); ir = new LineNumberReader(new FileReader(descriptorFile)); ir.setLineNumber(1); setLookAhead(null); // empty-statement intentional while (parseClass() != null); } finally { descriptorFile = null; if (ir != null) { ir.close(); } setLookAhead(null); } } } } // ---------------------------------------------------------------------- // Stand-Alone Command-Line Interface // ---------------------------------------------------------------------- /** A writer for standard output. */ static protected PrintWriter out = new PrintWriter(System.out, true); /** Command line arguments */ static public final List descrFileNames = new ArrayList(); /** Command line option 'quiet'.*/ static private boolean optionQuiet; /** Command line option 'verbose'.*/ static private boolean optionVerbose; /** Prints the CLI usage. */ static public void printUsage() { out.println(); out.println("usage: SignatureVerifier [options] arguments"); out.println("options:"); out.println(" [-h|--help print usage and exit]"); out.println(" [-q|--quiet only print error messages]"); out.println(" [-v|--verbose print verbose messages]"); out.println("arguments:"); out.println(" ..."); out.println(); } /** Parses command line arguments. */ static public int parseArgs(String args[]) { out.println("parse main() arguments"); // parse this class' options and arguments for (int i = 0; i < args.length; i++) { if (args[i] == null) { continue; } if (args[i].equalsIgnoreCase("-h") || args[i].equalsIgnoreCase("--help")) { return -1; } if (args[i].equalsIgnoreCase("-v") || args[i].equalsIgnoreCase("--verbose")) { optionVerbose = true; continue; } if (args[i].equalsIgnoreCase("-q") || args[i].equalsIgnoreCase("--quiet")) { optionQuiet = true; continue; } if (args[i].startsWith("-")) { out.println("Usage Error: unknown option " + args[i]); return -1; } // collect argument descrFileNames.add(args[i]); } // print args if (false) { out.println("descrFileNames = {"); for (Iterator i = descrFileNames.iterator(); i.hasNext();) { out.println(" " + i.next()); } out.println(" }"); out.println("optionQuiet = " + optionQuiet); out.println("optionVerbose = " + optionVerbose); } // check args if (descrFileNames.isEmpty()) { out.println("Usage Error: Missing argument " + "..."); return -1; } return 0; } /** Runs the signature test and exits with a status code. */ static public void main(String[] args) { out.println("run SignatureVerifier ..."); if (parseArgs(args) != 0) { printUsage(); out.println("abort."); System.exit(-1); } int status = 0; try { final SignatureVerifier s = new SignatureVerifier(out, optionQuiet, optionVerbose); status = s.test(descrFileNames); } catch (IOException ex) { out.println("ERROR: exception caught: " + ex); //ex.printStackTrace(); out.println("abort."); System.exit(-2); } catch (ParseException ex) { out.println("ERROR: exception caught: " + ex); //ex.printStackTrace(); out.println("abort."); System.exit(-3); } out.println(); out.println("done."); System.exit(status); } } tck/src/java/org/apache/jdo/tck/util/signature/TypeHelper.java100664 20575 12500110374 24661 0ustarmbouschenstaff 0 0 /* * 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.util.signature; import java.lang.reflect.Member; import java.lang.reflect.Modifier; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.lang.reflect.Constructor; import java.util.Iterator; import java.util.Set; import java.util.Map; import java.util.Arrays; import java.util.HashSet; import java.util.HashMap; /** * A helper class for translating between Java user type names and * reflection type names. */ public class TypeHelper { /** Error message for format errors with a user type name. */ static private final String MSG_ILLEGAL_USR_TYPE = "illegal user type name: "; /** Error message for format errors with a reflection type name. */ static private final String MSG_ILLEGAL_RFL_TYPE = "illegal reflection type name: "; /** Throws an IllegalArgumentException if a given condition is violated. */ static private void check(boolean cond, String msg) { if (!cond) throw new IllegalArgumentException(msg); } /** Maps primitive reflection type names to (Java) user names. */ static private final Map userTypeNames = new HashMap(); /** Maps primitive (Java) user type names to reflection names. */ static private final Map reflectionTypeNames = new HashMap(); /** Maps primitive type names to class objects. */ static private final Map primitiveClasses = new HashMap(); // initializes the type maps static { userTypeNames.put("B", "byte"); userTypeNames.put("C", "char"); userTypeNames.put("D", "double"); userTypeNames.put("F", "float"); userTypeNames.put("I", "int"); userTypeNames.put("J", "long"); userTypeNames.put("S", "short"); userTypeNames.put("Z", "boolean"); userTypeNames.put("V", "void"); for (Iterator i = userTypeNames.entrySet().iterator(); i.hasNext();) { final Map.Entry e = (Map.Entry)i.next(); reflectionTypeNames.put(e.getValue(), e.getKey()); } primitiveClasses.put("byte", byte.class); primitiveClasses.put("char", char.class); primitiveClasses.put("double", double.class); primitiveClasses.put("float", float.class); primitiveClasses.put("int", int.class); primitiveClasses.put("long", long.class); primitiveClasses.put("short", short.class); primitiveClasses.put("boolean", boolean.class); primitiveClasses.put("void", void.class); } /** Returns the (Java) user name for a reflection type name. */ static public String userTypeName(String name) { check(name != null, MSG_ILLEGAL_RFL_TYPE + name); // count array dimensions from start final int n = name.length(); check(n > 0, MSG_ILLEGAL_RFL_TYPE + name); int i = 0; final StringBuffer sb = new StringBuffer(); while (name.charAt(i) == '[') { sb.append("[]"); i++; check(i < n, MSG_ILLEGAL_RFL_TYPE + name); } // no translation of primitive type names if not an array type if (i == 0) { return name; } // translate and recompose name final String s; if (name.charAt(i) == 'L') { check(name.endsWith(";"), MSG_ILLEGAL_RFL_TYPE + name); s = name.substring(i + 1, n - 1); } else { s = (String)userTypeNames.get(name.substring(i)); check(s != null, MSG_ILLEGAL_RFL_TYPE + name); } return (s + sb.toString()); } /** Returns the (Java) user names for reflection type names. */ static public String[] userTypeNames(String[] names) { final String[] u = new String[names.length]; for (int i = names.length - 1; i >= 0; i--) { u[i] = userTypeName(names[i]); } return u; } /** Returns the reflection name for a (Java) user type name. */ static public String reflectionTypeName(String name) { check(name != null, MSG_ILLEGAL_USR_TYPE + name); // count array dimensions from end final int n = name.length(); check(n > 0, MSG_ILLEGAL_USR_TYPE + name); int i = n - 1; final StringBuffer sb = new StringBuffer(); while (name.charAt(i) == ']') { i--; check(name.charAt(i) == '[', MSG_ILLEGAL_USR_TYPE + name); sb.append("["); i--; check(i >= 0, MSG_ILLEGAL_USR_TYPE + name); } // no translation of primitive type names if not an array type if (++i == n) { return name; } // translate and recompose name final String s = name.substring(0, i); final String p = (String)reflectionTypeNames.get(s); return sb.append(p != null ? p : "L" + s + ";").toString(); } /** Returns the (Java) user names for reflection type names. */ static public String[] reflectionTypeNames(String[] names) { final String[] r = new String[names.length]; for (int i = names.length - 1; i >= 0; i--) { r[i] = reflectionTypeName(names[i]); } return r; } /** * Returns the class object for a primitive type name, or * null if the name does not denote a primitive type * (class objects of primitive types cannot be loaded with reflection). */ static public Class primitiveClass(String name) { return (Class)primitiveClasses.get(name); } /** Tests if a name denotes a primitive type. */ static public boolean isPrimitive(String name) { return primitiveClasses.containsKey(name); } /** Returns the component type name of a (Java) user type name. */ static public String componentUserTypeName(String name) { check(name != null, MSG_ILLEGAL_USR_TYPE + name); final int n = name.length(); check(n > 0, MSG_ILLEGAL_USR_TYPE + name); final int i = name.indexOf('['); if (i >= 0) { check(i > 0, MSG_ILLEGAL_USR_TYPE + name); name = name.substring(0, i); } return name; } /** * Returns the java.lang.-qualified name for a given * unqualified (Java) user type name. */ static public String qualifiedUserTypeName(String name) { final String c = componentUserTypeName(name); return ((isPrimitive(c) || c.indexOf('.') >= 0) ? name : "java.lang." + name); } /** * Returns the java.lang.-qualified names for given * unqualified (Java) user type names. */ static public String[] qualifiedUserTypeNames(String[] names) { final String[] q = new String[names.length]; for (int i = names.length - 1; i >= 0; i--) { q[i] = qualifiedUserTypeName(names[i]); } return q; } /** * Compares a type name with a class objects for equality in the name. */ static public boolean isNameMatch(String userTypeName, Class cls) { final String c = (cls == null ? null : userTypeName(cls.getName())); return (userTypeName == null ? (c == null) : userTypeName.equals(c)); } /** * Compares an array of type names with an array of class objects * for set-equality in the names (i.e., ignoring order). */ static public boolean isNameMatch(String[] userTypeName, Class[] cls) { final Set s = new HashSet(Arrays.asList(userTypeName)); for (int i = cls.length - 1; i >= 0; i--) { if (!s.remove(userTypeName(cls[i].getName()))) { return false; } } return s.isEmpty(); } } tck/src/java/org/apache/jdo/tck/util/SystemCfgSummary.java100664 6410 12500110374 24031 0ustarmbouschenstaff 0 0 /* * 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.util; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.PrintStream; import java.util.Enumeration; import java.util.Properties; import javax.jdo.JDOFatalException; /** * A class to produce a text summary of system configuration information. */ public class SystemCfgSummary { /** The name of the system configuration summary file. */ private static final String SYSCFG_FILE_NAME = "system_config.txt"; private static String newLine; /** * Creates a new file containing system configuration information. * @param args the first element contains the output directory; * the second element contains the file name */ public static void main(String[] args) { String directory = args[0] + File.separator; String fileName = null; if (args[1] != null) { fileName = args[1] ; } else { fileName = SYSCFG_FILE_NAME; } newLine = System.getProperty("line.separator"); String message = getSystemInfo(); if (message == null) { message = "No system information found."; } saveSystemInfo(directory + fileName, message); } /** * Gets system information from System properties * @return System property keys and values as a String, one per line */ static String getSystemInfo() { Properties props = System.getProperties(); Enumeration propEnum = props.propertyNames(); StringBuffer sysinfo = new StringBuffer(); while (propEnum.hasMoreElements()) { String key = (String)propEnum.nextElement(); sysinfo.append(key + ": " + props.getProperty(key) + newLine); } return sysinfo.toString(); } /** * Saves the given message to the system configuration summary file * in the given directory. * @param directory the directory * @param message the message */ static void saveSystemInfo(String path, String message) { PrintStream resultStream = null; try { resultStream = new PrintStream( new FileOutputStream(path, true)); resultStream.println(message); } catch (FileNotFoundException e) { throw new JDOFatalException("Cannot create file " + path, e); } finally { if (resultStream != null) resultStream.close(); } } } tck/src/java/org/apache/jdo/tck/util/TCKFileAppender.java100664 5047 12500110374 23454 0ustarmbouschenstaff 0 0 /* * 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.util; import java.io.IOException; import org.apache.log4j.FileAppender; import org.apache.log4j.Layout; /** * TCKFileAppender appends log events to a file. * Overrides {@link FileAppender#setFile(java.lang.String, boolean, boolean, int)} * changing the given file name. * For details on the construction of the changed file name see method * {@link BatchTestRunner#changeFileName(String)}. */ public class TCKFileAppender extends FileAppender { /** * @see FileAppender#FileAppender() */ public TCKFileAppender() {} public TCKFileAppender(Layout layout, String filename, boolean append, boolean bufferedIO, int bufferSize) throws IOException { super(layout, filename, append, bufferedIO, bufferSize); } /** * @see FileAppender#FileAppender(org.apache.log4j.Layout, java.lang.String, boolean, boolean, int) */ public TCKFileAppender(Layout layout, String filename, boolean append) throws IOException { super(layout, filename, append); } /** * @see FileAppender#FileAppender(org.apache.log4j.Layout, java.lang.String) */ public TCKFileAppender(Layout layout, String filename) throws IOException { this(layout, filename, true); } /** * The given file name is changed calling method * {@link BatchTestRunner#changeFileName(String)}. * @see FileAppender#setFile(java.lang.String, boolean, boolean, int) */ public synchronized void setFile(String fileName, boolean append, boolean bufferedIO, int bufferSize) throws IOException { String changedFileName = BatchTestRunner.changeFileName(fileName); super.setFile(changedFileName, append, bufferedIO, bufferSize); } } tck/src/java/org/apache/jdo/tck/util/TCKFileHandler.java100664 24662 12500110374 23317 0ustarmbouschenstaff 0 0 /* * 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.util; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; import java.io.UnsupportedEncodingException; import java.util.logging.ErrorManager; import java.util.logging.Filter; import java.util.logging.Formatter; import java.util.logging.Handler; import java.util.logging.Level; import java.util.logging.LogManager; import java.util.logging.LogRecord; import java.util.logging.SimpleFormatter; import java.util.logging.StreamHandler; /** * A JDK1.4 logging Handler class which delegates to a file handler. * Configuration: By default each TCKFileHandler is initialized using * the following LogManager configuration properties: *

      *
    • java.util.logging.TCKFileHandler.level * specifies the default level for the Handler (defaults to Level.ALL).
    • *
    • java.util.logging.FileHandler.filter * specifies the name of a Filter class to use (defaults to no Filter).
    • *
    • java.util.logging.FileHandler.formatter * specifies the name of a Formatter class to use * (defaults to java.util.logging.SimpleFormatter).
    • *
    • java.util.logging.FileHandler.encoding * the name of the character set encoding to use * (defaults to the default platform encoding).
    • *
    • java.util.logging.FileHandler.fileName * specifies a the output file name. See below for details.
    • *
    • java.util.logging.FileHandler.append * specifies whether the FileHandler should append onto any existing files * (defaults to false).
    • *
    * For details on the construction of the file name see method * {@link BatchTestRunner#changeFileName(String)}. */ public class TCKFileHandler extends Handler { private static final String defaultName = ""; private static final boolean defaultAppend = false; private static final Level defaultLevel = Level.ALL; private static final Filter defaultFilter = null; private static final Formatter defaultFormatter = new SimpleFormatter(); private static final String defaultEncoding = null; private String fileName; private boolean append; private Level level; private Filter filter; private Formatter formatter; private String encoding; private FileHandlerDelegate delegate; /** * @see Handler#Handler() * @throws IOException * @throws SecurityException */ public TCKFileHandler() throws IOException, SecurityException { configure(); this.delegate = new FileHandlerDelegate(); OutputStream stream = new FileOutputStream(this.fileName, this.append); this.delegate.setOutputStream(stream); this.delegate.setLevel(this.level); this.delegate.setFilter(this.filter); this.delegate.setFormatter(this.formatter); this.delegate.setEncoding(this.encoding); } /** * @see Handler#publish(java.util.logging.LogRecord) */ public synchronized void publish(LogRecord record) { this.delegate.publish(record); } /** * @see Handler#close() */ public synchronized void close() throws SecurityException { this.delegate.close(); } /** * @see Handler#flush() */ public void flush() { this.delegate.flush(); } /** * @see Handler#getEncoding() */ public String getEncoding() { return this.encoding; } /** * @see Handler#getErrorManager() */ public ErrorManager getErrorManager() { return this.delegate.getErrorManager(); } /** * @see Handler#getFilter() */ public Filter getFilter() { return this.filter; } /** * @see Handler#getFormatter() */ public Formatter getFormatter() { return this.formatter; } /** * @see Handler#getLevel() */ public Level getLevel() { return this.level; } /** * @see Handler#reportError(java.lang.String, java.lang.Exception, int) */ protected void reportError(String msg, Exception ex, int code) { this.delegate.reportError(msg, ex, code); } /** * @see Handler#setErrorManager(java.util.logging.ErrorManager) */ public void setErrorManager(ErrorManager em) { this.delegate.setErrorManager(em); } /** * @see StreamHandler#isLoggable(java.util.logging.LogRecord) */ public boolean isLoggable(LogRecord record) { return this.delegate.isLoggable(record); } /** * Sets the file name fileName property. * @param fileName The fileName to set */ protected void setPattern(String fileName) { this.fileName = BatchTestRunner.changeFileName(fileName); } /** * Sets the append property. * @param append The append to set. */ protected void setAppend(boolean append) { this.append = append; } /** * Sets the level property. * @param level The level to set. */ public void setLevel(Level level) { this.level = level; if (this.delegate != null) { this.delegate.setLevel(level); } } /** * Sets the filter property. * @param filter The filter to set. */ public void setFilter(Filter filter) { this.filter = filter; if (this.delegate != null) { this.delegate.setFilter(filter); } } /** * Sets the formatter property. * @param formatter The formatter to set. */ public void setFormatter(Formatter formatter) { this.formatter = formatter; if (this.delegate != null) { this.delegate.setFormatter(formatter); } } /** * Sets the encoding property. * @param encoding The encoding to set. * @throws UnsupportedEncodingException * @throws SecurityException */ public void setEncoding(String encoding) throws SecurityException, UnsupportedEncodingException { this.encoding = encoding; if (this.delegate != null) { this.delegate.setEncoding(encoding); } } /** * Sets the delegate. * @param delegate The delegate to set. */ protected void setDelegate(FileHandlerDelegate delegate) { this.delegate = delegate; } private void configure() { LogManager manager = LogManager.getLogManager(); String className = this.getClass().getName(); setPattern(getStringProperty(manager, className + ".fileName", defaultName)); setAppend(getBooleanProperty(manager, className + ".append", defaultAppend)); setLevel(getLevelProperty(manager, className + ".level", defaultLevel)); setFilter(getFilterProperty(manager, className + ".filter", defaultFilter)); setFormatter(getFormatterProperty(manager, className + ".formatter", defaultFormatter)); try { setEncoding(getStringProperty(manager, className + ".encoding", defaultEncoding)); } catch (Exception e) { try { setEncoding(defaultEncoding); } catch (Exception ex) { } } } private boolean getBooleanProperty(LogManager manager, String property, boolean defaultValue) { boolean result = defaultValue; String value = manager.getProperty(property); if ( value != null) { try { result = Boolean.valueOf(value.trim()).booleanValue(); } catch (Exception ex) { } } return result; } private String getStringProperty(LogManager manager, String property, String defaultValue) { String result = defaultValue; String value = manager.getProperty(property); if ( value != null) { result = value.trim(); } return result; } private Level getLevelProperty(LogManager manager, String property, Level defaultValue) { Level result = defaultValue; String value = manager.getProperty(property); if (value != null) { try { result = Level.parse(value.trim()); } catch (Exception ex) { } } return result; } private Filter getFilterProperty(LogManager manager, String property, Filter defaultValue) { return (Filter) newInstanceForProperty(manager, property, defaultValue); } private Formatter getFormatterProperty(LogManager manager, String property, Formatter defaultValue) { return (Formatter) newInstanceForProperty(manager, property, defaultValue); } private Object newInstanceForProperty(LogManager manager, String property, Object defaultValue) { Object result = defaultValue; String value = manager.getProperty(property); if (value != null) { try { Class clazz = ClassLoader.getSystemClassLoader().loadClass(value); result = clazz.newInstance(); } catch (Exception ex) { } } return result; } /** * This class has been defined to make method * {@link Handler#reportError(java.lang.String, java.lang.Exception, int)} * accessible in the outer class. */ private static class FileHandlerDelegate extends StreamHandler { protected void setOutputStream(OutputStream out) { super.setOutputStream(out); } /** * @see Handler#reportError(java.lang.String, java.lang.Exception, int) */ protected void reportError(String msg, Exception ex, int code) { super.reportError(msg, ex, code); } } } tck/src/java/org/apache/jdo/tck/util/TestSelector.java100664 23127 12500110374 23213 0ustarmbouschenstaff 0 0 /* * 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.util; import java.awt.Cursor; import java.awt.Dimension; import java.awt.Frame; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.Insets; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.util.ArrayList; import java.util.Collections; import java.util.Enumeration; import java.util.Iterator; import java.util.List; import java.util.Vector; import javax.swing.JButton; import javax.swing.JDialog; import javax.swing.JLabel; import javax.swing.JList; import javax.swing.JScrollPane; import javax.swing.JTree; import javax.swing.event.TreeSelectionEvent; import javax.swing.event.TreeSelectionListener; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultTreeModel; import javax.swing.tree.TreeModel; import javax.swing.tree.TreeNode; import javax.swing.tree.TreePath; import junit.runner.TestCollector; /** * A test class selector. A simple dialog to pick the name of a test suite. */ public class TestSelector extends JDialog { private JButton fCancel; private JButton fOk; private JList fList; private JTree fTree; private JScrollPane fScrolledList; private JLabel fDescription; private List fSelectedItems; /** */ public TestSelector(Frame parent, TestCollector testCollector) { super(parent, true); setSize(500, 500); // setLocationRelativeTo only exists in 1.4 try { setLocationRelativeTo(parent); } catch (NoSuchMethodError e) { centerWindow(); } setTitle("Test Selector"); Vector list = null; try { parent.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); list= createTestList(testCollector); } finally { parent.setCursor(Cursor.getDefaultCursor()); } fTree = new JTree(createTreeModel(list)); //fTree.getSelectionModel().setSelectionMode( // TreeSelectionModel.SINGLE_TREE_SELECTION); fScrolledList= new JScrollPane(fTree); fCancel= new JButton("Cancel"); fDescription= new JLabel("Select the Test class:"); fOk= new JButton("OK"); fOk.setEnabled(false); getRootPane().setDefaultButton(fOk); defineLayout(); addListeners(); } /** */ public boolean isEmpty() { return ((TreeNode)fTree.getModel().getRoot()).getChildCount() == 0; } /** */ public List getSelectedItems() { return fSelectedItems; } /** */ public void checkEnableOK(TreeSelectionEvent e) { boolean enabled = false; TreePath[] paths = fTree.getSelectionPaths(); if (paths != null) { for (int i = 0; i < paths.length; i++) { if (((TreeNode)paths[i].getLastPathComponent()).isLeaf()) { enabled = true; break; } } } fOk.setEnabled(enabled); } /** */ public void okSelected() { List classNames = new ArrayList(); TreePath[] paths = fTree.getSelectionPaths(); if (paths != null) { for (int i = 0; i < paths.length; i++) { Object selected = paths[i].getLastPathComponent(); if (selected instanceof ClassNameTreeNode) { classNames.add(((ClassNameTreeNode)selected).getClassName()); } } } fSelectedItems = classNames; dispose(); } /** */ private TreeModel createTreeModel(List classNames) { DefaultMutableTreeNode root = new DefaultMutableTreeNode("Test Classes"); TreeModel model = new DefaultTreeModel(root); String currentPackageName = null; DefaultMutableTreeNode currentPackageNode = null; DefaultMutableTreeNode parent = root; for (Iterator i = classNames.iterator(); i.hasNext();) { String className = (String)i.next(); int index = className.lastIndexOf('.'); String packageName = (index >= 0) ? className.substring(0, index) : ""; if ((currentPackageName == null) || !currentPackageName.equals(packageName)) { currentPackageName = packageName; currentPackageNode = new DefaultMutableTreeNode(currentPackageName); parent.add(currentPackageNode); } currentPackageNode.add(new ClassNameTreeNode(className)); } return model; } /** */ private void centerWindow() { Dimension paneSize = getSize(); Dimension screenSize = getToolkit().getScreenSize(); setLocation((screenSize.width-paneSize.width)/2, (screenSize.height-paneSize.height)/2); } /** */ private void addListeners() { fCancel.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { dispose(); } }); fOk.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { okSelected(); } }); fTree.addTreeSelectionListener( new TreeSelectionListener() { public void valueChanged(TreeSelectionEvent e) { checkEnableOK(e); } }); fTree.addMouseListener( new MouseAdapter () { public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2) { okSelected(); } } }); addWindowListener( new WindowAdapter() { public void windowClosing(WindowEvent e) { dispose(); } } ); } /** */ private void defineLayout() { getContentPane().setLayout(new GridBagLayout()); GridBagConstraints labelConstraints = new GridBagConstraints(); labelConstraints.gridx= 0; labelConstraints.gridy= 0; labelConstraints.gridwidth= 1; labelConstraints.gridheight= 1; labelConstraints.fill= GridBagConstraints.BOTH; labelConstraints.anchor= GridBagConstraints.WEST; labelConstraints.weightx= 1.0; labelConstraints.weighty= 0.0; labelConstraints.insets= new Insets(8, 8, 0, 8); getContentPane().add(fDescription, labelConstraints); GridBagConstraints listConstraints = new GridBagConstraints(); listConstraints.gridx= 0; listConstraints.gridy= 1; listConstraints.gridwidth= 4; listConstraints.gridheight= 1; listConstraints.fill= GridBagConstraints.BOTH; listConstraints.anchor= GridBagConstraints.CENTER; listConstraints.weightx= 1.0; listConstraints.weighty= 1.0; listConstraints.insets= new Insets(8, 8, 8, 8); getContentPane().add(fScrolledList, listConstraints); GridBagConstraints okConstraints= new GridBagConstraints(); okConstraints.gridx= 2; okConstraints.gridy= 2; okConstraints.gridwidth= 1; okConstraints.gridheight= 1; okConstraints.anchor= java.awt.GridBagConstraints.EAST; okConstraints.insets= new Insets(0, 8, 8, 8); getContentPane().add(fOk, okConstraints); GridBagConstraints cancelConstraints = new GridBagConstraints(); cancelConstraints.gridx= 3; cancelConstraints.gridy= 2; cancelConstraints.gridwidth= 1; cancelConstraints.gridheight= 1; cancelConstraints.anchor= java.awt.GridBagConstraints.EAST; cancelConstraints.insets= new Insets(0, 8, 8, 8); getContentPane().add(fCancel, cancelConstraints); } /** */ private Vector createTestList(TestCollector collector) { Enumeration each= collector.collectTests(); Vector classNames = new Vector(300); while(each.hasMoreElements()) { classNames.add(each.nextElement()); } Collections.sort(classNames); return classNames; } /** */ private static class ClassNameTreeNode extends DefaultMutableTreeNode { private String className; /** */ public ClassNameTreeNode (String className) { this.className = className; } /** */ public String toString() { if (className == null) return ""; int index = className.lastIndexOf('.'); return (index >= 0) ? className.substring(index+1) : className; } /** */ public String getClassName() { return className; } } } tck/src/java/org/apache/jdo/tck/util/ThreadExceptionHandler.java100664 4556 12500110374 25144 0ustarmbouschenstaff 0 0 /* * 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.util; import java.util.HashMap; import java.util.Map; import java.util.Set; /** * This class extends java.lang.ThreadGroup and stores any uncaught * exception of threads from this ThreadGroup for later retrieval. * * @author Michael Bouschen */ public class ThreadExceptionHandler extends ThreadGroup { /** * Map of uncaught exceptions. The thread is the key and the uncaught * Throwable is the value in the map. */ private final Map uncaughtExceptions = new HashMap(); /** Constructor. */ public ThreadExceptionHandler() { super("ThreadExceptionHandler"); } /** Called by the Java Virtual Machine when a thread in this thread * group stops because of an uncaught exception. This implementation * stores the uncaught exception in a map for later retrieval. */ public void uncaughtException(Thread t, Throwable e) { uncaughtExceptions.put(t, e); } /** Returns an uncaught exception for the specified thread. */ public Throwable getUncaughtException(Thread t) { return (Throwable)uncaughtExceptions.get(t); } /** * Returns all uncaught exceptions stored in this ThreadGroup. * Each element in the returned set is a Map.Entry with the * thread as the key and the uncaught Throwable is the value. */ public Set getAllUncaughtExceptions() { return uncaughtExceptions.entrySet(); } /** * Clears all exceptions in this ThreadGroup. */ public void clear() { uncaughtExceptions.clear(); } } tck/src/jdo/applicationidentity/org/apache/jdo/tck/api/instancecallbacks/package.jdo100664 3757 12500110371 31155 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/package.jdo100664 6170 12500110372 24731 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/building/package.jdo100664 2547 12500110372 27134 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/company/jdoTest.properties100664 14417 12500110371 30464 0ustarmbouschenstaff 0 0 # # 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. # # Classnames can have the following attributes: # jdo:{persistent|transactional} # super: # oid: # access: {public|protected|package|private} # Fieldnames can have the following attributes: # type: # access: {public|protected|package|private} # jdo:{persistent|transactional|transient} # annotation:{key|dfg|mediated} org.apache.jdo.tck.pc.company.Address=jdo:persistent,oid:org.apache.jdo.tck.pc.company.Address$Oid org.apache.jdo.tck.pc.company.Address#addrid=jdo:persistent,annotation:key org.apache.jdo.tck.pc.company.Address#city=jdo:persistent,annotation:dfg org.apache.jdo.tck.pc.company.Address#state=jdo:persistent,annotation:dfg org.apache.jdo.tck.pc.company.Address#street=jdo:persistent,annotation:dfg org.apache.jdo.tck.pc.company.Address#zipcode=jdo:persistent,annotation:dfg org.apache.jdo.tck.pc.company.Address#country=jdo:persistent,annotation:dfg org.apache.jdo.tck.pc.company.Company=jdo:persistent,oid:org.apache.jdo.tck.pc.company.Company$Oid org.apache.jdo.tck.pc.company.Company#address=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.company.Company#companyid=jdo:persistent,annotation:key org.apache.jdo.tck.pc.company.Company#departments=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.company.Company#founded=jdo:persistent,annotation:dfg org.apache.jdo.tck.pc.company.Company#name=jdo:persistent,annotation:dfg org.apache.jdo.tck.pc.company.DentalInsurance=jdo:persistent,super:org.apache.jdo.tck.pc.company.Insurance org.apache.jdo.tck.pc.company.DentalInsurance#lifetimeOrthoBenefit=jdo:persistent,annotation:dfg org.apache.jdo.tck.pc.company.Department=jdo:persistent,oid:org.apache.jdo.tck.pc.company.Department$Oid org.apache.jdo.tck.pc.company.Department#deptid=jdo:persistent,annotation:key org.apache.jdo.tck.pc.company.Department#name=jdo:persistent,annotation:dfg org.apache.jdo.tck.pc.company.Department#employees=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.company.Department#fundedEmps=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.company.Department#company=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.company.Department#employeeOfTheMonth=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.company.Employee=jdo:persistent,super:org.apache.jdo.tck.pc.company.Person org.apache.jdo.tck.pc.company.Employee#dentalInsurance=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.company.Employee#department=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.company.Employee#fundingDept=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.company.Employee#hiredate=jdo:persistent,annotation:dfg org.apache.jdo.tck.pc.company.Employee#hradvisees=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.company.Employee#hradvisor=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.company.Employee#manager=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.company.Employee#medicalInsurance=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.company.Employee#mentor=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.company.Employee#projects=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.company.Employee#protege=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.company.Employee#reviewedProjects=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.company.Employee#team=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.company.Employee#weeklyhours=jdo:persistent,annotation:dfg org.apache.jdo.tck.pc.company.FullTimeEmployee=jdo:persistent,super:org.apache.jdo.tck.pc.company.Employee org.apache.jdo.tck.pc.company.FullTimeEmployee#salary=jdo:persistent,annotation:dfg org.apache.jdo.tck.pc.company.Insurance=jdo:persistent,oid:org.apache.jdo.tck.pc.company.Insurance$Oid org.apache.jdo.tck.pc.company.Insurance#insid=jdo:persistent,annotation:key org.apache.jdo.tck.pc.company.Insurance#carrier=jdo:persistent,annotation:dfg org.apache.jdo.tck.pc.company.Insurance#employee=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.company.MedicalInsurance=jdo:persistent,super:org.apache.jdo.tck.pc.company.Insurance org.apache.jdo.tck.pc.company.MedicalInsurance#planType=jdo:persistent,annotation:dfg org.apache.jdo.tck.pc.company.PartTimeEmployee=jdo:persistent,super:org.apache.jdo.tck.pc.company.Employee org.apache.jdo.tck.pc.company.PartTimeEmployee#wage=jdo:persistent,annotation:dfg org.apache.jdo.tck.pc.company.Person=jdo:persistent,oid:org.apache.jdo.tck.pc.company.Person$Oid org.apache.jdo.tck.pc.company.Person#address=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.company.Person#birthdate=jdo:persistent,annotation:dfg org.apache.jdo.tck.pc.company.Person#firstname=jdo:persistent,annotation:dfg 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.Project=jdo:persistent,oid:org.apache.jdo.tck.pc.company.Project$Oid org.apache.jdo.tck.pc.company.Project#budget=jdo:persistent,annotation:dfg org.apache.jdo.tck.pc.company.Project#members=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.company.Project#name=jdo:persistent,annotation:dfg org.apache.jdo.tck.pc.company.Project#projid=jdo:persistent,annotation:key org.apache.jdo.tck.pc.company.Project#reviewers=jdo:persistent,annotation:mediated tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/company/package.jdo100664 33123 12500110371 27016 0ustarmbouschenstaff 0 0 SELECT firstname, lastname INTO org.apache.jdo.tck.query.result.classes.FullName FROM org.apache.jdo.tck.pc.company.Person SELECT UNIQUE firstname, lastname INTO org.apache.jdo.tck.query.result.classes.FullName FROM org.apache.jdo.tck.pc.company.Person WHERE firstname == 'emp1First' SELECT UNIQUE firstname, lastname INTO org.apache.jdo.tck.query.result.classes.FullName FROM org.apache.jdo.tck.pc.company.Person SELECT firstname, lastname FROM org.apache.jdo.tck.pc.company.Person SELECT FROM org.apache.jdo.tck.pc.company.Person WHERE personid > 1 SELECT FROM org.apache.jdo.tck.pc.company.Person SeLeCt FrOm org.apache.jdo.tck.pc.company.Person SELECT firstname, lastname INTO org.apache.jdo.tck.query.result.classes.FullName FROM org.apache.jdo.tck.pc.company.PIPerson SELECT UNIQUE firstname, lastname INTO org.apache.jdo.tck.query.result.classes.FullName FROM org.apache.jdo.tck.pc.company.PIPerson WHERE firstname == 'emp1First' SELECT UNIQUE firstname, lastname INTO org.apache.jdo.tck.query.result.classes.FullName FROM org.apache.jdo.tck.pc.company.PIPerson SELECT firstname, lastname FROM org.apache.jdo.tck.pc.company.PIPerson SELECT FROM org.apache.jdo.tck.pc.company.PIPerson WHERE personid > 1 SELECT FROM org.apache.jdo.tck.pc.company.PIPerson SeLeCt FrOm org.apache.jdo.tck.pc.company.PIPerson tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/company/Person.jdoquery100664 2603 12500110371 27736 0ustarmbouschenstaff 0 0 SELECT FROM org.apache.jdo.tck.pc.company.Person WHERE personid > 3 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/companyListWithoutJoin/package.jdo100664 11462 12500110371 32060 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/companyMapWithoutJoin/package.jdo100664 11525 12500110371 31662 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/AllTypes.jdo100664 2450 12500110371 27641 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/ArrayCollections.jdo100664 11044 12500110371 31400 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/ArrayListCollections.jdo100664 16406 12500110371 32243 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/CollectionCollections.jdo100664 15662 12500110371 32427 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfBigDecimal.jdo100664 20325 12500110371 31521 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfBigInteger.jdo100664 20325 12500110371 31560 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfBoolean.jdo100664 17657 12500110371 31136 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfByte.jdo100664 17211 12500110371 30444 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfCharacter.jdo100664 20163 12500110371 31435 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfDate.jdo100664 17211 12500110371 30416 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfDouble.jdo100664 17515 12500110371 30762 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfFloat.jdo100664 17353 12500110371 30615 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfInteger.jdo100664 17657 12500110371 31154 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfLocale.jdo100664 17515 12500110371 30747 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfLong.jdo100664 17211 12500110371 30440 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfObject.jdo100664 34335 12500110371 30755 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfPrimitiveboolean.jdo100664 17700 12500110371 33054 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfPrimitivebyte.jdo100664 17233 12500110371 32401 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfPrimitivechar.jdo100664 17233 12500110371 32353 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfPrimitivedouble.jdo100664 17537 12500110371 32717 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfPrimitivefloat.jdo100664 17375 12500110371 32552 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfPrimitiveint.jdo100664 17071 12500110371 32230 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfPrimitivelong.jdo100664 17233 12500110371 32375 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfPrimitiveshort.jdo100664 17375 12500110371 32604 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfShort.jdo100664 17353 12500110371 30647 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfSimpleClass.jdo100664 24710 12500110371 31762 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfSimpleEnum.jdo100664 20325 12500110371 31617 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfSimpleInterface.jdo100664 22417 12500110371 32617 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfString.jdo100664 17515 12500110371 31016 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/HashMapStringKeyCollections.jdo100664 33310 12500110371 33503 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/HashMapStringValueCollections.jdo100664 31645 12500110371 34040 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/HashSetCollections.jdo100664 15404 12500110371 31665 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/HashtableStringKeyCollections.jdo100664 33623 12500110371 34064 0ustarmbouschenstaff 0 0 ././@LongLink100644 0 0 145 12500111677 10253 Lustar 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/HashtableStringValueCollections.jdotck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/HashtableStringValueCollections.jdo100664 32137 12500110371 34407 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/LinkedListCollections.jdo100664 15662 12500110371 32376 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/ListCollections.jdo100664 15244 12500110371 31243 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/MapStringKeyCollections.jdo100664 35677 12500110371 32721 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/MapStringValueCollections.jdo100664 34311 12500110371 33225 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/SetCollections.jdo100664 15117 12500110371 31062 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/TreeMapStringKeyCollections.jdo100664 33313 12500110371 33522 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/TreeMapStringValueCollections.jdo100664 31645 12500110371 34054 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/TreeSetCollections.jdo100664 14100 12500110371 31671 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/VectorCollections.jdo100664 15376 12500110371 31600 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/inheritance/jdoTest.properties100664 14660 12500110371 31307 0ustarmbouschenstaff 0 0 # # 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. # # Classnames can have the following attributes: # jdo:{persistent|transactional} # super: # oid: # access: {public|protected|package|private} # Fieldnames can have the following attributes: # type: # access: {public|protected|package|private} # jdo:{persistent|transactional|transient} # annotation:{key|dfg|mediated} org.apache.jdo.tck.pc.inheritance.AllPersist=jdo:persistent,oid:org.apache.jdo.tck.pc.inheritance.AllPersist$Id org.apache.jdo.tck.pc.inheritance.AllPersist#intA=jdo:transient org.apache.jdo.tck.pc.inheritance.AllPersist#doubleB=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.inheritance.AllPersist#intB=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.inheritance.AllPersist#keyValue=jdo:persistent,annotation:key org.apache.jdo.tck.pc.inheritance.AllPersist2=jdo:persistent,super:org.apache.jdo.tck.pc.inheritance.AllPersist org.apache.jdo.tck.pc.inheritance.AllPersist2#floatE=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.inheritance.AllPersist2#charC=jdo:transient org.apache.jdo.tck.pc.inheritance.AllPersist2#booleanD=jdo:transient org.apache.jdo.tck.pc.inheritance.AllPersist3=jdo:persistent,super:org.apache.jdo.tck.pc.inheritance.AllPersist2 org.apache.jdo.tck.pc.inheritance.AllPersist3#secondObj=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.inheritance.AllPersist3#shortF=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.inheritance.AllPersist3#thirdObj=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.inheritance.AllPersist4=jdo:persistent,super:org.apache.jdo.tck.pc.inheritance.AllPersist3 org.apache.jdo.tck.pc.inheritance.AllPersist4#shortG=jdo:transient org.apache.jdo.tck.pc.inheritance.AllPersist4#intH=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.inheritance.FieldSameName=jdo:persistent,oid:org.apache.jdo.tck.pc.inheritance.FieldSameName$Id org.apache.jdo.tck.pc.inheritance.FieldSameName#keyValue=jdo:persistent,annotation:key org.apache.jdo.tck.pc.inheritance.FieldSameName#n1=jdo:transient org.apache.jdo.tck.pc.inheritance.FieldSameName#n2=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.inheritance.FieldSameName#n3=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.inheritance.FieldSameName2=jdo:persistent,super:org.apache.jdo.tck.pc.inheritance.FieldSameName org.apache.jdo.tck.pc.inheritance.FieldSameName2#n1=jdo:transient org.apache.jdo.tck.pc.inheritance.FieldSameName2#n2=jdo:transient org.apache.jdo.tck.pc.inheritance.FieldSameName2#n3=jdo:transactional,annotation:mediated org.apache.jdo.tck.pc.inheritance.FieldSameName3=jdo:persistent,super:org.apache.jdo.tck.pc.inheritance.FieldSameName2 org.apache.jdo.tck.pc.inheritance.FieldSameName3#n1=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.inheritance.FieldSameName3#n2=jdo:transactional,annotation:mediated org.apache.jdo.tck.pc.inheritance.FieldSameName3#n3=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.inheritance.FieldSameName4=jdo:persistent,super:org.apache.jdo.tck.pc.inheritance.FieldSameName3 org.apache.jdo.tck.pc.inheritance.FieldSameName4#n1=jdo:transient org.apache.jdo.tck.pc.inheritance.FieldSameName4#n2=jdo:transient org.apache.jdo.tck.pc.inheritance.FieldSameName4#n3=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.inheritance.TopNonPersistB=jdo:persistent,oid:org.apache.jdo.tck.pc.inheritance.TopNonPersistB$Id org.apache.jdo.tck.pc.inheritance.TopNonPersistB#doubleB=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.inheritance.TopNonPersistB#intB=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.inheritance.TopNonPersistB#keyValue=jdo:persistent,annotation:key org.apache.jdo.tck.pc.inheritance.TopNonPersistE=jdo:persistent,super:org.apache.jdo.tck.pc.inheritance.TopNonPersistB org.apache.jdo.tck.pc.inheritance.TopNonPersistE#floatE=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.inheritance.TopNonPersistF=jdo:persistent,super:org.apache.jdo.tck.pc.inheritance.TopNonPersistE org.apache.jdo.tck.pc.inheritance.TopNonPersistF#secondObj=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.inheritance.TopNonPersistF#shortF=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.inheritance.TopNonPersistF#thirdObj=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.inheritance.TopNonPersistH=jdo:persistent,super:org.apache.jdo.tck.pc.inheritance.TopNonPersistF org.apache.jdo.tck.pc.inheritance.TopNonPersistH#intH=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.inheritance.TopPersist=jdo:persistent,oid:org.apache.jdo.tck.pc.inheritance.TopPersist$Id org.apache.jdo.tck.pc.inheritance.TopPersist#intA=jdo:transient org.apache.jdo.tck.pc.inheritance.TopPersist#doubleB=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.inheritance.TopPersist#intB=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.inheritance.TopPersist#keyValue=jdo:persistent,annotation:key org.apache.jdo.tck.pc.inheritance.TopPersistE=jdo:persistent,super:org.apache.jdo.tck.pc.inheritance.TopPersist org.apache.jdo.tck.pc.inheritance.TopPersistE#floatE=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.inheritance.TopPersistF=jdo:persistent,super:org.apache.jdo.tck.pc.inheritance.TopPersistE org.apache.jdo.tck.pc.inheritance.TopPersistF#secondObj=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.inheritance.TopPersistF#shortF=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.inheritance.TopPersistF#thirdObj=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.inheritance.TopPersistH=jdo:persistent,super:org.apache.jdo.tck.pc.inheritance.TopPersistF org.apache.jdo.tck.pc.inheritance.TopPersistH#intH=jdo:persistent,annotation:mediated tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/inheritance/package.jdo100664 14327 12500110371 27646 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/instancecallbacks/jdoTest.properties100664 6617 12500110372 32446 0ustarmbouschenstaff 0 0 # # 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. # # Classnames can have the following attributes: # jdo:{persistent|transactional} # super: # oid: # access: {public|protected|package|private} # Fieldnames can have the following attributes: # type: # access: {public|protected|package|private} # jdo:{persistent|transactional|transient} # annotation:{key|dfg|mediated} org.apache.jdo.tck.pc.instancecallbacks.InstanceCallbackClass=jdo:persistent,oid:org.apache.jdo.tck.pc.instancecallbacks.InstanceCallbackClass$KeyClass org.apache.jdo.tck.pc.instancecallbacks.InstanceCallbackClass#keyValue=jdo:persistent,annotation:key org.apache.jdo.tck.pc.instancecallbacks.InstanceCallbackClass#name=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.instancecallbacks.InstanceCallbackClass#timeStamp=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.instancecallbacks.InstanceCallbackClass#nextObj=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.instancecallbacks.InstanceCallbackClass#children=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.instancecallbacks.InstanceCallbackClass#intValue=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.instancecallbacks.InstanceCallbackClass#doubleValue=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.instancecallbacks.InstanceCallbackClass#childToDelete=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.instancecallbacks.InstanceCallbackClass#charValue=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.instancecallbacks.InstanceCallbackNonPersistFdsClass=jdo:persistent,oid:org.apache.jdo.tck.pc.instancecallbacks.InstanceCallbackNonPersistFdsClass$KeyClass org.apache.jdo.tck.pc.instancecallbacks.InstanceCallbackNonPersistFdsClass#i=jdo:transient org.apache.jdo.tck.pc.instancecallbacks.InstanceCallbackNonPersistFdsClass#c=jdo:transient org.apache.jdo.tck.pc.instancecallbacks.InstanceCallbackNonPersistFdsClass#d=jdo:transactional,annotation:mediated org.apache.jdo.tck.pc.instancecallbacks.InstanceCallbackNonPersistFdsClass#s=jdo:transactional,annotation:mediated org.apache.jdo.tck.pc.instancecallbacks.InstanceCallbackNonPersistFdsClass#children=jdo:transient org.apache.jdo.tck.pc.instancecallbacks.InstanceCallbackNonPersistFdsClass#loadTime=jdo:transient org.apache.jdo.tck.pc.instancecallbacks.InstanceCallbackNonPersistFdsClass#keyValue=jdo:persistent,annotation:key org.apache.jdo.tck.pc.instancecallbacks.InstanceCallbackNonPersistFdsClass#floatValue=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.instancecallbacks.InstanceCallbackNonPersistFdsClass#intValue=jdo:persistent,annotation:mediated tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/instancecallbacks/package.jdo100664 4401 12500110372 30772 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/lifecycle/StateTransitionObj.jdo100664 2523 12500110372 31463 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/mylib/package.jdo100664 4774 12500110372 26457 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/mylib/PCClass.jdo100664 3341 12500110372 26341 0ustarmbouschenstaff 0 0 SELECT FROM org.apache.jdo.tck.pc.mylib.PCClass tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/newInstance/AAddress.jdo100664 3551 12500110372 27704 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/newInstance/AAddress_bad.jdo100664 3555 12500110372 30516 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/newInstance/Address.jdo100664 2636 12500110372 27606 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/newInstance/Address_bad.jdo100664 2642 12500110372 30411 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/newInstance/IAddress.jdo100664 3506 12500110372 27714 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/newInstance/IAddress_bad.jdo100664 3512 12500110372 30517 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/order/package.jdo100664 3547 12500110371 26452 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/query/package.jdo100664 3502 12500110371 26473 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/shoppingcart/package.jdo100664 5267 12500110372 30042 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/singlefieldidentity/package.jdo100664 7253 12500110372 31375 0ustarmbouschenstaff 0 0 tck/src/jdo/applicationidentity/package.jdo100664 2626 12500110371 21365 0ustarmbouschenstaff 0 0 SELECT FROM org.apache.jdo.tck.pc.company.Person SELECT FIRSTNAME, LASTNAME FROM applicationidentity0.persons tck/src/jdo/datastoreidentity/org/apache/jdo/tck/api/instancecallbacks/package.jdo100664 4177 12500110372 30636 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/package.jdo100664 5766 12500110372 24426 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/building/package.jdo100664 2524 12500110372 26612 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/company/jdoTest.properties100664 13767 12500110372 30157 0ustarmbouschenstaff 0 0 # # 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. # # Classnames can have the following attributes: # jdo:{persistent|transactional} # super: # oid: # access: {public|protected|package|private} # Fieldnames can have the following attributes: # type: # access: {public|protected|package|private} # jdo:{persistent|transactional|transient} # annotation:{key|dfg|mediated} org.apache.jdo.tck.pc.company.Address=jdo:persistent org.apache.jdo.tck.pc.company.Address#addrid=jdo:persistent,annotation:dfg org.apache.jdo.tck.pc.company.Address#city=jdo:persistent,annotation:dfg org.apache.jdo.tck.pc.company.Address#state=jdo:persistent,annotation:dfg org.apache.jdo.tck.pc.company.Address#street=jdo:persistent,annotation:dfg org.apache.jdo.tck.pc.company.Address#zipcode=jdo:persistent,annotation:dfg org.apache.jdo.tck.pc.company.Address#country=jdo:persistent,annotation:dfg org.apache.jdo.tck.pc.company.Company=jdo:persistent org.apache.jdo.tck.pc.company.Company#address=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.company.Company#companyid=jdo:persistent,annotation:dfg org.apache.jdo.tck.pc.company.Company#departments=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.company.Company#founded=jdo:persistent,annotation:dfg org.apache.jdo.tck.pc.company.Company#name=jdo:persistent,annotation:dfg org.apache.jdo.tck.pc.company.DentalInsurance=jdo:persistent,super:org.apache.jdo.tck.pc.company.Insurance org.apache.jdo.tck.pc.company.DentalInsurance#lifetimeOrthoBenefit=jdo:persistent,annotation:dfg org.apache.jdo.tck.pc.company.Department=jdo:persistent org.apache.jdo.tck.pc.company.Department#deptid=jdo:persistent,annotation:dfg org.apache.jdo.tck.pc.company.Department#name=jdo:persistent,annotation:dfg org.apache.jdo.tck.pc.company.Department#employees=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.company.Department#fundedEmps=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.company.Department#company=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.company.Department#employeeOfTheMonth=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.company.Employee=jdo:persistent,super:org.apache.jdo.tck.pc.company.Person org.apache.jdo.tck.pc.company.Employee#dentalInsurance=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.company.Employee#department=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.company.Employee#fundingDept=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.company.Employee#hiredate=jdo:persistent,annotation:dfg org.apache.jdo.tck.pc.company.Employee#hradvisees=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.company.Employee#hradvisor=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.company.Employee#manager=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.company.Employee#medicalInsurance=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.company.Employee#mentor=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.company.Employee#projects=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.company.Employee#protege=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.company.Employee#reviewedProjects=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.company.Employee#team=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.company.Employee#weeklyhours=jdo:persistent,annotation:dfg org.apache.jdo.tck.pc.company.FullTimeEmployee=jdo:persistent,super:org.apache.jdo.tck.pc.company.Employee org.apache.jdo.tck.pc.company.FullTimeEmployee#salary=jdo:persistent,annotation:dfg org.apache.jdo.tck.pc.company.Insurance=jdo:persistent org.apache.jdo.tck.pc.company.Insurance#insid=jdo:persistent,annotation:dfg org.apache.jdo.tck.pc.company.Insurance#carrier=jdo:persistent,annotation:dfg org.apache.jdo.tck.pc.company.Insurance#employee=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.company.MedicalInsurance=jdo:persistent,super:org.apache.jdo.tck.pc.company.Insurance org.apache.jdo.tck.pc.company.MedicalInsurance#planType=jdo:persistent,annotation:dfg org.apache.jdo.tck.pc.company.PartTimeEmployee=jdo:persistent,super:org.apache.jdo.tck.pc.company.Employee org.apache.jdo.tck.pc.company.PartTimeEmployee#wage=jdo:persistent,annotation:dfg org.apache.jdo.tck.pc.company.Person=jdo:persistent org.apache.jdo.tck.pc.company.Person#address=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.company.Person#birthdate=jdo:persistent,annotation:dfg org.apache.jdo.tck.pc.company.Person#firstname=jdo:persistent,annotation:dfg 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.Project=jdo:persistent org.apache.jdo.tck.pc.company.Project#budget=jdo:persistent,annotation:dfg org.apache.jdo.tck.pc.company.Project#members=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.company.Project#name=jdo:persistent,annotation:dfg org.apache.jdo.tck.pc.company.Project#projid=jdo:persistent,annotation:dfg org.apache.jdo.tck.pc.company.Project#reviewers=jdo:persistent,annotation:mediated tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/company/package.jdo100664 27702 12500110372 26510 0ustarmbouschenstaff 0 0 SELECT firstname, lastname INTO org.apache.jdo.tck.query.result.classes.FullName FROM org.apache.jdo.tck.pc.company.Person SELECT UNIQUE firstname, lastname INTO org.apache.jdo.tck.query.result.classes.FullName FROM org.apache.jdo.tck.pc.company.Person WHERE firstname == 'emp1First' SELECT UNIQUE firstname, lastname INTO org.apache.jdo.tck.query.result.classes.FullName FROM org.apache.jdo.tck.pc.company.Person SELECT firstname, lastname FROM org.apache.jdo.tck.pc.company.Person SELECT FROM org.apache.jdo.tck.pc.company.Person WHERE personid > 1 SELECT FROM org.apache.jdo.tck.pc.company.Person SeLeCt FrOm org.apache.jdo.tck.pc.company.Person SELECT firstname, lastname INTO org.apache.jdo.tck.query.result.classes.FullName FROM org.apache.jdo.tck.pc.company.PIPerson SELECT UNIQUE firstname, lastname INTO org.apache.jdo.tck.query.result.classes.FullName FROM org.apache.jdo.tck.pc.company.PIPerson WHERE firstname == 'emp1First' SELECT UNIQUE firstname, lastname INTO org.apache.jdo.tck.query.result.classes.FullName FROM org.apache.jdo.tck.pc.company.PIPerson SELECT firstname, lastname FROM org.apache.jdo.tck.pc.company.PIPerson SELECT FROM org.apache.jdo.tck.pc.company.PIPerson WHERE personid > 1 SELECT FROM org.apache.jdo.tck.pc.company.PIPerson SeLeCt FrOm org.apache.jdo.tck.pc.company.PIPerson tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/company/Person.jdoquery100664 2603 12500110372 27422 0ustarmbouschenstaff 0 0 SELECT FROM org.apache.jdo.tck.pc.company.Person WHERE personid > 3 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/companyListWithoutJoin/package.jdo100664 10642 12500110372 31543 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/companyMapWithoutJoin/package.jdo100664 10343 12500110372 31343 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/AllTypes.jdo100664 2217 12500110372 27326 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/ArrayCollections.jdo100664 10642 12500110372 31067 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/ArrayListCollections.jdo100664 16207 12500110372 31726 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/CollectionCollections.jdo100664 15462 12500110372 32111 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfBigDecimal.jdo100664 20130 12500110372 31177 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfBigInteger.jdo100664 20130 12500110372 31236 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfBoolean.jdo100664 17465 12500110372 30617 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfByte.jdo100664 17022 12500110372 30130 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfCharacter.jdo100664 17767 12500110372 31141 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfDate.jdo100664 17022 12500110372 30102 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfDouble.jdo100664 17324 12500110372 30444 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfFloat.jdo100664 17163 12500110372 30300 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfInteger.jdo100664 17555 12500110372 30635 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfLocale.jdo100664 17324 12500110372 30431 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfLong.jdo100664 17022 12500110372 30124 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfObject.jdo100664 34144 12500110372 30437 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfPrimitiveboolean.jdo100664 17476 12500110372 32552 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfPrimitivebyte.jdo100664 17033 12500110372 32063 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfPrimitivechar.jdo100664 17123 12500110372 32035 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfPrimitivedouble.jdo100664 17335 12500110372 32377 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfPrimitivefloat.jdo100664 17174 12500110372 32233 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfPrimitiveint.jdo100664 16672 12500110372 31722 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfPrimitivelong.jdo100664 17033 12500110372 32057 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfPrimitiveshort.jdo100664 17174 12500110372 32265 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfShort.jdo100664 17163 12500110372 30332 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfSimpleClass.jdo100664 24511 12500110372 31445 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfSimpleEnum.jdo100664 20220 12500110372 31275 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfSimpleInterface.jdo100664 22215 12500110372 32277 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfString.jdo100664 17324 12500110372 30500 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/HashMapStringKeyCollections.jdo100664 35030 12500110372 33170 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/HashMapStringValueCollections.jdo100664 31435 12500110372 33521 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/HashSetCollections.jdo100664 15206 12500110372 31351 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/HashtableStringKeyCollections.jdo100664 33413 12500110372 33545 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/HashtableStringValueCollections.jdo100664 31725 12500110372 34075 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/LinkedListCollections.jdo100664 15462 12500110372 32060 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/ListCollections.jdo100664 15052 12500110372 30724 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/MapStringKeyCollections.jdo100664 35475 12500110372 32401 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/MapStringValueCollections.jdo100664 34105 12500110372 32712 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/SetCollections.jdo100664 14726 12500110372 30553 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/TreeMapStringKeyCollections.jdo100664 33105 12500110372 33205 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/TreeMapStringValueCollections.jdo100664 31435 12500110372 33535 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/TreeSetCollections.jdo100664 13703 12500110372 31365 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/VectorCollections.jdo100664 15202 12500110372 31250 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/inheritance/jdoTest.properties100664 14355 12500110372 30774 0ustarmbouschenstaff 0 0 # # 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. # # Classnames can have the following attributes: # jdo:{persistent|transactional} # super: # oid: # access: {public|protected|package|private} # Fieldnames can have the following attributes: # type: # access: {public|protected|package|private} # jdo:{persistent|transactional|transient} # annotation:{key|dfg|mediated} org.apache.jdo.tck.pc.inheritance.AllPersist=jdo:persistent org.apache.jdo.tck.pc.inheritance.AllPersist#intA=jdo:transient org.apache.jdo.tck.pc.inheritance.AllPersist#doubleB=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.inheritance.AllPersist#intB=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.inheritance.AllPersist#keyValue=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.inheritance.AllPersist2=jdo:persistent,super:org.apache.jdo.tck.pc.inheritance.AllPersist org.apache.jdo.tck.pc.inheritance.AllPersist2#floatE=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.inheritance.AllPersist2#charC=jdo:transient org.apache.jdo.tck.pc.inheritance.AllPersist2#booleanD=jdo:transient org.apache.jdo.tck.pc.inheritance.AllPersist3=jdo:persistent,super:org.apache.jdo.tck.pc.inheritance.AllPersist2 org.apache.jdo.tck.pc.inheritance.AllPersist3#secondObj=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.inheritance.AllPersist3#shortF=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.inheritance.AllPersist3#thirdObj=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.inheritance.AllPersist4=jdo:persistent,super:org.apache.jdo.tck.pc.inheritance.AllPersist3 org.apache.jdo.tck.pc.inheritance.AllPersist4#shortG=jdo:transient org.apache.jdo.tck.pc.inheritance.AllPersist4#intH=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.inheritance.FieldSameName=jdo:persistent org.apache.jdo.tck.pc.inheritance.FieldSameName#keyValue=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.inheritance.FieldSameName#n1=jdo:transient org.apache.jdo.tck.pc.inheritance.FieldSameName#n2=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.inheritance.FieldSameName#n3=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.inheritance.FieldSameName2=jdo:persistent,super:org.apache.jdo.tck.pc.inheritance.FieldSameName org.apache.jdo.tck.pc.inheritance.FieldSameName2#n1=jdo:transient org.apache.jdo.tck.pc.inheritance.FieldSameName2#n2=jdo:transient org.apache.jdo.tck.pc.inheritance.FieldSameName2#n3=jdo:transactional,annotation:mediated org.apache.jdo.tck.pc.inheritance.FieldSameName3=jdo:persistent,super:org.apache.jdo.tck.pc.inheritance.FieldSameName2 org.apache.jdo.tck.pc.inheritance.FieldSameName3#n1=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.inheritance.FieldSameName3#n2=jdo:transactional,annotation:mediated org.apache.jdo.tck.pc.inheritance.FieldSameName3#n3=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.inheritance.FieldSameName4=jdo:persistent,super:org.apache.jdo.tck.pc.inheritance.FieldSameName3 org.apache.jdo.tck.pc.inheritance.FieldSameName4#n1=jdo:transient org.apache.jdo.tck.pc.inheritance.FieldSameName4#n2=jdo:transient org.apache.jdo.tck.pc.inheritance.FieldSameName4#n3=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.inheritance.TopNonPersistB=jdo:persistent org.apache.jdo.tck.pc.inheritance.TopNonPersistB#doubleB=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.inheritance.TopNonPersistB#intB=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.inheritance.TopNonPersistB#keyValue=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.inheritance.TopNonPersistE=jdo:persistent,super:org.apache.jdo.tck.pc.inheritance.TopNonPersistB org.apache.jdo.tck.pc.inheritance.TopNonPersistE#floatE=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.inheritance.TopNonPersistF=jdo:persistent,super:org.apache.jdo.tck.pc.inheritance.TopNonPersistE org.apache.jdo.tck.pc.inheritance.TopNonPersistF#secondObj=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.inheritance.TopNonPersistF#shortF=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.inheritance.TopNonPersistF#thirdObj=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.inheritance.TopNonPersistH=jdo:persistent,super:org.apache.jdo.tck.pc.inheritance.TopNonPersistF org.apache.jdo.tck.pc.inheritance.TopNonPersistH#intH=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.inheritance.TopPersist=jdo:persistent org.apache.jdo.tck.pc.inheritance.TopPersist#intA=jdo:transient org.apache.jdo.tck.pc.inheritance.TopPersist#doubleB=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.inheritance.TopPersist#intB=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.inheritance.TopPersist#keyValue=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.inheritance.TopPersistE=jdo:persistent,super:org.apache.jdo.tck.pc.inheritance.TopPersist org.apache.jdo.tck.pc.inheritance.TopPersistE#floatE=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.inheritance.TopPersistF=jdo:persistent,super:org.apache.jdo.tck.pc.inheritance.TopPersistE org.apache.jdo.tck.pc.inheritance.TopPersistF#secondObj=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.inheritance.TopPersistF#shortF=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.inheritance.TopPersistF#thirdObj=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.inheritance.TopPersistH=jdo:persistent,super:org.apache.jdo.tck.pc.inheritance.TopPersistF org.apache.jdo.tck.pc.inheritance.TopPersistH#intH=jdo:persistent,annotation:mediated tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/inheritance/package.jdo100664 13163 12500110372 27327 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/instancecallbacks/jdoTest.properties100664 6366 12500110372 32132 0ustarmbouschenstaff 0 0 # # 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. # # Classnames can have the following attributes: # jdo:{persistent|transactional} # super: # oid: # access: {public|protected|package|private} # Fieldnames can have the following attributes: # type: # access: {public|protected|package|private} # jdo:{persistent|transactional|transient} # annotation:{key|dfg|mediated} org.apache.jdo.tck.pc.instancecallbacks.InstanceCallbackClass=jdo:persistent org.apache.jdo.tck.pc.instancecallbacks.InstanceCallbackClass#keyValue=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.instancecallbacks.InstanceCallbackClass#name=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.instancecallbacks.InstanceCallbackClass#timeStamp=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.instancecallbacks.InstanceCallbackClass#nextObj=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.instancecallbacks.InstanceCallbackClass#children=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.instancecallbacks.InstanceCallbackClass#intValue=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.instancecallbacks.InstanceCallbackClass#doubleValue=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.instancecallbacks.InstanceCallbackClass#childToDelete=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.instancecallbacks.InstanceCallbackClass#charValue=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.instancecallbacks.InstanceCallbackNonPersistFdsClass=jdo:persistent org.apache.jdo.tck.pc.instancecallbacks.InstanceCallbackNonPersistFdsClass#i=jdo:transient org.apache.jdo.tck.pc.instancecallbacks.InstanceCallbackNonPersistFdsClass#c=jdo:transient org.apache.jdo.tck.pc.instancecallbacks.InstanceCallbackNonPersistFdsClass#d=jdo:transactional,annotation:mediated org.apache.jdo.tck.pc.instancecallbacks.InstanceCallbackNonPersistFdsClass#s=jdo:transactional,annotation:mediated org.apache.jdo.tck.pc.instancecallbacks.InstanceCallbackNonPersistFdsClass#children=jdo:transient org.apache.jdo.tck.pc.instancecallbacks.InstanceCallbackNonPersistFdsClass#loadTime=jdo:transient org.apache.jdo.tck.pc.instancecallbacks.InstanceCallbackNonPersistFdsClass#keyValue=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.instancecallbacks.InstanceCallbackNonPersistFdsClass#floatValue=jdo:persistent,annotation:mediated org.apache.jdo.tck.pc.instancecallbacks.InstanceCallbackNonPersistFdsClass#intValue=jdo:persistent,annotation:mediated tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/instancecallbacks/package.jdo100664 3664 12500110372 30467 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/lifecycle/StateTransitionObj.jdo100664 2254 12500110372 31147 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/mylib/package.jdo100664 3631 12500110372 26131 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/mylib/PCClass.jdo100664 3156 12500110372 26030 0ustarmbouschenstaff 0 0 SELECT FROM org.apache.jdo.tck.pc.mylib.PCClass tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/newInstance/AAddress.jdo100664 3365 12500110372 27372 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/newInstance/AAddress_bad.jdo100664 3371 12500110372 30175 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/newInstance/Address.jdo100664 3252 12500110372 27264 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/newInstance/Address_bad.jdo100664 3256 12500110372 30076 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/newInstance/IAddress.jdo100664 3305 12500110372 27374 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/newInstance/IAddress_bad.jdo100664 3311 12500110372 30177 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/order/package.jdo100664 2412 12500110372 26124 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/query/package.jdo100664 2701 12500110372 26157 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/shoppingcart/package.jdo100664 4202 12500110372 27511 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/singlefieldidentity/package.jdo100664 4147 12500110372 31057 0ustarmbouschenstaff 0 0 tck/src/jdo/datastoreidentity/package.jdo100664 2624 12500110372 21047 0ustarmbouschenstaff 0 0 SELECT FROM org.apache.jdo.tck.pc.company.Person SELECT FIRSTNAME, LASTNAME FROM datastoreidentity0.persons tck/src/main/resources/META-INF/NOTICE.txt100664 270 12500110374 20237 0ustarmbouschenstaff 0 0 Apache Java Data Objects (JDO) Copyright 2005-2006 The Apache Software Foundation This product includes software developed at The Apache Software Foundation (http://www.apache.org/). tck/src/orm/applicationidentity/org/apache/jdo/tck/api/instancecallbacks/package-standard.orm100664 4336 12500110372 33010 0ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/building/package-standard12.orm100664 4056 12500110372 31134 0ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/company/package-standard.orm100664 37004 12500110372 30661 0ustarmbouschenstaff 0 0 SELECT FROM org.apache.jdo.tck.pc.company.Person WHERE personid > 2 SELECT FROM org.apache.jdo.tck.pc.company.Person WHERE personid > 2 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/company/package-standard1.orm100664 16557 12500110372 30754 0ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/company/package-standard2.orm100664 26011 12500110372 30737 0ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/company/package-standard3.orm100664 16426 12500110372 30751 0ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/company/package-standard4.orm100664 16466 12500110372 30756 0ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/companyAnnotatedFC/package-standard11.orm100664 3244 12500110372 33051 0ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/companyListWithoutJoin/package-standard10.orm100664 14731 12500110372 34064 0ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/companyMapWithoutJoin/package-standard9.orm100664 14753 12500110372 33622 0ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/AllTypes-standard.orm100664 5212 12500110372 31501 0ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/ArrayCollections-standard.orm100664 14704 12500110372 33247 0ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/ArrayListCollections-standard.orm100664 26604 12500110372 34105 0ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/CollectionCollections-standard.orm100664 26514 12500110372 34266 0ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfBigDecimal-standard.orm100664 27474 12500110372 33376 0ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfBigInteger-standard.orm100664 13414 12500110372 33422 0ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfBoolean-standard.orm100664 12327 12500110372 32764 0ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfByte-standard.orm100664 11614 12500110372 32306 0ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfCharacter-standard.orm100664 24062 12500110372 33300 0ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfDate-standard.orm100664 11530 12500110372 32255 0ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfDouble-standard.orm100664 12107 12500110372 32613 0ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfFloat-standard.orm100664 11752 12500110372 32453 0ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfInteger-standard.orm100664 12416 12500110372 33001 0ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfLocale-standard.orm100664 12174 12500110372 32604 0ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfLong-standard.orm100664 11530 12500110372 32277 0ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfObject-standard.orm100664 16173 12500110372 32616 0ustarmbouschenstaff 0 0 ././@LongLink100644 0 0 147 12500111677 10255 Lustar 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfPrimitiveboolean-standard.ormtck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfPrimitiveboolean-standard.o100664 12440 12500110372 34352 0ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfPrimitivebyte-standard.orm100664 11552 12500110372 34240 0ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfPrimitivechar-standard.orm100664 11552 12500110372 34212 0ustarmbouschenstaff 0 0 ././@LongLink100644 0 0 146 12500111677 10254 Lustar 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfPrimitivedouble-standard.ormtck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfPrimitivedouble-standard.or100664 12216 12500110372 34370 0ustarmbouschenstaff 0 0 ././@LongLink100644 0 0 145 12500111677 10253 Lustar 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfPrimitivefloat-standard.ormtck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfPrimitivefloat-standard.orm100664 11774 12500110372 34410 0ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfPrimitiveint-standard.orm100664 11330 12500110372 34061 0ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfPrimitivelong-standard.orm100664 11552 12500110372 34234 0ustarmbouschenstaff 0 0 ././@LongLink100644 0 0 145 12500111677 10253 Lustar 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfPrimitiveshort-standard.ormtck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfPrimitiveshort-standard.orm100664 11774 12500110372 34442 0ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfShort-standard.orm100664 11755 12500110372 32510 0ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfSimpleClass-standard.orm100664 37163 12500110372 33631 0ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfSimpleEnum-standard.orm100664 12422 12500110372 33457 0ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfSimpleEnum-standard1.orm100664 26455 12500110372 33553 0ustarmbouschenstaff 0 0 ././@LongLink100644 0 0 146 12500111677 10254 Lustar 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfSimpleInterface-standard.ormtck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfSimpleInterface-standard.or100664 20441 12500110372 34276 0ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfString-standard.orm100664 12174 12500110372 32653 0ustarmbouschenstaff 0 0 ././@LongLink100644 0 0 152 12500111677 10251 Lustar 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/HashMapStringKeyCollections-standard.ormtck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/HashMapStringKeyCollections-standar100664 61600 12500110372 34407 0ustarmbouschenstaff 0 0 ././@LongLink100644 0 0 154 12500111677 10253 Lustar 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/HashMapStringValueCollections-standard.ormtck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/HashMapStringValueCollections-stand100664 55767 12500110372 34431 0ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/HashSetCollections-standard.orm100664 22422 12500110372 33524 0ustarmbouschenstaff 0 0 ././@LongLink100644 0 0 154 12500111677 10253 Lustar 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/HashtableStringKeyCollections-standard.ormtck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/HashtableStringKeyCollections-stand100664 62157 12500110372 34446 0ustarmbouschenstaff 0 0 ././@LongLink100644 0 0 156 12500111677 10255 Lustar 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/HashtableStringValueCollections-standard.ormtck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/HashtableStringValueCollections-sta100664 60511 12500110372 34440 0ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/LinkedListCollections-standard.orm100664 26514 12500110372 34235 0ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/ListCollections-standard.orm100664 25474 12500110372 33112 0ustarmbouschenstaff 0 0 ././@LongLink100644 0 0 146 12500111677 10254 Lustar 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/MapStringKeyCollections-standard.ormtck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/MapStringKeyCollections-standard.or100664 70512 12500110372 34370 0ustarmbouschenstaff 0 0 ././@LongLink100644 0 0 150 12500111677 10247 Lustar 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/MapStringValueCollections-standard.ormtck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/MapStringValueCollections-standard.100664 63152 12500110372 34355 0ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/SetCollections-standard.orm100664 21662 12500110372 32725 0ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/SimpleClass-standard.orm100664 2511 12500110372 32162 0ustarmbouschenstaff 0 0 ././@LongLink100644 0 0 152 12500111677 10251 Lustar 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/TreeMapStringKeyCollections-standard.ormtck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/TreeMapStringKeyCollections-standar100664 61601 12500110372 34424 0ustarmbouschenstaff 0 0 ././@LongLink100644 0 0 154 12500111677 10253 Lustar 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/TreeMapStringValueCollections-standard.ormtck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/TreeMapStringValueCollections-stand100664 60153 12500110372 34426 0ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/TreeSetCollections-standard.orm100664 21132 12500110372 33535 0ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/fieldtypes/VectorCollections-standard.orm100664 25754 12500110372 33442 0ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/inheritance/package-standard.orm100664 11576 12500110372 31512 0ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/instancecallbacks/package-standard.orm100664 5240 12500110372 32634 0ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/lifecycle/StateTransitionObj-standard.orm100664 2401 12500110372 33316 0ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/mylib/package-standard.orm100664 6363 12500110372 30313 0ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/mylib/package-standard5.orm100664 2440 12500110372 30370 0ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/mylib/package-standard6.orm100664 2433 12500110372 30373 0ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/mylib/package-standard7.orm100664 2433 12500110372 30374 0ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/newInstance/package-standard.orm100664 13322 12500110372 31466 0ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/order/package-standard.orm100664 3341 12500110372 30303 0ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/query/package-standard.orm100664 3216 12500110372 30336 0ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/shoppingcart/package-standard8.orm100664 4470 12500110372 31765 0ustarmbouschenstaff 0 0 tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/singlefieldidentity/package-standard.orm100664 10773 12500110372 33256 0ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/api/instancecallbacks/package-standard.orm100664 5310 12500110372 32464 0ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/building/package-standard12.orm100664 4361 12500110372 30616 0ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-standard.orm100664 40431 12500110372 30342 0ustarmbouschenstaff 0 0 SELECT FROM org.apache.jdo.tck.pc.company.Person WHERE personid > 2 SELECT FROM org.apache.jdo.tck.pc.company.Person WHERE personid > 2 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-standard1.orm100664 17657 12500110372 30441 0ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-standard2.orm100664 30607 12500110372 30430 0ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-standard3.orm100664 17511 12500110372 30430 0ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-standard4.orm100664 17510 12500110372 30430 0ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/companyAnnotatedFC/package-standard11.orm100664 3240 12500110372 32530 0ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/companyListWithoutJoin/package-standard10.orm100664 15315 12500110372 33546 0ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/companyMapWithoutJoin/package-standard9.orm100664 15730 12500110372 33301 0ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/AllTypes-standard.orm100664 5334 12500110372 31171 0ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/ArrayCollections-standard.orm100664 15063 12500110372 32731 0ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/ArrayListCollections-standard.orm100664 25634 12500110372 33572 0ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/CollectionCollections-standard.orm100664 26636 12500110372 33756 0ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfBigDecimal-standard.orm100664 27616 12500110372 33057 0ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfBigInteger-standard.orm100664 13536 12500110372 33112 0ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfBoolean-standard.orm100664 12451 12500110372 32445 0ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfByte-standard.orm100664 11736 12500110372 31776 0ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfCharacter-standard.orm100664 24204 12500110372 32761 0ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfDate-standard.orm100664 11652 12500110372 31745 0ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfDouble-standard.orm100664 12231 12500110372 32274 0ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfFloat-standard.orm100664 12074 12500110372 32134 0ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfInteger-standard.orm100664 12540 12500110372 32462 0ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfLocale-standard.orm100664 12316 12500110372 32265 0ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfLong-standard.orm100664 11652 12500110372 31767 0ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfObject-standard.orm100664 16402 12500110372 32274 0ustarmbouschenstaff 0 0 ././@LongLink100644 0 0 145 12500111677 10253 Lustar 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfPrimitiveboolean-standard.ormtck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfPrimitiveboolean-standard.orm100664 12562 12500110372 34401 0ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfPrimitivebyte-standard.orm100664 11674 12500110372 33730 0ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfPrimitivechar-standard.orm100664 11674 12500110372 33702 0ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfPrimitivedouble-standard.orm100664 12340 12500110372 34226 0ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfPrimitivefloat-standard.orm100664 12116 12500110372 34062 0ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfPrimitiveint-standard.orm100664 11452 12500110372 33551 0ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfPrimitivelong-standard.orm100664 11674 12500110372 33724 0ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfPrimitiveshort-standard.orm100664 12116 12500110372 34114 0ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfShort-standard.orm100664 12077 12500110372 32171 0ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfSimpleClass-standard.orm100664 37305 12500110372 33312 0ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfSimpleEnum-standard.orm100664 12544 12500110372 33147 0ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfSimpleEnum-standard1.orm100664 26523 12500110372 33232 0ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfSimpleInterface-standard.orm100664 20537 12500110372 34144 0ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/FieldsOfString-standard.orm100664 12316 12500110372 32334 0ustarmbouschenstaff 0 0 ././@LongLink100644 0 0 150 12500111677 10247 Lustar 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/HashMapStringKeyCollections-standard.ormtck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/HashMapStringKeyCollections-standard.100664 61763 12500110372 34326 0ustarmbouschenstaff 0 0 ././@LongLink100644 0 0 152 12500111677 10251 Lustar 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/HashMapStringValueCollections-standard.ormtck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/HashMapStringValueCollections-standar100664 61612 12500110372 34421 0ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/HashSetCollections-standard.orm100664 23630 12500110372 33211 0ustarmbouschenstaff 0 0 ././@LongLink100644 0 0 152 12500111677 10251 Lustar 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/HashtableStringKeyCollections-standard.ormtck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/HashtableStringKeyCollections-standar100664 62341 12500110372 34447 0ustarmbouschenstaff 0 0 ././@LongLink100644 0 0 154 12500111677 10253 Lustar 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/HashtableStringValueCollections-standard.ormtck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/HashtableStringValueCollections-stand100664 64152 12500110372 34452 0ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/LinkedListCollections-standard.orm100664 26636 12500110372 33725 0ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/ListCollections-standard.orm100664 25616 12500110372 32573 0ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/MapStringKeyCollections-standard.orm100664 70674 12500110372 34241 0ustarmbouschenstaff 0 0 ././@LongLink100644 0 0 146 12500111677 10254 Lustar 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/MapStringValueCollections-standard.ormtck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/MapStringValueCollections-standard.or100664 66570 12500110372 34410 0ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/SetCollections-standard.orm100664 23070 12500110372 32403 0ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/SimpleClass-standard.orm100664 2633 12500110372 31652 0ustarmbouschenstaff 0 0 ././@LongLink100644 0 0 150 12500111677 10247 Lustar 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/TreeMapStringKeyCollections-standard.ormtck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/TreeMapStringKeyCollections-standard.100664 61763 12500110372 34342 0ustarmbouschenstaff 0 0 ././@LongLink100644 0 0 152 12500111677 10251 Lustar 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/TreeMapStringValueCollections-standard.ormtck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/TreeMapStringValueCollections-standar100664 63571 12500110372 34443 0ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/TreeSetCollections-standard.orm100664 21254 12500110372 33225 0ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/fieldtypes/VectorCollections-standard.orm100664 26076 12500110372 33123 0ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/inheritance/package-standard.orm100664 12304 12500110372 31163 0ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/instancecallbacks/package-standard.orm100664 5536 12500110372 32327 0ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/lifecycle/StateTransitionObj-standard.orm100664 2516 12500110372 33010 0ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/mylib/package-standard.orm100664 7273 12500110372 27777 0ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/mylib/package-standard5.orm100664 2552 12500110372 30057 0ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/mylib/package-standard6.orm100664 2546 12500110372 30063 0ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/mylib/package-standard7.orm100664 2545 12500110372 30063 0ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/newInstance/package-standard.orm100664 13064 12500110372 31154 0ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/query/package-standard.orm100664 4043 12500110372 30020 0ustarmbouschenstaff 0 0 tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/shoppingcart/package-standard8.orm100664 5541 12500110372 31450 0ustarmbouschenstaff 0 0 tck/src/sql/derby/applicationidentity/schema.sql100664 1067617 12500110372 22502 0ustarmbouschenstaff 0 0 -- 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 applicationidentity0; SET SCHEMA applicationidentity0; ------------------------- -- newInstance ------------------------- DROP TABLE address; CREATE TABLE address ( ADDRID INTEGER, STREET VARCHAR(64), CITY VARCHAR(64), STATE CHAR(2), ZIPCODE CHAR(5), COUNTRY VARCHAR(64), CONSTRAINT ADDR_PK PRIMARY KEY (ADDRID) ); ------------------------- -- order ------------------------- DROP TABLE Item; DROP TABLE Orders; CREATE TABLE Orders ( ID BIGINT NOT NULL, CUSTOMERID BIGINT, CONSTRAINT ORDER_CONST PRIMARY KEY (ID) ); CREATE TABLE Item ( ID BIGINT NOT NULL, ORDERID BIGINT, DESCRIPTION VARCHAR(64), QUANTITY INT, CONSTRAINT ITEM_ORDER_FK FOREIGN KEY (ORDERID) REFERENCES Orders(ID), CONSTRAINT ITEM_CONST PRIMARY KEY (ID, ORDERID) ); ------------------------- -- mylib ------------------------- DROP TABLE PCRect; DROP TABLE PCPoint; DROP TABLE VersionedPCPoint; DROP TABLE PCPoint2; DROP TABLE PrimitiveTypes; DROP TABLE PCClass; CREATE TABLE PCPoint ( ID BIGINT NOT NULL, X INTEGER NOT NULL, Y INTEGER, CONSTRAINT PCPNT_CONST PRIMARY KEY (ID) ); CREATE TABLE VersionedPCPoint ( ID BIGINT, X INTEGER NOT NULL, Y INTEGER, VERSION INTEGER, CONSTRAINT VERSIONED_PCPNT_CONST PRIMARY KEY (ID) ); CREATE TABLE PCPoint2 ( ID BIGINT NOT NULL, X INTEGER NOT NULL, Y INTEGER, CONSTRAINT PCPNT2_CONST PRIMARY KEY (ID) ); CREATE TABLE PCRect ( ID BIGINT NOT NULL, UPPER_LEFT BIGINT REFERENCES PCPoint NOT NULL, LOWER_RIGHT BIGINT REFERENCES PCPoint NOT NULL, CONSTRAINT PCRCT_CONST PRIMARY KEY (ID) ); CREATE TABLE PrimitiveTypes ( ID BIGINT NOT NULL, booleanNotNull CHAR(1) NOT NULL CHECK (booleanNotNull IN ('Y','N')), booleanNull CHAR(1) CHECK (booleanNull IN ('Y','N')), byteNotNull SMALLINT NOT NULL, byteNull SMALLINT, shortNotNull SMALLINT NOT NULL, shortNull SMALLINT, intNotNull INTEGER NOT NULL, intNull INTEGER, longNotNull INTEGER NOT NULL, longNull INTEGER, floatNotNull REAL NOT NULL, floatNull REAL, doubleNotNull DOUBLE NOT NULL, doubleNull DOUBLE, charNotNull CHAR NOT NULL, charNull CHAR, dateNull TIMESTAMP, stringNull VARCHAR (256), bigDecimal DECIMAL, bigInteger INTEGER, PrimitiveTypes INTEGER, CONSTRAINT PT_CONST PRIMARY KEY (ID) ); CREATE TABLE PCClass ( ID BIGINT NOT NULL, NUMBER1 INTEGER, NUMBER2 INTEGER, CONSTRAINT PCCLASS_CONST PRIMARY KEY (ID) ); ------------------------- -- query ------------------------- DROP TABLE JDOQLKeywordsAsFieldNames; DROP TABLE NoExtent; DROP TABLE TimeSample; DROP TABLE MathSample; CREATE TABLE JDOQLKeywordsAsFieldNames ( ID VARCHAR(64) NOT NULL, CONSTRAINT KEYWORDS_PK PRIMARY KEY (ID) ); CREATE TABLE NoExtent ( ID INTEGER NOT NULL, CONSTRAINT NOEXTENT_PK PRIMARY KEY (ID) ); CREATE TABLE TimeSample ( ID INTEGER NOT NULL, TIME TIME, CONSTRAINT TIMESAMPLE_PK PRIMARY KEY (ID) ); CREATE TABLE MathSample ( ID INTEGER NOT NULL, ANGLE DECIMAL(18,8), CONSTRAINT MATHSAMPLE_PK PRIMARY KEY (ID) ); ------------------------- -- singlefieldidentity ------------------------- DROP TABLE PCPointSingleFieldByte; DROP TABLE PCPointSingleFieldChar; DROP TABLE PCPointSingleFieldInteger; DROP TABLE PCPointSingleFieldLong; DROP TABLE PCPointSingleFieldShort; DROP TABLE PCPointSingleFieldString; DROP TABLE PCPointSingleFieldDate; CREATE TABLE PCPointSingleFieldByte ( ID DECIMAL(3) NOT NULL, X INTEGER NOT NULL, Y INTEGER, CONSTRAINT PCPNT_SFB_PK PRIMARY KEY (ID) ); CREATE TABLE PCPointSingleFieldChar ( ID INTEGER NOT NULL, X INTEGER NOT NULL, Y INTEGER, CONSTRAINT PCPNT_SFC_PK PRIMARY KEY (ID) ); CREATE TABLE PCPointSingleFieldInteger ( ID INTEGER NOT NULL, X INTEGER NOT NULL, Y INTEGER, CONSTRAINT PCPNT_SFI_PK PRIMARY KEY (ID) ); CREATE TABLE PCPointSingleFieldLong ( ID BIGINT NOT NULL, X INTEGER NOT NULL, Y INTEGER, CONSTRAINT PCPNT_SFL_PK PRIMARY KEY (ID) ); CREATE TABLE PCPointSingleFieldShort ( ID SMALLINT NOT NULL, X INTEGER NOT NULL, Y INTEGER, CONSTRAINT PCPNT_SFS_PK PRIMARY KEY (ID) ); CREATE TABLE PCPointSingleFieldString ( ID VARCHAR(100) NOT NULL, X INTEGER NOT NULL, Y INTEGER, CONSTRAINT PCPNT_SFSTR_PK PRIMARY KEY (ID) ); CREATE TABLE PCPointSingleFieldDate ( ID DATE NOT NULL, X INTEGER NOT NULL, Y INTEGER, CONSTRAINT PCPNT_SFD_PK PRIMARY KEY (ID) ); ------------------------- -- company ------------------------- ALTER TABLE departments DROP CONSTRAINT EMP_MO_FK; ALTER TABLE departments DROP CONSTRAINT DEPTS_COMP_FK; ALTER TABLE project_reviewer DROP CONSTRAINT PR_PROJ_FK; ALTER TABLE project_reviewer DROP CONSTRAINT PR_REV_FK; ALTER TABLE persons DROP CONSTRAINT PERS_DEPT_FK; ALTER TABLE persons DROP CONSTRAINT PERS_FUNDDEPT_FK; ALTER TABLE persons DROP CONSTRAINT PERS_MANAGER_FK; ALTER TABLE persons DROP CONSTRAINT PERS_MENTOR_FK; ALTER TABLE persons DROP CONSTRAINT PERS_HRADVISOR_FK; ALTER TABLE insuranceplans DROP CONSTRAINT INS_EMP_FK; DROP TABLE insuranceplans; DROP TABLE project_reviewer; DROP TABLE project_member; DROP TABLE project_member_jpa; DROP TABLE employee_phoneno_type; DROP TABLE persons; DROP TABLE projects; DROP TABLE departments; DROP TABLE companies; DROP TABLE meetingrooms; DROP TABLE department_rooms; CREATE TABLE companies ( ID INTEGER NOT NULL, NAME VARCHAR(32) NOT NULL, FOUNDEDDATE DATE NOT NULL, ADDRID INTEGER, STREET VARCHAR(64), CITY VARCHAR(64), STATE CHAR(2), ZIPCODE CHAR(5), COUNTRY VARCHAR(64), DISCRIMINATOR VARCHAR(255), CONSTRAINT COMPS_PK PRIMARY KEY (ID) ); CREATE TABLE departments ( ID INTEGER NOT NULL, NAME VARCHAR(32) NOT NULL, EMP_OF_THE_MONTH INTEGER, COMPANYID INTEGER, DISCRIMINATOR VARCHAR(255), CONSTRAINT DEPTS_COMP_FK FOREIGN KEY (COMPANYID) REFERENCES companies, CONSTRAINT DEPTS_PK PRIMARY KEY (ID) ); CREATE TABLE department_rooms ( DEPTID INTEGER NOT NULL, ROOMID INTEGER NOT NULL, ROOM_ORDER INTEGER NOT NULL ); CREATE TABLE meetingrooms ( ID INTEGER NOT NULL, NAME VARCHAR(32) NOT NULL, DISCRIMINATOR VARCHAR(255), CONSTRAINT ROOMS_PK PRIMARY KEY (ID) ); CREATE TABLE persons ( PERSONID INTEGER NOT NULL, FIRSTNAME VARCHAR(32) NOT NULL, LASTNAME VARCHAR(32) NOT NULL, MIDDLENAME VARCHAR(32), BIRTHDATE DATE NOT NULL, ADDRID INTEGER, STREET VARCHAR(64), CITY VARCHAR(64), STATE CHAR(2), ZIPCODE CHAR(5), COUNTRY VARCHAR(64), HIREDATE DATE, WEEKLYHOURS REAL, DEPARTMENT INTEGER, FUNDINGDEPT INTEGER, MANAGER INTEGER, MENTOR INTEGER, HRADVISOR INTEGER, SALARY REAL, WAGE REAL, DISCRIMINATOR varchar(255) NOT NULL, CONSTRAINT PERS_DEPT_FK FOREIGN KEY (DEPARTMENT) REFERENCES departments, CONSTRAINT PERS_FUNDDEPT_FK FOREIGN KEY (FUNDINGDEPT) REFERENCES departments, CONSTRAINT PERS_MANAGER_FK FOREIGN KEY (MANAGER) REFERENCES persons, CONSTRAINT PERS_MENTOR_FK FOREIGN KEY (MENTOR) REFERENCES persons, CONSTRAINT PERS_HRADVISOR_FK FOREIGN KEY (HRADVISOR) REFERENCES persons, CONSTRAINT EMPS_PK PRIMARY KEY (PERSONID) ); CREATE TABLE insuranceplans ( INSID INTEGER NOT NULL, CARRIER VARCHAR(64) NOT NULL, LIFETIME_ORTHO_BENEFIT DECIMAL(22,3), PLANTYPE VARCHAR(8), DISCRIMINATOR varchar(255) NOT NULL, EMPLOYEE INTEGER, CONSTRAINT INS_EMP_FK FOREIGN KEY (EMPLOYEE) REFERENCES persons, CONSTRAINT INS_PK PRIMARY KEY (INSID) ); CREATE TABLE projects ( PROJID INTEGER NOT NULL, NAME VARCHAR(32) NOT NULL, BUDGET DECIMAL(11,2) NOT NULL, DISCRIMINATOR VARCHAR(255), CONSTRAINT PROJS_PK PRIMARY KEY (PROJID) ); CREATE TABLE project_reviewer ( PROJID INTEGER NOT NULL, REVIEWER INTEGER NOT NULL ); CREATE TABLE project_member ( PROJID INTEGER REFERENCES projects NOT NULL, MEMBER INTEGER REFERENCES persons NOT NULL ); CREATE TABLE project_member_jpa ( PROJID INTEGER REFERENCES projects NOT NULL, MEMBER_JPA INTEGER REFERENCES persons NOT NULL ); CREATE TABLE employee_phoneno_type ( EMPID INTEGER REFERENCES persons NOT NULL, PHONENO VARCHAR(16) NOT NULL, TYPE VARCHAR(16) NOT NULL ); ALTER TABLE project_reviewer ADD CONSTRAINT PR_PROJ_FK FOREIGN KEY (PROJID) REFERENCES projects(PROJID); ALTER TABLE project_reviewer ADD CONSTRAINT PR_REV_FK FOREIGN KEY (REVIEWER) REFERENCES persons(PERSONID); ALTER TABLE departments ADD CONSTRAINT EMP_MO_FK FOREIGN KEY (EMP_OF_THE_MONTH) REFERENCES persons(PERSONID) ON DELETE SET NULL; ------------------------- --fieldtypes ------------------------- DROP TABLE ARRAY_OF_OBJECT0; DROP TABLE ARRAY_OF_OBJECT1; DROP TABLE ARRAY_OF_SIMPLE_CLASS2; DROP TABLE ARRAY_OF_SIMPLE_CLASS3; DROP TABLE ARRAY_OF_SIMPLE_INTERFACE4; DROP TABLE ARRAY_OF_SIMPLE_INTERFACE5; DROP TABLE ARRAY_OF_STRING7; DROP TABLE ARRAY_OF_DATE9; DROP TABLE ARRAY_OF_LOCALE11; DROP TABLE ARRAY_OF_BIG_DECIMAL13; DROP TABLE ARRAY_OF_BIG_INTEGER15; DROP TABLE ARRAY_OF_BYTE17; DROP TABLE ARRAY_OF_DOUBLE19; DROP TABLE ARRAY_OF_FLOAT21; DROP TABLE ARRAY_OF_INTEGER23; DROP TABLE ARRAY_OF_LONG25; DROP TABLE ARRAY_OF_SHORT27; DROP TABLE ARRAY_OF_SIMPLEENUM29; DROP TABLE ARRAY_OF_SIMPLEENUM30; DROP TABLE ARRAY_COLLECTIONS; DROP TABLE ARRAYLIST_OF_OBJECT0; DROP TABLE ARRAYLIST_OF_OBJECT1; DROP TABLE ARRAYLIST_OF_OBJECT2; DROP TABLE ARRAYLIST_OF_SIMPLE_CLASS3; DROP TABLE ARRAYLIST_OF_SIMPLE_CLASS4; DROP TABLE ARRAYLIST_OF_SIMPLE_CLASS5; DROP TABLE ARRAYLIST_OF_SIMPLE_INTERFACE6; DROP TABLE ARRAYLIST_OF_SIMPLE_INTERFACE7; DROP TABLE ARRAYLIST_OF_SIMPLE_INTERFACE8; DROP TABLE ARRAYLIST_OF_STRING9; DROP TABLE ARRAYLIST_OF_STRING11; DROP TABLE ARRAYLIST_OF_DATE12; DROP TABLE ARRAYLIST_OF_DATE14; DROP TABLE ARRAYLIST_OF_LOCALE15; DROP TABLE ARRAYLIST_OF_LOCALE17; DROP TABLE ARRAYLIST_OF_BIG_DECIMAL18; DROP TABLE ARRAYLIST_OF_BIG_DECIMAL20; DROP TABLE ARRAYLIST_OF_BIG_INTEGER21; DROP TABLE ARRAYLIST_OF_BIG_INTEGER23; DROP TABLE ARRAYLIST_OF_BYTE24; DROP TABLE ARRAYLIST_OF_BYTE26; DROP TABLE ARRAYLIST_OF_DOUBLE27; DROP TABLE ARRAYLIST_OF_DOUBLE29; DROP TABLE ARRAYLIST_OF_FLOAT30; DROP TABLE ARRAYLIST_OF_FLOAT32; DROP TABLE ARRAYLIST_OF_INTEGER33; DROP TABLE ARRAYLIST_OF_INTEGER35; DROP TABLE ARRAYLIST_OF_LONG36; DROP TABLE ARRAYLIST_OF_LONG38; DROP TABLE ARRAYLIST_OF_SHORT39; DROP TABLE ARRAYLIST_OF_SHORT41; DROP TABLE ARRAYLIST_OF_SIMPLEENUM42; DROP TABLE ARRAYLIST_OF_SIMPLEENUM44; DROP TABLE ARRAYLIST_OF_SIMPLEENUM45; DROP TABLE ARRAYLIST_OF_SIMPLEENUM46; DROP TABLE ARRAYLIST_COLLECTIONS; DROP TABLE COLLECTION_OF_OBJECT0; DROP TABLE COLLECTION_OF_OBJECT1; DROP TABLE COLLECTION_OF_OBJECT2; DROP TABLE COLLECTION_OF_SIMPLE_CLASS3; DROP TABLE COLLECTION_OF_SIMPLE_CLASS4; DROP TABLE COLLECTION_OF_SIMPLE_CLASS5; DROP TABLE COLLECTION_OF_SIMPLE_INTERFACE6; DROP TABLE COLLECTION_OF_SIMPLE_INTERFACE7; DROP TABLE COLLECTION_OF_SIMPLE_INTERFACE8; DROP TABLE COLLECTION_OF_STRING9; DROP TABLE COLLECTION_OF_STRING10; DROP TABLE COLLECTION_OF_DATE12; DROP TABLE COLLECTION_OF_DATE13; DROP TABLE COLLECTION_OF_LOCALE15; DROP TABLE COLLECTION_OF_LOCALE16; DROP TABLE COLLECTION_OF_BIG_DECIMAL18; DROP TABLE COLLECTION_OF_BIG_DECIMAL19; DROP TABLE COLLECTION_OF_BIG_INTEGER21; DROP TABLE COLLECTION_OF_BIG_INTEGER22; DROP TABLE COLLECTION_OF_BYTE24; DROP TABLE COLLECTION_OF_BYTE25; DROP TABLE COLLECTION_OF_DOUBLE27; DROP TABLE COLLECTION_OF_DOUBLE28; DROP TABLE COLLECTION_OF_FLOAT30; DROP TABLE COLLECTION_OF_FLOAT31; DROP TABLE COLLECTION_OF_INTEGER33; DROP TABLE COLLECTION_OF_INTEGER34; DROP TABLE COLLECTION_OF_LONG36; DROP TABLE COLLECTION_OF_LONG37; DROP TABLE COLLECTION_OF_SHORT39; DROP TABLE COLLECTION_OF_SHORT40; DROP TABLE COLLECTION_COLLECTIONS; DROP TABLE LIST_OF_OBJECT0; DROP TABLE LIST_OF_OBJECT1; DROP TABLE LIST_OF_OBJECT2; DROP TABLE LIST_OF_SIMPLE_CLASS3; DROP TABLE LIST_OF_SIMPLE_CLASS4; DROP TABLE LIST_OF_SIMPLE_CLASS5; DROP TABLE LIST_OF_SIMPLE_INTERFACE6; DROP TABLE LIST_OF_SIMPLE_INTERFACE7; DROP TABLE LIST_OF_SIMPLE_INTERFACE8; DROP TABLE LIST_OF_STRING9; DROP TABLE LIST_OF_STRING10; DROP TABLE LIST_OF_DATE12; DROP TABLE LIST_OF_DATE13; DROP TABLE LIST_OF_LOCALE15; DROP TABLE LIST_OF_LOCALE16; DROP TABLE LIST_OF_BIG_DECIMAL18; DROP TABLE LIST_OF_BIG_DECIMAL19; DROP TABLE LIST_OF_BIG_INTEGER21; DROP TABLE LIST_OF_BIG_INTEGER22; DROP TABLE LIST_OF_BYTE24; DROP TABLE LIST_OF_BYTE25; DROP TABLE LIST_OF_DOUBLE27; DROP TABLE LIST_OF_DOUBLE28; DROP TABLE LIST_OF_FLOAT30; DROP TABLE LIST_OF_FLOAT31; DROP TABLE LIST_OF_INTEGER33; DROP TABLE LIST_OF_INTEGER34; DROP TABLE LIST_OF_LONG36; DROP TABLE LIST_OF_LONG37; DROP TABLE LIST_OF_SHORT39; DROP TABLE LIST_OF_SHORT40; DROP TABLE LIST_COLLECTIONS; DROP TABLE LINKEDLIST_OF_OBJECT0; DROP TABLE LINKEDLIST_OF_OBJECT1; DROP TABLE LINKEDLIST_OF_OBJECT2; DROP TABLE LINKEDLIST_OF_SIMPLE_CLASS3; DROP TABLE LINKEDLIST_OF_SIMPLE_CLASS4; DROP TABLE LINKEDLIST_OF_SIMPLE_CLASS5; DROP TABLE LINKEDLIST_OF_SIMPLE_INTERFACE6; DROP TABLE LINKEDLIST_OF_SIMPLE_INTERFACE7; DROP TABLE LINKEDLIST_OF_SIMPLE_INTERFACE8; DROP TABLE LINKEDLIST_OF_STRING9; DROP TABLE LINKEDLIST_OF_STRING10; DROP TABLE LINKEDLIST_OF_DATE12; DROP TABLE LINKEDLIST_OF_DATE13; DROP TABLE LINKEDLIST_OF_LOCALE15; DROP TABLE LINKEDLIST_OF_LOCALE16; DROP TABLE LINKEDLIST_OF_BIG_DECIMAL18; DROP TABLE LINKEDLIST_OF_BIG_DECIMAL19; DROP TABLE LINKEDLIST_OF_BIG_INTEGER21; DROP TABLE LINKEDLIST_OF_BIG_INTEGER22; DROP TABLE LINKEDLIST_OF_BYTE24; DROP TABLE LINKEDLIST_OF_BYTE25; DROP TABLE LINKEDLIST_OF_DOUBLE27; DROP TABLE LINKEDLIST_OF_DOUBLE28; DROP TABLE LINKEDLIST_OF_FLOAT30; DROP TABLE LINKEDLIST_OF_FLOAT31; DROP TABLE LINKEDLIST_OF_INTEGER33; DROP TABLE LINKEDLIST_OF_INTEGER34; DROP TABLE LINKEDLIST_OF_LONG36; DROP TABLE LINKEDLIST_OF_LONG37; DROP TABLE LINKEDLIST_OF_SHORT39; DROP TABLE LINKEDLIST_OF_SHORT40; DROP TABLE LINKEDLIST_COLLECTIONS; DROP TABLE VECTOR_OF_OBJECT0; DROP TABLE VECTOR_OF_OBJECT1; DROP TABLE VECTOR_OF_OBJECT2; DROP TABLE VECTOR_OF_SIMPLE_CLASS3; DROP TABLE VECTOR_OF_SIMPLE_CLASS4; DROP TABLE VECTOR_OF_SIMPLE_CLASS5; DROP TABLE VECTOR_OF_SIMPLE_INTERFACE6; DROP TABLE VECTOR_OF_SIMPLE_INTERFACE7; DROP TABLE VECTOR_OF_SIMPLE_INTERFACE8; DROP TABLE VECTOR_OF_STRING9; DROP TABLE VECTOR_OF_STRING10; DROP TABLE VECTOR_OF_DATE12; DROP TABLE VECTOR_OF_DATE13; DROP TABLE VECTOR_OF_LOCALE15; DROP TABLE VECTOR_OF_LOCALE16; DROP TABLE VECTOR_OF_BIG_DECIMAL18; DROP TABLE VECTOR_OF_BIG_DECIMAL19; DROP TABLE VECTOR_OF_BIG_INTEGER21; DROP TABLE VECTOR_OF_BIG_INTEGER22; DROP TABLE VECTOR_OF_BYTE24; DROP TABLE VECTOR_OF_BYTE25; DROP TABLE VECTOR_OF_DOUBLE27; DROP TABLE VECTOR_OF_DOUBLE28; DROP TABLE VECTOR_OF_FLOAT30; DROP TABLE VECTOR_OF_FLOAT31; DROP TABLE VECTOR_OF_INTEGER33; DROP TABLE VECTOR_OF_INTEGER34; DROP TABLE VECTOR_OF_LONG36; DROP TABLE VECTOR_OF_LONG37; DROP TABLE VECTOR_OF_SHORT39; DROP TABLE VECTOR_OF_SHORT40; DROP TABLE VECTOR_COLLECTIONS; DROP TABLE SET_OF_OBJECT0; DROP TABLE SET_OF_OBJECT1; DROP TABLE SET_OF_SIMPLE_CLASS3; DROP TABLE SET_OF_SIMPLE_CLASS4; DROP TABLE SET_OF_SIMPLE_INTERFACE6; DROP TABLE SET_OF_SIMPLE_INTERFACE7; DROP TABLE SET_OF_STRING9; DROP TABLE SET_OF_STRING10; DROP TABLE SET_OF_DATE12; DROP TABLE SET_OF_DATE13; DROP TABLE SET_OF_LOCALE15; DROP TABLE SET_OF_LOCALE16; DROP TABLE SET_OF_BIG_DECIMAL18; DROP TABLE SET_OF_BIG_DECIMAL19; DROP TABLE SET_OF_BIG_INTEGER21; DROP TABLE SET_OF_BIG_INTEGER22; DROP TABLE SET_OF_BYTE24; DROP TABLE SET_OF_BYTE25; DROP TABLE SET_OF_DOUBLE27; DROP TABLE SET_OF_DOUBLE28; DROP TABLE SET_OF_FLOAT30; DROP TABLE SET_OF_FLOAT31; DROP TABLE SET_OF_INTEGER33; DROP TABLE SET_OF_INTEGER34; DROP TABLE SET_OF_LONG36; DROP TABLE SET_OF_LONG37; DROP TABLE SET_OF_SHORT39; DROP TABLE SET_OF_SHORT40; DROP TABLE SET_COLLECTIONS; DROP TABLE HASHSET_OF_OBJECT0; DROP TABLE HASHSET_OF_OBJECT1; DROP TABLE HASHSET_OF_SIMPLE_CLASS3; DROP TABLE HASHSET_OF_SIMPLE_CLASS4; DROP TABLE HASHSET_OF_SIMPLE_INTERFACE6; DROP TABLE HASHSET_OF_SIMPLE_INTERFACE7; DROP TABLE HASHSET_OF_STRING9; DROP TABLE HASHSET_OF_STRING10; DROP TABLE HASHSET_OF_DATE12; DROP TABLE HASHSET_OF_DATE13; DROP TABLE HASHSET_OF_LOCALE15; DROP TABLE HASHSET_OF_LOCALE16; DROP TABLE HASHSET_OF_BIG_DECIMAL18; DROP TABLE HASHSET_OF_BIG_DECIMAL19; DROP TABLE HASHSET_OF_BIG_INTEGER21; DROP TABLE HASHSET_OF_BIG_INTEGER22; DROP TABLE HASHSET_OF_BYTE24; DROP TABLE HASHSET_OF_BYTE25; DROP TABLE HASHSET_OF_DOUBLE27; DROP TABLE HASHSET_OF_DOUBLE28; DROP TABLE HASHSET_OF_FLOAT30; DROP TABLE HASHSET_OF_FLOAT31; DROP TABLE HASHSET_OF_INTEGER33; DROP TABLE HASHSET_OF_INTEGER34; DROP TABLE HASHSET_OF_LONG36; DROP TABLE HASHSET_OF_LONG37; DROP TABLE HASHSET_OF_SHORT39; DROP TABLE HASHSET_OF_SHORT40; DROP TABLE HASHSET_COLLECTIONS; DROP TABLE TREESET_OF_OBJECT0; DROP TABLE TREESET_OF_OBJECT1; DROP TABLE TREESET_OF_OBJECT2; DROP TABLE TREESET_OF_SIMPLE_CLASS3; DROP TABLE TREESET_OF_SIMPLE_CLASS4; DROP TABLE TREESET_OF_SIMPLE_CLASS5; DROP TABLE TREESET_OF_SIMPLE_INTERFACE6; DROP TABLE TREESET_OF_SIMPLE_INTERFACE7; DROP TABLE TREESET_OF_SIMPLE_INTERFACE8; DROP TABLE TREESET_OF_STRING9; DROP TABLE TREESET_OF_STRING11; DROP TABLE TREESET_OF_DATE12; DROP TABLE TREESET_OF_DATE14; DROP TABLE TREESET_OF_BIG_DECIMAL15; DROP TABLE TREESET_OF_BIG_DECIMAL17; DROP TABLE TREESET_OF_BIG_INTEGER18; DROP TABLE TREESET_OF_BIG_INTEGER20; DROP TABLE TREESET_OF_BYTE21; DROP TABLE TREESET_OF_BYTE23; DROP TABLE TREESET_OF_DOUBLE24; DROP TABLE TREESET_OF_DOUBLE26; DROP TABLE TREESET_OF_FLOAT27; DROP TABLE TREESET_OF_FLOAT29; DROP TABLE TREESET_OF_INTEGER30; DROP TABLE TREESET_OF_INTEGER32; DROP TABLE TREESET_OF_LONG33; DROP TABLE TREESET_OF_LONG35; DROP TABLE TREESET_OF_SHORT36; DROP TABLE TREESET_OF_SHORT38; DROP TABLE TREESET_COLLECTIONS; DROP TABLE MAP_OF_STRING_OBJECT0; DROP TABLE MAP_OF_STRING_OBJECT1; DROP TABLE MAP_OF_STRING_OBJECT2; DROP TABLE MAP_OF_STRING_SIMPLE_CLASS3; DROP TABLE MAP_OF_STRING_SIMPLE_CLASS4; DROP TABLE MAP_OF_STRING_SIMPLE_CLASS5; DROP TABLE MAP_OF_STRING_SIMPLE_INTERFACE6; DROP TABLE MAP_OF_STRING_SIMPLE_INTERFACE7; DROP TABLE MAP_OF_STRING_SIMPLE_INTERFACE8; DROP TABLE MAP_OF_STRING_STRING9; DROP TABLE MAP_OF_STRING_STRING10; DROP TABLE MAP_OF_STRING_STRING11; DROP TABLE MAP_OF_STRING_DATE12; DROP TABLE MAP_OF_STRING_DATE13; DROP TABLE MAP_OF_STRING_DATE14; DROP TABLE MAP_OF_STRING_LOCALE15; DROP TABLE MAP_OF_STRING_LOCALE16; DROP TABLE MAP_OF_STRING_LOCALE17; DROP TABLE MAP_OF_STRING_BIG_DECIMAL18; DROP TABLE MAP_OF_STRING_BIG_DECIMAL19; DROP TABLE MAP_OF_STRING_BIG_DECIMAL20; DROP TABLE MAP_OF_STRING_BIG_INTEGER21; DROP TABLE MAP_OF_STRING_BIG_INTEGER22; DROP TABLE MAP_OF_STRING_BIG_INTEGER23; DROP TABLE MAP_OF_STRING_BYTE24; DROP TABLE MAP_OF_STRING_BYTE25; DROP TABLE MAP_OF_STRING_BYTE26; DROP TABLE MAP_OF_STRING_DOUBLE27; DROP TABLE MAP_OF_STRING_DOUBLE28; DROP TABLE MAP_OF_STRING_DOUBLE29; DROP TABLE MAP_OF_STRING_FLOAT30; DROP TABLE MAP_OF_STRING_FLOAT31; DROP TABLE MAP_OF_STRING_FLOAT32; DROP TABLE MAP_OF_STRING_INTEGER33; DROP TABLE MAP_OF_STRING_INTEGER34; DROP TABLE MAP_OF_STRING_INTEGER35; DROP TABLE MAP_OF_STRING_LONG36; DROP TABLE MAP_OF_STRING_LONG37; DROP TABLE MAP_OF_STRING_LONG38; DROP TABLE MAP_OF_STRING_SHORT39; DROP TABLE MAP_OF_STRING_SHORT40; DROP TABLE MAP_OF_STRING_SHORT41; DROP TABLE MAP_OF_STRING_OBJECT42; DROP TABLE MAP_OF_STRING_OBJECT43; DROP TABLE MAP_OF_STRING_SIMPLE_CLASS45; DROP TABLE MAP_OF_STRING_SIMPLE_CLASS46; DROP TABLE MAP_OF_STRING_SIMPLE_INTERFACE48; DROP TABLE MAP_OF_STRING_SIMPLE_INTERFACE49; DROP TABLE MAP_OF_STRING_STRING51; DROP TABLE MAP_OF_STRING_STRING52; DROP TABLE MAP_OF_STRING_DATE54; DROP TABLE MAP_OF_STRING_DATE55; DROP TABLE MAP_OF_STRING_LOCALE57; DROP TABLE MAP_OF_STRING_LOCALE58; DROP TABLE MAP_OF_STRING_BIG_DECIMAL60; DROP TABLE MAP_OF_STRING_BIG_DECIMAL61; DROP TABLE MAP_OF_STRING_BIG_INTEGER63; DROP TABLE MAP_OF_STRING_BIG_INTEGER64; DROP TABLE MAP_OF_STRING_BYTE66; DROP TABLE MAP_OF_STRING_BYTE67; DROP TABLE MAP_OF_STRING_DOUBLE69; DROP TABLE MAP_OF_STRING_DOUBLE70; DROP TABLE MAP_OF_STRING_FLOAT72; DROP TABLE MAP_OF_STRING_FLOAT73; DROP TABLE MAP_OF_STRING_INTEGER75; DROP TABLE MAP_OF_STRING_INTEGER76; DROP TABLE MAP_OF_STRING_LONG78; DROP TABLE MAP_OF_STRING_LONG79; DROP TABLE MAP_OF_STRING_SHORT81; DROP TABLE MAP_OF_STRING_SHORT82; DROP TABLE MAP_OF_STRING_OBJECT84; DROP TABLE MAP_OF_STRING_SIMPLE_CLASS87; DROP TABLE MAP_OF_STRING_SIMPLE_INTERFACE90; DROP TABLE MAP_OF_STRING_STRING93; DROP TABLE MAP_OF_STRING_DATE96; DROP TABLE MAP_OF_STRING_LOCALE99; DROP TABLE MAP_OF_STRING_BIG_DECIMAL102; DROP TABLE MAP_OF_STRING_BIG_INTEGER105; DROP TABLE MAP_OF_STRING_BYTE108; DROP TABLE MAP_OF_STRING_DOUBLE111; DROP TABLE MAP_OF_STRING_FLOAT114; DROP TABLE MAP_OF_STRING_INTEGER117; DROP TABLE MAP_OF_STRING_LONG120; DROP TABLE MAP_OF_STRING_SHORT123; DROP TABLE MAP_OF_STRING_SIMPLEENUM126; DROP TABLE MAP_OF_STRING_SIMPLEENUM127; DROP TABLE MAP_OF_STRING_SIMPLEENUM128; DROP TABLE MAP_OF_STRING_SIMPLEENUM129; DROP TABLE MAP_OF_STRING_SIMPLEENUM130; DROP TABLE MAP_OF_STRING_SIMPLEENUM131; DROP TABLE MAP_OF_STRING_SIMPLEENUM133; DROP TABLE MAP_OF_STRING_SIMPLEENUM134; DROP TABLE MAP_OF_STRING_SIMPLEENUM135; DROP TABLE MAP_OF_STRING_SIMPLEENUM136; DROP TABLE MAP_OF_STRING_SIMPLEENUM137; DROP TABLE MAP_OF_STRING_SIMPLEENUM138; DROP TABLE MAPSTRINGKEY_COLLECTIONS; DROP TABLE HASHMAP_STR_OBJECT0; DROP TABLE HASHMAP_STR_OBJECT1; DROP TABLE HASHMAP_STR_OBJECT2; DROP TABLE HASHMAP_STR_SIMPLE_CLASS3; DROP TABLE HASHMAP_STR_SIMPLE_CLASS4; DROP TABLE HASHMAP_STR_SIMPLE_CLASS5; DROP TABLE HASHMAP_STR_SIMPLE_INTERFACE6; DROP TABLE HASHMAP_STR_SIMPLE_INTERFACE7; DROP TABLE HASHMAP_STR_SIMPLE_INTERFACE8; DROP TABLE HASHMAP_STR_STRING9; DROP TABLE HASHMAP_STR_STRING10; DROP TABLE HASHMAP_STR_STRING11; DROP TABLE HASHMAP_STR_DATE12; DROP TABLE HASHMAP_STR_DATE13; DROP TABLE HASHMAP_STR_DATE14; DROP TABLE HASHMAP_STR_LOCALE15; DROP TABLE HASHMAP_STR_LOCALE16; DROP TABLE HASHMAP_STR_LOCALE17; DROP TABLE HASHMAP_STR_BIG_DECIMAL18; DROP TABLE HASHMAP_STR_BIG_DECIMAL19; DROP TABLE HASHMAP_STR_BIG_DECIMAL20; DROP TABLE HASHMAP_STR_BIG_INTEGER21; DROP TABLE HASHMAP_STR_BIG_INTEGER22; DROP TABLE HASHMAP_STR_BIG_INTEGER23; DROP TABLE HASHMAP_STR_BYTE24; DROP TABLE HASHMAP_STR_BYTE25; DROP TABLE HASHMAP_STR_BYTE26; DROP TABLE HASHMAP_STR_DOUBLE27; DROP TABLE HASHMAP_STR_DOUBLE28; DROP TABLE HASHMAP_STR_DOUBLE29; DROP TABLE HASHMAP_STR_FLOAT30; DROP TABLE HASHMAP_STR_FLOAT31; DROP TABLE HASHMAP_STR_FLOAT32; DROP TABLE HASHMAP_STR_INTEGER33; DROP TABLE HASHMAP_STR_INTEGER34; DROP TABLE HASHMAP_STR_INTEGER35; DROP TABLE HASHMAP_STR_LONG36; DROP TABLE HASHMAP_STR_LONG37; DROP TABLE HASHMAP_STR_LONG38; DROP TABLE HASHMAP_STR_SHORT39; DROP TABLE HASHMAP_STR_SHORT40; DROP TABLE HASHMAP_STR_SHORT41; DROP TABLE HASHMAP_STR_OBJECT42; DROP TABLE HASHMAP_STR_OBJECT43; DROP TABLE HASHMAP_STR_SIMPLE_CLASS45; DROP TABLE HASHMAP_STR_SIMPLE_CLASS46; DROP TABLE HASHMAP_STR_SIMPLE_INTERFACE48; DROP TABLE HASHMAP_STR_SIMPLE_INTERFACE49; DROP TABLE HASHMAP_STR_STRING51; DROP TABLE HASHMAP_STR_STRING52; DROP TABLE HASHMAP_STR_DATE54; DROP TABLE HASHMAP_STR_DATE55; DROP TABLE HASHMAP_STR_LOCALE57; DROP TABLE HASHMAP_STR_LOCALE58; DROP TABLE HASHMAP_STR_BIG_DECIMAL60; DROP TABLE HASHMAP_STR_BIG_DECIMAL61; DROP TABLE HASHMAP_STR_BIG_INTEGER63; DROP TABLE HASHMAP_STR_BIG_INTEGER64; DROP TABLE HASHMAP_STR_BYTE66; DROP TABLE HASHMAP_STR_BYTE67; DROP TABLE HASHMAP_STR_DOUBLE69; DROP TABLE HASHMAP_STR_DOUBLE70; DROP TABLE HASHMAP_STR_FLOAT72; DROP TABLE HASHMAP_STR_FLOAT73; DROP TABLE HASHMAP_STR_INTEGER75; DROP TABLE HASHMAP_STR_INTEGER76; DROP TABLE HASHMAP_STR_LONG78; DROP TABLE HASHMAP_STR_LONG79; DROP TABLE HASHMAP_STR_SHORT81; DROP TABLE HASHMAP_STR_SHORT82; DROP TABLE HASHMAP_STR_OBJECT84; DROP TABLE HASHMAP_STR_SIMPLE_CLASS87; DROP TABLE HASHMAP_STR_SIMPLE_INTERFACE90; DROP TABLE HASHMAP_STR_STRING93; DROP TABLE HASHMAP_STR_DATE96; DROP TABLE HASHMAP_STR_LOCALE99; DROP TABLE HASHMAP_STR_BIG_DECIMAL102; DROP TABLE HASHMAP_STR_BIG_INTEGER105; DROP TABLE HASHMAP_STR_BYTE108; DROP TABLE HASHMAP_STR_DOUBLE111; DROP TABLE HASHMAP_STR_FLOAT114; DROP TABLE HASHMAP_STR_INTEGER117; DROP TABLE HASHMAP_STR_LONG120; DROP TABLE HASHMAP_STR_SHORT123; DROP TABLE HASHMAPSTRINGKEY_COLLECTIONS; DROP TABLE MAP_OBJECT0_STR; DROP TABLE MAP_OBJECT1_STR; DROP TABLE MAP_OBJECT2_STR; DROP TABLE MAP_OBJECT3_STR; DROP TABLE MAP_OBJECT4_STR; DROP TABLE MAP_OBJECT6_STR; DROP TABLE MAP_SIMPLE_CLASS9_STR; DROP TABLE MAP_SIMPLE_CLASS10_STR; DROP TABLE MAP_SIMPLE_CLASS11_STR; DROP TABLE MAP_SIMPLE_CLASS12_STR; DROP TABLE MAP_SIMPLE_CLASS13_STR; DROP TABLE MAP_SIMPLE_CLASS15_STR; DROP TABLE MAP_SIMPLE_INTERFACE18_STR; DROP TABLE MAP_SIMPLE_INTERFACE19_STR; DROP TABLE MAP_SIMPLE_INTERFACE20_STR; DROP TABLE MAP_SIMPLE_INTERFACE21_STR; DROP TABLE MAP_SIMPLE_INTERFACE22_STR; DROP TABLE MAP_SIMPLE_INTERFACE24_STR; DROP TABLE MAP_STRING27_STR; DROP TABLE MAP_STRING28_STR; DROP TABLE MAP_STRING29_STR; DROP TABLE MAP_STRING30_STR; DROP TABLE MAP_STRING31_STR; DROP TABLE MAP_STRING33_STR; DROP TABLE MAP_DATE36_STR; DROP TABLE MAP_DATE37_STR; DROP TABLE MAP_DATE38_STR; DROP TABLE MAP_DATE39_STR; DROP TABLE MAP_DATE40_STR; DROP TABLE MAP_DATE42_STR; DROP TABLE MAP_BIG_DECIMAL45_STR; DROP TABLE MAP_BIG_DECIMAL46_STR; DROP TABLE MAP_BIG_DECIMAL47_STR; DROP TABLE MAP_BIG_DECIMAL48_STR; DROP TABLE MAP_BIG_DECIMAL49_STR; DROP TABLE MAP_BIG_DECIMAL51_STR; DROP TABLE MAP_BIG_INTEGER54_STR; DROP TABLE MAP_BIG_INTEGER55_STR; DROP TABLE MAP_BIG_INTEGER56_STR; DROP TABLE MAP_BIG_INTEGER57_STR; DROP TABLE MAP_BIG_INTEGER58_STR; DROP TABLE MAP_BIG_INTEGER60_STR; DROP TABLE MAP_BYTE63_STR; DROP TABLE MAP_BYTE64_STR; DROP TABLE MAP_BYTE65_STR; DROP TABLE MAP_BYTE66_STR; DROP TABLE MAP_BYTE67_STR; DROP TABLE MAP_BYTE69_STR; DROP TABLE MAP_DOUBLE72_STR; DROP TABLE MAP_DOUBLE73_STR; DROP TABLE MAP_DOUBLE74_STR; DROP TABLE MAP_DOUBLE75_STR; DROP TABLE MAP_DOUBLE76_STR; DROP TABLE MAP_DOUBLE78_STR; DROP TABLE MAP_FLOAT81_STR; DROP TABLE MAP_FLOAT82_STR; DROP TABLE MAP_FLOAT83_STR; DROP TABLE MAP_FLOAT84_STR; DROP TABLE MAP_FLOAT85_STR; DROP TABLE MAP_FLOAT87_STR; DROP TABLE MAP_INTEGER90_STR; DROP TABLE MAP_INTEGER91_STR; DROP TABLE MAP_INTEGER92_STR; DROP TABLE MAP_INTEGER93_STR; DROP TABLE MAP_INTEGER94_STR; DROP TABLE MAP_INTEGER96_STR; DROP TABLE MAP_LONG99_STR; DROP TABLE MAP_LONG100_STR; DROP TABLE MAP_LONG101_STR; DROP TABLE MAP_LONG102_STR; DROP TABLE MAP_LONG103_STR; DROP TABLE MAP_LONG105_STR; DROP TABLE MAP_SHORT108_STR; DROP TABLE MAP_SHORT109_STR; DROP TABLE MAP_SHORT110_STR; DROP TABLE MAP_SHORT111_STR; DROP TABLE MAP_SHORT112_STR; DROP TABLE MAP_SHORT114_STR; DROP TABLE MAP_SIMPLEENUM117_STR; DROP TABLE MAP_SIMPLEENUM118_STR; DROP TABLE MAP_SIMPLEENUM119_STR; DROP TABLE MAP_SIMPLEENUM120_STR; DROP TABLE MAP_SIMPLEENUM121_STR; DROP TABLE MAP_SIMPLEENUM122_STR; DROP TABLE MAP_SIMPLEENUM124_STR; DROP TABLE MAP_SIMPLEENUM125_STR; DROP TABLE MAP_SIMPLEENUM126_STR; DROP TABLE MAP_SIMPLEENUM127_STR; DROP TABLE MAP_SIMPLEENUM128_STR; DROP TABLE MAP_SIMPLEENUM129_STR; DROP TABLE MAPSTRINGVALUE_COLLECTIONS; DROP TABLE HASHTBL_STR_OBJECT0; DROP TABLE HASHTBL_STR_OBJECT1; DROP TABLE HASHTBL_STR_OBJECT2; DROP TABLE HASHTBL_STR_SIMPLE_CLASS3; DROP TABLE HASHTBL_STR_SIMPLE_CLASS4; DROP TABLE HASHTBL_STR_SIMPLE_CLASS5; DROP TABLE HASHTBL_STR_SIMPLE_INTERFACE6; DROP TABLE HASHTBL_STR_SIMPLE_INTERFACE7; DROP TABLE HASHTBL_STR_SIMPLE_INTERFACE8; DROP TABLE HASHTBL_STR_STRING9; DROP TABLE HASHTBL_STR_STRING10; DROP TABLE HASHTBL_STR_STRING11; DROP TABLE HASHTBL_STR_DATE12; DROP TABLE HASHTBL_STR_DATE13; DROP TABLE HASHTBL_STR_DATE14; DROP TABLE HASHTBL_STR_LOCALE15; DROP TABLE HASHTBL_STR_LOCALE16; DROP TABLE HASHTBL_STR_LOCALE17; DROP TABLE HASHTBL_STR_BIG_DECIMAL18; DROP TABLE HASHTBL_STR_BIG_DECIMAL19; DROP TABLE HASHTBL_STR_BIG_DECIMAL20; DROP TABLE HASHTBL_STR_BIG_INTEGER21; DROP TABLE HASHTBL_STR_BIG_INTEGER22; DROP TABLE HASHTBL_STR_BIG_INTEGER23; DROP TABLE HASHTBL_STR_BYTE24; DROP TABLE HASHTBL_STR_BYTE25; DROP TABLE HASHTBL_STR_BYTE26; DROP TABLE HASHTBL_STR_DOUBLE27; DROP TABLE HASHTBL_STR_DOUBLE28; DROP TABLE HASHTBL_STR_DOUBLE29; DROP TABLE HASHTBL_STR_FLOAT30; DROP TABLE HASHTBL_STR_FLOAT31; DROP TABLE HASHTBL_STR_FLOAT32; DROP TABLE HASHTBL_STR_INTEGER33; DROP TABLE HASHTBL_STR_INTEGER34; DROP TABLE HASHTBL_STR_INTEGER35; DROP TABLE HASHTBL_STR_LONG36; DROP TABLE HASHTBL_STR_LONG37; DROP TABLE HASHTBL_STR_LONG38; DROP TABLE HASHTBL_STR_SHORT39; DROP TABLE HASHTBL_STR_SHORT40; DROP TABLE HASHTBL_STR_SHORT41; DROP TABLE HASHTBL_STR_OBJECT42; DROP TABLE HASHTBL_STR_OBJECT43; DROP TABLE HASHTBL_STR_SIMPLE_CLASS45; DROP TABLE HASHTBL_STR_SIMPLE_CLASS46; DROP TABLE HASHTBL_STR_SIMPLE_INTERFACE48; DROP TABLE HASHTBL_STR_SIMPLE_INTERFACE49; DROP TABLE HASHTBL_STR_STRING51; DROP TABLE HASHTBL_STR_STRING52; DROP TABLE HASHTBL_STR_DATE54; DROP TABLE HASHTBL_STR_DATE55; DROP TABLE HASHTBL_STR_LOCALE57; DROP TABLE HASHTBL_STR_LOCALE58; DROP TABLE HASHTBL_STR_BIG_DECIMAL60; DROP TABLE HASHTBL_STR_BIG_DECIMAL61; DROP TABLE HASHTBL_STR_BIG_INTEGER63; DROP TABLE HASHTBL_STR_BIG_INTEGER64; DROP TABLE HASHTBL_STR_BYTE66; DROP TABLE HASHTBL_STR_BYTE67; DROP TABLE HASHTBL_STR_DOUBLE69; DROP TABLE HASHTBL_STR_DOUBLE70; DROP TABLE HASHTBL_STR_FLOAT72; DROP TABLE HASHTBL_STR_FLOAT73; DROP TABLE HASHTBL_STR_INTEGER75; DROP TABLE HASHTBL_STR_INTEGER76; DROP TABLE HASHTBL_STR_LONG78; DROP TABLE HASHTBL_STR_LONG79; DROP TABLE HASHTBL_STR_SHORT81; DROP TABLE HASHTBL_STR_SHORT82; DROP TABLE HASHTBL_STR_OBJECT84; DROP TABLE HASHTBL_STR_SIMPLE_CLASS87; DROP TABLE HASHTBL_STR_SIMPLE_INTERFACE90; DROP TABLE HASHTBL_STR_STRING93; DROP TABLE HASHTBL_STR_DATE96; DROP TABLE HASHTBL_STR_LOCALE99; DROP TABLE HASHTBL_STR_BIG_DECIMAL102; DROP TABLE HASHTBL_STR_BIG_INTEGER105; DROP TABLE HASHTBL_STR_BYTE108; DROP TABLE HASHTBL_STR_DOUBLE111; DROP TABLE HASHTBL_STR_FLOAT114; DROP TABLE HASHTBL_STR_INTEGER117; DROP TABLE HASHTBL_STR_LONG120; DROP TABLE HASHTBL_STR_SHORT123; DROP TABLE HASHTABLESTRINGKEY_COLLECTIONS; DROP TABLE TREEMAP_STR_OBJECT0; DROP TABLE TREEMAP_STR_OBJECT1; DROP TABLE TREEMAP_STR_OBJECT2; DROP TABLE TREEMAP_STR_SIMPLE_CLASS3; DROP TABLE TREEMAP_STR_SIMPLE_CLASS4; DROP TABLE TREEMAP_STR_SIMPLE_CLASS5; DROP TABLE TREEMAP_STR_SIMPLE_INTERFACE6; DROP TABLE TREEMAP_STR_SIMPLE_INTERFACE7; DROP TABLE TREEMAP_STR_SIMPLE_INTERFACE8; DROP TABLE TREEMAP_STR_STRING9; DROP TABLE TREEMAP_STR_STRING10; DROP TABLE TREEMAP_STR_STRING11; DROP TABLE TREEMAP_STR_DATE12; DROP TABLE TREEMAP_STR_DATE13; DROP TABLE TREEMAP_STR_DATE14; DROP TABLE TREEMAP_STR_LOCALE15; DROP TABLE TREEMAP_STR_LOCALE16; DROP TABLE TREEMAP_STR_LOCALE17; DROP TABLE TREEMAP_STR_BIG_DECIMAL18; DROP TABLE TREEMAP_STR_BIG_DECIMAL19; DROP TABLE TREEMAP_STR_BIG_DECIMAL20; DROP TABLE TREEMAP_STR_BIG_INTEGER21; DROP TABLE TREEMAP_STR_BIG_INTEGER22; DROP TABLE TREEMAP_STR_BIG_INTEGER23; DROP TABLE TREEMAP_STR_BYTE24; DROP TABLE TREEMAP_STR_BYTE25; DROP TABLE TREEMAP_STR_BYTE26; DROP TABLE TREEMAP_STR_DOUBLE27; DROP TABLE TREEMAP_STR_DOUBLE28; DROP TABLE TREEMAP_STR_DOUBLE29; DROP TABLE TREEMAP_STR_FLOAT30; DROP TABLE TREEMAP_STR_FLOAT31; DROP TABLE TREEMAP_STR_FLOAT32; DROP TABLE TREEMAP_STR_INTEGER33; DROP TABLE TREEMAP_STR_INTEGER34; DROP TABLE TREEMAP_STR_INTEGER35; DROP TABLE TREEMAP_STR_LONG36; DROP TABLE TREEMAP_STR_LONG37; DROP TABLE TREEMAP_STR_LONG38; DROP TABLE TREEMAP_STR_SHORT39; DROP TABLE TREEMAP_STR_SHORT40; DROP TABLE TREEMAP_STR_SHORT41; DROP TABLE TREEMAP_STR_OBJECT42; DROP TABLE TREEMAP_STR_OBJECT43; DROP TABLE TREEMAP_STR_SIMPLE_CLASS45; DROP TABLE TREEMAP_STR_SIMPLE_CLASS46; DROP TABLE TREEMAP_STR_SIMPLE_INTERFACE48; DROP TABLE TREEMAP_STR_SIMPLE_INTERFACE49; DROP TABLE TREEMAP_STR_STRING51; DROP TABLE TREEMAP_STR_STRING52; DROP TABLE TREEMAP_STR_DATE54; DROP TABLE TREEMAP_STR_DATE55; DROP TABLE TREEMAP_STR_LOCALE57; DROP TABLE TREEMAP_STR_LOCALE58; DROP TABLE TREEMAP_STR_BIG_DECIMAL60; DROP TABLE TREEMAP_STR_BIG_DECIMAL61; DROP TABLE TREEMAP_STR_BIG_INTEGER63; DROP TABLE TREEMAP_STR_BIG_INTEGER64; DROP TABLE TREEMAP_STR_BYTE66; DROP TABLE TREEMAP_STR_BYTE67; DROP TABLE TREEMAP_STR_DOUBLE69; DROP TABLE TREEMAP_STR_DOUBLE70; DROP TABLE TREEMAP_STR_FLOAT72; DROP TABLE TREEMAP_STR_FLOAT73; DROP TABLE TREEMAP_STR_INTEGER75; DROP TABLE TREEMAP_STR_INTEGER76; DROP TABLE TREEMAP_STR_LONG78; DROP TABLE TREEMAP_STR_LONG79; DROP TABLE TREEMAP_STR_SHORT81; DROP TABLE TREEMAP_STR_SHORT82; DROP TABLE TREEMAP_STR_OBJECT84; DROP TABLE TREEMAP_STR_SIMPLE_CLASS87; DROP TABLE TREEMAP_STR_SIMPLE_INTERFACE90; DROP TABLE TREEMAP_STR_STRING93; DROP TABLE TREEMAP_STR_DATE96; DROP TABLE TREEMAP_STR_LOCALE99; DROP TABLE TREEMAP_STR_BIG_DECIMAL102; DROP TABLE TREEMAP_STR_BIG_INTEGER105; DROP TABLE TREEMAP_STR_BYTE108; DROP TABLE TREEMAP_STR_DOUBLE111; DROP TABLE TREEMAP_STR_FLOAT114; DROP TABLE TREEMAP_STR_INTEGER117; DROP TABLE TREEMAP_STR_LONG120; DROP TABLE TREEMAP_STR_SHORT123; DROP TABLE TREEMAPSTRINGKEY_COLLECTIONS; DROP TABLE HASHMAP_OBJECT0_STR; DROP TABLE HASHMAP_OBJECT1_STR; DROP TABLE HASHMAP_OBJECT2_STR; DROP TABLE HASHMAP_OBJECT3_STR; DROP TABLE HASHMAP_OBJECT4_STR; DROP TABLE HASHMAP_OBJECT6_STR; DROP TABLE HASHMAP_SIMPLE_CLASS9_STR; DROP TABLE HASHMAP_SIMPLE_CLASS10_STR; DROP TABLE HASHMAP_SIMPLE_CLASS11_STR; DROP TABLE HASHMAP_SIMPLE_CLASS12_STR; DROP TABLE HASHMAP_SIMPLE_CLASS13_STR; DROP TABLE HASHMAP_SIMPLE_CLASS15_STR; DROP TABLE HASHMAP_SIMPLE_INTERFACE18_STR; DROP TABLE HASHMAP_SIMPLE_INTERFACE19_STR; DROP TABLE HASHMAP_SIMPLE_INTERFACE20_STR; DROP TABLE HASHMAP_SIMPLE_INTERFACE21_STR; DROP TABLE HASHMAP_SIMPLE_INTERFACE22_STR; DROP TABLE HASHMAP_SIMPLE_INTERFACE24_STR; DROP TABLE HASHMAP_STRING27_STR; DROP TABLE HASHMAP_STRING28_STR; DROP TABLE HASHMAP_STRING29_STR; DROP TABLE HASHMAP_STRING30_STR; DROP TABLE HASHMAP_STRING31_STR; DROP TABLE HASHMAP_STRING33_STR; DROP TABLE HASHMAP_DATE36_STR; DROP TABLE HASHMAP_DATE37_STR; DROP TABLE HASHMAP_DATE38_STR; DROP TABLE HASHMAP_DATE39_STR; DROP TABLE HASHMAP_DATE40_STR; DROP TABLE HASHMAP_DATE42_STR; DROP TABLE HASHMAP_BIG_DECIMAL45_STR; DROP TABLE HASHMAP_BIG_DECIMAL46_STR; DROP TABLE HASHMAP_BIG_DECIMAL47_STR; DROP TABLE HASHMAP_BIG_DECIMAL48_STR; DROP TABLE HASHMAP_BIG_DECIMAL49_STR; DROP TABLE HASHMAP_BIG_DECIMAL51_STR; DROP TABLE HASHMAP_BIG_INTEGER54_STR; DROP TABLE HASHMAP_BIG_INTEGER55_STR; DROP TABLE HASHMAP_BIG_INTEGER56_STR; DROP TABLE HASHMAP_BIG_INTEGER57_STR; DROP TABLE HASHMAP_BIG_INTEGER58_STR; DROP TABLE HASHMAP_BIG_INTEGER60_STR; DROP TABLE HASHMAP_BYTE63_STR; DROP TABLE HASHMAP_BYTE64_STR; DROP TABLE HASHMAP_BYTE65_STR; DROP TABLE HASHMAP_BYTE66_STR; DROP TABLE HASHMAP_BYTE67_STR; DROP TABLE HASHMAP_BYTE69_STR; DROP TABLE HASHMAP_DOUBLE72_STR; DROP TABLE HASHMAP_DOUBLE73_STR; DROP TABLE HASHMAP_DOUBLE74_STR; DROP TABLE HASHMAP_DOUBLE75_STR; DROP TABLE HASHMAP_DOUBLE76_STR; DROP TABLE HASHMAP_DOUBLE78_STR; DROP TABLE HASHMAP_FLOAT81_STR; DROP TABLE HASHMAP_FLOAT82_STR; DROP TABLE HASHMAP_FLOAT83_STR; DROP TABLE HASHMAP_FLOAT84_STR; DROP TABLE HASHMAP_FLOAT85_STR; DROP TABLE HASHMAP_FLOAT87_STR; DROP TABLE HASHMAP_INTEGER90_STR; DROP TABLE HASHMAP_INTEGER91_STR; DROP TABLE HASHMAP_INTEGER92_STR; DROP TABLE HASHMAP_INTEGER93_STR; DROP TABLE HASHMAP_INTEGER94_STR; DROP TABLE HASHMAP_INTEGER96_STR; DROP TABLE HASHMAP_LONG99_STR; DROP TABLE HASHMAP_LONG100_STR; DROP TABLE HASHMAP_LONG101_STR; DROP TABLE HASHMAP_LONG102_STR; DROP TABLE HASHMAP_LONG103_STR; DROP TABLE HASHMAP_LONG105_STR; DROP TABLE HASHMAP_SHORT108_STR; DROP TABLE HASHMAP_SHORT109_STR; DROP TABLE HASHMAP_SHORT110_STR; DROP TABLE HASHMAP_SHORT111_STR; DROP TABLE HASHMAP_SHORT112_STR; DROP TABLE HASHMAP_SHORT114_STR; DROP TABLE HASHMAPSTRINGVALUE_COLLECTIONS; DROP TABLE HASHTBL_OBJECT0_STR; DROP TABLE HASHTBL_OBJECT1_STR; DROP TABLE HASHTBL_OBJECT2_STR; DROP TABLE HASHTBL_OBJECT3_STR; DROP TABLE HASHTBL_OBJECT4_STR; DROP TABLE HASHTBL_OBJECT6_STR; DROP TABLE HASHTBL_SIMPLE_CLASS9_STR; DROP TABLE HASHTBL_SIMPLE_CLASS10_STR; DROP TABLE HASHTBL_SIMPLE_CLASS11_STR; DROP TABLE HASHTBL_SIMPLE_CLASS12_STR; DROP TABLE HASHTBL_SIMPLE_CLASS13_STR; DROP TABLE HASHTBL_SIMPLE_CLASS15_STR; DROP TABLE HASHTBL_SIMPLE_INTERFACE18_STR; DROP TABLE HASHTBL_SIMPLE_INTERFACE19_STR; DROP TABLE HASHTBL_SIMPLE_INTERFACE20_STR; DROP TABLE HASHTBL_SIMPLE_INTERFACE21_STR; DROP TABLE HASHTBL_SIMPLE_INTERFACE22_STR; DROP TABLE HASHTBL_SIMPLE_INTERFACE24_STR; DROP TABLE HASHTBL_STRING27_STR; DROP TABLE HASHTBL_STRING28_STR; DROP TABLE HASHTBL_STRING29_STR; DROP TABLE HASHTBL_STRING30_STR; DROP TABLE HASHTBL_STRING31_STR; DROP TABLE HASHTBL_STRING33_STR; DROP TABLE HASHTBL_DATE36_STR; DROP TABLE HASHTBL_DATE37_STR; DROP TABLE HASHTBL_DATE38_STR; DROP TABLE HASHTBL_DATE39_STR; DROP TABLE HASHTBL_DATE40_STR; DROP TABLE HASHTBL_DATE42_STR; DROP TABLE HASHTBL_BIG_DECIMAL45_STR; DROP TABLE HASHTBL_BIG_DECIMAL46_STR; DROP TABLE HASHTBL_BIG_DECIMAL47_STR; DROP TABLE HASHTBL_BIG_DECIMAL48_STR; DROP TABLE HASHTBL_BIG_DECIMAL49_STR; DROP TABLE HASHTBL_BIG_DECIMAL51_STR; DROP TABLE HASHTBL_BIG_INTEGER54_STR; DROP TABLE HASHTBL_BIG_INTEGER55_STR; DROP TABLE HASHTBL_BIG_INTEGER56_STR; DROP TABLE HASHTBL_BIG_INTEGER57_STR; DROP TABLE HASHTBL_BIG_INTEGER58_STR; DROP TABLE HASHTBL_BIG_INTEGER60_STR; DROP TABLE HASHTBL_BYTE63_STR; DROP TABLE HASHTBL_BYTE64_STR; DROP TABLE HASHTBL_BYTE65_STR; DROP TABLE HASHTBL_BYTE66_STR; DROP TABLE HASHTBL_BYTE67_STR; DROP TABLE HASHTBL_BYTE69_STR; DROP TABLE HASHTBL_DOUBLE72_STR; DROP TABLE HASHTBL_DOUBLE73_STR; DROP TABLE HASHTBL_DOUBLE74_STR; DROP TABLE HASHTBL_DOUBLE75_STR; DROP TABLE HASHTBL_DOUBLE76_STR; DROP TABLE HASHTBL_DOUBLE78_STR; DROP TABLE HASHTBL_FLOAT81_STR; DROP TABLE HASHTBL_FLOAT82_STR; DROP TABLE HASHTBL_FLOAT83_STR; DROP TABLE HASHTBL_FLOAT84_STR; DROP TABLE HASHTBL_FLOAT85_STR; DROP TABLE HASHTBL_FLOAT87_STR; DROP TABLE HASHTBL_INTEGER90_STR; DROP TABLE HASHTBL_INTEGER91_STR; DROP TABLE HASHTBL_INTEGER92_STR; DROP TABLE HASHTBL_INTEGER93_STR; DROP TABLE HASHTBL_INTEGER94_STR; DROP TABLE HASHTBL_INTEGER96_STR; DROP TABLE HASHTBL_LONG99_STR; DROP TABLE HASHTBL_LONG100_STR; DROP TABLE HASHTBL_LONG101_STR; DROP TABLE HASHTBL_LONG102_STR; DROP TABLE HASHTBL_LONG103_STR; DROP TABLE HASHTBL_LONG105_STR; DROP TABLE HASHTBL_SHORT108_STR; DROP TABLE HASHTBL_SHORT109_STR; DROP TABLE HASHTBL_SHORT110_STR; DROP TABLE HASHTBL_SHORT111_STR; DROP TABLE HASHTBL_SHORT112_STR; DROP TABLE HASHTBL_SHORT114_STR; DROP TABLE HASHTBLSTRINGVALUE_COLLECTIONS; DROP TABLE TREEMAP_OBJECT0_STR; DROP TABLE TREEMAP_OBJECT1_STR; DROP TABLE TREEMAP_OBJECT2_STR; DROP TABLE TREEMAP_OBJECT3_STR; DROP TABLE TREEMAP_OBJECT4_STR; DROP TABLE TREEMAP_OBJECT6_STR; DROP TABLE TREEMAP_SIMPLE_CLASS9_STR; DROP TABLE TREEMAP_SIMPLE_CLASS10_STR; DROP TABLE TREEMAP_SIMPLE_CLASS11_STR; DROP TABLE TREEMAP_SIMPLE_CLASS12_STR; DROP TABLE TREEMAP_SIMPLE_CLASS13_STR; DROP TABLE TREEMAP_SIMPLE_CLASS15_STR; DROP TABLE TREEMAP_SIMPLE_INTERFACE18_STR; DROP TABLE TREEMAP_SIMPLE_INTERFACE19_STR; DROP TABLE TREEMAP_SIMPLE_INTERFACE20_STR; DROP TABLE TREEMAP_SIMPLE_INTERFACE21_STR; DROP TABLE TREEMAP_SIMPLE_INTERFACE22_STR; DROP TABLE TREEMAP_SIMPLE_INTERFACE24_STR; DROP TABLE TREEMAP_STRING27_STR; DROP TABLE TREEMAP_STRING28_STR; DROP TABLE TREEMAP_STRING29_STR; DROP TABLE TREEMAP_STRING30_STR; DROP TABLE TREEMAP_STRING31_STR; DROP TABLE TREEMAP_STRING33_STR; DROP TABLE TREEMAP_DATE36_STR; DROP TABLE TREEMAP_DATE37_STR; DROP TABLE TREEMAP_DATE38_STR; DROP TABLE TREEMAP_DATE39_STR; DROP TABLE TREEMAP_DATE40_STR; DROP TABLE TREEMAP_DATE42_STR; DROP TABLE TREEMAP_BIG_DECIMAL45_STR; DROP TABLE TREEMAP_BIG_DECIMAL46_STR; DROP TABLE TREEMAP_BIG_DECIMAL47_STR; DROP TABLE TREEMAP_BIG_DECIMAL48_STR; DROP TABLE TREEMAP_BIG_DECIMAL49_STR; DROP TABLE TREEMAP_BIG_DECIMAL51_STR; DROP TABLE TREEMAP_BIG_INTEGER54_STR; DROP TABLE TREEMAP_BIG_INTEGER55_STR; DROP TABLE TREEMAP_BIG_INTEGER56_STR; DROP TABLE TREEMAP_BIG_INTEGER57_STR; DROP TABLE TREEMAP_BIG_INTEGER58_STR; DROP TABLE TREEMAP_BIG_INTEGER60_STR; DROP TABLE TREEMAP_BYTE63_STR; DROP TABLE TREEMAP_BYTE64_STR; DROP TABLE TREEMAP_BYTE65_STR; DROP TABLE TREEMAP_BYTE66_STR; DROP TABLE TREEMAP_BYTE67_STR; DROP TABLE TREEMAP_BYTE69_STR; DROP TABLE TREEMAP_DOUBLE72_STR; DROP TABLE TREEMAP_DOUBLE73_STR; DROP TABLE TREEMAP_DOUBLE74_STR; DROP TABLE TREEMAP_DOUBLE75_STR; DROP TABLE TREEMAP_DOUBLE76_STR; DROP TABLE TREEMAP_DOUBLE78_STR; DROP TABLE TREEMAP_FLOAT81_STR; DROP TABLE TREEMAP_FLOAT82_STR; DROP TABLE TREEMAP_FLOAT83_STR; DROP TABLE TREEMAP_FLOAT84_STR; DROP TABLE TREEMAP_FLOAT85_STR; DROP TABLE TREEMAP_FLOAT87_STR; DROP TABLE TREEMAP_INTEGER90_STR; DROP TABLE TREEMAP_INTEGER91_STR; DROP TABLE TREEMAP_INTEGER92_STR; DROP TABLE TREEMAP_INTEGER93_STR; DROP TABLE TREEMAP_INTEGER94_STR; DROP TABLE TREEMAP_INTEGER96_STR; DROP TABLE TREEMAP_LONG99_STR; DROP TABLE TREEMAP_LONG100_STR; DROP TABLE TREEMAP_LONG101_STR; DROP TABLE TREEMAP_LONG102_STR; DROP TABLE TREEMAP_LONG103_STR; DROP TABLE TREEMAP_LONG105_STR; DROP TABLE TREEMAP_SHORT108_STR; DROP TABLE TREEMAP_SHORT109_STR; DROP TABLE TREEMAP_SHORT110_STR; DROP TABLE TREEMAP_SHORT111_STR; DROP TABLE TREEMAP_SHORT112_STR; DROP TABLE TREEMAP_SHORT114_STR; DROP TABLE TREEMAPSTRINGVALUE_COLLECTIONS; DROP TABLE FIELDSOFSIMPLECLASS; DROP TABLE ALLTYPES; DROP TABLE FIELDSOFBYTE; DROP TABLE FIELDSOFBIGDECIMAL; DROP TABLE FIELDSOFBIGINTEGER; DROP TABLE FIELDSOFBOOLEAN; DROP TABLE FIELDSOFCHARACTER; DROP TABLE FIELDSOFDATE; DROP TABLE FIELDSOFDOUBLE; DROP TABLE FIELDSOFENUMNAME; DROP TABLE FIELDSOFFLOAT; DROP TABLE FIELDSOFINTEGER; DROP TABLE FIELDSOFLOCALE; DROP TABLE FIELDSOFLONG; DROP TABLE FIELDSOFOBJECT; DROP TABLE FIELDSOFSIMPLEINTERFACE; DROP TABLE FIELDSOFPRIMITIVEBOOLEAN; DROP TABLE FIELDSOFPRIMITIVEBYTE; DROP TABLE FIELDSOFPRIMITIVECHAR; DROP TABLE FIELDSOFPRIMITIVEDOUBLE; DROP TABLE FIELDSOFPRIMITIVEFLOAT; DROP TABLE FIELDSOFPRIMITIVEINT; DROP TABLE FIELDSOFPRIMITIVELONG; DROP TABLE FIELDSOFPRIMITIVESHORT; DROP TABLE FIELDSOFSHORT; DROP TABLE FIELDSOFSTRING; DROP TABLE SIMPLE_CLASS; CREATE TABLE SIMPLE_CLASS ( IDENTIFIER BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL, CONSTRAINT SIMPLE_CLASS_PK PRIMARY KEY (IDENTIFIER) ); CREATE TABLE ALLTYPES ( ID INTEGER NOT NULL, PRIMITIVEBOOLEAN CHAR(1) CHECK (PRIMITIVEBOOLEAN IN ('Y','N')), PRIMITIVEBYTE SMALLINT, PRIMITIVECHAR INTEGER, PRIMITIVEDOUBLE DOUBLE, PRIMITIVEFLOAT REAL, PRIMITIVEINT INTEGER, PRIMITIVELONG BIGINT, PRIMITIVESHORT SMALLINT, BOOLEANVAL CHAR(1) CHECK (BOOLEANVAL IN ('Y','N')), BYTEVAL SMALLINT, CHARACTERVAL INTEGER, DOUBLEVAL DOUBLE, FLOATVAL REAL, INTEGERVAL INTEGER, LONGVAL BIGINT, SHORTVAL SMALLINT, STRINGVAL VARCHAR(255), LOCALEVAL CHAR(20), DATEVAL TIMESTAMP, BIGDECIMALVAL DECIMAL(25,10), BIGINTEGERVAL NUMERIC(31) ); ALTER TABLE ALLTYPES ADD CONSTRAINT ALLTYPES_PK PRIMARY KEY (ID); CREATE TABLE FIELDSOFBIGDECIMAL ( IDENTIFIER INTEGER NOT NULL, BIG_DECIMAL0 DECIMAL(27,16), BIG_DECIMAL1 DECIMAL(27,16), BIG_DECIMAL102 DECIMAL(27,16), BIG_DECIMAL103 DECIMAL(27,16), BIG_DECIMAL104 DECIMAL(27,16), BIG_DECIMAL108 DECIMAL(27,16), BIG_DECIMAL109 DECIMAL(27,16), BIG_DECIMAL11 DECIMAL(27,16), BIG_DECIMAL110 DECIMAL(27,16), BIG_DECIMAL112 DECIMAL(27,16), BIG_DECIMAL113 DECIMAL(27,16), BIG_DECIMAL114 DECIMAL(27,16), BIG_DECIMAL119 DECIMAL(27,16), BIG_DECIMAL12 DECIMAL(27,16), BIG_DECIMAL120 DECIMAL(27,16), BIG_DECIMAL121 DECIMAL(27,16), BIG_DECIMAL124 DECIMAL(27,16), BIG_DECIMAL125 DECIMAL(27,16), BIG_DECIMAL126 DECIMAL(27,16), BIG_DECIMAL128 DECIMAL(27,16), BIG_DECIMAL129 DECIMAL(27,16), BIG_DECIMAL13 DECIMAL(27,16), BIG_DECIMAL130 DECIMAL(27,16), BIG_DECIMAL138 DECIMAL(27,16), BIG_DECIMAL139 DECIMAL(27,16), BIG_DECIMAL140 DECIMAL(27,16), BIG_DECIMAL16 DECIMAL(27,16), BIG_DECIMAL17 DECIMAL(27,16), BIG_DECIMAL18 DECIMAL(27,16), BIG_DECIMAL2 DECIMAL(27,16), BIG_DECIMAL20 DECIMAL(27,16), BIG_DECIMAL21 DECIMAL(27,16), BIG_DECIMAL22 DECIMAL(27,16), BIG_DECIMAL30 DECIMAL(27,16), BIG_DECIMAL31 DECIMAL(27,16), BIG_DECIMAL32 DECIMAL(27,16), BIG_DECIMAL36 DECIMAL(27,16), BIG_DECIMAL37 DECIMAL(27,16), BIG_DECIMAL38 DECIMAL(27,16), BIG_DECIMAL4 DECIMAL(27,16), BIG_DECIMAL40 DECIMAL(27,16), BIG_DECIMAL41 DECIMAL(27,16), BIG_DECIMAL42 DECIMAL(27,16), BIG_DECIMAL47 DECIMAL(27,16), BIG_DECIMAL48 DECIMAL(27,16), BIG_DECIMAL49 DECIMAL(27,16), BIG_DECIMAL5 DECIMAL(27,16), BIG_DECIMAL52 DECIMAL(27,16), BIG_DECIMAL53 DECIMAL(27,16), BIG_DECIMAL54 DECIMAL(27,16), BIG_DECIMAL56 DECIMAL(27,16), BIG_DECIMAL57 DECIMAL(27,16), BIG_DECIMAL58 DECIMAL(27,16), BIG_DECIMAL6 DECIMAL(27,16), BIG_DECIMAL66 DECIMAL(27,16), BIG_DECIMAL67 DECIMAL(27,16), BIG_DECIMAL68 DECIMAL(27,16), BIG_DECIMAL72 DECIMAL(27,16), BIG_DECIMAL73 DECIMAL(27,16), BIG_DECIMAL74 DECIMAL(27,16), BIG_DECIMAL76 DECIMAL(27,16), BIG_DECIMAL77 DECIMAL(27,16), BIG_DECIMAL78 DECIMAL(27,16), BIG_DECIMAL83 DECIMAL(27,16), BIG_DECIMAL84 DECIMAL(27,16), BIG_DECIMAL85 DECIMAL(27,16), BIG_DECIMAL88 DECIMAL(27,16), BIG_DECIMAL89 DECIMAL(27,16), BIG_DECIMAL90 DECIMAL(27,16), BIG_DECIMAL92 DECIMAL(27,16), BIG_DECIMAL93 DECIMAL(27,16), BIG_DECIMAL94 DECIMAL(27,16) ); ALTER TABLE FIELDSOFBIGDECIMAL ADD CONSTRAINT FIELDSOFBIGDPP_PK PRIMARY KEY (IDENTIFIER); CREATE TABLE FIELDSOFBIGINTEGER ( IDENTIFIER INTEGER NOT NULL, BIG_INTEGER0 NUMERIC(31), BIG_INTEGER1 NUMERIC(31), BIG_INTEGER102 NUMERIC(31), BIG_INTEGER103 NUMERIC(31), BIG_INTEGER104 NUMERIC(31), BIG_INTEGER108 NUMERIC(31), BIG_INTEGER109 NUMERIC(31), BIG_INTEGER11 NUMERIC(31), BIG_INTEGER110 NUMERIC(31), BIG_INTEGER112 NUMERIC(31), BIG_INTEGER113 NUMERIC(31), BIG_INTEGER114 NUMERIC(31), BIG_INTEGER119 NUMERIC(31), BIG_INTEGER12 NUMERIC(31), BIG_INTEGER120 NUMERIC(31), BIG_INTEGER121 NUMERIC(31), BIG_INTEGER124 NUMERIC(31), BIG_INTEGER125 NUMERIC(31), BIG_INTEGER126 NUMERIC(31), BIG_INTEGER128 NUMERIC(31), BIG_INTEGER129 NUMERIC(31), BIG_INTEGER13 NUMERIC(31), BIG_INTEGER130 NUMERIC(31), BIG_INTEGER138 NUMERIC(31), BIG_INTEGER139 NUMERIC(31), BIG_INTEGER140 NUMERIC(31), BIG_INTEGER16 NUMERIC(31), BIG_INTEGER17 NUMERIC(31), BIG_INTEGER18 NUMERIC(31), BIG_INTEGER2 NUMERIC(31), BIG_INTEGER20 NUMERIC(31), BIG_INTEGER21 NUMERIC(31), BIG_INTEGER22 NUMERIC(31), BIG_INTEGER30 NUMERIC(31), BIG_INTEGER31 NUMERIC(31), BIG_INTEGER32 NUMERIC(31), BIG_INTEGER36 NUMERIC(31), BIG_INTEGER37 NUMERIC(31), BIG_INTEGER38 NUMERIC(31), BIG_INTEGER4 NUMERIC(31), BIG_INTEGER40 NUMERIC(31), BIG_INTEGER41 NUMERIC(31), BIG_INTEGER42 NUMERIC(31), BIG_INTEGER47 NUMERIC(31), BIG_INTEGER48 NUMERIC(31), BIG_INTEGER49 NUMERIC(31), BIG_INTEGER5 NUMERIC(31), BIG_INTEGER52 NUMERIC(31), BIG_INTEGER53 NUMERIC(31), BIG_INTEGER54 NUMERIC(31), BIG_INTEGER56 NUMERIC(31), BIG_INTEGER57 NUMERIC(31), BIG_INTEGER58 NUMERIC(31), BIG_INTEGER6 NUMERIC(31), BIG_INTEGER66 NUMERIC(31), BIG_INTEGER67 NUMERIC(31), BIG_INTEGER68 NUMERIC(31), BIG_INTEGER72 NUMERIC(31), BIG_INTEGER73 NUMERIC(31), BIG_INTEGER74 NUMERIC(31), BIG_INTEGER76 NUMERIC(31), BIG_INTEGER77 NUMERIC(31), BIG_INTEGER78 NUMERIC(31), BIG_INTEGER83 NUMERIC(31), BIG_INTEGER84 NUMERIC(31), BIG_INTEGER85 NUMERIC(31), BIG_INTEGER88 NUMERIC(31), BIG_INTEGER89 NUMERIC(31), BIG_INTEGER90 NUMERIC(31), BIG_INTEGER92 NUMERIC(31), BIG_INTEGER93 NUMERIC(31), BIG_INTEGER94 NUMERIC(31) ); ALTER TABLE FIELDSOFBIGINTEGER ADD CONSTRAINT FIELDSOFBIGI2S_PK PRIMARY KEY (IDENTIFIER); CREATE TABLE FIELDSOFBOOLEAN ( IDENTIFIER INTEGER NOT NULL, BOOLEAN0 CHAR(1) CHECK (BOOLEAN0 IN ('Y','N') OR BOOLEAN0 IS NULL), BOOLEAN1 CHAR(1) CHECK (BOOLEAN1 IN ('Y','N') OR BOOLEAN1 IS NULL), BOOLEAN102 CHAR(1) CHECK (BOOLEAN102 IN ('Y','N') OR BOOLEAN102 IS NULL), BOOLEAN103 CHAR(1) CHECK (BOOLEAN103 IN ('Y','N') OR BOOLEAN103 IS NULL), BOOLEAN104 CHAR(1) CHECK (BOOLEAN104 IN ('Y','N') OR BOOLEAN104 IS NULL), BOOLEAN108 CHAR(1) CHECK (BOOLEAN108 IN ('Y','N') OR BOOLEAN108 IS NULL), BOOLEAN109 CHAR(1) CHECK (BOOLEAN109 IN ('Y','N') OR BOOLEAN109 IS NULL), BOOLEAN11 CHAR(1) CHECK (BOOLEAN11 IN ('Y','N') OR BOOLEAN11 IS NULL), BOOLEAN110 CHAR(1) CHECK (BOOLEAN110 IN ('Y','N') OR BOOLEAN110 IS NULL), BOOLEAN112 CHAR(1) CHECK (BOOLEAN112 IN ('Y','N') OR BOOLEAN112 IS NULL), BOOLEAN113 CHAR(1) CHECK (BOOLEAN113 IN ('Y','N') OR BOOLEAN113 IS NULL), BOOLEAN114 CHAR(1) CHECK (BOOLEAN114 IN ('Y','N') OR BOOLEAN114 IS NULL), BOOLEAN119 CHAR(1) CHECK (BOOLEAN119 IN ('Y','N') OR BOOLEAN119 IS NULL), BOOLEAN12 CHAR(1) CHECK (BOOLEAN12 IN ('Y','N') OR BOOLEAN12 IS NULL), BOOLEAN120 CHAR(1) CHECK (BOOLEAN120 IN ('Y','N') OR BOOLEAN120 IS NULL), BOOLEAN121 CHAR(1) CHECK (BOOLEAN121 IN ('Y','N') OR BOOLEAN121 IS NULL), BOOLEAN124 CHAR(1) CHECK (BOOLEAN124 IN ('Y','N') OR BOOLEAN124 IS NULL), BOOLEAN125 CHAR(1) CHECK (BOOLEAN125 IN ('Y','N') OR BOOLEAN125 IS NULL), BOOLEAN126 CHAR(1) CHECK (BOOLEAN126 IN ('Y','N') OR BOOLEAN126 IS NULL), BOOLEAN128 CHAR(1) CHECK (BOOLEAN128 IN ('Y','N') OR BOOLEAN128 IS NULL), BOOLEAN129 CHAR(1) CHECK (BOOLEAN129 IN ('Y','N') OR BOOLEAN129 IS NULL), BOOLEAN13 CHAR(1) CHECK (BOOLEAN13 IN ('Y','N') OR BOOLEAN13 IS NULL), BOOLEAN130 CHAR(1) CHECK (BOOLEAN130 IN ('Y','N') OR BOOLEAN130 IS NULL), BOOLEAN138 CHAR(1) CHECK (BOOLEAN138 IN ('Y','N') OR BOOLEAN138 IS NULL), BOOLEAN139 CHAR(1) CHECK (BOOLEAN139 IN ('Y','N') OR BOOLEAN139 IS NULL), BOOLEAN140 CHAR(1) CHECK (BOOLEAN140 IN ('Y','N') OR BOOLEAN140 IS NULL), BOOLEAN16 CHAR(1) CHECK (BOOLEAN16 IN ('Y','N') OR BOOLEAN16 IS NULL), BOOLEAN17 CHAR(1) CHECK (BOOLEAN17 IN ('Y','N') OR BOOLEAN17 IS NULL), BOOLEAN18 CHAR(1) CHECK (BOOLEAN18 IN ('Y','N') OR BOOLEAN18 IS NULL), BOOLEAN2 CHAR(1) CHECK (BOOLEAN2 IN ('Y','N') OR BOOLEAN2 IS NULL), BOOLEAN20 CHAR(1) CHECK (BOOLEAN20 IN ('Y','N') OR BOOLEAN20 IS NULL), BOOLEAN21 CHAR(1) CHECK (BOOLEAN21 IN ('Y','N') OR BOOLEAN21 IS NULL), BOOLEAN22 CHAR(1) CHECK (BOOLEAN22 IN ('Y','N') OR BOOLEAN22 IS NULL), BOOLEAN30 CHAR(1) CHECK (BOOLEAN30 IN ('Y','N') OR BOOLEAN30 IS NULL), BOOLEAN31 CHAR(1) CHECK (BOOLEAN31 IN ('Y','N') OR BOOLEAN31 IS NULL), BOOLEAN32 CHAR(1) CHECK (BOOLEAN32 IN ('Y','N') OR BOOLEAN32 IS NULL), BOOLEAN36 CHAR(1) CHECK (BOOLEAN36 IN ('Y','N') OR BOOLEAN36 IS NULL), BOOLEAN37 CHAR(1) CHECK (BOOLEAN37 IN ('Y','N') OR BOOLEAN37 IS NULL), BOOLEAN38 CHAR(1) CHECK (BOOLEAN38 IN ('Y','N') OR BOOLEAN38 IS NULL), BOOLEAN4 CHAR(1) CHECK (BOOLEAN4 IN ('Y','N') OR BOOLEAN4 IS NULL), BOOLEAN40 CHAR(1) CHECK (BOOLEAN40 IN ('Y','N') OR BOOLEAN40 IS NULL), BOOLEAN41 CHAR(1) CHECK (BOOLEAN41 IN ('Y','N') OR BOOLEAN41 IS NULL), BOOLEAN42 CHAR(1) CHECK (BOOLEAN42 IN ('Y','N') OR BOOLEAN42 IS NULL), BOOLEAN47 CHAR(1) CHECK (BOOLEAN47 IN ('Y','N') OR BOOLEAN47 IS NULL), BOOLEAN48 CHAR(1) CHECK (BOOLEAN48 IN ('Y','N') OR BOOLEAN48 IS NULL), BOOLEAN49 CHAR(1) CHECK (BOOLEAN49 IN ('Y','N') OR BOOLEAN49 IS NULL), BOOLEAN5 CHAR(1) CHECK (BOOLEAN5 IN ('Y','N') OR BOOLEAN5 IS NULL), BOOLEAN52 CHAR(1) CHECK (BOOLEAN52 IN ('Y','N') OR BOOLEAN52 IS NULL), BOOLEAN53 CHAR(1) CHECK (BOOLEAN53 IN ('Y','N') OR BOOLEAN53 IS NULL), BOOLEAN54 CHAR(1) CHECK (BOOLEAN54 IN ('Y','N') OR BOOLEAN54 IS NULL), BOOLEAN56 CHAR(1) CHECK (BOOLEAN56 IN ('Y','N') OR BOOLEAN56 IS NULL), BOOLEAN57 CHAR(1) CHECK (BOOLEAN57 IN ('Y','N') OR BOOLEAN57 IS NULL), BOOLEAN58 CHAR(1) CHECK (BOOLEAN58 IN ('Y','N') OR BOOLEAN58 IS NULL), BOOLEAN6 CHAR(1) CHECK (BOOLEAN6 IN ('Y','N') OR BOOLEAN6 IS NULL), BOOLEAN66 CHAR(1) CHECK (BOOLEAN66 IN ('Y','N') OR BOOLEAN66 IS NULL), BOOLEAN67 CHAR(1) CHECK (BOOLEAN67 IN ('Y','N') OR BOOLEAN67 IS NULL), BOOLEAN68 CHAR(1) CHECK (BOOLEAN68 IN ('Y','N') OR BOOLEAN68 IS NULL), BOOLEAN72 CHAR(1) CHECK (BOOLEAN72 IN ('Y','N') OR BOOLEAN72 IS NULL), BOOLEAN73 CHAR(1) CHECK (BOOLEAN73 IN ('Y','N') OR BOOLEAN73 IS NULL), BOOLEAN74 CHAR(1) CHECK (BOOLEAN74 IN ('Y','N') OR BOOLEAN74 IS NULL), BOOLEAN76 CHAR(1) CHECK (BOOLEAN76 IN ('Y','N') OR BOOLEAN76 IS NULL), BOOLEAN77 CHAR(1) CHECK (BOOLEAN77 IN ('Y','N') OR BOOLEAN77 IS NULL), BOOLEAN78 CHAR(1) CHECK (BOOLEAN78 IN ('Y','N') OR BOOLEAN78 IS NULL), BOOLEAN83 CHAR(1) CHECK (BOOLEAN83 IN ('Y','N') OR BOOLEAN83 IS NULL), BOOLEAN84 CHAR(1) CHECK (BOOLEAN84 IN ('Y','N') OR BOOLEAN84 IS NULL), BOOLEAN85 CHAR(1) CHECK (BOOLEAN85 IN ('Y','N') OR BOOLEAN85 IS NULL), BOOLEAN88 CHAR(1) CHECK (BOOLEAN88 IN ('Y','N') OR BOOLEAN88 IS NULL), BOOLEAN89 CHAR(1) CHECK (BOOLEAN89 IN ('Y','N') OR BOOLEAN89 IS NULL), BOOLEAN90 CHAR(1) CHECK (BOOLEAN90 IN ('Y','N') OR BOOLEAN90 IS NULL), BOOLEAN92 CHAR(1) CHECK (BOOLEAN92 IN ('Y','N') OR BOOLEAN92 IS NULL), BOOLEAN93 CHAR(1) CHECK (BOOLEAN93 IN ('Y','N') OR BOOLEAN93 IS NULL), BOOLEAN94 CHAR(1) CHECK (BOOLEAN94 IN ('Y','N') OR BOOLEAN94 IS NULL) ); ALTER TABLE FIELDSOFBOOLEAN ADD CONSTRAINT FIELDSOFBOOLS2_PK PRIMARY KEY (IDENTIFIER); CREATE TABLE FIELDSOFCHARACTER ( IDENTIFIER INTEGER NOT NULL, CHARACTER0 INTEGER, CHARACTER1 INTEGER, CHARACTER102 INTEGER, CHARACTER103 INTEGER, CHARACTER104 INTEGER, CHARACTER108 INTEGER, CHARACTER109 INTEGER, CHARACTER11 INTEGER, CHARACTER110 INTEGER, CHARACTER112 INTEGER, CHARACTER113 INTEGER, CHARACTER114 INTEGER, CHARACTER119 INTEGER, CHARACTER12 INTEGER, CHARACTER120 INTEGER, CHARACTER121 INTEGER, CHARACTER124 INTEGER, CHARACTER125 INTEGER, CHARACTER126 INTEGER, CHARACTER128 INTEGER, CHARACTER129 INTEGER, CHARACTER13 INTEGER, CHARACTER130 INTEGER, CHARACTER138 INTEGER, CHARACTER139 INTEGER, CHARACTER140 INTEGER, CHARACTER16 INTEGER, CHARACTER17 INTEGER, CHARACTER18 INTEGER, CHARACTER2 INTEGER, CHARACTER20 INTEGER, CHARACTER21 INTEGER, CHARACTER22 INTEGER, CHARACTER30 INTEGER, CHARACTER31 INTEGER, CHARACTER32 INTEGER, CHARACTER36 INTEGER, CHARACTER37 INTEGER, CHARACTER38 INTEGER, CHARACTER4 INTEGER, CHARACTER40 INTEGER, CHARACTER41 INTEGER, CHARACTER42 INTEGER, CHARACTER47 INTEGER, CHARACTER48 INTEGER, CHARACTER49 INTEGER, CHARACTER5 INTEGER, CHARACTER52 INTEGER, CHARACTER53 INTEGER, CHARACTER54 INTEGER, CHARACTER56 INTEGER, CHARACTER57 INTEGER, CHARACTER58 INTEGER, CHARACTER6 INTEGER, CHARACTER66 INTEGER, CHARACTER67 INTEGER, CHARACTER68 INTEGER, CHARACTER72 INTEGER, CHARACTER73 INTEGER, CHARACTER74 INTEGER, CHARACTER76 INTEGER, CHARACTER77 INTEGER, CHARACTER78 INTEGER, CHARACTER83 INTEGER, CHARACTER84 INTEGER, CHARACTER85 INTEGER, CHARACTER88 INTEGER, CHARACTER89 INTEGER, CHARACTER90 INTEGER, CHARACTER92 INTEGER, CHARACTER93 INTEGER, CHARACTER94 INTEGER ); ALTER TABLE FIELDSOFCHARACTER ADD CONSTRAINT FIELDSOFCHAROV_PK PRIMARY KEY (IDENTIFIER); CREATE TABLE FIELDSOFDATE ( IDENTIFIER INTEGER NOT NULL, DATE0 TIMESTAMP, DATE1 TIMESTAMP, DATE102 TIMESTAMP, DATE103 TIMESTAMP, DATE104 TIMESTAMP, DATE108 TIMESTAMP, DATE109 TIMESTAMP, DATE11 TIMESTAMP, DATE110 TIMESTAMP, DATE112 TIMESTAMP, DATE113 TIMESTAMP, DATE114 TIMESTAMP, DATE119 TIMESTAMP, DATE12 TIMESTAMP, DATE120 TIMESTAMP, DATE121 TIMESTAMP, DATE124 TIMESTAMP, DATE125 TIMESTAMP, DATE126 TIMESTAMP, DATE128 TIMESTAMP, DATE129 TIMESTAMP, DATE13 TIMESTAMP, DATE130 TIMESTAMP, DATE138 TIMESTAMP, DATE139 TIMESTAMP, DATE140 TIMESTAMP, DATE16 TIMESTAMP, DATE17 TIMESTAMP, DATE18 TIMESTAMP, DATE2 TIMESTAMP, DATE20 TIMESTAMP, DATE21 TIMESTAMP, DATE22 TIMESTAMP, DATE30 TIMESTAMP, DATE31 TIMESTAMP, DATE32 TIMESTAMP, DATE36 TIMESTAMP, DATE37 TIMESTAMP, DATE38 TIMESTAMP, DATE4 TIMESTAMP, DATE40 TIMESTAMP, DATE41 TIMESTAMP, DATE42 TIMESTAMP, DATE47 TIMESTAMP, DATE48 TIMESTAMP, DATE49 TIMESTAMP, DATE5 TIMESTAMP, DATE52 TIMESTAMP, DATE53 TIMESTAMP, DATE54 TIMESTAMP, DATE56 TIMESTAMP, DATE57 TIMESTAMP, DATE58 TIMESTAMP, DATE6 TIMESTAMP, DATE66 TIMESTAMP, DATE67 TIMESTAMP, DATE68 TIMESTAMP, DATE72 TIMESTAMP, DATE73 TIMESTAMP, DATE74 TIMESTAMP, DATE76 TIMESTAMP, DATE77 TIMESTAMP, DATE78 TIMESTAMP, DATE83 TIMESTAMP, DATE84 TIMESTAMP, DATE85 TIMESTAMP, DATE88 TIMESTAMP, DATE89 TIMESTAMP, DATE90 TIMESTAMP, DATE92 TIMESTAMP, DATE93 TIMESTAMP, DATE94 TIMESTAMP ); ALTER TABLE FIELDSOFDATE ADD CONSTRAINT FIELDSOFDATE_PK PRIMARY KEY (IDENTIFIER); CREATE TABLE FIELDSOFDOUBLE ( IDENTIFIER INTEGER NOT NULL, DOUBLE0 DOUBLE, DOUBLE1 DOUBLE, DOUBLE102 DOUBLE, DOUBLE103 DOUBLE, DOUBLE104 DOUBLE, DOUBLE108 DOUBLE, DOUBLE109 DOUBLE, DOUBLE11 DOUBLE, DOUBLE110 DOUBLE, DOUBLE112 DOUBLE, DOUBLE113 DOUBLE, DOUBLE114 DOUBLE, DOUBLE119 DOUBLE, DOUBLE12 DOUBLE, DOUBLE120 DOUBLE, DOUBLE121 DOUBLE, DOUBLE124 DOUBLE, DOUBLE125 DOUBLE, DOUBLE126 DOUBLE, DOUBLE128 DOUBLE, DOUBLE129 DOUBLE, DOUBLE13 DOUBLE, DOUBLE130 DOUBLE, DOUBLE138 DOUBLE, DOUBLE139 DOUBLE, DOUBLE140 DOUBLE, DOUBLE16 DOUBLE, DOUBLE17 DOUBLE, DOUBLE18 DOUBLE, DOUBLE2 DOUBLE, DOUBLE20 DOUBLE, DOUBLE21 DOUBLE, DOUBLE22 DOUBLE, DOUBLE30 DOUBLE, DOUBLE31 DOUBLE, DOUBLE32 DOUBLE, DOUBLE36 DOUBLE, DOUBLE37 DOUBLE, DOUBLE38 DOUBLE, DOUBLE4 DOUBLE, DOUBLE40 DOUBLE, DOUBLE41 DOUBLE, DOUBLE42 DOUBLE, DOUBLE47 DOUBLE, DOUBLE48 DOUBLE, DOUBLE49 DOUBLE, DOUBLE5 DOUBLE, DOUBLE52 DOUBLE, DOUBLE53 DOUBLE, DOUBLE54 DOUBLE, DOUBLE56 DOUBLE, DOUBLE57 DOUBLE, DOUBLE58 DOUBLE, DOUBLE6 DOUBLE, DOUBLE66 DOUBLE, DOUBLE67 DOUBLE, DOUBLE68 DOUBLE, DOUBLE72 DOUBLE, DOUBLE73 DOUBLE, DOUBLE74 DOUBLE, DOUBLE76 DOUBLE, DOUBLE77 DOUBLE, DOUBLE78 DOUBLE, DOUBLE83 DOUBLE, DOUBLE84 DOUBLE, DOUBLE85 DOUBLE, DOUBLE88 DOUBLE, DOUBLE89 DOUBLE, DOUBLE90 DOUBLE, DOUBLE92 DOUBLE, DOUBLE93 DOUBLE, DOUBLE94 DOUBLE ); ALTER TABLE FIELDSOFDOUBLE ADD CONSTRAINT FIELDSOFDOUBLE_PK PRIMARY KEY (IDENTIFIER); CREATE TABLE FIELDSOFENUMNAME ( IDENTIFIER INTEGER NOT NULL, ENUM0 CHAR(2), ENUM1 CHAR(2), ENUM102 CHAR(2), ENUM103 CHAR(2), ENUM104 VARCHAR(256), ENUM108 VARCHAR(256), ENUM109 VARCHAR(256), ENUM11 VARCHAR(256), ENUM110 CHAR(2), ENUM112 CHAR(2), ENUM113 CHAR(2), ENUM114 CHAR(2), ENUM119 VARCHAR(256), ENUM12 VARCHAR(256), ENUM120 VARCHAR(256), ENUM121 VARCHAR(256), ENUM124 CHAR(2), ENUM125 CHAR(2), ENUM126 CHAR(2), ENUM128 CHAR(2), ENUM129 VARCHAR(256), ENUM13 VARCHAR(256), ENUM130 VARCHAR(256), ENUM138 VARCHAR(256), ENUM139 CHAR(2), ENUM140 CHAR(2), ENUM16 CHAR(2), ENUM17 CHAR(2), ENUM18 VARCHAR(256), ENUM2 VARCHAR(256), ENUM20 VARCHAR(256), ENUM21 VARCHAR(256), ENUM22 CHAR(2), ENUM30 CHAR(2), ENUM31 CHAR(2), ENUM32 CHAR(2), ENUM36 VARCHAR(256), ENUM37 VARCHAR(256), ENUM38 VARCHAR(256), ENUM4 VARCHAR(256), ENUM40 CHAR(2), ENUM41 CHAR(2), ENUM42 CHAR(2), ENUM47 CHAR(2), ENUM48 VARCHAR(256), ENUM49 VARCHAR(256), ENUM5 VARCHAR(256), ENUM52 VARCHAR(256), ENUM53 CHAR(2), ENUM54 CHAR(2), ENUM56 CHAR(2), ENUM57 CHAR(2), ENUM58 VARCHAR(256), ENUM6 VARCHAR(256), ENUM66 VARCHAR(256), ENUM67 VARCHAR(256), ENUM68 CHAR(2), ENUM72 CHAR(2), ENUM73 CHAR(2), ENUM74 CHAR(2), ENUM76 VARCHAR(256), ENUM77 VARCHAR(256), ENUM78 VARCHAR(256), ENUM83 VARCHAR(256), ENUM84 CHAR(2), ENUM85 CHAR(2), ENUM88 CHAR(2), ENUM89 CHAR(2), ENUM90 VARCHAR(256), ENUM92 VARCHAR(256), ENUM93 VARCHAR(256), ENUM94 VARCHAR(256) ); ALTER TABLE FIELDSOFENUMNAME ADD CONSTRAINT FIELDSOFENUMNAME_PK PRIMARY KEY (IDENTIFIER); CREATE TABLE FIELDSOFFLOAT ( IDENTIFIER INTEGER NOT NULL, FLOAT0 REAL, FLOAT1 REAL, FLOAT102 REAL, FLOAT103 REAL, FLOAT104 REAL, FLOAT108 REAL, FLOAT109 REAL, FLOAT11 REAL, FLOAT110 REAL, FLOAT112 REAL, FLOAT113 REAL, FLOAT114 REAL, FLOAT119 REAL, FLOAT12 REAL, FLOAT120 REAL, FLOAT121 REAL, FLOAT124 REAL, FLOAT125 REAL, FLOAT126 REAL, FLOAT128 REAL, FLOAT129 REAL, FLOAT13 REAL, FLOAT130 REAL, FLOAT138 REAL, FLOAT139 REAL, FLOAT140 REAL, FLOAT16 REAL, FLOAT17 REAL, FLOAT18 REAL, FLOAT2 REAL, FLOAT20 REAL, FLOAT21 REAL, FLOAT22 REAL, FLOAT30 REAL, FLOAT31 REAL, FLOAT32 REAL, FLOAT36 REAL, FLOAT37 REAL, FLOAT38 REAL, FLOAT4 REAL, FLOAT40 REAL, FLOAT41 REAL, FLOAT42 REAL, FLOAT47 REAL, FLOAT48 REAL, FLOAT49 REAL, FLOAT5 REAL, FLOAT52 REAL, FLOAT53 REAL, FLOAT54 REAL, FLOAT56 REAL, FLOAT57 REAL, FLOAT58 REAL, FLOAT6 REAL, FLOAT66 REAL, FLOAT67 REAL, FLOAT68 REAL, FLOAT72 REAL, FLOAT73 REAL, FLOAT74 REAL, FLOAT76 REAL, FLOAT77 REAL, FLOAT78 REAL, FLOAT83 REAL, FLOAT84 REAL, FLOAT85 REAL, FLOAT88 REAL, FLOAT89 REAL, FLOAT90 REAL, FLOAT92 REAL, FLOAT93 REAL, FLOAT94 REAL ); ALTER TABLE FIELDSOFFLOAT ADD CONSTRAINT FIELDSOFFLOAT_PK PRIMARY KEY (IDENTIFIER); CREATE TABLE FIELDSOFINTEGER ( IDENTIFIER INTEGER NOT NULL, INTEGER0 INTEGER, INTEGER1 INTEGER, INTEGER102 INTEGER, INTEGER103 INTEGER, INTEGER104 INTEGER, INTEGER108 INTEGER, INTEGER109 INTEGER, INTEGER11 INTEGER, INTEGER110 INTEGER, INTEGER112 INTEGER, INTEGER113 INTEGER, INTEGER114 INTEGER, INTEGER119 INTEGER, INTEGER12 INTEGER, INTEGER120 INTEGER, INTEGER121 INTEGER, INTEGER124 INTEGER, INTEGER125 INTEGER, INTEGER126 INTEGER, INTEGER128 INTEGER, INTEGER129 INTEGER, INTEGER13 INTEGER, INTEGER130 INTEGER, INTEGER138 INTEGER, INTEGER139 INTEGER, INTEGER140 INTEGER, INTEGER16 INTEGER, INTEGER17 INTEGER, INTEGER18 INTEGER, INTEGER2 INTEGER, INTEGER20 INTEGER, INTEGER21 INTEGER, INTEGER22 INTEGER, INTEGER30 INTEGER, INTEGER31 INTEGER, INTEGER32 INTEGER, INTEGER36 INTEGER, INTEGER37 INTEGER, INTEGER38 INTEGER, INTEGER4 INTEGER, INTEGER40 INTEGER, INTEGER41 INTEGER, INTEGER42 INTEGER, INTEGER47 INTEGER, INTEGER48 INTEGER, INTEGER49 INTEGER, INTEGER5 INTEGER, INTEGER52 INTEGER, INTEGER53 INTEGER, INTEGER54 INTEGER, INTEGER56 INTEGER, INTEGER57 INTEGER, INTEGER58 INTEGER, INTEGER6 INTEGER, INTEGER66 INTEGER, INTEGER67 INTEGER, INTEGER68 INTEGER, INTEGER72 INTEGER, INTEGER73 INTEGER, INTEGER74 INTEGER, INTEGER76 INTEGER, INTEGER77 INTEGER, INTEGER78 INTEGER, INTEGER83 INTEGER, INTEGER84 INTEGER, INTEGER85 INTEGER, INTEGER88 INTEGER, INTEGER89 INTEGER, INTEGER90 INTEGER, INTEGER92 INTEGER, INTEGER93 INTEGER, INTEGER94 INTEGER ); ALTER TABLE FIELDSOFINTEGER ADD CONSTRAINT FIELDSOFINTEV0_PK PRIMARY KEY (IDENTIFIER); CREATE TABLE FIELDSOFLOCALE ( IDENTIFIER INTEGER NOT NULL, LOCALE0 CHAR(20), LOCALE1 CHAR(20), LOCALE102 CHAR(20), LOCALE103 CHAR(20), LOCALE104 CHAR(20), LOCALE108 CHAR(20), LOCALE109 CHAR(20), LOCALE11 CHAR(20), LOCALE110 CHAR(20), LOCALE112 CHAR(20), LOCALE113 CHAR(20), LOCALE114 CHAR(20), LOCALE119 CHAR(20), LOCALE12 CHAR(20), LOCALE120 CHAR(20), LOCALE121 CHAR(20), LOCALE124 CHAR(20), LOCALE125 CHAR(20), LOCALE126 CHAR(20), LOCALE128 CHAR(20), LOCALE129 CHAR(20), LOCALE13 CHAR(20), LOCALE130 CHAR(20), LOCALE138 CHAR(20), LOCALE139 CHAR(20), LOCALE140 CHAR(20), LOCALE16 CHAR(20), LOCALE17 CHAR(20), LOCALE18 CHAR(20), LOCALE2 CHAR(20), LOCALE20 CHAR(20), LOCALE21 CHAR(20), LOCALE22 CHAR(20), LOCALE30 CHAR(20), LOCALE31 CHAR(20), LOCALE32 CHAR(20), LOCALE36 CHAR(20), LOCALE37 CHAR(20), LOCALE38 CHAR(20), LOCALE4 CHAR(20), LOCALE40 CHAR(20), LOCALE41 CHAR(20), LOCALE42 CHAR(20), LOCALE47 CHAR(20), LOCALE48 CHAR(20), LOCALE49 CHAR(20), LOCALE5 CHAR(20), LOCALE52 CHAR(20), LOCALE53 CHAR(20), LOCALE54 CHAR(20), LOCALE56 CHAR(20), LOCALE57 CHAR(20), LOCALE58 CHAR(20), LOCALE6 CHAR(20), LOCALE66 CHAR(20), LOCALE67 CHAR(20), LOCALE68 CHAR(20), LOCALE72 CHAR(20), LOCALE73 CHAR(20), LOCALE74 CHAR(20), LOCALE76 CHAR(20), LOCALE77 CHAR(20), LOCALE78 CHAR(20), LOCALE83 CHAR(20), LOCALE84 CHAR(20), LOCALE85 CHAR(20), LOCALE88 CHAR(20), LOCALE89 CHAR(20), LOCALE90 CHAR(20), LOCALE92 CHAR(20), LOCALE93 CHAR(20), LOCALE94 CHAR(20) ); ALTER TABLE FIELDSOFLOCALE ADD CONSTRAINT FIELDSOFLOCALE_PK PRIMARY KEY (IDENTIFIER); CREATE TABLE FIELDSOFLONG ( IDENTIFIER INTEGER NOT NULL, LONG0 BIGINT, LONG1 BIGINT, LONG102 BIGINT, LONG103 BIGINT, LONG104 BIGINT, LONG108 BIGINT, LONG109 BIGINT, LONG11 BIGINT, LONG110 BIGINT, LONG112 BIGINT, LONG113 BIGINT, LONG114 BIGINT, LONG119 BIGINT, LONG12 BIGINT, LONG120 BIGINT, LONG121 BIGINT, LONG124 BIGINT, LONG125 BIGINT, LONG126 BIGINT, LONG128 BIGINT, LONG129 BIGINT, LONG13 BIGINT, LONG130 BIGINT, LONG138 BIGINT, LONG139 BIGINT, LONG140 BIGINT, LONG16 BIGINT, LONG17 BIGINT, LONG18 BIGINT, LONG2 BIGINT, LONG20 BIGINT, LONG21 BIGINT, LONG22 BIGINT, LONG30 BIGINT, LONG31 BIGINT, LONG32 BIGINT, LONG36 BIGINT, LONG37 BIGINT, LONG38 BIGINT, LONG4 BIGINT, LONG40 BIGINT, LONG41 BIGINT, LONG42 BIGINT, LONG47 BIGINT, LONG48 BIGINT, LONG49 BIGINT, LONG5 BIGINT, LONG52 BIGINT, LONG53 BIGINT, LONG54 BIGINT, LONG56 BIGINT, LONG57 BIGINT, LONG58 BIGINT, LONG6 BIGINT, LONG66 BIGINT, LONG67 BIGINT, LONG68 BIGINT, LONG72 BIGINT, LONG73 BIGINT, LONG74 BIGINT, LONG76 BIGINT, LONG77 BIGINT, LONG78 BIGINT, LONG83 BIGINT, LONG84 BIGINT, LONG85 BIGINT, LONG88 BIGINT, LONG89 BIGINT, LONG90 BIGINT, LONG92 BIGINT, LONG93 BIGINT, LONG94 BIGINT ); ALTER TABLE FIELDSOFLONG ADD CONSTRAINT FIELDSOFLONG_PK PRIMARY KEY (IDENTIFIER); CREATE TABLE FIELDSOFOBJECT ( IDENTIFIER INTEGER NOT NULL, OBJECT1 LONG VARCHAR FOR BIT DATA, OBJECT102 BIGINT REFERENCES SIMPLE_CLASS, OBJECT103 LONG VARCHAR FOR BIT DATA, OBJECT104 BIGINT REFERENCES SIMPLE_CLASS, OBJECT109 LONG VARCHAR FOR BIT DATA, OBJECT11 BIGINT REFERENCES SIMPLE_CLASS, OBJECT110 BIGINT REFERENCES SIMPLE_CLASS, OBJECT112 BIGINT REFERENCES SIMPLE_CLASS, OBJECT113 LONG VARCHAR FOR BIT DATA, OBJECT114 BIGINT REFERENCES SIMPLE_CLASS, OBJECT119 BIGINT REFERENCES SIMPLE_CLASS, OBJECT12 LONG VARCHAR FOR BIT DATA, OBJECT120 LONG VARCHAR FOR BIT DATA, OBJECT121 BIGINT REFERENCES SIMPLE_CLASS, OBJECT125 LONG VARCHAR FOR BIT DATA, OBJECT126 BIGINT REFERENCES SIMPLE_CLASS, OBJECT128 BIGINT REFERENCES SIMPLE_CLASS, OBJECT129 LONG VARCHAR FOR BIT DATA, OBJECT13 BIGINT REFERENCES SIMPLE_CLASS, OBJECT130 BIGINT REFERENCES SIMPLE_CLASS, OBJECT138 BIGINT REFERENCES SIMPLE_CLASS, OBJECT139 LONG VARCHAR FOR BIT DATA, OBJECT140 BIGINT REFERENCES SIMPLE_CLASS, OBJECT17 LONG VARCHAR FOR BIT DATA, OBJECT18 BIGINT REFERENCES SIMPLE_CLASS, OBJECT2 BIGINT REFERENCES SIMPLE_CLASS, OBJECT20 BIGINT REFERENCES SIMPLE_CLASS, OBJECT21 LONG VARCHAR FOR BIT DATA, OBJECT22 BIGINT REFERENCES SIMPLE_CLASS, OBJECT30 BIGINT REFERENCES SIMPLE_CLASS, OBJECT31 LONG VARCHAR FOR BIT DATA, OBJECT32 BIGINT REFERENCES SIMPLE_CLASS, OBJECT37 LONG VARCHAR FOR BIT DATA, OBJECT38 BIGINT REFERENCES SIMPLE_CLASS, OBJECT4 BIGINT REFERENCES SIMPLE_CLASS, OBJECT40 BIGINT REFERENCES SIMPLE_CLASS, OBJECT41 LONG VARCHAR FOR BIT DATA, OBJECT42 BIGINT REFERENCES SIMPLE_CLASS, OBJECT47 BIGINT REFERENCES SIMPLE_CLASS, OBJECT48 LONG VARCHAR FOR BIT DATA, OBJECT49 BIGINT REFERENCES SIMPLE_CLASS, OBJECT5 LONG VARCHAR FOR BIT DATA, OBJECT53 LONG VARCHAR FOR BIT DATA, OBJECT54 BIGINT REFERENCES SIMPLE_CLASS, OBJECT56 BIGINT REFERENCES SIMPLE_CLASS, OBJECT57 LONG VARCHAR FOR BIT DATA, OBJECT58 BIGINT REFERENCES SIMPLE_CLASS, OBJECT6 BIGINT REFERENCES SIMPLE_CLASS, OBJECT66 BIGINT REFERENCES SIMPLE_CLASS, OBJECT67 LONG VARCHAR FOR BIT DATA, OBJECT68 BIGINT REFERENCES SIMPLE_CLASS, OBJECT73 LONG VARCHAR FOR BIT DATA, OBJECT74 BIGINT REFERENCES SIMPLE_CLASS, OBJECT76 BIGINT REFERENCES SIMPLE_CLASS, OBJECT77 LONG VARCHAR FOR BIT DATA, OBJECT78 BIGINT REFERENCES SIMPLE_CLASS, OBJECT83 BIGINT REFERENCES SIMPLE_CLASS, OBJECT84 LONG VARCHAR FOR BIT DATA, OBJECT85 BIGINT REFERENCES SIMPLE_CLASS, OBJECT89 LONG VARCHAR FOR BIT DATA, OBJECT90 BIGINT REFERENCES SIMPLE_CLASS, OBJECT92 BIGINT REFERENCES SIMPLE_CLASS, OBJECT93 LONG VARCHAR FOR BIT DATA, OBJECT94 BIGINT REFERENCES SIMPLE_CLASS ); ALTER TABLE FIELDSOFOBJECT ADD CONSTRAINT FIELDSOFOBJECT_PK PRIMARY KEY (IDENTIFIER); CREATE TABLE FIELDSOFSIMPLEINTERFACE ( IDENTIFIER INTEGER NOT NULL, SIMPLEINTERFACE1 LONG VARCHAR FOR BIT DATA, SIMPLEINTERFACE102 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE103 LONG VARCHAR FOR BIT DATA, SIMPLEINTERFACE104 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE109 LONG VARCHAR FOR BIT DATA, SIMPLEINTERFACE11 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE110 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE112 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE113 LONG VARCHAR FOR BIT DATA, SIMPLEINTERFACE114 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE119 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE12 LONG VARCHAR FOR BIT DATA, SIMPLEINTERFACE120 LONG VARCHAR FOR BIT DATA, SIMPLEINTERFACE121 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE125 LONG VARCHAR FOR BIT DATA, SIMPLEINTERFACE126 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE128 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE129 LONG VARCHAR FOR BIT DATA, SIMPLEINTERFACE13 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE130 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE138 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE139 LONG VARCHAR FOR BIT DATA, SIMPLEINTERFACE140 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE17 LONG VARCHAR FOR BIT DATA, SIMPLEINTERFACE18 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE2 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE20 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE21 LONG VARCHAR FOR BIT DATA, SIMPLEINTERFACE22 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE30 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE31 LONG VARCHAR FOR BIT DATA, SIMPLEINTERFACE32 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE37 LONG VARCHAR FOR BIT DATA, SIMPLEINTERFACE38 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE4 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE40 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE41 LONG VARCHAR FOR BIT DATA, SIMPLEINTERFACE42 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE47 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE48 LONG VARCHAR FOR BIT DATA, SIMPLEINTERFACE49 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE5 LONG VARCHAR FOR BIT DATA, SIMPLEINTERFACE53 LONG VARCHAR FOR BIT DATA, SIMPLEINTERFACE54 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE56 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE57 LONG VARCHAR FOR BIT DATA, SIMPLEINTERFACE58 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE6 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE66 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE67 LONG VARCHAR FOR BIT DATA, SIMPLEINTERFACE68 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE73 LONG VARCHAR FOR BIT DATA, SIMPLEINTERFACE74 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE76 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE77 LONG VARCHAR FOR BIT DATA, SIMPLEINTERFACE78 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE83 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE84 LONG VARCHAR FOR BIT DATA, SIMPLEINTERFACE85 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE89 LONG VARCHAR FOR BIT DATA, SIMPLEINTERFACE90 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE92 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE93 LONG VARCHAR FOR BIT DATA, SIMPLEINTERFACE94 BIGINT REFERENCES SIMPLE_CLASS ); ALTER TABLE FIELDSOFSIMPLEINTERFACE ADD CONSTRAINT FOSI_PK PRIMARY KEY (IDENTIFIER); CREATE TABLE FIELDSOFPRIMITIVEBOOLEAN ( IDENTIFIER INTEGER NOT NULL, BOOLEAN0 CHAR(1) NOT NULL CHECK (BOOLEAN0 IN ('Y','N')), BOOLEAN1 CHAR(1) NOT NULL CHECK (BOOLEAN1 IN ('Y','N')), BOOLEAN102 CHAR(1) NOT NULL CHECK (BOOLEAN102 IN ('Y','N')), BOOLEAN103 CHAR(1) NOT NULL CHECK (BOOLEAN103 IN ('Y','N')), BOOLEAN104 CHAR(1) NOT NULL CHECK (BOOLEAN104 IN ('Y','N')), BOOLEAN108 CHAR(1) NOT NULL CHECK (BOOLEAN108 IN ('Y','N')), BOOLEAN109 CHAR(1) NOT NULL CHECK (BOOLEAN109 IN ('Y','N')), BOOLEAN11 CHAR(1) NOT NULL CHECK (BOOLEAN11 IN ('Y','N')), BOOLEAN110 CHAR(1) NOT NULL CHECK (BOOLEAN110 IN ('Y','N')), BOOLEAN112 CHAR(1) NOT NULL CHECK (BOOLEAN112 IN ('Y','N')), BOOLEAN113 CHAR(1) NOT NULL CHECK (BOOLEAN113 IN ('Y','N')), BOOLEAN114 CHAR(1) NOT NULL CHECK (BOOLEAN114 IN ('Y','N')), BOOLEAN119 CHAR(1) NOT NULL CHECK (BOOLEAN119 IN ('Y','N')), BOOLEAN12 CHAR(1) NOT NULL CHECK (BOOLEAN12 IN ('Y','N')), BOOLEAN120 CHAR(1) NOT NULL CHECK (BOOLEAN120 IN ('Y','N')), BOOLEAN121 CHAR(1) NOT NULL CHECK (BOOLEAN121 IN ('Y','N')), BOOLEAN124 CHAR(1) NOT NULL CHECK (BOOLEAN124 IN ('Y','N')), BOOLEAN125 CHAR(1) NOT NULL CHECK (BOOLEAN125 IN ('Y','N')), BOOLEAN126 CHAR(1) NOT NULL CHECK (BOOLEAN126 IN ('Y','N')), BOOLEAN128 CHAR(1) NOT NULL CHECK (BOOLEAN128 IN ('Y','N')), BOOLEAN129 CHAR(1) NOT NULL CHECK (BOOLEAN129 IN ('Y','N')), BOOLEAN13 CHAR(1) NOT NULL CHECK (BOOLEAN13 IN ('Y','N')), BOOLEAN130 CHAR(1) NOT NULL CHECK (BOOLEAN130 IN ('Y','N')), BOOLEAN138 CHAR(1) NOT NULL CHECK (BOOLEAN138 IN ('Y','N')), BOOLEAN139 CHAR(1) NOT NULL CHECK (BOOLEAN139 IN ('Y','N')), BOOLEAN140 CHAR(1) NOT NULL CHECK (BOOLEAN140 IN ('Y','N')), BOOLEAN16 CHAR(1) NOT NULL CHECK (BOOLEAN16 IN ('Y','N')), BOOLEAN17 CHAR(1) NOT NULL CHECK (BOOLEAN17 IN ('Y','N')), BOOLEAN18 CHAR(1) NOT NULL CHECK (BOOLEAN18 IN ('Y','N')), BOOLEAN2 CHAR(1) NOT NULL CHECK (BOOLEAN2 IN ('Y','N')), BOOLEAN20 CHAR(1) NOT NULL CHECK (BOOLEAN20 IN ('Y','N')), BOOLEAN21 CHAR(1) NOT NULL CHECK (BOOLEAN21 IN ('Y','N')), BOOLEAN22 CHAR(1) NOT NULL CHECK (BOOLEAN22 IN ('Y','N')), BOOLEAN30 CHAR(1) NOT NULL CHECK (BOOLEAN30 IN ('Y','N')), BOOLEAN31 CHAR(1) NOT NULL CHECK (BOOLEAN31 IN ('Y','N')), BOOLEAN32 CHAR(1) NOT NULL CHECK (BOOLEAN32 IN ('Y','N')), BOOLEAN36 CHAR(1) NOT NULL CHECK (BOOLEAN36 IN ('Y','N')), BOOLEAN37 CHAR(1) NOT NULL CHECK (BOOLEAN37 IN ('Y','N')), BOOLEAN38 CHAR(1) NOT NULL CHECK (BOOLEAN38 IN ('Y','N')), BOOLEAN4 CHAR(1) NOT NULL CHECK (BOOLEAN4 IN ('Y','N')), BOOLEAN40 CHAR(1) NOT NULL CHECK (BOOLEAN40 IN ('Y','N')), BOOLEAN41 CHAR(1) NOT NULL CHECK (BOOLEAN41 IN ('Y','N')), BOOLEAN42 CHAR(1) NOT NULL CHECK (BOOLEAN42 IN ('Y','N')), BOOLEAN47 CHAR(1) NOT NULL CHECK (BOOLEAN47 IN ('Y','N')), BOOLEAN48 CHAR(1) NOT NULL CHECK (BOOLEAN48 IN ('Y','N')), BOOLEAN49 CHAR(1) NOT NULL CHECK (BOOLEAN49 IN ('Y','N')), BOOLEAN5 CHAR(1) NOT NULL CHECK (BOOLEAN5 IN ('Y','N')), BOOLEAN52 CHAR(1) NOT NULL CHECK (BOOLEAN52 IN ('Y','N')), BOOLEAN53 CHAR(1) NOT NULL CHECK (BOOLEAN53 IN ('Y','N')), BOOLEAN54 CHAR(1) NOT NULL CHECK (BOOLEAN54 IN ('Y','N')), BOOLEAN56 CHAR(1) NOT NULL CHECK (BOOLEAN56 IN ('Y','N')), BOOLEAN57 CHAR(1) NOT NULL CHECK (BOOLEAN57 IN ('Y','N')), BOOLEAN58 CHAR(1) NOT NULL CHECK (BOOLEAN58 IN ('Y','N')), BOOLEAN6 CHAR(1) NOT NULL CHECK (BOOLEAN6 IN ('Y','N')), BOOLEAN66 CHAR(1) NOT NULL CHECK (BOOLEAN66 IN ('Y','N')), BOOLEAN67 CHAR(1) NOT NULL CHECK (BOOLEAN67 IN ('Y','N')), BOOLEAN68 CHAR(1) NOT NULL CHECK (BOOLEAN68 IN ('Y','N')), BOOLEAN72 CHAR(1) NOT NULL CHECK (BOOLEAN72 IN ('Y','N')), BOOLEAN73 CHAR(1) NOT NULL CHECK (BOOLEAN73 IN ('Y','N')), BOOLEAN74 CHAR(1) NOT NULL CHECK (BOOLEAN74 IN ('Y','N')), BOOLEAN76 CHAR(1) NOT NULL CHECK (BOOLEAN76 IN ('Y','N')), BOOLEAN77 CHAR(1) NOT NULL CHECK (BOOLEAN77 IN ('Y','N')), BOOLEAN78 CHAR(1) NOT NULL CHECK (BOOLEAN78 IN ('Y','N')), BOOLEAN83 CHAR(1) NOT NULL CHECK (BOOLEAN83 IN ('Y','N')), BOOLEAN84 CHAR(1) NOT NULL CHECK (BOOLEAN84 IN ('Y','N')), BOOLEAN85 CHAR(1) NOT NULL CHECK (BOOLEAN85 IN ('Y','N')), BOOLEAN88 CHAR(1) NOT NULL CHECK (BOOLEAN88 IN ('Y','N')), BOOLEAN89 CHAR(1) NOT NULL CHECK (BOOLEAN89 IN ('Y','N')), BOOLEAN90 CHAR(1) NOT NULL CHECK (BOOLEAN90 IN ('Y','N')), BOOLEAN92 CHAR(1) NOT NULL CHECK (BOOLEAN92 IN ('Y','N')), BOOLEAN93 CHAR(1) NOT NULL CHECK (BOOLEAN93 IN ('Y','N')), BOOLEAN94 CHAR(1) NOT NULL CHECK (BOOLEAN94 IN ('Y','N')) ); ALTER TABLE FIELDSOFPRIMITIVEBOOLEAN ADD CONSTRAINT FIELDSOFPRIMC2_PK PRIMARY KEY (IDENTIFIER); CREATE TABLE FIELDSOFPRIMITIVEBYTE ( IDENTIFIER INTEGER NOT NULL, BYTE0 SMALLINT NOT NULL, BYTE1 SMALLINT NOT NULL, BYTE102 SMALLINT NOT NULL, BYTE103 SMALLINT NOT NULL, BYTE104 SMALLINT NOT NULL, BYTE108 SMALLINT NOT NULL, BYTE109 SMALLINT NOT NULL, BYTE11 SMALLINT NOT NULL, BYTE110 SMALLINT NOT NULL, BYTE112 SMALLINT NOT NULL, BYTE113 SMALLINT NOT NULL, BYTE114 SMALLINT NOT NULL, BYTE119 SMALLINT NOT NULL, BYTE12 SMALLINT NOT NULL, BYTE120 SMALLINT NOT NULL, BYTE121 SMALLINT NOT NULL, BYTE124 SMALLINT NOT NULL, BYTE125 SMALLINT NOT NULL, BYTE126 SMALLINT NOT NULL, BYTE128 SMALLINT NOT NULL, BYTE129 SMALLINT NOT NULL, BYTE13 SMALLINT NOT NULL, BYTE130 SMALLINT NOT NULL, BYTE138 SMALLINT NOT NULL, BYTE139 SMALLINT NOT NULL, BYTE140 SMALLINT NOT NULL, BYTE16 SMALLINT NOT NULL, BYTE17 SMALLINT NOT NULL, BYTE18 SMALLINT NOT NULL, BYTE2 SMALLINT NOT NULL, BYTE20 SMALLINT NOT NULL, BYTE21 SMALLINT NOT NULL, BYTE22 SMALLINT NOT NULL, BYTE30 SMALLINT NOT NULL, BYTE31 SMALLINT NOT NULL, BYTE32 SMALLINT NOT NULL, BYTE36 SMALLINT NOT NULL, BYTE37 SMALLINT NOT NULL, BYTE38 SMALLINT NOT NULL, BYTE4 SMALLINT NOT NULL, BYTE40 SMALLINT NOT NULL, BYTE41 SMALLINT NOT NULL, BYTE42 SMALLINT NOT NULL, BYTE47 SMALLINT NOT NULL, BYTE48 SMALLINT NOT NULL, BYTE49 SMALLINT NOT NULL, BYTE5 SMALLINT NOT NULL, BYTE52 SMALLINT NOT NULL, BYTE53 SMALLINT NOT NULL, BYTE54 SMALLINT NOT NULL, BYTE56 SMALLINT NOT NULL, BYTE57 SMALLINT NOT NULL, BYTE58 SMALLINT NOT NULL, BYTE6 SMALLINT NOT NULL, BYTE66 SMALLINT NOT NULL, BYTE67 SMALLINT NOT NULL, BYTE68 SMALLINT NOT NULL, BYTE72 SMALLINT NOT NULL, BYTE73 SMALLINT NOT NULL, BYTE74 SMALLINT NOT NULL, BYTE76 SMALLINT NOT NULL, BYTE77 SMALLINT NOT NULL, BYTE78 SMALLINT NOT NULL, BYTE83 SMALLINT NOT NULL, BYTE84 SMALLINT NOT NULL, BYTE85 SMALLINT NOT NULL, BYTE88 SMALLINT NOT NULL, BYTE89 SMALLINT NOT NULL, BYTE90 SMALLINT NOT NULL, BYTE92 SMALLINT NOT NULL, BYTE93 SMALLINT NOT NULL, BYTE94 SMALLINT NOT NULL ); ALTER TABLE FIELDSOFPRIMITIVEBYTE ADD CONSTRAINT FIELDSOFPRIMSD_PK PRIMARY KEY (IDENTIFIER); CREATE TABLE FIELDSOFPRIMITIVECHAR ( IDENTIFIER INTEGER NOT NULL, CHAR0 CHAR(1) NOT NULL, CHAR1 CHAR(1) NOT NULL, CHAR102 CHAR(1) NOT NULL, CHAR103 CHAR(1) NOT NULL, CHAR104 CHAR(1) NOT NULL, CHAR108 CHAR(1) NOT NULL, CHAR109 CHAR(1) NOT NULL, CHAR11 CHAR(1) NOT NULL, CHAR110 CHAR(1) NOT NULL, CHAR112 CHAR(1) NOT NULL, CHAR113 CHAR(1) NOT NULL, CHAR114 CHAR(1) NOT NULL, CHAR119 CHAR(1) NOT NULL, CHAR12 CHAR(1) NOT NULL, CHAR120 CHAR(1) NOT NULL, CHAR121 CHAR(1) NOT NULL, CHAR124 CHAR(1) NOT NULL, CHAR125 CHAR(1) NOT NULL, CHAR126 CHAR(1) NOT NULL, CHAR128 CHAR(1) NOT NULL, CHAR129 CHAR(1) NOT NULL, CHAR13 CHAR(1) NOT NULL, CHAR130 CHAR(1) NOT NULL, CHAR138 CHAR(1) NOT NULL, CHAR139 CHAR(1) NOT NULL, CHAR140 CHAR(1) NOT NULL, CHAR16 CHAR(1) NOT NULL, CHAR17 CHAR(1) NOT NULL, CHAR18 CHAR(1) NOT NULL, CHAR2 CHAR(1) NOT NULL, CHAR20 CHAR(1) NOT NULL, CHAR21 CHAR(1) NOT NULL, CHAR22 CHAR(1) NOT NULL, CHAR30 CHAR(1) NOT NULL, CHAR31 CHAR(1) NOT NULL, CHAR32 CHAR(1) NOT NULL, CHAR36 CHAR(1) NOT NULL, CHAR37 CHAR(1) NOT NULL, CHAR38 CHAR(1) NOT NULL, CHAR4 CHAR(1) NOT NULL, CHAR40 CHAR(1) NOT NULL, CHAR41 CHAR(1) NOT NULL, CHAR42 CHAR(1) NOT NULL, CHAR47 CHAR(1) NOT NULL, CHAR48 CHAR(1) NOT NULL, CHAR49 CHAR(1) NOT NULL, CHAR5 CHAR(1) NOT NULL, CHAR52 CHAR(1) NOT NULL, CHAR53 CHAR(1) NOT NULL, CHAR54 CHAR(1) NOT NULL, CHAR56 CHAR(1) NOT NULL, CHAR57 CHAR(1) NOT NULL, CHAR58 CHAR(1) NOT NULL, CHAR6 CHAR(1) NOT NULL, CHAR66 CHAR(1) NOT NULL, CHAR67 CHAR(1) NOT NULL, CHAR68 CHAR(1) NOT NULL, CHAR72 CHAR(1) NOT NULL, CHAR73 CHAR(1) NOT NULL, CHAR74 CHAR(1) NOT NULL, CHAR76 CHAR(1) NOT NULL, CHAR77 CHAR(1) NOT NULL, CHAR78 CHAR(1) NOT NULL, CHAR83 CHAR(1) NOT NULL, CHAR84 CHAR(1) NOT NULL, CHAR85 CHAR(1) NOT NULL, CHAR88 CHAR(1) NOT NULL, CHAR89 CHAR(1) NOT NULL, CHAR90 CHAR(1) NOT NULL, CHAR92 CHAR(1) NOT NULL, CHAR93 CHAR(1) NOT NULL, CHAR94 CHAR(1) NOT NULL ); ALTER TABLE FIELDSOFPRIMITIVECHAR ADD CONSTRAINT FIELDSOFPRIMQ3_PK PRIMARY KEY (IDENTIFIER); CREATE TABLE FIELDSOFPRIMITIVEDOUBLE ( IDENTIFIER INTEGER NOT NULL, DOUBLE0 DOUBLE NOT NULL, DOUBLE1 DOUBLE NOT NULL, DOUBLE102 DOUBLE NOT NULL, DOUBLE103 DOUBLE NOT NULL, DOUBLE104 DOUBLE NOT NULL, DOUBLE108 DOUBLE NOT NULL, DOUBLE109 DOUBLE NOT NULL, DOUBLE11 DOUBLE NOT NULL, DOUBLE110 DOUBLE NOT NULL, DOUBLE112 DOUBLE NOT NULL, DOUBLE113 DOUBLE NOT NULL, DOUBLE114 DOUBLE NOT NULL, DOUBLE119 DOUBLE NOT NULL, DOUBLE12 DOUBLE NOT NULL, DOUBLE120 DOUBLE NOT NULL, DOUBLE121 DOUBLE NOT NULL, DOUBLE124 DOUBLE NOT NULL, DOUBLE125 DOUBLE NOT NULL, DOUBLE126 DOUBLE NOT NULL, DOUBLE128 DOUBLE NOT NULL, DOUBLE129 DOUBLE NOT NULL, DOUBLE13 DOUBLE NOT NULL, DOUBLE130 DOUBLE NOT NULL, DOUBLE138 DOUBLE NOT NULL, DOUBLE139 DOUBLE NOT NULL, DOUBLE140 DOUBLE NOT NULL, DOUBLE16 DOUBLE NOT NULL, DOUBLE17 DOUBLE NOT NULL, DOUBLE18 DOUBLE NOT NULL, DOUBLE2 DOUBLE NOT NULL, DOUBLE20 DOUBLE NOT NULL, DOUBLE21 DOUBLE NOT NULL, DOUBLE22 DOUBLE NOT NULL, DOUBLE30 DOUBLE NOT NULL, DOUBLE31 DOUBLE NOT NULL, DOUBLE32 DOUBLE NOT NULL, DOUBLE36 DOUBLE NOT NULL, DOUBLE37 DOUBLE NOT NULL, DOUBLE38 DOUBLE NOT NULL, DOUBLE4 DOUBLE NOT NULL, DOUBLE40 DOUBLE NOT NULL, DOUBLE41 DOUBLE NOT NULL, DOUBLE42 DOUBLE NOT NULL, DOUBLE47 DOUBLE NOT NULL, DOUBLE48 DOUBLE NOT NULL, DOUBLE49 DOUBLE NOT NULL, DOUBLE5 DOUBLE NOT NULL, DOUBLE52 DOUBLE NOT NULL, DOUBLE53 DOUBLE NOT NULL, DOUBLE54 DOUBLE NOT NULL, DOUBLE56 DOUBLE NOT NULL, DOUBLE57 DOUBLE NOT NULL, DOUBLE58 DOUBLE NOT NULL, DOUBLE6 DOUBLE NOT NULL, DOUBLE66 DOUBLE NOT NULL, DOUBLE67 DOUBLE NOT NULL, DOUBLE68 DOUBLE NOT NULL, DOUBLE72 DOUBLE NOT NULL, DOUBLE73 DOUBLE NOT NULL, DOUBLE74 DOUBLE NOT NULL, DOUBLE76 DOUBLE NOT NULL, DOUBLE77 DOUBLE NOT NULL, DOUBLE78 DOUBLE NOT NULL, DOUBLE83 DOUBLE NOT NULL, DOUBLE84 DOUBLE NOT NULL, DOUBLE85 DOUBLE NOT NULL, DOUBLE88 DOUBLE NOT NULL, DOUBLE89 DOUBLE NOT NULL, DOUBLE90 DOUBLE NOT NULL, DOUBLE92 DOUBLE NOT NULL, DOUBLE93 DOUBLE NOT NULL, DOUBLE94 DOUBLE NOT NULL ); ALTER TABLE FIELDSOFPRIMITIVEDOUBLE ADD CONSTRAINT FIELDSOFPRIMHH_PK PRIMARY KEY (IDENTIFIER); CREATE TABLE FIELDSOFPRIMITIVEFLOAT ( IDENTIFIER INTEGER NOT NULL, FLOAT0 REAL NOT NULL, FLOAT1 REAL NOT NULL, FLOAT102 REAL NOT NULL, FLOAT103 REAL NOT NULL, FLOAT104 REAL NOT NULL, FLOAT108 REAL NOT NULL, FLOAT109 REAL NOT NULL, FLOAT11 REAL NOT NULL, FLOAT110 REAL NOT NULL, FLOAT112 REAL NOT NULL, FLOAT113 REAL NOT NULL, FLOAT114 REAL NOT NULL, FLOAT119 REAL NOT NULL, FLOAT12 REAL NOT NULL, FLOAT120 REAL NOT NULL, FLOAT121 REAL NOT NULL, FLOAT124 REAL NOT NULL, FLOAT125 REAL NOT NULL, FLOAT126 REAL NOT NULL, FLOAT128 REAL NOT NULL, FLOAT129 REAL NOT NULL, FLOAT13 REAL NOT NULL, FLOAT130 REAL NOT NULL, FLOAT138 REAL NOT NULL, FLOAT139 REAL NOT NULL, FLOAT140 REAL NOT NULL, FLOAT16 REAL NOT NULL, FLOAT17 REAL NOT NULL, FLOAT18 REAL NOT NULL, FLOAT2 REAL NOT NULL, FLOAT20 REAL NOT NULL, FLOAT21 REAL NOT NULL, FLOAT22 REAL NOT NULL, FLOAT30 REAL NOT NULL, FLOAT31 REAL NOT NULL, FLOAT32 REAL NOT NULL, FLOAT36 REAL NOT NULL, FLOAT37 REAL NOT NULL, FLOAT38 REAL NOT NULL, FLOAT4 REAL NOT NULL, FLOAT40 REAL NOT NULL, FLOAT41 REAL NOT NULL, FLOAT42 REAL NOT NULL, FLOAT47 REAL NOT NULL, FLOAT48 REAL NOT NULL, FLOAT49 REAL NOT NULL, FLOAT5 REAL NOT NULL, FLOAT52 REAL NOT NULL, FLOAT53 REAL NOT NULL, FLOAT54 REAL NOT NULL, FLOAT56 REAL NOT NULL, FLOAT57 REAL NOT NULL, FLOAT58 REAL NOT NULL, FLOAT6 REAL NOT NULL, FLOAT66 REAL NOT NULL, FLOAT67 REAL NOT NULL, FLOAT68 REAL NOT NULL, FLOAT72 REAL NOT NULL, FLOAT73 REAL NOT NULL, FLOAT74 REAL NOT NULL, FLOAT76 REAL NOT NULL, FLOAT77 REAL NOT NULL, FLOAT78 REAL NOT NULL, FLOAT83 REAL NOT NULL, FLOAT84 REAL NOT NULL, FLOAT85 REAL NOT NULL, FLOAT88 REAL NOT NULL, FLOAT89 REAL NOT NULL, FLOAT90 REAL NOT NULL, FLOAT92 REAL NOT NULL, FLOAT93 REAL NOT NULL, FLOAT94 REAL NOT NULL ); ALTER TABLE FIELDSOFPRIMITIVEFLOAT ADD CONSTRAINT FIELDSOFPRIMR3_PK PRIMARY KEY (IDENTIFIER); CREATE TABLE FIELDSOFPRIMITIVEINT ( IDENTIFIER INTEGER NOT NULL, INT0 INTEGER NOT NULL, INT1 INTEGER NOT NULL, INT102 INTEGER NOT NULL, INT103 INTEGER NOT NULL, INT104 INTEGER NOT NULL, INT108 INTEGER NOT NULL, INT109 INTEGER NOT NULL, INT11 INTEGER NOT NULL, INT110 INTEGER NOT NULL, INT112 INTEGER NOT NULL, INT113 INTEGER NOT NULL, INT114 INTEGER NOT NULL, INT119 INTEGER NOT NULL, INT12 INTEGER NOT NULL, INT120 INTEGER NOT NULL, INT121 INTEGER NOT NULL, INT124 INTEGER NOT NULL, INT125 INTEGER NOT NULL, INT126 INTEGER NOT NULL, INT128 INTEGER NOT NULL, INT129 INTEGER NOT NULL, INT13 INTEGER NOT NULL, INT130 INTEGER NOT NULL, INT138 INTEGER NOT NULL, INT139 INTEGER NOT NULL, INT140 INTEGER NOT NULL, INT16 INTEGER NOT NULL, INT17 INTEGER NOT NULL, INT18 INTEGER NOT NULL, INT2 INTEGER NOT NULL, INT20 INTEGER NOT NULL, INT21 INTEGER NOT NULL, INT22 INTEGER NOT NULL, INT30 INTEGER NOT NULL, INT31 INTEGER NOT NULL, INT32 INTEGER NOT NULL, INT36 INTEGER NOT NULL, INT37 INTEGER NOT NULL, INT38 INTEGER NOT NULL, INT4 INTEGER NOT NULL, INT40 INTEGER NOT NULL, INT41 INTEGER NOT NULL, INT42 INTEGER NOT NULL, INT47 INTEGER NOT NULL, INT48 INTEGER NOT NULL, INT49 INTEGER NOT NULL, INT5 INTEGER NOT NULL, INT52 INTEGER NOT NULL, INT53 INTEGER NOT NULL, INT54 INTEGER NOT NULL, INT56 INTEGER NOT NULL, INT57 INTEGER NOT NULL, INT58 INTEGER NOT NULL, INT6 INTEGER NOT NULL, INT66 INTEGER NOT NULL, INT67 INTEGER NOT NULL, INT68 INTEGER NOT NULL, INT72 INTEGER NOT NULL, INT73 INTEGER NOT NULL, INT74 INTEGER NOT NULL, INT76 INTEGER NOT NULL, INT77 INTEGER NOT NULL, INT78 INTEGER NOT NULL, INT83 INTEGER NOT NULL, INT84 INTEGER NOT NULL, INT85 INTEGER NOT NULL, INT88 INTEGER NOT NULL, INT89 INTEGER NOT NULL, INT90 INTEGER NOT NULL, INT92 INTEGER NOT NULL, INT93 INTEGER NOT NULL, INT94 INTEGER NOT NULL ); ALTER TABLE FIELDSOFPRIMITIVEINT ADD CONSTRAINT FIELDSOFPRIMT6_PK PRIMARY KEY (IDENTIFIER); CREATE TABLE FIELDSOFPRIMITIVELONG ( IDENTIFIER INTEGER NOT NULL, LONG0 BIGINT NOT NULL, LONG1 BIGINT NOT NULL, LONG102 BIGINT NOT NULL, LONG103 BIGINT NOT NULL, LONG104 BIGINT NOT NULL, LONG108 BIGINT NOT NULL, LONG109 BIGINT NOT NULL, LONG11 BIGINT NOT NULL, LONG110 BIGINT NOT NULL, LONG112 BIGINT NOT NULL, LONG113 BIGINT NOT NULL, LONG114 BIGINT NOT NULL, LONG119 BIGINT NOT NULL, LONG12 BIGINT NOT NULL, LONG120 BIGINT NOT NULL, LONG121 BIGINT NOT NULL, LONG124 BIGINT NOT NULL, LONG125 BIGINT NOT NULL, LONG126 BIGINT NOT NULL, LONG128 BIGINT NOT NULL, LONG129 BIGINT NOT NULL, LONG13 BIGINT NOT NULL, LONG130 BIGINT NOT NULL, LONG138 BIGINT NOT NULL, LONG139 BIGINT NOT NULL, LONG140 BIGINT NOT NULL, LONG16 BIGINT NOT NULL, LONG17 BIGINT NOT NULL, LONG18 BIGINT NOT NULL, LONG2 BIGINT NOT NULL, LONG20 BIGINT NOT NULL, LONG21 BIGINT NOT NULL, LONG22 BIGINT NOT NULL, LONG30 BIGINT NOT NULL, LONG31 BIGINT NOT NULL, LONG32 BIGINT NOT NULL, LONG36 BIGINT NOT NULL, LONG37 BIGINT NOT NULL, LONG38 BIGINT NOT NULL, LONG4 BIGINT NOT NULL, LONG40 BIGINT NOT NULL, LONG41 BIGINT NOT NULL, LONG42 BIGINT NOT NULL, LONG47 BIGINT NOT NULL, LONG48 BIGINT NOT NULL, LONG49 BIGINT NOT NULL, LONG5 BIGINT NOT NULL, LONG52 BIGINT NOT NULL, LONG53 BIGINT NOT NULL, LONG54 BIGINT NOT NULL, LONG56 BIGINT NOT NULL, LONG57 BIGINT NOT NULL, LONG58 BIGINT NOT NULL, LONG6 BIGINT NOT NULL, LONG66 BIGINT NOT NULL, LONG67 BIGINT NOT NULL, LONG68 BIGINT NOT NULL, LONG72 BIGINT NOT NULL, LONG73 BIGINT NOT NULL, LONG74 BIGINT NOT NULL, LONG76 BIGINT NOT NULL, LONG77 BIGINT NOT NULL, LONG78 BIGINT NOT NULL, LONG83 BIGINT NOT NULL, LONG84 BIGINT NOT NULL, LONG85 BIGINT NOT NULL, LONG88 BIGINT NOT NULL, LONG89 BIGINT NOT NULL, LONG90 BIGINT NOT NULL, LONG92 BIGINT NOT NULL, LONG93 BIGINT NOT NULL, LONG94 BIGINT NOT NULL ); ALTER TABLE FIELDSOFPRIMITIVELONG ADD CONSTRAINT FIELDSOFPRIMLL_PK PRIMARY KEY (IDENTIFIER); CREATE TABLE FIELDSOFPRIMITIVESHORT ( IDENTIFIER INTEGER NOT NULL, SHORT0 SMALLINT NOT NULL, SHORT1 SMALLINT NOT NULL, SHORT102 SMALLINT NOT NULL, SHORT103 SMALLINT NOT NULL, SHORT104 SMALLINT NOT NULL, SHORT108 SMALLINT NOT NULL, SHORT109 SMALLINT NOT NULL, SHORT11 SMALLINT NOT NULL, SHORT110 SMALLINT NOT NULL, SHORT112 SMALLINT NOT NULL, SHORT113 SMALLINT NOT NULL, SHORT114 SMALLINT NOT NULL, SHORT119 SMALLINT NOT NULL, SHORT12 SMALLINT NOT NULL, SHORT120 SMALLINT NOT NULL, SHORT121 SMALLINT NOT NULL, SHORT124 SMALLINT NOT NULL, SHORT125 SMALLINT NOT NULL, SHORT126 SMALLINT NOT NULL, SHORT128 SMALLINT NOT NULL, SHORT129 SMALLINT NOT NULL, SHORT13 SMALLINT NOT NULL, SHORT130 SMALLINT NOT NULL, SHORT138 SMALLINT NOT NULL, SHORT139 SMALLINT NOT NULL, SHORT140 SMALLINT NOT NULL, SHORT16 SMALLINT NOT NULL, SHORT17 SMALLINT NOT NULL, SHORT18 SMALLINT NOT NULL, SHORT2 SMALLINT NOT NULL, SHORT20 SMALLINT NOT NULL, SHORT21 SMALLINT NOT NULL, SHORT22 SMALLINT NOT NULL, SHORT30 SMALLINT NOT NULL, SHORT31 SMALLINT NOT NULL, SHORT32 SMALLINT NOT NULL, SHORT36 SMALLINT NOT NULL, SHORT37 SMALLINT NOT NULL, SHORT38 SMALLINT NOT NULL, SHORT4 SMALLINT NOT NULL, SHORT40 SMALLINT NOT NULL, SHORT41 SMALLINT NOT NULL, SHORT42 SMALLINT NOT NULL, SHORT47 SMALLINT NOT NULL, SHORT48 SMALLINT NOT NULL, SHORT49 SMALLINT NOT NULL, SHORT5 SMALLINT NOT NULL, SHORT52 SMALLINT NOT NULL, SHORT53 SMALLINT NOT NULL, SHORT54 SMALLINT NOT NULL, SHORT56 SMALLINT NOT NULL, SHORT57 SMALLINT NOT NULL, SHORT58 SMALLINT NOT NULL, SHORT6 SMALLINT NOT NULL, SHORT66 SMALLINT NOT NULL, SHORT67 SMALLINT NOT NULL, SHORT68 SMALLINT NOT NULL, SHORT72 SMALLINT NOT NULL, SHORT73 SMALLINT NOT NULL, SHORT74 SMALLINT NOT NULL, SHORT76 SMALLINT NOT NULL, SHORT77 SMALLINT NOT NULL, SHORT78 SMALLINT NOT NULL, SHORT83 SMALLINT NOT NULL, SHORT84 SMALLINT NOT NULL, SHORT85 SMALLINT NOT NULL, SHORT88 SMALLINT NOT NULL, SHORT89 SMALLINT NOT NULL, SHORT90 SMALLINT NOT NULL, SHORT92 SMALLINT NOT NULL, SHORT93 SMALLINT NOT NULL, SHORT94 SMALLINT NOT NULL ); ALTER TABLE FIELDSOFPRIMITIVESHORT ADD CONSTRAINT FIELDSOFPRIMXB_PK PRIMARY KEY (IDENTIFIER); CREATE TABLE FIELDSOFSHORT ( IDENTIFIER INTEGER NOT NULL, SHORT0 SMALLINT, SHORT1 SMALLINT, SHORT102 SMALLINT, SHORT103 SMALLINT, SHORT104 SMALLINT, SHORT108 SMALLINT, SHORT109 SMALLINT, SHORT11 SMALLINT, SHORT110 SMALLINT, SHORT112 SMALLINT, SHORT113 SMALLINT, SHORT114 SMALLINT, SHORT119 SMALLINT, SHORT12 SMALLINT, SHORT120 SMALLINT, SHORT121 SMALLINT, SHORT124 SMALLINT, SHORT125 SMALLINT, SHORT126 SMALLINT, SHORT128 SMALLINT, SHORT129 SMALLINT, SHORT13 SMALLINT, SHORT130 SMALLINT, SHORT138 SMALLINT, SHORT139 SMALLINT, SHORT140 SMALLINT, SHORT16 SMALLINT, SHORT17 SMALLINT, SHORT18 SMALLINT, SHORT2 SMALLINT, SHORT20 SMALLINT, SHORT21 SMALLINT, SHORT22 SMALLINT, SHORT30 SMALLINT, SHORT31 SMALLINT, SHORT32 SMALLINT, SHORT36 SMALLINT, SHORT37 SMALLINT, SHORT38 SMALLINT, SHORT4 SMALLINT, SHORT40 SMALLINT, SHORT41 SMALLINT, SHORT42 SMALLINT, SHORT47 SMALLINT, SHORT48 SMALLINT, SHORT49 SMALLINT, SHORT5 SMALLINT, SHORT52 SMALLINT, SHORT53 SMALLINT, SHORT54 SMALLINT, SHORT56 SMALLINT, SHORT57 SMALLINT, SHORT58 SMALLINT, SHORT6 SMALLINT, SHORT66 SMALLINT, SHORT67 SMALLINT, SHORT68 SMALLINT, SHORT72 SMALLINT, SHORT73 SMALLINT, SHORT74 SMALLINT, SHORT76 SMALLINT, SHORT77 SMALLINT, SHORT78 SMALLINT, SHORT83 SMALLINT, SHORT84 SMALLINT, SHORT85 SMALLINT, SHORT88 SMALLINT, SHORT89 SMALLINT, SHORT90 SMALLINT, SHORT92 SMALLINT, SHORT93 SMALLINT, SHORT94 SMALLINT ); ALTER TABLE FIELDSOFSHORT ADD CONSTRAINT FIELDSOFSHORT_PK PRIMARY KEY (IDENTIFIER); CREATE TABLE FIELDSOFSTRING ( IDENTIFIER INTEGER NOT NULL, STRING0 VARCHAR(255), STRING1 VARCHAR(255), STRING102 VARCHAR(255), STRING103 VARCHAR(255), STRING104 VARCHAR(255), STRING108 VARCHAR(255), STRING109 VARCHAR(255), STRING11 VARCHAR(255), STRING110 VARCHAR(255), STRING112 VARCHAR(255), STRING113 VARCHAR(255), STRING114 VARCHAR(255), STRING119 VARCHAR(255), STRING12 VARCHAR(255), STRING120 VARCHAR(255), STRING121 VARCHAR(255), STRING124 VARCHAR(255), STRING125 VARCHAR(255), STRING126 VARCHAR(255), STRING128 VARCHAR(255), STRING129 VARCHAR(255), STRING13 VARCHAR(255), STRING130 VARCHAR(255), STRING138 VARCHAR(255), STRING139 VARCHAR(255), STRING140 VARCHAR(255), STRING16 VARCHAR(255), STRING17 VARCHAR(255), STRING18 VARCHAR(255), STRING2 VARCHAR(255), STRING20 VARCHAR(255), STRING21 VARCHAR(255), STRING22 VARCHAR(255), STRING30 VARCHAR(255), STRING31 VARCHAR(255), STRING32 VARCHAR(255), STRING36 VARCHAR(255), STRING37 VARCHAR(255), STRING38 VARCHAR(255), STRING4 VARCHAR(255), STRING40 VARCHAR(255), STRING41 VARCHAR(255), STRING42 VARCHAR(255), STRING47 VARCHAR(255), STRING48 VARCHAR(255), STRING49 VARCHAR(255), STRING5 VARCHAR(255), STRING52 VARCHAR(255), STRING53 VARCHAR(255), STRING54 VARCHAR(255), STRING56 VARCHAR(255), STRING57 VARCHAR(255), STRING58 VARCHAR(255), STRING6 VARCHAR(255), STRING66 VARCHAR(255), STRING67 VARCHAR(255), STRING68 VARCHAR(255), STRING72 VARCHAR(255), STRING73 VARCHAR(255), STRING74 VARCHAR(255), STRING76 VARCHAR(255), STRING77 VARCHAR(255), STRING78 VARCHAR(255), STRING83 VARCHAR(255), STRING84 VARCHAR(255), STRING85 VARCHAR(255), STRING88 VARCHAR(255), STRING89 VARCHAR(255), STRING90 VARCHAR(255), STRING92 VARCHAR(255), STRING93 VARCHAR(255), STRING94 VARCHAR(255) ); ALTER TABLE FIELDSOFSTRING ADD CONSTRAINT FIELDSOFSTRING_PK PRIMARY KEY (IDENTIFIER); CREATE TABLE FieldsOfByte ( IDENTIFIER INTEGER NOT NULL, BYTE0 SMALLINT, BYTE1 SMALLINT, BYTE2 SMALLINT, BYTE4 SMALLINT, BYTE5 SMALLINT, BYTE6 SMALLINT, BYTE11 SMALLINT, BYTE12 SMALLINT, BYTE13 SMALLINT, BYTE16 SMALLINT, BYTE17 SMALLINT, BYTE18 SMALLINT, BYTE20 SMALLINT, BYTE21 SMALLINT, BYTE22 SMALLINT, BYTE30 SMALLINT, BYTE31 SMALLINT, BYTE32 SMALLINT, BYTE36 SMALLINT, BYTE37 SMALLINT, BYTE38 SMALLINT, BYTE40 SMALLINT, BYTE41 SMALLINT, BYTE42 SMALLINT, BYTE43 SMALLINT, BYTE47 SMALLINT, BYTE48 SMALLINT, BYTE49 SMALLINT, BYTE52 SMALLINT, BYTE53 SMALLINT, BYTE54 SMALLINT, BYTE56 SMALLINT, BYTE57 SMALLINT, BYTE58 SMALLINT, BYTE66 SMALLINT, BYTE67 SMALLINT, BYTE68 SMALLINT, BYTE72 SMALLINT, BYTE73 SMALLINT, BYTE74 SMALLINT, BYTE76 SMALLINT, BYTE77 SMALLINT, BYTE78 SMALLINT, BYTE83 SMALLINT, BYTE84 SMALLINT, BYTE85 SMALLINT, BYTE88 SMALLINT, BYTE89 SMALLINT, BYTE90 SMALLINT, BYTE92 SMALLINT, BYTE93 SMALLINT, BYTE94 SMALLINT, BYTE102 SMALLINT, BYTE103 SMALLINT, BYTE104 SMALLINT, BYTE108 SMALLINT, BYTE109 SMALLINT, BYTE110 SMALLINT, BYTE112 SMALLINT, BYTE113 SMALLINT, BYTE114 SMALLINT, BYTE119 SMALLINT, BYTE120 SMALLINT, BYTE121 SMALLINT, BYTE124 SMALLINT, BYTE125 SMALLINT, BYTE126 SMALLINT, BYTE128 SMALLINT, BYTE129 SMALLINT, BYTE130 SMALLINT, BYTE138 SMALLINT, BYTE139 SMALLINT, BYTE140 SMALLINT, CONSTRAINT FieldsOfByte_PK PRIMARY KEY (IDENTIFIER) ); CREATE TABLE FIELDSOFSIMPLECLASS ( IDENTIFIER INTEGER NOT NULL, ID1 BIGINT, INTFIELD1 INTEGER, STRINGFIELD1 VARCHAR(1024), SIMPLECLASS0 BIGINT REFERENCES SIMPLE_CLASS, SIMPLECLASS102 BIGINT REFERENCES SIMPLE_CLASS, ID103 BIGINT, INTFIELD103 INTEGER, STRINGFIELD103 VARCHAR(1024), SIMPLECLASS104 BIGINT REFERENCES SIMPLE_CLASS, SIMPLECLASS108 BIGINT REFERENCES SIMPLE_CLASS, ID109 BIGINT, INTFIELD109 INTEGER, STRINGFIELD109 VARCHAR(1024), SIMPLECLASS11 BIGINT REFERENCES SIMPLE_CLASS, SIMPLECLASS110 BIGINT REFERENCES SIMPLE_CLASS, SIMPLECLASS112 BIGINT REFERENCES SIMPLE_CLASS, ID113 BIGINT, INTFIELD113 INTEGER, STRINGFIELD113 VARCHAR(1024), SIMPLECLASS114 BIGINT REFERENCES SIMPLE_CLASS, SIMPLECLASS119 BIGINT REFERENCES SIMPLE_CLASS, ID12 BIGINT, INTFIELD12 INTEGER, STRINGFIELD12 VARCHAR(1024), ID120 BIGINT, INTFIELD120 INTEGER, STRINGFIELD120 VARCHAR(1024), SIMPLECLASS121 BIGINT REFERENCES SIMPLE_CLASS, SIMPLECLASS124 BIGINT REFERENCES SIMPLE_CLASS, ID125 BIGINT, INTFIELD125 INTEGER, STRINGFIELD125 VARCHAR(1024), SIMPLECLASS126 BIGINT REFERENCES SIMPLE_CLASS, SIMPLECLASS128 BIGINT REFERENCES SIMPLE_CLASS, ID129 BIGINT, INTFIELD129 INTEGER, STRINGFIELD129 VARCHAR(1024), SIMPLECLASS13 BIGINT REFERENCES SIMPLE_CLASS, SIMPLECLASS130 BIGINT REFERENCES SIMPLE_CLASS, SIMPLECLASS138 BIGINT REFERENCES SIMPLE_CLASS, ID139 BIGINT, INTFIELD139 INTEGER, STRINGFIELD139 VARCHAR(1024), SIMPLECLASS140 BIGINT REFERENCES SIMPLE_CLASS, SIMPLECLASS16 BIGINT REFERENCES SIMPLE_CLASS, ID17 BIGINT, INTFIELD17 INTEGER, STRINGFIELD17 VARCHAR(1024), SIMPLECLASS18 BIGINT REFERENCES SIMPLE_CLASS, SIMPLECLASS2 BIGINT REFERENCES SIMPLE_CLASS, SIMPLECLASS20 BIGINT REFERENCES SIMPLE_CLASS, ID21 BIGINT, INTFIELD21 INTEGER, STRINGFIELD21 VARCHAR(1024), SIMPLECLASS22 BIGINT REFERENCES SIMPLE_CLASS, SIMPLECLASS30 BIGINT REFERENCES SIMPLE_CLASS, ID31 BIGINT, INTFIELD31 INTEGER, STRINGFIELD31 VARCHAR(1024), SIMPLECLASS32 BIGINT REFERENCES SIMPLE_CLASS, SIMPLECLASS36 BIGINT REFERENCES SIMPLE_CLASS, ID37 BIGINT, INTFIELD37 INTEGER, STRINGFIELD37 VARCHAR(1024), SIMPLECLASS38 BIGINT REFERENCES SIMPLE_CLASS, SIMPLECLASS4 BIGINT REFERENCES SIMPLE_CLASS, SIMPLECLASS40 BIGINT REFERENCES SIMPLE_CLASS, ID41 BIGINT, INTFIELD41 INTEGER, STRINGFIELD41 VARCHAR(1024), SIMPLECLASS42 BIGINT REFERENCES SIMPLE_CLASS, SIMPLECLASS47 BIGINT REFERENCES SIMPLE_CLASS, ID48 BIGINT, INTFIELD48 INTEGER, STRINGFIELD48 VARCHAR(1024), SIMPLECLASS49 BIGINT REFERENCES SIMPLE_CLASS, ID5 BIGINT, INTFIELD5 INTEGER, STRINGFIELD5 VARCHAR(1024), SIMPLECLASS52 BIGINT REFERENCES SIMPLE_CLASS, ID53 BIGINT, INTFIELD53 INTEGER, STRINGFIELD53 VARCHAR(1024), SIMPLECLASS54 BIGINT REFERENCES SIMPLE_CLASS, SIMPLECLASS56 BIGINT REFERENCES SIMPLE_CLASS, ID57 BIGINT, INTFIELD57 INTEGER, STRINGFIELD57 VARCHAR(1024), SIMPLECLASS58 BIGINT REFERENCES SIMPLE_CLASS, SIMPLECLASS6 BIGINT REFERENCES SIMPLE_CLASS, SIMPLECLASS66 BIGINT REFERENCES SIMPLE_CLASS, ID67 BIGINT, INTFIELD67 INTEGER, STRINGFIELD67 VARCHAR(1024), SIMPLECLASS68 BIGINT REFERENCES SIMPLE_CLASS, SIMPLECLASS72 BIGINT REFERENCES SIMPLE_CLASS, ID73 BIGINT, INTFIELD73 INTEGER, STRINGFIELD73 VARCHAR(1024), SIMPLECLASS74 BIGINT REFERENCES SIMPLE_CLASS, SIMPLECLASS76 BIGINT REFERENCES SIMPLE_CLASS, ID77 BIGINT, INTFIELD77 INTEGER, STRINGFIELD77 VARCHAR(1024), SIMPLECLASS78 BIGINT REFERENCES SIMPLE_CLASS, SIMPLECLASS83 BIGINT REFERENCES SIMPLE_CLASS, ID84 BIGINT, INTFIELD84 INTEGER, STRINGFIELD84 VARCHAR(1024), SIMPLECLASS85 BIGINT REFERENCES SIMPLE_CLASS, SIMPLECLASS88 BIGINT REFERENCES SIMPLE_CLASS, ID89 BIGINT, INTFIELD89 INTEGER, STRINGFIELD89 VARCHAR(1024), SIMPLECLASS90 BIGINT REFERENCES SIMPLE_CLASS, SIMPLECLASS92 BIGINT REFERENCES SIMPLE_CLASS, ID93 BIGINT, INTFIELD93 INTEGER, STRINGFIELD93 VARCHAR(1024), SIMPLECLASS94 BIGINT REFERENCES SIMPLE_CLASS, SIMPLECLASS144 LONG VARCHAR FOR BIT DATA, SIMPLECLASS145 LONG VARCHAR FOR BIT DATA, SIMPLECLASS146 LONG VARCHAR FOR BIT DATA, SIMPLECLASS147 LONG VARCHAR FOR BIT DATA, SIMPLECLASS148 LONG VARCHAR FOR BIT DATA, SIMPLECLASS149 LONG VARCHAR FOR BIT DATA, SIMPLECLASS150 LONG VARCHAR FOR BIT DATA, SIMPLECLASS151 LONG VARCHAR FOR BIT DATA, SIMPLECLASS152 LONG VARCHAR FOR BIT DATA, SIMPLECLASS153 LONG VARCHAR FOR BIT DATA, SIMPLECLASS154 LONG VARCHAR FOR BIT DATA, SIMPLECLASS155 LONG VARCHAR FOR BIT DATA, SIMPLECLASS156 LONG VARCHAR FOR BIT DATA, SIMPLECLASS157 LONG VARCHAR FOR BIT DATA, SIMPLECLASS158 LONG VARCHAR FOR BIT DATA, SIMPLECLASS159 LONG VARCHAR FOR BIT DATA, SIMPLECLASS160 LONG VARCHAR FOR BIT DATA, SIMPLECLASS161 LONG VARCHAR FOR BIT DATA, SIMPLECLASS162 LONG VARCHAR FOR BIT DATA, SIMPLECLASS163 LONG VARCHAR FOR BIT DATA, SIMPLECLASS164 LONG VARCHAR FOR BIT DATA, SIMPLECLASS165 LONG VARCHAR FOR BIT DATA, SIMPLECLASS166 LONG VARCHAR FOR BIT DATA, SIMPLECLASS167 LONG VARCHAR FOR BIT DATA, CONSTRAINT FieldsOfSimpCls_PK PRIMARY KEY (IDENTIFIER) ); CREATE TABLE ARRAY_COLLECTIONS ( IDENTIFIER INTEGER NOT NULL, ARRAY_OF_STRING6 LONG VARCHAR FOR BIT DATA, ARRAY_OF_DATE8 LONG VARCHAR FOR BIT DATA, ARRAY_OF_LOCALE10 LONG VARCHAR FOR BIT DATA, ARRAY_OF_BIG_DECIMAL12 LONG VARCHAR FOR BIT DATA, ARRAY_OF_BIG_INTEGER14 LONG VARCHAR FOR BIT DATA, ARRAY_OF_BYTE16 LONG VARCHAR FOR BIT DATA, ARRAY_OF_DOUBLE18 LONG VARCHAR FOR BIT DATA, ARRAY_OF_FLOAT20 LONG VARCHAR FOR BIT DATA, ARRAY_OF_INTEGER22 LONG VARCHAR FOR BIT DATA, ARRAY_OF_LONG24 LONG VARCHAR FOR BIT DATA, ARRAY_OF_SHORT26 LONG VARCHAR FOR BIT DATA, ARRAY_OF_SIMPLEENUM28 LONG VARCHAR FOR BIT DATA, CONSTRAINT AC_PK PRIMARY KEY (IDENTIFIER) ); CREATE TABLE ARRAY_OF_OBJECT0 ( IDENTIFIER INTEGER REFERENCES ARRAY_COLLECTIONS NOT NULL, ORDER_COL BIGINT, OBJVAL LONG VARCHAR FOR BIT DATA ); CREATE TABLE ARRAY_OF_OBJECT1 ( IDENTIFIER INTEGER REFERENCES ARRAY_COLLECTIONS NOT NULL, ORDER_COL BIGINT, OBJREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE ARRAY_OF_SIMPLE_CLASS2 ( IDENTIFIER INTEGER REFERENCES ARRAY_COLLECTIONS NOT NULL, ORDER_COL BIGINT, OBJVAL LONG VARCHAR FOR BIT DATA ); CREATE TABLE ARRAY_OF_SIMPLE_CLASS3 ( IDENTIFIER INTEGER REFERENCES ARRAY_COLLECTIONS NOT NULL, ORDER_COL BIGINT, OBJREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE ARRAY_OF_SIMPLE_INTERFACE4 ( IDENTIFIER INTEGER REFERENCES ARRAY_COLLECTIONS NOT NULL, ORDER_COL BIGINT, OBJVAL LONG VARCHAR FOR BIT DATA ); CREATE TABLE ARRAY_OF_SIMPLE_INTERFACE5 ( IDENTIFIER INTEGER REFERENCES ARRAY_COLLECTIONS NOT NULL, ORDER_COL BIGINT, OBJREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE ARRAY_OF_STRING7 ( IDENTIFIER INTEGER REFERENCES ARRAY_COLLECTIONS NOT NULL, ORDER_COL BIGINT, STRINGVAL VARCHAR(1024) ); CREATE TABLE ARRAY_OF_DATE9 ( IDENTIFIER INTEGER REFERENCES ARRAY_COLLECTIONS NOT NULL, ORDER_COL BIGINT, DATEVAL TIMESTAMP ); CREATE TABLE ARRAY_OF_LOCALE11 ( IDENTIFIER INTEGER REFERENCES ARRAY_COLLECTIONS NOT NULL, ORDER_COL BIGINT, LOCALEVAL CHAR(20) ); CREATE TABLE ARRAY_OF_BIG_DECIMAL13 ( IDENTIFIER INTEGER REFERENCES ARRAY_COLLECTIONS NOT NULL, ORDER_COL BIGINT, BIG_DECIMALVAL DECIMAL(27,16) ); CREATE TABLE ARRAY_OF_BIG_INTEGER15 ( IDENTIFIER INTEGER REFERENCES ARRAY_COLLECTIONS NOT NULL, ORDER_COL BIGINT, BIG_INTEGERVAL NUMERIC(31) ); CREATE TABLE ARRAY_OF_BYTE17 ( IDENTIFIER INTEGER REFERENCES ARRAY_COLLECTIONS NOT NULL, ORDER_COL BIGINT, BYTEVAL SMALLINT ); CREATE TABLE ARRAY_OF_DOUBLE19 ( IDENTIFIER INTEGER REFERENCES ARRAY_COLLECTIONS NOT NULL, ORDER_COL BIGINT, DOUBLEVAL DOUBLE ); CREATE TABLE ARRAY_OF_FLOAT21 ( IDENTIFIER INTEGER REFERENCES ARRAY_COLLECTIONS NOT NULL, ORDER_COL BIGINT, FLOATVAL REAL ); CREATE TABLE ARRAY_OF_INTEGER23 ( IDENTIFIER INTEGER REFERENCES ARRAY_COLLECTIONS NOT NULL, ORDER_COL BIGINT, INTEGERVAL INTEGER ); CREATE TABLE ARRAY_OF_LONG25 ( IDENTIFIER INTEGER REFERENCES ARRAY_COLLECTIONS NOT NULL, ORDER_COL BIGINT, LONGVAL BIGINT ); CREATE TABLE ARRAY_OF_SHORT27 ( IDENTIFIER INTEGER REFERENCES ARRAY_COLLECTIONS NOT NULL, ORDER_COL BIGINT, SHORTVAL SMALLINT ); CREATE TABLE ARRAY_OF_SIMPLEENUM29 ( IDENTIFIER INTEGER REFERENCES ARRAY_COLLECTIONS NOT NULL, ORDER_COL BIGINT, ENUMVAL CHAR(2) ); CREATE TABLE ARRAY_OF_SIMPLEENUM30 ( IDENTIFIER INTEGER REFERENCES ARRAY_COLLECTIONS NOT NULL, ORDER_COL BIGINT, ENUMVAL NUMERIC(2,0) ); --CollectionCollections CREATE TABLE COLLECTION_COLLECTIONS ( IDENTIFIER INTEGER NOT NULL, COLLECTION_OF_STRING11 LONG VARCHAR FOR BIT DATA, COLLECTION_OF_DATE14 LONG VARCHAR FOR BIT DATA, COLLECTION_OF_LOCALE17 LONG VARCHAR FOR BIT DATA, COLLECTION_OF_BIG_DECIMAL20 LONG VARCHAR FOR BIT DATA, COLLECTION_OF_BIG_INTEGER23 LONG VARCHAR FOR BIT DATA, COLLECTION_OF_BYTE26 LONG VARCHAR FOR BIT DATA, COLLECTION_OF_DOUBLE29 LONG VARCHAR FOR BIT DATA, COLLECTION_OF_FLOAT32 LONG VARCHAR FOR BIT DATA, COLLECTION_OF_INTEGER35 LONG VARCHAR FOR BIT DATA, COLLECTION_OF_LONG38 LONG VARCHAR FOR BIT DATA, COLLECTION_OF_SHORT41 LONG VARCHAR FOR BIT DATA, COLLECTION_OF_SIMPLE_CLASS42 LONG VARCHAR FOR BIT DATA, CONSTRAINT CC_PK PRIMARY KEY (IDENTIFIER) ); CREATE TABLE COLLECTION_OF_OBJECT0 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, OBJREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE COLLECTION_OF_OBJECT1 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE COLLECTION_OF_OBJECT2 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, COLLVAL LONG VARCHAR FOR BIT DATA ); CREATE TABLE COLLECTION_OF_SIMPLE_CLASS3 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, SIMPCLSREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE COLLECTION_OF_SIMPLE_CLASS4 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE COLLECTION_OF_SIMPLE_CLASS5 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, COLLVAL LONG VARCHAR FOR BIT DATA ); CREATE TABLE COLLECTION_OF_SIMPLE_INTERFACE6 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, SIMPINTREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE COLLECTION_OF_SIMPLE_INTERFACE7 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE COLLECTION_OF_SIMPLE_INTERFACE8 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, COLLVAL LONG VARCHAR FOR BIT DATA ); CREATE TABLE COLLECTION_OF_STRING9 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, STRINGVAL VARCHAR(1024) ); CREATE TABLE COLLECTION_OF_STRING10 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, STRINGVAL VARCHAR(1024) ); CREATE TABLE COLLECTION_OF_DATE12 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, DATEVAL TIMESTAMP ); CREATE TABLE COLLECTION_OF_DATE13 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, DATEVAL TIMESTAMP ); CREATE TABLE COLLECTION_OF_LOCALE15 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, LOCALEVAL CHAR(20) ); CREATE TABLE COLLECTION_OF_LOCALE16 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, LOCALEVAL CHAR(20) ); CREATE TABLE COLLECTION_OF_BIG_DECIMAL18 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, BIG_DECIMALVAL DECIMAL(27,16) ); CREATE TABLE COLLECTION_OF_BIG_DECIMAL19 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, BIG_DECIMALVAL DECIMAL(27,16) ); CREATE TABLE COLLECTION_OF_BIG_INTEGER21 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, BIG_INTEGERVAL NUMERIC(31) ); CREATE TABLE COLLECTION_OF_BIG_INTEGER22 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, BIG_INTEGERVAL NUMERIC(31) ); CREATE TABLE COLLECTION_OF_BYTE24 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, BYTEVAL SMALLINT ); CREATE TABLE COLLECTION_OF_BYTE25 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, BYTEVAL SMALLINT ); CREATE TABLE COLLECTION_OF_DOUBLE27 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, DOUBLEVAL DOUBLE ); CREATE TABLE COLLECTION_OF_DOUBLE28 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, DOUBLEVAL DOUBLE ); CREATE TABLE COLLECTION_OF_FLOAT30 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, FLOATVAL REAL ); CREATE TABLE COLLECTION_OF_FLOAT31 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, FLOATVAL REAL ); CREATE TABLE COLLECTION_OF_INTEGER33 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, INTEGERVAL INTEGER ); CREATE TABLE COLLECTION_OF_INTEGER34 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, INTEGERVAL INTEGER ); CREATE TABLE COLLECTION_OF_LONG36 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, LONGVAL BIGINT ); CREATE TABLE COLLECTION_OF_LONG37 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, LONGVAL BIGINT ); CREATE TABLE COLLECTION_OF_SHORT39 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, SHORTVAL SMALLINT ); CREATE TABLE COLLECTION_OF_SHORT40 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, SHORTVAL SMALLINT ); --ListCollections CREATE TABLE LIST_COLLECTIONS ( IDENTIFIER INTEGER NOT NULL, LIST_OF_STRING11 LONG VARCHAR FOR BIT DATA, LIST_OF_DATE14 LONG VARCHAR FOR BIT DATA, LIST_OF_LOCALE17 LONG VARCHAR FOR BIT DATA, LIST_OF_BIG_DECIMAL20 LONG VARCHAR FOR BIT DATA, LIST_OF_BIG_INTEGER23 LONG VARCHAR FOR BIT DATA, LIST_OF_BYTE26 LONG VARCHAR FOR BIT DATA, LIST_OF_DOUBLE29 LONG VARCHAR FOR BIT DATA, LIST_OF_FLOAT32 LONG VARCHAR FOR BIT DATA, LIST_OF_INTEGER35 LONG VARCHAR FOR BIT DATA, LIST_OF_LONG38 LONG VARCHAR FOR BIT DATA, LIST_OF_SHORT41 LONG VARCHAR FOR BIT DATA, LIST_OF_SIMPLE_CLASS42 LONG VARCHAR FOR BIT DATA, CONSTRAINT LC_PK PRIMARY KEY (IDENTIFIER) ); CREATE TABLE LIST_OF_OBJECT0 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, OBJREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE LIST_OF_OBJECT1 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE LIST_OF_OBJECT2 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, COLLVAL LONG VARCHAR FOR BIT DATA ); CREATE TABLE LIST_OF_SIMPLE_CLASS3 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, SIMPCLSREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE LIST_OF_SIMPLE_CLASS4 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE LIST_OF_SIMPLE_CLASS5 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, COLLVAL LONG VARCHAR FOR BIT DATA ); CREATE TABLE LIST_OF_SIMPLE_INTERFACE6 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, SIMPINTREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE LIST_OF_SIMPLE_INTERFACE7 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE LIST_OF_SIMPLE_INTERFACE8 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, COLLVAL LONG VARCHAR FOR BIT DATA ); CREATE TABLE LIST_OF_STRING9 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, STRINGVAL VARCHAR(1024) ); CREATE TABLE LIST_OF_STRING10 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, STRINGVAL VARCHAR(1024) ); CREATE TABLE LIST_OF_DATE12 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, DATEVAL TIMESTAMP ); CREATE TABLE LIST_OF_DATE13 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, DATEVAL TIMESTAMP ); CREATE TABLE LIST_OF_LOCALE15 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, LOCALEVAL CHAR(20) ); CREATE TABLE LIST_OF_LOCALE16 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, LOCALEVAL CHAR(20) ); CREATE TABLE LIST_OF_BIG_DECIMAL18 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, BIG_DECIMALVAL DECIMAL(27,16) ); CREATE TABLE LIST_OF_BIG_DECIMAL19 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, BIG_DECIMALVAL DECIMAL(27,16) ); CREATE TABLE LIST_OF_BIG_INTEGER21 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, BIG_INTEGERVAL NUMERIC(31) ); CREATE TABLE LIST_OF_BIG_INTEGER22 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, BIG_INTEGERVAL NUMERIC(31) ); CREATE TABLE LIST_OF_BYTE24 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, BYTEVAL SMALLINT ); CREATE TABLE LIST_OF_BYTE25 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, BYTEVAL SMALLINT ); CREATE TABLE LIST_OF_DOUBLE27 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, DOUBLEVAL DOUBLE ); CREATE TABLE LIST_OF_DOUBLE28 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, DOUBLEVAL DOUBLE ); CREATE TABLE LIST_OF_FLOAT30 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, FLOATVAL REAL ); CREATE TABLE LIST_OF_FLOAT31 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, FLOATVAL REAL ); CREATE TABLE LIST_OF_INTEGER33 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, INTEGERVAL INTEGER ); CREATE TABLE LIST_OF_INTEGER34 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, INTEGERVAL INTEGER ); CREATE TABLE LIST_OF_LONG36 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, LONGVAL BIGINT ); CREATE TABLE LIST_OF_LONG37 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, LONGVAL BIGINT ); CREATE TABLE LIST_OF_SHORT39 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, SHORTVAL SMALLINT ); CREATE TABLE LIST_OF_SHORT40 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, SHORTVAL SMALLINT ); --ArrayListCollections CREATE TABLE ARRAYLIST_COLLECTIONS ( IDENTIFIER INTEGER NOT NULL, ARRAYLIST_OF_STRING10 LONG VARCHAR FOR BIT DATA, ARRAYLIST_OF_DATE13 LONG VARCHAR FOR BIT DATA, ARRAYLIST_OF_LOCALE16 LONG VARCHAR FOR BIT DATA, ARRAYLIST_OF_BIG_DECIMAL19 LONG VARCHAR FOR BIT DATA, ARRAYLIST_OF_BIG_INTEGER22 LONG VARCHAR FOR BIT DATA, ARRAYLIST_OF_BYTE25 LONG VARCHAR FOR BIT DATA, ARRAYLIST_OF_DOUBLE28 LONG VARCHAR FOR BIT DATA, ARRAYLIST_OF_FLOAT31 LONG VARCHAR FOR BIT DATA, ARRAYLIST_OF_INTEGER34 LONG VARCHAR FOR BIT DATA, ARRAYLIST_OF_LONG37 LONG VARCHAR FOR BIT DATA, ARRAYLIST_OF_SHORT40 LONG VARCHAR FOR BIT DATA, ARRAYLIST_OF_SIMPLEENUM43 LONG VARCHAR FOR BIT DATA, CONSTRAINT ALC_PK PRIMARY KEY (IDENTIFIER) ); CREATE TABLE ARRAYLIST_OF_OBJECT0 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, OBJREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL, INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_OBJECT1 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, OBJREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL, INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_OBJECT2 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, OBJREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL, INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_SIMPLE_CLASS3 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, SIMPCLSREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL, INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_SIMPLE_CLASS4 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, SIMPCLSREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL, INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_SIMPLE_CLASS5 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, SIMPCLSREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL, INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_SIMPLE_INTERFACE6 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, SIMPINTREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL, INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_SIMPLE_INTERFACE7 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, SIMPINTREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL, INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_SIMPLE_INTERFACE8 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, SIMPINTREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL, INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_STRING9 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, STRINGVAL VARCHAR(1024), INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_STRING11 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, STRINGVAL VARCHAR(1024), INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_DATE12 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, DATEVAL TIMESTAMP, INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_DATE14 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, DATEVAL TIMESTAMP, INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_LOCALE15 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, LOCALEVAL CHAR(20), INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_LOCALE17 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, LOCALEVAL CHAR(20), INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_BIG_DECIMAL18 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, BIG_DECIMALVAL DECIMAL(27,16), INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_BIG_DECIMAL20 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, BIG_DECIMALVAL DECIMAL(27,16), INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_BIG_INTEGER21 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, BIG_INTEGERVAL NUMERIC(31), INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_BIG_INTEGER23 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, BIG_INTEGERVAL NUMERIC(31), INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_BYTE24 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, BYTEVAL SMALLINT, INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_BYTE26 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, BYTEVAL SMALLINT, INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_DOUBLE27 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, DOUBLEVAL DOUBLE, INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_DOUBLE29 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, DOUBLEVAL DOUBLE, INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_FLOAT30 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, FLOATVAL REAL, INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_FLOAT32 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, FLOATVAL REAL, INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_INTEGER33 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, INTEGERVAL INTEGER, INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_INTEGER35 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, INTEGERVAL INTEGER, INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_LONG36 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, LONGVAL BIGINT, INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_LONG38 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, LONGVAL BIGINT, INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_SHORT39 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, SHORTVAL SMALLINT, INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_SHORT41 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, SHORTVAL SMALLINT, INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_SIMPLEENUM42 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, SIMPLEENUMVAL CHAR(2), INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_SIMPLEENUM44 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, SIMPLEENUMVAL CHAR(2), INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_SIMPLEENUM45 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, SIMPLEENUMVAL NUMERIC(2,0), INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_SIMPLEENUM46 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, SIMPLEENUMVAL NUMERIC(2,0), INDEX INTEGER NOT NULL ); --LinkedListCollections CREATE TABLE LINKEDLIST_COLLECTIONS ( IDENTIFIER INTEGER NOT NULL, LINKEDLIST_OF_STRING11 LONG VARCHAR FOR BIT DATA, LINKEDLIST_OF_DATE14 LONG VARCHAR FOR BIT DATA, LINKEDLIST_OF_LOCALE17 LONG VARCHAR FOR BIT DATA, LINKEDLIST_OF_BIG_DECIMAL20 LONG VARCHAR FOR BIT DATA, LINKEDLIST_OF_BIG_INTEGER23 LONG VARCHAR FOR BIT DATA, LINKEDLIST_OF_BYTE26 LONG VARCHAR FOR BIT DATA, LINKEDLIST_OF_DOUBLE29 LONG VARCHAR FOR BIT DATA, LINKEDLIST_OF_FLOAT32 LONG VARCHAR FOR BIT DATA, LINKEDLIST_OF_INTEGER35 LONG VARCHAR FOR BIT DATA, LINKEDLIST_OF_LONG38 LONG VARCHAR FOR BIT DATA, LINKEDLIST_OF_SHORT41 LONG VARCHAR FOR BIT DATA, LINKEDLIST_OF_SIMPLE_CLASS42 LONG VARCHAR FOR BIT DATA, CONSTRAINT LLC_PK PRIMARY KEY (IDENTIFIER) ); CREATE TABLE LINKEDLIST_OF_OBJECT0 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, OBJREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE LINKEDLIST_OF_OBJECT1 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE LINKEDLIST_OF_OBJECT2 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, COLLVAL LONG VARCHAR FOR BIT DATA ); CREATE TABLE LINKEDLIST_OF_SIMPLE_CLASS3 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, SIMPCLSREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE LINKEDLIST_OF_SIMPLE_CLASS4 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE LINKEDLIST_OF_SIMPLE_CLASS5 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, COLLVAL LONG VARCHAR FOR BIT DATA ); CREATE TABLE LINKEDLIST_OF_SIMPLE_INTERFACE6 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, SIMPINTREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE LINKEDLIST_OF_SIMPLE_INTERFACE7 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE LINKEDLIST_OF_SIMPLE_INTERFACE8 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, COLLVAL LONG VARCHAR FOR BIT DATA ); CREATE TABLE LINKEDLIST_OF_STRING9 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, STRINGVAL VARCHAR(1024) ); CREATE TABLE LINKEDLIST_OF_STRING10 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, STRINGVAL VARCHAR(1024) ); CREATE TABLE LINKEDLIST_OF_DATE12 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, DATEVAL TIMESTAMP ); CREATE TABLE LINKEDLIST_OF_DATE13 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, DATEVAL TIMESTAMP ); CREATE TABLE LINKEDLIST_OF_LOCALE15 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, LOCALEVAL CHAR(20) ); CREATE TABLE LINKEDLIST_OF_LOCALE16 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, LOCALEVAL CHAR(20) ); CREATE TABLE LINKEDLIST_OF_BIG_DECIMAL18 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, BIG_DECIMALVAL DECIMAL(27,16) ); CREATE TABLE LINKEDLIST_OF_BIG_DECIMAL19 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, BIG_DECIMALVAL DECIMAL(27,16) ); CREATE TABLE LINKEDLIST_OF_BIG_INTEGER21 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, BIG_INTEGERVAL NUMERIC(31) ); CREATE TABLE LINKEDLIST_OF_BIG_INTEGER22 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, BIG_INTEGERVAL NUMERIC(31) ); CREATE TABLE LINKEDLIST_OF_BYTE24 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, BYTEVAL SMALLINT ); CREATE TABLE LINKEDLIST_OF_BYTE25 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, BYTEVAL SMALLINT ); CREATE TABLE LINKEDLIST_OF_DOUBLE27 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, DOUBLEVAL DOUBLE ); CREATE TABLE LINKEDLIST_OF_DOUBLE28 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, DOUBLEVAL DOUBLE ); CREATE TABLE LINKEDLIST_OF_FLOAT30 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, FLOATVAL REAL ); CREATE TABLE LINKEDLIST_OF_FLOAT31 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, FLOATVAL REAL ); CREATE TABLE LINKEDLIST_OF_INTEGER33 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, INTEGERVAL INTEGER ); CREATE TABLE LINKEDLIST_OF_INTEGER34 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, INTEGERVAL INTEGER ); CREATE TABLE LINKEDLIST_OF_LONG36 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, LONGVAL BIGINT ); CREATE TABLE LINKEDLIST_OF_LONG37 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, LONGVAL BIGINT ); CREATE TABLE LINKEDLIST_OF_SHORT39 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, SHORTVAL SMALLINT ); CREATE TABLE LINKEDLIST_OF_SHORT40 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, SHORTVAL SMALLINT ); --VectorCollections CREATE TABLE VECTOR_COLLECTIONS ( IDENTIFIER INTEGER NOT NULL, VECTOR_OF_STRING11 LONG VARCHAR FOR BIT DATA, VECTOR_OF_DATE14 LONG VARCHAR FOR BIT DATA, VECTOR_OF_LOCALE17 LONG VARCHAR FOR BIT DATA, VECTOR_OF_BIG_DECIMAL20 LONG VARCHAR FOR BIT DATA, VECTOR_OF_BIG_INTEGER23 LONG VARCHAR FOR BIT DATA, VECTOR_OF_BYTE26 LONG VARCHAR FOR BIT DATA, VECTOR_OF_DOUBLE29 LONG VARCHAR FOR BIT DATA, VECTOR_OF_FLOAT32 LONG VARCHAR FOR BIT DATA, VECTOR_OF_INTEGER35 LONG VARCHAR FOR BIT DATA, VECTOR_OF_LONG38 LONG VARCHAR FOR BIT DATA, VECTOR_OF_SHORT41 LONG VARCHAR FOR BIT DATA, VECTOR_OF_SIMPLE_CLASS42 LONG VARCHAR FOR BIT DATA, CONSTRAINT VC_PK PRIMARY KEY (IDENTIFIER) ); CREATE TABLE VECTOR_OF_OBJECT0 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, OBJREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE VECTOR_OF_OBJECT1 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE VECTOR_OF_OBJECT2 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, COLLVAL LONG VARCHAR FOR BIT DATA ); CREATE TABLE VECTOR_OF_SIMPLE_CLASS3 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, SIMPCLSREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE VECTOR_OF_SIMPLE_CLASS4 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE VECTOR_OF_SIMPLE_CLASS5 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, COLLVAL LONG VARCHAR FOR BIT DATA ); CREATE TABLE VECTOR_OF_SIMPLE_INTERFACE6 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, SIMPINTREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE VECTOR_OF_SIMPLE_INTERFACE7 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE VECTOR_OF_SIMPLE_INTERFACE8 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, COLLVAL LONG VARCHAR FOR BIT DATA ); CREATE TABLE VECTOR_OF_STRING9 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, STRINGVAL VARCHAR(1024) ); CREATE TABLE VECTOR_OF_STRING10 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, STRINGVAL VARCHAR(1024) ); CREATE TABLE VECTOR_OF_DATE12 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, DATEVAL TIMESTAMP ); CREATE TABLE VECTOR_OF_DATE13 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, DATEVAL TIMESTAMP ); CREATE TABLE VECTOR_OF_LOCALE15 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, LOCALEVAL CHAR(20) ); CREATE TABLE VECTOR_OF_LOCALE16 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, LOCALEVAL CHAR(20) ); CREATE TABLE VECTOR_OF_BIG_DECIMAL18 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, BIG_DECIMALVAL DECIMAL(27,16) ); CREATE TABLE VECTOR_OF_BIG_DECIMAL19 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, BIG_DECIMALVAL DECIMAL(27,16) ); CREATE TABLE VECTOR_OF_BIG_INTEGER21 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, BIG_INTEGERVAL NUMERIC(31) ); CREATE TABLE VECTOR_OF_BIG_INTEGER22 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, BIG_INTEGERVAL NUMERIC(31) ); CREATE TABLE VECTOR_OF_BYTE24 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, BYTEVAL SMALLINT ); CREATE TABLE VECTOR_OF_BYTE25 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, BYTEVAL SMALLINT ); CREATE TABLE VECTOR_OF_DOUBLE27 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, DOUBLEVAL DOUBLE ); CREATE TABLE VECTOR_OF_DOUBLE28 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, DOUBLEVAL DOUBLE ); CREATE TABLE VECTOR_OF_FLOAT30 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, FLOATVAL REAL ); CREATE TABLE VECTOR_OF_FLOAT31 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, FLOATVAL REAL ); CREATE TABLE VECTOR_OF_INTEGER33 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, INTEGERVAL INTEGER ); CREATE TABLE VECTOR_OF_INTEGER34 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, INTEGERVAL INTEGER ); CREATE TABLE VECTOR_OF_LONG36 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, LONGVAL BIGINT ); CREATE TABLE VECTOR_OF_LONG37 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, LONGVAL BIGINT ); CREATE TABLE VECTOR_OF_SHORT39 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, SHORTVAL SMALLINT ); CREATE TABLE VECTOR_OF_SHORT40 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, SHORTVAL SMALLINT ); --SetCollections CREATE TABLE SET_COLLECTIONS ( IDENTIFIER INTEGER NOT NULL, SET_OF_OBJECT2 LONG VARCHAR FOR BIT DATA, SET_OF_SIMPLE_CLASS5 LONG VARCHAR FOR BIT DATA, SET_OF_SIMPLE_INTERFACE8 LONG VARCHAR FOR BIT DATA, SET_OF_STRING11 LONG VARCHAR FOR BIT DATA, SET_OF_DATE14 LONG VARCHAR FOR BIT DATA, SET_OF_LOCALE17 LONG VARCHAR FOR BIT DATA, SET_OF_BIG_DECIMAL20 LONG VARCHAR FOR BIT DATA, SET_OF_BIG_INTEGER23 LONG VARCHAR FOR BIT DATA, SET_OF_BYTE26 LONG VARCHAR FOR BIT DATA, SET_OF_DOUBLE29 LONG VARCHAR FOR BIT DATA, SET_OF_FLOAT32 LONG VARCHAR FOR BIT DATA, SET_OF_INTEGER35 LONG VARCHAR FOR BIT DATA, SET_OF_LONG38 LONG VARCHAR FOR BIT DATA, SET_OF_SHORT41 LONG VARCHAR FOR BIT DATA, SET_OF_SIMPLE_CLASS42 LONG VARCHAR FOR BIT DATA, CONSTRAINT SC_PK PRIMARY KEY (IDENTIFIER) ); CREATE TABLE SET_OF_OBJECT0 ( IDENTIFIER INTEGER REFERENCES SET_COLLECTIONS NOT NULL, OBJREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE SET_OF_OBJECT1 ( IDENTIFIER INTEGER REFERENCES SET_COLLECTIONS NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE SET_OF_SIMPLE_CLASS3 ( IDENTIFIER INTEGER REFERENCES SET_COLLECTIONS NOT NULL, SIMPCLSREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE SET_OF_SIMPLE_CLASS4 ( IDENTIFIER INTEGER REFERENCES SET_COLLECTIONS NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE SET_OF_SIMPLE_INTERFACE6 ( IDENTIFIER INTEGER REFERENCES SET_COLLECTIONS NOT NULL, SIMPINTREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE SET_OF_SIMPLE_INTERFACE7 ( IDENTIFIER INTEGER REFERENCES SET_COLLECTIONS NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE SET_OF_STRING9 ( IDENTIFIER INTEGER REFERENCES SET_COLLECTIONS NOT NULL, STRINGVAL VARCHAR(1024) ); CREATE TABLE SET_OF_STRING10 ( IDENTIFIER INTEGER REFERENCES SET_COLLECTIONS NOT NULL, STRINGVAL VARCHAR(1024) ); CREATE TABLE SET_OF_DATE12 ( IDENTIFIER INTEGER REFERENCES SET_COLLECTIONS NOT NULL, DATEVAL TIMESTAMP ); CREATE TABLE SET_OF_DATE13 ( IDENTIFIER INTEGER REFERENCES SET_COLLECTIONS NOT NULL, DATEVAL TIMESTAMP ); CREATE TABLE SET_OF_LOCALE15 ( IDENTIFIER INTEGER REFERENCES SET_COLLECTIONS NOT NULL, LOCALEVAL CHAR(20) ); CREATE TABLE SET_OF_LOCALE16 ( IDENTIFIER INTEGER REFERENCES SET_COLLECTIONS NOT NULL, LOCALEVAL CHAR(20) ); CREATE TABLE SET_OF_BIG_DECIMAL18 ( IDENTIFIER INTEGER REFERENCES SET_COLLECTIONS NOT NULL, BIG_DECIMALVAL DECIMAL(27,16) ); CREATE TABLE SET_OF_BIG_DECIMAL19 ( IDENTIFIER INTEGER REFERENCES SET_COLLECTIONS NOT NULL, BIG_DECIMALVAL DECIMAL(27,16) ); CREATE TABLE SET_OF_BIG_INTEGER21 ( IDENTIFIER INTEGER REFERENCES SET_COLLECTIONS NOT NULL, BIG_INTEGERVAL NUMERIC(31) ); CREATE TABLE SET_OF_BIG_INTEGER22 ( IDENTIFIER INTEGER REFERENCES SET_COLLECTIONS NOT NULL, BIG_INTEGERVAL NUMERIC(31) ); CREATE TABLE SET_OF_BYTE24 ( IDENTIFIER INTEGER REFERENCES SET_COLLECTIONS NOT NULL, BYTEVAL SMALLINT ); CREATE TABLE SET_OF_BYTE25 ( IDENTIFIER INTEGER REFERENCES SET_COLLECTIONS NOT NULL, BYTEVAL SMALLINT ); CREATE TABLE SET_OF_DOUBLE27 ( IDENTIFIER INTEGER REFERENCES SET_COLLECTIONS NOT NULL, DOUBLEVAL DOUBLE ); CREATE TABLE SET_OF_DOUBLE28 ( IDENTIFIER INTEGER REFERENCES SET_COLLECTIONS NOT NULL, DOUBLEVAL DOUBLE ); CREATE TABLE SET_OF_FLOAT30 ( IDENTIFIER INTEGER REFERENCES SET_COLLECTIONS NOT NULL, FLOATVAL REAL ); CREATE TABLE SET_OF_FLOAT31 ( IDENTIFIER INTEGER REFERENCES SET_COLLECTIONS NOT NULL, FLOATVAL REAL ); CREATE TABLE SET_OF_INTEGER33 ( IDENTIFIER INTEGER REFERENCES SET_COLLECTIONS NOT NULL, INTEGERVAL INTEGER ); CREATE TABLE SET_OF_INTEGER34 ( IDENTIFIER INTEGER REFERENCES SET_COLLECTIONS NOT NULL, INTEGERVAL INTEGER ); CREATE TABLE SET_OF_LONG36 ( IDENTIFIER INTEGER REFERENCES SET_COLLECTIONS NOT NULL, LONGVAL BIGINT ); CREATE TABLE SET_OF_LONG37 ( IDENTIFIER INTEGER REFERENCES SET_COLLECTIONS NOT NULL, LONGVAL BIGINT ); CREATE TABLE SET_OF_SHORT39 ( IDENTIFIER INTEGER REFERENCES SET_COLLECTIONS NOT NULL, SHORTVAL SMALLINT ); CREATE TABLE SET_OF_SHORT40 ( IDENTIFIER INTEGER REFERENCES SET_COLLECTIONS NOT NULL, SHORTVAL SMALLINT ); --HashSetCollections CREATE TABLE HASHSET_COLLECTIONS ( IDENTIFIER INTEGER NOT NULL, HASHSET_OF_OBJECT2 LONG VARCHAR FOR BIT DATA, HASHSET_OF_SIMPLE_CLASS5 LONG VARCHAR FOR BIT DATA, HASHSET_OF_SIMPLE_INTERFACE8 LONG VARCHAR FOR BIT DATA, HASHSET_OF_STRING11 LONG VARCHAR FOR BIT DATA, HASHSET_OF_DATE14 LONG VARCHAR FOR BIT DATA, HASHSET_OF_LOCALE17 LONG VARCHAR FOR BIT DATA, HASHSET_OF_BIG_DECIMAL20 LONG VARCHAR FOR BIT DATA, HASHSET_OF_BIG_INTEGER23 LONG VARCHAR FOR BIT DATA, HASHSET_OF_BYTE26 LONG VARCHAR FOR BIT DATA, HASHSET_OF_DOUBLE29 LONG VARCHAR FOR BIT DATA, HASHSET_OF_FLOAT32 LONG VARCHAR FOR BIT DATA, HASHSET_OF_INTEGER35 LONG VARCHAR FOR BIT DATA, HASHSET_OF_LONG38 LONG VARCHAR FOR BIT DATA, HASHSET_OF_SHORT41 LONG VARCHAR FOR BIT DATA, HASHSET_OF_SIMPLE_CLASS42 LONG VARCHAR FOR BIT DATA, CONSTRAINT HSC_PK PRIMARY KEY (IDENTIFIER) ); CREATE TABLE HASHSET_OF_OBJECT0 ( IDENTIFIER INTEGER REFERENCES HASHSET_COLLECTIONS NOT NULL, OBJREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHSET_OF_OBJECT1 ( IDENTIFIER INTEGER REFERENCES HASHSET_COLLECTIONS NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHSET_OF_SIMPLE_CLASS3 ( IDENTIFIER INTEGER REFERENCES HASHSET_COLLECTIONS NOT NULL, SIMPCLSREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHSET_OF_SIMPLE_CLASS4 ( IDENTIFIER INTEGER REFERENCES HASHSET_COLLECTIONS NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHSET_OF_SIMPLE_INTERFACE6 ( IDENTIFIER INTEGER REFERENCES HASHSET_COLLECTIONS NOT NULL, SIMPINTREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHSET_OF_SIMPLE_INTERFACE7 ( IDENTIFIER INTEGER REFERENCES HASHSET_COLLECTIONS NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHSET_OF_STRING9 ( IDENTIFIER INTEGER REFERENCES HASHSET_COLLECTIONS NOT NULL, STRINGVAL VARCHAR(1024) ); CREATE TABLE HASHSET_OF_STRING10 ( IDENTIFIER INTEGER REFERENCES HASHSET_COLLECTIONS NOT NULL, STRINGVAL VARCHAR(1024) ); CREATE TABLE HASHSET_OF_DATE12 ( IDENTIFIER INTEGER REFERENCES HASHSET_COLLECTIONS NOT NULL, DATEVAL TIMESTAMP ); CREATE TABLE HASHSET_OF_DATE13 ( IDENTIFIER INTEGER REFERENCES HASHSET_COLLECTIONS NOT NULL, DATEVAL TIMESTAMP ); CREATE TABLE HASHSET_OF_LOCALE15 ( IDENTIFIER INTEGER REFERENCES HASHSET_COLLECTIONS NOT NULL, LOCALEVAL CHAR(20) ); CREATE TABLE HASHSET_OF_LOCALE16 ( IDENTIFIER INTEGER REFERENCES HASHSET_COLLECTIONS NOT NULL, LOCALEVAL CHAR(20) ); CREATE TABLE HASHSET_OF_BIG_DECIMAL18 ( IDENTIFIER INTEGER REFERENCES HASHSET_COLLECTIONS NOT NULL, BIG_DECIMALVAL DECIMAL(27,16) ); CREATE TABLE HASHSET_OF_BIG_DECIMAL19 ( IDENTIFIER INTEGER REFERENCES HASHSET_COLLECTIONS NOT NULL, BIG_DECIMALVAL DECIMAL(27,16) ); CREATE TABLE HASHSET_OF_BIG_INTEGER21 ( IDENTIFIER INTEGER REFERENCES HASHSET_COLLECTIONS NOT NULL, BIG_INTEGERVAL NUMERIC(31) ); CREATE TABLE HASHSET_OF_BIG_INTEGER22 ( IDENTIFIER INTEGER REFERENCES HASHSET_COLLECTIONS NOT NULL, BIG_INTEGERVAL NUMERIC(31) ); CREATE TABLE HASHSET_OF_BYTE24 ( IDENTIFIER INTEGER REFERENCES HASHSET_COLLECTIONS NOT NULL, BYTEVAL SMALLINT ); CREATE TABLE HASHSET_OF_BYTE25 ( IDENTIFIER INTEGER REFERENCES HASHSET_COLLECTIONS NOT NULL, BYTEVAL SMALLINT ); CREATE TABLE HASHSET_OF_DOUBLE27 ( IDENTIFIER INTEGER REFERENCES HASHSET_COLLECTIONS NOT NULL, DOUBLEVAL DOUBLE ); CREATE TABLE HASHSET_OF_DOUBLE28 ( IDENTIFIER INTEGER REFERENCES HASHSET_COLLECTIONS NOT NULL, DOUBLEVAL DOUBLE ); CREATE TABLE HASHSET_OF_FLOAT30 ( IDENTIFIER INTEGER REFERENCES HASHSET_COLLECTIONS NOT NULL, FLOATVAL REAL ); CREATE TABLE HASHSET_OF_FLOAT31 ( IDENTIFIER INTEGER REFERENCES HASHSET_COLLECTIONS NOT NULL, FLOATVAL REAL ); CREATE TABLE HASHSET_OF_INTEGER33 ( IDENTIFIER INTEGER REFERENCES HASHSET_COLLECTIONS NOT NULL, INTEGERVAL INTEGER ); CREATE TABLE HASHSET_OF_INTEGER34 ( IDENTIFIER INTEGER REFERENCES HASHSET_COLLECTIONS NOT NULL, INTEGERVAL INTEGER ); CREATE TABLE HASHSET_OF_LONG36 ( IDENTIFIER INTEGER REFERENCES HASHSET_COLLECTIONS NOT NULL, LONGVAL BIGINT ); CREATE TABLE HASHSET_OF_LONG37 ( IDENTIFIER INTEGER REFERENCES HASHSET_COLLECTIONS NOT NULL, LONGVAL BIGINT ); CREATE TABLE HASHSET_OF_SHORT39 ( IDENTIFIER INTEGER REFERENCES HASHSET_COLLECTIONS NOT NULL, SHORTVAL SMALLINT ); CREATE TABLE HASHSET_OF_SHORT40 ( IDENTIFIER INTEGER REFERENCES HASHSET_COLLECTIONS NOT NULL, SHORTVAL SMALLINT ); --TreeSetCollections CREATE TABLE TREESET_COLLECTIONS ( IDENTIFIER INTEGER NOT NULL, TREESET_OF_STRING10 LONG VARCHAR FOR BIT DATA, TREESET_OF_DATE13 LONG VARCHAR FOR BIT DATA, TREESET_OF_BIG_DECIMAL16 LONG VARCHAR FOR BIT DATA, TREESET_OF_BIG_INTEGER19 LONG VARCHAR FOR BIT DATA, TREESET_OF_BYTE22 LONG VARCHAR FOR BIT DATA, TREESET_OF_DOUBLE25 LONG VARCHAR FOR BIT DATA, TREESET_OF_FLOAT28 LONG VARCHAR FOR BIT DATA, TREESET_OF_INTEGER31 LONG VARCHAR FOR BIT DATA, TREESET_OF_LONG34 LONG VARCHAR FOR BIT DATA, TREESET_OF_SHORT37 LONG VARCHAR FOR BIT DATA, CONSTRAINT TSC_PK PRIMARY KEY (IDENTIFIER) ); CREATE TABLE TREESET_OF_OBJECT0 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, OBJREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL, INDEX INTEGER NOT NULL ); CREATE TABLE TREESET_OF_OBJECT1 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, OBJREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL, INDEX INTEGER NOT NULL ); CREATE TABLE TREESET_OF_OBJECT2 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, OBJREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL, INDEX INTEGER NOT NULL ); CREATE TABLE TREESET_OF_SIMPLE_CLASS3 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, SIMPCLSREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL, INDEX INTEGER NOT NULL ); CREATE TABLE TREESET_OF_SIMPLE_CLASS4 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, SIMPCLSREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL, INDEX INTEGER NOT NULL ); CREATE TABLE TREESET_OF_SIMPLE_CLASS5 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, SIMPCLSREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL, INDEX INTEGER NOT NULL ); CREATE TABLE TREESET_OF_SIMPLE_INTERFACE6 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, SIMPINTREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL, INDEX INTEGER NOT NULL ); CREATE TABLE TREESET_OF_SIMPLE_INTERFACE7 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, SIMPINTREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL, INDEX INTEGER NOT NULL ); CREATE TABLE TREESET_OF_SIMPLE_INTERFACE8 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, SIMPINTREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL, INDEX INTEGER NOT NULL ); CREATE TABLE TREESET_OF_STRING9 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, STRINGVAL VARCHAR(1024), INDEX INTEGER NOT NULL ); CREATE TABLE TREESET_OF_STRING11 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, STRINGVAL VARCHAR(1024), INDEX INTEGER NOT NULL ); CREATE TABLE TREESET_OF_DATE12 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, DATEVAL TIMESTAMP, INDEX INTEGER NOT NULL ); CREATE TABLE TREESET_OF_DATE14 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, DATEVAL TIMESTAMP, INDEX INTEGER NOT NULL ); CREATE TABLE TREESET_OF_BIG_DECIMAL15 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, BIG_DECIMALVAL DECIMAL(27,16), INDEX INTEGER NOT NULL ); CREATE TABLE TREESET_OF_BIG_DECIMAL17 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, BIG_DECIMALVAL DECIMAL(27,16), INDEX INTEGER NOT NULL ); CREATE TABLE TREESET_OF_BIG_INTEGER18 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, BIG_INTEGERVAL NUMERIC(31), INDEX INTEGER NOT NULL ); CREATE TABLE TREESET_OF_BIG_INTEGER20 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, BIG_INTEGERVAL NUMERIC(31), INDEX INTEGER NOT NULL ); CREATE TABLE TREESET_OF_BYTE21 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, BYTEVAL SMALLINT, INDEX INTEGER NOT NULL ); CREATE TABLE TREESET_OF_BYTE23 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, BYTEVAL SMALLINT, INDEX INTEGER NOT NULL ); CREATE TABLE TREESET_OF_DOUBLE24 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, DOUBLEVAL DOUBLE, INDEX INTEGER NOT NULL ); CREATE TABLE TREESET_OF_DOUBLE26 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, DOUBLEVAL DOUBLE, INDEX INTEGER NOT NULL ); CREATE TABLE TREESET_OF_FLOAT27 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, FLOATVAL REAL, INDEX INTEGER NOT NULL ); CREATE TABLE TREESET_OF_FLOAT29 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, FLOATVAL REAL, INDEX INTEGER NOT NULL ); CREATE TABLE TREESET_OF_INTEGER30 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, INTEGERVAL INTEGER, INDEX INTEGER NOT NULL ); CREATE TABLE TREESET_OF_INTEGER32 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, INTEGERVAL INTEGER, INDEX INTEGER NOT NULL ); CREATE TABLE TREESET_OF_LONG33 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, LONGVAL BIGINT, INDEX INTEGER NOT NULL ); CREATE TABLE TREESET_OF_LONG35 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, LONGVAL BIGINT, INDEX INTEGER NOT NULL ); CREATE TABLE TREESET_OF_SHORT36 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, SHORTVAL SMALLINT, INDEX INTEGER NOT NULL ); CREATE TABLE TREESET_OF_SHORT38 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, SHORTVAL SMALLINT, INDEX INTEGER NOT NULL ); --MapOfStringKeyCollections CREATE TABLE MAPSTRINGKEY_COLLECTIONS ( IDENTIFIER INTEGER NOT NULL, MAP_OF_STRING_OBJECT86 LONG VARCHAR FOR BIT DATA, MAP_OF_STRING_SIMPLECLASS89 LONG VARCHAR FOR BIT DATA, MAP_OF_STRING_SIMPLEINTERFACE92 LONG VARCHAR FOR BIT DATA, MAP_OF_STRING_STRING95 LONG VARCHAR FOR BIT DATA, MAP_OF_STRING_DATE98 LONG VARCHAR FOR BIT DATA, MAP_OF_STRING_LOCALE101 LONG VARCHAR FOR BIT DATA, MAP_OF_STRING_BIGDECIMAL104 LONG VARCHAR FOR BIT DATA, MAP_OF_STRING_BIGINTEGER107 LONG VARCHAR FOR BIT DATA, MAP_OF_STRING_BYTE110 LONG VARCHAR FOR BIT DATA, MAP_OF_STRING_DOUBLE113 LONG VARCHAR FOR BIT DATA, MAP_OF_STRING_FLOAT116 LONG VARCHAR FOR BIT DATA, MAP_OF_STRING_INTEGER119 LONG VARCHAR FOR BIT DATA, MAP_OF_STRING_LONG122 LONG VARCHAR FOR BIT DATA, MAP_OF_STRING_SHORT125 LONG VARCHAR FOR BIT DATA, MAP_OF_STRING_SIMPLEENUM132 LONG VARCHAR FOR BIT DATA, CONSTRAINT MSKC_PK PRIMARY KEY (IDENTIFIER) ); CREATE TABLE MAP_OF_STRING_OBJECT0 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, OBJREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE MAP_OF_STRING_OBJECT1 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, OBJREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE MAP_OF_STRING_OBJECT2 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, OBJREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE MAP_OF_STRING_SIMPLE_CLASS3 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, SIMPCLSREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE MAP_OF_STRING_SIMPLE_CLASS4 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, SIMPCLSREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE MAP_OF_STRING_SIMPLE_CLASS5 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, SIMPCLSREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE MAP_OF_STRING_SIMPLE_INTERFACE6 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, SIMPINTREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE MAP_OF_STRING_SIMPLE_INTERFACE7 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, SIMPINTREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE MAP_OF_STRING_SIMPLE_INTERFACE8 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, SIMPINTREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE MAP_OF_STRING_STRING9 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL VARCHAR(100) NOT NULL ); CREATE TABLE MAP_OF_STRING_STRING10 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL VARCHAR(100) NOT NULL ); CREATE TABLE MAP_OF_STRING_STRING11 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL VARCHAR(100) NOT NULL ); CREATE TABLE MAP_OF_STRING_DATE12 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL TIMESTAMP NOT NULL ); CREATE TABLE MAP_OF_STRING_DATE13 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL TIMESTAMP NOT NULL ); CREATE TABLE MAP_OF_STRING_DATE14 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL TIMESTAMP NOT NULL ); CREATE TABLE MAP_OF_STRING_LOCALE15 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(20) NOT NULL ); CREATE TABLE MAP_OF_STRING_LOCALE16 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(20) NOT NULL ); CREATE TABLE MAP_OF_STRING_LOCALE17 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(20) NOT NULL ); CREATE TABLE MAP_OF_STRING_BIG_DECIMAL18 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DECIMAL(27,16) NOT NULL ); CREATE TABLE MAP_OF_STRING_BIG_DECIMAL19 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DECIMAL(27,16) NOT NULL ); CREATE TABLE MAP_OF_STRING_BIG_DECIMAL20 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DECIMAL(27,16) NOT NULL ); CREATE TABLE MAP_OF_STRING_BIG_INTEGER21 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(31) NOT NULL ); CREATE TABLE MAP_OF_STRING_BIG_INTEGER22 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(31) NOT NULL ); CREATE TABLE MAP_OF_STRING_BIG_INTEGER23 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(31) NOT NULL ); CREATE TABLE MAP_OF_STRING_BYTE24 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE MAP_OF_STRING_BYTE25 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE MAP_OF_STRING_BYTE26 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE MAP_OF_STRING_DOUBLE27 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DOUBLE NOT NULL ); CREATE TABLE MAP_OF_STRING_DOUBLE28 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DOUBLE NOT NULL ); CREATE TABLE MAP_OF_STRING_DOUBLE29 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DOUBLE NOT NULL ); CREATE TABLE MAP_OF_STRING_FLOAT30 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL REAL NOT NULL ); CREATE TABLE MAP_OF_STRING_FLOAT31 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL REAL NOT NULL ); CREATE TABLE MAP_OF_STRING_FLOAT32 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL REAL NOT NULL ); CREATE TABLE MAP_OF_STRING_INTEGER33 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL INTEGER NOT NULL ); CREATE TABLE MAP_OF_STRING_INTEGER34 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL INTEGER NOT NULL ); CREATE TABLE MAP_OF_STRING_INTEGER35 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL INTEGER NOT NULL ); CREATE TABLE MAP_OF_STRING_LONG36 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL BIGINT NOT NULL ); CREATE TABLE MAP_OF_STRING_LONG37 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL BIGINT NOT NULL ); CREATE TABLE MAP_OF_STRING_LONG38 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL BIGINT NOT NULL ); CREATE TABLE MAP_OF_STRING_SHORT39 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE MAP_OF_STRING_SHORT40 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE MAP_OF_STRING_SHORT41 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE MAP_OF_STRING_OBJECT42 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE MAP_OF_STRING_OBJECT43 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE MAP_OF_STRING_SIMPLE_CLASS45 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE MAP_OF_STRING_SIMPLE_CLASS46 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE MAP_OF_STRING_SIMPLE_INTERFACE48 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE MAP_OF_STRING_SIMPLE_INTERFACE49 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE MAP_OF_STRING_STRING51 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL VARCHAR(100) NOT NULL ); CREATE TABLE MAP_OF_STRING_STRING52 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL VARCHAR(100) NOT NULL ); CREATE TABLE MAP_OF_STRING_DATE54 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL TIMESTAMP NOT NULL ); CREATE TABLE MAP_OF_STRING_DATE55 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL TIMESTAMP NOT NULL ); CREATE TABLE MAP_OF_STRING_LOCALE57 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(20) NOT NULL ); CREATE TABLE MAP_OF_STRING_LOCALE58 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(20) NOT NULL ); CREATE TABLE MAP_OF_STRING_BIG_DECIMAL60 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DECIMAL(27,16) NOT NULL ); CREATE TABLE MAP_OF_STRING_BIG_DECIMAL61 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DECIMAL(27,16) NOT NULL ); CREATE TABLE MAP_OF_STRING_BIG_INTEGER63 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(31) NOT NULL ); CREATE TABLE MAP_OF_STRING_BIG_INTEGER64 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(31) NOT NULL ); CREATE TABLE MAP_OF_STRING_BYTE66 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE MAP_OF_STRING_BYTE67 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE MAP_OF_STRING_DOUBLE69 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DOUBLE NOT NULL ); CREATE TABLE MAP_OF_STRING_DOUBLE70 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DOUBLE NOT NULL ); CREATE TABLE MAP_OF_STRING_FLOAT72 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL REAL NOT NULL ); CREATE TABLE MAP_OF_STRING_FLOAT73 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL REAL NOT NULL ); CREATE TABLE MAP_OF_STRING_INTEGER75 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL INTEGER NOT NULL ); CREATE TABLE MAP_OF_STRING_INTEGER76 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL INTEGER NOT NULL ); CREATE TABLE MAP_OF_STRING_LONG78 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL BIGINT NOT NULL ); CREATE TABLE MAP_OF_STRING_LONG79 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL BIGINT NOT NULL ); CREATE TABLE MAP_OF_STRING_SHORT81 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE MAP_OF_STRING_SHORT82 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE MAP_OF_STRING_OBJECT84 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL LONG VARCHAR FOR BIT DATA ); CREATE TABLE MAP_OF_STRING_SIMPLE_CLASS87 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL LONG VARCHAR FOR BIT DATA ); CREATE TABLE MAP_OF_STRING_SIMPLE_INTERFACE90 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL LONG VARCHAR FOR BIT DATA ); CREATE TABLE MAP_OF_STRING_STRING93 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL VARCHAR(100) NOT NULL ); CREATE TABLE MAP_OF_STRING_DATE96 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL TIMESTAMP NOT NULL ); CREATE TABLE MAP_OF_STRING_LOCALE99 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(20) NOT NULL ); CREATE TABLE MAP_OF_STRING_BIG_DECIMAL102 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DECIMAL(27,16) NOT NULL ); CREATE TABLE MAP_OF_STRING_BIG_INTEGER105 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(31) NOT NULL ); CREATE TABLE MAP_OF_STRING_BYTE108 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE MAP_OF_STRING_DOUBLE111 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DOUBLE NOT NULL ); CREATE TABLE MAP_OF_STRING_FLOAT114 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL REAL NOT NULL ); CREATE TABLE MAP_OF_STRING_INTEGER117 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL INTEGER NOT NULL ); CREATE TABLE MAP_OF_STRING_LONG120 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL BIGINT NOT NULL ); CREATE TABLE MAP_OF_STRING_SHORT123 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE MAP_OF_STRING_SIMPLEENUM126 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(2) NOT NULL ); CREATE TABLE MAP_OF_STRING_SIMPLEENUM127 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(2) NOT NULL ); CREATE TABLE MAP_OF_STRING_SIMPLEENUM128 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(2) NOT NULL ); CREATE TABLE MAP_OF_STRING_SIMPLEENUM129 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(2) NOT NULL ); CREATE TABLE MAP_OF_STRING_SIMPLEENUM130 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(2) NOT NULL ); CREATE TABLE MAP_OF_STRING_SIMPLEENUM131 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(2) NOT NULL ); CREATE TABLE MAP_OF_STRING_SIMPLEENUM133 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(2,0) NOT NULL ); CREATE TABLE MAP_OF_STRING_SIMPLEENUM134 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(2,0) NOT NULL ); CREATE TABLE MAP_OF_STRING_SIMPLEENUM135 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100), VALUEVAL NUMERIC(2,0) ); CREATE TABLE MAP_OF_STRING_SIMPLEENUM136 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(2,0) NOT NULL ); CREATE TABLE MAP_OF_STRING_SIMPLEENUM137 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(2,0) NOT NULL ); CREATE TABLE MAP_OF_STRING_SIMPLEENUM138 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(2,0) NOT NULL ); --HashMapOfStringKeyCollections CREATE TABLE HASHMAPSTRINGKEY_COLLECTIONS ( IDENTIFIER INTEGER NOT NULL, HASHMAP_STR_OBJECT86 LONG VARCHAR FOR BIT DATA, HASHMAP_STR_SIMPLECLASS89 LONG VARCHAR FOR BIT DATA, HASHMAP_STR_SIMPLEINTERFACE92 LONG VARCHAR FOR BIT DATA, HASHMAP_STR_STRING95 LONG VARCHAR FOR BIT DATA, HASHMAP_STR_DATE98 LONG VARCHAR FOR BIT DATA, HASHMAP_STR_LOCALE101 LONG VARCHAR FOR BIT DATA, HASHMAP_STR_BIGDECIMAL104 LONG VARCHAR FOR BIT DATA, HASHMAP_STR_BIGINTEGER107 LONG VARCHAR FOR BIT DATA, HASHMAP_STR_BYTE110 LONG VARCHAR FOR BIT DATA, HASHMAP_STR_DOUBLE113 LONG VARCHAR FOR BIT DATA, HASHMAP_STR_FLOAT116 LONG VARCHAR FOR BIT DATA, HASHMAP_STR_INTEGER119 LONG VARCHAR FOR BIT DATA, HASHMAP_STR_LONG122 LONG VARCHAR FOR BIT DATA, HASHMAP_STR_SHORT125 LONG VARCHAR FOR BIT DATA, CONSTRAINT HMSKC_PK PRIMARY KEY (IDENTIFIER) ); CREATE TABLE HASHMAP_STR_OBJECT0 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, OBJREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHMAP_STR_OBJECT1 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, OBJREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHMAP_STR_OBJECT2 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, OBJREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHMAP_STR_SIMPLE_CLASS3 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, SIMPCLSREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHMAP_STR_SIMPLE_CLASS4 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, SIMPCLSREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHMAP_STR_SIMPLE_CLASS5 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, SIMPCLSREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHMAP_STR_SIMPLE_INTERFACE6 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, SIMPINTREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHMAP_STR_SIMPLE_INTERFACE7 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, SIMPINTREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHMAP_STR_SIMPLE_INTERFACE8 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, SIMPINTREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHMAP_STR_STRING9 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL VARCHAR(100) NOT NULL ); CREATE TABLE HASHMAP_STR_STRING10 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL VARCHAR(100) NOT NULL ); CREATE TABLE HASHMAP_STR_STRING11 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL VARCHAR(100) NOT NULL ); CREATE TABLE HASHMAP_STR_DATE12 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL TIMESTAMP NOT NULL ); CREATE TABLE HASHMAP_STR_DATE13 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL TIMESTAMP NOT NULL ); CREATE TABLE HASHMAP_STR_DATE14 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL TIMESTAMP NOT NULL ); CREATE TABLE HASHMAP_STR_LOCALE15 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(20) NOT NULL ); CREATE TABLE HASHMAP_STR_LOCALE16 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(20) NOT NULL ); CREATE TABLE HASHMAP_STR_LOCALE17 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(20) NOT NULL ); CREATE TABLE HASHMAP_STR_BIG_DECIMAL18 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DECIMAL(27,16) NOT NULL ); CREATE TABLE HASHMAP_STR_BIG_DECIMAL19 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DECIMAL(27,16) NOT NULL ); CREATE TABLE HASHMAP_STR_BIG_DECIMAL20 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DECIMAL(27,16) NOT NULL ); CREATE TABLE HASHMAP_STR_BIG_INTEGER21 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(31) NOT NULL ); CREATE TABLE HASHMAP_STR_BIG_INTEGER22 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(31) NOT NULL ); CREATE TABLE HASHMAP_STR_BIG_INTEGER23 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(31) NOT NULL ); CREATE TABLE HASHMAP_STR_BYTE24 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE HASHMAP_STR_BYTE25 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE HASHMAP_STR_BYTE26 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE HASHMAP_STR_DOUBLE27 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DOUBLE NOT NULL ); CREATE TABLE HASHMAP_STR_DOUBLE28 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DOUBLE NOT NULL ); CREATE TABLE HASHMAP_STR_DOUBLE29 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DOUBLE NOT NULL ); CREATE TABLE HASHMAP_STR_FLOAT30 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL REAL NOT NULL ); CREATE TABLE HASHMAP_STR_FLOAT31 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL REAL NOT NULL ); CREATE TABLE HASHMAP_STR_FLOAT32 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL REAL NOT NULL ); CREATE TABLE HASHMAP_STR_INTEGER33 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL INTEGER NOT NULL ); CREATE TABLE HASHMAP_STR_INTEGER34 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL INTEGER NOT NULL ); CREATE TABLE HASHMAP_STR_INTEGER35 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL INTEGER NOT NULL ); CREATE TABLE HASHMAP_STR_LONG36 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL BIGINT NOT NULL ); CREATE TABLE HASHMAP_STR_LONG37 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL BIGINT NOT NULL ); CREATE TABLE HASHMAP_STR_LONG38 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL BIGINT NOT NULL ); CREATE TABLE HASHMAP_STR_SHORT39 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE HASHMAP_STR_SHORT40 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE HASHMAP_STR_SHORT41 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE HASHMAP_STR_OBJECT42 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHMAP_STR_OBJECT43 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHMAP_STR_SIMPLE_CLASS45 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHMAP_STR_SIMPLE_CLASS46 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHMAP_STR_SIMPLE_INTERFACE48 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHMAP_STR_SIMPLE_INTERFACE49 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHMAP_STR_STRING51 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL VARCHAR(100) NOT NULL ); CREATE TABLE HASHMAP_STR_STRING52 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL VARCHAR(100) NOT NULL ); CREATE TABLE HASHMAP_STR_DATE54 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL TIMESTAMP NOT NULL ); CREATE TABLE HASHMAP_STR_DATE55 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL TIMESTAMP NOT NULL ); CREATE TABLE HASHMAP_STR_LOCALE57 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(20) NOT NULL ); CREATE TABLE HASHMAP_STR_LOCALE58 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(20) NOT NULL ); CREATE TABLE HASHMAP_STR_BIG_DECIMAL60 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DECIMAL(27,16) NOT NULL ); CREATE TABLE HASHMAP_STR_BIG_DECIMAL61 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DECIMAL(27,16) NOT NULL ); CREATE TABLE HASHMAP_STR_BIG_INTEGER63 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(31) NOT NULL ); CREATE TABLE HASHMAP_STR_BIG_INTEGER64 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(31) NOT NULL ); CREATE TABLE HASHMAP_STR_BYTE66 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE HASHMAP_STR_BYTE67 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE HASHMAP_STR_DOUBLE69 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DOUBLE NOT NULL ); CREATE TABLE HASHMAP_STR_DOUBLE70 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DOUBLE NOT NULL ); CREATE TABLE HASHMAP_STR_FLOAT72 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL REAL NOT NULL ); CREATE TABLE HASHMAP_STR_FLOAT73 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL REAL NOT NULL ); CREATE TABLE HASHMAP_STR_INTEGER75 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL INTEGER NOT NULL ); CREATE TABLE HASHMAP_STR_INTEGER76 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL INTEGER NOT NULL ); CREATE TABLE HASHMAP_STR_LONG78 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL BIGINT NOT NULL ); CREATE TABLE HASHMAP_STR_LONG79 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL BIGINT NOT NULL ); CREATE TABLE HASHMAP_STR_SHORT81 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE HASHMAP_STR_SHORT82 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE HASHMAP_STR_OBJECT84 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL LONG VARCHAR FOR BIT DATA ); CREATE TABLE HASHMAP_STR_SIMPLE_CLASS87 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL LONG VARCHAR FOR BIT DATA ); CREATE TABLE HASHMAP_STR_SIMPLE_INTERFACE90 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL LONG VARCHAR FOR BIT DATA ); CREATE TABLE HASHMAP_STR_STRING93 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL VARCHAR(100) NOT NULL ); CREATE TABLE HASHMAP_STR_DATE96 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL TIMESTAMP NOT NULL ); CREATE TABLE HASHMAP_STR_LOCALE99 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(20) NOT NULL ); CREATE TABLE HASHMAP_STR_BIG_DECIMAL102 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DECIMAL(27,16) NOT NULL ); CREATE TABLE HASHMAP_STR_BIG_INTEGER105 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(31) NOT NULL ); CREATE TABLE HASHMAP_STR_BYTE108 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE HASHMAP_STR_DOUBLE111 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DOUBLE NOT NULL ); CREATE TABLE HASHMAP_STR_FLOAT114 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL REAL NOT NULL ); CREATE TABLE HASHMAP_STR_INTEGER117 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL INTEGER NOT NULL ); CREATE TABLE HASHMAP_STR_LONG120 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL BIGINT NOT NULL ); CREATE TABLE HASHMAP_STR_SHORT123 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); --HashtableOfStringKeyCollections CREATE TABLE HASHTABLESTRINGKEY_COLLECTIONS ( IDENTIFIER INTEGER NOT NULL, HASHTBL_STR_OBJECT86 LONG VARCHAR FOR BIT DATA, HASHTBL_STR_SIMPLECLASS89 LONG VARCHAR FOR BIT DATA, HASHTBL_STR_SIMPLEINTERFACE92 LONG VARCHAR FOR BIT DATA, HASHTBL_STR_STRING95 LONG VARCHAR FOR BIT DATA, HASHTBL_STR_DATE98 LONG VARCHAR FOR BIT DATA, HASHTBL_STR_LOCALE101 LONG VARCHAR FOR BIT DATA, HASHTBL_STR_BIGDECIMAL104 LONG VARCHAR FOR BIT DATA, HASHTBL_STR_BIGINTEGER107 LONG VARCHAR FOR BIT DATA, HASHTBL_STR_BYTE110 LONG VARCHAR FOR BIT DATA, HASHTBL_STR_DOUBLE113 LONG VARCHAR FOR BIT DATA, HASHTBL_STR_FLOAT116 LONG VARCHAR FOR BIT DATA, HASHTBL_STR_INTEGER119 LONG VARCHAR FOR BIT DATA, HASHTBL_STR_LONG122 LONG VARCHAR FOR BIT DATA, HASHTBL_STR_SHORT125 LONG VARCHAR FOR BIT DATA, CONSTRAINT HTSKC_PK PRIMARY KEY (IDENTIFIER) ); CREATE TABLE HASHTBL_STR_OBJECT0 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, OBJREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHTBL_STR_OBJECT1 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, OBJREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHTBL_STR_OBJECT2 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, OBJREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHTBL_STR_SIMPLE_CLASS3 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, SIMPCLSREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHTBL_STR_SIMPLE_CLASS4 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, SIMPCLSREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHTBL_STR_SIMPLE_CLASS5 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, SIMPCLSREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHTBL_STR_SIMPLE_INTERFACE6 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, SIMPINTREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHTBL_STR_SIMPLE_INTERFACE7 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, SIMPINTREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHTBL_STR_SIMPLE_INTERFACE8 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, SIMPINTREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHTBL_STR_STRING9 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL VARCHAR(100) NOT NULL ); CREATE TABLE HASHTBL_STR_STRING10 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL VARCHAR(100) NOT NULL ); CREATE TABLE HASHTBL_STR_STRING11 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL VARCHAR(100) NOT NULL ); CREATE TABLE HASHTBL_STR_DATE12 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL TIMESTAMP NOT NULL ); CREATE TABLE HASHTBL_STR_DATE13 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL TIMESTAMP NOT NULL ); CREATE TABLE HASHTBL_STR_DATE14 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL TIMESTAMP NOT NULL ); CREATE TABLE HASHTBL_STR_LOCALE15 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(20) NOT NULL ); CREATE TABLE HASHTBL_STR_LOCALE16 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(20) NOT NULL ); CREATE TABLE HASHTBL_STR_LOCALE17 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(20) NOT NULL ); CREATE TABLE HASHTBL_STR_BIG_DECIMAL18 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DECIMAL(27,16) NOT NULL ); CREATE TABLE HASHTBL_STR_BIG_DECIMAL19 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DECIMAL(27,16) NOT NULL ); CREATE TABLE HASHTBL_STR_BIG_DECIMAL20 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DECIMAL(27,16) NOT NULL ); CREATE TABLE HASHTBL_STR_BIG_INTEGER21 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(31) NOT NULL ); CREATE TABLE HASHTBL_STR_BIG_INTEGER22 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(31) NOT NULL ); CREATE TABLE HASHTBL_STR_BIG_INTEGER23 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(31) NOT NULL ); CREATE TABLE HASHTBL_STR_BYTE24 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE HASHTBL_STR_BYTE25 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE HASHTBL_STR_BYTE26 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE HASHTBL_STR_DOUBLE27 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DOUBLE NOT NULL ); CREATE TABLE HASHTBL_STR_DOUBLE28 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DOUBLE NOT NULL ); CREATE TABLE HASHTBL_STR_DOUBLE29 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DOUBLE NOT NULL ); CREATE TABLE HASHTBL_STR_FLOAT30 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL REAL NOT NULL ); CREATE TABLE HASHTBL_STR_FLOAT31 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL REAL NOT NULL ); CREATE TABLE HASHTBL_STR_FLOAT32 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL REAL NOT NULL ); CREATE TABLE HASHTBL_STR_INTEGER33 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL INTEGER NOT NULL ); CREATE TABLE HASHTBL_STR_INTEGER34 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL INTEGER NOT NULL ); CREATE TABLE HASHTBL_STR_INTEGER35 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL INTEGER NOT NULL ); CREATE TABLE HASHTBL_STR_LONG36 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL BIGINT NOT NULL ); CREATE TABLE HASHTBL_STR_LONG37 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL BIGINT NOT NULL ); CREATE TABLE HASHTBL_STR_LONG38 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL BIGINT NOT NULL ); CREATE TABLE HASHTBL_STR_SHORT39 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE HASHTBL_STR_SHORT40 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE HASHTBL_STR_SHORT41 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE HASHTBL_STR_OBJECT42 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHTBL_STR_OBJECT43 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHTBL_STR_SIMPLE_CLASS45 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHTBL_STR_SIMPLE_CLASS46 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHTBL_STR_SIMPLE_INTERFACE48 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHTBL_STR_SIMPLE_INTERFACE49 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHTBL_STR_STRING51 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL VARCHAR(100) NOT NULL ); CREATE TABLE HASHTBL_STR_STRING52 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL VARCHAR(100) NOT NULL ); CREATE TABLE HASHTBL_STR_DATE54 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL TIMESTAMP NOT NULL ); CREATE TABLE HASHTBL_STR_DATE55 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL TIMESTAMP NOT NULL ); CREATE TABLE HASHTBL_STR_LOCALE57 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(20) NOT NULL ); CREATE TABLE HASHTBL_STR_LOCALE58 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(20) NOT NULL ); CREATE TABLE HASHTBL_STR_BIG_DECIMAL60 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DECIMAL(27,16) NOT NULL ); CREATE TABLE HASHTBL_STR_BIG_DECIMAL61 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DECIMAL(27,16) NOT NULL ); CREATE TABLE HASHTBL_STR_BIG_INTEGER63 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(31) NOT NULL ); CREATE TABLE HASHTBL_STR_BIG_INTEGER64 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(31) NOT NULL ); CREATE TABLE HASHTBL_STR_BYTE66 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE HASHTBL_STR_BYTE67 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE HASHTBL_STR_DOUBLE69 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DOUBLE NOT NULL ); CREATE TABLE HASHTBL_STR_DOUBLE70 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DOUBLE NOT NULL ); CREATE TABLE HASHTBL_STR_FLOAT72 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL REAL NOT NULL ); CREATE TABLE HASHTBL_STR_FLOAT73 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL REAL NOT NULL ); CREATE TABLE HASHTBL_STR_INTEGER75 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL INTEGER NOT NULL ); CREATE TABLE HASHTBL_STR_INTEGER76 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL INTEGER NOT NULL ); CREATE TABLE HASHTBL_STR_LONG78 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL BIGINT NOT NULL ); CREATE TABLE HASHTBL_STR_LONG79 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL BIGINT NOT NULL ); CREATE TABLE HASHTBL_STR_SHORT81 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE HASHTBL_STR_SHORT82 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE HASHTBL_STR_OBJECT84 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL LONG VARCHAR FOR BIT DATA ); CREATE TABLE HASHTBL_STR_SIMPLE_CLASS87 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL LONG VARCHAR FOR BIT DATA ); CREATE TABLE HASHTBL_STR_SIMPLE_INTERFACE90 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL LONG VARCHAR FOR BIT DATA ); CREATE TABLE HASHTBL_STR_STRING93 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL VARCHAR(100) NOT NULL ); CREATE TABLE HASHTBL_STR_DATE96 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL TIMESTAMP NOT NULL ); CREATE TABLE HASHTBL_STR_LOCALE99 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(20) NOT NULL ); CREATE TABLE HASHTBL_STR_BIG_DECIMAL102 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DECIMAL(27,16) NOT NULL ); CREATE TABLE HASHTBL_STR_BIG_INTEGER105 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(31) NOT NULL ); CREATE TABLE HASHTBL_STR_BYTE108 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE HASHTBL_STR_DOUBLE111 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DOUBLE NOT NULL ); CREATE TABLE HASHTBL_STR_FLOAT114 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL REAL NOT NULL ); CREATE TABLE HASHTBL_STR_INTEGER117 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL INTEGER NOT NULL ); CREATE TABLE HASHTBL_STR_LONG120 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL BIGINT NOT NULL ); CREATE TABLE HASHTBL_STR_SHORT123 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); --HashMapOfStringValueCollections CREATE TABLE HASHMAPSTRINGVALUE_COLLECTIONS ( IDENTIFIER INTEGER NOT NULL, HASHMAP_OBJECT8_STR LONG VARCHAR FOR BIT DATA, HASHMAP_SIMPLE_CLASS17_STR LONG VARCHAR FOR BIT DATA, HASHMAP_SIMPLE_INTERFACE26_STR LONG VARCHAR FOR BIT DATA, HASHMAP_STRING35_STR LONG VARCHAR FOR BIT DATA, HASHMAP_DATE44_STR LONG VARCHAR FOR BIT DATA, HASHMAP_BIG_DECIMAL53_STR LONG VARCHAR FOR BIT DATA, HASHMAP_BIG_INTEGER62_STR LONG VARCHAR FOR BIT DATA, HASHMAP_BYTE71_STR LONG VARCHAR FOR BIT DATA, HASHMAP_DOUBLE80_STR LONG VARCHAR FOR BIT DATA, HASHMAP_FLOAT89_STR LONG VARCHAR FOR BIT DATA, HASHMAP_INTEGER98_STR LONG VARCHAR FOR BIT DATA, HASHMAP_LONG107_STR LONG VARCHAR FOR BIT DATA, HASHMAP_SHORT116_STR LONG VARCHAR FOR BIT DATA, CONSTRAINT HMSVC_PK PRIMARY KEY (IDENTIFIER) ); CREATE TABLE HASHMAP_OBJECT0_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHMAP_OBJECT1_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHMAP_OBJECT2_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHMAP_OBJECT3_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHMAP_OBJECT4_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHMAP_OBJECT6_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHMAP_SIMPLE_CLASS9_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHMAP_SIMPLE_CLASS10_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHMAP_SIMPLE_CLASS11_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHMAP_SIMPLE_CLASS12_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHMAP_SIMPLE_CLASS13_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHMAP_SIMPLE_CLASS15_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHMAP_SIMPLE_INTERFACE18_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHMAP_SIMPLE_INTERFACE19_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHMAP_SIMPLE_INTERFACE20_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHMAP_SIMPLE_INTERFACE21_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHMAP_SIMPLE_INTERFACE22_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHMAP_SIMPLE_INTERFACE24_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHMAP_STRING27_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL VARCHAR(1024) ); CREATE TABLE HASHMAP_STRING28_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL VARCHAR(1024) ); CREATE TABLE HASHMAP_STRING29_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL VARCHAR(1024) ); CREATE TABLE HASHMAP_STRING30_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL VARCHAR(1024) ); CREATE TABLE HASHMAP_STRING31_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL VARCHAR(1024) ); CREATE TABLE HASHMAP_STRING33_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL VARCHAR(1024) ); CREATE TABLE HASHMAP_DATE36_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL TIMESTAMP ); CREATE TABLE HASHMAP_DATE37_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL TIMESTAMP ); CREATE TABLE HASHMAP_DATE38_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL TIMESTAMP ); CREATE TABLE HASHMAP_DATE39_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL TIMESTAMP ); CREATE TABLE HASHMAP_DATE40_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL TIMESTAMP ); CREATE TABLE HASHMAP_DATE42_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL TIMESTAMP ); CREATE TABLE HASHMAP_BIG_DECIMAL45_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DECIMAL(27,16) ); CREATE TABLE HASHMAP_BIG_DECIMAL46_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DECIMAL(27,16) ); CREATE TABLE HASHMAP_BIG_DECIMAL47_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DECIMAL(27,16) ); CREATE TABLE HASHMAP_BIG_DECIMAL48_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DECIMAL(27,16) ); CREATE TABLE HASHMAP_BIG_DECIMAL49_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DECIMAL(27,16) ); CREATE TABLE HASHMAP_BIG_DECIMAL51_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DECIMAL(27,16) ); CREATE TABLE HASHMAP_BIG_INTEGER54_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(31) ); CREATE TABLE HASHMAP_BIG_INTEGER55_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(31) ); CREATE TABLE HASHMAP_BIG_INTEGER56_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(31) ); CREATE TABLE HASHMAP_BIG_INTEGER57_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(31) ); CREATE TABLE HASHMAP_BIG_INTEGER58_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(31) ); CREATE TABLE HASHMAP_BIG_INTEGER60_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(31) ); CREATE TABLE HASHMAP_BYTE63_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE HASHMAP_BYTE64_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE HASHMAP_BYTE65_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE HASHMAP_BYTE66_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE HASHMAP_BYTE67_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE HASHMAP_BYTE69_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE HASHMAP_DOUBLE72_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DOUBLE ); CREATE TABLE HASHMAP_DOUBLE73_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DOUBLE ); CREATE TABLE HASHMAP_DOUBLE74_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DOUBLE ); CREATE TABLE HASHMAP_DOUBLE75_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DOUBLE ); CREATE TABLE HASHMAP_DOUBLE76_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DOUBLE ); CREATE TABLE HASHMAP_DOUBLE78_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DOUBLE ); CREATE TABLE HASHMAP_FLOAT81_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL REAL ); CREATE TABLE HASHMAP_FLOAT82_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL REAL ); CREATE TABLE HASHMAP_FLOAT83_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL REAL ); CREATE TABLE HASHMAP_FLOAT84_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL REAL ); CREATE TABLE HASHMAP_FLOAT85_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL REAL ); CREATE TABLE HASHMAP_FLOAT87_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL REAL ); CREATE TABLE HASHMAP_INTEGER90_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL INTEGER ); CREATE TABLE HASHMAP_INTEGER91_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL INTEGER ); CREATE TABLE HASHMAP_INTEGER92_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL INTEGER ); CREATE TABLE HASHMAP_INTEGER93_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL INTEGER ); CREATE TABLE HASHMAP_INTEGER94_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL INTEGER ); CREATE TABLE HASHMAP_INTEGER96_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL INTEGER ); CREATE TABLE HASHMAP_LONG99_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL BIGINT ); CREATE TABLE HASHMAP_LONG100_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL BIGINT ); CREATE TABLE HASHMAP_LONG101_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL BIGINT ); CREATE TABLE HASHMAP_LONG102_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL BIGINT ); CREATE TABLE HASHMAP_LONG103_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL BIGINT ); CREATE TABLE HASHMAP_LONG105_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL BIGINT ); CREATE TABLE HASHMAP_SHORT108_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE HASHMAP_SHORT109_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE HASHMAP_SHORT110_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE HASHMAP_SHORT111_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE HASHMAP_SHORT112_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE HASHMAP_SHORT114_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); --HashtableOfStringValueCollections CREATE TABLE HASHTBLSTRINGVALUE_COLLECTIONS ( IDENTIFIER INTEGER NOT NULL, HASHTBL_OBJECT8_STR LONG VARCHAR FOR BIT DATA, HASHTBL_SIMPLE_CLASS17_STR LONG VARCHAR FOR BIT DATA, HASHTBL_SIMPLE_INTERFACE26_STR LONG VARCHAR FOR BIT DATA, HASHTBL_STRING35_STR LONG VARCHAR FOR BIT DATA, HASHTBL_DATE44_STR LONG VARCHAR FOR BIT DATA, HASHTBL_BIG_DECIMAL53_STR LONG VARCHAR FOR BIT DATA, HASHTBL_BIG_INTEGER62_STR LONG VARCHAR FOR BIT DATA, HASHTBL_BYTE71_STR LONG VARCHAR FOR BIT DATA, HASHTBL_DOUBLE80_STR LONG VARCHAR FOR BIT DATA, HASHTBL_FLOAT89_STR LONG VARCHAR FOR BIT DATA, HASHTBL_INTEGER98_STR LONG VARCHAR FOR BIT DATA, HASHTBL_LONG107_STR LONG VARCHAR FOR BIT DATA, HASHTBL_SHORT116_STR LONG VARCHAR FOR BIT DATA, CONSTRAINT HTSVC_PK PRIMARY KEY (IDENTIFIER) ); CREATE TABLE HASHTBL_OBJECT0_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHTBL_OBJECT1_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHTBL_OBJECT2_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHTBL_OBJECT3_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHTBL_OBJECT4_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHTBL_OBJECT6_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHTBL_SIMPLE_CLASS9_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHTBL_SIMPLE_CLASS10_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHTBL_SIMPLE_CLASS11_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHTBL_SIMPLE_CLASS12_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHTBL_SIMPLE_CLASS13_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHTBL_SIMPLE_CLASS15_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHTBL_SIMPLE_INTERFACE18_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHTBL_SIMPLE_INTERFACE19_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHTBL_SIMPLE_INTERFACE20_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHTBL_SIMPLE_INTERFACE21_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHTBL_SIMPLE_INTERFACE22_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHTBL_SIMPLE_INTERFACE24_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHTBL_STRING27_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL VARCHAR(1024) ); CREATE TABLE HASHTBL_STRING28_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL VARCHAR(1024) ); CREATE TABLE HASHTBL_STRING29_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL VARCHAR(1024) ); CREATE TABLE HASHTBL_STRING30_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL VARCHAR(1024) ); CREATE TABLE HASHTBL_STRING31_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL VARCHAR(1024) ); CREATE TABLE HASHTBL_STRING33_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL VARCHAR(1024) ); CREATE TABLE HASHTBL_DATE36_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL TIMESTAMP ); CREATE TABLE HASHTBL_DATE37_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL TIMESTAMP ); CREATE TABLE HASHTBL_DATE38_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL TIMESTAMP ); CREATE TABLE HASHTBL_DATE39_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL TIMESTAMP ); CREATE TABLE HASHTBL_DATE40_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL TIMESTAMP ); CREATE TABLE HASHTBL_DATE42_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL TIMESTAMP ); CREATE TABLE HASHTBL_BIG_DECIMAL45_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DECIMAL(27,16) ); CREATE TABLE HASHTBL_BIG_DECIMAL46_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DECIMAL(27,16) ); CREATE TABLE HASHTBL_BIG_DECIMAL47_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DECIMAL(27,16) ); CREATE TABLE HASHTBL_BIG_DECIMAL48_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DECIMAL(27,16) ); CREATE TABLE HASHTBL_BIG_DECIMAL49_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DECIMAL(27,16) ); CREATE TABLE HASHTBL_BIG_DECIMAL51_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DECIMAL(27,16) ); CREATE TABLE HASHTBL_BIG_INTEGER54_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(31) ); CREATE TABLE HASHTBL_BIG_INTEGER55_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(31) ); CREATE TABLE HASHTBL_BIG_INTEGER56_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(31) ); CREATE TABLE HASHTBL_BIG_INTEGER57_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(31) ); CREATE TABLE HASHTBL_BIG_INTEGER58_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(31) ); CREATE TABLE HASHTBL_BIG_INTEGER60_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(31) ); CREATE TABLE HASHTBL_BYTE63_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE HASHTBL_BYTE64_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE HASHTBL_BYTE65_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE HASHTBL_BYTE66_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE HASHTBL_BYTE67_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE HASHTBL_BYTE69_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE HASHTBL_DOUBLE72_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DOUBLE ); CREATE TABLE HASHTBL_DOUBLE73_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DOUBLE ); CREATE TABLE HASHTBL_DOUBLE74_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DOUBLE ); CREATE TABLE HASHTBL_DOUBLE75_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DOUBLE ); CREATE TABLE HASHTBL_DOUBLE76_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DOUBLE ); CREATE TABLE HASHTBL_DOUBLE78_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DOUBLE ); CREATE TABLE HASHTBL_FLOAT81_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL REAL ); CREATE TABLE HASHTBL_FLOAT82_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL REAL ); CREATE TABLE HASHTBL_FLOAT83_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL REAL ); CREATE TABLE HASHTBL_FLOAT84_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL REAL ); CREATE TABLE HASHTBL_FLOAT85_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL REAL ); CREATE TABLE HASHTBL_FLOAT87_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL REAL ); CREATE TABLE HASHTBL_INTEGER90_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL INTEGER ); CREATE TABLE HASHTBL_INTEGER91_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL INTEGER ); CREATE TABLE HASHTBL_INTEGER92_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL INTEGER ); CREATE TABLE HASHTBL_INTEGER93_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL INTEGER ); CREATE TABLE HASHTBL_INTEGER94_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL INTEGER ); CREATE TABLE HASHTBL_INTEGER96_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL INTEGER ); CREATE TABLE HASHTBL_LONG99_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL BIGINT ); CREATE TABLE HASHTBL_LONG100_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL BIGINT ); CREATE TABLE HASHTBL_LONG101_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL BIGINT ); CREATE TABLE HASHTBL_LONG102_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL BIGINT ); CREATE TABLE HASHTBL_LONG103_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL BIGINT ); CREATE TABLE HASHTBL_LONG105_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL BIGINT ); CREATE TABLE HASHTBL_SHORT108_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE HASHTBL_SHORT109_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE HASHTBL_SHORT110_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE HASHTBL_SHORT111_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE HASHTBL_SHORT112_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE HASHTBL_SHORT114_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); --TreeMapOfStringValueCollections CREATE TABLE TREEMAPSTRINGVALUE_COLLECTIONS ( IDENTIFIER INTEGER NOT NULL, TREEMAP_OBJECT8_STR LONG VARCHAR FOR BIT DATA, TREEMAP_SIMPLE_CLASS17_STR LONG VARCHAR FOR BIT DATA, TREEMAP_SIMPLE_INTERFACE26_STR LONG VARCHAR FOR BIT DATA, TREEMAP_STRING35_STR LONG VARCHAR FOR BIT DATA, TREEMAP_DATE44_STR LONG VARCHAR FOR BIT DATA, TREEMAP_BIG_DECIMAL53_STR LONG VARCHAR FOR BIT DATA, TREEMAP_BIG_INTEGER62_STR LONG VARCHAR FOR BIT DATA, TREEMAP_BYTE71_STR LONG VARCHAR FOR BIT DATA, TREEMAP_DOUBLE80_STR LONG VARCHAR FOR BIT DATA, TREEMAP_FLOAT89_STR LONG VARCHAR FOR BIT DATA, TREEMAP_INTEGER98_STR LONG VARCHAR FOR BIT DATA, TREEMAP_LONG107_STR LONG VARCHAR FOR BIT DATA, TREEMAP_SHORT116_STR LONG VARCHAR FOR BIT DATA, CONSTRAINT TMSVC_PK PRIMARY KEY (IDENTIFIER) ); CREATE TABLE TREEMAP_OBJECT0_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE TREEMAP_OBJECT1_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE TREEMAP_OBJECT2_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE TREEMAP_OBJECT3_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE TREEMAP_OBJECT4_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE TREEMAP_OBJECT6_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE TREEMAP_SIMPLE_CLASS9_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE TREEMAP_SIMPLE_CLASS10_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE TREEMAP_SIMPLE_CLASS11_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE TREEMAP_SIMPLE_CLASS12_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE TREEMAP_SIMPLE_CLASS13_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE TREEMAP_SIMPLE_CLASS15_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE TREEMAP_SIMPLE_INTERFACE18_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE TREEMAP_SIMPLE_INTERFACE19_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE TREEMAP_SIMPLE_INTERFACE20_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE TREEMAP_SIMPLE_INTERFACE21_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE TREEMAP_SIMPLE_INTERFACE22_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE TREEMAP_SIMPLE_INTERFACE24_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE TREEMAP_STRING27_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL VARCHAR(1024) ); CREATE TABLE TREEMAP_STRING28_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL VARCHAR(1024) ); CREATE TABLE TREEMAP_STRING29_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL VARCHAR(1024) ); CREATE TABLE TREEMAP_STRING30_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL VARCHAR(1024) ); CREATE TABLE TREEMAP_STRING31_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL VARCHAR(1024) ); CREATE TABLE TREEMAP_STRING33_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL VARCHAR(1024) ); CREATE TABLE TREEMAP_DATE36_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL TIMESTAMP ); CREATE TABLE TREEMAP_DATE37_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL TIMESTAMP ); CREATE TABLE TREEMAP_DATE38_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL TIMESTAMP ); CREATE TABLE TREEMAP_DATE39_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL TIMESTAMP ); CREATE TABLE TREEMAP_DATE40_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL TIMESTAMP ); CREATE TABLE TREEMAP_DATE42_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL TIMESTAMP ); CREATE TABLE TREEMAP_BIG_DECIMAL45_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DECIMAL(27,16) ); CREATE TABLE TREEMAP_BIG_DECIMAL46_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DECIMAL(27,16) ); CREATE TABLE TREEMAP_BIG_DECIMAL47_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DECIMAL(27,16) ); CREATE TABLE TREEMAP_BIG_DECIMAL48_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DECIMAL(27,16) ); CREATE TABLE TREEMAP_BIG_DECIMAL49_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DECIMAL(27,16) ); CREATE TABLE TREEMAP_BIG_DECIMAL51_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DECIMAL(27,16) ); CREATE TABLE TREEMAP_BIG_INTEGER54_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(31) ); CREATE TABLE TREEMAP_BIG_INTEGER55_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(31) ); CREATE TABLE TREEMAP_BIG_INTEGER56_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(31) ); CREATE TABLE TREEMAP_BIG_INTEGER57_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(31) ); CREATE TABLE TREEMAP_BIG_INTEGER58_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(31) ); CREATE TABLE TREEMAP_BIG_INTEGER60_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(31) ); CREATE TABLE TREEMAP_BYTE63_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE TREEMAP_BYTE64_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE TREEMAP_BYTE65_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE TREEMAP_BYTE66_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE TREEMAP_BYTE67_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE TREEMAP_BYTE69_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE TREEMAP_DOUBLE72_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DOUBLE ); CREATE TABLE TREEMAP_DOUBLE73_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DOUBLE ); CREATE TABLE TREEMAP_DOUBLE74_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DOUBLE ); CREATE TABLE TREEMAP_DOUBLE75_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DOUBLE ); CREATE TABLE TREEMAP_DOUBLE76_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DOUBLE ); CREATE TABLE TREEMAP_DOUBLE78_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DOUBLE ); CREATE TABLE TREEMAP_FLOAT81_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL REAL ); CREATE TABLE TREEMAP_FLOAT82_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL REAL ); CREATE TABLE TREEMAP_FLOAT83_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL REAL ); CREATE TABLE TREEMAP_FLOAT84_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL REAL ); CREATE TABLE TREEMAP_FLOAT85_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL REAL ); CREATE TABLE TREEMAP_FLOAT87_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL REAL ); CREATE TABLE TREEMAP_INTEGER90_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL INTEGER ); CREATE TABLE TREEMAP_INTEGER91_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL INTEGER ); CREATE TABLE TREEMAP_INTEGER92_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL INTEGER ); CREATE TABLE TREEMAP_INTEGER93_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL INTEGER ); CREATE TABLE TREEMAP_INTEGER94_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL INTEGER ); CREATE TABLE TREEMAP_INTEGER96_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL INTEGER ); CREATE TABLE TREEMAP_LONG99_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL BIGINT ); CREATE TABLE TREEMAP_LONG100_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL BIGINT ); CREATE TABLE TREEMAP_LONG101_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL BIGINT ); CREATE TABLE TREEMAP_LONG102_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL BIGINT ); CREATE TABLE TREEMAP_LONG103_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL BIGINT ); CREATE TABLE TREEMAP_LONG105_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL BIGINT ); CREATE TABLE TREEMAP_SHORT108_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE TREEMAP_SHORT109_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE TREEMAP_SHORT110_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE TREEMAP_SHORT111_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE TREEMAP_SHORT112_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE TREEMAP_SHORT114_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); --MapOfStringValueCollections CREATE TABLE MAPSTRINGVALUE_COLLECTIONS ( IDENTIFIER INTEGER NOT NULL, MAP_OBJECT8_STR LONG VARCHAR FOR BIT DATA, MAP_SIMPLE_CLASS17_STR LONG VARCHAR FOR BIT DATA, MAP_SIMPLE_INTERFACE26_STR LONG VARCHAR FOR BIT DATA, MAP_STRING35_STR LONG VARCHAR FOR BIT DATA, MAP_DATE44_STR LONG VARCHAR FOR BIT DATA, MAP_BIG_DECIMAL53_STR LONG VARCHAR FOR BIT DATA, MAP_BIG_INTEGER62_STR LONG VARCHAR FOR BIT DATA, MAP_BYTE71_STR LONG VARCHAR FOR BIT DATA, MAP_DOUBLE80_STR LONG VARCHAR FOR BIT DATA, MAP_FLOAT89_STR LONG VARCHAR FOR BIT DATA, MAP_INTEGER98_STR LONG VARCHAR FOR BIT DATA, MAP_LONG107_STR LONG VARCHAR FOR BIT DATA, MAP_SHORT116_STR LONG VARCHAR FOR BIT DATA, MAP_SIMPLEENUM123_STR LONG VARCHAR FOR BIT DATA, CONSTRAINT MSVC_PK PRIMARY KEY (IDENTIFIER) ); CREATE TABLE MAP_OBJECT0_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE MAP_OBJECT1_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE MAP_OBJECT2_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE MAP_OBJECT3_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE MAP_OBJECT4_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE MAP_OBJECT6_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE MAP_SIMPLE_CLASS9_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE MAP_SIMPLE_CLASS10_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE MAP_SIMPLE_CLASS11_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE MAP_SIMPLE_CLASS12_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE MAP_SIMPLE_CLASS13_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE MAP_SIMPLE_CLASS15_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE MAP_SIMPLE_INTERFACE18_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE MAP_SIMPLE_INTERFACE19_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE MAP_SIMPLE_INTERFACE20_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE MAP_SIMPLE_INTERFACE21_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE MAP_SIMPLE_INTERFACE22_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE MAP_SIMPLE_INTERFACE24_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE MAP_STRING27_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL VARCHAR(1024) ); CREATE TABLE MAP_STRING28_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL VARCHAR(1024) ); CREATE TABLE MAP_STRING29_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL VARCHAR(1024) ); CREATE TABLE MAP_STRING30_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL VARCHAR(1024) ); CREATE TABLE MAP_STRING31_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL VARCHAR(1024) ); CREATE TABLE MAP_STRING33_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL VARCHAR(1024) ); CREATE TABLE MAP_DATE36_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL TIMESTAMP ); CREATE TABLE MAP_DATE37_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL TIMESTAMP ); CREATE TABLE MAP_DATE38_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL TIMESTAMP ); CREATE TABLE MAP_DATE39_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL TIMESTAMP ); CREATE TABLE MAP_DATE40_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL TIMESTAMP ); CREATE TABLE MAP_DATE42_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL TIMESTAMP ); CREATE TABLE MAP_BIG_DECIMAL45_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DECIMAL(27,16) ); CREATE TABLE MAP_BIG_DECIMAL46_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DECIMAL(27,16) ); CREATE TABLE MAP_BIG_DECIMAL47_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DECIMAL(27,16) ); CREATE TABLE MAP_BIG_DECIMAL48_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DECIMAL(27,16) ); CREATE TABLE MAP_BIG_DECIMAL49_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DECIMAL(27,16) ); CREATE TABLE MAP_BIG_DECIMAL51_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DECIMAL(27,16) ); CREATE TABLE MAP_BIG_INTEGER54_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(31) ); CREATE TABLE MAP_BIG_INTEGER55_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(31) ); CREATE TABLE MAP_BIG_INTEGER56_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(31) ); CREATE TABLE MAP_BIG_INTEGER57_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(31) ); CREATE TABLE MAP_BIG_INTEGER58_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(31) ); CREATE TABLE MAP_BIG_INTEGER60_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(31) ); CREATE TABLE MAP_BYTE63_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE MAP_BYTE64_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE MAP_BYTE65_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE MAP_BYTE66_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE MAP_BYTE67_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE MAP_BYTE69_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE MAP_DOUBLE72_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DOUBLE ); CREATE TABLE MAP_DOUBLE73_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DOUBLE ); CREATE TABLE MAP_DOUBLE74_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DOUBLE ); CREATE TABLE MAP_DOUBLE75_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DOUBLE ); CREATE TABLE MAP_DOUBLE76_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DOUBLE ); CREATE TABLE MAP_DOUBLE78_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DOUBLE ); CREATE TABLE MAP_FLOAT81_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL REAL ); CREATE TABLE MAP_FLOAT82_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL REAL ); CREATE TABLE MAP_FLOAT83_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL REAL ); CREATE TABLE MAP_FLOAT84_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL REAL ); CREATE TABLE MAP_FLOAT85_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL REAL ); CREATE TABLE MAP_FLOAT87_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL REAL ); CREATE TABLE MAP_INTEGER90_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL INTEGER ); CREATE TABLE MAP_INTEGER91_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL INTEGER ); CREATE TABLE MAP_INTEGER92_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL INTEGER ); CREATE TABLE MAP_INTEGER93_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL INTEGER ); CREATE TABLE MAP_INTEGER94_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL INTEGER ); CREATE TABLE MAP_INTEGER96_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL INTEGER ); CREATE TABLE MAP_LONG99_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL BIGINT ); CREATE TABLE MAP_LONG100_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL BIGINT ); CREATE TABLE MAP_LONG101_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL BIGINT ); CREATE TABLE MAP_LONG102_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL BIGINT ); CREATE TABLE MAP_LONG103_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL BIGINT ); CREATE TABLE MAP_LONG105_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL BIGINT ); CREATE TABLE MAP_SHORT108_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE MAP_SHORT109_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE MAP_SHORT110_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE MAP_SHORT111_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE MAP_SHORT112_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE MAP_SHORT114_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE MAP_SIMPLEENUM117_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL CHAR(2) ); CREATE TABLE MAP_SIMPLEENUM118_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL CHAR(2) ); CREATE TABLE MAP_SIMPLEENUM119_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL CHAR(2) ); CREATE TABLE MAP_SIMPLEENUM120_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL CHAR(2) ); CREATE TABLE MAP_SIMPLEENUM121_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL CHAR(2) ); CREATE TABLE MAP_SIMPLEENUM122_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL CHAR(2) ); CREATE TABLE MAP_SIMPLEENUM124_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(2,0) ); CREATE TABLE MAP_SIMPLEENUM125_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(2,0) ); CREATE TABLE MAP_SIMPLEENUM126_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(2,0) ); CREATE TABLE MAP_SIMPLEENUM127_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(2,0) ); CREATE TABLE MAP_SIMPLEENUM128_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(2,0) ); CREATE TABLE MAP_SIMPLEENUM129_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(2,0) ); --TreeMapOfStringKeyCollections CREATE TABLE TREEMAPSTRINGKEY_COLLECTIONS ( IDENTIFIER INTEGER NOT NULL, TREEMAP_STR_OBJECT86 LONG VARCHAR FOR BIT DATA, TREEMAP_STR_SIMPLECLASS89 LONG VARCHAR FOR BIT DATA, TREEMAP_STR_SIMPLEINTERFACE92 LONG VARCHAR FOR BIT DATA, TREEMAP_STR_STRING95 LONG VARCHAR FOR BIT DATA, TREEMAP_STR_DATE98 LONG VARCHAR FOR BIT DATA, TREEMAP_STR_LOCALE101 LONG VARCHAR FOR BIT DATA, TREEMAP_STR_BIGDECIMAL104 LONG VARCHAR FOR BIT DATA, TREEMAP_STR_BIGINTEGER107 LONG VARCHAR FOR BIT DATA, TREEMAP_STR_BYTE110 LONG VARCHAR FOR BIT DATA, TREEMAP_STR_DOUBLE113 LONG VARCHAR FOR BIT DATA, TREEMAP_STR_FLOAT116 LONG VARCHAR FOR BIT DATA, TREEMAP_STR_INTEGER119 LONG VARCHAR FOR BIT DATA, TREEMAP_STR_LONG122 LONG VARCHAR FOR BIT DATA, TREEMAP_STR_SHORT125 LONG VARCHAR FOR BIT DATA, CONSTRAINT TMSKC_PK PRIMARY KEY (IDENTIFIER) ); CREATE TABLE TREEMAP_STR_OBJECT0 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, OBJREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE TREEMAP_STR_OBJECT1 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, OBJREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE TREEMAP_STR_OBJECT2 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, OBJREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE TREEMAP_STR_SIMPLE_CLASS3 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, SIMPCLSREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE TREEMAP_STR_SIMPLE_CLASS4 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, SIMPCLSREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE TREEMAP_STR_SIMPLE_CLASS5 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, SIMPCLSREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE TREEMAP_STR_SIMPLE_INTERFACE6 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, SIMPINTREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE TREEMAP_STR_SIMPLE_INTERFACE7 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, SIMPINTREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE TREEMAP_STR_SIMPLE_INTERFACE8 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, SIMPINTREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE TREEMAP_STR_STRING9 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL VARCHAR(100) NOT NULL ); CREATE TABLE TREEMAP_STR_STRING10 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL VARCHAR(100) NOT NULL ); CREATE TABLE TREEMAP_STR_STRING11 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL VARCHAR(100) NOT NULL ); CREATE TABLE TREEMAP_STR_DATE12 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL TIMESTAMP NOT NULL ); CREATE TABLE TREEMAP_STR_DATE13 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL TIMESTAMP NOT NULL ); CREATE TABLE TREEMAP_STR_DATE14 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL TIMESTAMP NOT NULL ); CREATE TABLE TREEMAP_STR_LOCALE15 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(20) NOT NULL ); CREATE TABLE TREEMAP_STR_LOCALE16 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(20) NOT NULL ); CREATE TABLE TREEMAP_STR_LOCALE17 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(20) NOT NULL ); CREATE TABLE TREEMAP_STR_BIG_DECIMAL18 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DECIMAL(27,16) NOT NULL ); CREATE TABLE TREEMAP_STR_BIG_DECIMAL19 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DECIMAL(27,16) NOT NULL ); CREATE TABLE TREEMAP_STR_BIG_DECIMAL20 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DECIMAL(27,16) NOT NULL ); CREATE TABLE TREEMAP_STR_BIG_INTEGER21 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(31) NOT NULL ); CREATE TABLE TREEMAP_STR_BIG_INTEGER22 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(31) NOT NULL ); CREATE TABLE TREEMAP_STR_BIG_INTEGER23 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(31) NOT NULL ); CREATE TABLE TREEMAP_STR_BYTE24 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE TREEMAP_STR_BYTE25 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE TREEMAP_STR_BYTE26 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE TREEMAP_STR_DOUBLE27 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DOUBLE NOT NULL ); CREATE TABLE TREEMAP_STR_DOUBLE28 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DOUBLE NOT NULL ); CREATE TABLE TREEMAP_STR_DOUBLE29 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DOUBLE NOT NULL ); CREATE TABLE TREEMAP_STR_FLOAT30 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL REAL NOT NULL ); CREATE TABLE TREEMAP_STR_FLOAT31 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL REAL NOT NULL ); CREATE TABLE TREEMAP_STR_FLOAT32 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL REAL NOT NULL ); CREATE TABLE TREEMAP_STR_INTEGER33 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL INTEGER NOT NULL ); CREATE TABLE TREEMAP_STR_INTEGER34 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL INTEGER NOT NULL ); CREATE TABLE TREEMAP_STR_INTEGER35 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL INTEGER NOT NULL ); CREATE TABLE TREEMAP_STR_LONG36 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL BIGINT NOT NULL ); CREATE TABLE TREEMAP_STR_LONG37 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL BIGINT NOT NULL ); CREATE TABLE TREEMAP_STR_LONG38 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL BIGINT NOT NULL ); CREATE TABLE TREEMAP_STR_SHORT39 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE TREEMAP_STR_SHORT40 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE TREEMAP_STR_SHORT41 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE TREEMAP_STR_OBJECT42 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE TREEMAP_STR_OBJECT43 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE TREEMAP_STR_SIMPLE_CLASS45 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE TREEMAP_STR_SIMPLE_CLASS46 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE TREEMAP_STR_SIMPLE_INTERFACE48 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE TREEMAP_STR_SIMPLE_INTERFACE49 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE TREEMAP_STR_STRING51 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL VARCHAR(100) NOT NULL ); CREATE TABLE TREEMAP_STR_STRING52 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL VARCHAR(100) NOT NULL ); CREATE TABLE TREEMAP_STR_DATE54 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL TIMESTAMP NOT NULL ); CREATE TABLE TREEMAP_STR_DATE55 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL TIMESTAMP NOT NULL ); CREATE TABLE TREEMAP_STR_LOCALE57 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(20) NOT NULL ); CREATE TABLE TREEMAP_STR_LOCALE58 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(20) NOT NULL ); CREATE TABLE TREEMAP_STR_BIG_DECIMAL60 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DECIMAL(27,16) NOT NULL ); CREATE TABLE TREEMAP_STR_BIG_DECIMAL61 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DECIMAL(27,16) NOT NULL ); CREATE TABLE TREEMAP_STR_BIG_INTEGER63 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(31) NOT NULL ); CREATE TABLE TREEMAP_STR_BIG_INTEGER64 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(31) NOT NULL ); CREATE TABLE TREEMAP_STR_BYTE66 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE TREEMAP_STR_BYTE67 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE TREEMAP_STR_DOUBLE69 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DOUBLE NOT NULL ); CREATE TABLE TREEMAP_STR_DOUBLE70 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DOUBLE NOT NULL ); CREATE TABLE TREEMAP_STR_FLOAT72 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL REAL NOT NULL ); CREATE TABLE TREEMAP_STR_FLOAT73 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL REAL NOT NULL ); CREATE TABLE TREEMAP_STR_INTEGER75 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL INTEGER NOT NULL ); CREATE TABLE TREEMAP_STR_INTEGER76 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL INTEGER NOT NULL ); CREATE TABLE TREEMAP_STR_LONG78 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL BIGINT NOT NULL ); CREATE TABLE TREEMAP_STR_LONG79 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL BIGINT NOT NULL ); CREATE TABLE TREEMAP_STR_SHORT81 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE TREEMAP_STR_SHORT82 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE TREEMAP_STR_OBJECT84 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL LONG VARCHAR FOR BIT DATA ); CREATE TABLE TREEMAP_STR_SIMPLE_CLASS87 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL LONG VARCHAR FOR BIT DATA ); CREATE TABLE TREEMAP_STR_SIMPLE_INTERFACE90 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL LONG VARCHAR FOR BIT DATA ); CREATE TABLE TREEMAP_STR_STRING93 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL VARCHAR(100) NOT NULL ); CREATE TABLE TREEMAP_STR_DATE96 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL TIMESTAMP NOT NULL ); CREATE TABLE TREEMAP_STR_LOCALE99 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(20) NOT NULL ); CREATE TABLE TREEMAP_STR_BIG_DECIMAL102 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DECIMAL(27,16) NOT NULL ); CREATE TABLE TREEMAP_STR_BIG_INTEGER105 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(31) NOT NULL ); CREATE TABLE TREEMAP_STR_BYTE108 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE TREEMAP_STR_DOUBLE111 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DOUBLE NOT NULL ); CREATE TABLE TREEMAP_STR_FLOAT114 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL REAL NOT NULL ); CREATE TABLE TREEMAP_STR_INTEGER117 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL INTEGER NOT NULL ); CREATE TABLE TREEMAP_STR_LONG120 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL BIGINT NOT NULL ); CREATE TABLE TREEMAP_STR_SHORT123 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); ------------------------- --inheritance ------------------------- DROP TABLE AllPersist; DROP TABLE TopNonPersistB; DROP TABLE TopPersist; DROP TABLE FieldSameName; CREATE TABLE AllPersist ( KEY_VALUE INTEGER NOT NULL, DOUBLE_B DOUBLE, INT_B INTEGER, FLOAT_E REAL, SHORT_F SMALLINT, SECOND_OBJ INTEGER, THIRD_OBJ INTEGER, INT_H INTEGER, DISCRIMINATOR varchar(64) NOT NULL, CONSTRAINT AllPersist_PK PRIMARY KEY (KEY_VALUE), FOREIGN KEY (SECOND_OBJ) REFERENCES AllPersist (KEY_VALUE), FOREIGN KEY (THIRD_OBJ) REFERENCES AllPersist (KEY_VALUE) ); CREATE TABLE TopNonPersistB ( KEY_VALUE INTEGER NOT NULL, DOUBLE_B DOUBLE, INT_B INTEGER, FLOAT_E REAL, SHORT_F SMALLINT, SECOND_OBJ INTEGER, THIRD_OBJ INTEGER, INT_H INTEGER, DISCRIMINATOR varchar(64) NOT NULL, CONSTRAINT TopNonPersistB_PK PRIMARY KEY (KEY_VALUE), FOREIGN KEY (SECOND_OBJ) REFERENCES TopNonPersistB (KEY_VALUE), FOREIGN KEY (THIRD_OBJ) REFERENCES TopNonPersistB (KEY_VALUE) ); CREATE TABLE TopPersist ( KEY_VALUE INTEGER NOT NULL, DOUBLE_B DOUBLE, INT_B INTEGER, FLOAT_E REAL, SHORT_F SMALLINT, SECOND_OBJ INTEGER, THIRD_OBJ INTEGER, INT_H INTEGER, DISCRIMINATOR varchar(64) NOT NULL, CONSTRAINT TopPersist_PK PRIMARY KEY (KEY_VALUE), FOREIGN KEY (SECOND_OBJ) REFERENCES TopPersist (KEY_VALUE), FOREIGN KEY (THIRD_OBJ) REFERENCES TopPersist (KEY_VALUE) ); CREATE TABLE FieldSameName ( KEY_VALUE INTEGER NOT NULL, N2 DOUBLE, N3 INTEGER, FSN2_N3 REAL, FSN3_N1 SMALLINT, FSN3_N2 INTEGER, FSN3_N3 INTEGER, FSN4_N3 INTEGER, DISCRIMINATOR varchar(64) NOT NULL, CONSTRAINT FieldSameName_PK PRIMARY KEY (KEY_VALUE), FOREIGN KEY (FSN3_N2) REFERENCES FieldSameName (KEY_VALUE), FOREIGN KEY (FSN3_N3) REFERENCES FieldSameName (KEY_VALUE) ); ------------------------- --instancecallbacks ------------------------- DROP TABLE ICNonPersistFds; DROP TABLE InstanceCallbacks; CREATE TABLE ICNonPersistFds ( ICKEY INTEGER NOT NULL, D DOUBLE, S SMALLINT, FLOATVAL REAL, INTVAL INTEGER, CONSTRAINT ICNP_PK PRIMARY KEY (ICKEY) ); CREATE TABLE InstanceCallbacks ( ICKEY INTEGER NOT NULL, NAME VARCHAR(64), TIMEDATE TIMESTAMP, NEXTOBJ INTEGER, PARENT INTEGER, INTVAL INTEGER, DOUBLEVAL DOUBLE, CHILD2DEL INTEGER, CHARVAL CHAR(254), CONSTRAINT IC_PK PRIMARY KEY (ICKEY) ); ------------------------- --lifecycle ------------------------- DROP TABLE STATETRANSITIONOBJ; CREATE TABLE STATETRANSITIONOBJ ( ID INTEGER NOT NULL, INT_FIELD INTEGER NOT NULL, CONSTRAINT STOBJ_PK PRIMARY KEY (ID) ); ------------------------- --lifecycle-callbacks ------------------------- DROP TABLE LIFECYCLELISTENERATTACH; CREATE TABLE LIFECYCLELISTENERATTACH ( ID INTEGER NOT NULL, CONSTRAINT LIFECYCLE_ATTACH_PK PRIMARY KEY (ID) ); DROP TABLE LIFECYCLELISTENERCLEAR; CREATE TABLE LIFECYCLELISTENERCLEAR ( ID INTEGER NOT NULL, CONSTRAINT LIFECYCLE_CLEAR_PK PRIMARY KEY (ID) ); DROP TABLE LIFECYCLELISTENERDELETE; CREATE TABLE LIFECYCLELISTENERDELETE ( ID INTEGER NOT NULL, CONSTRAINT LIFECYCLE_DELETE_PK PRIMARY KEY (ID) ); DROP TABLE LIFECYCLELISTENERDETACH; CREATE TABLE LIFECYCLELISTENERDETACH ( ID INTEGER NOT NULL, CONSTRAINT LIFECYCLE_DETACH_PK PRIMARY KEY (ID) ); DROP TABLE LIFECYCLELISTENERLOAD; CREATE TABLE LIFECYCLELISTENERLOAD ( ID INTEGER NOT NULL, VALUE INTEGER NOT NULL, CONSTRAINT LIFECYCLE_LOAD_PK PRIMARY KEY (ID) ); DROP TABLE LIFECYCLELISTENERSTORE; CREATE TABLE LIFECYCLELISTENERSTORE ( ID INTEGER NOT NULL, CONSTRAINT LIFECYCLE_STORE_PK PRIMARY KEY (ID) ); disconnect; tck/src/sql/derby/applicationidentity/schema1.sql100664 16130 12500110372 22502 0ustarmbouschenstaff 0 0 -- 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 -- Inheritance mapping: -- Separate table for each class in the inheritance hierarchy. -- Each table contains columns for the declared fields. -- See tables "persons", "employees", "parttimeemployees", -- "fulltimeemployees", "insuranceplans", "medicalinsurance", and "dentalinsurance". connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; CREATE SCHEMA applicationidentity1; SET SCHEMA applicationidentity1; ------------------------- -- company ------------------------- ALTER TABLE departments DROP CONSTRAINT EMP_MO_FK; ALTER TABLE project_reviewer DROP CONSTRAINT PR_PROJ_FK; ALTER TABLE project_reviewer DROP CONSTRAINT PR_REV_FK; DROP TABLE dentalinsurance; DROP TABLE medicalinsurance; DROP TABLE insuranceplans; DROP TABLE project_reviewer; DROP TABLE project_member; DROP TABLE employee_phoneno_type; DROP TABLE fulltimeemployees; DROP TABLE parttimeemployees; DROP TABLE employees; DROP TABLE persons; DROP TABLE projects; DROP TABLE departments; DROP TABLE companies; DROP TABLE meetingrooms; DROP TABLE department_rooms; CREATE TABLE companies ( ID INTEGER NOT NULL, NAME VARCHAR(32) NOT NULL, FOUNDEDDATE DATE NOT NULL, ADDRID INTEGER, STREET VARCHAR(64), CITY VARCHAR(64), STATE CHAR(2), ZIPCODE CHAR(5), COUNTRY VARCHAR(64), CONSTRAINT COMPS_PK PRIMARY KEY (ID) ); CREATE TABLE departments ( ID INTEGER NOT NULL, NAME VARCHAR(32) NOT NULL, EMP_OF_THE_MONTH INTEGER, COMPANYID INTEGER REFERENCES companies, CONSTRAINT DEPTS_PK PRIMARY KEY (ID) ); CREATE TABLE department_rooms ( DEPTID INTEGER NOT NULL, ROOMID INTEGER NOT NULL, ROOM_ORDER INTEGER NOT NULL ); CREATE TABLE meetingrooms ( ID INTEGER NOT NULL, NAME VARCHAR(32) NOT NULL, CONSTRAINT ROOMS_PK PRIMARY KEY (ID) ); CREATE TABLE persons ( PERSONID INTEGER NOT NULL, FIRSTNAME VARCHAR(32) NOT NULL, LASTNAME VARCHAR(32) NOT NULL, MIDDLENAME VARCHAR(32), BIRTHDATE DATE NOT NULL, ADDRID INTEGER, STREET VARCHAR(64), CITY VARCHAR(64), STATE CHAR(2), ZIPCODE CHAR(5), COUNTRY VARCHAR(64), CONSTRAINT PERS_PK PRIMARY KEY (PERSONID) ); CREATE TABLE employees ( PERSONID INTEGER NOT NULL, HIREDATE DATE, WEEKLYHOURS DOUBLE, DEPARTMENT INTEGER REFERENCES departments, FUNDINGDEPT INTEGER REFERENCES departments, MANAGER INTEGER REFERENCES persons, MENTOR INTEGER REFERENCES persons, HRADVISOR INTEGER REFERENCES persons, CONSTRAINT EMPS_PK PRIMARY KEY (PERSONID), CONSTRAINT EMPS_FK FOREIGN KEY (PERSONID) REFERENCES persons (PERSONID) ); CREATE TABLE parttimeemployees ( PERSONID INTEGER NOT NULL, WAGE DOUBLE, CONSTRAINT PTEMPS_PK PRIMARY KEY (PERSONID), CONSTRAINT PTEMPS_FK FOREIGN KEY (PERSONID) REFERENCES persons (PERSONID) ); CREATE TABLE fulltimeemployees ( PERSONID INTEGER NOT NULL, SALARY DOUBLE, CONSTRAINT FTEMPS_PK PRIMARY KEY (PERSONID), CONSTRAINT FTEMPS_FK FOREIGN KEY (PERSONID) REFERENCES persons (PERSONID) ); CREATE TABLE insuranceplans ( INSID INTEGER NOT NULL, CARRIER VARCHAR(64) NOT NULL, EMPLOYEE INTEGER REFERENCES persons, CONSTRAINT INS_PK PRIMARY KEY (INSID) ); CREATE TABLE medicalinsurance ( INSID INTEGER NOT NULL, PLANTYPE VARCHAR(8), CONSTRAINT MEDINS_PK PRIMARY KEY (INSID), CONSTRAINT MEDINS_FK FOREIGN KEY (INSID) REFERENCES insuranceplans (INSID) ); CREATE TABLE dentalinsurance ( INSID INTEGER NOT NULL, LIFETIME_ORTHO_BENEFIT DECIMAL(22,3), CONSTRAINT DENTINS_PK PRIMARY KEY (INSID), CONSTRAINT DENTINS_FK FOREIGN KEY (INSID) REFERENCES insuranceplans (INSID) ); CREATE TABLE projects ( PROJID INTEGER NOT NULL, NAME VARCHAR(32) NOT NULL, BUDGET DECIMAL(11,2) NOT NULL, CONSTRAINT PROJS_PK PRIMARY KEY (PROJID) ); CREATE TABLE project_reviewer ( PROJID INTEGER NOT NULL, REVIEWER INTEGER NOT NULL ); CREATE TABLE project_member ( PROJID INTEGER REFERENCES projects NOT NULL, MEMBER INTEGER REFERENCES persons NOT NULL ); CREATE TABLE employee_phoneno_type ( EMPID INTEGER REFERENCES persons NOT NULL, PHONENO VARCHAR(16) NOT NULL, TYPE VARCHAR(16) NOT NULL ); ALTER TABLE project_reviewer ADD CONSTRAINT PR_PROJ_FK FOREIGN KEY (PROJID) REFERENCES projects(PROJID); ALTER TABLE project_reviewer ADD CONSTRAINT PR_REV_FK FOREIGN KEY (REVIEWER) REFERENCES persons(PERSONID); ALTER TABLE departments ADD CONSTRAINT EMP_MO_FK FOREIGN KEY (EMP_OF_THE_MONTH) REFERENCES persons(PERSONID) ON DELETE SET NULL; ------------------------- -- fieldtypes (enum) ------------------------- DROP TABLE FIELDSOFENUMORDINAL; CREATE TABLE FIELDSOFENUMORDINAL ( IDENTIFIER INTEGER NOT NULL, ENUM0 SMALLINT, ENUM1 SMALLINT, ENUM102 SMALLINT, ENUM103 SMALLINT, ENUM104 INTEGER, ENUM108 INTEGER, ENUM109 INTEGER, ENUM11 INTEGER, ENUM110 BIGINT, ENUM112 BIGINT, ENUM113 BIGINT, ENUM114 BIGINT, ENUM119 NUMERIC(2,0), ENUM12 NUMERIC(2,0), ENUM120 NUMERIC(2,0), ENUM121 NUMERIC(2,0), ENUM124 SMALLINT, ENUM125 SMALLINT, ENUM126 SMALLINT, ENUM128 SMALLINT, ENUM129 INTEGER, ENUM13 INTEGER, ENUM130 INTEGER, ENUM138 INTEGER, ENUM139 BIGINT, ENUM140 BIGINT, ENUM16 BIGINT, ENUM17 BIGINT, ENUM18 NUMERIC(2,0), ENUM2 NUMERIC(2,0), ENUM20 NUMERIC(2,0), ENUM21 NUMERIC(2,0), ENUM22 SMALLINT, ENUM30 SMALLINT, ENUM31 SMALLINT, ENUM32 SMALLINT, ENUM36 INTEGER, ENUM37 INTEGER, ENUM38 INTEGER, ENUM4 INTEGER, ENUM40 BIGINT, ENUM41 BIGINT, ENUM42 BIGINT, ENUM47 BIGINT, ENUM48 NUMERIC(2,0), ENUM49 NUMERIC(2,0), ENUM5 NUMERIC(2,0), ENUM52 NUMERIC(2,0), ENUM53 SMALLINT, ENUM54 SMALLINT, ENUM56 SMALLINT, ENUM57 SMALLINT, ENUM58 INTEGER, ENUM6 INTEGER, ENUM66 INTEGER, ENUM67 INTEGER, ENUM68 BIGINT, ENUM72 BIGINT, ENUM73 BIGINT, ENUM74 BIGINT, ENUM76 NUMERIC(2,0), ENUM77 NUMERIC(2,0), ENUM78 NUMERIC(2,0), ENUM83 NUMERIC(2,0), ENUM84 SMALLINT, ENUM85 SMALLINT, ENUM88 SMALLINT, ENUM89 SMALLINT, ENUM90 INTEGER, ENUM92 INTEGER, ENUM93 INTEGER, ENUM94 INTEGER ); ALTER TABLE FIELDSOFENUMORDINAL ADD CONSTRAINT FIELDSOFENUMORDINAL_PK PRIMARY KEY (IDENTIFIER); disconnect; tck/src/sql/derby/applicationidentity/schema10.sql100664 5606 12500110372 22550 0ustarmbouschenstaff 0 0 -- 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 applicationidentity10; SET SCHEMA applicationidentity10; ------------------------- -- company ------------------------- ALTER TABLE departments DROP CONSTRAINT EMP_MO_FK; ALTER TABLE departments DROP CONSTRAINT DEPTS_COMP_FK; ALTER TABLE persons DROP CONSTRAINT PERS_DEPT_FK; ALTER TABLE persons DROP CONSTRAINT PERS_FUNDDEPT_FK; ALTER TABLE persons DROP CONSTRAINT PERS_MANAGER_FK; ALTER TABLE persons DROP CONSTRAINT PERS_MENTOR_FK; ALTER TABLE persons DROP CONSTRAINT PERS_HRADVISOR_FK; DROP TABLE persons; DROP TABLE departments; DROP TABLE companies; CREATE TABLE companies ( ID INTEGER NOT NULL, NAME VARCHAR(32) NOT NULL, FOUNDEDDATE DATE NOT NULL, CONSTRAINT COMPS_PK PRIMARY KEY (ID) ); CREATE TABLE departments ( ID INTEGER NOT NULL, NAME VARCHAR(32) NOT NULL, EMP_OF_THE_MONTH INTEGER, COMPANYID INTEGER, DISCRIMINATOR VARCHAR(255), CONSTRAINT DEPTS_COMP_FK FOREIGN KEY (COMPANYID) REFERENCES companies, CONSTRAINT DEPTS_PK PRIMARY KEY (ID) ); CREATE TABLE persons ( PERSONID INTEGER NOT NULL, FIRSTNAME VARCHAR(32) NOT NULL, LASTNAME VARCHAR(32) NOT NULL, MIDDLENAME VARCHAR(32), BIRTHDATE DATE NOT NULL, DISCRIMINATOR varchar(64) NOT NULL, ORDER_COL INTEGER NOT NULL, HIREDATE DATE, WEEKLYHOURS REAL, DEPARTMENT INTEGER, FUNDINGDEPT INTEGER, MANAGER INTEGER, MENTOR INTEGER, HRADVISOR INTEGER, SALARY REAL, WAGE REAL, CONSTRAINT PERS_DEPT_FK FOREIGN KEY (DEPARTMENT) REFERENCES departments, CONSTRAINT PERS_FUNDDEPT_FK FOREIGN KEY (FUNDINGDEPT) REFERENCES departments, CONSTRAINT PERS_MANAGER_FK FOREIGN KEY (MANAGER) REFERENCES persons, CONSTRAINT PERS_MENTOR_FK FOREIGN KEY (MENTOR) REFERENCES persons, CONSTRAINT PERS_HRADVISOR_FK FOREIGN KEY (HRADVISOR) REFERENCES persons, CONSTRAINT PERS_PK PRIMARY KEY (PERSONID) ); ALTER TABLE departments ADD CONSTRAINT EMP_MO_FK FOREIGN KEY (EMP_OF_THE_MONTH) REFERENCES persons(PERSONID) ON DELETE SET NULL; tck/src/sql/derby/applicationidentity/schema11.sql100664 12155 12500110372 22566 0ustarmbouschenstaff 0 0 -- 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 applicationidentity11; SET SCHEMA applicationidentity11; ------------------------- -- company ------------------------- ALTER TABLE comp_depts DROP CONSTRAINT EMP_MO_FK; ALTER TABLE comp_depts DROP CONSTRAINT DEPTS_COMP_FK; ALTER TABLE project_reviewer DROP CONSTRAINT PR_PROJ_FK; ALTER TABLE project_reviewer DROP CONSTRAINT PR_REV_FK; ALTER TABLE persons DROP CONSTRAINT PERS_DEPT_FK; ALTER TABLE persons DROP CONSTRAINT PERS_FUNDDEPT_FK; ALTER TABLE persons DROP CONSTRAINT PERS_MANAGER_FK; ALTER TABLE persons DROP CONSTRAINT PERS_MENTOR_FK; ALTER TABLE persons DROP CONSTRAINT PERS_HRADVISOR_FK; ALTER TABLE insuranceplans DROP CONSTRAINT INS_EMP_FK; DROP TABLE insuranceplans; DROP TABLE project_reviewer; DROP TABLE project_member; DROP TABLE employee_phoneno_type; DROP TABLE persons; DROP TABLE projects; DROP TABLE comp_depts; DROP TABLE companies; DROP TABLE meetingrooms; DROP TABLE department_rooms; CREATE TABLE companies ( ID INTEGER NOT NULL, NAME VARCHAR(32) NOT NULL, FOUNDEDDATE DATE NOT NULL, ADDRID INTEGER, STREET VARCHAR(64), CITY VARCHAR(64), STATE CHAR(2), ZIPCODE CHAR(5), COUNTRY VARCHAR(64), DISCRIMINATOR VARCHAR(255), CONSTRAINT COMPS_PK PRIMARY KEY (ID) ); CREATE TABLE comp_depts ( ID INTEGER NOT NULL, NAME VARCHAR(32) NOT NULL, EMP_OF_THE_MONTH INTEGER, COMPANYID INTEGER, DISCRIMINATOR VARCHAR(255), CONSTRAINT DEPTS_COMP_FK FOREIGN KEY (COMPANYID) REFERENCES companies, CONSTRAINT DEPTS_PK PRIMARY KEY (ID) ); CREATE TABLE department_rooms ( DEPTID INTEGER NOT NULL, ROOMID INTEGER NOT NULL, ROOM_ORDER INTEGER NOT NULL ); CREATE TABLE meetingrooms ( ID INTEGER NOT NULL, NAME VARCHAR(32) NOT NULL, DISCRIMINATOR VARCHAR(255), CONSTRAINT ROOMS_PK PRIMARY KEY (ID) ); CREATE TABLE persons ( PERSONID INTEGER NOT NULL, FIRSTNAME VARCHAR(32) NOT NULL, LASTNAME VARCHAR(32) NOT NULL, MIDDLENAME VARCHAR(32), BIRTHDATE DATE NOT NULL, ADDRID INTEGER, STREET VARCHAR(64), CITY VARCHAR(64), STATE CHAR(2), ZIPCODE CHAR(5), COUNTRY VARCHAR(64), HIREDATE DATE, WEEKLYHOURS REAL, DEPARTMENT INTEGER, FUNDINGDEPT INTEGER, MANAGER INTEGER, MENTOR INTEGER, HRADVISOR INTEGER, SALARY REAL, WAGE REAL, DISCRIMINATOR varchar(255) NOT NULL, CONSTRAINT PERS_DEPT_FK FOREIGN KEY (DEPARTMENT) REFERENCES comp_depts, CONSTRAINT PERS_FUNDDEPT_FK FOREIGN KEY (FUNDINGDEPT) REFERENCES comp_depts, CONSTRAINT PERS_MANAGER_FK FOREIGN KEY (MANAGER) REFERENCES persons, CONSTRAINT PERS_MENTOR_FK FOREIGN KEY (MENTOR) REFERENCES persons, CONSTRAINT PERS_HRADVISOR_FK FOREIGN KEY (HRADVISOR) REFERENCES persons, CONSTRAINT EMPS_PK PRIMARY KEY (PERSONID) ); CREATE TABLE insuranceplans ( INSID INTEGER NOT NULL, CARRIER VARCHAR(64) NOT NULL, LIFETIME_ORTHO_BENEFIT DECIMAL(22,3), PLANTYPE VARCHAR(8), DISCRIMINATOR varchar(255) NOT NULL, EMPLOYEE INTEGER, CONSTRAINT INS_EMP_FK FOREIGN KEY (EMPLOYEE) REFERENCES persons, CONSTRAINT INS_PK PRIMARY KEY (INSID) ); CREATE TABLE projects ( PROJID INTEGER NOT NULL, NAME VARCHAR(32) NOT NULL, PROJECT_BUDGET DECIMAL(11,2) NOT NULL, CLASS VARCHAR(255), CONSTRAINT PROJS_PK PRIMARY KEY (PROJID) ); CREATE TABLE project_reviewer ( PROJID INTEGER NOT NULL, REVIEWER INTEGER NOT NULL ); CREATE TABLE project_member ( PROJID INTEGER REFERENCES projects NOT NULL, MEMBER INTEGER REFERENCES persons NOT NULL ); CREATE TABLE employee_phoneno_type ( EMPID INTEGER REFERENCES persons NOT NULL, PHONENO VARCHAR(16) NOT NULL, TYPE VARCHAR(16) NOT NULL ); ALTER TABLE project_reviewer ADD CONSTRAINT PR_PROJ_FK FOREIGN KEY (PROJID) REFERENCES projects(PROJID); ALTER TABLE project_reviewer ADD CONSTRAINT PR_REV_FK FOREIGN KEY (REVIEWER) REFERENCES persons(PERSONID); ALTER TABLE project_member ADD CONSTRAINT PM_PROJ_FK FOREIGN KEY (PROJID) REFERENCES projects; ALTER TABLE project_member ADD CONSTRAINT PM_MEMB_FK FOREIGN KEY (MEMBER) REFERENCES persons; ALTER TABLE comp_depts ADD CONSTRAINT EMP_MO_FK FOREIGN KEY (EMP_OF_THE_MONTH) REFERENCES persons(PERSONID) ON DELETE SET NULL; disconnect; tck/src/sql/derby/applicationidentity/schema12.sql100664 2445 12500110372 22550 0ustarmbouschenstaff 0 0 -- 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) ); tck/src/sql/derby/applicationidentity/schema2.sql100664 14602 12500110372 22505 0ustarmbouschenstaff 0 0 -- 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 -- Inheritance mapping: -- Separate table for each class in the inheritance hierarchy. -- No tables for abstract classes. -- Each table contains columns for all fields. -- Managers, mentors, hradvisors, and employees of the month -- are fulltime employees. -- Only fulltime employees can have insurances, can be project members, -- and can be project reviewers. -- Separate phone number type tables for persons, fulltime employees, -- and parttime employees. -- See tables "persons", "parttimeemployees", -- "fulltimeemployees", "medicalinsurance", "dentalinsurance", -- "fulltime_employee_phoneno_type", and "parttime_employee_phoneno_type". connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; CREATE SCHEMA applicationidentity2; SET SCHEMA applicationidentity2; ------------------------- -- company ------------------------- ALTER TABLE departments DROP CONSTRAINT EMP_MO_FK; ALTER TABLE project_reviewer DROP CONSTRAINT PR_PROJ_FK; ALTER TABLE project_reviewer DROP CONSTRAINT PR_REV_FK; DROP TABLE dentalinsurance; DROP TABLE medicalinsurance; DROP TABLE project_reviewer; DROP TABLE project_member; DROP TABLE employee_phoneno_type; DROP TABLE fulltime_employee_phoneno_type; DROP TABLE parttime_employee_phoneno_type; DROP TABLE parttimeemployees; DROP TABLE fulltimeemployees; DROP TABLE persons; DROP TABLE projects; DROP TABLE departments; DROP TABLE companies; DROP TABLE meetingrooms; DROP TABLE department_rooms; CREATE TABLE companies ( ID INTEGER NOT NULL, NAME VARCHAR(32) NOT NULL, FOUNDEDDATE DATE NOT NULL, ADDRID INTEGER, STREET VARCHAR(64), CITY VARCHAR(64), STATE CHAR(2), ZIPCODE CHAR(5), COUNTRY VARCHAR(64), CONSTRAINT COMPS_PK PRIMARY KEY (ID) ); CREATE TABLE departments ( ID INTEGER NOT NULL, NAME VARCHAR(32) NOT NULL, EMP_OF_THE_MONTH INTEGER, COMPANYID INTEGER REFERENCES companies, CONSTRAINT DEPTS_PK PRIMARY KEY (ID) ); CREATE TABLE department_rooms ( DEPTID INTEGER NOT NULL, ROOMID INTEGER NOT NULL, ROOM_ORDER INTEGER NOT NULL ); CREATE TABLE meetingrooms ( ID INTEGER NOT NULL, NAME VARCHAR(32) NOT NULL, CONSTRAINT ROOMS_PK PRIMARY KEY (ID) ); CREATE TABLE persons ( PERSONID INTEGER NOT NULL, FIRSTNAME VARCHAR(32) NOT NULL, LASTNAME VARCHAR(32) NOT NULL, MIDDLENAME VARCHAR(32), BIRTHDATE DATE NOT NULL, ADDRID INTEGER, STREET VARCHAR(64), CITY VARCHAR(64), STATE CHAR(2), ZIPCODE CHAR(5), COUNTRY VARCHAR(64), CONSTRAINT PERS_PK PRIMARY KEY (PERSONID) ); CREATE TABLE fulltimeemployees ( PERSONID INTEGER NOT NULL, FIRSTNAME VARCHAR(32) NOT NULL, LASTNAME VARCHAR(32) NOT NULL, MIDDLENAME VARCHAR(32), BIRTHDATE DATE NOT NULL, ADDRID INTEGER, STREET VARCHAR(64), CITY VARCHAR(64), STATE CHAR(2), ZIPCODE CHAR(5), COUNTRY VARCHAR(64), HIREDATE DATE, WEEKLYHOURS DOUBLE, DEPARTMENT INTEGER REFERENCES departments, FUNDINGDEPT INTEGER REFERENCES departments, MANAGER INTEGER REFERENCES fulltimeemployees, MENTOR INTEGER REFERENCES fulltimeemployees, HRADVISOR INTEGER REFERENCES fulltimeemployees, SALARY DOUBLE, CONSTRAINT FTEMPS_PK PRIMARY KEY (PERSONID) ); CREATE TABLE parttimeemployees ( PERSONID INTEGER NOT NULL, FIRSTNAME VARCHAR(32) NOT NULL, LASTNAME VARCHAR(32) NOT NULL, MIDDLENAME VARCHAR(32), BIRTHDATE DATE NOT NULL, ADDRID INTEGER, STREET VARCHAR(64), CITY VARCHAR(64), STATE CHAR(2), ZIPCODE CHAR(5), COUNTRY VARCHAR(64), HIREDATE DATE, WEEKLYHOURS DOUBLE, DEPARTMENT INTEGER REFERENCES departments, FUNDINGDEPT INTEGER REFERENCES departments, MANAGER INTEGER REFERENCES fulltimeemployees, MENTOR INTEGER REFERENCES fulltimeemployees, HRADVISOR INTEGER REFERENCES fulltimeemployees, WAGE DOUBLE, CONSTRAINT PTEMPS_PK PRIMARY KEY (PERSONID) ); CREATE TABLE medicalinsurance ( INSID INTEGER NOT NULL, CARRIER VARCHAR(64) NOT NULL, EMPLOYEE INTEGER REFERENCES fulltimeemployees, PLANTYPE VARCHAR(8), CONSTRAINT MEDINS_PK PRIMARY KEY (INSID) ); CREATE TABLE dentalinsurance ( INSID INTEGER NOT NULL, CARRIER VARCHAR(64) NOT NULL, EMPLOYEE INTEGER REFERENCES fulltimeemployees, LIFETIME_ORTHO_BENEFIT DECIMAL(22,3), CONSTRAINT DENTINS_PK PRIMARY KEY (INSID) ); CREATE TABLE projects ( PROJID INTEGER NOT NULL, NAME VARCHAR(32) NOT NULL, BUDGET DECIMAL(11,2) NOT NULL, CONSTRAINT PROJS_PK PRIMARY KEY (PROJID) ); CREATE TABLE project_reviewer ( PROJID INTEGER NOT NULL, REVIEWER INTEGER NOT NULL ); CREATE TABLE project_member ( PROJID INTEGER REFERENCES projects NOT NULL, MEMBER INTEGER REFERENCES fulltimeemployees NOT NULL ); CREATE TABLE employee_phoneno_type ( EMPID INTEGER REFERENCES persons NOT NULL, PHONENO VARCHAR(16) NOT NULL, TYPE VARCHAR(16) NOT NULL ); CREATE TABLE fulltime_employee_phoneno_type ( EMPID INTEGER REFERENCES fulltimeemployees NOT NULL, PHONENO VARCHAR(16) NOT NULL, TYPE VARCHAR(16) NOT NULL ); CREATE TABLE parttime_employee_phoneno_type ( EMPID INTEGER REFERENCES parttimeemployees NOT NULL, PHONENO VARCHAR(16) NOT NULL, TYPE VARCHAR(16) NOT NULL ); ALTER TABLE project_reviewer ADD CONSTRAINT PR_PROJ_FK FOREIGN KEY (PROJID) REFERENCES projects(PROJID); ALTER TABLE project_reviewer ADD CONSTRAINT PR_REV_FK FOREIGN KEY (REVIEWER) REFERENCES fulltimeemployees(PERSONID); ALTER TABLE departments ADD CONSTRAINT EMP_MO_FK FOREIGN KEY (EMP_OF_THE_MONTH) REFERENCES fulltimeemployees(PERSONID) ON DELETE SET NULL; disconnect; tck/src/sql/derby/applicationidentity/schema3.sql100664 12501 12500110372 22502 0ustarmbouschenstaff 0 0 -- 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 -- Inheritance mapping: -- Person has inheritance strategy "new-table". -- Employee has inheritance strategy "subclass-table". -- PartTimeEmployee and FullTimeEmployee have inheritance strategy "new-table". -- Insurance has inheritance strategy "subclass-table". -- MedicalInsurance and DentalInsurance have inheritance strategy "new-table". -- See tables "persons", "parttimeemployees", "fulltimeemployees", -- "medicalinsurance" and "dentalinsurance". connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; CREATE SCHEMA applicationidentity3; SET SCHEMA applicationidentity3; ------------------------- -- company ------------------------- ALTER TABLE departments DROP CONSTRAINT EMP_MO_FK; ALTER TABLE project_reviewer DROP CONSTRAINT PR_PROJ_FK; ALTER TABLE project_reviewer DROP CONSTRAINT PR_REV_FK; DROP TABLE dentalinsurance; DROP TABLE medicalinsurance; DROP TABLE project_reviewer; DROP TABLE project_member; DROP TABLE employee_phoneno_type; DROP TABLE fulltimeemployees; DROP TABLE parttimeemployees; DROP TABLE persons; DROP TABLE projects; DROP TABLE departments; DROP TABLE companies; DROP TABLE meetingrooms; DROP TABLE department_rooms; CREATE TABLE companies ( ID INTEGER NOT NULL, NAME VARCHAR(32) NOT NULL, FOUNDEDDATE DATE NOT NULL, ADDRID INTEGER, STREET VARCHAR(64), CITY VARCHAR(64), STATE CHAR(2), ZIPCODE CHAR(5), COUNTRY VARCHAR(64), CONSTRAINT COMPS_PK PRIMARY KEY (ID) ); CREATE TABLE departments ( ID INTEGER NOT NULL, NAME VARCHAR(32) NOT NULL, EMP_OF_THE_MONTH INTEGER, COMPANYID INTEGER REFERENCES companies, CONSTRAINT DEPTS_PK PRIMARY KEY (ID) ); CREATE TABLE department_rooms ( DEPTID INTEGER NOT NULL, ROOMID INTEGER NOT NULL, ROOM_ORDER INTEGER NOT NULL ); CREATE TABLE meetingrooms ( ID INTEGER NOT NULL, NAME VARCHAR(32) NOT NULL, CONSTRAINT ROOMS_PK PRIMARY KEY (ID) ); CREATE TABLE persons ( PERSONID INTEGER NOT NULL, FIRSTNAME VARCHAR(32) NOT NULL, LASTNAME VARCHAR(32) NOT NULL, MIDDLENAME VARCHAR(32), BIRTHDATE DATE NOT NULL, ADDRID INTEGER, STREET VARCHAR(64), CITY VARCHAR(64), STATE CHAR(2), ZIPCODE CHAR(5), COUNTRY VARCHAR(64), CONSTRAINT PERS_PK PRIMARY KEY (PERSONID) ); CREATE TABLE parttimeemployees ( PERSONID INTEGER NOT NULL, HIREDATE DATE, WEEKLYHOURS DOUBLE, DEPARTMENT INTEGER REFERENCES departments, FUNDINGDEPT INTEGER REFERENCES departments, MANAGER INTEGER REFERENCES persons, MENTOR INTEGER REFERENCES persons, HRADVISOR INTEGER REFERENCES persons, WAGE DOUBLE, CONSTRAINT PTEMPS_PK PRIMARY KEY (PERSONID), CONSTRAINT PTEMPS_FK FOREIGN KEY (PERSONID) REFERENCES persons (PERSONID) ); CREATE TABLE fulltimeemployees ( PERSONID INTEGER NOT NULL, HIREDATE DATE, WEEKLYHOURS DOUBLE, DEPARTMENT INTEGER REFERENCES departments, FUNDINGDEPT INTEGER REFERENCES departments, MANAGER INTEGER REFERENCES persons, MENTOR INTEGER REFERENCES persons, HRADVISOR INTEGER REFERENCES persons, SALARY DOUBLE, CONSTRAINT FTEMPS_PK PRIMARY KEY (PERSONID), CONSTRAINT FTEMPS_FK FOREIGN KEY (PERSONID) REFERENCES persons (PERSONID) ); CREATE TABLE medicalinsurance ( INSID INTEGER NOT NULL, CARRIER VARCHAR(64) NOT NULL, EMPLOYEE INTEGER REFERENCES persons, PLANTYPE VARCHAR(8), CONSTRAINT MEDINS_PK PRIMARY KEY (INSID) ); CREATE TABLE dentalinsurance ( INSID INTEGER NOT NULL, CARRIER VARCHAR(64) NOT NULL, EMPLOYEE INTEGER REFERENCES persons, LIFETIME_ORTHO_BENEFIT DECIMAL(22,3), CONSTRAINT DENTINS_PK PRIMARY KEY (INSID) ); CREATE TABLE projects ( PROJID INTEGER NOT NULL, NAME VARCHAR(32) NOT NULL, BUDGET DECIMAL(11,2) NOT NULL, CONSTRAINT PROJS_PK PRIMARY KEY (PROJID) ); CREATE TABLE project_reviewer ( PROJID INTEGER NOT NULL, REVIEWER INTEGER NOT NULL ); CREATE TABLE project_member ( PROJID INTEGER REFERENCES projects NOT NULL, MEMBER INTEGER REFERENCES persons NOT NULL ); CREATE TABLE employee_phoneno_type ( EMPID INTEGER REFERENCES persons NOT NULL, PHONENO VARCHAR(16) NOT NULL, TYPE VARCHAR(16) NOT NULL ); ALTER TABLE project_reviewer ADD CONSTRAINT PR_PROJ_FK FOREIGN KEY (PROJID) REFERENCES projects(PROJID); ALTER TABLE project_reviewer ADD CONSTRAINT PR_REV_FK FOREIGN KEY (REVIEWER) REFERENCES persons(PERSONID); ALTER TABLE departments ADD CONSTRAINT EMP_MO_FK FOREIGN KEY (EMP_OF_THE_MONTH) REFERENCES persons(PERSONID) ON DELETE SET NULL; disconnect; tck/src/sql/derby/applicationidentity/schema4.sql100664 11025 12500110372 22503 0ustarmbouschenstaff 0 0 -- 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 -- Inheritance mapping: -- Person, Employee, and Insurance have inheritance strategy "new-table". -- PartTimeEmployee, FullTimeEmployee, MedicalInsurance, and DentalInsurance -- have inheritance strategy "superclass-table". -- See tables "persons", "employees", and "insuranceplans". connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; CREATE SCHEMA applicationidentity4; SET SCHEMA applicationidentity4; ------------------------- -- company ------------------------- ALTER TABLE departments DROP CONSTRAINT EMP_MO_FK; ALTER TABLE project_reviewer DROP CONSTRAINT PR_PROJ_FK; ALTER TABLE project_reviewer DROP CONSTRAINT PR_REV_FK; DROP TABLE insuranceplans; DROP TABLE project_reviewer; DROP TABLE project_member; DROP TABLE employee_phoneno_type; DROP TABLE employees; DROP TABLE persons; DROP TABLE projects; DROP TABLE departments; DROP TABLE companies; DROP TABLE meetingrooms; DROP TABLE department_rooms; CREATE TABLE companies ( ID INTEGER NOT NULL, NAME VARCHAR(32) NOT NULL, FOUNDEDDATE DATE NOT NULL, ADDRID INTEGER, STREET VARCHAR(64), CITY VARCHAR(64), STATE CHAR(2), ZIPCODE CHAR(5), COUNTRY VARCHAR(64), CONSTRAINT COMPS_PK PRIMARY KEY (ID) ); CREATE TABLE departments ( ID INTEGER NOT NULL, NAME VARCHAR(32) NOT NULL, EMP_OF_THE_MONTH INTEGER, COMPANYID INTEGER REFERENCES companies, CONSTRAINT DEPTS_PK PRIMARY KEY (ID) ); CREATE TABLE department_rooms ( DEPTID INTEGER NOT NULL, ROOMID INTEGER NOT NULL, ROOM_ORDER INTEGER NOT NULL ); CREATE TABLE meetingrooms ( ID INTEGER NOT NULL, NAME VARCHAR(32) NOT NULL, CONSTRAINT ROOMS_PK PRIMARY KEY (ID) ); CREATE TABLE persons ( PERSONID INTEGER NOT NULL, FIRSTNAME VARCHAR(32) NOT NULL, LASTNAME VARCHAR(32) NOT NULL, MIDDLENAME VARCHAR(32), BIRTHDATE DATE NOT NULL, ADDRID INTEGER, STREET VARCHAR(64), CITY VARCHAR(64), STATE CHAR(2), ZIPCODE CHAR(5), COUNTRY VARCHAR(64), CONSTRAINT PERS_PK PRIMARY KEY (PERSONID) ); CREATE TABLE employees ( PERSONID INTEGER NOT NULL, HIREDATE DATE, WEEKLYHOURS DOUBLE, DEPARTMENT INTEGER REFERENCES departments, FUNDINGDEPT INTEGER REFERENCES departments, MANAGER INTEGER REFERENCES persons, MENTOR INTEGER REFERENCES persons, HRADVISOR INTEGER REFERENCES persons, WAGE DOUBLE, SALARY DOUBLE, DISCRIMINATOR varchar(64) NOT NULL, CONSTRAINT EMPS_PK PRIMARY KEY (PERSONID), CONSTRAINT EMPS_FK FOREIGN KEY (PERSONID) REFERENCES persons (PERSONID) ); CREATE TABLE insuranceplans ( INSID INTEGER NOT NULL, CARRIER VARCHAR(64) NOT NULL, EMPLOYEE INTEGER REFERENCES persons, PLANTYPE VARCHAR(8), LIFETIME_ORTHO_BENEFIT DECIMAL(22,3), DISCRIMINATOR varchar(64) NOT NULL, CONSTRAINT INS_PK PRIMARY KEY (INSID) ); CREATE TABLE projects ( PROJID INTEGER NOT NULL, NAME VARCHAR(32) NOT NULL, BUDGET DECIMAL(11,2) NOT NULL, CONSTRAINT PROJS_PK PRIMARY KEY (PROJID) ); CREATE TABLE project_reviewer ( PROJID INTEGER NOT NULL, REVIEWER INTEGER NOT NULL ); CREATE TABLE project_member ( PROJID INTEGER REFERENCES projects NOT NULL, MEMBER INTEGER REFERENCES persons NOT NULL ); CREATE TABLE employee_phoneno_type ( EMPID INTEGER REFERENCES persons NOT NULL, PHONENO VARCHAR(16) NOT NULL, TYPE VARCHAR(16) NOT NULL ); ALTER TABLE project_reviewer ADD CONSTRAINT PR_PROJ_FK FOREIGN KEY (PROJID) REFERENCES projects(PROJID); ALTER TABLE project_reviewer ADD CONSTRAINT PR_REV_FK FOREIGN KEY (REVIEWER) REFERENCES persons(PERSONID); ALTER TABLE departments ADD CONSTRAINT EMP_MO_FK FOREIGN KEY (EMP_OF_THE_MONTH) REFERENCES persons(PERSONID) ON DELETE SET NULL; disconnect; tck/src/sql/derby/applicationidentity/schema5.sql100664 2270 12500110372 22466 0ustarmbouschenstaff 0 0 -- 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 orm connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; CREATE SCHEMA applicationidentity_orm; SET SCHEMA applicationidentity_orm; ------------------------- -- mylib ------------------------- DROP TABLE PCPoint; CREATE TABLE PCPoint ( ID BIGINT NOT NULL, X INTEGER NOT NULL, Y INTEGER, CONSTRAINT PCPNT_CONST PRIMARY KEY (ID) ); tck/src/sql/derby/applicationidentity/schema6.sql100664 2270 12500110372 22467 0ustarmbouschenstaff 0 0 -- 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 pkg connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; CREATE SCHEMA applicationidentity_pkg; SET SCHEMA applicationidentity_pkg; ------------------------- -- mylib ------------------------- DROP TABLE PCPoint; CREATE TABLE PCPoint ( ID BIGINT NOT NULL, X INTEGER NOT NULL, Y INTEGER, CONSTRAINT PCPNT_CONST PRIMARY KEY (ID) ); tck/src/sql/derby/applicationidentity/schema7.sql100664 2270 12500110372 22470 0ustarmbouschenstaff 0 0 -- 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 cls connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; CREATE SCHEMA applicationidentity_cls; SET SCHEMA applicationidentity_cls; ------------------------- -- mylib ------------------------- DROP TABLE PCPoint; CREATE TABLE PCPoint ( ID BIGINT NOT NULL, X INTEGER NOT NULL, Y INTEGER, CONSTRAINT PCPNT_CONST PRIMARY KEY (ID) ); tck/src/sql/derby/applicationidentity/schema8.sql100664 3712 12500110372 22473 0ustarmbouschenstaff 0 0 -- 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 applicationidentity8; SET SCHEMA applicationidentity8; DROP TABLE CART_ENTRIES; DROP TABLE CARTS; DROP TABLE PRODUCTS; DROP TABLE UNDETACHABLES; CREATE TABLE CARTS ( CART_ID BIGINT NOT NULL, CUSTOMER_ID VARCHAR(128) NOT NULL, VERSION INTEGER NOT NULL DEFAULT 0, CONSTRAINT CARTS_PK PRIMARY KEY (CART_ID) ); CREATE TABLE PRODUCTS ( SKU VARCHAR(48) NOT NULL, DESCRIPTION VARCHAR(128), VERSION INTEGER NOT NULL DEFAULT 0, CONSTRAINT PRODUCTS_PK PRIMARY KEY (SKU) ); CREATE TABLE CART_ENTRIES ( ID BIGINT NOT NULL, QUANTITY INTEGER DEFAULT 0, CART_ID BIGINT NOT NULL, SKU VARCHAR(48) NOT NULL, VERSION INTEGER NOT NULL DEFAULT 0, CONSTRAINT CART_ENTRIES_PK PRIMARY KEY (ID), CONSTRAINT CARTS_FK FOREIGN KEY (CART_ID) REFERENCES CARTS, CONSTRAINT PRODUCTS_FK FOREIGN KEY (SKU) REFERENCES PRODUCTS ); CREATE TABLE UNDETACHABLES ( ID BIGINT NOT NULL, FOO INTEGER, BAR INTEGER, VERSION INTEGER NOT NULL DEFAULT 0, CONSTRAINT UNDETACHABLES_PK PRIMARY KEY (ID) ); tck/src/sql/derby/applicationidentity/schema9.sql100664 5572 12500110372 22502 0ustarmbouschenstaff 0 0 -- 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 applicationidentity9; SET SCHEMA applicationidentity9; ------------------------- -- company ------------------------- ALTER TABLE departments DROP CONSTRAINT EMP_MO_FK; ALTER TABLE departments DROP CONSTRAINT DEPTS_COMP_FK; ALTER TABLE persons DROP CONSTRAINT PERS_DEPT_FK; ALTER TABLE persons DROP CONSTRAINT PERS_FUNDDEPT_FK; ALTER TABLE persons DROP CONSTRAINT PERS_MANAGER_FK; ALTER TABLE persons DROP CONSTRAINT PERS_MENTOR_FK; ALTER TABLE persons DROP CONSTRAINT PERS_HRADVISOR_FK; DROP TABLE persons; DROP TABLE departments; DROP TABLE companies; CREATE TABLE companies ( ID INTEGER NOT NULL, NAME VARCHAR(32) NOT NULL, FOUNDEDDATE DATE NOT NULL, CONSTRAINT COMPS_PK PRIMARY KEY (ID) ); CREATE TABLE departments ( ID INTEGER NOT NULL, NAME VARCHAR(32) NOT NULL, EMP_OF_THE_MONTH INTEGER, COMPANYID INTEGER, DISCRIMINATOR VARCHAR(255), CONSTRAINT DEPTS_COMP_FK FOREIGN KEY (COMPANYID) REFERENCES companies, CONSTRAINT DEPTS_PK PRIMARY KEY (ID) ); CREATE TABLE persons ( PERSONID INTEGER NOT NULL, FIRSTNAME VARCHAR(32) NOT NULL, LASTNAME VARCHAR(32) NOT NULL, MIDDLENAME VARCHAR(32), BIRTHDATE DATE Not NULL, DISCRIMINATOR varchar(64) NOT NULL, ROLE VARCHAR(32), HIREDATE DATE, WEEKLYHOURS REAL, DEPARTMENT INTEGER, FUNDINGDEPT INTEGER, MANAGER INTEGER, MENTOR INTEGER, HRADVISOR INTEGER, SALARY REAL, WAGE REAL, CONSTRAINT PERS_DEPT_FK FOREIGN KEY (DEPARTMENT) REFERENCES departments, CONSTRAINT PERS_FUNDDEPT_FK FOREIGN KEY (FUNDINGDEPT) REFERENCES departments, CONSTRAINT PERS_MANAGER_FK FOREIGN KEY (MANAGER) REFERENCES persons, CONSTRAINT PERS_MENTOR_FK FOREIGN KEY (MENTOR) REFERENCES persons, CONSTRAINT PERS_HRADVISOR_FK FOREIGN KEY (HRADVISOR) REFERENCES persons, CONSTRAINT PERS_PK PRIMARY KEY (PERSONID) ); ALTER TABLE departments ADD CONSTRAINT EMP_MO_FK FOREIGN KEY (EMP_OF_THE_MONTH) REFERENCES persons(PERSONID) ON DELETE SET NULL; tck/src/sql/derby/datastoreidentity/schema.sql100664 1077414 12500110372 22161 0ustarmbouschenstaff 0 0 -- 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 datastoreidentity0; SET SCHEMA datastoreidentity0; ------------------------- -- newInstance ------------------------- DROP TABLE address; CREATE TABLE address ( DATASTORE_IDENTITY BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY, ADDRID INTEGER, STREET VARCHAR(64), CITY VARCHAR(64), STATE CHAR(2), ZIPCODE CHAR(5), COUNTRY VARCHAR(64), CONSTRAINT ADDR_PK PRIMARY KEY (ADDRID) ); ------------------------- -- mylib ------------------------- DROP TABLE PCRect; DROP TABLE PCPoint; DROP TABLE VersionedPCPoint; DROP TABLE PCPoint2; DROP TABLE PrimitiveTypes; DROP TABLE PCClass; CREATE TABLE PCPoint ( DATASTORE_IDENTITY BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY, ID BIGINT, X INTEGER NOT NULL, Y INTEGER, CONSTRAINT PCPNT_CONST PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE VersionedPCPoint ( DATASTORE_IDENTITY BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY, ID BIGINT, X INTEGER NOT NULL, Y INTEGER, VERSION INTEGER, CONSTRAINT VERSIONED_PCPNT_CONST PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE PCPoint2 ( DATASTORE_IDENTITY BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY, ID BIGINT, X INTEGER NOT NULL, Y INTEGER, CONSTRAINT PCPNT2_CONST PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE PCRect ( DATASTORE_IDENTITY BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY, ID BIGINT, UPPER_LEFT BIGINT REFERENCES PCPoint NOT NULL, LOWER_RIGHT BIGINT REFERENCES PCPoint NOT NULL, CONSTRAINT PCRCT_CONST PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE PrimitiveTypes ( DATASTORE_IDENTITY BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY, ID BIGINT, booleanNotNull CHAR(1) NOT NULL CHECK (booleanNotNull IN ('Y','N')), booleanNull CHAR(1) CHECK (booleanNull IN ('Y','N')), byteNotNull SMALLINT NOT NULL, byteNull SMALLINT, shortNotNull SMALLINT NOT NULL, shortNull SMALLINT, intNotNull INTEGER NOT NULL, intNull INTEGER, longNotNull INTEGER NOT NULL, longNull INTEGER, floatNotNull REAL NOT NULL, floatNull REAL, doubleNotNull DOUBLE NOT NULL, doubleNull DOUBLE, charNotNull CHAR NOT NULL, charNull CHAR, dateNull TIMESTAMP, stringNull VARCHAR (256), bigDecimal DECIMAL, bigInteger INTEGER, PrimitiveTypes INTEGER, CONSTRAINT PT_CONST PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE PCClass ( DATASTORE_IDENTITY BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY, ID BIGINT, NUMBER1 INTEGER, NUMBER2 INTEGER, CONSTRAINT PCCLASS_CONST PRIMARY KEY (DATASTORE_IDENTITY) ); ------------------------- -- query ------------------------- DROP TABLE JDOQLKeywordsAsFieldNames; DROP TABLE NoExtent; DROP TABLE TimeSample; DROP TABLE MathSample; CREATE TABLE JDOQLKeywordsAsFieldNames ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, ID VARCHAR(64) NOT NULL, CONSTRAINT KEYWORDS_PK PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE NoExtent ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, ID INTEGER NOT NULL, CONSTRAINT NOEXTENT_PK PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE TimeSample ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, ID INTEGER NOT NULL, TIME TIME, CONSTRAINT TIMESAMPLE_PK PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE MathSample ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, ID INTEGER NOT NULL, ANGLE DECIMAL(18,8), CONSTRAINT MATHSAMPLE_PK PRIMARY KEY (DATASTORE_IDENTITY) ); ------------------------- -- company ------------------------- ALTER TABLE departments DROP CONSTRAINT EMP_MO_FK; ALTER TABLE departments DROP CONSTRAINT DEPTS_COMP_FK; ALTER TABLE project_reviewer DROP CONSTRAINT PR_PROJ_FK; ALTER TABLE project_reviewer DROP CONSTRAINT PR_REV_FK; ALTER TABLE persons DROP CONSTRAINT PERS_DEPT_FK; ALTER TABLE persons DROP CONSTRAINT PERS_FUNDDEPT_FK; ALTER TABLE persons DROP CONSTRAINT PERS_MANAGER_FK; ALTER TABLE persons DROP CONSTRAINT PERS_MENTOR_FK; ALTER TABLE persons DROP CONSTRAINT PERS_HRADVISOR_FK; ALTER TABLE insuranceplans DROP CONSTRAINT INS_EMP_FK; DROP TABLE insuranceplans; DROP TABLE project_reviewer; DROP TABLE project_member; DROP TABLE employee_phoneno_type; DROP TABLE persons; DROP TABLE projects; DROP TABLE departments; DROP TABLE companies; DROP TABLE meetingrooms; DROP TABLE department_rooms; CREATE TABLE companies ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, ID INTEGER, NAME VARCHAR(32) NOT NULL, FOUNDEDDATE DATE NOT NULL, ADDRID INTEGER, STREET VARCHAR(64), CITY VARCHAR(64), STATE CHAR(2), ZIPCODE CHAR(5), COUNTRY VARCHAR(64), DISCRIMINATOR VARCHAR(255), CONSTRAINT COMPS_PK PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE departments ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, ID INTEGER, NAME VARCHAR(32) NOT NULL, EMP_OF_THE_MONTH INTEGER, COMPANYID INTEGER, DISCRIMINATOR VARCHAR(255), CONSTRAINT DEPTS_COMP_FK FOREIGN KEY (COMPANYID) REFERENCES companies, CONSTRAINT DEPTS_PK PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE department_rooms ( DEPTID INTEGER NOT NULL, ROOMID INTEGER NOT NULL, ROOM_ORDER INTEGER NOT NULL ); CREATE TABLE meetingrooms ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, ID INTEGER NOT NULL, NAME VARCHAR(32) NOT NULL, DISCRIMINATOR VARCHAR(255), CONSTRAINT ROOMS_PK PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE persons ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, PERSONID INTEGER NOT NULL, FIRSTNAME VARCHAR(32) NOT NULL, LASTNAME VARCHAR(32) NOT NULL, MIDDLENAME VARCHAR(32), BIRTHDATE DATE NOT NULL, ADDRID INTEGER, STREET VARCHAR(64), CITY VARCHAR(64), STATE CHAR(2), ZIPCODE CHAR(5), COUNTRY VARCHAR(64), HIREDATE DATE, WEEKLYHOURS REAL, DEPARTMENT INTEGER, FUNDINGDEPT INTEGER, MANAGER INTEGER, MENTOR INTEGER, HRADVISOR INTEGER, SALARY REAL, WAGE REAL, DISCRIMINATOR varchar(255) NOT NULL, CONSTRAINT PERS_DEPT_FK FOREIGN KEY (DEPARTMENT) REFERENCES departments, CONSTRAINT PERS_FUNDDEPT_FK FOREIGN KEY (FUNDINGDEPT) REFERENCES departments, CONSTRAINT PERS_MANAGER_FK FOREIGN KEY (MANAGER) REFERENCES persons, CONSTRAINT PERS_MENTOR_FK FOREIGN KEY (MENTOR) REFERENCES persons, CONSTRAINT PERS_HRADVISOR_FK FOREIGN KEY (HRADVISOR) REFERENCES persons, CONSTRAINT PERS_UK UNIQUE (PERSONID), CONSTRAINT PERS_PK PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE insuranceplans ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, INSID INTEGER, CARRIER VARCHAR(64) NOT NULL, LIFETIME_ORTHO_BENEFIT DECIMAL(22,3), PLANTYPE VARCHAR(8), DISCRIMINATOR varchar(255) NOT NULL, EMPLOYEE INTEGER, CONSTRAINT INS_EMP_FK FOREIGN KEY (EMPLOYEE) REFERENCES persons, CONSTRAINT INS_PK PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE projects ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, PROJID INTEGER NOT NULL, NAME VARCHAR(32) NOT NULL, BUDGET DECIMAL(11,2) NOT NULL, DISCRIMINATOR VARCHAR(255), CONSTRAINT PROJS_UK UNIQUE (PROJID), CONSTRAINT PROJS_PK PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE project_reviewer ( PROJID INTEGER NOT NULL, REVIEWER INTEGER NOT NULL ); CREATE TABLE project_member ( PROJID INTEGER NOT NULL, MEMBER INTEGER NOT NULL ); CREATE TABLE employee_phoneno_type ( EMPID INTEGER REFERENCES persons NOT NULL, PHONENO VARCHAR(16) NOT NULL, TYPE VARCHAR(16) NOT NULL ); ALTER TABLE project_reviewer ADD CONSTRAINT PR_PROJ_FK FOREIGN KEY (PROJID) REFERENCES projects; ALTER TABLE project_reviewer ADD CONSTRAINT PR_REV_FK FOREIGN KEY (REVIEWER) REFERENCES persons; ALTER TABLE project_member ADD CONSTRAINT PM_PROJ_FK FOREIGN KEY (PROJID) REFERENCES projects; ALTER TABLE project_member ADD CONSTRAINT PM_MEMB_FK FOREIGN KEY (MEMBER) REFERENCES persons; ALTER TABLE departments ADD CONSTRAINT EMP_MO_FK FOREIGN KEY (EMP_OF_THE_MONTH) REFERENCES persons ON DELETE SET NULL; ------------------------- --fieldtypes ------------------------- DROP TABLE ARRAY_OF_OBJECT0; DROP TABLE ARRAY_OF_OBJECT1; DROP TABLE ARRAY_OF_SIMPLE_CLASS2; DROP TABLE ARRAY_OF_SIMPLE_CLASS3; DROP TABLE ARRAY_OF_SIMPLE_INTERFACE4; DROP TABLE ARRAY_OF_SIMPLE_INTERFACE5; DROP TABLE ARRAY_OF_STRING7; DROP TABLE ARRAY_OF_DATE9; DROP TABLE ARRAY_OF_LOCALE11; DROP TABLE ARRAY_OF_BIG_DECIMAL13; DROP TABLE ARRAY_OF_BIG_INTEGER15; DROP TABLE ARRAY_OF_BYTE17; DROP TABLE ARRAY_OF_DOUBLE19; DROP TABLE ARRAY_OF_FLOAT21; DROP TABLE ARRAY_OF_INTEGER23; DROP TABLE ARRAY_OF_LONG25; DROP TABLE ARRAY_OF_SHORT27; DROP TABLE ARRAY_OF_SIMPLEENUM29; DROP TABLE ARRAY_OF_SIMPLEENUM30; DROP TABLE ARRAY_COLLECTIONS; DROP TABLE ARRAYLIST_OF_OBJECT0; DROP TABLE ARRAYLIST_OF_OBJECT1; DROP TABLE ARRAYLIST_OF_OBJECT2; DROP TABLE ARRAYLIST_OF_SIMPLE_CLASS3; DROP TABLE ARRAYLIST_OF_SIMPLE_CLASS4; DROP TABLE ARRAYLIST_OF_SIMPLE_CLASS5; DROP TABLE ARRAYLIST_OF_SIMPLE_INTERFACE6; DROP TABLE ARRAYLIST_OF_SIMPLE_INTERFACE7; DROP TABLE ARRAYLIST_OF_SIMPLE_INTERFACE8; DROP TABLE ARRAYLIST_OF_STRING9; DROP TABLE ARRAYLIST_OF_STRING11; DROP TABLE ARRAYLIST_OF_DATE12; DROP TABLE ARRAYLIST_OF_DATE14; DROP TABLE ARRAYLIST_OF_LOCALE15; DROP TABLE ARRAYLIST_OF_LOCALE17; DROP TABLE ARRAYLIST_OF_BIG_DECIMAL18; DROP TABLE ARRAYLIST_OF_BIG_DECIMAL20; DROP TABLE ARRAYLIST_OF_BIG_INTEGER21; DROP TABLE ARRAYLIST_OF_BIG_INTEGER23; DROP TABLE ARRAYLIST_OF_BYTE24; DROP TABLE ARRAYLIST_OF_BYTE26; DROP TABLE ARRAYLIST_OF_DOUBLE27; DROP TABLE ARRAYLIST_OF_DOUBLE29; DROP TABLE ARRAYLIST_OF_FLOAT30; DROP TABLE ARRAYLIST_OF_FLOAT32; DROP TABLE ARRAYLIST_OF_INTEGER33; DROP TABLE ARRAYLIST_OF_INTEGER35; DROP TABLE ARRAYLIST_OF_LONG36; DROP TABLE ARRAYLIST_OF_LONG38; DROP TABLE ARRAYLIST_OF_SHORT39; DROP TABLE ARRAYLIST_OF_SHORT41; DROP TABLE ARRAYLIST_OF_SIMPLEENUM42; DROP TABLE ARRAYLIST_OF_SIMPLEENUM44; DROP TABLE ARRAYLIST_OF_SIMPLEENUM45; DROP TABLE ARRAYLIST_OF_SIMPLEENUM46; DROP TABLE ARRAYLIST_COLLECTIONS; DROP TABLE COLLECTION_OF_OBJECT0; DROP TABLE COLLECTION_OF_OBJECT1; DROP TABLE COLLECTION_OF_OBJECT2; DROP TABLE COLLECTION_OF_SIMPLE_CLASS3; DROP TABLE COLLECTION_OF_SIMPLE_CLASS4; DROP TABLE COLLECTION_OF_SIMPLE_CLASS5; DROP TABLE COLLECTION_OF_SIMPLE_INTERFACE6; DROP TABLE COLLECTION_OF_SIMPLE_INTERFACE7; DROP TABLE COLLECTION_OF_SIMPLE_INTERFACE8; DROP TABLE COLLECTION_OF_STRING9; DROP TABLE COLLECTION_OF_STRING10; DROP TABLE COLLECTION_OF_DATE12; DROP TABLE COLLECTION_OF_DATE13; DROP TABLE COLLECTION_OF_LOCALE15; DROP TABLE COLLECTION_OF_LOCALE16; DROP TABLE COLLECTION_OF_BIG_DECIMAL18; DROP TABLE COLLECTION_OF_BIG_DECIMAL19; DROP TABLE COLLECTION_OF_BIG_INTEGER21; DROP TABLE COLLECTION_OF_BIG_INTEGER22; DROP TABLE COLLECTION_OF_BYTE24; DROP TABLE COLLECTION_OF_BYTE25; DROP TABLE COLLECTION_OF_DOUBLE27; DROP TABLE COLLECTION_OF_DOUBLE28; DROP TABLE COLLECTION_OF_FLOAT30; DROP TABLE COLLECTION_OF_FLOAT31; DROP TABLE COLLECTION_OF_INTEGER33; DROP TABLE COLLECTION_OF_INTEGER34; DROP TABLE COLLECTION_OF_LONG36; DROP TABLE COLLECTION_OF_LONG37; DROP TABLE COLLECTION_OF_SHORT39; DROP TABLE COLLECTION_OF_SHORT40; DROP TABLE COLLECTION_COLLECTIONS; DROP TABLE LIST_OF_OBJECT0; DROP TABLE LIST_OF_OBJECT1; DROP TABLE LIST_OF_OBJECT2; DROP TABLE LIST_OF_SIMPLE_CLASS3; DROP TABLE LIST_OF_SIMPLE_CLASS4; DROP TABLE LIST_OF_SIMPLE_CLASS5; DROP TABLE LIST_OF_SIMPLE_INTERFACE6; DROP TABLE LIST_OF_SIMPLE_INTERFACE7; DROP TABLE LIST_OF_SIMPLE_INTERFACE8; DROP TABLE LIST_OF_STRING9; DROP TABLE LIST_OF_STRING10; DROP TABLE LIST_OF_DATE12; DROP TABLE LIST_OF_DATE13; DROP TABLE LIST_OF_LOCALE15; DROP TABLE LIST_OF_LOCALE16; DROP TABLE LIST_OF_BIG_DECIMAL18; DROP TABLE LIST_OF_BIG_DECIMAL19; DROP TABLE LIST_OF_BIG_INTEGER21; DROP TABLE LIST_OF_BIG_INTEGER22; DROP TABLE LIST_OF_BYTE24; DROP TABLE LIST_OF_BYTE25; DROP TABLE LIST_OF_DOUBLE27; DROP TABLE LIST_OF_DOUBLE28; DROP TABLE LIST_OF_FLOAT30; DROP TABLE LIST_OF_FLOAT31; DROP TABLE LIST_OF_INTEGER33; DROP TABLE LIST_OF_INTEGER34; DROP TABLE LIST_OF_LONG36; DROP TABLE LIST_OF_LONG37; DROP TABLE LIST_OF_SHORT39; DROP TABLE LIST_OF_SHORT40; DROP TABLE LIST_COLLECTIONS; DROP TABLE LINKEDLIST_OF_OBJECT0; DROP TABLE LINKEDLIST_OF_OBJECT1; DROP TABLE LINKEDLIST_OF_OBJECT2; DROP TABLE LINKEDLIST_OF_SIMPLE_CLASS3; DROP TABLE LINKEDLIST_OF_SIMPLE_CLASS4; DROP TABLE LINKEDLIST_OF_SIMPLE_CLASS5; DROP TABLE LINKEDLIST_OF_SIMPLE_INTERFACE6; DROP TABLE LINKEDLIST_OF_SIMPLE_INTERFACE7; DROP TABLE LINKEDLIST_OF_SIMPLE_INTERFACE8; DROP TABLE LINKEDLIST_OF_STRING9; DROP TABLE LINKEDLIST_OF_STRING10; DROP TABLE LINKEDLIST_OF_DATE12; DROP TABLE LINKEDLIST_OF_DATE13; DROP TABLE LINKEDLIST_OF_LOCALE15; DROP TABLE LINKEDLIST_OF_LOCALE16; DROP TABLE LINKEDLIST_OF_BIG_DECIMAL18; DROP TABLE LINKEDLIST_OF_BIG_DECIMAL19; DROP TABLE LINKEDLIST_OF_BIG_INTEGER21; DROP TABLE LINKEDLIST_OF_BIG_INTEGER22; DROP TABLE LINKEDLIST_OF_BYTE24; DROP TABLE LINKEDLIST_OF_BYTE25; DROP TABLE LINKEDLIST_OF_DOUBLE27; DROP TABLE LINKEDLIST_OF_DOUBLE28; DROP TABLE LINKEDLIST_OF_FLOAT30; DROP TABLE LINKEDLIST_OF_FLOAT31; DROP TABLE LINKEDLIST_OF_INTEGER33; DROP TABLE LINKEDLIST_OF_INTEGER34; DROP TABLE LINKEDLIST_OF_LONG36; DROP TABLE LINKEDLIST_OF_LONG37; DROP TABLE LINKEDLIST_OF_SHORT39; DROP TABLE LINKEDLIST_OF_SHORT40; DROP TABLE LINKEDLIST_COLLECTIONS; DROP TABLE VECTOR_OF_OBJECT0; DROP TABLE VECTOR_OF_OBJECT1; DROP TABLE VECTOR_OF_OBJECT2; DROP TABLE VECTOR_OF_SIMPLE_CLASS3; DROP TABLE VECTOR_OF_SIMPLE_CLASS4; DROP TABLE VECTOR_OF_SIMPLE_CLASS5; DROP TABLE VECTOR_OF_SIMPLE_INTERFACE6; DROP TABLE VECTOR_OF_SIMPLE_INTERFACE7; DROP TABLE VECTOR_OF_SIMPLE_INTERFACE8; DROP TABLE VECTOR_OF_STRING9; DROP TABLE VECTOR_OF_STRING10; DROP TABLE VECTOR_OF_DATE12; DROP TABLE VECTOR_OF_DATE13; DROP TABLE VECTOR_OF_LOCALE15; DROP TABLE VECTOR_OF_LOCALE16; DROP TABLE VECTOR_OF_BIG_DECIMAL18; DROP TABLE VECTOR_OF_BIG_DECIMAL19; DROP TABLE VECTOR_OF_BIG_INTEGER21; DROP TABLE VECTOR_OF_BIG_INTEGER22; DROP TABLE VECTOR_OF_BYTE24; DROP TABLE VECTOR_OF_BYTE25; DROP TABLE VECTOR_OF_DOUBLE27; DROP TABLE VECTOR_OF_DOUBLE28; DROP TABLE VECTOR_OF_FLOAT30; DROP TABLE VECTOR_OF_FLOAT31; DROP TABLE VECTOR_OF_INTEGER33; DROP TABLE VECTOR_OF_INTEGER34; DROP TABLE VECTOR_OF_LONG36; DROP TABLE VECTOR_OF_LONG37; DROP TABLE VECTOR_OF_SHORT39; DROP TABLE VECTOR_OF_SHORT40; DROP TABLE VECTOR_COLLECTIONS; DROP TABLE SET_OF_OBJECT0; DROP TABLE SET_OF_OBJECT1; DROP TABLE SET_OF_SIMPLE_CLASS3; DROP TABLE SET_OF_SIMPLE_CLASS4; DROP TABLE SET_OF_SIMPLE_INTERFACE6; DROP TABLE SET_OF_SIMPLE_INTERFACE7; DROP TABLE SET_OF_STRING9; DROP TABLE SET_OF_STRING10; DROP TABLE SET_OF_DATE12; DROP TABLE SET_OF_DATE13; DROP TABLE SET_OF_LOCALE15; DROP TABLE SET_OF_LOCALE16; DROP TABLE SET_OF_BIG_DECIMAL18; DROP TABLE SET_OF_BIG_DECIMAL19; DROP TABLE SET_OF_BIG_INTEGER21; DROP TABLE SET_OF_BIG_INTEGER22; DROP TABLE SET_OF_BYTE24; DROP TABLE SET_OF_BYTE25; DROP TABLE SET_OF_DOUBLE27; DROP TABLE SET_OF_DOUBLE28; DROP TABLE SET_OF_FLOAT30; DROP TABLE SET_OF_FLOAT31; DROP TABLE SET_OF_INTEGER33; DROP TABLE SET_OF_INTEGER34; DROP TABLE SET_OF_LONG36; DROP TABLE SET_OF_LONG37; DROP TABLE SET_OF_SHORT39; DROP TABLE SET_OF_SHORT40; DROP TABLE SET_COLLECTIONS; DROP TABLE HASHSET_OF_OBJECT0; DROP TABLE HASHSET_OF_OBJECT1; DROP TABLE HASHSET_OF_SIMPLE_CLASS3; DROP TABLE HASHSET_OF_SIMPLE_CLASS4; DROP TABLE HASHSET_OF_SIMPLE_INTERFACE6; DROP TABLE HASHSET_OF_SIMPLE_INTERFACE7; DROP TABLE HASHSET_OF_STRING9; DROP TABLE HASHSET_OF_STRING10; DROP TABLE HASHSET_OF_DATE12; DROP TABLE HASHSET_OF_DATE13; DROP TABLE HASHSET_OF_LOCALE15; DROP TABLE HASHSET_OF_LOCALE16; DROP TABLE HASHSET_OF_BIG_DECIMAL18; DROP TABLE HASHSET_OF_BIG_DECIMAL19; DROP TABLE HASHSET_OF_BIG_INTEGER21; DROP TABLE HASHSET_OF_BIG_INTEGER22; DROP TABLE HASHSET_OF_BYTE24; DROP TABLE HASHSET_OF_BYTE25; DROP TABLE HASHSET_OF_DOUBLE27; DROP TABLE HASHSET_OF_DOUBLE28; DROP TABLE HASHSET_OF_FLOAT30; DROP TABLE HASHSET_OF_FLOAT31; DROP TABLE HASHSET_OF_INTEGER33; DROP TABLE HASHSET_OF_INTEGER34; DROP TABLE HASHSET_OF_LONG36; DROP TABLE HASHSET_OF_LONG37; DROP TABLE HASHSET_OF_SHORT39; DROP TABLE HASHSET_OF_SHORT40; DROP TABLE HASHSET_COLLECTIONS; DROP TABLE TREESET_OF_OBJECT0; DROP TABLE TREESET_OF_OBJECT1; DROP TABLE TREESET_OF_OBJECT2; DROP TABLE TREESET_OF_SIMPLE_CLASS3; DROP TABLE TREESET_OF_SIMPLE_CLASS4; DROP TABLE TREESET_OF_SIMPLE_CLASS5; DROP TABLE TREESET_OF_SIMPLE_INTERFACE6; DROP TABLE TREESET_OF_SIMPLE_INTERFACE7; DROP TABLE TREESET_OF_SIMPLE_INTERFACE8; DROP TABLE TREESET_OF_STRING9; DROP TABLE TREESET_OF_STRING11; DROP TABLE TREESET_OF_DATE12; DROP TABLE TREESET_OF_DATE14; DROP TABLE TREESET_OF_BIG_DECIMAL15; DROP TABLE TREESET_OF_BIG_DECIMAL17; DROP TABLE TREESET_OF_BIG_INTEGER18; DROP TABLE TREESET_OF_BIG_INTEGER20; DROP TABLE TREESET_OF_BYTE21; DROP TABLE TREESET_OF_BYTE23; DROP TABLE TREESET_OF_DOUBLE24; DROP TABLE TREESET_OF_DOUBLE26; DROP TABLE TREESET_OF_FLOAT27; DROP TABLE TREESET_OF_FLOAT29; DROP TABLE TREESET_OF_INTEGER30; DROP TABLE TREESET_OF_INTEGER32; DROP TABLE TREESET_OF_LONG33; DROP TABLE TREESET_OF_LONG35; DROP TABLE TREESET_OF_SHORT36; DROP TABLE TREESET_OF_SHORT38; DROP TABLE TREESET_COLLECTIONS; DROP TABLE MAP_OF_STRING_OBJECT0; DROP TABLE MAP_OF_STRING_OBJECT1; DROP TABLE MAP_OF_STRING_OBJECT2; DROP TABLE MAP_OF_STRING_SIMPLE_CLASS3; DROP TABLE MAP_OF_STRING_SIMPLE_CLASS4; DROP TABLE MAP_OF_STRING_SIMPLE_CLASS5; DROP TABLE MAP_OF_STRING_SIMPLE_INTERFACE6; DROP TABLE MAP_OF_STRING_SIMPLE_INTERFACE7; DROP TABLE MAP_OF_STRING_SIMPLE_INTERFACE8; DROP TABLE MAP_OF_STRING_STRING9; DROP TABLE MAP_OF_STRING_STRING10; DROP TABLE MAP_OF_STRING_STRING11; DROP TABLE MAP_OF_STRING_DATE12; DROP TABLE MAP_OF_STRING_DATE13; DROP TABLE MAP_OF_STRING_DATE14; DROP TABLE MAP_OF_STRING_LOCALE15; DROP TABLE MAP_OF_STRING_LOCALE16; DROP TABLE MAP_OF_STRING_LOCALE17; DROP TABLE MAP_OF_STRING_BIG_DECIMAL18; DROP TABLE MAP_OF_STRING_BIG_DECIMAL19; DROP TABLE MAP_OF_STRING_BIG_DECIMAL20; DROP TABLE MAP_OF_STRING_BIG_INTEGER21; DROP TABLE MAP_OF_STRING_BIG_INTEGER22; DROP TABLE MAP_OF_STRING_BIG_INTEGER23; DROP TABLE MAP_OF_STRING_BYTE24; DROP TABLE MAP_OF_STRING_BYTE25; DROP TABLE MAP_OF_STRING_BYTE26; DROP TABLE MAP_OF_STRING_DOUBLE27; DROP TABLE MAP_OF_STRING_DOUBLE28; DROP TABLE MAP_OF_STRING_DOUBLE29; DROP TABLE MAP_OF_STRING_FLOAT30; DROP TABLE MAP_OF_STRING_FLOAT31; DROP TABLE MAP_OF_STRING_FLOAT32; DROP TABLE MAP_OF_STRING_INTEGER33; DROP TABLE MAP_OF_STRING_INTEGER34; DROP TABLE MAP_OF_STRING_INTEGER35; DROP TABLE MAP_OF_STRING_LONG36; DROP TABLE MAP_OF_STRING_LONG37; DROP TABLE MAP_OF_STRING_LONG38; DROP TABLE MAP_OF_STRING_SHORT39; DROP TABLE MAP_OF_STRING_SHORT40; DROP TABLE MAP_OF_STRING_SHORT41; DROP TABLE MAP_OF_STRING_OBJECT42; DROP TABLE MAP_OF_STRING_OBJECT43; DROP TABLE MAP_OF_STRING_SIMPLE_CLASS45; DROP TABLE MAP_OF_STRING_SIMPLE_CLASS46; DROP TABLE MAP_OF_STRING_SIMPLE_INTERFACE48; DROP TABLE MAP_OF_STRING_SIMPLE_INTERFACE49; DROP TABLE MAP_OF_STRING_STRING51; DROP TABLE MAP_OF_STRING_STRING52; DROP TABLE MAP_OF_STRING_DATE54; DROP TABLE MAP_OF_STRING_DATE55; DROP TABLE MAP_OF_STRING_LOCALE57; DROP TABLE MAP_OF_STRING_LOCALE58; DROP TABLE MAP_OF_STRING_BIG_DECIMAL60; DROP TABLE MAP_OF_STRING_BIG_DECIMAL61; DROP TABLE MAP_OF_STRING_BIG_INTEGER63; DROP TABLE MAP_OF_STRING_BIG_INTEGER64; DROP TABLE MAP_OF_STRING_BYTE66; DROP TABLE MAP_OF_STRING_BYTE67; DROP TABLE MAP_OF_STRING_DOUBLE69; DROP TABLE MAP_OF_STRING_DOUBLE70; DROP TABLE MAP_OF_STRING_FLOAT72; DROP TABLE MAP_OF_STRING_FLOAT73; DROP TABLE MAP_OF_STRING_INTEGER75; DROP TABLE MAP_OF_STRING_INTEGER76; DROP TABLE MAP_OF_STRING_LONG78; DROP TABLE MAP_OF_STRING_LONG79; DROP TABLE MAP_OF_STRING_SHORT81; DROP TABLE MAP_OF_STRING_SHORT82; DROP TABLE MAP_OF_STRING_OBJECT84; DROP TABLE MAP_OF_STRING_SIMPLE_CLASS87; DROP TABLE MAP_OF_STRING_SIMPLE_INTERFACE90; DROP TABLE MAP_OF_STRING_STRING93; DROP TABLE MAP_OF_STRING_DATE96; DROP TABLE MAP_OF_STRING_LOCALE99; DROP TABLE MAP_OF_STRING_BIG_DECIMAL102; DROP TABLE MAP_OF_STRING_BIG_INTEGER105; DROP TABLE MAP_OF_STRING_BYTE108; DROP TABLE MAP_OF_STRING_DOUBLE111; DROP TABLE MAP_OF_STRING_FLOAT114; DROP TABLE MAP_OF_STRING_INTEGER117; DROP TABLE MAP_OF_STRING_LONG120; DROP TABLE MAP_OF_STRING_SHORT123; DROP TABLE MAP_OF_STRING_SIMPLEENUM126; DROP TABLE MAP_OF_STRING_SIMPLEENUM127; DROP TABLE MAP_OF_STRING_SIMPLEENUM128; DROP TABLE MAP_OF_STRING_SIMPLEENUM129; DROP TABLE MAP_OF_STRING_SIMPLEENUM130; DROP TABLE MAP_OF_STRING_SIMPLEENUM131; DROP TABLE MAP_OF_STRING_SIMPLEENUM133; DROP TABLE MAP_OF_STRING_SIMPLEENUM134; DROP TABLE MAP_OF_STRING_SIMPLEENUM135; DROP TABLE MAP_OF_STRING_SIMPLEENUM136; DROP TABLE MAP_OF_STRING_SIMPLEENUM137; DROP TABLE MAP_OF_STRING_SIMPLEENUM138; DROP TABLE MAPSTRINGKEY_COLLECTIONS; DROP TABLE HASHMAP_STR_OBJECT0; DROP TABLE HASHMAP_STR_OBJECT1; DROP TABLE HASHMAP_STR_OBJECT2; DROP TABLE HASHMAP_STR_SIMPLE_CLASS3; DROP TABLE HASHMAP_STR_SIMPLE_CLASS4; DROP TABLE HASHMAP_STR_SIMPLE_CLASS5; DROP TABLE HASHMAP_STR_SIMPLE_INTERFACE6; DROP TABLE HASHMAP_STR_SIMPLE_INTERFACE7; DROP TABLE HASHMAP_STR_SIMPLE_INTERFACE8; DROP TABLE HASHMAP_STR_STRING9; DROP TABLE HASHMAP_STR_STRING10; DROP TABLE HASHMAP_STR_STRING11; DROP TABLE HASHMAP_STR_DATE12; DROP TABLE HASHMAP_STR_DATE13; DROP TABLE HASHMAP_STR_DATE14; DROP TABLE HASHMAP_STR_LOCALE15; DROP TABLE HASHMAP_STR_LOCALE16; DROP TABLE HASHMAP_STR_LOCALE17; DROP TABLE HASHMAP_STR_BIG_DECIMAL18; DROP TABLE HASHMAP_STR_BIG_DECIMAL19; DROP TABLE HASHMAP_STR_BIG_DECIMAL20; DROP TABLE HASHMAP_STR_BIG_INTEGER21; DROP TABLE HASHMAP_STR_BIG_INTEGER22; DROP TABLE HASHMAP_STR_BIG_INTEGER23; DROP TABLE HASHMAP_STR_BYTE24; DROP TABLE HASHMAP_STR_BYTE25; DROP TABLE HASHMAP_STR_BYTE26; DROP TABLE HASHMAP_STR_DOUBLE27; DROP TABLE HASHMAP_STR_DOUBLE28; DROP TABLE HASHMAP_STR_DOUBLE29; DROP TABLE HASHMAP_STR_FLOAT30; DROP TABLE HASHMAP_STR_FLOAT31; DROP TABLE HASHMAP_STR_FLOAT32; DROP TABLE HASHMAP_STR_INTEGER33; DROP TABLE HASHMAP_STR_INTEGER34; DROP TABLE HASHMAP_STR_INTEGER35; DROP TABLE HASHMAP_STR_LONG36; DROP TABLE HASHMAP_STR_LONG37; DROP TABLE HASHMAP_STR_LONG38; DROP TABLE HASHMAP_STR_SHORT39; DROP TABLE HASHMAP_STR_SHORT40; DROP TABLE HASHMAP_STR_SHORT41; DROP TABLE HASHMAP_STR_OBJECT42; DROP TABLE HASHMAP_STR_OBJECT43; DROP TABLE HASHMAP_STR_SIMPLE_CLASS45; DROP TABLE HASHMAP_STR_SIMPLE_CLASS46; DROP TABLE HASHMAP_STR_SIMPLE_INTERFACE48; DROP TABLE HASHMAP_STR_SIMPLE_INTERFACE49; DROP TABLE HASHMAP_STR_STRING51; DROP TABLE HASHMAP_STR_STRING52; DROP TABLE HASHMAP_STR_DATE54; DROP TABLE HASHMAP_STR_DATE55; DROP TABLE HASHMAP_STR_LOCALE57; DROP TABLE HASHMAP_STR_LOCALE58; DROP TABLE HASHMAP_STR_BIG_DECIMAL60; DROP TABLE HASHMAP_STR_BIG_DECIMAL61; DROP TABLE HASHMAP_STR_BIG_INTEGER63; DROP TABLE HASHMAP_STR_BIG_INTEGER64; DROP TABLE HASHMAP_STR_BYTE66; DROP TABLE HASHMAP_STR_BYTE67; DROP TABLE HASHMAP_STR_DOUBLE69; DROP TABLE HASHMAP_STR_DOUBLE70; DROP TABLE HASHMAP_STR_FLOAT72; DROP TABLE HASHMAP_STR_FLOAT73; DROP TABLE HASHMAP_STR_INTEGER75; DROP TABLE HASHMAP_STR_INTEGER76; DROP TABLE HASHMAP_STR_LONG78; DROP TABLE HASHMAP_STR_LONG79; DROP TABLE HASHMAP_STR_SHORT81; DROP TABLE HASHMAP_STR_SHORT82; DROP TABLE HASHMAP_STR_OBJECT84; DROP TABLE HASHMAP_STR_SIMPLE_CLASS87; DROP TABLE HASHMAP_STR_SIMPLE_INTERFACE90; DROP TABLE HASHMAP_STR_STRING93; DROP TABLE HASHMAP_STR_DATE96; DROP TABLE HASHMAP_STR_LOCALE99; DROP TABLE HASHMAP_STR_BIG_DECIMAL102; DROP TABLE HASHMAP_STR_BIG_INTEGER105; DROP TABLE HASHMAP_STR_BYTE108; DROP TABLE HASHMAP_STR_DOUBLE111; DROP TABLE HASHMAP_STR_FLOAT114; DROP TABLE HASHMAP_STR_INTEGER117; DROP TABLE HASHMAP_STR_LONG120; DROP TABLE HASHMAP_STR_SHORT123; DROP TABLE HASHMAPSTRINGKEY_COLLECTIONS; DROP TABLE MAP_OBJECT0_STR; DROP TABLE MAP_OBJECT1_STR; DROP TABLE MAP_OBJECT2_STR; DROP TABLE MAP_OBJECT3_STR; DROP TABLE MAP_OBJECT4_STR; DROP TABLE MAP_OBJECT6_STR; DROP TABLE MAP_SIMPLE_CLASS9_STR; DROP TABLE MAP_SIMPLE_CLASS10_STR; DROP TABLE MAP_SIMPLE_CLASS11_STR; DROP TABLE MAP_SIMPLE_CLASS12_STR; DROP TABLE MAP_SIMPLE_CLASS13_STR; DROP TABLE MAP_SIMPLE_CLASS15_STR; DROP TABLE MAP_SIMPLE_INTERFACE18_STR; DROP TABLE MAP_SIMPLE_INTERFACE19_STR; DROP TABLE MAP_SIMPLE_INTERFACE20_STR; DROP TABLE MAP_SIMPLE_INTERFACE21_STR; DROP TABLE MAP_SIMPLE_INTERFACE22_STR; DROP TABLE MAP_SIMPLE_INTERFACE24_STR; DROP TABLE MAP_STRING27_STR; DROP TABLE MAP_STRING28_STR; DROP TABLE MAP_STRING29_STR; DROP TABLE MAP_STRING30_STR; DROP TABLE MAP_STRING31_STR; DROP TABLE MAP_STRING33_STR; DROP TABLE MAP_DATE36_STR; DROP TABLE MAP_DATE37_STR; DROP TABLE MAP_DATE38_STR; DROP TABLE MAP_DATE39_STR; DROP TABLE MAP_DATE40_STR; DROP TABLE MAP_DATE42_STR; DROP TABLE MAP_BIG_DECIMAL45_STR; DROP TABLE MAP_BIG_DECIMAL46_STR; DROP TABLE MAP_BIG_DECIMAL47_STR; DROP TABLE MAP_BIG_DECIMAL48_STR; DROP TABLE MAP_BIG_DECIMAL49_STR; DROP TABLE MAP_BIG_DECIMAL51_STR; DROP TABLE MAP_BIG_INTEGER54_STR; DROP TABLE MAP_BIG_INTEGER55_STR; DROP TABLE MAP_BIG_INTEGER56_STR; DROP TABLE MAP_BIG_INTEGER57_STR; DROP TABLE MAP_BIG_INTEGER58_STR; DROP TABLE MAP_BIG_INTEGER60_STR; DROP TABLE MAP_BYTE63_STR; DROP TABLE MAP_BYTE64_STR; DROP TABLE MAP_BYTE65_STR; DROP TABLE MAP_BYTE66_STR; DROP TABLE MAP_BYTE67_STR; DROP TABLE MAP_BYTE69_STR; DROP TABLE MAP_DOUBLE72_STR; DROP TABLE MAP_DOUBLE73_STR; DROP TABLE MAP_DOUBLE74_STR; DROP TABLE MAP_DOUBLE75_STR; DROP TABLE MAP_DOUBLE76_STR; DROP TABLE MAP_DOUBLE78_STR; DROP TABLE MAP_FLOAT81_STR; DROP TABLE MAP_FLOAT82_STR; DROP TABLE MAP_FLOAT83_STR; DROP TABLE MAP_FLOAT84_STR; DROP TABLE MAP_FLOAT85_STR; DROP TABLE MAP_FLOAT87_STR; DROP TABLE MAP_INTEGER90_STR; DROP TABLE MAP_INTEGER91_STR; DROP TABLE MAP_INTEGER92_STR; DROP TABLE MAP_INTEGER93_STR; DROP TABLE MAP_INTEGER94_STR; DROP TABLE MAP_INTEGER96_STR; DROP TABLE MAP_LONG99_STR; DROP TABLE MAP_LONG100_STR; DROP TABLE MAP_LONG101_STR; DROP TABLE MAP_LONG102_STR; DROP TABLE MAP_LONG103_STR; DROP TABLE MAP_LONG105_STR; DROP TABLE MAP_SHORT108_STR; DROP TABLE MAP_SHORT109_STR; DROP TABLE MAP_SHORT110_STR; DROP TABLE MAP_SHORT111_STR; DROP TABLE MAP_SHORT112_STR; DROP TABLE MAP_SHORT114_STR; DROP TABLE MAP_SIMPLEENUM117_STR; DROP TABLE MAP_SIMPLEENUM118_STR; DROP TABLE MAP_SIMPLEENUM119_STR; DROP TABLE MAP_SIMPLEENUM120_STR; DROP TABLE MAP_SIMPLEENUM121_STR; DROP TABLE MAP_SIMPLEENUM122_STR; DROP TABLE MAP_SIMPLEENUM124_STR; DROP TABLE MAP_SIMPLEENUM125_STR; DROP TABLE MAP_SIMPLEENUM126_STR; DROP TABLE MAP_SIMPLEENUM127_STR; DROP TABLE MAP_SIMPLEENUM128_STR; DROP TABLE MAP_SIMPLEENUM129_STR; DROP TABLE MAPSTRINGVALUE_COLLECTIONS; DROP TABLE HASHTBL_STR_OBJECT0; DROP TABLE HASHTBL_STR_OBJECT1; DROP TABLE HASHTBL_STR_OBJECT2; DROP TABLE HASHTBL_STR_SIMPLE_CLASS3; DROP TABLE HASHTBL_STR_SIMPLE_CLASS4; DROP TABLE HASHTBL_STR_SIMPLE_CLASS5; DROP TABLE HASHTBL_STR_SIMPLE_INTERFACE6; DROP TABLE HASHTBL_STR_SIMPLE_INTERFACE7; DROP TABLE HASHTBL_STR_SIMPLE_INTERFACE8; DROP TABLE HASHTBL_STR_STRING9; DROP TABLE HASHTBL_STR_STRING10; DROP TABLE HASHTBL_STR_STRING11; DROP TABLE HASHTBL_STR_DATE12; DROP TABLE HASHTBL_STR_DATE13; DROP TABLE HASHTBL_STR_DATE14; DROP TABLE HASHTBL_STR_LOCALE15; DROP TABLE HASHTBL_STR_LOCALE16; DROP TABLE HASHTBL_STR_LOCALE17; DROP TABLE HASHTBL_STR_BIG_DECIMAL18; DROP TABLE HASHTBL_STR_BIG_DECIMAL19; DROP TABLE HASHTBL_STR_BIG_DECIMAL20; DROP TABLE HASHTBL_STR_BIG_INTEGER21; DROP TABLE HASHTBL_STR_BIG_INTEGER22; DROP TABLE HASHTBL_STR_BIG_INTEGER23; DROP TABLE HASHTBL_STR_BYTE24; DROP TABLE HASHTBL_STR_BYTE25; DROP TABLE HASHTBL_STR_BYTE26; DROP TABLE HASHTBL_STR_DOUBLE27; DROP TABLE HASHTBL_STR_DOUBLE28; DROP TABLE HASHTBL_STR_DOUBLE29; DROP TABLE HASHTBL_STR_FLOAT30; DROP TABLE HASHTBL_STR_FLOAT31; DROP TABLE HASHTBL_STR_FLOAT32; DROP TABLE HASHTBL_STR_INTEGER33; DROP TABLE HASHTBL_STR_INTEGER34; DROP TABLE HASHTBL_STR_INTEGER35; DROP TABLE HASHTBL_STR_LONG36; DROP TABLE HASHTBL_STR_LONG37; DROP TABLE HASHTBL_STR_LONG38; DROP TABLE HASHTBL_STR_SHORT39; DROP TABLE HASHTBL_STR_SHORT40; DROP TABLE HASHTBL_STR_SHORT41; DROP TABLE HASHTBL_STR_OBJECT42; DROP TABLE HASHTBL_STR_OBJECT43; DROP TABLE HASHTBL_STR_SIMPLE_CLASS45; DROP TABLE HASHTBL_STR_SIMPLE_CLASS46; DROP TABLE HASHTBL_STR_SIMPLE_INTERFACE48; DROP TABLE HASHTBL_STR_SIMPLE_INTERFACE49; DROP TABLE HASHTBL_STR_STRING51; DROP TABLE HASHTBL_STR_STRING52; DROP TABLE HASHTBL_STR_DATE54; DROP TABLE HASHTBL_STR_DATE55; DROP TABLE HASHTBL_STR_LOCALE57; DROP TABLE HASHTBL_STR_LOCALE58; DROP TABLE HASHTBL_STR_BIG_DECIMAL60; DROP TABLE HASHTBL_STR_BIG_DECIMAL61; DROP TABLE HASHTBL_STR_BIG_INTEGER63; DROP TABLE HASHTBL_STR_BIG_INTEGER64; DROP TABLE HASHTBL_STR_BYTE66; DROP TABLE HASHTBL_STR_BYTE67; DROP TABLE HASHTBL_STR_DOUBLE69; DROP TABLE HASHTBL_STR_DOUBLE70; DROP TABLE HASHTBL_STR_FLOAT72; DROP TABLE HASHTBL_STR_FLOAT73; DROP TABLE HASHTBL_STR_INTEGER75; DROP TABLE HASHTBL_STR_INTEGER76; DROP TABLE HASHTBL_STR_LONG78; DROP TABLE HASHTBL_STR_LONG79; DROP TABLE HASHTBL_STR_SHORT81; DROP TABLE HASHTBL_STR_SHORT82; DROP TABLE HASHTBL_STR_OBJECT84; DROP TABLE HASHTBL_STR_SIMPLE_CLASS87; DROP TABLE HASHTBL_STR_SIMPLE_INTERFACE90; DROP TABLE HASHTBL_STR_STRING93; DROP TABLE HASHTBL_STR_DATE96; DROP TABLE HASHTBL_STR_LOCALE99; DROP TABLE HASHTBL_STR_BIG_DECIMAL102; DROP TABLE HASHTBL_STR_BIG_INTEGER105; DROP TABLE HASHTBL_STR_BYTE108; DROP TABLE HASHTBL_STR_DOUBLE111; DROP TABLE HASHTBL_STR_FLOAT114; DROP TABLE HASHTBL_STR_INTEGER117; DROP TABLE HASHTBL_STR_LONG120; DROP TABLE HASHTBL_STR_SHORT123; DROP TABLE HASHTABLESTRINGKEY_COLLECTIONS; DROP TABLE TREEMAP_STR_OBJECT0; DROP TABLE TREEMAP_STR_OBJECT1; DROP TABLE TREEMAP_STR_OBJECT2; DROP TABLE TREEMAP_STR_SIMPLE_CLASS3; DROP TABLE TREEMAP_STR_SIMPLE_CLASS4; DROP TABLE TREEMAP_STR_SIMPLE_CLASS5; DROP TABLE TREEMAP_STR_SIMPLE_INTERFACE6; DROP TABLE TREEMAP_STR_SIMPLE_INTERFACE7; DROP TABLE TREEMAP_STR_SIMPLE_INTERFACE8; DROP TABLE TREEMAP_STR_STRING9; DROP TABLE TREEMAP_STR_STRING10; DROP TABLE TREEMAP_STR_STRING11; DROP TABLE TREEMAP_STR_DATE12; DROP TABLE TREEMAP_STR_DATE13; DROP TABLE TREEMAP_STR_DATE14; DROP TABLE TREEMAP_STR_LOCALE15; DROP TABLE TREEMAP_STR_LOCALE16; DROP TABLE TREEMAP_STR_LOCALE17; DROP TABLE TREEMAP_STR_BIG_DECIMAL18; DROP TABLE TREEMAP_STR_BIG_DECIMAL19; DROP TABLE TREEMAP_STR_BIG_DECIMAL20; DROP TABLE TREEMAP_STR_BIG_INTEGER21; DROP TABLE TREEMAP_STR_BIG_INTEGER22; DROP TABLE TREEMAP_STR_BIG_INTEGER23; DROP TABLE TREEMAP_STR_BYTE24; DROP TABLE TREEMAP_STR_BYTE25; DROP TABLE TREEMAP_STR_BYTE26; DROP TABLE TREEMAP_STR_DOUBLE27; DROP TABLE TREEMAP_STR_DOUBLE28; DROP TABLE TREEMAP_STR_DOUBLE29; DROP TABLE TREEMAP_STR_FLOAT30; DROP TABLE TREEMAP_STR_FLOAT31; DROP TABLE TREEMAP_STR_FLOAT32; DROP TABLE TREEMAP_STR_INTEGER33; DROP TABLE TREEMAP_STR_INTEGER34; DROP TABLE TREEMAP_STR_INTEGER35; DROP TABLE TREEMAP_STR_LONG36; DROP TABLE TREEMAP_STR_LONG37; DROP TABLE TREEMAP_STR_LONG38; DROP TABLE TREEMAP_STR_SHORT39; DROP TABLE TREEMAP_STR_SHORT40; DROP TABLE TREEMAP_STR_SHORT41; DROP TABLE TREEMAP_STR_OBJECT42; DROP TABLE TREEMAP_STR_OBJECT43; DROP TABLE TREEMAP_STR_SIMPLE_CLASS45; DROP TABLE TREEMAP_STR_SIMPLE_CLASS46; DROP TABLE TREEMAP_STR_SIMPLE_INTERFACE48; DROP TABLE TREEMAP_STR_SIMPLE_INTERFACE49; DROP TABLE TREEMAP_STR_STRING51; DROP TABLE TREEMAP_STR_STRING52; DROP TABLE TREEMAP_STR_DATE54; DROP TABLE TREEMAP_STR_DATE55; DROP TABLE TREEMAP_STR_LOCALE57; DROP TABLE TREEMAP_STR_LOCALE58; DROP TABLE TREEMAP_STR_BIG_DECIMAL60; DROP TABLE TREEMAP_STR_BIG_DECIMAL61; DROP TABLE TREEMAP_STR_BIG_INTEGER63; DROP TABLE TREEMAP_STR_BIG_INTEGER64; DROP TABLE TREEMAP_STR_BYTE66; DROP TABLE TREEMAP_STR_BYTE67; DROP TABLE TREEMAP_STR_DOUBLE69; DROP TABLE TREEMAP_STR_DOUBLE70; DROP TABLE TREEMAP_STR_FLOAT72; DROP TABLE TREEMAP_STR_FLOAT73; DROP TABLE TREEMAP_STR_INTEGER75; DROP TABLE TREEMAP_STR_INTEGER76; DROP TABLE TREEMAP_STR_LONG78; DROP TABLE TREEMAP_STR_LONG79; DROP TABLE TREEMAP_STR_SHORT81; DROP TABLE TREEMAP_STR_SHORT82; DROP TABLE TREEMAP_STR_OBJECT84; DROP TABLE TREEMAP_STR_SIMPLE_CLASS87; DROP TABLE TREEMAP_STR_SIMPLE_INTERFACE90; DROP TABLE TREEMAP_STR_STRING93; DROP TABLE TREEMAP_STR_DATE96; DROP TABLE TREEMAP_STR_LOCALE99; DROP TABLE TREEMAP_STR_BIG_DECIMAL102; DROP TABLE TREEMAP_STR_BIG_INTEGER105; DROP TABLE TREEMAP_STR_BYTE108; DROP TABLE TREEMAP_STR_DOUBLE111; DROP TABLE TREEMAP_STR_FLOAT114; DROP TABLE TREEMAP_STR_INTEGER117; DROP TABLE TREEMAP_STR_LONG120; DROP TABLE TREEMAP_STR_SHORT123; DROP TABLE TREEMAPSTRINGKEY_COLLECTIONS; DROP TABLE HASHMAP_OBJECT0_STR; DROP TABLE HASHMAP_OBJECT1_STR; DROP TABLE HASHMAP_OBJECT2_STR; DROP TABLE HASHMAP_OBJECT3_STR; DROP TABLE HASHMAP_OBJECT4_STR; DROP TABLE HASHMAP_OBJECT6_STR; DROP TABLE HASHMAP_SIMPLE_CLASS9_STR; DROP TABLE HASHMAP_SIMPLE_CLASS10_STR; DROP TABLE HASHMAP_SIMPLE_CLASS11_STR; DROP TABLE HASHMAP_SIMPLE_CLASS12_STR; DROP TABLE HASHMAP_SIMPLE_CLASS13_STR; DROP TABLE HASHMAP_SIMPLE_CLASS15_STR; DROP TABLE HASHMAP_SIMPLE_INTERFACE18_STR; DROP TABLE HASHMAP_SIMPLE_INTERFACE19_STR; DROP TABLE HASHMAP_SIMPLE_INTERFACE20_STR; DROP TABLE HASHMAP_SIMPLE_INTERFACE21_STR; DROP TABLE HASHMAP_SIMPLE_INTERFACE22_STR; DROP TABLE HASHMAP_SIMPLE_INTERFACE24_STR; DROP TABLE HASHMAP_STRING27_STR; DROP TABLE HASHMAP_STRING28_STR; DROP TABLE HASHMAP_STRING29_STR; DROP TABLE HASHMAP_STRING30_STR; DROP TABLE HASHMAP_STRING31_STR; DROP TABLE HASHMAP_STRING33_STR; DROP TABLE HASHMAP_DATE36_STR; DROP TABLE HASHMAP_DATE37_STR; DROP TABLE HASHMAP_DATE38_STR; DROP TABLE HASHMAP_DATE39_STR; DROP TABLE HASHMAP_DATE40_STR; DROP TABLE HASHMAP_DATE42_STR; DROP TABLE HASHMAP_BIG_DECIMAL45_STR; DROP TABLE HASHMAP_BIG_DECIMAL46_STR; DROP TABLE HASHMAP_BIG_DECIMAL47_STR; DROP TABLE HASHMAP_BIG_DECIMAL48_STR; DROP TABLE HASHMAP_BIG_DECIMAL49_STR; DROP TABLE HASHMAP_BIG_DECIMAL51_STR; DROP TABLE HASHMAP_BIG_INTEGER54_STR; DROP TABLE HASHMAP_BIG_INTEGER55_STR; DROP TABLE HASHMAP_BIG_INTEGER56_STR; DROP TABLE HASHMAP_BIG_INTEGER57_STR; DROP TABLE HASHMAP_BIG_INTEGER58_STR; DROP TABLE HASHMAP_BIG_INTEGER60_STR; DROP TABLE HASHMAP_BYTE63_STR; DROP TABLE HASHMAP_BYTE64_STR; DROP TABLE HASHMAP_BYTE65_STR; DROP TABLE HASHMAP_BYTE66_STR; DROP TABLE HASHMAP_BYTE67_STR; DROP TABLE HASHMAP_BYTE69_STR; DROP TABLE HASHMAP_DOUBLE72_STR; DROP TABLE HASHMAP_DOUBLE73_STR; DROP TABLE HASHMAP_DOUBLE74_STR; DROP TABLE HASHMAP_DOUBLE75_STR; DROP TABLE HASHMAP_DOUBLE76_STR; DROP TABLE HASHMAP_DOUBLE78_STR; DROP TABLE HASHMAP_FLOAT81_STR; DROP TABLE HASHMAP_FLOAT82_STR; DROP TABLE HASHMAP_FLOAT83_STR; DROP TABLE HASHMAP_FLOAT84_STR; DROP TABLE HASHMAP_FLOAT85_STR; DROP TABLE HASHMAP_FLOAT87_STR; DROP TABLE HASHMAP_INTEGER90_STR; DROP TABLE HASHMAP_INTEGER91_STR; DROP TABLE HASHMAP_INTEGER92_STR; DROP TABLE HASHMAP_INTEGER93_STR; DROP TABLE HASHMAP_INTEGER94_STR; DROP TABLE HASHMAP_INTEGER96_STR; DROP TABLE HASHMAP_LONG99_STR; DROP TABLE HASHMAP_LONG100_STR; DROP TABLE HASHMAP_LONG101_STR; DROP TABLE HASHMAP_LONG102_STR; DROP TABLE HASHMAP_LONG103_STR; DROP TABLE HASHMAP_LONG105_STR; DROP TABLE HASHMAP_SHORT108_STR; DROP TABLE HASHMAP_SHORT109_STR; DROP TABLE HASHMAP_SHORT110_STR; DROP TABLE HASHMAP_SHORT111_STR; DROP TABLE HASHMAP_SHORT112_STR; DROP TABLE HASHMAP_SHORT114_STR; DROP TABLE HASHMAPSTRINGVALUE_COLLECTIONS; DROP TABLE HASHTBL_OBJECT0_STR; DROP TABLE HASHTBL_OBJECT1_STR; DROP TABLE HASHTBL_OBJECT2_STR; DROP TABLE HASHTBL_OBJECT3_STR; DROP TABLE HASHTBL_OBJECT4_STR; DROP TABLE HASHTBL_OBJECT6_STR; DROP TABLE HASHTBL_SIMPLE_CLASS9_STR; DROP TABLE HASHTBL_SIMPLE_CLASS10_STR; DROP TABLE HASHTBL_SIMPLE_CLASS11_STR; DROP TABLE HASHTBL_SIMPLE_CLASS12_STR; DROP TABLE HASHTBL_SIMPLE_CLASS13_STR; DROP TABLE HASHTBL_SIMPLE_CLASS15_STR; DROP TABLE HASHTBL_SIMPLE_INTERFACE18_STR; DROP TABLE HASHTBL_SIMPLE_INTERFACE19_STR; DROP TABLE HASHTBL_SIMPLE_INTERFACE20_STR; DROP TABLE HASHTBL_SIMPLE_INTERFACE21_STR; DROP TABLE HASHTBL_SIMPLE_INTERFACE22_STR; DROP TABLE HASHTBL_SIMPLE_INTERFACE24_STR; DROP TABLE HASHTBL_STRING27_STR; DROP TABLE HASHTBL_STRING28_STR; DROP TABLE HASHTBL_STRING29_STR; DROP TABLE HASHTBL_STRING30_STR; DROP TABLE HASHTBL_STRING31_STR; DROP TABLE HASHTBL_STRING33_STR; DROP TABLE HASHTBL_DATE36_STR; DROP TABLE HASHTBL_DATE37_STR; DROP TABLE HASHTBL_DATE38_STR; DROP TABLE HASHTBL_DATE39_STR; DROP TABLE HASHTBL_DATE40_STR; DROP TABLE HASHTBL_DATE42_STR; DROP TABLE HASHTBL_BIG_DECIMAL45_STR; DROP TABLE HASHTBL_BIG_DECIMAL46_STR; DROP TABLE HASHTBL_BIG_DECIMAL47_STR; DROP TABLE HASHTBL_BIG_DECIMAL48_STR; DROP TABLE HASHTBL_BIG_DECIMAL49_STR; DROP TABLE HASHTBL_BIG_DECIMAL51_STR; DROP TABLE HASHTBL_BIG_INTEGER54_STR; DROP TABLE HASHTBL_BIG_INTEGER55_STR; DROP TABLE HASHTBL_BIG_INTEGER56_STR; DROP TABLE HASHTBL_BIG_INTEGER57_STR; DROP TABLE HASHTBL_BIG_INTEGER58_STR; DROP TABLE HASHTBL_BIG_INTEGER60_STR; DROP TABLE HASHTBL_BYTE63_STR; DROP TABLE HASHTBL_BYTE64_STR; DROP TABLE HASHTBL_BYTE65_STR; DROP TABLE HASHTBL_BYTE66_STR; DROP TABLE HASHTBL_BYTE67_STR; DROP TABLE HASHTBL_BYTE69_STR; DROP TABLE HASHTBL_DOUBLE72_STR; DROP TABLE HASHTBL_DOUBLE73_STR; DROP TABLE HASHTBL_DOUBLE74_STR; DROP TABLE HASHTBL_DOUBLE75_STR; DROP TABLE HASHTBL_DOUBLE76_STR; DROP TABLE HASHTBL_DOUBLE78_STR; DROP TABLE HASHTBL_FLOAT81_STR; DROP TABLE HASHTBL_FLOAT82_STR; DROP TABLE HASHTBL_FLOAT83_STR; DROP TABLE HASHTBL_FLOAT84_STR; DROP TABLE HASHTBL_FLOAT85_STR; DROP TABLE HASHTBL_FLOAT87_STR; DROP TABLE HASHTBL_INTEGER90_STR; DROP TABLE HASHTBL_INTEGER91_STR; DROP TABLE HASHTBL_INTEGER92_STR; DROP TABLE HASHTBL_INTEGER93_STR; DROP TABLE HASHTBL_INTEGER94_STR; DROP TABLE HASHTBL_INTEGER96_STR; DROP TABLE HASHTBL_LONG99_STR; DROP TABLE HASHTBL_LONG100_STR; DROP TABLE HASHTBL_LONG101_STR; DROP TABLE HASHTBL_LONG102_STR; DROP TABLE HASHTBL_LONG103_STR; DROP TABLE HASHTBL_LONG105_STR; DROP TABLE HASHTBL_SHORT108_STR; DROP TABLE HASHTBL_SHORT109_STR; DROP TABLE HASHTBL_SHORT110_STR; DROP TABLE HASHTBL_SHORT111_STR; DROP TABLE HASHTBL_SHORT112_STR; DROP TABLE HASHTBL_SHORT114_STR; DROP TABLE HASHTBLSTRINGVALUE_COLLECTIONS; DROP TABLE TREEMAP_OBJECT0_STR; DROP TABLE TREEMAP_OBJECT1_STR; DROP TABLE TREEMAP_OBJECT2_STR; DROP TABLE TREEMAP_OBJECT3_STR; DROP TABLE TREEMAP_OBJECT4_STR; DROP TABLE TREEMAP_OBJECT6_STR; DROP TABLE TREEMAP_SIMPLE_CLASS9_STR; DROP TABLE TREEMAP_SIMPLE_CLASS10_STR; DROP TABLE TREEMAP_SIMPLE_CLASS11_STR; DROP TABLE TREEMAP_SIMPLE_CLASS12_STR; DROP TABLE TREEMAP_SIMPLE_CLASS13_STR; DROP TABLE TREEMAP_SIMPLE_CLASS15_STR; DROP TABLE TREEMAP_SIMPLE_INTERFACE18_STR; DROP TABLE TREEMAP_SIMPLE_INTERFACE19_STR; DROP TABLE TREEMAP_SIMPLE_INTERFACE20_STR; DROP TABLE TREEMAP_SIMPLE_INTERFACE21_STR; DROP TABLE TREEMAP_SIMPLE_INTERFACE22_STR; DROP TABLE TREEMAP_SIMPLE_INTERFACE24_STR; DROP TABLE TREEMAP_STRING27_STR; DROP TABLE TREEMAP_STRING28_STR; DROP TABLE TREEMAP_STRING29_STR; DROP TABLE TREEMAP_STRING30_STR; DROP TABLE TREEMAP_STRING31_STR; DROP TABLE TREEMAP_STRING33_STR; DROP TABLE TREEMAP_DATE36_STR; DROP TABLE TREEMAP_DATE37_STR; DROP TABLE TREEMAP_DATE38_STR; DROP TABLE TREEMAP_DATE39_STR; DROP TABLE TREEMAP_DATE40_STR; DROP TABLE TREEMAP_DATE42_STR; DROP TABLE TREEMAP_BIG_DECIMAL45_STR; DROP TABLE TREEMAP_BIG_DECIMAL46_STR; DROP TABLE TREEMAP_BIG_DECIMAL47_STR; DROP TABLE TREEMAP_BIG_DECIMAL48_STR; DROP TABLE TREEMAP_BIG_DECIMAL49_STR; DROP TABLE TREEMAP_BIG_DECIMAL51_STR; DROP TABLE TREEMAP_BIG_INTEGER54_STR; DROP TABLE TREEMAP_BIG_INTEGER55_STR; DROP TABLE TREEMAP_BIG_INTEGER56_STR; DROP TABLE TREEMAP_BIG_INTEGER57_STR; DROP TABLE TREEMAP_BIG_INTEGER58_STR; DROP TABLE TREEMAP_BIG_INTEGER60_STR; DROP TABLE TREEMAP_BYTE63_STR; DROP TABLE TREEMAP_BYTE64_STR; DROP TABLE TREEMAP_BYTE65_STR; DROP TABLE TREEMAP_BYTE66_STR; DROP TABLE TREEMAP_BYTE67_STR; DROP TABLE TREEMAP_BYTE69_STR; DROP TABLE TREEMAP_DOUBLE72_STR; DROP TABLE TREEMAP_DOUBLE73_STR; DROP TABLE TREEMAP_DOUBLE74_STR; DROP TABLE TREEMAP_DOUBLE75_STR; DROP TABLE TREEMAP_DOUBLE76_STR; DROP TABLE TREEMAP_DOUBLE78_STR; DROP TABLE TREEMAP_FLOAT81_STR; DROP TABLE TREEMAP_FLOAT82_STR; DROP TABLE TREEMAP_FLOAT83_STR; DROP TABLE TREEMAP_FLOAT84_STR; DROP TABLE TREEMAP_FLOAT85_STR; DROP TABLE TREEMAP_FLOAT87_STR; DROP TABLE TREEMAP_INTEGER90_STR; DROP TABLE TREEMAP_INTEGER91_STR; DROP TABLE TREEMAP_INTEGER92_STR; DROP TABLE TREEMAP_INTEGER93_STR; DROP TABLE TREEMAP_INTEGER94_STR; DROP TABLE TREEMAP_INTEGER96_STR; DROP TABLE TREEMAP_LONG99_STR; DROP TABLE TREEMAP_LONG100_STR; DROP TABLE TREEMAP_LONG101_STR; DROP TABLE TREEMAP_LONG102_STR; DROP TABLE TREEMAP_LONG103_STR; DROP TABLE TREEMAP_LONG105_STR; DROP TABLE TREEMAP_SHORT108_STR; DROP TABLE TREEMAP_SHORT109_STR; DROP TABLE TREEMAP_SHORT110_STR; DROP TABLE TREEMAP_SHORT111_STR; DROP TABLE TREEMAP_SHORT112_STR; DROP TABLE TREEMAP_SHORT114_STR; DROP TABLE TREEMAPSTRINGVALUE_COLLECTIONS; DROP TABLE FIELDSOFSIMPLECLASS; DROP TABLE ALLTYPES; DROP TABLE FIELDSOFBYTE; DROP TABLE FIELDSOFBIGDECIMAL; DROP TABLE FIELDSOFBIGINTEGER; DROP TABLE FIELDSOFBOOLEAN; DROP TABLE FIELDSOFCHARACTER; DROP TABLE FIELDSOFDATE; DROP TABLE FIELDSOFDOUBLE; DROP TABLE FIELDSOFENUMNAME; DROP TABLE FIELDSOFFLOAT; DROP TABLE FIELDSOFINTEGER; DROP TABLE FIELDSOFLOCALE; DROP TABLE FIELDSOFLONG; DROP TABLE FIELDSOFOBJECT; DROP TABLE FIELDSOFSIMPLEINTERFACE; DROP TABLE FIELDSOFPRIMITIVEBOOLEAN; DROP TABLE FIELDSOFPRIMITIVEBYTE; DROP TABLE FIELDSOFPRIMITIVECHAR; DROP TABLE FIELDSOFPRIMITIVEDOUBLE; DROP TABLE FIELDSOFPRIMITIVEFLOAT; DROP TABLE FIELDSOFPRIMITIVEINT; DROP TABLE FIELDSOFPRIMITIVELONG; DROP TABLE FIELDSOFPRIMITIVESHORT; DROP TABLE FIELDSOFSHORT; DROP TABLE FIELDSOFSTRING; DROP TABLE SIMPLE_CLASS; CREATE TABLE SIMPLE_CLASS ( DATASTORE_IDENTITY BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY, IDENTIFIER BIGINT, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL, CONSTRAINT SIMPLE_CLASS_PK PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE ALLTYPES ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, ID INTEGER, PRIMITIVEBOOLEAN CHAR(1)CHECK (PRIMITIVEBOOLEAN IN ('Y','N')), PRIMITIVEBYTE SMALLINT, PRIMITIVECHAR INTEGER, PRIMITIVEDOUBLE DOUBLE, PRIMITIVEFLOAT REAL, PRIMITIVEINT INTEGER, PRIMITIVELONG BIGINT, PRIMITIVESHORT SMALLINT, BOOLEANVAL CHAR(1)CHECK (BOOLEANVAL IN ('Y','N')), BYTEVAL SMALLINT, CHARACTERVAL INTEGER, DOUBLEVAL DOUBLE, FLOATVAL REAL, INTEGERVAL INTEGER, LONGVAL BIGINT, SHORTVAL SMALLINT, STRINGVAL VARCHAR(255), LOCALEVAL CHAR(20), DATEVAL TIMESTAMP, BIGDECIMALVAL DECIMAL(25,10), BIGINTEGERVAL NUMERIC(31) ); ALTER TABLE ALLTYPES ADD CONSTRAINT ALLTYPES_PK PRIMARY KEY (DATASTORE_IDENTITY); CREATE TABLE FIELDSOFBIGDECIMAL ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, IDENTIFIER INTEGER, BIG_DECIMAL0 DECIMAL(27,16), BIG_DECIMAL1 DECIMAL(27,16), BIG_DECIMAL102 DECIMAL(27,16), BIG_DECIMAL103 DECIMAL(27,16), BIG_DECIMAL104 DECIMAL(27,16), BIG_DECIMAL108 DECIMAL(27,16), BIG_DECIMAL109 DECIMAL(27,16), BIG_DECIMAL11 DECIMAL(27,16), BIG_DECIMAL110 DECIMAL(27,16), BIG_DECIMAL112 DECIMAL(27,16), BIG_DECIMAL113 DECIMAL(27,16), BIG_DECIMAL114 DECIMAL(27,16), BIG_DECIMAL119 DECIMAL(27,16), BIG_DECIMAL12 DECIMAL(27,16), BIG_DECIMAL120 DECIMAL(27,16), BIG_DECIMAL121 DECIMAL(27,16), BIG_DECIMAL124 DECIMAL(27,16), BIG_DECIMAL125 DECIMAL(27,16), BIG_DECIMAL126 DECIMAL(27,16), BIG_DECIMAL128 DECIMAL(27,16), BIG_DECIMAL129 DECIMAL(27,16), BIG_DECIMAL13 DECIMAL(27,16), BIG_DECIMAL130 DECIMAL(27,16), BIG_DECIMAL138 DECIMAL(27,16), BIG_DECIMAL139 DECIMAL(27,16), BIG_DECIMAL140 DECIMAL(27,16), BIG_DECIMAL16 DECIMAL(27,16), BIG_DECIMAL17 DECIMAL(27,16), BIG_DECIMAL18 DECIMAL(27,16), BIG_DECIMAL2 DECIMAL(27,16), BIG_DECIMAL20 DECIMAL(27,16), BIG_DECIMAL21 DECIMAL(27,16), BIG_DECIMAL22 DECIMAL(27,16), BIG_DECIMAL30 DECIMAL(27,16), BIG_DECIMAL31 DECIMAL(27,16), BIG_DECIMAL32 DECIMAL(27,16), BIG_DECIMAL36 DECIMAL(27,16), BIG_DECIMAL37 DECIMAL(27,16), BIG_DECIMAL38 DECIMAL(27,16), BIG_DECIMAL4 DECIMAL(27,16), BIG_DECIMAL40 DECIMAL(27,16), BIG_DECIMAL41 DECIMAL(27,16), BIG_DECIMAL42 DECIMAL(27,16), BIG_DECIMAL47 DECIMAL(27,16), BIG_DECIMAL48 DECIMAL(27,16), BIG_DECIMAL49 DECIMAL(27,16), BIG_DECIMAL5 DECIMAL(27,16), BIG_DECIMAL52 DECIMAL(27,16), BIG_DECIMAL53 DECIMAL(27,16), BIG_DECIMAL54 DECIMAL(27,16), BIG_DECIMAL56 DECIMAL(27,16), BIG_DECIMAL57 DECIMAL(27,16), BIG_DECIMAL58 DECIMAL(27,16), BIG_DECIMAL6 DECIMAL(27,16), BIG_DECIMAL66 DECIMAL(27,16), BIG_DECIMAL67 DECIMAL(27,16), BIG_DECIMAL68 DECIMAL(27,16), BIG_DECIMAL72 DECIMAL(27,16), BIG_DECIMAL73 DECIMAL(27,16), BIG_DECIMAL74 DECIMAL(27,16), BIG_DECIMAL76 DECIMAL(27,16), BIG_DECIMAL77 DECIMAL(27,16), BIG_DECIMAL78 DECIMAL(27,16), BIG_DECIMAL83 DECIMAL(27,16), BIG_DECIMAL84 DECIMAL(27,16), BIG_DECIMAL85 DECIMAL(27,16), BIG_DECIMAL88 DECIMAL(27,16), BIG_DECIMAL89 DECIMAL(27,16), BIG_DECIMAL90 DECIMAL(27,16), BIG_DECIMAL92 DECIMAL(27,16), BIG_DECIMAL93 DECIMAL(27,16), BIG_DECIMAL94 DECIMAL(27,16) ); ALTER TABLE FIELDSOFBIGDECIMAL ADD CONSTRAINT FIELDSOFBIGDPP_PK PRIMARY KEY (DATASTORE_IDENTITY); CREATE TABLE FIELDSOFBIGINTEGER ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, IDENTIFIER INTEGER, BIG_INTEGER0 NUMERIC(31), BIG_INTEGER1 NUMERIC(31), BIG_INTEGER102 NUMERIC(31), BIG_INTEGER103 NUMERIC(31), BIG_INTEGER104 NUMERIC(31), BIG_INTEGER108 NUMERIC(31), BIG_INTEGER109 NUMERIC(31), BIG_INTEGER11 NUMERIC(31), BIG_INTEGER110 NUMERIC(31), BIG_INTEGER112 NUMERIC(31), BIG_INTEGER113 NUMERIC(31), BIG_INTEGER114 NUMERIC(31), BIG_INTEGER119 NUMERIC(31), BIG_INTEGER12 NUMERIC(31), BIG_INTEGER120 NUMERIC(31), BIG_INTEGER121 NUMERIC(31), BIG_INTEGER124 NUMERIC(31), BIG_INTEGER125 NUMERIC(31), BIG_INTEGER126 NUMERIC(31), BIG_INTEGER128 NUMERIC(31), BIG_INTEGER129 NUMERIC(31), BIG_INTEGER13 NUMERIC(31), BIG_INTEGER130 NUMERIC(31), BIG_INTEGER138 NUMERIC(31), BIG_INTEGER139 NUMERIC(31), BIG_INTEGER140 NUMERIC(31), BIG_INTEGER16 NUMERIC(31), BIG_INTEGER17 NUMERIC(31), BIG_INTEGER18 NUMERIC(31), BIG_INTEGER2 NUMERIC(31), BIG_INTEGER20 NUMERIC(31), BIG_INTEGER21 NUMERIC(31), BIG_INTEGER22 NUMERIC(31), BIG_INTEGER30 NUMERIC(31), BIG_INTEGER31 NUMERIC(31), BIG_INTEGER32 NUMERIC(31), BIG_INTEGER36 NUMERIC(31), BIG_INTEGER37 NUMERIC(31), BIG_INTEGER38 NUMERIC(31), BIG_INTEGER4 NUMERIC(31), BIG_INTEGER40 NUMERIC(31), BIG_INTEGER41 NUMERIC(31), BIG_INTEGER42 NUMERIC(31), BIG_INTEGER47 NUMERIC(31), BIG_INTEGER48 NUMERIC(31), BIG_INTEGER49 NUMERIC(31), BIG_INTEGER5 NUMERIC(31), BIG_INTEGER52 NUMERIC(31), BIG_INTEGER53 NUMERIC(31), BIG_INTEGER54 NUMERIC(31), BIG_INTEGER56 NUMERIC(31), BIG_INTEGER57 NUMERIC(31), BIG_INTEGER58 NUMERIC(31), BIG_INTEGER6 NUMERIC(31), BIG_INTEGER66 NUMERIC(31), BIG_INTEGER67 NUMERIC(31), BIG_INTEGER68 NUMERIC(31), BIG_INTEGER72 NUMERIC(31), BIG_INTEGER73 NUMERIC(31), BIG_INTEGER74 NUMERIC(31), BIG_INTEGER76 NUMERIC(31), BIG_INTEGER77 NUMERIC(31), BIG_INTEGER78 NUMERIC(31), BIG_INTEGER83 NUMERIC(31), BIG_INTEGER84 NUMERIC(31), BIG_INTEGER85 NUMERIC(31), BIG_INTEGER88 NUMERIC(31), BIG_INTEGER89 NUMERIC(31), BIG_INTEGER90 NUMERIC(31), BIG_INTEGER92 NUMERIC(31), BIG_INTEGER93 NUMERIC(31), BIG_INTEGER94 NUMERIC(31) ); ALTER TABLE FIELDSOFBIGINTEGER ADD CONSTRAINT FIELDSOFBIGI2S_PK PRIMARY KEY (DATASTORE_IDENTITY); CREATE TABLE FIELDSOFBOOLEAN ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, IDENTIFIER INTEGER, BOOLEAN0 CHAR(1) CHECK (BOOLEAN0 IN ('Y','N') OR BOOLEAN0 IS NULL), BOOLEAN1 CHAR(1) CHECK (BOOLEAN1 IN ('Y','N') OR BOOLEAN1 IS NULL), BOOLEAN102 CHAR(1) CHECK (BOOLEAN102 IN ('Y','N') OR BOOLEAN102 IS NULL), BOOLEAN103 CHAR(1) CHECK (BOOLEAN103 IN ('Y','N') OR BOOLEAN103 IS NULL), BOOLEAN104 CHAR(1) CHECK (BOOLEAN104 IN ('Y','N') OR BOOLEAN104 IS NULL), BOOLEAN108 CHAR(1) CHECK (BOOLEAN108 IN ('Y','N') OR BOOLEAN108 IS NULL), BOOLEAN109 CHAR(1) CHECK (BOOLEAN109 IN ('Y','N') OR BOOLEAN109 IS NULL), BOOLEAN11 CHAR(1) CHECK (BOOLEAN11 IN ('Y','N') OR BOOLEAN11 IS NULL), BOOLEAN110 CHAR(1) CHECK (BOOLEAN110 IN ('Y','N') OR BOOLEAN110 IS NULL), BOOLEAN112 CHAR(1) CHECK (BOOLEAN112 IN ('Y','N') OR BOOLEAN112 IS NULL), BOOLEAN113 CHAR(1) CHECK (BOOLEAN113 IN ('Y','N') OR BOOLEAN113 IS NULL), BOOLEAN114 CHAR(1) CHECK (BOOLEAN114 IN ('Y','N') OR BOOLEAN114 IS NULL), BOOLEAN119 CHAR(1) CHECK (BOOLEAN119 IN ('Y','N') OR BOOLEAN119 IS NULL), BOOLEAN12 CHAR(1) CHECK (BOOLEAN12 IN ('Y','N') OR BOOLEAN12 IS NULL), BOOLEAN120 CHAR(1) CHECK (BOOLEAN120 IN ('Y','N') OR BOOLEAN120 IS NULL), BOOLEAN121 CHAR(1) CHECK (BOOLEAN121 IN ('Y','N') OR BOOLEAN121 IS NULL), BOOLEAN124 CHAR(1) CHECK (BOOLEAN124 IN ('Y','N') OR BOOLEAN124 IS NULL), BOOLEAN125 CHAR(1) CHECK (BOOLEAN125 IN ('Y','N') OR BOOLEAN125 IS NULL), BOOLEAN126 CHAR(1) CHECK (BOOLEAN126 IN ('Y','N') OR BOOLEAN126 IS NULL), BOOLEAN128 CHAR(1) CHECK (BOOLEAN128 IN ('Y','N') OR BOOLEAN128 IS NULL), BOOLEAN129 CHAR(1) CHECK (BOOLEAN129 IN ('Y','N') OR BOOLEAN129 IS NULL), BOOLEAN13 CHAR(1) CHECK (BOOLEAN13 IN ('Y','N') OR BOOLEAN13 IS NULL), BOOLEAN130 CHAR(1) CHECK (BOOLEAN130 IN ('Y','N') OR BOOLEAN130 IS NULL), BOOLEAN138 CHAR(1) CHECK (BOOLEAN138 IN ('Y','N') OR BOOLEAN138 IS NULL), BOOLEAN139 CHAR(1) CHECK (BOOLEAN139 IN ('Y','N') OR BOOLEAN139 IS NULL), BOOLEAN140 CHAR(1) CHECK (BOOLEAN140 IN ('Y','N') OR BOOLEAN140 IS NULL), BOOLEAN16 CHAR(1) CHECK (BOOLEAN16 IN ('Y','N') OR BOOLEAN16 IS NULL), BOOLEAN17 CHAR(1) CHECK (BOOLEAN17 IN ('Y','N') OR BOOLEAN17 IS NULL), BOOLEAN18 CHAR(1) CHECK (BOOLEAN18 IN ('Y','N') OR BOOLEAN18 IS NULL), BOOLEAN2 CHAR(1) CHECK (BOOLEAN2 IN ('Y','N') OR BOOLEAN2 IS NULL), BOOLEAN20 CHAR(1) CHECK (BOOLEAN20 IN ('Y','N') OR BOOLEAN20 IS NULL), BOOLEAN21 CHAR(1) CHECK (BOOLEAN21 IN ('Y','N') OR BOOLEAN21 IS NULL), BOOLEAN22 CHAR(1) CHECK (BOOLEAN22 IN ('Y','N') OR BOOLEAN22 IS NULL), BOOLEAN30 CHAR(1) CHECK (BOOLEAN30 IN ('Y','N') OR BOOLEAN30 IS NULL), BOOLEAN31 CHAR(1) CHECK (BOOLEAN31 IN ('Y','N') OR BOOLEAN31 IS NULL), BOOLEAN32 CHAR(1) CHECK (BOOLEAN32 IN ('Y','N') OR BOOLEAN32 IS NULL), BOOLEAN36 CHAR(1) CHECK (BOOLEAN36 IN ('Y','N') OR BOOLEAN36 IS NULL), BOOLEAN37 CHAR(1) CHECK (BOOLEAN37 IN ('Y','N') OR BOOLEAN37 IS NULL), BOOLEAN38 CHAR(1) CHECK (BOOLEAN38 IN ('Y','N') OR BOOLEAN38 IS NULL), BOOLEAN4 CHAR(1) CHECK (BOOLEAN4 IN ('Y','N') OR BOOLEAN4 IS NULL), BOOLEAN40 CHAR(1) CHECK (BOOLEAN40 IN ('Y','N') OR BOOLEAN40 IS NULL), BOOLEAN41 CHAR(1) CHECK (BOOLEAN41 IN ('Y','N') OR BOOLEAN41 IS NULL), BOOLEAN42 CHAR(1) CHECK (BOOLEAN42 IN ('Y','N') OR BOOLEAN42 IS NULL), BOOLEAN47 CHAR(1) CHECK (BOOLEAN47 IN ('Y','N') OR BOOLEAN47 IS NULL), BOOLEAN48 CHAR(1) CHECK (BOOLEAN48 IN ('Y','N') OR BOOLEAN48 IS NULL), BOOLEAN49 CHAR(1) CHECK (BOOLEAN49 IN ('Y','N') OR BOOLEAN49 IS NULL), BOOLEAN5 CHAR(1) CHECK (BOOLEAN5 IN ('Y','N') OR BOOLEAN5 IS NULL), BOOLEAN52 CHAR(1) CHECK (BOOLEAN52 IN ('Y','N') OR BOOLEAN52 IS NULL), BOOLEAN53 CHAR(1) CHECK (BOOLEAN53 IN ('Y','N') OR BOOLEAN53 IS NULL), BOOLEAN54 CHAR(1) CHECK (BOOLEAN54 IN ('Y','N') OR BOOLEAN54 IS NULL), BOOLEAN56 CHAR(1) CHECK (BOOLEAN56 IN ('Y','N') OR BOOLEAN56 IS NULL), BOOLEAN57 CHAR(1) CHECK (BOOLEAN57 IN ('Y','N') OR BOOLEAN57 IS NULL), BOOLEAN58 CHAR(1) CHECK (BOOLEAN58 IN ('Y','N') OR BOOLEAN58 IS NULL), BOOLEAN6 CHAR(1) CHECK (BOOLEAN6 IN ('Y','N') OR BOOLEAN6 IS NULL), BOOLEAN66 CHAR(1) CHECK (BOOLEAN66 IN ('Y','N') OR BOOLEAN66 IS NULL), BOOLEAN67 CHAR(1) CHECK (BOOLEAN67 IN ('Y','N') OR BOOLEAN67 IS NULL), BOOLEAN68 CHAR(1) CHECK (BOOLEAN68 IN ('Y','N') OR BOOLEAN68 IS NULL), BOOLEAN72 CHAR(1) CHECK (BOOLEAN72 IN ('Y','N') OR BOOLEAN72 IS NULL), BOOLEAN73 CHAR(1) CHECK (BOOLEAN73 IN ('Y','N') OR BOOLEAN73 IS NULL), BOOLEAN74 CHAR(1) CHECK (BOOLEAN74 IN ('Y','N') OR BOOLEAN74 IS NULL), BOOLEAN76 CHAR(1) CHECK (BOOLEAN76 IN ('Y','N') OR BOOLEAN76 IS NULL), BOOLEAN77 CHAR(1) CHECK (BOOLEAN77 IN ('Y','N') OR BOOLEAN77 IS NULL), BOOLEAN78 CHAR(1) CHECK (BOOLEAN78 IN ('Y','N') OR BOOLEAN78 IS NULL), BOOLEAN83 CHAR(1) CHECK (BOOLEAN83 IN ('Y','N') OR BOOLEAN83 IS NULL), BOOLEAN84 CHAR(1) CHECK (BOOLEAN84 IN ('Y','N') OR BOOLEAN84 IS NULL), BOOLEAN85 CHAR(1) CHECK (BOOLEAN85 IN ('Y','N') OR BOOLEAN85 IS NULL), BOOLEAN88 CHAR(1) CHECK (BOOLEAN88 IN ('Y','N') OR BOOLEAN88 IS NULL), BOOLEAN89 CHAR(1) CHECK (BOOLEAN89 IN ('Y','N') OR BOOLEAN89 IS NULL), BOOLEAN90 CHAR(1) CHECK (BOOLEAN90 IN ('Y','N') OR BOOLEAN90 IS NULL), BOOLEAN92 CHAR(1) CHECK (BOOLEAN92 IN ('Y','N') OR BOOLEAN92 IS NULL), BOOLEAN93 CHAR(1) CHECK (BOOLEAN93 IN ('Y','N') OR BOOLEAN93 IS NULL), BOOLEAN94 CHAR(1) CHECK (BOOLEAN94 IN ('Y','N') OR BOOLEAN94 IS NULL) ); ALTER TABLE FIELDSOFBOOLEAN ADD CONSTRAINT FIELDSOFBOOLS2_PK PRIMARY KEY (DATASTORE_IDENTITY); CREATE TABLE FIELDSOFCHARACTER ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, IDENTIFIER INTEGER, CHARACTER0 INTEGER, CHARACTER1 INTEGER, CHARACTER102 INTEGER, CHARACTER103 INTEGER, CHARACTER104 INTEGER, CHARACTER108 INTEGER, CHARACTER109 INTEGER, CHARACTER11 INTEGER, CHARACTER110 INTEGER, CHARACTER112 INTEGER, CHARACTER113 INTEGER, CHARACTER114 INTEGER, CHARACTER119 INTEGER, CHARACTER12 INTEGER, CHARACTER120 INTEGER, CHARACTER121 INTEGER, CHARACTER124 INTEGER, CHARACTER125 INTEGER, CHARACTER126 INTEGER, CHARACTER128 INTEGER, CHARACTER129 INTEGER, CHARACTER13 INTEGER, CHARACTER130 INTEGER, CHARACTER138 INTEGER, CHARACTER139 INTEGER, CHARACTER140 INTEGER, CHARACTER16 INTEGER, CHARACTER17 INTEGER, CHARACTER18 INTEGER, CHARACTER2 INTEGER, CHARACTER20 INTEGER, CHARACTER21 INTEGER, CHARACTER22 INTEGER, CHARACTER30 INTEGER, CHARACTER31 INTEGER, CHARACTER32 INTEGER, CHARACTER36 INTEGER, CHARACTER37 INTEGER, CHARACTER38 INTEGER, CHARACTER4 INTEGER, CHARACTER40 INTEGER, CHARACTER41 INTEGER, CHARACTER42 INTEGER, CHARACTER47 INTEGER, CHARACTER48 INTEGER, CHARACTER49 INTEGER, CHARACTER5 INTEGER, CHARACTER52 INTEGER, CHARACTER53 INTEGER, CHARACTER54 INTEGER, CHARACTER56 INTEGER, CHARACTER57 INTEGER, CHARACTER58 INTEGER, CHARACTER6 INTEGER, CHARACTER66 INTEGER, CHARACTER67 INTEGER, CHARACTER68 INTEGER, CHARACTER72 INTEGER, CHARACTER73 INTEGER, CHARACTER74 INTEGER, CHARACTER76 INTEGER, CHARACTER77 INTEGER, CHARACTER78 INTEGER, CHARACTER83 INTEGER, CHARACTER84 INTEGER, CHARACTER85 INTEGER, CHARACTER88 INTEGER, CHARACTER89 INTEGER, CHARACTER90 INTEGER, CHARACTER92 INTEGER, CHARACTER93 INTEGER, CHARACTER94 INTEGER ); ALTER TABLE FIELDSOFCHARACTER ADD CONSTRAINT FIELDSOFCHAROV_PK PRIMARY KEY (DATASTORE_IDENTITY); CREATE TABLE FIELDSOFDATE ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, IDENTIFIER INTEGER, DATE0 TIMESTAMP, DATE1 TIMESTAMP, DATE102 TIMESTAMP, DATE103 TIMESTAMP, DATE104 TIMESTAMP, DATE108 TIMESTAMP, DATE109 TIMESTAMP, DATE11 TIMESTAMP, DATE110 TIMESTAMP, DATE112 TIMESTAMP, DATE113 TIMESTAMP, DATE114 TIMESTAMP, DATE119 TIMESTAMP, DATE12 TIMESTAMP, DATE120 TIMESTAMP, DATE121 TIMESTAMP, DATE124 TIMESTAMP, DATE125 TIMESTAMP, DATE126 TIMESTAMP, DATE128 TIMESTAMP, DATE129 TIMESTAMP, DATE13 TIMESTAMP, DATE130 TIMESTAMP, DATE138 TIMESTAMP, DATE139 TIMESTAMP, DATE140 TIMESTAMP, DATE16 TIMESTAMP, DATE17 TIMESTAMP, DATE18 TIMESTAMP, DATE2 TIMESTAMP, DATE20 TIMESTAMP, DATE21 TIMESTAMP, DATE22 TIMESTAMP, DATE30 TIMESTAMP, DATE31 TIMESTAMP, DATE32 TIMESTAMP, DATE36 TIMESTAMP, DATE37 TIMESTAMP, DATE38 TIMESTAMP, DATE4 TIMESTAMP, DATE40 TIMESTAMP, DATE41 TIMESTAMP, DATE42 TIMESTAMP, DATE47 TIMESTAMP, DATE48 TIMESTAMP, DATE49 TIMESTAMP, DATE5 TIMESTAMP, DATE52 TIMESTAMP, DATE53 TIMESTAMP, DATE54 TIMESTAMP, DATE56 TIMESTAMP, DATE57 TIMESTAMP, DATE58 TIMESTAMP, DATE6 TIMESTAMP, DATE66 TIMESTAMP, DATE67 TIMESTAMP, DATE68 TIMESTAMP, DATE72 TIMESTAMP, DATE73 TIMESTAMP, DATE74 TIMESTAMP, DATE76 TIMESTAMP, DATE77 TIMESTAMP, DATE78 TIMESTAMP, DATE83 TIMESTAMP, DATE84 TIMESTAMP, DATE85 TIMESTAMP, DATE88 TIMESTAMP, DATE89 TIMESTAMP, DATE90 TIMESTAMP, DATE92 TIMESTAMP, DATE93 TIMESTAMP, DATE94 TIMESTAMP ); ALTER TABLE FIELDSOFDATE ADD CONSTRAINT FIELDSOFDATE_PK PRIMARY KEY (DATASTORE_IDENTITY); CREATE TABLE FIELDSOFDOUBLE ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, IDENTIFIER INTEGER, DOUBLE0 DOUBLE, DOUBLE1 DOUBLE, DOUBLE102 DOUBLE, DOUBLE103 DOUBLE, DOUBLE104 DOUBLE, DOUBLE108 DOUBLE, DOUBLE109 DOUBLE, DOUBLE11 DOUBLE, DOUBLE110 DOUBLE, DOUBLE112 DOUBLE, DOUBLE113 DOUBLE, DOUBLE114 DOUBLE, DOUBLE119 DOUBLE, DOUBLE12 DOUBLE, DOUBLE120 DOUBLE, DOUBLE121 DOUBLE, DOUBLE124 DOUBLE, DOUBLE125 DOUBLE, DOUBLE126 DOUBLE, DOUBLE128 DOUBLE, DOUBLE129 DOUBLE, DOUBLE13 DOUBLE, DOUBLE130 DOUBLE, DOUBLE138 DOUBLE, DOUBLE139 DOUBLE, DOUBLE140 DOUBLE, DOUBLE16 DOUBLE, DOUBLE17 DOUBLE, DOUBLE18 DOUBLE, DOUBLE2 DOUBLE, DOUBLE20 DOUBLE, DOUBLE21 DOUBLE, DOUBLE22 DOUBLE, DOUBLE30 DOUBLE, DOUBLE31 DOUBLE, DOUBLE32 DOUBLE, DOUBLE36 DOUBLE, DOUBLE37 DOUBLE, DOUBLE38 DOUBLE, DOUBLE4 DOUBLE, DOUBLE40 DOUBLE, DOUBLE41 DOUBLE, DOUBLE42 DOUBLE, DOUBLE47 DOUBLE, DOUBLE48 DOUBLE, DOUBLE49 DOUBLE, DOUBLE5 DOUBLE, DOUBLE52 DOUBLE, DOUBLE53 DOUBLE, DOUBLE54 DOUBLE, DOUBLE56 DOUBLE, DOUBLE57 DOUBLE, DOUBLE58 DOUBLE, DOUBLE6 DOUBLE, DOUBLE66 DOUBLE, DOUBLE67 DOUBLE, DOUBLE68 DOUBLE, DOUBLE72 DOUBLE, DOUBLE73 DOUBLE, DOUBLE74 DOUBLE, DOUBLE76 DOUBLE, DOUBLE77 DOUBLE, DOUBLE78 DOUBLE, DOUBLE83 DOUBLE, DOUBLE84 DOUBLE, DOUBLE85 DOUBLE, DOUBLE88 DOUBLE, DOUBLE89 DOUBLE, DOUBLE90 DOUBLE, DOUBLE92 DOUBLE, DOUBLE93 DOUBLE, DOUBLE94 DOUBLE ); ALTER TABLE FIELDSOFDOUBLE ADD CONSTRAINT FIELDSOFDOUBLE_PK PRIMARY KEY (DATASTORE_IDENTITY); CREATE TABLE FIELDSOFENUMNAME ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, IDENTIFIER INTEGER, ENUM0 CHAR(2), ENUM1 CHAR(2), ENUM102 CHAR(2), ENUM103 CHAR(2), ENUM104 VARCHAR(256), ENUM108 VARCHAR(256), ENUM109 VARCHAR(256), ENUM11 VARCHAR(256), ENUM110 CHAR(2), ENUM112 CHAR(2), ENUM113 CHAR(2), ENUM114 CHAR(2), ENUM119 VARCHAR(256), ENUM12 VARCHAR(256), ENUM120 VARCHAR(256), ENUM121 VARCHAR(256), ENUM124 CHAR(2), ENUM125 CHAR(2), ENUM126 CHAR(2), ENUM128 CHAR(2), ENUM129 VARCHAR(256), ENUM13 VARCHAR(256), ENUM130 VARCHAR(256), ENUM138 VARCHAR(256), ENUM139 CHAR(2), ENUM140 CHAR(2), ENUM16 CHAR(2), ENUM17 CHAR(2), ENUM18 VARCHAR(256), ENUM2 VARCHAR(256), ENUM20 VARCHAR(256), ENUM21 VARCHAR(256), ENUM22 CHAR(2), ENUM30 CHAR(2), ENUM31 CHAR(2), ENUM32 CHAR(2), ENUM36 VARCHAR(256), ENUM37 VARCHAR(256), ENUM38 VARCHAR(256), ENUM4 VARCHAR(256), ENUM40 CHAR(2), ENUM41 CHAR(2), ENUM42 CHAR(2), ENUM47 CHAR(2), ENUM48 VARCHAR(256), ENUM49 VARCHAR(256), ENUM5 VARCHAR(256), ENUM52 VARCHAR(256), ENUM53 CHAR(2), ENUM54 CHAR(2), ENUM56 CHAR(2), ENUM57 CHAR(2), ENUM58 VARCHAR(256), ENUM6 VARCHAR(256), ENUM66 VARCHAR(256), ENUM67 VARCHAR(256), ENUM68 CHAR(2), ENUM72 CHAR(2), ENUM73 CHAR(2), ENUM74 CHAR(2), ENUM76 VARCHAR(256), ENUM77 VARCHAR(256), ENUM78 VARCHAR(256), ENUM83 VARCHAR(256), ENUM84 CHAR(2), ENUM85 CHAR(2), ENUM88 CHAR(2), ENUM89 CHAR(2), ENUM90 VARCHAR(256), ENUM92 VARCHAR(256), ENUM93 VARCHAR(256), ENUM94 VARCHAR(256) ); ALTER TABLE FIELDSOFENUMNAME ADD CONSTRAINT FIELDSOFENUMNAME_PK PRIMARY KEY (DATASTORE_IDENTITY); CREATE TABLE FIELDSOFFLOAT ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, IDENTIFIER INTEGER, FLOAT0 REAL, FLOAT1 REAL, FLOAT102 REAL, FLOAT103 REAL, FLOAT104 REAL, FLOAT108 REAL, FLOAT109 REAL, FLOAT11 REAL, FLOAT110 REAL, FLOAT112 REAL, FLOAT113 REAL, FLOAT114 REAL, FLOAT119 REAL, FLOAT12 REAL, FLOAT120 REAL, FLOAT121 REAL, FLOAT124 REAL, FLOAT125 REAL, FLOAT126 REAL, FLOAT128 REAL, FLOAT129 REAL, FLOAT13 REAL, FLOAT130 REAL, FLOAT138 REAL, FLOAT139 REAL, FLOAT140 REAL, FLOAT16 REAL, FLOAT17 REAL, FLOAT18 REAL, FLOAT2 REAL, FLOAT20 REAL, FLOAT21 REAL, FLOAT22 REAL, FLOAT30 REAL, FLOAT31 REAL, FLOAT32 REAL, FLOAT36 REAL, FLOAT37 REAL, FLOAT38 REAL, FLOAT4 REAL, FLOAT40 REAL, FLOAT41 REAL, FLOAT42 REAL, FLOAT47 REAL, FLOAT48 REAL, FLOAT49 REAL, FLOAT5 REAL, FLOAT52 REAL, FLOAT53 REAL, FLOAT54 REAL, FLOAT56 REAL, FLOAT57 REAL, FLOAT58 REAL, FLOAT6 REAL, FLOAT66 REAL, FLOAT67 REAL, FLOAT68 REAL, FLOAT72 REAL, FLOAT73 REAL, FLOAT74 REAL, FLOAT76 REAL, FLOAT77 REAL, FLOAT78 REAL, FLOAT83 REAL, FLOAT84 REAL, FLOAT85 REAL, FLOAT88 REAL, FLOAT89 REAL, FLOAT90 REAL, FLOAT92 REAL, FLOAT93 REAL, FLOAT94 REAL ); ALTER TABLE FIELDSOFFLOAT ADD CONSTRAINT FIELDSOFFLOAT_PK PRIMARY KEY (DATASTORE_IDENTITY); CREATE TABLE FIELDSOFINTEGER ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, IDENTIFIER INTEGER, INTEGER0 INTEGER, INTEGER1 INTEGER, INTEGER102 INTEGER, INTEGER103 INTEGER, INTEGER104 INTEGER, INTEGER108 INTEGER, INTEGER109 INTEGER, INTEGER11 INTEGER, INTEGER110 INTEGER, INTEGER112 INTEGER, INTEGER113 INTEGER, INTEGER114 INTEGER, INTEGER119 INTEGER, INTEGER12 INTEGER, INTEGER120 INTEGER, INTEGER121 INTEGER, INTEGER124 INTEGER, INTEGER125 INTEGER, INTEGER126 INTEGER, INTEGER128 INTEGER, INTEGER129 INTEGER, INTEGER13 INTEGER, INTEGER130 INTEGER, INTEGER138 INTEGER, INTEGER139 INTEGER, INTEGER140 INTEGER, INTEGER16 INTEGER, INTEGER17 INTEGER, INTEGER18 INTEGER, INTEGER2 INTEGER, INTEGER20 INTEGER, INTEGER21 INTEGER, INTEGER22 INTEGER, INTEGER30 INTEGER, INTEGER31 INTEGER, INTEGER32 INTEGER, INTEGER36 INTEGER, INTEGER37 INTEGER, INTEGER38 INTEGER, INTEGER4 INTEGER, INTEGER40 INTEGER, INTEGER41 INTEGER, INTEGER42 INTEGER, INTEGER47 INTEGER, INTEGER48 INTEGER, INTEGER49 INTEGER, INTEGER5 INTEGER, INTEGER52 INTEGER, INTEGER53 INTEGER, INTEGER54 INTEGER, INTEGER56 INTEGER, INTEGER57 INTEGER, INTEGER58 INTEGER, INTEGER6 INTEGER, INTEGER66 INTEGER, INTEGER67 INTEGER, INTEGER68 INTEGER, INTEGER72 INTEGER, INTEGER73 INTEGER, INTEGER74 INTEGER, INTEGER76 INTEGER, INTEGER77 INTEGER, INTEGER78 INTEGER, INTEGER83 INTEGER, INTEGER84 INTEGER, INTEGER85 INTEGER, INTEGER88 INTEGER, INTEGER89 INTEGER, INTEGER90 INTEGER, INTEGER92 INTEGER, INTEGER93 INTEGER, INTEGER94 INTEGER ); ALTER TABLE FIELDSOFINTEGER ADD CONSTRAINT FIELDSOFINTEV0_PK PRIMARY KEY (DATASTORE_IDENTITY); CREATE TABLE FIELDSOFLOCALE ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, IDENTIFIER INTEGER, LOCALE0 CHAR(20), LOCALE1 CHAR(20), LOCALE102 CHAR(20), LOCALE103 CHAR(20), LOCALE104 CHAR(20), LOCALE108 CHAR(20), LOCALE109 CHAR(20), LOCALE11 CHAR(20), LOCALE110 CHAR(20), LOCALE112 CHAR(20), LOCALE113 CHAR(20), LOCALE114 CHAR(20), LOCALE119 CHAR(20), LOCALE12 CHAR(20), LOCALE120 CHAR(20), LOCALE121 CHAR(20), LOCALE124 CHAR(20), LOCALE125 CHAR(20), LOCALE126 CHAR(20), LOCALE128 CHAR(20), LOCALE129 CHAR(20), LOCALE13 CHAR(20), LOCALE130 CHAR(20), LOCALE138 CHAR(20), LOCALE139 CHAR(20), LOCALE140 CHAR(20), LOCALE16 CHAR(20), LOCALE17 CHAR(20), LOCALE18 CHAR(20), LOCALE2 CHAR(20), LOCALE20 CHAR(20), LOCALE21 CHAR(20), LOCALE22 CHAR(20), LOCALE30 CHAR(20), LOCALE31 CHAR(20), LOCALE32 CHAR(20), LOCALE36 CHAR(20), LOCALE37 CHAR(20), LOCALE38 CHAR(20), LOCALE4 CHAR(20), LOCALE40 CHAR(20), LOCALE41 CHAR(20), LOCALE42 CHAR(20), LOCALE47 CHAR(20), LOCALE48 CHAR(20), LOCALE49 CHAR(20), LOCALE5 CHAR(20), LOCALE52 CHAR(20), LOCALE53 CHAR(20), LOCALE54 CHAR(20), LOCALE56 CHAR(20), LOCALE57 CHAR(20), LOCALE58 CHAR(20), LOCALE6 CHAR(20), LOCALE66 CHAR(20), LOCALE67 CHAR(20), LOCALE68 CHAR(20), LOCALE72 CHAR(20), LOCALE73 CHAR(20), LOCALE74 CHAR(20), LOCALE76 CHAR(20), LOCALE77 CHAR(20), LOCALE78 CHAR(20), LOCALE83 CHAR(20), LOCALE84 CHAR(20), LOCALE85 CHAR(20), LOCALE88 CHAR(20), LOCALE89 CHAR(20), LOCALE90 CHAR(20), LOCALE92 CHAR(20), LOCALE93 CHAR(20), LOCALE94 CHAR(20) ); ALTER TABLE FIELDSOFLOCALE ADD CONSTRAINT FIELDSOFLOCALE_PK PRIMARY KEY (DATASTORE_IDENTITY); CREATE TABLE FIELDSOFLONG ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, IDENTIFIER INTEGER, LONG0 BIGINT, LONG1 BIGINT, LONG102 BIGINT, LONG103 BIGINT, LONG104 BIGINT, LONG108 BIGINT, LONG109 BIGINT, LONG11 BIGINT, LONG110 BIGINT, LONG112 BIGINT, LONG113 BIGINT, LONG114 BIGINT, LONG119 BIGINT, LONG12 BIGINT, LONG120 BIGINT, LONG121 BIGINT, LONG124 BIGINT, LONG125 BIGINT, LONG126 BIGINT, LONG128 BIGINT, LONG129 BIGINT, LONG13 BIGINT, LONG130 BIGINT, LONG138 BIGINT, LONG139 BIGINT, LONG140 BIGINT, LONG16 BIGINT, LONG17 BIGINT, LONG18 BIGINT, LONG2 BIGINT, LONG20 BIGINT, LONG21 BIGINT, LONG22 BIGINT, LONG30 BIGINT, LONG31 BIGINT, LONG32 BIGINT, LONG36 BIGINT, LONG37 BIGINT, LONG38 BIGINT, LONG4 BIGINT, LONG40 BIGINT, LONG41 BIGINT, LONG42 BIGINT, LONG47 BIGINT, LONG48 BIGINT, LONG49 BIGINT, LONG5 BIGINT, LONG52 BIGINT, LONG53 BIGINT, LONG54 BIGINT, LONG56 BIGINT, LONG57 BIGINT, LONG58 BIGINT, LONG6 BIGINT, LONG66 BIGINT, LONG67 BIGINT, LONG68 BIGINT, LONG72 BIGINT, LONG73 BIGINT, LONG74 BIGINT, LONG76 BIGINT, LONG77 BIGINT, LONG78 BIGINT, LONG83 BIGINT, LONG84 BIGINT, LONG85 BIGINT, LONG88 BIGINT, LONG89 BIGINT, LONG90 BIGINT, LONG92 BIGINT, LONG93 BIGINT, LONG94 BIGINT ); ALTER TABLE FIELDSOFLONG ADD CONSTRAINT FIELDSOFLONG_PK PRIMARY KEY (DATASTORE_IDENTITY); CREATE TABLE FIELDSOFOBJECT ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, IDENTIFIER INTEGER, OBJECT1 LONG VARCHAR FOR BIT DATA, OBJECT102 BIGINT REFERENCES SIMPLE_CLASS, OBJECT103 LONG VARCHAR FOR BIT DATA, OBJECT104 BIGINT REFERENCES SIMPLE_CLASS, OBJECT109 LONG VARCHAR FOR BIT DATA, OBJECT11 BIGINT REFERENCES SIMPLE_CLASS, OBJECT110 BIGINT REFERENCES SIMPLE_CLASS, OBJECT112 BIGINT REFERENCES SIMPLE_CLASS, OBJECT113 LONG VARCHAR FOR BIT DATA, OBJECT114 BIGINT REFERENCES SIMPLE_CLASS, OBJECT119 BIGINT REFERENCES SIMPLE_CLASS, OBJECT12 LONG VARCHAR FOR BIT DATA, OBJECT120 LONG VARCHAR FOR BIT DATA, OBJECT121 BIGINT REFERENCES SIMPLE_CLASS, OBJECT125 LONG VARCHAR FOR BIT DATA, OBJECT126 BIGINT REFERENCES SIMPLE_CLASS, OBJECT128 BIGINT REFERENCES SIMPLE_CLASS, OBJECT129 LONG VARCHAR FOR BIT DATA, OBJECT13 BIGINT REFERENCES SIMPLE_CLASS, OBJECT130 BIGINT REFERENCES SIMPLE_CLASS, OBJECT138 BIGINT REFERENCES SIMPLE_CLASS, OBJECT139 LONG VARCHAR FOR BIT DATA, OBJECT140 BIGINT REFERENCES SIMPLE_CLASS, OBJECT17 LONG VARCHAR FOR BIT DATA, OBJECT18 BIGINT REFERENCES SIMPLE_CLASS, OBJECT2 BIGINT REFERENCES SIMPLE_CLASS, OBJECT20 BIGINT REFERENCES SIMPLE_CLASS, OBJECT21 LONG VARCHAR FOR BIT DATA, OBJECT22 BIGINT REFERENCES SIMPLE_CLASS, OBJECT30 BIGINT REFERENCES SIMPLE_CLASS, OBJECT31 LONG VARCHAR FOR BIT DATA, OBJECT32 BIGINT REFERENCES SIMPLE_CLASS, OBJECT37 LONG VARCHAR FOR BIT DATA, OBJECT38 BIGINT REFERENCES SIMPLE_CLASS, OBJECT4 BIGINT REFERENCES SIMPLE_CLASS, OBJECT40 BIGINT REFERENCES SIMPLE_CLASS, OBJECT41 LONG VARCHAR FOR BIT DATA, OBJECT42 BIGINT REFERENCES SIMPLE_CLASS, OBJECT47 BIGINT REFERENCES SIMPLE_CLASS, OBJECT48 LONG VARCHAR FOR BIT DATA, OBJECT49 BIGINT REFERENCES SIMPLE_CLASS, OBJECT5 LONG VARCHAR FOR BIT DATA, OBJECT53 LONG VARCHAR FOR BIT DATA, OBJECT54 BIGINT REFERENCES SIMPLE_CLASS, OBJECT56 BIGINT REFERENCES SIMPLE_CLASS, OBJECT57 LONG VARCHAR FOR BIT DATA, OBJECT58 BIGINT REFERENCES SIMPLE_CLASS, OBJECT6 BIGINT REFERENCES SIMPLE_CLASS, OBJECT66 BIGINT REFERENCES SIMPLE_CLASS, OBJECT67 LONG VARCHAR FOR BIT DATA, OBJECT68 BIGINT REFERENCES SIMPLE_CLASS, OBJECT73 LONG VARCHAR FOR BIT DATA, OBJECT74 BIGINT REFERENCES SIMPLE_CLASS, OBJECT76 BIGINT REFERENCES SIMPLE_CLASS, OBJECT77 LONG VARCHAR FOR BIT DATA, OBJECT78 BIGINT REFERENCES SIMPLE_CLASS, OBJECT83 BIGINT REFERENCES SIMPLE_CLASS, OBJECT84 LONG VARCHAR FOR BIT DATA, OBJECT85 BIGINT REFERENCES SIMPLE_CLASS, OBJECT89 LONG VARCHAR FOR BIT DATA, OBJECT90 BIGINT REFERENCES SIMPLE_CLASS, OBJECT92 BIGINT REFERENCES SIMPLE_CLASS, OBJECT93 LONG VARCHAR FOR BIT DATA, OBJECT94 BIGINT REFERENCES SIMPLE_CLASS ); ALTER TABLE FIELDSOFOBJECT ADD CONSTRAINT FIELDSOFOBJECT_PK PRIMARY KEY (DATASTORE_IDENTITY); CREATE TABLE FIELDSOFSIMPLEINTERFACE ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, IDENTIFIER INTEGER, SIMPLEINTERFACE1 LONG VARCHAR FOR BIT DATA, SIMPLEINTERFACE102 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE103 LONG VARCHAR FOR BIT DATA, SIMPLEINTERFACE104 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE109 LONG VARCHAR FOR BIT DATA, SIMPLEINTERFACE11 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE110 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE112 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE113 LONG VARCHAR FOR BIT DATA, SIMPLEINTERFACE114 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE119 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE12 LONG VARCHAR FOR BIT DATA, SIMPLEINTERFACE120 LONG VARCHAR FOR BIT DATA, SIMPLEINTERFACE121 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE125 LONG VARCHAR FOR BIT DATA, SIMPLEINTERFACE126 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE128 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE129 LONG VARCHAR FOR BIT DATA, SIMPLEINTERFACE13 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE130 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE138 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE139 LONG VARCHAR FOR BIT DATA, SIMPLEINTERFACE140 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE17 LONG VARCHAR FOR BIT DATA, SIMPLEINTERFACE18 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE2 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE20 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE21 LONG VARCHAR FOR BIT DATA, SIMPLEINTERFACE22 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE30 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE31 LONG VARCHAR FOR BIT DATA, SIMPLEINTERFACE32 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE37 LONG VARCHAR FOR BIT DATA, SIMPLEINTERFACE38 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE4 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE40 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE41 LONG VARCHAR FOR BIT DATA, SIMPLEINTERFACE42 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE47 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE48 LONG VARCHAR FOR BIT DATA, SIMPLEINTERFACE49 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE5 LONG VARCHAR FOR BIT DATA, SIMPLEINTERFACE53 LONG VARCHAR FOR BIT DATA, SIMPLEINTERFACE54 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE56 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE57 LONG VARCHAR FOR BIT DATA, SIMPLEINTERFACE58 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE6 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE66 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE67 LONG VARCHAR FOR BIT DATA, SIMPLEINTERFACE68 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE73 LONG VARCHAR FOR BIT DATA, SIMPLEINTERFACE74 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE76 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE77 LONG VARCHAR FOR BIT DATA, SIMPLEINTERFACE78 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE83 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE84 LONG VARCHAR FOR BIT DATA, SIMPLEINTERFACE85 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE89 LONG VARCHAR FOR BIT DATA, SIMPLEINTERFACE90 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE92 BIGINT REFERENCES SIMPLE_CLASS, SIMPLEINTERFACE93 LONG VARCHAR FOR BIT DATA, SIMPLEINTERFACE94 BIGINT REFERENCES SIMPLE_CLASS ); ALTER TABLE FIELDSOFSIMPLEINTERFACE ADD CONSTRAINT FOSI_PK PRIMARY KEY (DATASTORE_IDENTITY); CREATE TABLE FIELDSOFPRIMITIVEBOOLEAN ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, IDENTIFIER INTEGER, BOOLEAN0 CHAR(1) NOT NULL CHECK (BOOLEAN0 IN ('Y','N')), BOOLEAN1 CHAR(1) NOT NULL CHECK (BOOLEAN1 IN ('Y','N')), BOOLEAN102 CHAR(1) NOT NULL CHECK (BOOLEAN102 IN ('Y','N')), BOOLEAN103 CHAR(1) NOT NULL CHECK (BOOLEAN103 IN ('Y','N')), BOOLEAN104 CHAR(1) NOT NULL CHECK (BOOLEAN104 IN ('Y','N')), BOOLEAN108 CHAR(1) NOT NULL CHECK (BOOLEAN108 IN ('Y','N')), BOOLEAN109 CHAR(1) NOT NULL CHECK (BOOLEAN109 IN ('Y','N')), BOOLEAN11 CHAR(1) NOT NULL CHECK (BOOLEAN11 IN ('Y','N')), BOOLEAN110 CHAR(1) NOT NULL CHECK (BOOLEAN110 IN ('Y','N')), BOOLEAN112 CHAR(1) NOT NULL CHECK (BOOLEAN112 IN ('Y','N')), BOOLEAN113 CHAR(1) NOT NULL CHECK (BOOLEAN113 IN ('Y','N')), BOOLEAN114 CHAR(1) NOT NULL CHECK (BOOLEAN114 IN ('Y','N')), BOOLEAN119 CHAR(1) NOT NULL CHECK (BOOLEAN119 IN ('Y','N')), BOOLEAN12 CHAR(1) NOT NULL CHECK (BOOLEAN12 IN ('Y','N')), BOOLEAN120 CHAR(1) NOT NULL CHECK (BOOLEAN120 IN ('Y','N')), BOOLEAN121 CHAR(1) NOT NULL CHECK (BOOLEAN121 IN ('Y','N')), BOOLEAN124 CHAR(1) NOT NULL CHECK (BOOLEAN124 IN ('Y','N')), BOOLEAN125 CHAR(1) NOT NULL CHECK (BOOLEAN125 IN ('Y','N')), BOOLEAN126 CHAR(1) NOT NULL CHECK (BOOLEAN126 IN ('Y','N')), BOOLEAN128 CHAR(1) NOT NULL CHECK (BOOLEAN128 IN ('Y','N')), BOOLEAN129 CHAR(1) NOT NULL CHECK (BOOLEAN129 IN ('Y','N')), BOOLEAN13 CHAR(1) NOT NULL CHECK (BOOLEAN13 IN ('Y','N')), BOOLEAN130 CHAR(1) NOT NULL CHECK (BOOLEAN130 IN ('Y','N')), BOOLEAN138 CHAR(1) NOT NULL CHECK (BOOLEAN138 IN ('Y','N')), BOOLEAN139 CHAR(1) NOT NULL CHECK (BOOLEAN139 IN ('Y','N')), BOOLEAN140 CHAR(1) NOT NULL CHECK (BOOLEAN140 IN ('Y','N')), BOOLEAN16 CHAR(1) NOT NULL CHECK (BOOLEAN16 IN ('Y','N')), BOOLEAN17 CHAR(1) NOT NULL CHECK (BOOLEAN17 IN ('Y','N')), BOOLEAN18 CHAR(1) NOT NULL CHECK (BOOLEAN18 IN ('Y','N')), BOOLEAN2 CHAR(1) NOT NULL CHECK (BOOLEAN2 IN ('Y','N')), BOOLEAN20 CHAR(1) NOT NULL CHECK (BOOLEAN20 IN ('Y','N')), BOOLEAN21 CHAR(1) NOT NULL CHECK (BOOLEAN21 IN ('Y','N')), BOOLEAN22 CHAR(1) NOT NULL CHECK (BOOLEAN22 IN ('Y','N')), BOOLEAN30 CHAR(1) NOT NULL CHECK (BOOLEAN30 IN ('Y','N')), BOOLEAN31 CHAR(1) NOT NULL CHECK (BOOLEAN31 IN ('Y','N')), BOOLEAN32 CHAR(1) NOT NULL CHECK (BOOLEAN32 IN ('Y','N')), BOOLEAN36 CHAR(1) NOT NULL CHECK (BOOLEAN36 IN ('Y','N')), BOOLEAN37 CHAR(1) NOT NULL CHECK (BOOLEAN37 IN ('Y','N')), BOOLEAN38 CHAR(1) NOT NULL CHECK (BOOLEAN38 IN ('Y','N')), BOOLEAN4 CHAR(1) NOT NULL CHECK (BOOLEAN4 IN ('Y','N')), BOOLEAN40 CHAR(1) NOT NULL CHECK (BOOLEAN40 IN ('Y','N')), BOOLEAN41 CHAR(1) NOT NULL CHECK (BOOLEAN41 IN ('Y','N')), BOOLEAN42 CHAR(1) NOT NULL CHECK (BOOLEAN42 IN ('Y','N')), BOOLEAN47 CHAR(1) NOT NULL CHECK (BOOLEAN47 IN ('Y','N')), BOOLEAN48 CHAR(1) NOT NULL CHECK (BOOLEAN48 IN ('Y','N')), BOOLEAN49 CHAR(1) NOT NULL CHECK (BOOLEAN49 IN ('Y','N')), BOOLEAN5 CHAR(1) NOT NULL CHECK (BOOLEAN5 IN ('Y','N')), BOOLEAN52 CHAR(1) NOT NULL CHECK (BOOLEAN52 IN ('Y','N')), BOOLEAN53 CHAR(1) NOT NULL CHECK (BOOLEAN53 IN ('Y','N')), BOOLEAN54 CHAR(1) NOT NULL CHECK (BOOLEAN54 IN ('Y','N')), BOOLEAN56 CHAR(1) NOT NULL CHECK (BOOLEAN56 IN ('Y','N')), BOOLEAN57 CHAR(1) NOT NULL CHECK (BOOLEAN57 IN ('Y','N')), BOOLEAN58 CHAR(1) NOT NULL CHECK (BOOLEAN58 IN ('Y','N')), BOOLEAN6 CHAR(1) NOT NULL CHECK (BOOLEAN6 IN ('Y','N')), BOOLEAN66 CHAR(1) NOT NULL CHECK (BOOLEAN66 IN ('Y','N')), BOOLEAN67 CHAR(1) NOT NULL CHECK (BOOLEAN67 IN ('Y','N')), BOOLEAN68 CHAR(1) NOT NULL CHECK (BOOLEAN68 IN ('Y','N')), BOOLEAN72 CHAR(1) NOT NULL CHECK (BOOLEAN72 IN ('Y','N')), BOOLEAN73 CHAR(1) NOT NULL CHECK (BOOLEAN73 IN ('Y','N')), BOOLEAN74 CHAR(1) NOT NULL CHECK (BOOLEAN74 IN ('Y','N')), BOOLEAN76 CHAR(1) NOT NULL CHECK (BOOLEAN76 IN ('Y','N')), BOOLEAN77 CHAR(1) NOT NULL CHECK (BOOLEAN77 IN ('Y','N')), BOOLEAN78 CHAR(1) NOT NULL CHECK (BOOLEAN78 IN ('Y','N')), BOOLEAN83 CHAR(1) NOT NULL CHECK (BOOLEAN83 IN ('Y','N')), BOOLEAN84 CHAR(1) NOT NULL CHECK (BOOLEAN84 IN ('Y','N')), BOOLEAN85 CHAR(1) NOT NULL CHECK (BOOLEAN85 IN ('Y','N')), BOOLEAN88 CHAR(1) NOT NULL CHECK (BOOLEAN88 IN ('Y','N')), BOOLEAN89 CHAR(1) NOT NULL CHECK (BOOLEAN89 IN ('Y','N')), BOOLEAN90 CHAR(1) NOT NULL CHECK (BOOLEAN90 IN ('Y','N')), BOOLEAN92 CHAR(1) NOT NULL CHECK (BOOLEAN92 IN ('Y','N')), BOOLEAN93 CHAR(1) NOT NULL CHECK (BOOLEAN93 IN ('Y','N')), BOOLEAN94 CHAR(1) NOT NULL CHECK (BOOLEAN94 IN ('Y','N')) ); ALTER TABLE FIELDSOFPRIMITIVEBOOLEAN ADD CONSTRAINT FIELDSOFPRIMC2_PK PRIMARY KEY (DATASTORE_IDENTITY); CREATE TABLE FIELDSOFPRIMITIVEBYTE ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, IDENTIFIER INTEGER, BYTE0 SMALLINT NOT NULL, BYTE1 SMALLINT NOT NULL, BYTE102 SMALLINT NOT NULL, BYTE103 SMALLINT NOT NULL, BYTE104 SMALLINT NOT NULL, BYTE108 SMALLINT NOT NULL, BYTE109 SMALLINT NOT NULL, BYTE11 SMALLINT NOT NULL, BYTE110 SMALLINT NOT NULL, BYTE112 SMALLINT NOT NULL, BYTE113 SMALLINT NOT NULL, BYTE114 SMALLINT NOT NULL, BYTE119 SMALLINT NOT NULL, BYTE12 SMALLINT NOT NULL, BYTE120 SMALLINT NOT NULL, BYTE121 SMALLINT NOT NULL, BYTE124 SMALLINT NOT NULL, BYTE125 SMALLINT NOT NULL, BYTE126 SMALLINT NOT NULL, BYTE128 SMALLINT NOT NULL, BYTE129 SMALLINT NOT NULL, BYTE13 SMALLINT NOT NULL, BYTE130 SMALLINT NOT NULL, BYTE138 SMALLINT NOT NULL, BYTE139 SMALLINT NOT NULL, BYTE140 SMALLINT NOT NULL, BYTE16 SMALLINT NOT NULL, BYTE17 SMALLINT NOT NULL, BYTE18 SMALLINT NOT NULL, BYTE2 SMALLINT NOT NULL, BYTE20 SMALLINT NOT NULL, BYTE21 SMALLINT NOT NULL, BYTE22 SMALLINT NOT NULL, BYTE30 SMALLINT NOT NULL, BYTE31 SMALLINT NOT NULL, BYTE32 SMALLINT NOT NULL, BYTE36 SMALLINT NOT NULL, BYTE37 SMALLINT NOT NULL, BYTE38 SMALLINT NOT NULL, BYTE4 SMALLINT NOT NULL, BYTE40 SMALLINT NOT NULL, BYTE41 SMALLINT NOT NULL, BYTE42 SMALLINT NOT NULL, BYTE47 SMALLINT NOT NULL, BYTE48 SMALLINT NOT NULL, BYTE49 SMALLINT NOT NULL, BYTE5 SMALLINT NOT NULL, BYTE52 SMALLINT NOT NULL, BYTE53 SMALLINT NOT NULL, BYTE54 SMALLINT NOT NULL, BYTE56 SMALLINT NOT NULL, BYTE57 SMALLINT NOT NULL, BYTE58 SMALLINT NOT NULL, BYTE6 SMALLINT NOT NULL, BYTE66 SMALLINT NOT NULL, BYTE67 SMALLINT NOT NULL, BYTE68 SMALLINT NOT NULL, BYTE72 SMALLINT NOT NULL, BYTE73 SMALLINT NOT NULL, BYTE74 SMALLINT NOT NULL, BYTE76 SMALLINT NOT NULL, BYTE77 SMALLINT NOT NULL, BYTE78 SMALLINT NOT NULL, BYTE83 SMALLINT NOT NULL, BYTE84 SMALLINT NOT NULL, BYTE85 SMALLINT NOT NULL, BYTE88 SMALLINT NOT NULL, BYTE89 SMALLINT NOT NULL, BYTE90 SMALLINT NOT NULL, BYTE92 SMALLINT NOT NULL, BYTE93 SMALLINT NOT NULL, BYTE94 SMALLINT NOT NULL ); ALTER TABLE FIELDSOFPRIMITIVEBYTE ADD CONSTRAINT FIELDSOFPRIMSD_PK PRIMARY KEY (DATASTORE_IDENTITY); CREATE TABLE FIELDSOFPRIMITIVECHAR ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, IDENTIFIER INTEGER, CHAR0 CHAR(1) NOT NULL, CHAR1 CHAR(1) NOT NULL, CHAR102 CHAR(1) NOT NULL, CHAR103 CHAR(1) NOT NULL, CHAR104 CHAR(1) NOT NULL, CHAR108 CHAR(1) NOT NULL, CHAR109 CHAR(1) NOT NULL, CHAR11 CHAR(1) NOT NULL, CHAR110 CHAR(1) NOT NULL, CHAR112 CHAR(1) NOT NULL, CHAR113 CHAR(1) NOT NULL, CHAR114 CHAR(1) NOT NULL, CHAR119 CHAR(1) NOT NULL, CHAR12 CHAR(1) NOT NULL, CHAR120 CHAR(1) NOT NULL, CHAR121 CHAR(1) NOT NULL, CHAR124 CHAR(1) NOT NULL, CHAR125 CHAR(1) NOT NULL, CHAR126 CHAR(1) NOT NULL, CHAR128 CHAR(1) NOT NULL, CHAR129 CHAR(1) NOT NULL, CHAR13 CHAR(1) NOT NULL, CHAR130 CHAR(1) NOT NULL, CHAR138 CHAR(1) NOT NULL, CHAR139 CHAR(1) NOT NULL, CHAR140 CHAR(1) NOT NULL, CHAR16 CHAR(1) NOT NULL, CHAR17 CHAR(1) NOT NULL, CHAR18 CHAR(1) NOT NULL, CHAR2 CHAR(1) NOT NULL, CHAR20 CHAR(1) NOT NULL, CHAR21 CHAR(1) NOT NULL, CHAR22 CHAR(1) NOT NULL, CHAR30 CHAR(1) NOT NULL, CHAR31 CHAR(1) NOT NULL, CHAR32 CHAR(1) NOT NULL, CHAR36 CHAR(1) NOT NULL, CHAR37 CHAR(1) NOT NULL, CHAR38 CHAR(1) NOT NULL, CHAR4 CHAR(1) NOT NULL, CHAR40 CHAR(1) NOT NULL, CHAR41 CHAR(1) NOT NULL, CHAR42 CHAR(1) NOT NULL, CHAR47 CHAR(1) NOT NULL, CHAR48 CHAR(1) NOT NULL, CHAR49 CHAR(1) NOT NULL, CHAR5 CHAR(1) NOT NULL, CHAR52 CHAR(1) NOT NULL, CHAR53 CHAR(1) NOT NULL, CHAR54 CHAR(1) NOT NULL, CHAR56 CHAR(1) NOT NULL, CHAR57 CHAR(1) NOT NULL, CHAR58 CHAR(1) NOT NULL, CHAR6 CHAR(1) NOT NULL, CHAR66 CHAR(1) NOT NULL, CHAR67 CHAR(1) NOT NULL, CHAR68 CHAR(1) NOT NULL, CHAR72 CHAR(1) NOT NULL, CHAR73 CHAR(1) NOT NULL, CHAR74 CHAR(1) NOT NULL, CHAR76 CHAR(1) NOT NULL, CHAR77 CHAR(1) NOT NULL, CHAR78 CHAR(1) NOT NULL, CHAR83 CHAR(1) NOT NULL, CHAR84 CHAR(1) NOT NULL, CHAR85 CHAR(1) NOT NULL, CHAR88 CHAR(1) NOT NULL, CHAR89 CHAR(1) NOT NULL, CHAR90 CHAR(1) NOT NULL, CHAR92 CHAR(1) NOT NULL, CHAR93 CHAR(1) NOT NULL, CHAR94 CHAR(1) NOT NULL ); ALTER TABLE FIELDSOFPRIMITIVECHAR ADD CONSTRAINT FIELDSOFPRIMQ3_PK PRIMARY KEY (DATASTORE_IDENTITY); CREATE TABLE FIELDSOFPRIMITIVEDOUBLE ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, IDENTIFIER INTEGER, DOUBLE0 DOUBLE NOT NULL, DOUBLE1 DOUBLE NOT NULL, DOUBLE102 DOUBLE NOT NULL, DOUBLE103 DOUBLE NOT NULL, DOUBLE104 DOUBLE NOT NULL, DOUBLE108 DOUBLE NOT NULL, DOUBLE109 DOUBLE NOT NULL, DOUBLE11 DOUBLE NOT NULL, DOUBLE110 DOUBLE NOT NULL, DOUBLE112 DOUBLE NOT NULL, DOUBLE113 DOUBLE NOT NULL, DOUBLE114 DOUBLE NOT NULL, DOUBLE119 DOUBLE NOT NULL, DOUBLE12 DOUBLE NOT NULL, DOUBLE120 DOUBLE NOT NULL, DOUBLE121 DOUBLE NOT NULL, DOUBLE124 DOUBLE NOT NULL, DOUBLE125 DOUBLE NOT NULL, DOUBLE126 DOUBLE NOT NULL, DOUBLE128 DOUBLE NOT NULL, DOUBLE129 DOUBLE NOT NULL, DOUBLE13 DOUBLE NOT NULL, DOUBLE130 DOUBLE NOT NULL, DOUBLE138 DOUBLE NOT NULL, DOUBLE139 DOUBLE NOT NULL, DOUBLE140 DOUBLE NOT NULL, DOUBLE16 DOUBLE NOT NULL, DOUBLE17 DOUBLE NOT NULL, DOUBLE18 DOUBLE NOT NULL, DOUBLE2 DOUBLE NOT NULL, DOUBLE20 DOUBLE NOT NULL, DOUBLE21 DOUBLE NOT NULL, DOUBLE22 DOUBLE NOT NULL, DOUBLE30 DOUBLE NOT NULL, DOUBLE31 DOUBLE NOT NULL, DOUBLE32 DOUBLE NOT NULL, DOUBLE36 DOUBLE NOT NULL, DOUBLE37 DOUBLE NOT NULL, DOUBLE38 DOUBLE NOT NULL, DOUBLE4 DOUBLE NOT NULL, DOUBLE40 DOUBLE NOT NULL, DOUBLE41 DOUBLE NOT NULL, DOUBLE42 DOUBLE NOT NULL, DOUBLE47 DOUBLE NOT NULL, DOUBLE48 DOUBLE NOT NULL, DOUBLE49 DOUBLE NOT NULL, DOUBLE5 DOUBLE NOT NULL, DOUBLE52 DOUBLE NOT NULL, DOUBLE53 DOUBLE NOT NULL, DOUBLE54 DOUBLE NOT NULL, DOUBLE56 DOUBLE NOT NULL, DOUBLE57 DOUBLE NOT NULL, DOUBLE58 DOUBLE NOT NULL, DOUBLE6 DOUBLE NOT NULL, DOUBLE66 DOUBLE NOT NULL, DOUBLE67 DOUBLE NOT NULL, DOUBLE68 DOUBLE NOT NULL, DOUBLE72 DOUBLE NOT NULL, DOUBLE73 DOUBLE NOT NULL, DOUBLE74 DOUBLE NOT NULL, DOUBLE76 DOUBLE NOT NULL, DOUBLE77 DOUBLE NOT NULL, DOUBLE78 DOUBLE NOT NULL, DOUBLE83 DOUBLE NOT NULL, DOUBLE84 DOUBLE NOT NULL, DOUBLE85 DOUBLE NOT NULL, DOUBLE88 DOUBLE NOT NULL, DOUBLE89 DOUBLE NOT NULL, DOUBLE90 DOUBLE NOT NULL, DOUBLE92 DOUBLE NOT NULL, DOUBLE93 DOUBLE NOT NULL, DOUBLE94 DOUBLE NOT NULL ); ALTER TABLE FIELDSOFPRIMITIVEDOUBLE ADD CONSTRAINT FIELDSOFPRIMHH_PK PRIMARY KEY (DATASTORE_IDENTITY); CREATE TABLE FIELDSOFPRIMITIVEFLOAT ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, IDENTIFIER INTEGER, FLOAT0 REAL NOT NULL, FLOAT1 REAL NOT NULL, FLOAT102 REAL NOT NULL, FLOAT103 REAL NOT NULL, FLOAT104 REAL NOT NULL, FLOAT108 REAL NOT NULL, FLOAT109 REAL NOT NULL, FLOAT11 REAL NOT NULL, FLOAT110 REAL NOT NULL, FLOAT112 REAL NOT NULL, FLOAT113 REAL NOT NULL, FLOAT114 REAL NOT NULL, FLOAT119 REAL NOT NULL, FLOAT12 REAL NOT NULL, FLOAT120 REAL NOT NULL, FLOAT121 REAL NOT NULL, FLOAT124 REAL NOT NULL, FLOAT125 REAL NOT NULL, FLOAT126 REAL NOT NULL, FLOAT128 REAL NOT NULL, FLOAT129 REAL NOT NULL, FLOAT13 REAL NOT NULL, FLOAT130 REAL NOT NULL, FLOAT138 REAL NOT NULL, FLOAT139 REAL NOT NULL, FLOAT140 REAL NOT NULL, FLOAT16 REAL NOT NULL, FLOAT17 REAL NOT NULL, FLOAT18 REAL NOT NULL, FLOAT2 REAL NOT NULL, FLOAT20 REAL NOT NULL, FLOAT21 REAL NOT NULL, FLOAT22 REAL NOT NULL, FLOAT30 REAL NOT NULL, FLOAT31 REAL NOT NULL, FLOAT32 REAL NOT NULL, FLOAT36 REAL NOT NULL, FLOAT37 REAL NOT NULL, FLOAT38 REAL NOT NULL, FLOAT4 REAL NOT NULL, FLOAT40 REAL NOT NULL, FLOAT41 REAL NOT NULL, FLOAT42 REAL NOT NULL, FLOAT47 REAL NOT NULL, FLOAT48 REAL NOT NULL, FLOAT49 REAL NOT NULL, FLOAT5 REAL NOT NULL, FLOAT52 REAL NOT NULL, FLOAT53 REAL NOT NULL, FLOAT54 REAL NOT NULL, FLOAT56 REAL NOT NULL, FLOAT57 REAL NOT NULL, FLOAT58 REAL NOT NULL, FLOAT6 REAL NOT NULL, FLOAT66 REAL NOT NULL, FLOAT67 REAL NOT NULL, FLOAT68 REAL NOT NULL, FLOAT72 REAL NOT NULL, FLOAT73 REAL NOT NULL, FLOAT74 REAL NOT NULL, FLOAT76 REAL NOT NULL, FLOAT77 REAL NOT NULL, FLOAT78 REAL NOT NULL, FLOAT83 REAL NOT NULL, FLOAT84 REAL NOT NULL, FLOAT85 REAL NOT NULL, FLOAT88 REAL NOT NULL, FLOAT89 REAL NOT NULL, FLOAT90 REAL NOT NULL, FLOAT92 REAL NOT NULL, FLOAT93 REAL NOT NULL, FLOAT94 REAL NOT NULL ); ALTER TABLE FIELDSOFPRIMITIVEFLOAT ADD CONSTRAINT FIELDSOFPRIMR3_PK PRIMARY KEY (DATASTORE_IDENTITY); CREATE TABLE FIELDSOFPRIMITIVEINT ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, IDENTIFIER INTEGER, INT0 INTEGER NOT NULL, INT1 INTEGER NOT NULL, INT102 INTEGER NOT NULL, INT103 INTEGER NOT NULL, INT104 INTEGER NOT NULL, INT108 INTEGER NOT NULL, INT109 INTEGER NOT NULL, INT11 INTEGER NOT NULL, INT110 INTEGER NOT NULL, INT112 INTEGER NOT NULL, INT113 INTEGER NOT NULL, INT114 INTEGER NOT NULL, INT119 INTEGER NOT NULL, INT12 INTEGER NOT NULL, INT120 INTEGER NOT NULL, INT121 INTEGER NOT NULL, INT124 INTEGER NOT NULL, INT125 INTEGER NOT NULL, INT126 INTEGER NOT NULL, INT128 INTEGER NOT NULL, INT129 INTEGER NOT NULL, INT13 INTEGER NOT NULL, INT130 INTEGER NOT NULL, INT138 INTEGER NOT NULL, INT139 INTEGER NOT NULL, INT140 INTEGER NOT NULL, INT16 INTEGER NOT NULL, INT17 INTEGER NOT NULL, INT18 INTEGER NOT NULL, INT2 INTEGER NOT NULL, INT20 INTEGER NOT NULL, INT21 INTEGER NOT NULL, INT22 INTEGER NOT NULL, INT30 INTEGER NOT NULL, INT31 INTEGER NOT NULL, INT32 INTEGER NOT NULL, INT36 INTEGER NOT NULL, INT37 INTEGER NOT NULL, INT38 INTEGER NOT NULL, INT4 INTEGER NOT NULL, INT40 INTEGER NOT NULL, INT41 INTEGER NOT NULL, INT42 INTEGER NOT NULL, INT47 INTEGER NOT NULL, INT48 INTEGER NOT NULL, INT49 INTEGER NOT NULL, INT5 INTEGER NOT NULL, INT52 INTEGER NOT NULL, INT53 INTEGER NOT NULL, INT54 INTEGER NOT NULL, INT56 INTEGER NOT NULL, INT57 INTEGER NOT NULL, INT58 INTEGER NOT NULL, INT6 INTEGER NOT NULL, INT66 INTEGER NOT NULL, INT67 INTEGER NOT NULL, INT68 INTEGER NOT NULL, INT72 INTEGER NOT NULL, INT73 INTEGER NOT NULL, INT74 INTEGER NOT NULL, INT76 INTEGER NOT NULL, INT77 INTEGER NOT NULL, INT78 INTEGER NOT NULL, INT83 INTEGER NOT NULL, INT84 INTEGER NOT NULL, INT85 INTEGER NOT NULL, INT88 INTEGER NOT NULL, INT89 INTEGER NOT NULL, INT90 INTEGER NOT NULL, INT92 INTEGER NOT NULL, INT93 INTEGER NOT NULL, INT94 INTEGER NOT NULL ); ALTER TABLE FIELDSOFPRIMITIVEINT ADD CONSTRAINT FIELDSOFPRIMT6_PK PRIMARY KEY (DATASTORE_IDENTITY); CREATE TABLE FIELDSOFPRIMITIVELONG ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, IDENTIFIER INTEGER, LONG0 BIGINT NOT NULL, LONG1 BIGINT NOT NULL, LONG102 BIGINT NOT NULL, LONG103 BIGINT NOT NULL, LONG104 BIGINT NOT NULL, LONG108 BIGINT NOT NULL, LONG109 BIGINT NOT NULL, LONG11 BIGINT NOT NULL, LONG110 BIGINT NOT NULL, LONG112 BIGINT NOT NULL, LONG113 BIGINT NOT NULL, LONG114 BIGINT NOT NULL, LONG119 BIGINT NOT NULL, LONG12 BIGINT NOT NULL, LONG120 BIGINT NOT NULL, LONG121 BIGINT NOT NULL, LONG124 BIGINT NOT NULL, LONG125 BIGINT NOT NULL, LONG126 BIGINT NOT NULL, LONG128 BIGINT NOT NULL, LONG129 BIGINT NOT NULL, LONG13 BIGINT NOT NULL, LONG130 BIGINT NOT NULL, LONG138 BIGINT NOT NULL, LONG139 BIGINT NOT NULL, LONG140 BIGINT NOT NULL, LONG16 BIGINT NOT NULL, LONG17 BIGINT NOT NULL, LONG18 BIGINT NOT NULL, LONG2 BIGINT NOT NULL, LONG20 BIGINT NOT NULL, LONG21 BIGINT NOT NULL, LONG22 BIGINT NOT NULL, LONG30 BIGINT NOT NULL, LONG31 BIGINT NOT NULL, LONG32 BIGINT NOT NULL, LONG36 BIGINT NOT NULL, LONG37 BIGINT NOT NULL, LONG38 BIGINT NOT NULL, LONG4 BIGINT NOT NULL, LONG40 BIGINT NOT NULL, LONG41 BIGINT NOT NULL, LONG42 BIGINT NOT NULL, LONG47 BIGINT NOT NULL, LONG48 BIGINT NOT NULL, LONG49 BIGINT NOT NULL, LONG5 BIGINT NOT NULL, LONG52 BIGINT NOT NULL, LONG53 BIGINT NOT NULL, LONG54 BIGINT NOT NULL, LONG56 BIGINT NOT NULL, LONG57 BIGINT NOT NULL, LONG58 BIGINT NOT NULL, LONG6 BIGINT NOT NULL, LONG66 BIGINT NOT NULL, LONG67 BIGINT NOT NULL, LONG68 BIGINT NOT NULL, LONG72 BIGINT NOT NULL, LONG73 BIGINT NOT NULL, LONG74 BIGINT NOT NULL, LONG76 BIGINT NOT NULL, LONG77 BIGINT NOT NULL, LONG78 BIGINT NOT NULL, LONG83 BIGINT NOT NULL, LONG84 BIGINT NOT NULL, LONG85 BIGINT NOT NULL, LONG88 BIGINT NOT NULL, LONG89 BIGINT NOT NULL, LONG90 BIGINT NOT NULL, LONG92 BIGINT NOT NULL, LONG93 BIGINT NOT NULL, LONG94 BIGINT NOT NULL ); ALTER TABLE FIELDSOFPRIMITIVELONG ADD CONSTRAINT FIELDSOFPRIMLL_PK PRIMARY KEY (DATASTORE_IDENTITY); CREATE TABLE FIELDSOFPRIMITIVESHORT ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, IDENTIFIER INTEGER, SHORT0 SMALLINT NOT NULL, SHORT1 SMALLINT NOT NULL, SHORT102 SMALLINT NOT NULL, SHORT103 SMALLINT NOT NULL, SHORT104 SMALLINT NOT NULL, SHORT108 SMALLINT NOT NULL, SHORT109 SMALLINT NOT NULL, SHORT11 SMALLINT NOT NULL, SHORT110 SMALLINT NOT NULL, SHORT112 SMALLINT NOT NULL, SHORT113 SMALLINT NOT NULL, SHORT114 SMALLINT NOT NULL, SHORT119 SMALLINT NOT NULL, SHORT12 SMALLINT NOT NULL, SHORT120 SMALLINT NOT NULL, SHORT121 SMALLINT NOT NULL, SHORT124 SMALLINT NOT NULL, SHORT125 SMALLINT NOT NULL, SHORT126 SMALLINT NOT NULL, SHORT128 SMALLINT NOT NULL, SHORT129 SMALLINT NOT NULL, SHORT13 SMALLINT NOT NULL, SHORT130 SMALLINT NOT NULL, SHORT138 SMALLINT NOT NULL, SHORT139 SMALLINT NOT NULL, SHORT140 SMALLINT NOT NULL, SHORT16 SMALLINT NOT NULL, SHORT17 SMALLINT NOT NULL, SHORT18 SMALLINT NOT NULL, SHORT2 SMALLINT NOT NULL, SHORT20 SMALLINT NOT NULL, SHORT21 SMALLINT NOT NULL, SHORT22 SMALLINT NOT NULL, SHORT30 SMALLINT NOT NULL, SHORT31 SMALLINT NOT NULL, SHORT32 SMALLINT NOT NULL, SHORT36 SMALLINT NOT NULL, SHORT37 SMALLINT NOT NULL, SHORT38 SMALLINT NOT NULL, SHORT4 SMALLINT NOT NULL, SHORT40 SMALLINT NOT NULL, SHORT41 SMALLINT NOT NULL, SHORT42 SMALLINT NOT NULL, SHORT47 SMALLINT NOT NULL, SHORT48 SMALLINT NOT NULL, SHORT49 SMALLINT NOT NULL, SHORT5 SMALLINT NOT NULL, SHORT52 SMALLINT NOT NULL, SHORT53 SMALLINT NOT NULL, SHORT54 SMALLINT NOT NULL, SHORT56 SMALLINT NOT NULL, SHORT57 SMALLINT NOT NULL, SHORT58 SMALLINT NOT NULL, SHORT6 SMALLINT NOT NULL, SHORT66 SMALLINT NOT NULL, SHORT67 SMALLINT NOT NULL, SHORT68 SMALLINT NOT NULL, SHORT72 SMALLINT NOT NULL, SHORT73 SMALLINT NOT NULL, SHORT74 SMALLINT NOT NULL, SHORT76 SMALLINT NOT NULL, SHORT77 SMALLINT NOT NULL, SHORT78 SMALLINT NOT NULL, SHORT83 SMALLINT NOT NULL, SHORT84 SMALLINT NOT NULL, SHORT85 SMALLINT NOT NULL, SHORT88 SMALLINT NOT NULL, SHORT89 SMALLINT NOT NULL, SHORT90 SMALLINT NOT NULL, SHORT92 SMALLINT NOT NULL, SHORT93 SMALLINT NOT NULL, SHORT94 SMALLINT NOT NULL ); ALTER TABLE FIELDSOFPRIMITIVESHORT ADD CONSTRAINT FIELDSOFPRIMXB_PK PRIMARY KEY (DATASTORE_IDENTITY); CREATE TABLE FIELDSOFSHORT ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, IDENTIFIER INTEGER, SHORT0 SMALLINT, SHORT1 SMALLINT, SHORT102 SMALLINT, SHORT103 SMALLINT, SHORT104 SMALLINT, SHORT108 SMALLINT, SHORT109 SMALLINT, SHORT11 SMALLINT, SHORT110 SMALLINT, SHORT112 SMALLINT, SHORT113 SMALLINT, SHORT114 SMALLINT, SHORT119 SMALLINT, SHORT12 SMALLINT, SHORT120 SMALLINT, SHORT121 SMALLINT, SHORT124 SMALLINT, SHORT125 SMALLINT, SHORT126 SMALLINT, SHORT128 SMALLINT, SHORT129 SMALLINT, SHORT13 SMALLINT, SHORT130 SMALLINT, SHORT138 SMALLINT, SHORT139 SMALLINT, SHORT140 SMALLINT, SHORT16 SMALLINT, SHORT17 SMALLINT, SHORT18 SMALLINT, SHORT2 SMALLINT, SHORT20 SMALLINT, SHORT21 SMALLINT, SHORT22 SMALLINT, SHORT30 SMALLINT, SHORT31 SMALLINT, SHORT32 SMALLINT, SHORT36 SMALLINT, SHORT37 SMALLINT, SHORT38 SMALLINT, SHORT4 SMALLINT, SHORT40 SMALLINT, SHORT41 SMALLINT, SHORT42 SMALLINT, SHORT47 SMALLINT, SHORT48 SMALLINT, SHORT49 SMALLINT, SHORT5 SMALLINT, SHORT52 SMALLINT, SHORT53 SMALLINT, SHORT54 SMALLINT, SHORT56 SMALLINT, SHORT57 SMALLINT, SHORT58 SMALLINT, SHORT6 SMALLINT, SHORT66 SMALLINT, SHORT67 SMALLINT, SHORT68 SMALLINT, SHORT72 SMALLINT, SHORT73 SMALLINT, SHORT74 SMALLINT, SHORT76 SMALLINT, SHORT77 SMALLINT, SHORT78 SMALLINT, SHORT83 SMALLINT, SHORT84 SMALLINT, SHORT85 SMALLINT, SHORT88 SMALLINT, SHORT89 SMALLINT, SHORT90 SMALLINT, SHORT92 SMALLINT, SHORT93 SMALLINT, SHORT94 SMALLINT ); ALTER TABLE FIELDSOFSHORT ADD CONSTRAINT FIELDSOFSHORT_PK PRIMARY KEY (DATASTORE_IDENTITY); CREATE TABLE FIELDSOFSTRING ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, IDENTIFIER INTEGER, STRING0 VARCHAR(255), STRING1 VARCHAR(255), STRING102 VARCHAR(255), STRING103 VARCHAR(255), STRING104 VARCHAR(255), STRING108 VARCHAR(255), STRING109 VARCHAR(255), STRING11 VARCHAR(255), STRING110 VARCHAR(255), STRING112 VARCHAR(255), STRING113 VARCHAR(255), STRING114 VARCHAR(255), STRING119 VARCHAR(255), STRING12 VARCHAR(255), STRING120 VARCHAR(255), STRING121 VARCHAR(255), STRING124 VARCHAR(255), STRING125 VARCHAR(255), STRING126 VARCHAR(255), STRING128 VARCHAR(255), STRING129 VARCHAR(255), STRING13 VARCHAR(255), STRING130 VARCHAR(255), STRING138 VARCHAR(255), STRING139 VARCHAR(255), STRING140 VARCHAR(255), STRING16 VARCHAR(255), STRING17 VARCHAR(255), STRING18 VARCHAR(255), STRING2 VARCHAR(255), STRING20 VARCHAR(255), STRING21 VARCHAR(255), STRING22 VARCHAR(255), STRING30 VARCHAR(255), STRING31 VARCHAR(255), STRING32 VARCHAR(255), STRING36 VARCHAR(255), STRING37 VARCHAR(255), STRING38 VARCHAR(255), STRING4 VARCHAR(255), STRING40 VARCHAR(255), STRING41 VARCHAR(255), STRING42 VARCHAR(255), STRING47 VARCHAR(255), STRING48 VARCHAR(255), STRING49 VARCHAR(255), STRING5 VARCHAR(255), STRING52 VARCHAR(255), STRING53 VARCHAR(255), STRING54 VARCHAR(255), STRING56 VARCHAR(255), STRING57 VARCHAR(255), STRING58 VARCHAR(255), STRING6 VARCHAR(255), STRING66 VARCHAR(255), STRING67 VARCHAR(255), STRING68 VARCHAR(255), STRING72 VARCHAR(255), STRING73 VARCHAR(255), STRING74 VARCHAR(255), STRING76 VARCHAR(255), STRING77 VARCHAR(255), STRING78 VARCHAR(255), STRING83 VARCHAR(255), STRING84 VARCHAR(255), STRING85 VARCHAR(255), STRING88 VARCHAR(255), STRING89 VARCHAR(255), STRING90 VARCHAR(255), STRING92 VARCHAR(255), STRING93 VARCHAR(255), STRING94 VARCHAR(255) ); ALTER TABLE FIELDSOFSTRING ADD CONSTRAINT FIELDSOFSTRING_PK PRIMARY KEY (DATASTORE_IDENTITY); CREATE TABLE FieldsOfByte ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, IDENTIFIER INTEGER, BYTE0 SMALLINT, BYTE1 SMALLINT, BYTE2 SMALLINT, BYTE4 SMALLINT, BYTE5 SMALLINT, BYTE6 SMALLINT, BYTE11 SMALLINT, BYTE12 SMALLINT, BYTE13 SMALLINT, BYTE16 SMALLINT, BYTE17 SMALLINT, BYTE18 SMALLINT, BYTE20 SMALLINT, BYTE21 SMALLINT, BYTE22 SMALLINT, BYTE30 SMALLINT, BYTE31 SMALLINT, BYTE32 SMALLINT, BYTE36 SMALLINT, BYTE37 SMALLINT, BYTE38 SMALLINT, BYTE40 SMALLINT, BYTE41 SMALLINT, BYTE42 SMALLINT, BYTE43 SMALLINT, BYTE47 SMALLINT, BYTE48 SMALLINT, BYTE49 SMALLINT, BYTE52 SMALLINT, BYTE53 SMALLINT, BYTE54 SMALLINT, BYTE56 SMALLINT, BYTE57 SMALLINT, BYTE58 SMALLINT, BYTE66 SMALLINT, BYTE67 SMALLINT, BYTE68 SMALLINT, BYTE72 SMALLINT, BYTE73 SMALLINT, BYTE74 SMALLINT, BYTE76 SMALLINT, BYTE77 SMALLINT, BYTE78 SMALLINT, BYTE83 SMALLINT, BYTE84 SMALLINT, BYTE85 SMALLINT, BYTE88 SMALLINT, BYTE89 SMALLINT, BYTE90 SMALLINT, BYTE92 SMALLINT, BYTE93 SMALLINT, BYTE94 SMALLINT, BYTE102 SMALLINT, BYTE103 SMALLINT, BYTE104 SMALLINT, BYTE108 SMALLINT, BYTE109 SMALLINT, BYTE110 SMALLINT, BYTE112 SMALLINT, BYTE113 SMALLINT, BYTE114 SMALLINT, BYTE119 SMALLINT, BYTE120 SMALLINT, BYTE121 SMALLINT, BYTE124 SMALLINT, BYTE125 SMALLINT, BYTE126 SMALLINT, BYTE128 SMALLINT, BYTE129 SMALLINT, BYTE130 SMALLINT, BYTE138 SMALLINT, BYTE139 SMALLINT, BYTE140 SMALLINT, CONSTRAINT FieldsOfByte_PK PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE FIELDSOFSIMPLECLASS ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, IDENTIFIER INTEGER, ID1 BIGINT, INTFIELD1 INTEGER, STRINGFIELD1 VARCHAR(1024), SIMPLECLASS0 BIGINT REFERENCES SIMPLE_CLASS, SIMPLECLASS102 BIGINT REFERENCES SIMPLE_CLASS, ID103 BIGINT, INTFIELD103 INTEGER, STRINGFIELD103 VARCHAR(1024), SIMPLECLASS104 BIGINT REFERENCES SIMPLE_CLASS, SIMPLECLASS108 BIGINT REFERENCES SIMPLE_CLASS, ID109 BIGINT, INTFIELD109 INTEGER, STRINGFIELD109 VARCHAR(1024), SIMPLECLASS11 BIGINT REFERENCES SIMPLE_CLASS, SIMPLECLASS110 BIGINT REFERENCES SIMPLE_CLASS, SIMPLECLASS112 BIGINT REFERENCES SIMPLE_CLASS, ID113 BIGINT, INTFIELD113 INTEGER, STRINGFIELD113 VARCHAR(1024), SIMPLECLASS114 BIGINT REFERENCES SIMPLE_CLASS, SIMPLECLASS119 BIGINT REFERENCES SIMPLE_CLASS, ID12 BIGINT, INTFIELD12 INTEGER, STRINGFIELD12 VARCHAR(1024), ID120 BIGINT, INTFIELD120 INTEGER, STRINGFIELD120 VARCHAR(1024), SIMPLECLASS121 BIGINT REFERENCES SIMPLE_CLASS, SIMPLECLASS124 BIGINT REFERENCES SIMPLE_CLASS, ID125 BIGINT, INTFIELD125 INTEGER, STRINGFIELD125 VARCHAR(1024), SIMPLECLASS126 BIGINT REFERENCES SIMPLE_CLASS, SIMPLECLASS128 BIGINT REFERENCES SIMPLE_CLASS, ID129 BIGINT, INTFIELD129 INTEGER, STRINGFIELD129 VARCHAR(1024), SIMPLECLASS13 BIGINT REFERENCES SIMPLE_CLASS, SIMPLECLASS130 BIGINT REFERENCES SIMPLE_CLASS, SIMPLECLASS138 BIGINT REFERENCES SIMPLE_CLASS, ID139 BIGINT, INTFIELD139 INTEGER, STRINGFIELD139 VARCHAR(1024), SIMPLECLASS140 BIGINT REFERENCES SIMPLE_CLASS, SIMPLECLASS16 BIGINT REFERENCES SIMPLE_CLASS, ID17 BIGINT, INTFIELD17 INTEGER, STRINGFIELD17 VARCHAR(1024), SIMPLECLASS18 BIGINT REFERENCES SIMPLE_CLASS, SIMPLECLASS2 BIGINT REFERENCES SIMPLE_CLASS, SIMPLECLASS20 BIGINT REFERENCES SIMPLE_CLASS, ID21 BIGINT, INTFIELD21 INTEGER, STRINGFIELD21 VARCHAR(1024), SIMPLECLASS22 BIGINT REFERENCES SIMPLE_CLASS, SIMPLECLASS30 BIGINT REFERENCES SIMPLE_CLASS, ID31 BIGINT, INTFIELD31 INTEGER, STRINGFIELD31 VARCHAR(1024), SIMPLECLASS32 BIGINT REFERENCES SIMPLE_CLASS, SIMPLECLASS36 BIGINT REFERENCES SIMPLE_CLASS, ID37 BIGINT, INTFIELD37 INTEGER, STRINGFIELD37 VARCHAR(1024), SIMPLECLASS38 BIGINT REFERENCES SIMPLE_CLASS, SIMPLECLASS4 BIGINT REFERENCES SIMPLE_CLASS, SIMPLECLASS40 BIGINT REFERENCES SIMPLE_CLASS, ID41 BIGINT, INTFIELD41 INTEGER, STRINGFIELD41 VARCHAR(1024), SIMPLECLASS42 BIGINT REFERENCES SIMPLE_CLASS, SIMPLECLASS47 BIGINT REFERENCES SIMPLE_CLASS, ID48 BIGINT, INTFIELD48 INTEGER, STRINGFIELD48 VARCHAR(1024), SIMPLECLASS49 BIGINT REFERENCES SIMPLE_CLASS, ID5 BIGINT, INTFIELD5 INTEGER, STRINGFIELD5 VARCHAR(1024), SIMPLECLASS52 BIGINT REFERENCES SIMPLE_CLASS, ID53 BIGINT, INTFIELD53 INTEGER, STRINGFIELD53 VARCHAR(1024), SIMPLECLASS54 BIGINT REFERENCES SIMPLE_CLASS, SIMPLECLASS56 BIGINT REFERENCES SIMPLE_CLASS, ID57 BIGINT, INTFIELD57 INTEGER, STRINGFIELD57 VARCHAR(1024), SIMPLECLASS58 BIGINT REFERENCES SIMPLE_CLASS, SIMPLECLASS6 BIGINT REFERENCES SIMPLE_CLASS, SIMPLECLASS66 BIGINT REFERENCES SIMPLE_CLASS, ID67 BIGINT, INTFIELD67 INTEGER, STRINGFIELD67 VARCHAR(1024), SIMPLECLASS68 BIGINT REFERENCES SIMPLE_CLASS, SIMPLECLASS72 BIGINT REFERENCES SIMPLE_CLASS, ID73 BIGINT, INTFIELD73 INTEGER, STRINGFIELD73 VARCHAR(1024), SIMPLECLASS74 BIGINT REFERENCES SIMPLE_CLASS, SIMPLECLASS76 BIGINT REFERENCES SIMPLE_CLASS, ID77 BIGINT, INTFIELD77 INTEGER, STRINGFIELD77 VARCHAR(1024), SIMPLECLASS78 BIGINT REFERENCES SIMPLE_CLASS, SIMPLECLASS83 BIGINT REFERENCES SIMPLE_CLASS, ID84 BIGINT, INTFIELD84 INTEGER, STRINGFIELD84 VARCHAR(1024), SIMPLECLASS85 BIGINT REFERENCES SIMPLE_CLASS, SIMPLECLASS88 BIGINT REFERENCES SIMPLE_CLASS, ID89 BIGINT, INTFIELD89 INTEGER, STRINGFIELD89 VARCHAR(1024), SIMPLECLASS90 BIGINT REFERENCES SIMPLE_CLASS, SIMPLECLASS92 BIGINT REFERENCES SIMPLE_CLASS, ID93 BIGINT, INTFIELD93 INTEGER, STRINGFIELD93 VARCHAR(1024), SIMPLECLASS94 BIGINT REFERENCES SIMPLE_CLASS, SIMPLECLASS144 LONG VARCHAR FOR BIT DATA, SIMPLECLASS145 LONG VARCHAR FOR BIT DATA, SIMPLECLASS146 LONG VARCHAR FOR BIT DATA, SIMPLECLASS147 LONG VARCHAR FOR BIT DATA, SIMPLECLASS148 LONG VARCHAR FOR BIT DATA, SIMPLECLASS149 LONG VARCHAR FOR BIT DATA, SIMPLECLASS150 LONG VARCHAR FOR BIT DATA, SIMPLECLASS151 LONG VARCHAR FOR BIT DATA, SIMPLECLASS152 LONG VARCHAR FOR BIT DATA, SIMPLECLASS153 LONG VARCHAR FOR BIT DATA, SIMPLECLASS154 LONG VARCHAR FOR BIT DATA, SIMPLECLASS155 LONG VARCHAR FOR BIT DATA, SIMPLECLASS156 LONG VARCHAR FOR BIT DATA, SIMPLECLASS157 LONG VARCHAR FOR BIT DATA, SIMPLECLASS158 LONG VARCHAR FOR BIT DATA, SIMPLECLASS159 LONG VARCHAR FOR BIT DATA, SIMPLECLASS160 LONG VARCHAR FOR BIT DATA, SIMPLECLASS161 LONG VARCHAR FOR BIT DATA, SIMPLECLASS162 LONG VARCHAR FOR BIT DATA, SIMPLECLASS163 LONG VARCHAR FOR BIT DATA, SIMPLECLASS164 LONG VARCHAR FOR BIT DATA, SIMPLECLASS165 LONG VARCHAR FOR BIT DATA, SIMPLECLASS166 LONG VARCHAR FOR BIT DATA, SIMPLECLASS167 LONG VARCHAR FOR BIT DATA, CONSTRAINT FieldsOfSimpCls_PK PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE ARRAY_COLLECTIONS ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, IDENTIFIER INTEGER NOT NULL, ARRAY_OF_STRING6 LONG VARCHAR FOR BIT DATA, ARRAY_OF_DATE8 LONG VARCHAR FOR BIT DATA, ARRAY_OF_LOCALE10 LONG VARCHAR FOR BIT DATA, ARRAY_OF_BIG_DECIMAL12 LONG VARCHAR FOR BIT DATA, ARRAY_OF_BIG_INTEGER14 LONG VARCHAR FOR BIT DATA, ARRAY_OF_BYTE16 LONG VARCHAR FOR BIT DATA, ARRAY_OF_DOUBLE18 LONG VARCHAR FOR BIT DATA, ARRAY_OF_FLOAT20 LONG VARCHAR FOR BIT DATA, ARRAY_OF_INTEGER22 LONG VARCHAR FOR BIT DATA, ARRAY_OF_LONG24 LONG VARCHAR FOR BIT DATA, ARRAY_OF_SHORT26 LONG VARCHAR FOR BIT DATA, ARRAY_OF_SIMPLEENUM28 LONG VARCHAR FOR BIT DATA, CONSTRAINT AC_PK PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE ARRAY_OF_OBJECT0 ( IDENTIFIER INTEGER REFERENCES ARRAY_COLLECTIONS NOT NULL, ORDER_COL BIGINT, OBJVAL LONG VARCHAR FOR BIT DATA ); CREATE TABLE ARRAY_OF_OBJECT1 ( IDENTIFIER INTEGER REFERENCES ARRAY_COLLECTIONS NOT NULL, ORDER_COL BIGINT, OBJREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE ARRAY_OF_SIMPLE_CLASS2 ( IDENTIFIER INTEGER REFERENCES ARRAY_COLLECTIONS NOT NULL, ORDER_COL BIGINT, OBJVAL LONG VARCHAR FOR BIT DATA ); CREATE TABLE ARRAY_OF_SIMPLE_CLASS3 ( IDENTIFIER INTEGER REFERENCES ARRAY_COLLECTIONS NOT NULL, ORDER_COL BIGINT, OBJREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE ARRAY_OF_SIMPLE_INTERFACE4 ( IDENTIFIER INTEGER REFERENCES ARRAY_COLLECTIONS NOT NULL, ORDER_COL BIGINT, OBJVAL LONG VARCHAR FOR BIT DATA ); CREATE TABLE ARRAY_OF_SIMPLE_INTERFACE5 ( IDENTIFIER INTEGER REFERENCES ARRAY_COLLECTIONS NOT NULL, ORDER_COL BIGINT, OBJREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE ARRAY_OF_STRING7 ( IDENTIFIER INTEGER REFERENCES ARRAY_COLLECTIONS NOT NULL, ORDER_COL BIGINT, STRINGVAL VARCHAR(1024) ); CREATE TABLE ARRAY_OF_DATE9 ( IDENTIFIER INTEGER REFERENCES ARRAY_COLLECTIONS NOT NULL, ORDER_COL BIGINT, DATEVAL TIMESTAMP ); CREATE TABLE ARRAY_OF_LOCALE11 ( IDENTIFIER INTEGER REFERENCES ARRAY_COLLECTIONS NOT NULL, ORDER_COL BIGINT, LOCALEVAL CHAR(20) ); CREATE TABLE ARRAY_OF_BIG_DECIMAL13 ( IDENTIFIER INTEGER REFERENCES ARRAY_COLLECTIONS NOT NULL, ORDER_COL BIGINT, BIG_DECIMALVAL DECIMAL(27,16) ); CREATE TABLE ARRAY_OF_BIG_INTEGER15 ( IDENTIFIER INTEGER REFERENCES ARRAY_COLLECTIONS NOT NULL, ORDER_COL BIGINT, BIG_INTEGERVAL NUMERIC(31) ); CREATE TABLE ARRAY_OF_BYTE17 ( IDENTIFIER INTEGER REFERENCES ARRAY_COLLECTIONS NOT NULL, ORDER_COL BIGINT, BYTEVAL SMALLINT ); CREATE TABLE ARRAY_OF_DOUBLE19 ( IDENTIFIER INTEGER REFERENCES ARRAY_COLLECTIONS NOT NULL, ORDER_COL BIGINT, DOUBLEVAL DOUBLE ); CREATE TABLE ARRAY_OF_FLOAT21 ( IDENTIFIER INTEGER REFERENCES ARRAY_COLLECTIONS NOT NULL, ORDER_COL BIGINT, FLOATVAL REAL ); CREATE TABLE ARRAY_OF_INTEGER23 ( IDENTIFIER INTEGER REFERENCES ARRAY_COLLECTIONS NOT NULL, ORDER_COL BIGINT, INTEGERVAL INTEGER ); CREATE TABLE ARRAY_OF_LONG25 ( IDENTIFIER INTEGER REFERENCES ARRAY_COLLECTIONS NOT NULL, ORDER_COL BIGINT, LONGVAL BIGINT ); CREATE TABLE ARRAY_OF_SHORT27 ( IDENTIFIER INTEGER REFERENCES ARRAY_COLLECTIONS NOT NULL, ORDER_COL BIGINT, SHORTVAL SMALLINT ); CREATE TABLE ARRAY_OF_SIMPLEENUM29 ( IDENTIFIER INTEGER REFERENCES ARRAY_COLLECTIONS NOT NULL, ORDER_COL BIGINT, ENUMVAL CHAR(2) ); CREATE TABLE ARRAY_OF_SIMPLEENUM30 ( IDENTIFIER INTEGER REFERENCES ARRAY_COLLECTIONS NOT NULL, ORDER_COL BIGINT, ENUMVAL NUMERIC(2,0) ); --CollectionCollections CREATE TABLE COLLECTION_COLLECTIONS ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, IDENTIFIER INTEGER, COLLECTION_OF_STRING11 LONG VARCHAR FOR BIT DATA, COLLECTION_OF_DATE14 LONG VARCHAR FOR BIT DATA, COLLECTION_OF_LOCALE17 LONG VARCHAR FOR BIT DATA, COLLECTION_OF_BIG_DECIMAL20 LONG VARCHAR FOR BIT DATA, COLLECTION_OF_BIG_INTEGER23 LONG VARCHAR FOR BIT DATA, COLLECTION_OF_BYTE26 LONG VARCHAR FOR BIT DATA, COLLECTION_OF_DOUBLE29 LONG VARCHAR FOR BIT DATA, COLLECTION_OF_FLOAT32 LONG VARCHAR FOR BIT DATA, COLLECTION_OF_INTEGER35 LONG VARCHAR FOR BIT DATA, COLLECTION_OF_LONG38 LONG VARCHAR FOR BIT DATA, COLLECTION_OF_SHORT41 LONG VARCHAR FOR BIT DATA, COLLECTION_OF_SIMPLE_CLASS42 LONG VARCHAR FOR BIT DATA, CONSTRAINT CC_PK PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE COLLECTION_OF_OBJECT0 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, OBJREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE COLLECTION_OF_OBJECT1 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE COLLECTION_OF_OBJECT2 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, COLLVAL LONG VARCHAR FOR BIT DATA ); CREATE TABLE COLLECTION_OF_SIMPLE_CLASS3 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, SIMPCLSREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE COLLECTION_OF_SIMPLE_CLASS4 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE COLLECTION_OF_SIMPLE_CLASS5 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, COLLVAL LONG VARCHAR FOR BIT DATA ); CREATE TABLE COLLECTION_OF_SIMPLE_INTERFACE6 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, SIMPINTREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE COLLECTION_OF_SIMPLE_INTERFACE7 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE COLLECTION_OF_SIMPLE_INTERFACE8 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, COLLVAL LONG VARCHAR FOR BIT DATA ); CREATE TABLE COLLECTION_OF_STRING9 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, STRINGVAL VARCHAR(1024) ); CREATE TABLE COLLECTION_OF_STRING10 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, STRINGVAL VARCHAR(1024) ); CREATE TABLE COLLECTION_OF_DATE12 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, DATEVAL TIMESTAMP ); CREATE TABLE COLLECTION_OF_DATE13 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, DATEVAL TIMESTAMP ); CREATE TABLE COLLECTION_OF_LOCALE15 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, LOCALEVAL CHAR(20) ); CREATE TABLE COLLECTION_OF_LOCALE16 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, LOCALEVAL CHAR(20) ); CREATE TABLE COLLECTION_OF_BIG_DECIMAL18 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, BIG_DECIMALVAL DECIMAL(27,16) ); CREATE TABLE COLLECTION_OF_BIG_DECIMAL19 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, BIG_DECIMALVAL DECIMAL(27,16) ); CREATE TABLE COLLECTION_OF_BIG_INTEGER21 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, BIG_INTEGERVAL NUMERIC(31) ); CREATE TABLE COLLECTION_OF_BIG_INTEGER22 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, BIG_INTEGERVAL NUMERIC(31) ); CREATE TABLE COLLECTION_OF_BYTE24 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, BYTEVAL SMALLINT ); CREATE TABLE COLLECTION_OF_BYTE25 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, BYTEVAL SMALLINT ); CREATE TABLE COLLECTION_OF_DOUBLE27 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, DOUBLEVAL DOUBLE ); CREATE TABLE COLLECTION_OF_DOUBLE28 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, DOUBLEVAL DOUBLE ); CREATE TABLE COLLECTION_OF_FLOAT30 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, FLOATVAL REAL ); CREATE TABLE COLLECTION_OF_FLOAT31 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, FLOATVAL REAL ); CREATE TABLE COLLECTION_OF_INTEGER33 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, INTEGERVAL INTEGER ); CREATE TABLE COLLECTION_OF_INTEGER34 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, INTEGERVAL INTEGER ); CREATE TABLE COLLECTION_OF_LONG36 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, LONGVAL BIGINT ); CREATE TABLE COLLECTION_OF_LONG37 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, LONGVAL BIGINT ); CREATE TABLE COLLECTION_OF_SHORT39 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, SHORTVAL SMALLINT ); CREATE TABLE COLLECTION_OF_SHORT40 ( IDENTIFIER INTEGER REFERENCES COLLECTION_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, SHORTVAL SMALLINT ); --ListCollections CREATE TABLE LIST_COLLECTIONS ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, IDENTIFIER INTEGER, LIST_OF_STRING11 LONG VARCHAR FOR BIT DATA, LIST_OF_DATE14 LONG VARCHAR FOR BIT DATA, LIST_OF_LOCALE17 LONG VARCHAR FOR BIT DATA, LIST_OF_BIG_DECIMAL20 LONG VARCHAR FOR BIT DATA, LIST_OF_BIG_INTEGER23 LONG VARCHAR FOR BIT DATA, LIST_OF_BYTE26 LONG VARCHAR FOR BIT DATA, LIST_OF_DOUBLE29 LONG VARCHAR FOR BIT DATA, LIST_OF_FLOAT32 LONG VARCHAR FOR BIT DATA, LIST_OF_INTEGER35 LONG VARCHAR FOR BIT DATA, LIST_OF_LONG38 LONG VARCHAR FOR BIT DATA, LIST_OF_SHORT41 LONG VARCHAR FOR BIT DATA, LIST_OF_SIMPLE_CLASS42 LONG VARCHAR FOR BIT DATA, CONSTRAINT LC_PK PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE LIST_OF_OBJECT0 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, OBJREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE LIST_OF_OBJECT1 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE LIST_OF_OBJECT2 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, COLLVAL LONG VARCHAR FOR BIT DATA ); CREATE TABLE LIST_OF_SIMPLE_CLASS3 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, SIMPCLSREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE LIST_OF_SIMPLE_CLASS4 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE LIST_OF_SIMPLE_CLASS5 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, COLLVAL LONG VARCHAR FOR BIT DATA ); CREATE TABLE LIST_OF_SIMPLE_INTERFACE6 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, SIMPINTREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE LIST_OF_SIMPLE_INTERFACE7 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE LIST_OF_SIMPLE_INTERFACE8 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, COLLVAL LONG VARCHAR FOR BIT DATA ); CREATE TABLE LIST_OF_STRING9 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, STRINGVAL VARCHAR(1024) ); CREATE TABLE LIST_OF_STRING10 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, STRINGVAL VARCHAR(1024) ); CREATE TABLE LIST_OF_DATE12 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, DATEVAL TIMESTAMP ); CREATE TABLE LIST_OF_DATE13 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, DATEVAL TIMESTAMP ); CREATE TABLE LIST_OF_LOCALE15 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, LOCALEVAL CHAR(20) ); CREATE TABLE LIST_OF_LOCALE16 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, LOCALEVAL CHAR(20) ); CREATE TABLE LIST_OF_BIG_DECIMAL18 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, BIG_DECIMALVAL DECIMAL(27,16) ); CREATE TABLE LIST_OF_BIG_DECIMAL19 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, BIG_DECIMALVAL DECIMAL(27,16) ); CREATE TABLE LIST_OF_BIG_INTEGER21 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, BIG_INTEGERVAL NUMERIC(31) ); CREATE TABLE LIST_OF_BIG_INTEGER22 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, BIG_INTEGERVAL NUMERIC(31) ); CREATE TABLE LIST_OF_BYTE24 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, BYTEVAL SMALLINT ); CREATE TABLE LIST_OF_BYTE25 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, BYTEVAL SMALLINT ); CREATE TABLE LIST_OF_DOUBLE27 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, DOUBLEVAL DOUBLE ); CREATE TABLE LIST_OF_DOUBLE28 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, DOUBLEVAL DOUBLE ); CREATE TABLE LIST_OF_FLOAT30 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, FLOATVAL REAL ); CREATE TABLE LIST_OF_FLOAT31 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, FLOATVAL REAL ); CREATE TABLE LIST_OF_INTEGER33 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, INTEGERVAL INTEGER ); CREATE TABLE LIST_OF_INTEGER34 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, INTEGERVAL INTEGER ); CREATE TABLE LIST_OF_LONG36 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, LONGVAL BIGINT ); CREATE TABLE LIST_OF_LONG37 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, LONGVAL BIGINT ); CREATE TABLE LIST_OF_SHORT39 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, SHORTVAL SMALLINT ); CREATE TABLE LIST_OF_SHORT40 ( IDENTIFIER INTEGER REFERENCES LIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, SHORTVAL SMALLINT ); --ArrayListCollections CREATE TABLE ARRAYLIST_COLLECTIONS ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, IDENTIFIER INTEGER, ARRAYLIST_OF_STRING10 LONG VARCHAR FOR BIT DATA, ARRAYLIST_OF_DATE13 LONG VARCHAR FOR BIT DATA, ARRAYLIST_OF_LOCALE16 LONG VARCHAR FOR BIT DATA, ARRAYLIST_OF_BIG_DECIMAL19 LONG VARCHAR FOR BIT DATA, ARRAYLIST_OF_BIG_INTEGER22 LONG VARCHAR FOR BIT DATA, ARRAYLIST_OF_BYTE25 LONG VARCHAR FOR BIT DATA, ARRAYLIST_OF_DOUBLE28 LONG VARCHAR FOR BIT DATA, ARRAYLIST_OF_FLOAT31 LONG VARCHAR FOR BIT DATA, ARRAYLIST_OF_INTEGER34 LONG VARCHAR FOR BIT DATA, ARRAYLIST_OF_LONG37 LONG VARCHAR FOR BIT DATA, ARRAYLIST_OF_SHORT40 LONG VARCHAR FOR BIT DATA, ARRAYLIST_OF_SIMPLEENUM43 LONG VARCHAR FOR BIT DATA, CONSTRAINT ALC_PK PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE ARRAYLIST_OF_OBJECT0 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, OBJREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL, INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_OBJECT1 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, OBJREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL, INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_OBJECT2 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, OBJREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL, INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_SIMPLE_CLASS3 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, SIMPCLSREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL, INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_SIMPLE_CLASS4 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, SIMPCLSREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL, INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_SIMPLE_CLASS5 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, SIMPCLSREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL, INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_SIMPLE_INTERFACE6 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, SIMPINTREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL, INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_SIMPLE_INTERFACE7 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, SIMPINTREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL, INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_SIMPLE_INTERFACE8 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, SIMPINTREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL, INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_STRING9 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, STRINGVAL VARCHAR(1024), INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_STRING11 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, STRINGVAL VARCHAR(1024), INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_DATE12 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, DATEVAL TIMESTAMP, INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_DATE14 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, DATEVAL TIMESTAMP, INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_LOCALE15 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, LOCALEVAL CHAR(20), INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_LOCALE17 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, LOCALEVAL CHAR(20), INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_BIG_DECIMAL18 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, BIG_DECIMALVAL DECIMAL(27,16), INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_BIG_DECIMAL20 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, BIG_DECIMALVAL DECIMAL(27,16), INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_BIG_INTEGER21 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, BIG_INTEGERVAL NUMERIC(31), INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_BIG_INTEGER23 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, BIG_INTEGERVAL NUMERIC(31), INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_BYTE24 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, BYTEVAL SMALLINT, INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_BYTE26 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, BYTEVAL SMALLINT, INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_DOUBLE27 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, DOUBLEVAL DOUBLE, INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_DOUBLE29 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, DOUBLEVAL DOUBLE, INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_FLOAT30 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, FLOATVAL REAL, INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_FLOAT32 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, FLOATVAL REAL, INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_INTEGER33 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, INTEGERVAL INTEGER, INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_INTEGER35 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, INTEGERVAL INTEGER, INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_LONG36 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, LONGVAL BIGINT, INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_LONG38 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, LONGVAL BIGINT, INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_SHORT39 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, SHORTVAL SMALLINT, INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_SHORT41 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, SHORTVAL SMALLINT, INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_SIMPLEENUM42 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, SIMPLEENUMVAL CHAR(2), INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_SIMPLEENUM44 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, SIMPLEENUMVAL CHAR(2), INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_SIMPLEENUM45 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, SIMPLEENUMVAL NUMERIC(2), INDEX INTEGER NOT NULL ); CREATE TABLE ARRAYLIST_OF_SIMPLEENUM46 ( IDENTIFIER INTEGER REFERENCES ARRAYLIST_COLLECTIONS NOT NULL, SIMPLEENUMVAL NUMERIC(2), INDEX INTEGER NOT NULL ); --LinkedListCollections CREATE TABLE LINKEDLIST_COLLECTIONS ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, IDENTIFIER INTEGER, LINKEDLIST_OF_STRING11 LONG VARCHAR FOR BIT DATA, LINKEDLIST_OF_DATE14 LONG VARCHAR FOR BIT DATA, LINKEDLIST_OF_LOCALE17 LONG VARCHAR FOR BIT DATA, LINKEDLIST_OF_BIG_DECIMAL20 LONG VARCHAR FOR BIT DATA, LINKEDLIST_OF_BIG_INTEGER23 LONG VARCHAR FOR BIT DATA, LINKEDLIST_OF_BYTE26 LONG VARCHAR FOR BIT DATA, LINKEDLIST_OF_DOUBLE29 LONG VARCHAR FOR BIT DATA, LINKEDLIST_OF_FLOAT32 LONG VARCHAR FOR BIT DATA, LINKEDLIST_OF_INTEGER35 LONG VARCHAR FOR BIT DATA, LINKEDLIST_OF_LONG38 LONG VARCHAR FOR BIT DATA, LINKEDLIST_OF_SHORT41 LONG VARCHAR FOR BIT DATA, LINKEDLIST_OF_SIMPLE_CLASS42 LONG VARCHAR FOR BIT DATA, CONSTRAINT LLC_PK PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE LINKEDLIST_OF_OBJECT0 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, OBJREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE LINKEDLIST_OF_OBJECT1 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE LINKEDLIST_OF_OBJECT2 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, COLLVAL LONG VARCHAR FOR BIT DATA ); CREATE TABLE LINKEDLIST_OF_SIMPLE_CLASS3 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, SIMPCLSREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE LINKEDLIST_OF_SIMPLE_CLASS4 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE LINKEDLIST_OF_SIMPLE_CLASS5 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, COLLVAL LONG VARCHAR FOR BIT DATA ); CREATE TABLE LINKEDLIST_OF_SIMPLE_INTERFACE6 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, SIMPINTREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE LINKEDLIST_OF_SIMPLE_INTERFACE7 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE LINKEDLIST_OF_SIMPLE_INTERFACE8 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, COLLVAL LONG VARCHAR FOR BIT DATA ); CREATE TABLE LINKEDLIST_OF_STRING9 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, STRINGVAL VARCHAR(1024) ); CREATE TABLE LINKEDLIST_OF_STRING10 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, STRINGVAL VARCHAR(1024) ); CREATE TABLE LINKEDLIST_OF_DATE12 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, DATEVAL TIMESTAMP ); CREATE TABLE LINKEDLIST_OF_DATE13 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, DATEVAL TIMESTAMP ); CREATE TABLE LINKEDLIST_OF_LOCALE15 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, LOCALEVAL CHAR(20) ); CREATE TABLE LINKEDLIST_OF_LOCALE16 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, LOCALEVAL CHAR(20) ); CREATE TABLE LINKEDLIST_OF_BIG_DECIMAL18 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, BIG_DECIMALVAL DECIMAL(27,16) ); CREATE TABLE LINKEDLIST_OF_BIG_DECIMAL19 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, BIG_DECIMALVAL DECIMAL(27,16) ); CREATE TABLE LINKEDLIST_OF_BIG_INTEGER21 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, BIG_INTEGERVAL NUMERIC(31) ); CREATE TABLE LINKEDLIST_OF_BIG_INTEGER22 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, BIG_INTEGERVAL NUMERIC(31) ); CREATE TABLE LINKEDLIST_OF_BYTE24 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, BYTEVAL SMALLINT ); CREATE TABLE LINKEDLIST_OF_BYTE25 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, BYTEVAL SMALLINT ); CREATE TABLE LINKEDLIST_OF_DOUBLE27 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, DOUBLEVAL DOUBLE ); CREATE TABLE LINKEDLIST_OF_DOUBLE28 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, DOUBLEVAL DOUBLE ); CREATE TABLE LINKEDLIST_OF_FLOAT30 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, FLOATVAL REAL ); CREATE TABLE LINKEDLIST_OF_FLOAT31 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, FLOATVAL REAL ); CREATE TABLE LINKEDLIST_OF_INTEGER33 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, INTEGERVAL INTEGER ); CREATE TABLE LINKEDLIST_OF_INTEGER34 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, INTEGERVAL INTEGER ); CREATE TABLE LINKEDLIST_OF_LONG36 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, LONGVAL BIGINT ); CREATE TABLE LINKEDLIST_OF_LONG37 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, LONGVAL BIGINT ); CREATE TABLE LINKEDLIST_OF_SHORT39 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, SHORTVAL SMALLINT ); CREATE TABLE LINKEDLIST_OF_SHORT40 ( IDENTIFIER INTEGER REFERENCES LINKEDLIST_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, SHORTVAL SMALLINT ); --VectorCollections CREATE TABLE VECTOR_COLLECTIONS ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, IDENTIFIER INTEGER, VECTOR_OF_STRING11 LONG VARCHAR FOR BIT DATA, VECTOR_OF_DATE14 LONG VARCHAR FOR BIT DATA, VECTOR_OF_LOCALE17 LONG VARCHAR FOR BIT DATA, VECTOR_OF_BIG_DECIMAL20 LONG VARCHAR FOR BIT DATA, VECTOR_OF_BIG_INTEGER23 LONG VARCHAR FOR BIT DATA, VECTOR_OF_BYTE26 LONG VARCHAR FOR BIT DATA, VECTOR_OF_DOUBLE29 LONG VARCHAR FOR BIT DATA, VECTOR_OF_FLOAT32 LONG VARCHAR FOR BIT DATA, VECTOR_OF_INTEGER35 LONG VARCHAR FOR BIT DATA, VECTOR_OF_LONG38 LONG VARCHAR FOR BIT DATA, VECTOR_OF_SHORT41 LONG VARCHAR FOR BIT DATA, VECTOR_OF_SIMPLE_CLASS42 LONG VARCHAR FOR BIT DATA, CONSTRAINT VC_PK PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE VECTOR_OF_OBJECT0 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, OBJREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE VECTOR_OF_OBJECT1 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE VECTOR_OF_OBJECT2 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, COLLVAL LONG VARCHAR FOR BIT DATA ); CREATE TABLE VECTOR_OF_SIMPLE_CLASS3 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, SIMPCLSREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE VECTOR_OF_SIMPLE_CLASS4 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE VECTOR_OF_SIMPLE_CLASS5 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, COLLVAL LONG VARCHAR FOR BIT DATA ); CREATE TABLE VECTOR_OF_SIMPLE_INTERFACE6 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, SIMPINTREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE VECTOR_OF_SIMPLE_INTERFACE7 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE VECTOR_OF_SIMPLE_INTERFACE8 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, COLLVAL LONG VARCHAR FOR BIT DATA ); CREATE TABLE VECTOR_OF_STRING9 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, STRINGVAL VARCHAR(1024) ); CREATE TABLE VECTOR_OF_STRING10 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, STRINGVAL VARCHAR(1024) ); CREATE TABLE VECTOR_OF_DATE12 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, DATEVAL TIMESTAMP ); CREATE TABLE VECTOR_OF_DATE13 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, DATEVAL TIMESTAMP ); CREATE TABLE VECTOR_OF_LOCALE15 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, LOCALEVAL CHAR(20) ); CREATE TABLE VECTOR_OF_LOCALE16 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, LOCALEVAL CHAR(20) ); CREATE TABLE VECTOR_OF_BIG_DECIMAL18 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, BIG_DECIMALVAL DECIMAL(27,16) ); CREATE TABLE VECTOR_OF_BIG_DECIMAL19 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, BIG_DECIMALVAL DECIMAL(27,16) ); CREATE TABLE VECTOR_OF_BIG_INTEGER21 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, BIG_INTEGERVAL NUMERIC(31) ); CREATE TABLE VECTOR_OF_BIG_INTEGER22 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, BIG_INTEGERVAL NUMERIC(31) ); CREATE TABLE VECTOR_OF_BYTE24 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, BYTEVAL SMALLINT ); CREATE TABLE VECTOR_OF_BYTE25 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, BYTEVAL SMALLINT ); CREATE TABLE VECTOR_OF_DOUBLE27 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, DOUBLEVAL DOUBLE ); CREATE TABLE VECTOR_OF_DOUBLE28 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, DOUBLEVAL DOUBLE ); CREATE TABLE VECTOR_OF_FLOAT30 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, FLOATVAL REAL ); CREATE TABLE VECTOR_OF_FLOAT31 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, FLOATVAL REAL ); CREATE TABLE VECTOR_OF_INTEGER33 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, INTEGERVAL INTEGER ); CREATE TABLE VECTOR_OF_INTEGER34 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, INTEGERVAL INTEGER ); CREATE TABLE VECTOR_OF_LONG36 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, LONGVAL BIGINT ); CREATE TABLE VECTOR_OF_LONG37 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, LONGVAL BIGINT ); CREATE TABLE VECTOR_OF_SHORT39 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, SHORTVAL SMALLINT ); CREATE TABLE VECTOR_OF_SHORT40 ( IDENTIFIER INTEGER REFERENCES VECTOR_COLLECTIONS NOT NULL, ALLOW_DUPLICATES BIGINT NOT NULL, SHORTVAL SMALLINT ); --SetCollections CREATE TABLE SET_COLLECTIONS ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, IDENTIFIER INTEGER, SET_OF_OBJECT2 LONG VARCHAR FOR BIT DATA, SET_OF_SIMPLE_CLASS5 LONG VARCHAR FOR BIT DATA, SET_OF_SIMPLE_INTERFACE8 LONG VARCHAR FOR BIT DATA, SET_OF_STRING11 LONG VARCHAR FOR BIT DATA, SET_OF_DATE14 LONG VARCHAR FOR BIT DATA, SET_OF_LOCALE17 LONG VARCHAR FOR BIT DATA, SET_OF_BIG_DECIMAL20 LONG VARCHAR FOR BIT DATA, SET_OF_BIG_INTEGER23 LONG VARCHAR FOR BIT DATA, SET_OF_BYTE26 LONG VARCHAR FOR BIT DATA, SET_OF_DOUBLE29 LONG VARCHAR FOR BIT DATA, SET_OF_FLOAT32 LONG VARCHAR FOR BIT DATA, SET_OF_INTEGER35 LONG VARCHAR FOR BIT DATA, SET_OF_LONG38 LONG VARCHAR FOR BIT DATA, SET_OF_SHORT41 LONG VARCHAR FOR BIT DATA, SET_OF_SIMPLE_CLASS42 LONG VARCHAR FOR BIT DATA, CONSTRAINT SC_PK PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE SET_OF_OBJECT0 ( IDENTIFIER INTEGER REFERENCES SET_COLLECTIONS NOT NULL, OBJREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE SET_OF_OBJECT1 ( IDENTIFIER INTEGER REFERENCES SET_COLLECTIONS NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE SET_OF_SIMPLE_CLASS3 ( IDENTIFIER INTEGER REFERENCES SET_COLLECTIONS NOT NULL, SIMPCLSREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE SET_OF_SIMPLE_CLASS4 ( IDENTIFIER INTEGER REFERENCES SET_COLLECTIONS NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE SET_OF_SIMPLE_INTERFACE6 ( IDENTIFIER INTEGER REFERENCES SET_COLLECTIONS NOT NULL, SIMPINTREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE SET_OF_SIMPLE_INTERFACE7 ( IDENTIFIER INTEGER REFERENCES SET_COLLECTIONS NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE SET_OF_STRING9 ( IDENTIFIER INTEGER REFERENCES SET_COLLECTIONS NOT NULL, STRINGVAL VARCHAR(1024) ); CREATE TABLE SET_OF_STRING10 ( IDENTIFIER INTEGER REFERENCES SET_COLLECTIONS NOT NULL, STRINGVAL VARCHAR(1024) ); CREATE TABLE SET_OF_DATE12 ( IDENTIFIER INTEGER REFERENCES SET_COLLECTIONS NOT NULL, DATEVAL TIMESTAMP ); CREATE TABLE SET_OF_DATE13 ( IDENTIFIER INTEGER REFERENCES SET_COLLECTIONS NOT NULL, DATEVAL TIMESTAMP ); CREATE TABLE SET_OF_LOCALE15 ( IDENTIFIER INTEGER REFERENCES SET_COLLECTIONS NOT NULL, LOCALEVAL CHAR(20) ); CREATE TABLE SET_OF_LOCALE16 ( IDENTIFIER INTEGER REFERENCES SET_COLLECTIONS NOT NULL, LOCALEVAL CHAR(20) ); CREATE TABLE SET_OF_BIG_DECIMAL18 ( IDENTIFIER INTEGER REFERENCES SET_COLLECTIONS NOT NULL, BIG_DECIMALVAL DECIMAL(27,16) ); CREATE TABLE SET_OF_BIG_DECIMAL19 ( IDENTIFIER INTEGER REFERENCES SET_COLLECTIONS NOT NULL, BIG_DECIMALVAL DECIMAL(27,16) ); CREATE TABLE SET_OF_BIG_INTEGER21 ( IDENTIFIER INTEGER REFERENCES SET_COLLECTIONS NOT NULL, BIG_INTEGERVAL NUMERIC(31) ); CREATE TABLE SET_OF_BIG_INTEGER22 ( IDENTIFIER INTEGER REFERENCES SET_COLLECTIONS NOT NULL, BIG_INTEGERVAL NUMERIC(31) ); CREATE TABLE SET_OF_BYTE24 ( IDENTIFIER INTEGER REFERENCES SET_COLLECTIONS NOT NULL, BYTEVAL SMALLINT ); CREATE TABLE SET_OF_BYTE25 ( IDENTIFIER INTEGER REFERENCES SET_COLLECTIONS NOT NULL, BYTEVAL SMALLINT ); CREATE TABLE SET_OF_DOUBLE27 ( IDENTIFIER INTEGER REFERENCES SET_COLLECTIONS NOT NULL, DOUBLEVAL DOUBLE ); CREATE TABLE SET_OF_DOUBLE28 ( IDENTIFIER INTEGER REFERENCES SET_COLLECTIONS NOT NULL, DOUBLEVAL DOUBLE ); CREATE TABLE SET_OF_FLOAT30 ( IDENTIFIER INTEGER REFERENCES SET_COLLECTIONS NOT NULL, FLOATVAL REAL ); CREATE TABLE SET_OF_FLOAT31 ( IDENTIFIER INTEGER REFERENCES SET_COLLECTIONS NOT NULL, FLOATVAL REAL ); CREATE TABLE SET_OF_INTEGER33 ( IDENTIFIER INTEGER REFERENCES SET_COLLECTIONS NOT NULL, INTEGERVAL INTEGER ); CREATE TABLE SET_OF_INTEGER34 ( IDENTIFIER INTEGER REFERENCES SET_COLLECTIONS NOT NULL, INTEGERVAL INTEGER ); CREATE TABLE SET_OF_LONG36 ( IDENTIFIER INTEGER REFERENCES SET_COLLECTIONS NOT NULL, LONGVAL BIGINT ); CREATE TABLE SET_OF_LONG37 ( IDENTIFIER INTEGER REFERENCES SET_COLLECTIONS NOT NULL, LONGVAL BIGINT ); CREATE TABLE SET_OF_SHORT39 ( IDENTIFIER INTEGER REFERENCES SET_COLLECTIONS NOT NULL, SHORTVAL SMALLINT ); CREATE TABLE SET_OF_SHORT40 ( IDENTIFIER INTEGER REFERENCES SET_COLLECTIONS NOT NULL, SHORTVAL SMALLINT ); --HashSetCollections CREATE TABLE HASHSET_COLLECTIONS ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, IDENTIFIER INTEGER, HASHSET_OF_OBJECT2 LONG VARCHAR FOR BIT DATA, HASHSET_OF_SIMPLE_CLASS5 LONG VARCHAR FOR BIT DATA, HASHSET_OF_SIMPLE_INTERFACE8 LONG VARCHAR FOR BIT DATA, HASHSET_OF_STRING11 LONG VARCHAR FOR BIT DATA, HASHSET_OF_DATE14 LONG VARCHAR FOR BIT DATA, HASHSET_OF_LOCALE17 LONG VARCHAR FOR BIT DATA, HASHSET_OF_BIG_DECIMAL20 LONG VARCHAR FOR BIT DATA, HASHSET_OF_BIG_INTEGER23 LONG VARCHAR FOR BIT DATA, HASHSET_OF_BYTE26 LONG VARCHAR FOR BIT DATA, HASHSET_OF_DOUBLE29 LONG VARCHAR FOR BIT DATA, HASHSET_OF_FLOAT32 LONG VARCHAR FOR BIT DATA, HASHSET_OF_INTEGER35 LONG VARCHAR FOR BIT DATA, HASHSET_OF_LONG38 LONG VARCHAR FOR BIT DATA, HASHSET_OF_SHORT41 LONG VARCHAR FOR BIT DATA, HASHSET_OF_SIMPLE_CLASS42 LONG VARCHAR FOR BIT DATA, CONSTRAINT HSC_PK PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE HASHSET_OF_OBJECT0 ( IDENTIFIER INTEGER REFERENCES HASHSET_COLLECTIONS NOT NULL, OBJREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHSET_OF_OBJECT1 ( IDENTIFIER INTEGER REFERENCES HASHSET_COLLECTIONS NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHSET_OF_SIMPLE_CLASS3 ( IDENTIFIER INTEGER REFERENCES HASHSET_COLLECTIONS NOT NULL, SIMPCLSREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHSET_OF_SIMPLE_CLASS4 ( IDENTIFIER INTEGER REFERENCES HASHSET_COLLECTIONS NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHSET_OF_SIMPLE_INTERFACE6 ( IDENTIFIER INTEGER REFERENCES HASHSET_COLLECTIONS NOT NULL, SIMPINTREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHSET_OF_SIMPLE_INTERFACE7 ( IDENTIFIER INTEGER REFERENCES HASHSET_COLLECTIONS NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHSET_OF_STRING9 ( IDENTIFIER INTEGER REFERENCES HASHSET_COLLECTIONS NOT NULL, STRINGVAL VARCHAR(1024) ); CREATE TABLE HASHSET_OF_STRING10 ( IDENTIFIER INTEGER REFERENCES HASHSET_COLLECTIONS NOT NULL, STRINGVAL VARCHAR(1024) ); CREATE TABLE HASHSET_OF_DATE12 ( IDENTIFIER INTEGER REFERENCES HASHSET_COLLECTIONS NOT NULL, DATEVAL TIMESTAMP ); CREATE TABLE HASHSET_OF_DATE13 ( IDENTIFIER INTEGER REFERENCES HASHSET_COLLECTIONS NOT NULL, DATEVAL TIMESTAMP ); CREATE TABLE HASHSET_OF_LOCALE15 ( IDENTIFIER INTEGER REFERENCES HASHSET_COLLECTIONS NOT NULL, LOCALEVAL CHAR(20) ); CREATE TABLE HASHSET_OF_LOCALE16 ( IDENTIFIER INTEGER REFERENCES HASHSET_COLLECTIONS NOT NULL, LOCALEVAL CHAR(20) ); CREATE TABLE HASHSET_OF_BIG_DECIMAL18 ( IDENTIFIER INTEGER REFERENCES HASHSET_COLLECTIONS NOT NULL, BIG_DECIMALVAL DECIMAL(27,16) ); CREATE TABLE HASHSET_OF_BIG_DECIMAL19 ( IDENTIFIER INTEGER REFERENCES HASHSET_COLLECTIONS NOT NULL, BIG_DECIMALVAL DECIMAL(27,16) ); CREATE TABLE HASHSET_OF_BIG_INTEGER21 ( IDENTIFIER INTEGER REFERENCES HASHSET_COLLECTIONS NOT NULL, BIG_INTEGERVAL NUMERIC(31) ); CREATE TABLE HASHSET_OF_BIG_INTEGER22 ( IDENTIFIER INTEGER REFERENCES HASHSET_COLLECTIONS NOT NULL, BIG_INTEGERVAL NUMERIC(31) ); CREATE TABLE HASHSET_OF_BYTE24 ( IDENTIFIER INTEGER REFERENCES HASHSET_COLLECTIONS NOT NULL, BYTEVAL SMALLINT ); CREATE TABLE HASHSET_OF_BYTE25 ( IDENTIFIER INTEGER REFERENCES HASHSET_COLLECTIONS NOT NULL, BYTEVAL SMALLINT ); CREATE TABLE HASHSET_OF_DOUBLE27 ( IDENTIFIER INTEGER REFERENCES HASHSET_COLLECTIONS NOT NULL, DOUBLEVAL DOUBLE ); CREATE TABLE HASHSET_OF_DOUBLE28 ( IDENTIFIER INTEGER REFERENCES HASHSET_COLLECTIONS NOT NULL, DOUBLEVAL DOUBLE ); CREATE TABLE HASHSET_OF_FLOAT30 ( IDENTIFIER INTEGER REFERENCES HASHSET_COLLECTIONS NOT NULL, FLOATVAL REAL ); CREATE TABLE HASHSET_OF_FLOAT31 ( IDENTIFIER INTEGER REFERENCES HASHSET_COLLECTIONS NOT NULL, FLOATVAL REAL ); CREATE TABLE HASHSET_OF_INTEGER33 ( IDENTIFIER INTEGER REFERENCES HASHSET_COLLECTIONS NOT NULL, INTEGERVAL INTEGER ); CREATE TABLE HASHSET_OF_INTEGER34 ( IDENTIFIER INTEGER REFERENCES HASHSET_COLLECTIONS NOT NULL, INTEGERVAL INTEGER ); CREATE TABLE HASHSET_OF_LONG36 ( IDENTIFIER INTEGER REFERENCES HASHSET_COLLECTIONS NOT NULL, LONGVAL BIGINT ); CREATE TABLE HASHSET_OF_LONG37 ( IDENTIFIER INTEGER REFERENCES HASHSET_COLLECTIONS NOT NULL, LONGVAL BIGINT ); CREATE TABLE HASHSET_OF_SHORT39 ( IDENTIFIER INTEGER REFERENCES HASHSET_COLLECTIONS NOT NULL, SHORTVAL SMALLINT ); CREATE TABLE HASHSET_OF_SHORT40 ( IDENTIFIER INTEGER REFERENCES HASHSET_COLLECTIONS NOT NULL, SHORTVAL SMALLINT ); --TreeSetCollections CREATE TABLE TREESET_COLLECTIONS ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, IDENTIFIER INTEGER, TREESET_OF_STRING10 LONG VARCHAR FOR BIT DATA, TREESET_OF_DATE13 LONG VARCHAR FOR BIT DATA, TREESET_OF_BIG_DECIMAL16 LONG VARCHAR FOR BIT DATA, TREESET_OF_BIG_INTEGER19 LONG VARCHAR FOR BIT DATA, TREESET_OF_BYTE22 LONG VARCHAR FOR BIT DATA, TREESET_OF_DOUBLE25 LONG VARCHAR FOR BIT DATA, TREESET_OF_FLOAT28 LONG VARCHAR FOR BIT DATA, TREESET_OF_INTEGER31 LONG VARCHAR FOR BIT DATA, TREESET_OF_LONG34 LONG VARCHAR FOR BIT DATA, TREESET_OF_SHORT37 LONG VARCHAR FOR BIT DATA, CONSTRAINT TSC_PK PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE TREESET_OF_OBJECT0 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, OBJREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL, INDEX INTEGER NOT NULL ); CREATE TABLE TREESET_OF_OBJECT1 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, OBJREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL, INDEX INTEGER NOT NULL ); CREATE TABLE TREESET_OF_OBJECT2 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, OBJREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL, INDEX INTEGER NOT NULL ); CREATE TABLE TREESET_OF_SIMPLE_CLASS3 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, SIMPCLSREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL, INDEX INTEGER NOT NULL ); CREATE TABLE TREESET_OF_SIMPLE_CLASS4 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, SIMPCLSREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL, INDEX INTEGER NOT NULL ); CREATE TABLE TREESET_OF_SIMPLE_CLASS5 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, SIMPCLSREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL, INDEX INTEGER NOT NULL ); CREATE TABLE TREESET_OF_SIMPLE_INTERFACE6 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, SIMPINTREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL, INDEX INTEGER NOT NULL ); CREATE TABLE TREESET_OF_SIMPLE_INTERFACE7 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, SIMPINTREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL, INDEX INTEGER NOT NULL ); CREATE TABLE TREESET_OF_SIMPLE_INTERFACE8 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, SIMPINTREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL, INDEX INTEGER NOT NULL ); CREATE TABLE TREESET_OF_STRING9 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, STRINGVAL VARCHAR(1024), INDEX INTEGER NOT NULL ); CREATE TABLE TREESET_OF_STRING11 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, STRINGVAL VARCHAR(1024), INDEX INTEGER NOT NULL ); CREATE TABLE TREESET_OF_DATE12 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, DATEVAL TIMESTAMP, INDEX INTEGER NOT NULL ); CREATE TABLE TREESET_OF_DATE14 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, DATEVAL TIMESTAMP, INDEX INTEGER NOT NULL ); CREATE TABLE TREESET_OF_BIG_DECIMAL15 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, BIG_DECIMALVAL DECIMAL(27,16), INDEX INTEGER NOT NULL ); CREATE TABLE TREESET_OF_BIG_DECIMAL17 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, BIG_DECIMALVAL DECIMAL(27,16), INDEX INTEGER NOT NULL ); CREATE TABLE TREESET_OF_BIG_INTEGER18 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, BIG_INTEGERVAL NUMERIC(31), INDEX INTEGER NOT NULL ); CREATE TABLE TREESET_OF_BIG_INTEGER20 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, BIG_INTEGERVAL NUMERIC(31), INDEX INTEGER NOT NULL ); CREATE TABLE TREESET_OF_BYTE21 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, BYTEVAL SMALLINT, INDEX INTEGER NOT NULL ); CREATE TABLE TREESET_OF_BYTE23 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, BYTEVAL SMALLINT, INDEX INTEGER NOT NULL ); CREATE TABLE TREESET_OF_DOUBLE24 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, DOUBLEVAL DOUBLE, INDEX INTEGER NOT NULL ); CREATE TABLE TREESET_OF_DOUBLE26 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, DOUBLEVAL DOUBLE, INDEX INTEGER NOT NULL ); CREATE TABLE TREESET_OF_FLOAT27 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, FLOATVAL REAL, INDEX INTEGER NOT NULL ); CREATE TABLE TREESET_OF_FLOAT29 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, FLOATVAL REAL, INDEX INTEGER NOT NULL ); CREATE TABLE TREESET_OF_INTEGER30 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, INTEGERVAL INTEGER, INDEX INTEGER NOT NULL ); CREATE TABLE TREESET_OF_INTEGER32 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, INTEGERVAL INTEGER, INDEX INTEGER NOT NULL ); CREATE TABLE TREESET_OF_LONG33 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, LONGVAL BIGINT, INDEX INTEGER NOT NULL ); CREATE TABLE TREESET_OF_LONG35 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, LONGVAL BIGINT, INDEX INTEGER NOT NULL ); CREATE TABLE TREESET_OF_SHORT36 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, SHORTVAL SMALLINT, INDEX INTEGER NOT NULL ); CREATE TABLE TREESET_OF_SHORT38 ( IDENTIFIER INTEGER REFERENCES TREESET_COLLECTIONS NOT NULL, SHORTVAL SMALLINT, INDEX INTEGER NOT NULL ); --MapOfStringKeyCollections CREATE TABLE MAPSTRINGKEY_COLLECTIONS ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, IDENTIFIER INTEGER, MAP_OF_STRING_OBJECT86 LONG VARCHAR FOR BIT DATA, MAP_OF_STRING_SIMPLECLASS89 LONG VARCHAR FOR BIT DATA, MAP_OF_STRING_SIMPLEINTERFACE92 LONG VARCHAR FOR BIT DATA, MAP_OF_STRING_STRING95 LONG VARCHAR FOR BIT DATA, MAP_OF_STRING_DATE98 LONG VARCHAR FOR BIT DATA, MAP_OF_STRING_LOCALE101 LONG VARCHAR FOR BIT DATA, MAP_OF_STRING_BIGDECIMAL104 LONG VARCHAR FOR BIT DATA, MAP_OF_STRING_BIGINTEGER107 LONG VARCHAR FOR BIT DATA, MAP_OF_STRING_BYTE110 LONG VARCHAR FOR BIT DATA, MAP_OF_STRING_DOUBLE113 LONG VARCHAR FOR BIT DATA, MAP_OF_STRING_FLOAT116 LONG VARCHAR FOR BIT DATA, MAP_OF_STRING_INTEGER119 LONG VARCHAR FOR BIT DATA, MAP_OF_STRING_LONG122 LONG VARCHAR FOR BIT DATA, MAP_OF_STRING_SHORT125 LONG VARCHAR FOR BIT DATA, MAP_OF_STRING_SIMPLEENUM132 LONG VARCHAR FOR BIT DATA, CONSTRAINT MSKC_PK PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE MAP_OF_STRING_OBJECT0 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, OBJREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE MAP_OF_STRING_OBJECT1 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, OBJREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE MAP_OF_STRING_OBJECT2 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, OBJREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE MAP_OF_STRING_SIMPLE_CLASS3 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, SIMPCLSREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE MAP_OF_STRING_SIMPLE_CLASS4 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, SIMPCLSREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE MAP_OF_STRING_SIMPLE_CLASS5 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, SIMPCLSREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE MAP_OF_STRING_SIMPLE_INTERFACE6 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, SIMPINTREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE MAP_OF_STRING_SIMPLE_INTERFACE7 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, SIMPINTREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE MAP_OF_STRING_SIMPLE_INTERFACE8 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, SIMPINTREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE MAP_OF_STRING_STRING9 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL VARCHAR(100) NOT NULL ); CREATE TABLE MAP_OF_STRING_STRING10 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL VARCHAR(100) NOT NULL ); CREATE TABLE MAP_OF_STRING_STRING11 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL VARCHAR(100) NOT NULL ); CREATE TABLE MAP_OF_STRING_DATE12 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL TIMESTAMP NOT NULL ); CREATE TABLE MAP_OF_STRING_DATE13 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL TIMESTAMP NOT NULL ); CREATE TABLE MAP_OF_STRING_DATE14 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL TIMESTAMP NOT NULL ); CREATE TABLE MAP_OF_STRING_LOCALE15 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(20) NOT NULL ); CREATE TABLE MAP_OF_STRING_LOCALE16 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(20) NOT NULL ); CREATE TABLE MAP_OF_STRING_LOCALE17 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(20) NOT NULL ); CREATE TABLE MAP_OF_STRING_BIG_DECIMAL18 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DECIMAL(27,16) NOT NULL ); CREATE TABLE MAP_OF_STRING_BIG_DECIMAL19 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DECIMAL(27,16) NOT NULL ); CREATE TABLE MAP_OF_STRING_BIG_DECIMAL20 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DECIMAL(27,16) NOT NULL ); CREATE TABLE MAP_OF_STRING_BIG_INTEGER21 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(31) NOT NULL ); CREATE TABLE MAP_OF_STRING_BIG_INTEGER22 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(31) NOT NULL ); CREATE TABLE MAP_OF_STRING_BIG_INTEGER23 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(31) NOT NULL ); CREATE TABLE MAP_OF_STRING_BYTE24 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE MAP_OF_STRING_BYTE25 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE MAP_OF_STRING_BYTE26 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE MAP_OF_STRING_DOUBLE27 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DOUBLE NOT NULL ); CREATE TABLE MAP_OF_STRING_DOUBLE28 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DOUBLE NOT NULL ); CREATE TABLE MAP_OF_STRING_DOUBLE29 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DOUBLE NOT NULL ); CREATE TABLE MAP_OF_STRING_FLOAT30 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL REAL NOT NULL ); CREATE TABLE MAP_OF_STRING_FLOAT31 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL REAL NOT NULL ); CREATE TABLE MAP_OF_STRING_FLOAT32 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL REAL NOT NULL ); CREATE TABLE MAP_OF_STRING_INTEGER33 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL INTEGER NOT NULL ); CREATE TABLE MAP_OF_STRING_INTEGER34 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL INTEGER NOT NULL ); CREATE TABLE MAP_OF_STRING_INTEGER35 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL INTEGER NOT NULL ); CREATE TABLE MAP_OF_STRING_LONG36 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL BIGINT NOT NULL ); CREATE TABLE MAP_OF_STRING_LONG37 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL BIGINT NOT NULL ); CREATE TABLE MAP_OF_STRING_LONG38 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL BIGINT NOT NULL ); CREATE TABLE MAP_OF_STRING_SHORT39 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE MAP_OF_STRING_SHORT40 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE MAP_OF_STRING_SHORT41 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE MAP_OF_STRING_OBJECT42 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE MAP_OF_STRING_OBJECT43 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE MAP_OF_STRING_SIMPLE_CLASS45 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE MAP_OF_STRING_SIMPLE_CLASS46 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE MAP_OF_STRING_SIMPLE_INTERFACE48 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE MAP_OF_STRING_SIMPLE_INTERFACE49 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE MAP_OF_STRING_STRING51 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL VARCHAR(100) NOT NULL ); CREATE TABLE MAP_OF_STRING_STRING52 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL VARCHAR(100) NOT NULL ); CREATE TABLE MAP_OF_STRING_DATE54 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL TIMESTAMP NOT NULL ); CREATE TABLE MAP_OF_STRING_DATE55 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL TIMESTAMP NOT NULL ); CREATE TABLE MAP_OF_STRING_LOCALE57 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(20) NOT NULL ); CREATE TABLE MAP_OF_STRING_LOCALE58 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(20) NOT NULL ); CREATE TABLE MAP_OF_STRING_BIG_DECIMAL60 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DECIMAL(27,16) NOT NULL ); CREATE TABLE MAP_OF_STRING_BIG_DECIMAL61 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DECIMAL(27,16) NOT NULL ); CREATE TABLE MAP_OF_STRING_BIG_INTEGER63 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(31) NOT NULL ); CREATE TABLE MAP_OF_STRING_BIG_INTEGER64 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(31) NOT NULL ); CREATE TABLE MAP_OF_STRING_BYTE66 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE MAP_OF_STRING_BYTE67 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE MAP_OF_STRING_DOUBLE69 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DOUBLE NOT NULL ); CREATE TABLE MAP_OF_STRING_DOUBLE70 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DOUBLE NOT NULL ); CREATE TABLE MAP_OF_STRING_FLOAT72 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL REAL NOT NULL ); CREATE TABLE MAP_OF_STRING_FLOAT73 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL REAL NOT NULL ); CREATE TABLE MAP_OF_STRING_INTEGER75 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL INTEGER NOT NULL ); CREATE TABLE MAP_OF_STRING_INTEGER76 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL INTEGER NOT NULL ); CREATE TABLE MAP_OF_STRING_LONG78 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL BIGINT NOT NULL ); CREATE TABLE MAP_OF_STRING_LONG79 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL BIGINT NOT NULL ); CREATE TABLE MAP_OF_STRING_SHORT81 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE MAP_OF_STRING_SHORT82 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE MAP_OF_STRING_OBJECT84 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL LONG VARCHAR FOR BIT DATA ); CREATE TABLE MAP_OF_STRING_SIMPLE_CLASS87 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL LONG VARCHAR FOR BIT DATA ); CREATE TABLE MAP_OF_STRING_SIMPLE_INTERFACE90 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL LONG VARCHAR FOR BIT DATA ); CREATE TABLE MAP_OF_STRING_STRING93 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL VARCHAR(100) NOT NULL ); CREATE TABLE MAP_OF_STRING_DATE96 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL TIMESTAMP NOT NULL ); CREATE TABLE MAP_OF_STRING_LOCALE99 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(20) NOT NULL ); CREATE TABLE MAP_OF_STRING_BIG_DECIMAL102 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DECIMAL(27,16) NOT NULL ); CREATE TABLE MAP_OF_STRING_BIG_INTEGER105 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(31) NOT NULL ); CREATE TABLE MAP_OF_STRING_BYTE108 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE MAP_OF_STRING_DOUBLE111 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DOUBLE NOT NULL ); CREATE TABLE MAP_OF_STRING_FLOAT114 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL REAL NOT NULL ); CREATE TABLE MAP_OF_STRING_INTEGER117 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL INTEGER NOT NULL ); CREATE TABLE MAP_OF_STRING_LONG120 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL BIGINT NOT NULL ); CREATE TABLE MAP_OF_STRING_SHORT123 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE MAP_OF_STRING_SIMPLEENUM126 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(2) NOT NULL ); CREATE TABLE MAP_OF_STRING_SIMPLEENUM127 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(2) NOT NULL ); CREATE TABLE MAP_OF_STRING_SIMPLEENUM128 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(2) NOT NULL ); CREATE TABLE MAP_OF_STRING_SIMPLEENUM129 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(2) NOT NULL ); CREATE TABLE MAP_OF_STRING_SIMPLEENUM130 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(2) NOT NULL ); CREATE TABLE MAP_OF_STRING_SIMPLEENUM131 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(2) NOT NULL ); CREATE TABLE MAP_OF_STRING_SIMPLEENUM133 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(2,0) NOT NULL ); CREATE TABLE MAP_OF_STRING_SIMPLEENUM134 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(2,0) NOT NULL ); CREATE TABLE MAP_OF_STRING_SIMPLEENUM135 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(2,0) NOT NULL ); CREATE TABLE MAP_OF_STRING_SIMPLEENUM136 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(2,0) NOT NULL ); CREATE TABLE MAP_OF_STRING_SIMPLEENUM137 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(2,0) NOT NULL ); CREATE TABLE MAP_OF_STRING_SIMPLEENUM138 ( IDENTIFIER INTEGER REFERENCES MAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(2,0) NOT NULL ); --HashMapOfStringKeyCollections CREATE TABLE HASHMAPSTRINGKEY_COLLECTIONS ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, IDENTIFIER INTEGER, HASHMAP_STR_OBJECT86 LONG VARCHAR FOR BIT DATA, HASHMAP_STR_SIMPLECLASS89 LONG VARCHAR FOR BIT DATA, HASHMAP_STR_SIMPLEINTERFACE92 LONG VARCHAR FOR BIT DATA, HASHMAP_STR_STRING95 LONG VARCHAR FOR BIT DATA, HASHMAP_STR_DATE98 LONG VARCHAR FOR BIT DATA, HASHMAP_STR_LOCALE101 LONG VARCHAR FOR BIT DATA, HASHMAP_STR_BIGDECIMAL104 LONG VARCHAR FOR BIT DATA, HASHMAP_STR_BIGINTEGER107 LONG VARCHAR FOR BIT DATA, HASHMAP_STR_BYTE110 LONG VARCHAR FOR BIT DATA, HASHMAP_STR_DOUBLE113 LONG VARCHAR FOR BIT DATA, HASHMAP_STR_FLOAT116 LONG VARCHAR FOR BIT DATA, HASHMAP_STR_INTEGER119 LONG VARCHAR FOR BIT DATA, HASHMAP_STR_LONG122 LONG VARCHAR FOR BIT DATA, HASHMAP_STR_SHORT125 LONG VARCHAR FOR BIT DATA, CONSTRAINT HMSKC_PK PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE HASHMAP_STR_OBJECT0 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, OBJREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHMAP_STR_OBJECT1 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, OBJREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHMAP_STR_OBJECT2 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, OBJREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHMAP_STR_SIMPLE_CLASS3 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, SIMPCLSREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHMAP_STR_SIMPLE_CLASS4 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, SIMPCLSREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHMAP_STR_SIMPLE_CLASS5 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, SIMPCLSREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHMAP_STR_SIMPLE_INTERFACE6 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, SIMPINTREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHMAP_STR_SIMPLE_INTERFACE7 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, SIMPINTREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHMAP_STR_SIMPLE_INTERFACE8 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, SIMPINTREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHMAP_STR_STRING9 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL VARCHAR(100) NOT NULL ); CREATE TABLE HASHMAP_STR_STRING10 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL VARCHAR(100) NOT NULL ); CREATE TABLE HASHMAP_STR_STRING11 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL VARCHAR(100) NOT NULL ); CREATE TABLE HASHMAP_STR_DATE12 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL TIMESTAMP NOT NULL ); CREATE TABLE HASHMAP_STR_DATE13 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL TIMESTAMP NOT NULL ); CREATE TABLE HASHMAP_STR_DATE14 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL TIMESTAMP NOT NULL ); CREATE TABLE HASHMAP_STR_LOCALE15 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(20) NOT NULL ); CREATE TABLE HASHMAP_STR_LOCALE16 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(20) NOT NULL ); CREATE TABLE HASHMAP_STR_LOCALE17 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(20) NOT NULL ); CREATE TABLE HASHMAP_STR_BIG_DECIMAL18 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DECIMAL(27,16) NOT NULL ); CREATE TABLE HASHMAP_STR_BIG_DECIMAL19 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DECIMAL(27,16) NOT NULL ); CREATE TABLE HASHMAP_STR_BIG_DECIMAL20 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DECIMAL(27,16) NOT NULL ); CREATE TABLE HASHMAP_STR_BIG_INTEGER21 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(31) NOT NULL ); CREATE TABLE HASHMAP_STR_BIG_INTEGER22 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(31) NOT NULL ); CREATE TABLE HASHMAP_STR_BIG_INTEGER23 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(31) NOT NULL ); CREATE TABLE HASHMAP_STR_BYTE24 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE HASHMAP_STR_BYTE25 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE HASHMAP_STR_BYTE26 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE HASHMAP_STR_DOUBLE27 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DOUBLE NOT NULL ); CREATE TABLE HASHMAP_STR_DOUBLE28 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DOUBLE NOT NULL ); CREATE TABLE HASHMAP_STR_DOUBLE29 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DOUBLE NOT NULL ); CREATE TABLE HASHMAP_STR_FLOAT30 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL REAL NOT NULL ); CREATE TABLE HASHMAP_STR_FLOAT31 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL REAL NOT NULL ); CREATE TABLE HASHMAP_STR_FLOAT32 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL REAL NOT NULL ); CREATE TABLE HASHMAP_STR_INTEGER33 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL INTEGER NOT NULL ); CREATE TABLE HASHMAP_STR_INTEGER34 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL INTEGER NOT NULL ); CREATE TABLE HASHMAP_STR_INTEGER35 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL INTEGER NOT NULL ); CREATE TABLE HASHMAP_STR_LONG36 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL BIGINT NOT NULL ); CREATE TABLE HASHMAP_STR_LONG37 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL BIGINT NOT NULL ); CREATE TABLE HASHMAP_STR_LONG38 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL BIGINT NOT NULL ); CREATE TABLE HASHMAP_STR_SHORT39 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE HASHMAP_STR_SHORT40 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE HASHMAP_STR_SHORT41 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE HASHMAP_STR_OBJECT42 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHMAP_STR_OBJECT43 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHMAP_STR_SIMPLE_CLASS45 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHMAP_STR_SIMPLE_CLASS46 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHMAP_STR_SIMPLE_INTERFACE48 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHMAP_STR_SIMPLE_INTERFACE49 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHMAP_STR_STRING51 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL VARCHAR(100) NOT NULL ); CREATE TABLE HASHMAP_STR_STRING52 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL VARCHAR(100) NOT NULL ); CREATE TABLE HASHMAP_STR_DATE54 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL TIMESTAMP NOT NULL ); CREATE TABLE HASHMAP_STR_DATE55 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL TIMESTAMP NOT NULL ); CREATE TABLE HASHMAP_STR_LOCALE57 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(20) NOT NULL ); CREATE TABLE HASHMAP_STR_LOCALE58 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(20) NOT NULL ); CREATE TABLE HASHMAP_STR_BIG_DECIMAL60 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DECIMAL(27,16) NOT NULL ); CREATE TABLE HASHMAP_STR_BIG_DECIMAL61 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DECIMAL(27,16) NOT NULL ); CREATE TABLE HASHMAP_STR_BIG_INTEGER63 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(31) NOT NULL ); CREATE TABLE HASHMAP_STR_BIG_INTEGER64 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(31) NOT NULL ); CREATE TABLE HASHMAP_STR_BYTE66 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE HASHMAP_STR_BYTE67 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE HASHMAP_STR_DOUBLE69 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DOUBLE NOT NULL ); CREATE TABLE HASHMAP_STR_DOUBLE70 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DOUBLE NOT NULL ); CREATE TABLE HASHMAP_STR_FLOAT72 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL REAL NOT NULL ); CREATE TABLE HASHMAP_STR_FLOAT73 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL REAL NOT NULL ); CREATE TABLE HASHMAP_STR_INTEGER75 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL INTEGER NOT NULL ); CREATE TABLE HASHMAP_STR_INTEGER76 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL INTEGER NOT NULL ); CREATE TABLE HASHMAP_STR_LONG78 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL BIGINT NOT NULL ); CREATE TABLE HASHMAP_STR_LONG79 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL BIGINT NOT NULL ); CREATE TABLE HASHMAP_STR_SHORT81 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE HASHMAP_STR_SHORT82 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE HASHMAP_STR_OBJECT84 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL LONG VARCHAR FOR BIT DATA ); CREATE TABLE HASHMAP_STR_SIMPLE_CLASS87 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL LONG VARCHAR FOR BIT DATA ); CREATE TABLE HASHMAP_STR_SIMPLE_INTERFACE90 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL LONG VARCHAR FOR BIT DATA ); CREATE TABLE HASHMAP_STR_STRING93 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL VARCHAR(100) NOT NULL ); CREATE TABLE HASHMAP_STR_DATE96 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL TIMESTAMP NOT NULL ); CREATE TABLE HASHMAP_STR_LOCALE99 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(20) NOT NULL ); CREATE TABLE HASHMAP_STR_BIG_DECIMAL102 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DECIMAL(27,16) NOT NULL ); CREATE TABLE HASHMAP_STR_BIG_INTEGER105 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(31) NOT NULL ); CREATE TABLE HASHMAP_STR_BYTE108 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE HASHMAP_STR_DOUBLE111 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DOUBLE NOT NULL ); CREATE TABLE HASHMAP_STR_FLOAT114 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL REAL NOT NULL ); CREATE TABLE HASHMAP_STR_INTEGER117 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL INTEGER NOT NULL ); CREATE TABLE HASHMAP_STR_LONG120 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL BIGINT NOT NULL ); CREATE TABLE HASHMAP_STR_SHORT123 ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); --HashtableOfStringKeyCollections CREATE TABLE HASHTABLESTRINGKEY_COLLECTIONS ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, IDENTIFIER INTEGER, HASHTBL_STR_OBJECT86 LONG VARCHAR FOR BIT DATA, HASHTBL_STR_SIMPLECLASS89 LONG VARCHAR FOR BIT DATA, HASHTBL_STR_SIMPLEINTERFACE92 LONG VARCHAR FOR BIT DATA, HASHTBL_STR_STRING95 LONG VARCHAR FOR BIT DATA, HASHTBL_STR_DATE98 LONG VARCHAR FOR BIT DATA, HASHTBL_STR_LOCALE101 LONG VARCHAR FOR BIT DATA, HASHTBL_STR_BIGDECIMAL104 LONG VARCHAR FOR BIT DATA, HASHTBL_STR_BIGINTEGER107 LONG VARCHAR FOR BIT DATA, HASHTBL_STR_BYTE110 LONG VARCHAR FOR BIT DATA, HASHTBL_STR_DOUBLE113 LONG VARCHAR FOR BIT DATA, HASHTBL_STR_FLOAT116 LONG VARCHAR FOR BIT DATA, HASHTBL_STR_INTEGER119 LONG VARCHAR FOR BIT DATA, HASHTBL_STR_LONG122 LONG VARCHAR FOR BIT DATA, HASHTBL_STR_SHORT125 LONG VARCHAR FOR BIT DATA, CONSTRAINT HTSKC_PK PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE HASHTBL_STR_OBJECT0 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, OBJREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHTBL_STR_OBJECT1 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, OBJREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHTBL_STR_OBJECT2 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, OBJREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHTBL_STR_SIMPLE_CLASS3 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, SIMPCLSREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHTBL_STR_SIMPLE_CLASS4 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, SIMPCLSREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHTBL_STR_SIMPLE_CLASS5 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, SIMPCLSREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHTBL_STR_SIMPLE_INTERFACE6 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, SIMPINTREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHTBL_STR_SIMPLE_INTERFACE7 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, SIMPINTREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHTBL_STR_SIMPLE_INTERFACE8 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, SIMPINTREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHTBL_STR_STRING9 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL VARCHAR(100) NOT NULL ); CREATE TABLE HASHTBL_STR_STRING10 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL VARCHAR(100) NOT NULL ); CREATE TABLE HASHTBL_STR_STRING11 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL VARCHAR(100) NOT NULL ); CREATE TABLE HASHTBL_STR_DATE12 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL TIMESTAMP NOT NULL ); CREATE TABLE HASHTBL_STR_DATE13 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL TIMESTAMP NOT NULL ); CREATE TABLE HASHTBL_STR_DATE14 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL TIMESTAMP NOT NULL ); CREATE TABLE HASHTBL_STR_LOCALE15 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(20) NOT NULL ); CREATE TABLE HASHTBL_STR_LOCALE16 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(20) NOT NULL ); CREATE TABLE HASHTBL_STR_LOCALE17 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(20) NOT NULL ); CREATE TABLE HASHTBL_STR_BIG_DECIMAL18 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DECIMAL(27,16) NOT NULL ); CREATE TABLE HASHTBL_STR_BIG_DECIMAL19 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DECIMAL(27,16) NOT NULL ); CREATE TABLE HASHTBL_STR_BIG_DECIMAL20 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DECIMAL(27,16) NOT NULL ); CREATE TABLE HASHTBL_STR_BIG_INTEGER21 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(31) NOT NULL ); CREATE TABLE HASHTBL_STR_BIG_INTEGER22 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(31) NOT NULL ); CREATE TABLE HASHTBL_STR_BIG_INTEGER23 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(31) NOT NULL ); CREATE TABLE HASHTBL_STR_BYTE24 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE HASHTBL_STR_BYTE25 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE HASHTBL_STR_BYTE26 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE HASHTBL_STR_DOUBLE27 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DOUBLE NOT NULL ); CREATE TABLE HASHTBL_STR_DOUBLE28 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DOUBLE NOT NULL ); CREATE TABLE HASHTBL_STR_DOUBLE29 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DOUBLE NOT NULL ); CREATE TABLE HASHTBL_STR_FLOAT30 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL REAL NOT NULL ); CREATE TABLE HASHTBL_STR_FLOAT31 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL REAL NOT NULL ); CREATE TABLE HASHTBL_STR_FLOAT32 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL REAL NOT NULL ); CREATE TABLE HASHTBL_STR_INTEGER33 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL INTEGER NOT NULL ); CREATE TABLE HASHTBL_STR_INTEGER34 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL INTEGER NOT NULL ); CREATE TABLE HASHTBL_STR_INTEGER35 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL INTEGER NOT NULL ); CREATE TABLE HASHTBL_STR_LONG36 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL BIGINT NOT NULL ); CREATE TABLE HASHTBL_STR_LONG37 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL BIGINT NOT NULL ); CREATE TABLE HASHTBL_STR_LONG38 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL BIGINT NOT NULL ); CREATE TABLE HASHTBL_STR_SHORT39 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE HASHTBL_STR_SHORT40 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE HASHTBL_STR_SHORT41 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE HASHTBL_STR_OBJECT42 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHTBL_STR_OBJECT43 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHTBL_STR_SIMPLE_CLASS45 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHTBL_STR_SIMPLE_CLASS46 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHTBL_STR_SIMPLE_INTERFACE48 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHTBL_STR_SIMPLE_INTERFACE49 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHTBL_STR_STRING51 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL VARCHAR(100) NOT NULL ); CREATE TABLE HASHTBL_STR_STRING52 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL VARCHAR(100) NOT NULL ); CREATE TABLE HASHTBL_STR_DATE54 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL TIMESTAMP NOT NULL ); CREATE TABLE HASHTBL_STR_DATE55 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL TIMESTAMP NOT NULL ); CREATE TABLE HASHTBL_STR_LOCALE57 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(20) NOT NULL ); CREATE TABLE HASHTBL_STR_LOCALE58 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(20) NOT NULL ); CREATE TABLE HASHTBL_STR_BIG_DECIMAL60 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DECIMAL(27,16) NOT NULL ); CREATE TABLE HASHTBL_STR_BIG_DECIMAL61 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DECIMAL(27,16) NOT NULL ); CREATE TABLE HASHTBL_STR_BIG_INTEGER63 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(31) NOT NULL ); CREATE TABLE HASHTBL_STR_BIG_INTEGER64 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(31) NOT NULL ); CREATE TABLE HASHTBL_STR_BYTE66 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE HASHTBL_STR_BYTE67 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE HASHTBL_STR_DOUBLE69 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DOUBLE NOT NULL ); CREATE TABLE HASHTBL_STR_DOUBLE70 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DOUBLE NOT NULL ); CREATE TABLE HASHTBL_STR_FLOAT72 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL REAL NOT NULL ); CREATE TABLE HASHTBL_STR_FLOAT73 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL REAL NOT NULL ); CREATE TABLE HASHTBL_STR_INTEGER75 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL INTEGER NOT NULL ); CREATE TABLE HASHTBL_STR_INTEGER76 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL INTEGER NOT NULL ); CREATE TABLE HASHTBL_STR_LONG78 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL BIGINT NOT NULL ); CREATE TABLE HASHTBL_STR_LONG79 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL BIGINT NOT NULL ); CREATE TABLE HASHTBL_STR_SHORT81 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE HASHTBL_STR_SHORT82 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE HASHTBL_STR_OBJECT84 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL LONG VARCHAR FOR BIT DATA ); CREATE TABLE HASHTBL_STR_SIMPLE_CLASS87 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL LONG VARCHAR FOR BIT DATA ); CREATE TABLE HASHTBL_STR_SIMPLE_INTERFACE90 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL LONG VARCHAR FOR BIT DATA ); CREATE TABLE HASHTBL_STR_STRING93 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL VARCHAR(100) NOT NULL ); CREATE TABLE HASHTBL_STR_DATE96 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL TIMESTAMP NOT NULL ); CREATE TABLE HASHTBL_STR_LOCALE99 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(20) NOT NULL ); CREATE TABLE HASHTBL_STR_BIG_DECIMAL102 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DECIMAL(27,16) NOT NULL ); CREATE TABLE HASHTBL_STR_BIG_INTEGER105 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(31) NOT NULL ); CREATE TABLE HASHTBL_STR_BYTE108 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE HASHTBL_STR_DOUBLE111 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DOUBLE NOT NULL ); CREATE TABLE HASHTBL_STR_FLOAT114 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL REAL NOT NULL ); CREATE TABLE HASHTBL_STR_INTEGER117 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL INTEGER NOT NULL ); CREATE TABLE HASHTBL_STR_LONG120 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL BIGINT NOT NULL ); CREATE TABLE HASHTBL_STR_SHORT123 ( IDENTIFIER INTEGER REFERENCES HASHTABLESTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); --HashMapOfStringValueCollections CREATE TABLE HASHMAPSTRINGVALUE_COLLECTIONS ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, IDENTIFIER INTEGER, HASHMAP_OBJECT8_STR LONG VARCHAR FOR BIT DATA, HASHMAP_SIMPLE_CLASS17_STR LONG VARCHAR FOR BIT DATA, HASHMAP_SIMPLE_INTERFACE26_STR LONG VARCHAR FOR BIT DATA, HASHMAP_STRING35_STR LONG VARCHAR FOR BIT DATA, HASHMAP_DATE44_STR LONG VARCHAR FOR BIT DATA, HASHMAP_BIG_DECIMAL53_STR LONG VARCHAR FOR BIT DATA, HASHMAP_BIG_INTEGER62_STR LONG VARCHAR FOR BIT DATA, HASHMAP_BYTE71_STR LONG VARCHAR FOR BIT DATA, HASHMAP_DOUBLE80_STR LONG VARCHAR FOR BIT DATA, HASHMAP_FLOAT89_STR LONG VARCHAR FOR BIT DATA, HASHMAP_INTEGER98_STR LONG VARCHAR FOR BIT DATA, HASHMAP_LONG107_STR LONG VARCHAR FOR BIT DATA, HASHMAP_SHORT116_STR LONG VARCHAR FOR BIT DATA, CONSTRAINT HMSVC_PK PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE HASHMAP_OBJECT0_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHMAP_OBJECT1_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHMAP_OBJECT2_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHMAP_OBJECT3_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHMAP_OBJECT4_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHMAP_OBJECT6_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHMAP_SIMPLE_CLASS9_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHMAP_SIMPLE_CLASS10_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHMAP_SIMPLE_CLASS11_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHMAP_SIMPLE_CLASS12_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHMAP_SIMPLE_CLASS13_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHMAP_SIMPLE_CLASS15_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHMAP_SIMPLE_INTERFACE18_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHMAP_SIMPLE_INTERFACE19_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHMAP_SIMPLE_INTERFACE20_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHMAP_SIMPLE_INTERFACE21_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHMAP_SIMPLE_INTERFACE22_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHMAP_SIMPLE_INTERFACE24_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHMAP_STRING27_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL VARCHAR(1024) ); CREATE TABLE HASHMAP_STRING28_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL VARCHAR(1024) ); CREATE TABLE HASHMAP_STRING29_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL VARCHAR(1024) ); CREATE TABLE HASHMAP_STRING30_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL VARCHAR(1024) ); CREATE TABLE HASHMAP_STRING31_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL VARCHAR(1024) ); CREATE TABLE HASHMAP_STRING33_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL VARCHAR(1024) ); CREATE TABLE HASHMAP_DATE36_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL TIMESTAMP ); CREATE TABLE HASHMAP_DATE37_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL TIMESTAMP ); CREATE TABLE HASHMAP_DATE38_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL TIMESTAMP ); CREATE TABLE HASHMAP_DATE39_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL TIMESTAMP ); CREATE TABLE HASHMAP_DATE40_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL TIMESTAMP ); CREATE TABLE HASHMAP_DATE42_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL TIMESTAMP ); CREATE TABLE HASHMAP_BIG_DECIMAL45_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DECIMAL(27,16) ); CREATE TABLE HASHMAP_BIG_DECIMAL46_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DECIMAL(27,16) ); CREATE TABLE HASHMAP_BIG_DECIMAL47_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DECIMAL(27,16) ); CREATE TABLE HASHMAP_BIG_DECIMAL48_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DECIMAL(27,16) ); CREATE TABLE HASHMAP_BIG_DECIMAL49_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DECIMAL(27,16) ); CREATE TABLE HASHMAP_BIG_DECIMAL51_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DECIMAL(27,16) ); CREATE TABLE HASHMAP_BIG_INTEGER54_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(31) ); CREATE TABLE HASHMAP_BIG_INTEGER55_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(31) ); CREATE TABLE HASHMAP_BIG_INTEGER56_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(31) ); CREATE TABLE HASHMAP_BIG_INTEGER57_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(31) ); CREATE TABLE HASHMAP_BIG_INTEGER58_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(31) ); CREATE TABLE HASHMAP_BIG_INTEGER60_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(31) ); CREATE TABLE HASHMAP_BYTE63_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE HASHMAP_BYTE64_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE HASHMAP_BYTE65_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE HASHMAP_BYTE66_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE HASHMAP_BYTE67_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE HASHMAP_BYTE69_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE HASHMAP_DOUBLE72_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DOUBLE ); CREATE TABLE HASHMAP_DOUBLE73_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DOUBLE ); CREATE TABLE HASHMAP_DOUBLE74_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DOUBLE ); CREATE TABLE HASHMAP_DOUBLE75_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DOUBLE ); CREATE TABLE HASHMAP_DOUBLE76_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DOUBLE ); CREATE TABLE HASHMAP_DOUBLE78_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DOUBLE ); CREATE TABLE HASHMAP_FLOAT81_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL REAL ); CREATE TABLE HASHMAP_FLOAT82_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL REAL ); CREATE TABLE HASHMAP_FLOAT83_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL REAL ); CREATE TABLE HASHMAP_FLOAT84_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL REAL ); CREATE TABLE HASHMAP_FLOAT85_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL REAL ); CREATE TABLE HASHMAP_FLOAT87_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL REAL ); CREATE TABLE HASHMAP_INTEGER90_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL INTEGER ); CREATE TABLE HASHMAP_INTEGER91_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL INTEGER ); CREATE TABLE HASHMAP_INTEGER92_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL INTEGER ); CREATE TABLE HASHMAP_INTEGER93_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL INTEGER ); CREATE TABLE HASHMAP_INTEGER94_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL INTEGER ); CREATE TABLE HASHMAP_INTEGER96_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL INTEGER ); CREATE TABLE HASHMAP_LONG99_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL BIGINT ); CREATE TABLE HASHMAP_LONG100_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL BIGINT ); CREATE TABLE HASHMAP_LONG101_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL BIGINT ); CREATE TABLE HASHMAP_LONG102_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL BIGINT ); CREATE TABLE HASHMAP_LONG103_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL BIGINT ); CREATE TABLE HASHMAP_LONG105_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL BIGINT ); CREATE TABLE HASHMAP_SHORT108_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE HASHMAP_SHORT109_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE HASHMAP_SHORT110_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE HASHMAP_SHORT111_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE HASHMAP_SHORT112_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE HASHMAP_SHORT114_STR ( IDENTIFIER INTEGER REFERENCES HASHMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); --HashtableOfStringValueCollections CREATE TABLE HASHTBLSTRINGVALUE_COLLECTIONS ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, IDENTIFIER INTEGER, HASHTBL_OBJECT8_STR LONG VARCHAR FOR BIT DATA, HASHTBL_SIMPLE_CLASS17_STR LONG VARCHAR FOR BIT DATA, HASHTBL_SIMPLE_INTERFACE26_STR LONG VARCHAR FOR BIT DATA, HASHTBL_STRING35_STR LONG VARCHAR FOR BIT DATA, HASHTBL_DATE44_STR LONG VARCHAR FOR BIT DATA, HASHTBL_BIG_DECIMAL53_STR LONG VARCHAR FOR BIT DATA, HASHTBL_BIG_INTEGER62_STR LONG VARCHAR FOR BIT DATA, HASHTBL_BYTE71_STR LONG VARCHAR FOR BIT DATA, HASHTBL_DOUBLE80_STR LONG VARCHAR FOR BIT DATA, HASHTBL_FLOAT89_STR LONG VARCHAR FOR BIT DATA, HASHTBL_INTEGER98_STR LONG VARCHAR FOR BIT DATA, HASHTBL_LONG107_STR LONG VARCHAR FOR BIT DATA, HASHTBL_SHORT116_STR LONG VARCHAR FOR BIT DATA, CONSTRAINT HTSVC_PK PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE HASHTBL_OBJECT0_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHTBL_OBJECT1_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHTBL_OBJECT2_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHTBL_OBJECT3_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHTBL_OBJECT4_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHTBL_OBJECT6_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHTBL_SIMPLE_CLASS9_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHTBL_SIMPLE_CLASS10_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHTBL_SIMPLE_CLASS11_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHTBL_SIMPLE_CLASS12_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHTBL_SIMPLE_CLASS13_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHTBL_SIMPLE_CLASS15_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHTBL_SIMPLE_INTERFACE18_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHTBL_SIMPLE_INTERFACE19_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHTBL_SIMPLE_INTERFACE20_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE HASHTBL_SIMPLE_INTERFACE21_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHTBL_SIMPLE_INTERFACE22_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHTBL_SIMPLE_INTERFACE24_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE HASHTBL_STRING27_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL VARCHAR(1024) ); CREATE TABLE HASHTBL_STRING28_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL VARCHAR(1024) ); CREATE TABLE HASHTBL_STRING29_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL VARCHAR(1024) ); CREATE TABLE HASHTBL_STRING30_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL VARCHAR(1024) ); CREATE TABLE HASHTBL_STRING31_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL VARCHAR(1024) ); CREATE TABLE HASHTBL_STRING33_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL VARCHAR(1024) ); CREATE TABLE HASHTBL_DATE36_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL TIMESTAMP ); CREATE TABLE HASHTBL_DATE37_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL TIMESTAMP ); CREATE TABLE HASHTBL_DATE38_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL TIMESTAMP ); CREATE TABLE HASHTBL_DATE39_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL TIMESTAMP ); CREATE TABLE HASHTBL_DATE40_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL TIMESTAMP ); CREATE TABLE HASHTBL_DATE42_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL TIMESTAMP ); CREATE TABLE HASHTBL_BIG_DECIMAL45_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DECIMAL(27,16) ); CREATE TABLE HASHTBL_BIG_DECIMAL46_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DECIMAL(27,16) ); CREATE TABLE HASHTBL_BIG_DECIMAL47_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DECIMAL(27,16) ); CREATE TABLE HASHTBL_BIG_DECIMAL48_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DECIMAL(27,16) ); CREATE TABLE HASHTBL_BIG_DECIMAL49_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DECIMAL(27,16) ); CREATE TABLE HASHTBL_BIG_DECIMAL51_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DECIMAL(27,16) ); CREATE TABLE HASHTBL_BIG_INTEGER54_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(31) ); CREATE TABLE HASHTBL_BIG_INTEGER55_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(31) ); CREATE TABLE HASHTBL_BIG_INTEGER56_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(31) ); CREATE TABLE HASHTBL_BIG_INTEGER57_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(31) ); CREATE TABLE HASHTBL_BIG_INTEGER58_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(31) ); CREATE TABLE HASHTBL_BIG_INTEGER60_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(31) ); CREATE TABLE HASHTBL_BYTE63_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE HASHTBL_BYTE64_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE HASHTBL_BYTE65_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE HASHTBL_BYTE66_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE HASHTBL_BYTE67_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE HASHTBL_BYTE69_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE HASHTBL_DOUBLE72_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DOUBLE ); CREATE TABLE HASHTBL_DOUBLE73_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DOUBLE ); CREATE TABLE HASHTBL_DOUBLE74_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DOUBLE ); CREATE TABLE HASHTBL_DOUBLE75_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DOUBLE ); CREATE TABLE HASHTBL_DOUBLE76_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DOUBLE ); CREATE TABLE HASHTBL_DOUBLE78_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DOUBLE ); CREATE TABLE HASHTBL_FLOAT81_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL REAL ); CREATE TABLE HASHTBL_FLOAT82_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL REAL ); CREATE TABLE HASHTBL_FLOAT83_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL REAL ); CREATE TABLE HASHTBL_FLOAT84_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL REAL ); CREATE TABLE HASHTBL_FLOAT85_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL REAL ); CREATE TABLE HASHTBL_FLOAT87_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL REAL ); CREATE TABLE HASHTBL_INTEGER90_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL INTEGER ); CREATE TABLE HASHTBL_INTEGER91_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL INTEGER ); CREATE TABLE HASHTBL_INTEGER92_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL INTEGER ); CREATE TABLE HASHTBL_INTEGER93_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL INTEGER ); CREATE TABLE HASHTBL_INTEGER94_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL INTEGER ); CREATE TABLE HASHTBL_INTEGER96_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL INTEGER ); CREATE TABLE HASHTBL_LONG99_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL BIGINT ); CREATE TABLE HASHTBL_LONG100_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL BIGINT ); CREATE TABLE HASHTBL_LONG101_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL BIGINT ); CREATE TABLE HASHTBL_LONG102_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL BIGINT ); CREATE TABLE HASHTBL_LONG103_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL BIGINT ); CREATE TABLE HASHTBL_LONG105_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL BIGINT ); CREATE TABLE HASHTBL_SHORT108_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE HASHTBL_SHORT109_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE HASHTBL_SHORT110_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE HASHTBL_SHORT111_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE HASHTBL_SHORT112_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE HASHTBL_SHORT114_STR ( IDENTIFIER INTEGER REFERENCES HASHTBLSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); --TreeMapOfStringValueCollections CREATE TABLE TREEMAPSTRINGVALUE_COLLECTIONS ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, IDENTIFIER INTEGER, TREEMAP_OBJECT8_STR LONG VARCHAR FOR BIT DATA, TREEMAP_SIMPLE_CLASS17_STR LONG VARCHAR FOR BIT DATA, TREEMAP_SIMPLE_INTERFACE26_STR LONG VARCHAR FOR BIT DATA, TREEMAP_STRING35_STR LONG VARCHAR FOR BIT DATA, TREEMAP_DATE44_STR LONG VARCHAR FOR BIT DATA, TREEMAP_BIG_DECIMAL53_STR LONG VARCHAR FOR BIT DATA, TREEMAP_BIG_INTEGER62_STR LONG VARCHAR FOR BIT DATA, TREEMAP_BYTE71_STR LONG VARCHAR FOR BIT DATA, TREEMAP_DOUBLE80_STR LONG VARCHAR FOR BIT DATA, TREEMAP_FLOAT89_STR LONG VARCHAR FOR BIT DATA, TREEMAP_INTEGER98_STR LONG VARCHAR FOR BIT DATA, TREEMAP_LONG107_STR LONG VARCHAR FOR BIT DATA, TREEMAP_SHORT116_STR LONG VARCHAR FOR BIT DATA, CONSTRAINT TMSVC_PK PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE TREEMAP_OBJECT0_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE TREEMAP_OBJECT1_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE TREEMAP_OBJECT2_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE TREEMAP_OBJECT3_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE TREEMAP_OBJECT4_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE TREEMAP_OBJECT6_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE TREEMAP_SIMPLE_CLASS9_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE TREEMAP_SIMPLE_CLASS10_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE TREEMAP_SIMPLE_CLASS11_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE TREEMAP_SIMPLE_CLASS12_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE TREEMAP_SIMPLE_CLASS13_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE TREEMAP_SIMPLE_CLASS15_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE TREEMAP_SIMPLE_INTERFACE18_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE TREEMAP_SIMPLE_INTERFACE19_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE TREEMAP_SIMPLE_INTERFACE20_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE TREEMAP_SIMPLE_INTERFACE21_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE TREEMAP_SIMPLE_INTERFACE22_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE TREEMAP_SIMPLE_INTERFACE24_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE TREEMAP_STRING27_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL VARCHAR(1024) ); CREATE TABLE TREEMAP_STRING28_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL VARCHAR(1024) ); CREATE TABLE TREEMAP_STRING29_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL VARCHAR(1024) ); CREATE TABLE TREEMAP_STRING30_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL VARCHAR(1024) ); CREATE TABLE TREEMAP_STRING31_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL VARCHAR(1024) ); CREATE TABLE TREEMAP_STRING33_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL VARCHAR(1024) ); CREATE TABLE TREEMAP_DATE36_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL TIMESTAMP ); CREATE TABLE TREEMAP_DATE37_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL TIMESTAMP ); CREATE TABLE TREEMAP_DATE38_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL TIMESTAMP ); CREATE TABLE TREEMAP_DATE39_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL TIMESTAMP ); CREATE TABLE TREEMAP_DATE40_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL TIMESTAMP ); CREATE TABLE TREEMAP_DATE42_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL TIMESTAMP ); CREATE TABLE TREEMAP_BIG_DECIMAL45_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DECIMAL(27,16) ); CREATE TABLE TREEMAP_BIG_DECIMAL46_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DECIMAL(27,16) ); CREATE TABLE TREEMAP_BIG_DECIMAL47_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DECIMAL(27,16) ); CREATE TABLE TREEMAP_BIG_DECIMAL48_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DECIMAL(27,16) ); CREATE TABLE TREEMAP_BIG_DECIMAL49_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DECIMAL(27,16) ); CREATE TABLE TREEMAP_BIG_DECIMAL51_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DECIMAL(27,16) ); CREATE TABLE TREEMAP_BIG_INTEGER54_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(31) ); CREATE TABLE TREEMAP_BIG_INTEGER55_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(31) ); CREATE TABLE TREEMAP_BIG_INTEGER56_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(31) ); CREATE TABLE TREEMAP_BIG_INTEGER57_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(31) ); CREATE TABLE TREEMAP_BIG_INTEGER58_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(31) ); CREATE TABLE TREEMAP_BIG_INTEGER60_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(31) ); CREATE TABLE TREEMAP_BYTE63_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE TREEMAP_BYTE64_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE TREEMAP_BYTE65_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE TREEMAP_BYTE66_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE TREEMAP_BYTE67_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE TREEMAP_BYTE69_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE TREEMAP_DOUBLE72_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DOUBLE ); CREATE TABLE TREEMAP_DOUBLE73_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DOUBLE ); CREATE TABLE TREEMAP_DOUBLE74_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DOUBLE ); CREATE TABLE TREEMAP_DOUBLE75_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DOUBLE ); CREATE TABLE TREEMAP_DOUBLE76_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DOUBLE ); CREATE TABLE TREEMAP_DOUBLE78_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DOUBLE ); CREATE TABLE TREEMAP_FLOAT81_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL REAL ); CREATE TABLE TREEMAP_FLOAT82_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL REAL ); CREATE TABLE TREEMAP_FLOAT83_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL REAL ); CREATE TABLE TREEMAP_FLOAT84_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL REAL ); CREATE TABLE TREEMAP_FLOAT85_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL REAL ); CREATE TABLE TREEMAP_FLOAT87_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL REAL ); CREATE TABLE TREEMAP_INTEGER90_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL INTEGER ); CREATE TABLE TREEMAP_INTEGER91_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL INTEGER ); CREATE TABLE TREEMAP_INTEGER92_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL INTEGER ); CREATE TABLE TREEMAP_INTEGER93_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL INTEGER ); CREATE TABLE TREEMAP_INTEGER94_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL INTEGER ); CREATE TABLE TREEMAP_INTEGER96_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL INTEGER ); CREATE TABLE TREEMAP_LONG99_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL BIGINT ); CREATE TABLE TREEMAP_LONG100_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL BIGINT ); CREATE TABLE TREEMAP_LONG101_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL BIGINT ); CREATE TABLE TREEMAP_LONG102_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL BIGINT ); CREATE TABLE TREEMAP_LONG103_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL BIGINT ); CREATE TABLE TREEMAP_LONG105_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL BIGINT ); CREATE TABLE TREEMAP_SHORT108_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE TREEMAP_SHORT109_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE TREEMAP_SHORT110_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE TREEMAP_SHORT111_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE TREEMAP_SHORT112_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE TREEMAP_SHORT114_STR ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); --MapOfStringValueCollections CREATE TABLE MAPSTRINGVALUE_COLLECTIONS ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, IDENTIFIER INTEGER, MAP_OBJECT8_STR LONG VARCHAR FOR BIT DATA, MAP_SIMPLE_CLASS17_STR LONG VARCHAR FOR BIT DATA, MAP_SIMPLE_INTERFACE26_STR LONG VARCHAR FOR BIT DATA, MAP_STRING35_STR LONG VARCHAR FOR BIT DATA, MAP_DATE44_STR LONG VARCHAR FOR BIT DATA, MAP_BIG_DECIMAL53_STR LONG VARCHAR FOR BIT DATA, MAP_BIG_INTEGER62_STR LONG VARCHAR FOR BIT DATA, MAP_BYTE71_STR LONG VARCHAR FOR BIT DATA, MAP_DOUBLE80_STR LONG VARCHAR FOR BIT DATA, MAP_FLOAT89_STR LONG VARCHAR FOR BIT DATA, MAP_INTEGER98_STR LONG VARCHAR FOR BIT DATA, MAP_LONG107_STR LONG VARCHAR FOR BIT DATA, MAP_SHORT116_STR LONG VARCHAR FOR BIT DATA, MAP_SIMPLEENUM123_STR LONG VARCHAR FOR BIT DATA, CONSTRAINT MSVC_PK PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE MAP_OBJECT0_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE MAP_OBJECT1_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE MAP_OBJECT2_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE MAP_OBJECT3_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE MAP_OBJECT4_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE MAP_OBJECT6_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE MAP_SIMPLE_CLASS9_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE MAP_SIMPLE_CLASS10_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE MAP_SIMPLE_CLASS11_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE MAP_SIMPLE_CLASS12_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE MAP_SIMPLE_CLASS13_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE MAP_SIMPLE_CLASS15_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE MAP_SIMPLE_INTERFACE18_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE MAP_SIMPLE_INTERFACE19_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE MAP_SIMPLE_INTERFACE20_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE MAP_SIMPLE_INTERFACE21_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE MAP_SIMPLE_INTERFACE22_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE MAP_SIMPLE_INTERFACE24_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE MAP_STRING27_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL VARCHAR(1024) ); CREATE TABLE MAP_STRING28_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL VARCHAR(1024) ); CREATE TABLE MAP_STRING29_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL VARCHAR(1024) ); CREATE TABLE MAP_STRING30_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL VARCHAR(1024) ); CREATE TABLE MAP_STRING31_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL VARCHAR(1024) ); CREATE TABLE MAP_STRING33_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL VARCHAR(1024) ); CREATE TABLE MAP_DATE36_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL TIMESTAMP ); CREATE TABLE MAP_DATE37_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL TIMESTAMP ); CREATE TABLE MAP_DATE38_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL TIMESTAMP ); CREATE TABLE MAP_DATE39_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL TIMESTAMP ); CREATE TABLE MAP_DATE40_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL TIMESTAMP ); CREATE TABLE MAP_DATE42_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL TIMESTAMP ); CREATE TABLE MAP_BIG_DECIMAL45_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DECIMAL(27,16) ); CREATE TABLE MAP_BIG_DECIMAL46_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DECIMAL(27,16) ); CREATE TABLE MAP_BIG_DECIMAL47_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DECIMAL(27,16) ); CREATE TABLE MAP_BIG_DECIMAL48_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DECIMAL(27,16) ); CREATE TABLE MAP_BIG_DECIMAL49_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DECIMAL(27,16) ); CREATE TABLE MAP_BIG_DECIMAL51_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DECIMAL(27,16) ); CREATE TABLE MAP_BIG_INTEGER54_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(31) ); CREATE TABLE MAP_BIG_INTEGER55_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(31) ); CREATE TABLE MAP_BIG_INTEGER56_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(31) ); CREATE TABLE MAP_BIG_INTEGER57_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(31) ); CREATE TABLE MAP_BIG_INTEGER58_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(31) ); CREATE TABLE MAP_BIG_INTEGER60_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(31) ); CREATE TABLE MAP_BYTE63_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE MAP_BYTE64_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE MAP_BYTE65_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE MAP_BYTE66_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE MAP_BYTE67_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE MAP_BYTE69_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE MAP_DOUBLE72_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DOUBLE ); CREATE TABLE MAP_DOUBLE73_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DOUBLE ); CREATE TABLE MAP_DOUBLE74_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DOUBLE ); CREATE TABLE MAP_DOUBLE75_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DOUBLE ); CREATE TABLE MAP_DOUBLE76_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DOUBLE ); CREATE TABLE MAP_DOUBLE78_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL DOUBLE ); CREATE TABLE MAP_FLOAT81_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL REAL ); CREATE TABLE MAP_FLOAT82_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL REAL ); CREATE TABLE MAP_FLOAT83_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL REAL ); CREATE TABLE MAP_FLOAT84_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL REAL ); CREATE TABLE MAP_FLOAT85_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL REAL ); CREATE TABLE MAP_FLOAT87_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL REAL ); CREATE TABLE MAP_INTEGER90_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL INTEGER ); CREATE TABLE MAP_INTEGER91_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL INTEGER ); CREATE TABLE MAP_INTEGER92_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL INTEGER ); CREATE TABLE MAP_INTEGER93_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL INTEGER ); CREATE TABLE MAP_INTEGER94_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL INTEGER ); CREATE TABLE MAP_INTEGER96_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL INTEGER ); CREATE TABLE MAP_LONG99_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL BIGINT ); CREATE TABLE MAP_LONG100_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL BIGINT ); CREATE TABLE MAP_LONG101_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL BIGINT ); CREATE TABLE MAP_LONG102_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL BIGINT ); CREATE TABLE MAP_LONG103_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL BIGINT ); CREATE TABLE MAP_LONG105_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL BIGINT ); CREATE TABLE MAP_SHORT108_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE MAP_SHORT109_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE MAP_SHORT110_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE MAP_SHORT111_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE MAP_SHORT112_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE MAP_SHORT114_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL SMALLINT ); CREATE TABLE MAP_SIMPLEENUM117_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL CHAR(2) ); CREATE TABLE MAP_SIMPLEENUM118_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL CHAR(2) ); CREATE TABLE MAP_SIMPLEENUM119_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL CHAR(2) ); CREATE TABLE MAP_SIMPLEENUM120_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL CHAR(2) ); CREATE TABLE MAP_SIMPLEENUM121_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL CHAR(2) ); CREATE TABLE MAP_SIMPLEENUM122_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL CHAR(2) ); CREATE TABLE MAP_SIMPLEENUM124_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(2,0) ); CREATE TABLE MAP_SIMPLEENUM125_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(2,0) ); CREATE TABLE MAP_SIMPLEENUM126_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(2,0) ); CREATE TABLE MAP_SIMPLEENUM127_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(2,0) ); CREATE TABLE MAP_SIMPLEENUM128_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(2,0) ); CREATE TABLE MAP_SIMPLEENUM129_STR ( IDENTIFIER INTEGER REFERENCES MAPSTRINGVALUE_COLLECTIONS NOT NULL, VALUEVAL VARCHAR(100) NOT NULL, KEYVAL NUMERIC(2,0) ); --TreeMapOfStringKeyCollections CREATE TABLE TREEMAPSTRINGKEY_COLLECTIONS ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, IDENTIFIER INTEGER, TREEMAP_STR_OBJECT86 LONG VARCHAR FOR BIT DATA, TREEMAP_STR_SIMPLECLASS89 LONG VARCHAR FOR BIT DATA, TREEMAP_STR_SIMPLEINTERFACE92 LONG VARCHAR FOR BIT DATA, TREEMAP_STR_STRING95 LONG VARCHAR FOR BIT DATA, TREEMAP_STR_DATE98 LONG VARCHAR FOR BIT DATA, TREEMAP_STR_LOCALE101 LONG VARCHAR FOR BIT DATA, TREEMAP_STR_BIGDECIMAL104 LONG VARCHAR FOR BIT DATA, TREEMAP_STR_BIGINTEGER107 LONG VARCHAR FOR BIT DATA, TREEMAP_STR_BYTE110 LONG VARCHAR FOR BIT DATA, TREEMAP_STR_DOUBLE113 LONG VARCHAR FOR BIT DATA, TREEMAP_STR_FLOAT116 LONG VARCHAR FOR BIT DATA, TREEMAP_STR_INTEGER119 LONG VARCHAR FOR BIT DATA, TREEMAP_STR_LONG122 LONG VARCHAR FOR BIT DATA, TREEMAP_STR_SHORT125 LONG VARCHAR FOR BIT DATA, CONSTRAINT TMSKC_PK PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE TREEMAP_STR_OBJECT0 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, OBJREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE TREEMAP_STR_OBJECT1 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, OBJREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE TREEMAP_STR_OBJECT2 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, OBJREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE TREEMAP_STR_SIMPLE_CLASS3 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, SIMPCLSREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE TREEMAP_STR_SIMPLE_CLASS4 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, SIMPCLSREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE TREEMAP_STR_SIMPLE_CLASS5 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, SIMPCLSREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE TREEMAP_STR_SIMPLE_INTERFACE6 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, SIMPINTREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE TREEMAP_STR_SIMPLE_INTERFACE7 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, SIMPINTREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE TREEMAP_STR_SIMPLE_INTERFACE8 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, SIMPINTREF BIGINT REFERENCES SIMPLE_CLASS NOT NULL ); CREATE TABLE TREEMAP_STR_STRING9 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL VARCHAR(100) NOT NULL ); CREATE TABLE TREEMAP_STR_STRING10 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL VARCHAR(100) NOT NULL ); CREATE TABLE TREEMAP_STR_STRING11 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL VARCHAR(100) NOT NULL ); CREATE TABLE TREEMAP_STR_DATE12 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL TIMESTAMP NOT NULL ); CREATE TABLE TREEMAP_STR_DATE13 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL TIMESTAMP NOT NULL ); CREATE TABLE TREEMAP_STR_DATE14 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL TIMESTAMP NOT NULL ); CREATE TABLE TREEMAP_STR_LOCALE15 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(20) NOT NULL ); CREATE TABLE TREEMAP_STR_LOCALE16 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(20) NOT NULL ); CREATE TABLE TREEMAP_STR_LOCALE17 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(20) NOT NULL ); CREATE TABLE TREEMAP_STR_BIG_DECIMAL18 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DECIMAL(27,16) NOT NULL ); CREATE TABLE TREEMAP_STR_BIG_DECIMAL19 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DECIMAL(27,16) NOT NULL ); CREATE TABLE TREEMAP_STR_BIG_DECIMAL20 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DECIMAL(27,16) NOT NULL ); CREATE TABLE TREEMAP_STR_BIG_INTEGER21 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(31) NOT NULL ); CREATE TABLE TREEMAP_STR_BIG_INTEGER22 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(31) NOT NULL ); CREATE TABLE TREEMAP_STR_BIG_INTEGER23 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(31) NOT NULL ); CREATE TABLE TREEMAP_STR_BYTE24 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE TREEMAP_STR_BYTE25 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE TREEMAP_STR_BYTE26 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE TREEMAP_STR_DOUBLE27 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DOUBLE NOT NULL ); CREATE TABLE TREEMAP_STR_DOUBLE28 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DOUBLE NOT NULL ); CREATE TABLE TREEMAP_STR_DOUBLE29 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DOUBLE NOT NULL ); CREATE TABLE TREEMAP_STR_FLOAT30 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL REAL NOT NULL ); CREATE TABLE TREEMAP_STR_FLOAT31 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL REAL NOT NULL ); CREATE TABLE TREEMAP_STR_FLOAT32 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL REAL NOT NULL ); CREATE TABLE TREEMAP_STR_INTEGER33 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL INTEGER NOT NULL ); CREATE TABLE TREEMAP_STR_INTEGER34 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL INTEGER NOT NULL ); CREATE TABLE TREEMAP_STR_INTEGER35 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL INTEGER NOT NULL ); CREATE TABLE TREEMAP_STR_LONG36 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL BIGINT NOT NULL ); CREATE TABLE TREEMAP_STR_LONG37 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL BIGINT NOT NULL ); CREATE TABLE TREEMAP_STR_LONG38 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL BIGINT NOT NULL ); CREATE TABLE TREEMAP_STR_SHORT39 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE TREEMAP_STR_SHORT40 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE TREEMAP_STR_SHORT41 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE TREEMAP_STR_OBJECT42 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE TREEMAP_STR_OBJECT43 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE TREEMAP_STR_SIMPLE_CLASS45 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE TREEMAP_STR_SIMPLE_CLASS46 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE TREEMAP_STR_SIMPLE_INTERFACE48 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE TREEMAP_STR_SIMPLE_INTERFACE49 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, ID BIGINT NOT NULL, INTVAL INTEGER NOT NULL, STRINGVAL VARCHAR(128) NOT NULL ); CREATE TABLE TREEMAP_STR_STRING51 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL VARCHAR(100) NOT NULL ); CREATE TABLE TREEMAP_STR_STRING52 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL VARCHAR(100) NOT NULL ); CREATE TABLE TREEMAP_STR_DATE54 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL TIMESTAMP NOT NULL ); CREATE TABLE TREEMAP_STR_DATE55 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL TIMESTAMP NOT NULL ); CREATE TABLE TREEMAP_STR_LOCALE57 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(20) NOT NULL ); CREATE TABLE TREEMAP_STR_LOCALE58 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(20) NOT NULL ); CREATE TABLE TREEMAP_STR_BIG_DECIMAL60 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DECIMAL(27,16) NOT NULL ); CREATE TABLE TREEMAP_STR_BIG_DECIMAL61 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DECIMAL(27,16) NOT NULL ); CREATE TABLE TREEMAP_STR_BIG_INTEGER63 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(31) NOT NULL ); CREATE TABLE TREEMAP_STR_BIG_INTEGER64 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(31) NOT NULL ); CREATE TABLE TREEMAP_STR_BYTE66 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE TREEMAP_STR_BYTE67 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE TREEMAP_STR_DOUBLE69 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DOUBLE NOT NULL ); CREATE TABLE TREEMAP_STR_DOUBLE70 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DOUBLE NOT NULL ); CREATE TABLE TREEMAP_STR_FLOAT72 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL REAL NOT NULL ); CREATE TABLE TREEMAP_STR_FLOAT73 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL REAL NOT NULL ); CREATE TABLE TREEMAP_STR_INTEGER75 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL INTEGER NOT NULL ); CREATE TABLE TREEMAP_STR_INTEGER76 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL INTEGER NOT NULL ); CREATE TABLE TREEMAP_STR_LONG78 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL BIGINT NOT NULL ); CREATE TABLE TREEMAP_STR_LONG79 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL BIGINT NOT NULL ); CREATE TABLE TREEMAP_STR_SHORT81 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE TREEMAP_STR_SHORT82 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE TREEMAP_STR_OBJECT84 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL LONG VARCHAR FOR BIT DATA ); CREATE TABLE TREEMAP_STR_SIMPLE_CLASS87 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL LONG VARCHAR FOR BIT DATA ); CREATE TABLE TREEMAP_STR_SIMPLE_INTERFACE90 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL LONG VARCHAR FOR BIT DATA ); CREATE TABLE TREEMAP_STR_STRING93 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL VARCHAR(100) NOT NULL ); CREATE TABLE TREEMAP_STR_DATE96 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL TIMESTAMP NOT NULL ); CREATE TABLE TREEMAP_STR_LOCALE99 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL CHAR(20) NOT NULL ); CREATE TABLE TREEMAP_STR_BIG_DECIMAL102 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DECIMAL(27,16) NOT NULL ); CREATE TABLE TREEMAP_STR_BIG_INTEGER105 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL NUMERIC(31) NOT NULL ); CREATE TABLE TREEMAP_STR_BYTE108 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); CREATE TABLE TREEMAP_STR_DOUBLE111 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL DOUBLE NOT NULL ); CREATE TABLE TREEMAP_STR_FLOAT114 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL REAL NOT NULL ); CREATE TABLE TREEMAP_STR_INTEGER117 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL INTEGER NOT NULL ); CREATE TABLE TREEMAP_STR_LONG120 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL BIGINT NOT NULL ); CREATE TABLE TREEMAP_STR_SHORT123 ( IDENTIFIER INTEGER REFERENCES TREEMAPSTRINGKEY_COLLECTIONS NOT NULL, KEYVAL VARCHAR(100) NOT NULL, VALUEVAL SMALLINT NOT NULL ); ------------------------- --inheritance ------------------------- DROP TABLE AllPersist; DROP TABLE TopNonPersistB; DROP TABLE TopPersist; DROP TABLE FieldSameName; CREATE TABLE AllPersist ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, KEY_VALUE INTEGER, DOUBLE_B DOUBLE, INT_B INTEGER, FLOAT_E REAL, SHORT_F SMALLINT, SECOND_OBJ INTEGER, THIRD_OBJ INTEGER, INT_H INTEGER, DISCRIMINATOR varchar(64) NOT NULL, CONSTRAINT AllPersist_PK PRIMARY KEY (DATASTORE_IDENTITY), FOREIGN KEY (SECOND_OBJ) REFERENCES AllPersist, FOREIGN KEY (THIRD_OBJ) REFERENCES AllPersist ); CREATE TABLE TopNonPersistB ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, KEY_VALUE INTEGER, DOUBLE_B DOUBLE, INT_B INTEGER, FLOAT_E REAL, SHORT_F SMALLINT, SECOND_OBJ INTEGER, THIRD_OBJ INTEGER, INT_H INTEGER, DISCRIMINATOR varchar(64) NOT NULL, CONSTRAINT TopNonPersistB_PK PRIMARY KEY (DATASTORE_IDENTITY), FOREIGN KEY (SECOND_OBJ) REFERENCES TopNonPersistB, FOREIGN KEY (THIRD_OBJ) REFERENCES TopNonPersistB ); CREATE TABLE TopPersist ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, KEY_VALUE INTEGER, DOUBLE_B DOUBLE, INT_B INTEGER, FLOAT_E REAL, SHORT_F SMALLINT, SECOND_OBJ INTEGER, THIRD_OBJ INTEGER, INT_H INTEGER, DISCRIMINATOR varchar(64) NOT NULL, CONSTRAINT TopPersist_PK PRIMARY KEY (DATASTORE_IDENTITY), FOREIGN KEY (SECOND_OBJ) REFERENCES TopPersist, FOREIGN KEY (THIRD_OBJ) REFERENCES TopPersist ); CREATE TABLE FieldSameName ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, KEY_VALUE INTEGER, N2 DOUBLE, N3 INTEGER, FSN2_N3 REAL, FSN3_N1 SMALLINT, FSN3_N2 INTEGER, FSN3_N3 INTEGER, FSN4_N3 INTEGER, DISCRIMINATOR varchar(64) NOT NULL, CONSTRAINT FieldSameName_PK PRIMARY KEY (DATASTORE_IDENTITY), FOREIGN KEY (FSN3_N2) REFERENCES FieldSameName, FOREIGN KEY (FSN3_N3) REFERENCES FieldSameName ); ------------------------- --instancecallbacks ------------------------- DROP TABLE ICNonPersistFds; DROP TABLE InstanceCallbacks; CREATE TABLE ICNonPersistFds ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, ICKEY INTEGER, D DOUBLE, S SMALLINT, FLOATVAL REAL, INTVAL INTEGER, CONSTRAINT ICNP_PK PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE InstanceCallbacks ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, ICKEY INTEGER, NAME VARCHAR(64), TIMEDATE TIMESTAMP, NEXTOBJ INTEGER, PARENT INTEGER, INTVAL INTEGER, DOUBLEVAL DOUBLE, CHILD2DEL INTEGER, CHARVAL CHAR(254), CONSTRAINT IC_PK PRIMARY KEY (DATASTORE_IDENTITY) ); ------------------------- --lifecycle ------------------------- DROP TABLE STATETRANSITIONOBJ; CREATE TABLE STATETRANSITIONOBJ ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, ID INTEGER, INT_FIELD INTEGER NOT NULL, CONSTRAINT STOBJ_PK PRIMARY KEY (DATASTORE_IDENTITY) ); ------------------------- --lifecycle-callbacks ------------------------- DROP TABLE LIFECYCLELISTENERATTACH; CREATE TABLE LIFECYCLELISTENERATTACH ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, ID INTEGER, CONSTRAINT LIFECYCLE_ATTACH_PK PRIMARY KEY (DATASTORE_IDENTITY) ); DROP TABLE LIFECYCLELISTENERCLEAR; CREATE TABLE LIFECYCLELISTENERCLEAR ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, ID INTEGER, CONSTRAINT LIFECYCLE_CLEAR_PK PRIMARY KEY (DATASTORE_IDENTITY) ); DROP TABLE LIFECYCLELISTENERDELETE; CREATE TABLE LIFECYCLELISTENERDELETE ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, ID INTEGER, CONSTRAINT LIFECYCLE_DELETE_PK PRIMARY KEY (DATASTORE_IDENTITY) ); DROP TABLE LIFECYCLELISTENERDETACH; CREATE TABLE LIFECYCLELISTENERDETACH ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, ID INTEGER, CONSTRAINT LIFECYCLE_DETACH_PK PRIMARY KEY (DATASTORE_IDENTITY) ); DROP TABLE LIFECYCLELISTENERLOAD; CREATE TABLE LIFECYCLELISTENERLOAD ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, ID INTEGER NOT NULL, VALUE INTEGER NOT NULL, CONSTRAINT LIFECYCLE_LOAD_PK PRIMARY KEY (DATASTORE_IDENTITY) ); DROP TABLE LIFECYCLELISTENERSTORE; CREATE TABLE LIFECYCLELISTENERSTORE ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, ID INTEGER, CONSTRAINT LIFECYCLE_STORE_PK PRIMARY KEY (DATASTORE_IDENTITY) ); disconnect; tck/src/sql/derby/datastoreidentity/schema1.sql100664 21553 12500110372 22172 0ustarmbouschenstaff 0 0 -- 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 -- Inheritance mapping: -- Separate table for each class in the inheritance hierarchy. -- Each table contains columns for the declared fields. -- See tables "persons", "employees", "parttimeemployees", -- "fulltimeemployees", "insuranceplans", "medicalinsurance", and "dentalinsurance". connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; CREATE SCHEMA datastoreidentity1; SET SCHEMA datastoreidentity1; ------------------------- -- company ------------------------- ALTER TABLE departments DROP CONSTRAINT EMP_MO_FK; ALTER TABLE project_reviewer DROP CONSTRAINT PR_PROJ_FK; ALTER TABLE project_reviewer DROP CONSTRAINT PR_REV_FK; DROP TABLE dentalinsurance; DROP TABLE medicalinsurance; DROP TABLE insuranceplans; DROP TABLE project_reviewer; DROP TABLE project_member; DROP TABLE employee_phoneno_type; DROP TABLE fulltimeemployees; DROP TABLE parttimeemployees; DROP TABLE employees; DROP TABLE persons; DROP TABLE projects; DROP TABLE departments; DROP TABLE companies; DROP TABLE meetingrooms; DROP TABLE department_rooms; CREATE TABLE companies ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, ID INTEGER, NAME VARCHAR(32) NOT NULL, FOUNDEDDATE DATE NOT NULL, ADDRID INTEGER, STREET VARCHAR(64), CITY VARCHAR(64), STATE CHAR(2), ZIPCODE CHAR(5), COUNTRY VARCHAR(64), CONSTRAINT COMPS_PK PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE departments ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, ID INTEGER, NAME VARCHAR(32) NOT NULL, EMP_OF_THE_MONTH INTEGER, COMPANYID INTEGER, CONSTRAINT DEPTS_PK PRIMARY KEY (DATASTORE_IDENTITY), CONSTRAINT DEPTS_COMPANYID FOREIGN KEY (COMPANYID) REFERENCES companies (DATASTORE_IDENTITY) ); CREATE TABLE department_rooms ( DEPTID INTEGER NOT NULL, ROOMID INTEGER NOT NULL, ROOM_ORDER INTEGER NOT NULL ); CREATE TABLE meetingrooms ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, ID INTEGER NOT NULL, NAME VARCHAR(32) NOT NULL, CONSTRAINT ROOMS_PK PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE persons ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, PERSONID INTEGER NOT NULL, FIRSTNAME VARCHAR(32) NOT NULL, LASTNAME VARCHAR(32) NOT NULL, MIDDLENAME VARCHAR(32), BIRTHDATE DATE NOT NULL, ADDRID INTEGER, STREET VARCHAR(64), CITY VARCHAR(64), STATE CHAR(2), ZIPCODE CHAR(5), COUNTRY VARCHAR(64), CONSTRAINT PERS_PK PRIMARY KEY (DATASTORE_IDENTITY), CONSTRAINT PERS_UK UNIQUE (PERSONID) ); CREATE TABLE employees ( DATASTORE_IDENTITY INTEGER NOT NULL, HIREDATE DATE, WEEKLYHOURS DOUBLE, DEPARTMENT INTEGER, FUNDINGDEPT INTEGER, MANAGER INTEGER, MENTOR INTEGER, HRADVISOR INTEGER, CONSTRAINT EMPS_PK PRIMARY KEY (DATASTORE_IDENTITY), CONSTRAINT EMPS_FK FOREIGN KEY (DATASTORE_IDENTITY) REFERENCES persons (DATASTORE_IDENTITY), CONSTRAINT EMPS_DEPARTMENT FOREIGN KEY (DEPARTMENT) REFERENCES departments (DATASTORE_IDENTITY), CONSTRAINT EMPS_FUNDINGDEPT FOREIGN KEY (FUNDINGDEPT) REFERENCES departments (DATASTORE_IDENTITY), CONSTRAINT EMPS_MANAGER FOREIGN KEY (MANAGER) REFERENCES persons (DATASTORE_IDENTITY), CONSTRAINT EMPS_MENTOR FOREIGN KEY (MENTOR) REFERENCES persons (DATASTORE_IDENTITY), CONSTRAINT EMPS_HRADVISOR FOREIGN KEY (HRADVISOR) REFERENCES persons (DATASTORE_IDENTITY) ); CREATE TABLE parttimeemployees ( DATASTORE_IDENTITY INTEGER NOT NULL, WAGE DOUBLE, CONSTRAINT PTEMPS_PK PRIMARY KEY (DATASTORE_IDENTITY), CONSTRAINT PTEMPS_FK FOREIGN KEY (DATASTORE_IDENTITY) REFERENCES persons (DATASTORE_IDENTITY) ); CREATE TABLE fulltimeemployees ( DATASTORE_IDENTITY INTEGER NOT NULL, SALARY DOUBLE, CONSTRAINT FTEMPS_PK PRIMARY KEY (DATASTORE_IDENTITY), CONSTRAINT FTEMPS_FK FOREIGN KEY (DATASTORE_IDENTITY) REFERENCES persons (DATASTORE_IDENTITY) ); CREATE TABLE insuranceplans ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, INSID INTEGER, CARRIER VARCHAR(64) NOT NULL, EMPLOYEE INTEGER, CONSTRAINT INS_PK PRIMARY KEY (DATASTORE_IDENTITY), CONSTRAINT INS_EMPLOYEE FOREIGN KEY (EMPLOYEE) REFERENCES persons (DATASTORE_IDENTITY) ); CREATE TABLE medicalinsurance ( DATASTORE_IDENTITY INTEGER NOT NULL, PLANTYPE VARCHAR(8), CONSTRAINT MEDINS_PK PRIMARY KEY (DATASTORE_IDENTITY), CONSTRAINT MEDINS_FK FOREIGN KEY (DATASTORE_IDENTITY) REFERENCES insuranceplans (DATASTORE_IDENTITY) ); CREATE TABLE dentalinsurance ( DATASTORE_IDENTITY INTEGER NOT NULL, LIFETIME_ORTHO_BENEFIT DECIMAL(22,3), CONSTRAINT DENTINS_PK PRIMARY KEY (DATASTORE_IDENTITY), CONSTRAINT DENTINS_FK FOREIGN KEY (DATASTORE_IDENTITY) REFERENCES insuranceplans (DATASTORE_IDENTITY) ); CREATE TABLE projects ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, PROJID INTEGER NOT NULL, NAME VARCHAR(32) NOT NULL, BUDGET DECIMAL(11,2) NOT NULL, CONSTRAINT PROJS_PK PRIMARY KEY (DATASTORE_IDENTITY), CONSTRAINT PROJS_UK UNIQUE (PROJID) ); CREATE TABLE project_reviewer ( PROJID INTEGER NOT NULL, REVIEWER INTEGER NOT NULL ); CREATE TABLE project_member ( PROJID INTEGER NOT NULL, MEMBER INTEGER NOT NULL ); CREATE TABLE employee_phoneno_type ( EMPID INTEGER NOT NULL, PHONENO VARCHAR(16) NOT NULL, TYPE VARCHAR(16) NOT NULL, CONSTRAINT employee_phoneno_type_EMPID FOREIGN KEY (EMPID) REFERENCES persons (DATASTORE_IDENTITY) ); ALTER TABLE project_reviewer ADD CONSTRAINT PR_PROJ_FK FOREIGN KEY (PROJID) REFERENCES projects(DATASTORE_IDENTITY); ALTER TABLE project_reviewer ADD CONSTRAINT PR_REV_FK FOREIGN KEY (REVIEWER) REFERENCES persons(DATASTORE_IDENTITY); ALTER TABLE project_member ADD CONSTRAINT PM_PROJ_FK FOREIGN KEY (PROJID) REFERENCES projects(DATASTORE_IDENTITY); ALTER TABLE project_member ADD CONSTRAINT PM_MEMB_FK FOREIGN KEY (MEMBER) REFERENCES persons(DATASTORE_IDENTITY); ALTER TABLE departments ADD CONSTRAINT EMP_MO_FK FOREIGN KEY (EMP_OF_THE_MONTH) REFERENCES persons(DATASTORE_IDENTITY) ON DELETE SET NULL; ------------------------- -- fieldtypes (enum) ------------------------- DROP TABLE FIELDSOFENUMORDINAL; CREATE TABLE FIELDSOFENUMORDINAL ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, IDENTIFIER INTEGER, ENUM0 SMALLINT, ENUM1 SMALLINT, ENUM102 SMALLINT, ENUM103 SMALLINT, ENUM104 INTEGER, ENUM108 INTEGER, ENUM109 INTEGER, ENUM11 INTEGER, ENUM110 BIGINT, ENUM112 BIGINT, ENUM113 BIGINT, ENUM114 BIGINT, ENUM119 NUMERIC(2,0), ENUM12 NUMERIC(2,0), ENUM120 NUMERIC(2,0), ENUM121 NUMERIC(2,0), ENUM124 SMALLINT, ENUM125 SMALLINT, ENUM126 SMALLINT, ENUM128 SMALLINT, ENUM129 INTEGER, ENUM13 INTEGER, ENUM130 INTEGER, ENUM138 INTEGER, ENUM139 BIGINT, ENUM140 BIGINT, ENUM16 BIGINT, ENUM17 BIGINT, ENUM18 NUMERIC(2,0), ENUM2 NUMERIC(2,0), ENUM20 NUMERIC(2,0), ENUM21 NUMERIC(2,0), ENUM22 SMALLINT, ENUM30 SMALLINT, ENUM31 SMALLINT, ENUM32 SMALLINT, ENUM36 INTEGER, ENUM37 INTEGER, ENUM38 INTEGER, ENUM4 INTEGER, ENUM40 BIGINT, ENUM41 BIGINT, ENUM42 BIGINT, ENUM47 BIGINT, ENUM48 NUMERIC(2,0), ENUM49 NUMERIC(2,0), ENUM5 NUMERIC(2,0), ENUM52 NUMERIC(2,0), ENUM53 SMALLINT, ENUM54 SMALLINT, ENUM56 SMALLINT, ENUM57 SMALLINT, ENUM58 INTEGER, ENUM6 INTEGER, ENUM66 INTEGER, ENUM67 INTEGER, ENUM68 BIGINT, ENUM72 BIGINT, ENUM73 BIGINT, ENUM74 BIGINT, ENUM76 NUMERIC(2,0), ENUM77 NUMERIC(2,0), ENUM78 NUMERIC(2,0), ENUM83 NUMERIC(2,0), ENUM84 SMALLINT, ENUM85 SMALLINT, ENUM88 SMALLINT, ENUM89 SMALLINT, ENUM90 INTEGER, ENUM92 INTEGER, ENUM93 INTEGER, ENUM94 INTEGER ); ALTER TABLE FIELDSOFENUMORDINAL ADD CONSTRAINT FIELDSOFENUMORDINAL_PK PRIMARY KEY (DATASTORE_IDENTITY); disconnect; tck/src/sql/derby/datastoreidentity/schema10.sql100664 6206 12500110372 22230 0ustarmbouschenstaff 0 0 -- 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 datastoreidentity10; SET SCHEMA datastoreidentity10; ------------------------- -- company ------------------------- ALTER TABLE departments DROP CONSTRAINT EMP_MO_FK; ALTER TABLE departments DROP CONSTRAINT DEPTS_COMP_FK; ALTER TABLE persons DROP CONSTRAINT PERS_DEPT_FK; ALTER TABLE persons DROP CONSTRAINT PERS_FUNDDEPT_FK; ALTER TABLE persons DROP CONSTRAINT PERS_MANAGER_FK; ALTER TABLE persons DROP CONSTRAINT PERS_MENTOR_FK; ALTER TABLE persons DROP CONSTRAINT PERS_HRADVISOR_FK; DROP TABLE persons; DROP TABLE departments; DROP TABLE companies; CREATE TABLE companies ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, ID INTEGER NOT NULL, NAME VARCHAR(32) NOT NULL, FOUNDEDDATE DATE NOT NULL, CONSTRAINT COMPS_PK PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE departments ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, ID INTEGER NOT NULL, NAME VARCHAR(32) NOT NULL, EMP_OF_THE_MONTH INTEGER, COMPANYID INTEGER, DISCRIMINATOR VARCHAR(255), CONSTRAINT DEPTS_COMP_FK FOREIGN KEY (COMPANYID) REFERENCES companies, CONSTRAINT DEPTS_PK PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE persons ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, PERSONID INTEGER NOT NULL, FIRSTNAME VARCHAR(32) NOT NULL, LASTNAME VARCHAR(32) NOT NULL, MIDDLENAME VARCHAR(32), BIRTHDATE DATE NOT NULL, DISCRIMINATOR varchar(64) NOT NULL, ORDER_COL INTEGER NOT NULL, HIREDATE DATE, WEEKLYHOURS REAL, DEPARTMENT INTEGER, FUNDINGDEPT INTEGER, MANAGER INTEGER, MENTOR INTEGER, HRADVISOR INTEGER, SALARY REAL, WAGE REAL, CONSTRAINT PERS_DEPT_FK FOREIGN KEY (DEPARTMENT) REFERENCES departments, CONSTRAINT PERS_FUNDDEPT_FK FOREIGN KEY (FUNDINGDEPT) REFERENCES departments, CONSTRAINT PERS_MANAGER_FK FOREIGN KEY (MANAGER) REFERENCES persons, CONSTRAINT PERS_MENTOR_FK FOREIGN KEY (MENTOR) REFERENCES persons, CONSTRAINT PERS_HRADVISOR_FK FOREIGN KEY (HRADVISOR) REFERENCES persons, CONSTRAINT PERS_PK PRIMARY KEY (DATASTORE_IDENTITY) ); ALTER TABLE departments ADD CONSTRAINT EMP_MO_FK FOREIGN KEY (EMP_OF_THE_MONTH) REFERENCES persons(DATASTORE_IDENTITY) ON DELETE SET NULL; tck/src/sql/derby/datastoreidentity/schema11.sql100664 13122 12500110372 22244 0ustarmbouschenstaff 0 0 -- 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 datastoreidentity11; SET SCHEMA datastoreidentity11; ------------------------- -- company ------------------------- ALTER TABLE comp_depts DROP CONSTRAINT EMP_MO_FK; ALTER TABLE comp_depts DROP CONSTRAINT DEPTS_COMP_FK; ALTER TABLE project_reviewer DROP CONSTRAINT PR_PROJ_FK; ALTER TABLE project_reviewer DROP CONSTRAINT PR_REV_FK; ALTER TABLE persons DROP CONSTRAINT PERS_DEPT_FK; ALTER TABLE persons DROP CONSTRAINT PERS_FUNDDEPT_FK; ALTER TABLE persons DROP CONSTRAINT PERS_MANAGER_FK; ALTER TABLE persons DROP CONSTRAINT PERS_MENTOR_FK; ALTER TABLE persons DROP CONSTRAINT PERS_HRADVISOR_FK; ALTER TABLE insuranceplans DROP CONSTRAINT INS_EMP_FK; DROP TABLE insuranceplans; DROP TABLE project_reviewer; DROP TABLE project_member; DROP TABLE employee_phoneno_type; DROP TABLE persons; DROP TABLE projects; DROP TABLE comp_depts; DROP TABLE companies; DROP TABLE meetingrooms; DROP TABLE department_rooms; CREATE TABLE companies ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, ID INTEGER, NAME VARCHAR(32) NOT NULL, FOUNDEDDATE DATE NOT NULL, ADDRID INTEGER, STREET VARCHAR(64), CITY VARCHAR(64), STATE CHAR(2), ZIPCODE CHAR(5), COUNTRY VARCHAR(64), DISCRIMINATOR VARCHAR(255), CONSTRAINT COMPS_PK PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE comp_depts ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, ID INTEGER, NAME VARCHAR(32) NOT NULL, EMP_OF_THE_MONTH INTEGER, COMPANYID INTEGER, DISCRIMINATOR VARCHAR(255), CONSTRAINT DEPTS_COMP_FK FOREIGN KEY (COMPANYID) REFERENCES companies, CONSTRAINT DEPTS_PK PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE department_rooms ( DEPTID INTEGER NOT NULL, ROOMID INTEGER NOT NULL, ROOM_ORDER INTEGER NOT NULL ); CREATE TABLE meetingrooms ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, ID INTEGER NOT NULL, NAME VARCHAR(32) NOT NULL, DISCRIMINATOR VARCHAR(255), CONSTRAINT ROOMS_PK PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE persons ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, PERSONID INTEGER NOT NULL, FIRSTNAME VARCHAR(32) NOT NULL, LASTNAME VARCHAR(32) NOT NULL, MIDDLENAME VARCHAR(32), BIRTHDATE DATE NOT NULL, ADDRID INTEGER, STREET VARCHAR(64), CITY VARCHAR(64), STATE CHAR(2), ZIPCODE CHAR(5), COUNTRY VARCHAR(64), HIREDATE DATE, WEEKLYHOURS REAL, DEPARTMENT INTEGER, FUNDINGDEPT INTEGER, MANAGER INTEGER, MENTOR INTEGER, HRADVISOR INTEGER, SALARY REAL, WAGE REAL, DISCRIMINATOR varchar(255) NOT NULL, CONSTRAINT PERS_DEPT_FK FOREIGN KEY (DEPARTMENT) REFERENCES comp_depts, CONSTRAINT PERS_FUNDDEPT_FK FOREIGN KEY (FUNDINGDEPT) REFERENCES comp_depts, CONSTRAINT PERS_MANAGER_FK FOREIGN KEY (MANAGER) REFERENCES persons, CONSTRAINT PERS_MENTOR_FK FOREIGN KEY (MENTOR) REFERENCES persons, CONSTRAINT PERS_HRADVISOR_FK FOREIGN KEY (HRADVISOR) REFERENCES persons, CONSTRAINT PERS_UK UNIQUE (PERSONID), CONSTRAINT PERS_PK PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE insuranceplans ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, INSID INTEGER, CARRIER VARCHAR(64) NOT NULL, LIFETIME_ORTHO_BENEFIT DECIMAL(22,3), PLANTYPE VARCHAR(8), DISCRIMINATOR varchar(255) NOT NULL, EMPLOYEE INTEGER, CONSTRAINT INS_EMP_FK FOREIGN KEY (EMPLOYEE) REFERENCES persons, CONSTRAINT INS_PK PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE projects ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, PROJID INTEGER NOT NULL, NAME VARCHAR(32) NOT NULL, PROJECT_BUDGET DECIMAL(11,2) NOT NULL, CLASS VARCHAR(255), CONSTRAINT PROJS_UK UNIQUE (PROJID), CONSTRAINT PROJS_PK PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE project_reviewer ( PROJID INTEGER NOT NULL, REVIEWER INTEGER NOT NULL ); CREATE TABLE project_member ( PROJID INTEGER NOT NULL, MEMBER INTEGER NOT NULL ); CREATE TABLE employee_phoneno_type ( EMPID INTEGER REFERENCES persons NOT NULL, PHONENO VARCHAR(16) NOT NULL, TYPE VARCHAR(16) NOT NULL ); ALTER TABLE project_reviewer ADD CONSTRAINT PR_PROJ_FK FOREIGN KEY (PROJID) REFERENCES projects; ALTER TABLE project_reviewer ADD CONSTRAINT PR_REV_FK FOREIGN KEY (REVIEWER) REFERENCES persons; ALTER TABLE project_member ADD CONSTRAINT PM_PROJ_FK FOREIGN KEY (PROJID) REFERENCES projects; ALTER TABLE project_member ADD CONSTRAINT PM_MEMB_FK FOREIGN KEY (MEMBER) REFERENCES persons; ALTER TABLE comp_depts ADD CONSTRAINT EMP_MO_FK FOREIGN KEY (EMP_OF_THE_MONTH) REFERENCES persons ON DELETE SET NULL; disconnect; tck/src/sql/derby/datastoreidentity/schema12.sql100664 2713 12500110372 22231 0ustarmbouschenstaff 0 0 -- 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 SEQUENCE DATASTORE_SEQ; DROP TABLE KITCHEN; CREATE SEQUENCE DATASTORE_SEQ AS BIGINT START WITH 1; 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) ); tck/src/sql/derby/datastoreidentity/schema2.sql100664 21147 12500110372 22172 0ustarmbouschenstaff 0 0 -- 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 -- Inheritance mapping: -- Separate table for each class in the inheritance hierarchy. -- No tables for abstract classes. -- Each table contains columns for all fields. -- Managers, mentors, hradvisors, and employees of the month -- are fulltime employees. -- Only fulltime employees can have insurances, can be project members, -- and can be project reviewers. -- Separate phone number type tables for persons, fulltime employees, -- and parttime employees. -- See tables "persons", "parttimeemployees", -- "fulltimeemployees", "medicalinsurance", "dentalinsurance", -- "fulltime_employee_phoneno_type", and "parttime_employee_phoneno_type". connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; CREATE SCHEMA datastoreidentity2; SET SCHEMA datastoreidentity2; ------------------------- -- company ------------------------- ALTER TABLE departments DROP CONSTRAINT EMP_MO_FK; ALTER TABLE project_reviewer DROP CONSTRAINT PR_PROJ_FK; ALTER TABLE project_reviewer DROP CONSTRAINT PR_REV_FK; DROP TABLE dentalinsurance; DROP TABLE medicalinsurance; DROP TABLE project_reviewer; DROP TABLE project_member; DROP TABLE employee_phoneno_type; DROP TABLE fulltime_employee_phoneno_type; DROP TABLE parttime_employee_phoneno_type; DROP TABLE parttimeemployees; DROP TABLE fulltimeemployees; DROP TABLE persons; DROP TABLE projects; DROP TABLE departments; DROP TABLE companies; DROP TABLE meetingrooms; DROP TABLE department_rooms; CREATE TABLE companies ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, ID INTEGER, NAME VARCHAR(32) NOT NULL, FOUNDEDDATE DATE NOT NULL, ADDRID INTEGER, STREET VARCHAR(64), CITY VARCHAR(64), STATE CHAR(2), ZIPCODE CHAR(5), COUNTRY VARCHAR(64), CONSTRAINT COMPS_PK PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE departments ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, ID INTEGER, NAME VARCHAR(32) NOT NULL, EMP_OF_THE_MONTH INTEGER, COMPANYID INTEGER, CONSTRAINT DEPTS_PK PRIMARY KEY (DATASTORE_IDENTITY), CONSTRAINT DEPTS_COMPANYID FOREIGN KEY (COMPANYID) REFERENCES companies (DATASTORE_IDENTITY) ); CREATE TABLE department_rooms ( DEPTID INTEGER NOT NULL, ROOMID INTEGER NOT NULL, ROOM_ORDER INTEGER NOT NULL ); CREATE TABLE meetingrooms ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, ID INTEGER NOT NULL, NAME VARCHAR(32) NOT NULL, CONSTRAINT ROOMS_PK PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE persons ( DATASTORE_IDENTITY INTEGER NOT NULL, PERSONID INTEGER NOT NULL, FIRSTNAME VARCHAR(32) NOT NULL, LASTNAME VARCHAR(32) NOT NULL, MIDDLENAME VARCHAR(32), BIRTHDATE DATE NOT NULL, ADDRID INTEGER, STREET VARCHAR(64), CITY VARCHAR(64), STATE CHAR(2), ZIPCODE CHAR(5), COUNTRY VARCHAR(64), CONSTRAINT PERS_UK UNIQUE (PERSONID), CONSTRAINT PERS_PK PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE fulltimeemployees ( DATASTORE_IDENTITY INTEGER NOT NULL, PERSONID INTEGER NOT NULL, FIRSTNAME VARCHAR(32) NOT NULL, LASTNAME VARCHAR(32) NOT NULL, MIDDLENAME VARCHAR(32), BIRTHDATE DATE NOT NULL, ADDRID INTEGER, STREET VARCHAR(64), CITY VARCHAR(64), STATE CHAR(2), ZIPCODE CHAR(5), COUNTRY VARCHAR(64), HIREDATE DATE, WEEKLYHOURS DOUBLE, DEPARTMENT INTEGER, FUNDINGDEPT INTEGER, MANAGER INTEGER, MENTOR INTEGER, HRADVISOR INTEGER, SALARY DOUBLE, CONSTRAINT FTEMPS_UK UNIQUE (PERSONID), CONSTRAINT FTEMPS_PK PRIMARY KEY (DATASTORE_IDENTITY), CONSTRAINT FTEMPS_DEPARTMENT FOREIGN KEY (DEPARTMENT) REFERENCES departments (DATASTORE_IDENTITY), CONSTRAINT FTEMPS_FUNDINGDEPT FOREIGN KEY (FUNDINGDEPT) REFERENCES departments (DATASTORE_IDENTITY), CONSTRAINT FTEMPS_MANAGER FOREIGN KEY (MANAGER) REFERENCES fulltimeemployees (DATASTORE_IDENTITY), CONSTRAINT FTEMPS_MENTOR FOREIGN KEY (MENTOR) REFERENCES fulltimeemployees (DATASTORE_IDENTITY), CONSTRAINT FTEMPS_HRADVISOR FOREIGN KEY (HRADVISOR) REFERENCES fulltimeemployees (DATASTORE_IDENTITY) ); CREATE TABLE parttimeemployees ( DATASTORE_IDENTITY INTEGER NOT NULL, PERSONID INTEGER NOT NULL, FIRSTNAME VARCHAR(32) NOT NULL, LASTNAME VARCHAR(32) NOT NULL, MIDDLENAME VARCHAR(32), BIRTHDATE DATE NOT NULL, ADDRID INTEGER, STREET VARCHAR(64), CITY VARCHAR(64), STATE CHAR(2), ZIPCODE CHAR(5), COUNTRY VARCHAR(64), HIREDATE DATE, WEEKLYHOURS DOUBLE, DEPARTMENT INTEGER, FUNDINGDEPT INTEGER, MANAGER INTEGER, MENTOR INTEGER, HRADVISOR INTEGER, WAGE DOUBLE, CONSTRAINT PTEMPS_UK UNIQUE (PERSONID), CONSTRAINT PTEMPS_PK PRIMARY KEY (DATASTORE_IDENTITY), CONSTRAINT PTEMPS_DEPARTMENT FOREIGN KEY (DEPARTMENT) REFERENCES departments (DATASTORE_IDENTITY), CONSTRAINT PTEMPS_FUNDINGDEPT FOREIGN KEY (FUNDINGDEPT) REFERENCES departments (DATASTORE_IDENTITY), CONSTRAINT PTEMPS_MANAGER FOREIGN KEY (MANAGER) REFERENCES parttimeemployees (DATASTORE_IDENTITY), CONSTRAINT PTEMPS_MENTOR FOREIGN KEY (MENTOR) REFERENCES parttimeemployees (DATASTORE_IDENTITY), CONSTRAINT PTEMPS_HRADVISOR FOREIGN KEY (HRADVISOR) REFERENCES parttimeemployees (DATASTORE_IDENTITY) ); CREATE TABLE medicalinsurance ( DATASTORE_IDENTITY INTEGER NOT NULL, INSID INTEGER, CARRIER VARCHAR(64) NOT NULL, EMPLOYEE INTEGER, PLANTYPE VARCHAR(8), CONSTRAINT MEDINS_PK PRIMARY KEY (DATASTORE_IDENTITY), CONSTRAINT MEDINS_EMPLOYEE FOREIGN KEY (EMPLOYEE) REFERENCES fulltimeemployees (DATASTORE_IDENTITY) ); CREATE TABLE dentalinsurance ( DATASTORE_IDENTITY INTEGER NOT NULL, INSID INTEGER, CARRIER VARCHAR(64) NOT NULL, EMPLOYEE INTEGER, LIFETIME_ORTHO_BENEFIT DECIMAL(22,3), CONSTRAINT DENTINS_PK PRIMARY KEY (DATASTORE_IDENTITY), CONSTRAINT DENTINS_EMPLOYEE FOREIGN KEY (EMPLOYEE) REFERENCES fulltimeemployees (DATASTORE_IDENTITY) ); CREATE TABLE projects ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, PROJID INTEGER NOT NULL, NAME VARCHAR(32) NOT NULL, BUDGET DECIMAL(11,2) NOT NULL, CONSTRAINT PROJS_UK UNIQUE (PROJID), CONSTRAINT PROJS_PK PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE project_reviewer ( PROJID INTEGER NOT NULL, REVIEWER INTEGER NOT NULL ); CREATE TABLE project_member ( PROJID INTEGER NOT NULL, MEMBER INTEGER NOT NULL ); CREATE TABLE employee_phoneno_type ( EMPID INTEGER NOT NULL, PHONENO VARCHAR(16) NOT NULL, TYPE VARCHAR(16) NOT NULL, CONSTRAINT EMP_PHNO_PERSONS FOREIGN KEY (EMPID) REFERENCES persons (DATASTORE_IDENTITY) ); CREATE TABLE fulltime_employee_phoneno_type ( EMPID INTEGER NOT NULL, PHONENO VARCHAR(16) NOT NULL, TYPE VARCHAR(16) NOT NULL, CONSTRAINT FTEMP_PHNO_FTEMP FOREIGN KEY (EMPID) REFERENCES fulltimeemployees (DATASTORE_IDENTITY) ); CREATE TABLE parttime_employee_phoneno_type ( EMPID INTEGER REFERENCES parttimeemployees NOT NULL, PHONENO VARCHAR(16) NOT NULL, TYPE VARCHAR(16) NOT NULL, CONSTRAINT PTEMP_PHNO_PTEMP FOREIGN KEY (EMPID) REFERENCES parttimeemployees (DATASTORE_IDENTITY) ); ALTER TABLE project_reviewer ADD CONSTRAINT PR_PROJ_FK FOREIGN KEY (PROJID) REFERENCES projects; ALTER TABLE project_reviewer ADD CONSTRAINT PR_REV_FK FOREIGN KEY (REVIEWER) REFERENCES fulltimeemployees; ALTER TABLE project_member ADD CONSTRAINT PM_PROJ_FK FOREIGN KEY (PROJID) REFERENCES projects; ALTER TABLE project_member ADD CONSTRAINT PM_MEMB_FK FOREIGN KEY (MEMBER) REFERENCES fulltimeemployees; ALTER TABLE departments ADD CONSTRAINT EMP_MO_FK FOREIGN KEY (EMP_OF_THE_MONTH) REFERENCES fulltimeemployees ON DELETE SET NULL; disconnect; tck/src/sql/derby/datastoreidentity/schema3.sql100664 17025 12500110372 22173 0ustarmbouschenstaff 0 0 -- 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 -- Inheritance mapping: -- Person has inheritance strategy "new-table". -- Employee has inheritance strategy "subclass-table". -- PartTimeEmployee and FullTimeEmployee have inheritance strategy "new-table". -- Insurance has inheritance strategy "subclass-table". -- MedicalInsurance and DentalInsurance have inheritance strategy "new-table". -- See tables "persons", "parttimeemployees", "fulltimeemployees", -- "medicalinsurance" and "dentalinsurance". connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; CREATE SCHEMA datastoreidentity3; SET SCHEMA datastoreidentity3; ------------------------- -- company ------------------------- ALTER TABLE departments DROP CONSTRAINT EMP_MO_FK; ALTER TABLE project_reviewer DROP CONSTRAINT PR_PROJ_FK; ALTER TABLE project_reviewer DROP CONSTRAINT PR_REV_FK; DROP TABLE dentalinsurance; DROP TABLE medicalinsurance; DROP TABLE project_reviewer; DROP TABLE project_member; DROP TABLE employee_phoneno_type; DROP TABLE fulltimeemployees; DROP TABLE parttimeemployees; DROP TABLE persons; DROP TABLE projects; DROP TABLE departments; DROP TABLE companies; DROP TABLE meetingrooms; DROP TABLE department_rooms; CREATE TABLE companies ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, ID INTEGER, NAME VARCHAR(32) NOT NULL, FOUNDEDDATE DATE NOT NULL, ADDRID INTEGER, STREET VARCHAR(64), CITY VARCHAR(64), STATE CHAR(2), ZIPCODE CHAR(5), COUNTRY VARCHAR(64), CONSTRAINT COMPS_PK PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE departments ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, ID INTEGER, NAME VARCHAR(32) NOT NULL, EMP_OF_THE_MONTH INTEGER, COMPANYID INTEGER, CONSTRAINT DEPTS_PK PRIMARY KEY (DATASTORE_IDENTITY), CONSTRAINT DEPTS_COMPANYID FOREIGN KEY (COMPANYID) REFERENCES companies (DATASTORE_IDENTITY) ); CREATE TABLE department_rooms ( DEPTID INTEGER NOT NULL, ROOMID INTEGER NOT NULL, ROOM_ORDER INTEGER NOT NULL ); CREATE TABLE meetingrooms ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, ID INTEGER NOT NULL, NAME VARCHAR(32) NOT NULL, CONSTRAINT ROOMS_PK PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE persons ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, PERSONID INTEGER NOT NULL, FIRSTNAME VARCHAR(32) NOT NULL, LASTNAME VARCHAR(32) NOT NULL, MIDDLENAME VARCHAR(32), BIRTHDATE DATE NOT NULL, ADDRID INTEGER, STREET VARCHAR(64), CITY VARCHAR(64), STATE CHAR(2), ZIPCODE CHAR(5), COUNTRY VARCHAR(64), CONSTRAINT PERS_UK UNIQUE (PERSONID), CONSTRAINT PERS_PK PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE parttimeemployees ( DATASTORE_IDENTITY INTEGER NOT NULL, HIREDATE DATE, WEEKLYHOURS DOUBLE, DEPARTMENT INTEGER, FUNDINGDEPT INTEGER, MANAGER INTEGER, MENTOR INTEGER, HRADVISOR INTEGER, WAGE DOUBLE, CONSTRAINT PTEMPS_PK PRIMARY KEY (DATASTORE_IDENTITY), CONSTRAINT PTEMPS_FK FOREIGN KEY (DATASTORE_IDENTITY) REFERENCES persons (DATASTORE_IDENTITY), CONSTRAINT PTEMPS_DEPARTMENT FOREIGN KEY (DEPARTMENT) REFERENCES departments (DATASTORE_IDENTITY), CONSTRAINT PTEMPS_FUNDINGDEPT FOREIGN KEY (FUNDINGDEPT) REFERENCES departments (DATASTORE_IDENTITY), CONSTRAINT PTEMPS_MANAGER FOREIGN KEY (MANAGER) REFERENCES parttimeemployees (DATASTORE_IDENTITY), CONSTRAINT PTEMPS_MENTOR FOREIGN KEY (MENTOR) REFERENCES parttimeemployees (DATASTORE_IDENTITY), CONSTRAINT PTEMPS_HRADVISOR FOREIGN KEY (HRADVISOR) REFERENCES parttimeemployees (DATASTORE_IDENTITY) ); CREATE TABLE fulltimeemployees ( DATASTORE_IDENTITY INTEGER NOT NULL, HIREDATE DATE, WEEKLYHOURS DOUBLE, DEPARTMENT INTEGER REFERENCES departments, FUNDINGDEPT INTEGER REFERENCES departments, MANAGER INTEGER REFERENCES persons, MENTOR INTEGER REFERENCES persons, HRADVISOR INTEGER REFERENCES persons, SALARY DOUBLE, CONSTRAINT FTEMPS_PK PRIMARY KEY (DATASTORE_IDENTITY), CONSTRAINT FTEMPS_FK FOREIGN KEY (DATASTORE_IDENTITY) REFERENCES persons (DATASTORE_IDENTITY), CONSTRAINT FTEMPS_DEPARTMENT FOREIGN KEY (DEPARTMENT) REFERENCES departments (DATASTORE_IDENTITY), CONSTRAINT FTEMPS_FUNDINGDEPT FOREIGN KEY (FUNDINGDEPT) REFERENCES departments (DATASTORE_IDENTITY), CONSTRAINT FTEMPS_MANAGER FOREIGN KEY (MANAGER) REFERENCES fulltimeemployees (DATASTORE_IDENTITY), CONSTRAINT FTEMPS_MENTOR FOREIGN KEY (MENTOR) REFERENCES fulltimeemployees (DATASTORE_IDENTITY), CONSTRAINT FTEMPS_HRADVISOR FOREIGN KEY (HRADVISOR) REFERENCES fulltimeemployees (DATASTORE_IDENTITY) ); CREATE TABLE medicalinsurance ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, INSID INTEGER, CARRIER VARCHAR(64) NOT NULL, EMPLOYEE INTEGER, PLANTYPE VARCHAR(8), CONSTRAINT MEDINS_PK PRIMARY KEY (DATASTORE_IDENTITY), CONSTRAINT MEDINS_EMPLOYEE FOREIGN KEY (EMPLOYEE) REFERENCES fulltimeemployees (DATASTORE_IDENTITY) ); CREATE TABLE dentalinsurance ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, INSID INTEGER, CARRIER VARCHAR(64) NOT NULL, EMPLOYEE INTEGER, LIFETIME_ORTHO_BENEFIT DECIMAL(22,3), CONSTRAINT DENTINS_PK PRIMARY KEY (DATASTORE_IDENTITY), CONSTRAINT DENTINS_EMPLOYEE FOREIGN KEY (EMPLOYEE) REFERENCES fulltimeemployees (DATASTORE_IDENTITY) ); CREATE TABLE projects ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, PROJID INTEGER NOT NULL, NAME VARCHAR(32) NOT NULL, BUDGET DECIMAL(11,2) NOT NULL, CONSTRAINT PROJS_UK UNIQUE (PROJID), CONSTRAINT PROJS_PK PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE project_reviewer ( PROJID INTEGER NOT NULL, REVIEWER INTEGER NOT NULL ); CREATE TABLE project_member ( PROJID INTEGER NOT NULL, MEMBER INTEGER NOT NULL ); CREATE TABLE employee_phoneno_type ( EMPID INTEGER NOT NULL, PHONENO VARCHAR(16) NOT NULL, TYPE VARCHAR(16) NOT NULL, CONSTRAINT EMP_PHNO_PERSONS FOREIGN KEY (EMPID) REFERENCES persons (DATASTORE_IDENTITY) ); ALTER TABLE project_reviewer ADD CONSTRAINT PR_PROJ_FK FOREIGN KEY (PROJID) REFERENCES projects; ALTER TABLE project_reviewer ADD CONSTRAINT PR_REV_FK FOREIGN KEY (REVIEWER) REFERENCES persons; ALTER TABLE project_member ADD CONSTRAINT PM_PROJ_FK FOREIGN KEY (PROJID) REFERENCES projects; ALTER TABLE project_member ADD CONSTRAINT PM_MEMB_FK FOREIGN KEY (MEMBER) REFERENCES persons; ALTER TABLE departments ADD CONSTRAINT EMP_MO_FK FOREIGN KEY (EMP_OF_THE_MONTH) REFERENCES persons ON DELETE SET NULL; disconnect; tck/src/sql/derby/datastoreidentity/schema4.sql100664 13660 12500110372 22175 0ustarmbouschenstaff 0 0 -- 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 -- Inheritance mapping: -- Person, Employee, and Insurance have inheritance strategy "new-table". -- PartTimeEmployee, FullTimeEmployee, MedicalInsurance, and DentalInsurance -- have inheritance strategy "superclass-table". -- See tables "persons", "employees", and "insuranceplans". connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; CREATE SCHEMA datastoreidentity4; SET SCHEMA datastoreidentity4; ------------------------- -- company ------------------------- ALTER TABLE departments DROP CONSTRAINT EMP_MO_FK; ALTER TABLE project_reviewer DROP CONSTRAINT PR_PROJ_FK; ALTER TABLE project_reviewer DROP CONSTRAINT PR_REV_FK; DROP TABLE insuranceplans; DROP TABLE project_reviewer; DROP TABLE project_member; DROP TABLE employee_phoneno_type; DROP TABLE employees; DROP TABLE persons; DROP TABLE projects; DROP TABLE departments; DROP TABLE companies; DROP TABLE meetingrooms; DROP TABLE department_rooms; CREATE TABLE companies ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, ID INTEGER, NAME VARCHAR(32) NOT NULL, FOUNDEDDATE DATE NOT NULL, ADDRID INTEGER, STREET VARCHAR(64), CITY VARCHAR(64), STATE CHAR(2), ZIPCODE CHAR(5), COUNTRY VARCHAR(64), CONSTRAINT COMPS_PK PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE departments ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, ID INTEGER, NAME VARCHAR(32) NOT NULL, EMP_OF_THE_MONTH INTEGER, COMPANYID INTEGER, CONSTRAINT DEPTS_PK PRIMARY KEY (DATASTORE_IDENTITY), CONSTRAINT DEPTS_COMPANYID FOREIGN KEY (COMPANYID) REFERENCES companies (DATASTORE_IDENTITY) ); CREATE TABLE department_rooms ( DEPTID INTEGER NOT NULL, ROOMID INTEGER NOT NULL, ROOM_ORDER INTEGER NOT NULL ); CREATE TABLE meetingrooms ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, ID INTEGER NOT NULL, NAME VARCHAR(32) NOT NULL, CONSTRAINT ROOMS_PK PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE persons ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, PERSONID INTEGER NOT NULL, FIRSTNAME VARCHAR(32) NOT NULL, LASTNAME VARCHAR(32) NOT NULL, MIDDLENAME VARCHAR(32), BIRTHDATE DATE NOT NULL, ADDRID INTEGER, STREET VARCHAR(64), CITY VARCHAR(64), STATE CHAR(2), ZIPCODE CHAR(5), COUNTRY VARCHAR(64), CONSTRAINT PERS_PK PRIMARY KEY (DATASTORE_IDENTITY), CONSTRAINT PERS_UK UNIQUE (PERSONID) ); CREATE TABLE employees ( DATASTORE_IDENTITY INTEGER NOT NULL, HIREDATE DATE, WEEKLYHOURS DOUBLE, DEPARTMENT INTEGER, FUNDINGDEPT INTEGER, MANAGER INTEGER, MENTOR INTEGER, HRADVISOR INTEGER, WAGE DOUBLE, SALARY DOUBLE, DISCRIMINATOR varchar(64) NOT NULL, CONSTRAINT EMPS_PK PRIMARY KEY (DATASTORE_IDENTITY), CONSTRAINT EMPS_FK FOREIGN KEY (DATASTORE_IDENTITY) REFERENCES persons (DATASTORE_IDENTITY), CONSTRAINT EMPS_DEPARTMENT FOREIGN KEY (DEPARTMENT) REFERENCES departments (DATASTORE_IDENTITY), CONSTRAINT EMPS_FUNDINGDEPT FOREIGN KEY (FUNDINGDEPT) REFERENCES departments (DATASTORE_IDENTITY), CONSTRAINT EMPS_MANAGER FOREIGN KEY (MANAGER) REFERENCES persons (DATASTORE_IDENTITY), CONSTRAINT EMPS_MENTOR FOREIGN KEY (MENTOR) REFERENCES persons (DATASTORE_IDENTITY), CONSTRAINT EMPS_HRADVISOR FOREIGN KEY (HRADVISOR) REFERENCES persons (DATASTORE_IDENTITY) ); CREATE TABLE insuranceplans ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, INSID INTEGER, CARRIER VARCHAR(64) NOT NULL, EMPLOYEE INTEGER, PLANTYPE VARCHAR(8), LIFETIME_ORTHO_BENEFIT DECIMAL(22,3), DISCRIMINATOR varchar(64) NOT NULL, CONSTRAINT INS_PK PRIMARY KEY (DATASTORE_IDENTITY), CONSTRAINT INS_EMPLOYEE FOREIGN KEY (EMPLOYEE) REFERENCES persons (DATASTORE_IDENTITY) ); CREATE TABLE projects ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, PROJID INTEGER NOT NULL, NAME VARCHAR(32) NOT NULL, BUDGET DECIMAL(11,2) NOT NULL, CONSTRAINT PROJS_PK PRIMARY KEY (DATASTORE_IDENTITY), CONSTRAINT PROJS_UK UNIQUE (PROJID) ); CREATE TABLE project_reviewer ( PROJID INTEGER NOT NULL, REVIEWER INTEGER NOT NULL ); CREATE TABLE project_member ( PROJID INTEGER NOT NULL, MEMBER INTEGER NOT NULL ); CREATE TABLE employee_phoneno_type ( EMPID INTEGER NOT NULL, PHONENO VARCHAR(16) NOT NULL, TYPE VARCHAR(16) NOT NULL, CONSTRAINT employee_phoneno_type_EMPID FOREIGN KEY (EMPID) REFERENCES persons (DATASTORE_IDENTITY) ); ALTER TABLE project_reviewer ADD CONSTRAINT PR_PROJ_FK FOREIGN KEY (PROJID) REFERENCES projects; ALTER TABLE project_reviewer ADD CONSTRAINT PR_REV_FK FOREIGN KEY (REVIEWER) REFERENCES persons; ALTER TABLE project_member ADD CONSTRAINT PM_PROJ_FK FOREIGN KEY (PROJID) REFERENCES projects; ALTER TABLE project_member ADD CONSTRAINT PM_MEMB_FK FOREIGN KEY (MEMBER) REFERENCES persons; ALTER TABLE departments ADD CONSTRAINT EMP_MO_FK FOREIGN KEY (EMP_OF_THE_MONTH) REFERENCES persons ON DELETE SET NULL; disconnect; tck/src/sql/derby/datastoreidentity/schema5.sql100664 2376 12500110372 22160 0ustarmbouschenstaff 0 0 -- 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 orm connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; CREATE SCHEMA datastoreidentity_orm; SET SCHEMA datastoreidentity_orm; ------------------------- -- mylib ------------------------- DROP TABLE PCPoint; CREATE TABLE PCPoint ( DATASTORE_IDENTITY BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY, ID BIGINT, X INTEGER NOT NULL, Y INTEGER, CONSTRAINT PCPNT_CONST PRIMARY KEY (DATASTORE_IDENTITY) ); tck/src/sql/derby/datastoreidentity/schema6.sql100664 2376 12500110372 22161 0ustarmbouschenstaff 0 0 -- 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 pkg connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; CREATE SCHEMA datastoreidentity_pkg; SET SCHEMA datastoreidentity_pkg; ------------------------- -- mylib ------------------------- DROP TABLE PCPoint; CREATE TABLE PCPoint ( DATASTORE_IDENTITY BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY, ID BIGINT, X INTEGER NOT NULL, Y INTEGER, CONSTRAINT PCPNT_CONST PRIMARY KEY (DATASTORE_IDENTITY) ); tck/src/sql/derby/datastoreidentity/schema7.sql100664 2376 12500110372 22162 0ustarmbouschenstaff 0 0 -- 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 cls connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; CREATE SCHEMA datastoreidentity_cls; SET SCHEMA datastoreidentity_cls; ------------------------- -- mylib ------------------------- DROP TABLE PCPoint; CREATE TABLE PCPoint ( DATASTORE_IDENTITY BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY, ID BIGINT, X INTEGER NOT NULL, Y INTEGER, CONSTRAINT PCPNT_CONST PRIMARY KEY (DATASTORE_IDENTITY) ); tck/src/sql/derby/datastoreidentity/schema8.sql100664 4620 12500110372 22155 0ustarmbouschenstaff 0 0 -- 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 datastoreidentity8; SET SCHEMA datastoreidentity8; DROP SEQUENCE DATASTORE_SEQ; DROP TABLE CART_ENTRIES; DROP TABLE CARTS; DROP TABLE PRODUCTS; DROP TABLE UNDETACHABLES; CREATE SEQUENCE DATASTORE_SEQ AS BIGINT START WITH 1; CREATE TABLE CARTS ( DATASTORE_ID BIGINT NOT NULL, CART_ID BIGINT NOT NULL, CUSTOMER_ID VARCHAR(128) NOT NULL, VERSION INTEGER NOT NULL DEFAULT 0, CONSTRAINT CARTS_PK PRIMARY KEY (DATASTORE_ID), CONSTRAINT CARTS_UK UNIQUE (CART_ID) ); CREATE TABLE PRODUCTS ( DATASTORE_ID VARCHAR(48) NOT NULL, SKU VARCHAR(48) NOT NULL, DESCRIPTION VARCHAR(128), VERSION INTEGER NOT NULL DEFAULT 0, CONSTRAINT PRODUCTS_PK PRIMARY KEY (DATASTORE_ID), CONSTRAINT PRODUCTS_UK UNIQUE (SKU) ); CREATE TABLE CART_ENTRIES ( DATASTORE_ID BIGINT NOT NULL, ID BIGINT NOT NULL, QUANTITY INTEGER DEFAULT 0, CART_ID BIGINT NOT NULL, SKU VARCHAR(48) NOT NULL, VERSION INTEGER NOT NULL DEFAULT 0, CONSTRAINT CART_ENTRIES_PK PRIMARY KEY (DATASTORE_ID), CONSTRAINT CART_ENTRIES_UK UNIQUE (ID), CONSTRAINT CARTS_FK FOREIGN KEY (CART_ID) REFERENCES CARTS, CONSTRAINT PRODUCTS_FK FOREIGN KEY (SKU) REFERENCES PRODUCTS ); CREATE TABLE UNDETACHABLES ( DATASTORE_ID BIGINT NOT NULL, ID BIGINT NOT NULL, FOO INTEGER, BAR INTEGER, VERSION INTEGER NOT NULL DEFAULT 0, CONSTRAINT UNDETACHABLES_PK PRIMARY KEY (DATASTORE_ID), CONSTRAINT UNDETACHABLES_UK UNIQUE (ID) ); tck/src/sql/derby/datastoreidentity/schema9.sql100664 6232 12500110372 22157 0ustarmbouschenstaff 0 0 -- 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 datastoreidentity9; SET SCHEMA datastoreidentity9; ------------------------- -- company ------------------------- ALTER TABLE departments DROP CONSTRAINT EMP_MO_FK; ALTER TABLE departments DROP CONSTRAINT DEPTS_COMP_FK; ALTER TABLE persons DROP CONSTRAINT PERS_DEPT_FK; ALTER TABLE persons DROP CONSTRAINT PERS_FUNDDEPT_FK; ALTER TABLE persons DROP CONSTRAINT PERS_MANAGER_FK; ALTER TABLE persons DROP CONSTRAINT PERS_MENTOR_FK; ALTER TABLE persons DROP CONSTRAINT PERS_HRADVISOR_FK; DROP TABLE persons; DROP TABLE departments; DROP TABLE companies; CREATE TABLE companies ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, ID INTEGER NOT NULL, NAME VARCHAR(32) NOT NULL, FOUNDEDDATE DATE NOT NULL, CONSTRAINT COMPS_PK PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE departments ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, ID INTEGER NOT NULL, NAME VARCHAR(32) NOT NULL, EMP_OF_THE_MONTH INTEGER, COMPANYID INTEGER, DISCRIMINATOR VARCHAR(255), CONSTRAINT DEPTS_COMP_FK FOREIGN KEY (COMPANYID) REFERENCES companies, CONSTRAINT DEPTS_PK PRIMARY KEY (DATASTORE_IDENTITY) ); CREATE TABLE persons ( DATASTORE_IDENTITY INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, PERSONID INTEGER NOT NULL, FIRSTNAME VARCHAR(32) NOT NULL, LASTNAME VARCHAR(32) NOT NULL, MIDDLENAME VARCHAR(32), BIRTHDATE DATE NOT NULL, DISCRIMINATOR varchar(64) NOT NULL, ROLE VARCHAR(32), HIREDATE DATE, WEEKLYHOURS REAL, DEPARTMENT INTEGER, FUNDINGDEPT INTEGER, MANAGER INTEGER, MENTOR INTEGER, HRADVISOR INTEGER, SALARY REAL, WAGE REAL, CONSTRAINT PERS_DEPT_FK FOREIGN KEY (DEPARTMENT) REFERENCES departments, CONSTRAINT PERS_FUNDDEPT_FK FOREIGN KEY (FUNDINGDEPT) REFERENCES departments, CONSTRAINT PERS_MANAGER_FK FOREIGN KEY (MANAGER) REFERENCES persons, CONSTRAINT PERS_MENTOR_FK FOREIGN KEY (MENTOR) REFERENCES persons, CONSTRAINT PERS_HRADVISOR_FK FOREIGN KEY (HRADVISOR) REFERENCES persons, CONSTRAINT PERS_UK UNIQUE (PERSONID), CONSTRAINT PERS_PK PRIMARY KEY (DATASTORE_IDENTITY) ); ALTER TABLE departments ADD CONSTRAINT EMP_MO_FK FOREIGN KEY (EMP_OF_THE_MONTH) REFERENCES persons(PERSONID) ON DELETE SET NULL; tck/src/testdata/org/apache/jdo/tck/pc/company/company1-1Relationships.xml100664 36620 12500110374 27071 0ustarmbouschenstaff 0 0 Company instances for CompletenessTest with 1-1 relationships 1 Sun Microsystems, Inc. 11/Apr/1952 1 Development 2 Human Resources 1 emp1First emp1Last emp1Middle 10/Jun/1970 1/Jan/1999 20000 40 2 emp2First emp2Last emp2Middle 22/Dec/1975 1/Jul/2003 10000 40 3 emp3First emp3Last emp3Middle 5/Sep/1972 15/Aug/2002 15 19 4 emp4First emp4Last emp4Middle 6/Sep/1973 15/Apr/2001 13 5 emp5First emp5Last emp5Middle 5/Jul/1962 15/Aug/1998 45000 1 Unter den Linden 1 Berlin 12345 Germany 2 Broadway 1 New York NY 10000 USA 3 Market St. San Francisco CA 94102 USA 1 Carrier1 PPO 2 Carrier2 HMO 3 Carrier3 HMO 4 Carrier4 HMO 5 Carrier5 HMO 11 Carrier1 99.999 12 Carrier2 99.999 13 Carrier3 99.999 14 Carrier4 99.999 15 Carrier5 99.999 1 orange 2500000.99 2 blue 50000.00 3 green 2000.99 tck/src/testdata/org/apache/jdo/tck/pc/company/company1-MRelationships.xml100664 33233 12500110374 27122 0ustarmbouschenstaff 0 0 Company instances for CompletenessTest with 1-m relationships 1 Sun Microsystems, Inc. 11/Apr/1952 1 Development 2 Human Resources 1 emp1First emp1Last emp1Middle 10/Jun/1970 1/Jan/1999 20000 40 2 emp2First emp2Last emp2Middle 22/Dec/1975 1/Jul/2003 10000 40 3 emp3First emp3Last emp3Middle 5/Sep/1972 15/Aug/2002 15 19 4 emp4First emp4Last emp4Middle 6/Sep/1973 15/Apr/2001 13 5 emp5First emp5Last emp5Middle 5/Jul/1962 15/Aug/1998 45000 1 Unter den Linden 1 Berlin 12345 Germany 2 Broadway 1 New York NY 10000 USA 3 Market St. San Francisco CA 94102 USA 1 Carrier1 PPO 2 Carrier2 HMO 3 Carrier2 HMO 4 Carrier2 99.999 1 orange 2500000.99 2 blue 50000.00 3 green 2000.99 tck/src/testdata/org/apache/jdo/tck/pc/company/companyAllRelationships.xml100664 52642 12500110374 27305 0ustarmbouschenstaff 0 0 Company instances for CompletenessTest with all relationships 1 Sun Microsystems, Inc. 11/Apr/1952 1 Development 2 Human Resources 1 emp1First emp1Last emp1Middle 10/Jun/1970 1/Jan/1999 20000 40 1111 123456-1 2 emp2First emp2Last emp2Middle 22/Dec/1975 1/Jul/2003 10000 40 2222 123456-2 3 emp3First emp3Last emp3Middle 5/Sep/1972 15/Aug/2002 15 19 3333 123456-3 4 emp4First emp4Last emp4Middle 6/Sep/1973 15/Apr/2001 13 3343 124456-3 5 emp5First emp5Last emp5Middle 5/Jul/1962 15/Aug/1998 45000 3363 126456-3 1 Unter den Linden 1 Berlin 12345 Germany 2 Broadway 1 New York NY 10000 USA 3 Market St. San Francisco CA 94102 USA 1 Carrier1 PPO 2 Carrier2 HMO 3 Carrier3 HMO 4 Carrier4 HMO 5 Carrier5 HMO 11 Carrier1 99.999 12 Carrier2 99.999 13 Carrier3 99.999 14 Carrier4 99.999 15 Carrier5 99.999 1 orange 2500000.99 2 blue 50000.00 3 green 2000.99 tck/src/testdata/org/apache/jdo/tck/pc/company/companyEmbedded.xml100664 32051 12500110374 25511 0ustarmbouschenstaff 0 0 Company instances for CompletenessTest with embedded relationships 1 Sun Microsystems, Inc. 11/Apr/1952 1 Development 2 Human Resources 1 emp1First emp1Last emp1Middle 10/Jun/1970 1/Jan/1999 20000 40 1111 123456-1 2 emp2First emp2Last emp2Middle 22/Dec/1975 1/Jul/2003 10000 40 2222 123456-2 3 emp3First emp3Last emp3Middle 5/Sep/1972 15/Aug/2002 15 19 3333 123456-3 4 emp4First emp4Last emp4Middle 6/Sep/1973 15/Apr/2001 13 3343 124456-3 5 emp5First emp5Last emp5Middle 5/Jul/1962 15/Aug/1998 45000 3363 126456-3 1 Unter den Linden 1 Berlin 12345 Germany 2 Broadway 1 New York NY 10000 USA 3 Market St. San Francisco CA 94102 USA 1 Carrier1 PPO 2 Carrier2 HMO 3 Carrier2 HMO 4 Carrier2 99.999 1 orange 2500000.99 2 blue 50000.00 3 green 2000.99 tck/src/testdata/org/apache/jdo/tck/pc/company/companyForQueryTests.xml100664 55565 12500110374 26636 0ustarmbouschenstaff 0 0 Company instances for query testing 1 Sun Microsystems, Inc. 11/Apr/1952 1 Comfy Room 2 Large Discussion Room 3 Conference Room 1 Development 2 Human Resources 1 emp1First emp1Last emp1Middle 10/Jun/1970 1/Jan/1999 20000 40 1111 123456-1 2 emp2First emp2Last emp2Middle 22/Dec/1975 1/Jul/2003 10000 40 2222 123456-2 3 emp3First emp3Last emp3Middle 5/Sep/1972 15/Aug/2002 15 19 3333 123456-3 4 emp4First emp4Last emp4Middle 6/Sep/1973 15/Apr/2001 13 3343 124456-3 5 emp5First emp5Last emp5Middle 5/Jul/1962 15/Aug/1998 45000 3363 126456-3 1 Unter den Linden 1 Berlin 12345 Germany 2 Broadway 1 New York NY 10000 USA 3 Market St. San Francisco CA 94102 USA 1 Carrier1 PPO 2 Carrier2 HMO 3 Carrier3 HMO 4 Carrier4 HMO 5 Carrier5 HMO 11 Carrier1 99.995 12 Carrier2 99.996 13 Carrier3 99.997 14 Carrier4 99.998 15 Carrier5 99.999 99 Carrier99 1 orange 2500000.99 2 blue 50000.00 3 green 2000.99 tck/src/testdata/org/apache/jdo/tck/pc/company/companyForSubqueriesTests.xml100664 41062 12500110374 27643 0ustarmbouschenstaff 0 0 Company instances for query testing 1 Sun Microsystems, Inc. 11/Apr/1952 1 Development 2 Human Resources 1 emp1First emp1Last emp1Middle 10/Jun/1970 1/Jan/1999 30000 40 2 emp2First emp2Last emp2Middle 22/Dec/1975 1/Jul/2003 20000 40 3 emp3First emp3Last emp3Middle 5/Sep/1972 15/Aug/2002 10000 25 4 emp4First emp4Last emp4Middle 6/Sep/1973 15/Apr/2001 25000 40 5 emp5First emp5Last emp5Middle 5/Jul/1962 1/Nov/2002 18000 35 6 emp6First emp6Last emp6Middle 10/Jun/1969 1/Jun/2002 22000 40 7 emp7First emp7Last emp7Middle 10/Jun/1970 1/Jan/2000 40000 40 8 emp8First emp8Last emp8Middle 22/Dec/1975 1/Aug/2003 10000 15 9 emp9First emp9Last emp9Middle 5/Sep/1972 1/May/2002 12000 20 10 emp10First emp10Last emp10Middle 5/Sep/1972 1/Oct/2002 24000 40 1 Unter den Linden 1 Berlin 12345 Germany 2 Broadway 1 New York NY 10000 USA 3 Market St. San Francisco CA 94102 USA tck/src/testdata/org/apache/jdo/tck/pc/company/companyM-MRelationships.xml100664 32101 12500110374 27147 0ustarmbouschenstaff 0 0 Company instances for CompletenessTest with m-m relationships 1 Sun Microsystems, Inc. 11/Apr/1952 1 Development 2 Human Resources 1 emp1First emp1Last emp1Middle 10/Jun/1970 1/Jan/1999 20000 40 2 emp2First emp2Last emp2Middle 22/Dec/1975 1/Jul/2003 10000 40 3 emp3First emp3Last emp3Middle 5/Sep/1972 15/Aug/2002 15 19 4 emp4First emp4Last emp4Middle 6/Sep/1973 15/Apr/2001 13 5 emp5First emp5Last emp5Middle 5/Jul/1962 15/Aug/1998 45000 1 Unter den Linden 1 Berlin 12345 Germany 2 Broadway 1 New York NY 10000 USA 3 Market St. San Francisco CA 94102 USA 1 Carrier1 PPO 2 Carrier2 HMO 3 Carrier2 HMO 4 Carrier2 99.999 1 orange 2500000.99 2 blue 50000.00 3 green 2000.99 tck/src/testdata/org/apache/jdo/tck/pc/company/companyNoRelationships.xml100664 22461 12500110374 27145 0ustarmbouschenstaff 0 0 Company instances for CompletenessTest with no relationships 1 Sun Microsystems, Inc. 11/Apr/1952 1 Development 2 Human Resources 1 emp1First emp1Last emp1Middle 10/Jun/1970 1/Jan/1999 20000 40 2 emp2First emp2Last emp2Middle 22/Dec/1975 1/Jul/2003 10000 40 3 emp3First emp3Last emp3Middle 5/Sep/1972 15/Aug/2002 15 19 4 emp4First emp4Last emp4Middle 6/Sep/1973 15/Apr/2001 13 5 emp5First emp5Last emp5Middle 5/Jul/1962 15/Aug/1998 45000 1 Carrier1 PPO 2 Carrier2 HMO 3 Carrier2 HMO 4 Carrier2 99.999 1 orange 2500000.99 2 blue 50000.00 3 green 2000.99 tck/src/testdata/org/apache/jdo/tck/pc/companyListWithoutJoin/companyListWithoutJoin.xml100664 20702 12500110374 32177 0ustarmbouschenstaff 0 0 Company instances for CompletenessTest with Map without join table 1 Sun Microsystems, Inc. 11/Apr/1952 1 Development 2 Human Resources 1 emp1First emp1Last emp1Middle 10/Jun/1970 1/Jan/1999 60000 40 2 emp2First emp2Last emp2Middle 22/Dec/1975 1/Jul/2003 47000 40 3 emp3First emp3Last emp3Middle 5/Sep/1972 15/Aug/2002 67.00 19 4 emp4First emp4Last emp4Middle 6/Sep/1973 15/Apr/2001 37.00 5 emp5First emp5Last emp5Middle 5/Jul/1962 15/Aug/1998 73000 tck/src/testdata/org/apache/jdo/tck/pc/companyMapWithoutJoin/companyMapWithoutJoin.xml100664 22345 12500110374 31610 0ustarmbouschenstaff 0 0 Company instances for CompletenessTest with Map without join table 1 Sun Microsystems, Inc. 11/Apr/1952 1 Development 2 Human Resources 1 emp1First emp1Last emp1Middle 10/Jun/1970 1/Jan/1999 role1 60000 40 2 emp2First emp2Last emp2Middle 22/Dec/1975 1/Jul/2003 role2 47000 40 3 emp3First emp3Last emp3Middle 5/Sep/1972 15/Aug/2002 role3 67.00 19 4 emp4First emp4Last emp4Middle 6/Sep/1973 15/Apr/2001 role4 37.00 5 emp5First emp5Last emp5Middle 5/Jul/1962 15/Aug/1998 role5 73000 tck/src/testdata/org/apache/jdo/tck/pc/mylib/mylibForQueryTests.xml100664 7210 12500110374 25712 0ustarmbouschenstaff 0 0 Mylib instances for query testing 1 4 4 4 4 4.0 4.0 4.0 4.0 2 -4 -4 -4 -4 -4.0 -4.0 -4.0 -4.0 1 10 10 2 20 20 3 O O Even tck/src/testdata/org/apache/jdo/tck/pc/order/order.xml100664 5216 12500110374 23174 0ustarmbouschenstaff 0 0 Order instances for CompletenessTest of compound identity 1 3 1 SunRay 15 1 Sun Ultra 40 3 tck/src/uml/org/apache/jdo/tck/pc/shoppingcart/shoppingcart.argo.uml100664 215434 12500110372 26123 0ustarmbouschenstaff 0 0 0.18.1 Novosoft UML Library 0.4.20 JDO 2.0 Detachable Shopping Cart Object Model Cart id 1 1 transient false volatile false customerId transient false volatile false CartEntry id transient false volatile false quantity transient false volatile false int 0 -1 Product sku transient false volatile false description transient false volatile false long java lang String void Undetachable id transient false volatile false foo transient false volatile false bar transient false volatile false ProductCategory 0 1 Cart id : long customerId:String CartEntry id : long quantity:int Product sku : String description:String Undetachable id : long foo : int bar:int ProductCategory sourcePortFig="Fig0.2" destPortFig="Fig1.2" sourceFigNode="Fig0" destFigNode="Fig1" sourcePortFig="Fig1.2" destPortFig="Fig3.2" sourceFigNode="Fig1" destFigNode="Fig3" sourcePortFig="Fig3.2" destPortFig="Fig3.2" sourceFigNode="Fig3" destFigNode="Fig3" sourcePortFig="Fig7.2" destPortFig="Fig7.2" sourceFigNode="Fig7" destFigNode="Fig7" sourcePortFig="Fig7.2" destPortFig="Fig3.2" sourceFigNode="Fig7" destFigNode="Fig3" lib/ext/ 40775 0 12500110374 12341 5ustarmbouschenstaff 0 0 lib/iut/ 40775 0 12500110374 12342 5ustarmbouschenstaff 0 0 lib/jdori/ 40775 0 12500110554 12650 5ustarmbouschenstaff 0 0 assembly.xml100664 5507 12500110371 13435 0ustarmbouschenstaff 0 0 src zip tar.gz false org.apache.jdo:parent-pom false parent-pom pom.xml javax.jdo:jdo-api false api src/** test/** pom.xml org.apache.jdo:jdo-exectck false exectck src/** pom.xml org.apache.jdo:copy-jdori-jars false copyjdorijars src/** pom.xml org.apache.jdo:jdo-tck false tck src/** pom.xml RunRules.html . LICENSE.txt NOTICE.txt README.html assembly.xml pom.xml lib/ext lib/iut lib/jdori LICENSE.txt100664 26136 12500110371 12740 0ustarmbouschenstaff 0 0 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed 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. NOTICE.txt100664 270 12500110371 12566 0ustarmbouschenstaff 0 0 Apache Java Data Objects (JDO) Copyright 2005-2006 The Apache Software Foundation This product includes software developed at The Apache Software Foundation (http://www.apache.org/). pom.xml100664 10137 12500110371 12424 0ustarmbouschenstaff 0 0 org.apache.jdo parent-pom 3.1 parent-pom 4.0.0 org.apache jdo pom 3.1 JDO Root POM parent-pom api exectck copyjdorijars tck scm:svn:http://svn.apache.org/repos/asf/db/jdo/tags/jdo-3.1 scm:svn:https://svn.apache.org/repos/asf/db/jdo/tags/jdo-3.1 http://svn.apache.org/viewvc/db/jdo/tags/jdo-3.1 maven-clean-plugin ${basedir} query.ser tck.txt org.apache.rat apache-rat-plugin specification/** .svnignore assembly.xml tck.txt apache-release api parent-pom maven-assembly-plugin 2.4 true assembly.xml package single org.apache.maven.plugins maven-gpg-plugin 1.1 ${file}.jar ${gpg.keyname} README.html100664 23202 12500110371 12727 0ustarmbouschenstaff 0 0 JDO 3 TCK README

    The JDO 3.x Technology Compatibility Kit

    Overview of the JDO 3.x Technology Compatibility Kit

    The JDO 3 project includes the following subprojects:

    • api contains source to build jdo-api-3.x.jar, which defines the JDO API version 3.x for Java 1.5 and later.
    • copyjdorijars contains source to build jdo-api-3.x.jar, which defines the JDO API version 3.x for Java 1.5 and later.
    • exectck contains source to build the maven plugin to run the TCK the Reference Implementation (RI) or an implementation under test (IUT)
    • tck contains the JDO 3.x Technology Compatibility Kit for Java 1.5 and later.
    • parent-pom contains the maven pom.xml that ties the projects together.

    JDO releases may be downloaded from the Apache JDO downloads page. Minor updates of releases are only available as source from the Subversion repository. Follow the instructions below to build the API from source.

    For complete rules for certifying a JDO implementation, see RunRules.html in the top level tck project directory.

    Prerequisites

    You must install the software listed in the following sections to successfully run the TCK. Other dependencies, such as the reference implementation, DataNucleus, and the Apache Derby database, are downloaded automatically by maven. Note that Apache JDO uses the apache commons logging package for logging.

    Maven

    You must have Maven version 2+ to build the projects from source and to execute the TCK. You can download maven from http://maven.apache.org/download.html

    Note that maven uses the user.home system property for the location of the maven local repostitory: ${user.home}/.m2/repository. Under Windows this system property is C:\Documents and Settings\user no matter what the HOME variable is set to. As a workaround you may set the system property by adding -Duser.home=%HOME% to the environment variable MAVEN_OPTS.

    JNDI Implementation (fscontext.jar and providerutil.jar)

    The JNDI test cases in tck need a JNDI implementation. The TCK is configured to use Sun's JNDI implementation. To use your own implementation, put the implementation jar files into lib/ext and update jndi.properties in the TCK directory src/conf. To download Oracle's implementation, go to http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-java-plat-419418.html#7110-jndi-1.2.1-oth-JPR. Aaccept the license agreement and download File System Service Provider, 1.2 Beta 3 and then unpack the downloaded zip into lib/ext. It includes the jars fscontext.jar and providerutil.jar.

    Building from Top Level TCK Project

    For instructions for checking out the JDO source, see the Apache JDO source code page. To build JDO with all subprojects go to the root directory of the branch you are working in (or trunk)
    mvn clean install
    This will build the artifacts jdo-api and jdo-exectck and will run the TCK.

    Building the API

    To build the API, change to the "api" directory of the branch you are working in (or trunk) and run

    mvn clean install
    This will build the jdo-api artifact and install it in your local Maven2 repository and run the TCK on the Reference Implementation.

    Running the TCK on an Implementation Under Test

    First build the from the top level TCK project as described above. To run the JDO TCK on an Implementation Under Test, copy the jars needed by the implementation to the top-level lib/iut directory, as well as log4j.properties and log4j-1.2.13.jar. The log4j jar file may be copied from lib/jdori.

    Change to the "tck" directory of the branch you are working in (or trunk) and run

    mvn -Djdo.tck.impl="iut" clean install
    and this will run the TCK (via the "jdo-exectck" plugin) on the Implementation Under Test on all supported databases and identity types.

    The "jdo-exectck" plugin has various options so you can run other implementations or only run particular tests.

    Custom Goals

    mvn jdo-exectck:<goal>
    help
    Displays help text describing custom goals and options
    installSchema
    Installs the database schema
    enhance
    enhances the test classes being used
    runtck
    Runs the TCK

    Command Line Options

    -Djdo.tck.impl=
    either jdori (reference implementation) or iut (implementation under test).
    -Djdo.tck.cfglist=configuration file list
    Overrides the definition of jdo.tck.cfglist found in tck/src/conf/configuration.list by supplying one or more comma-separated test configuration files. Test configuration files typically have the .conf extension. To run a single test, create a .conf file (copy an existing file) and put the test into the jdo.tck.classes property.
    -Djdo.tck.dblist=database list
    Overrides the property value in project.properties by supplying one or more comma-separated database names. Currently only derby is supported.
    -Djdo.tck.identitytypes=identity type list
    Overrides the identity types to be run, supplying one or more comma-separated identity types ("applicationidentity" or "datastoreidentity") to use for this run.
    -Dproject.lib.iut.directory=
    Location of implementation jar files. Default: ${basedir}/../lib/iut
    -Djdo.tck.impl.logfile=
    Location of implementation log file. Default: ${user.dir}/datanucleus.txt
    -Djdo.tck.doInstallSchema=
    Setting this parameter to false will bypass schema installation.
    -Djdo.tck.doEnhance=
    Setting this parameter to false will bypass enhancement.
    -Djdo.tck.doRunTCK=
    Setting this parameter to false will bypass running the TCK.
    -Djdo.tck.runTCKVerbose=
    Setting this parameter to true will display test progress and error output while the TCK is running.

    Examples

    mvn -Djdo.tck.identitytypes=datastoreidentity jdo-exectck:installSchema
    Installs the database schema for datastore identity for all supported databases
    mvn -Djdo.tck.cfglist="alltests.conf cfg1.conf" jdo-exectck:runtck
    Runs the test configurations specified in alltests.conf and cfg1.conf on the JDORI, using all supported identity types and databases.

    Files

    While running the TCK, maven uses the following configuration files in src/conf:

    • configurations.list
      A list of files. Each file listed is a test configuration file.
    • test configuration files (*.conf)
      Each of these files sets values for
      jdo.tck.testdescription
      An optional string describing the purpose of these tests
      jdo.tck.classes
      A list of one or more test classes (required)
      jdo.tck.testdata
      The fully qualified file name of the xml test data file(optional)
      jdo.tck.standarddata
      The fully qualified file name of the xml test data file(optional)
      jdo.tck.mapping
      The file designator that maven.xml uses to build a javax.jdo.option.Mapping value and corresponding schema name (required)
    • exclude.list
      A list of test classes NOT to execute during a TCK test run