You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jdo-commits@db.apache.org by to...@apache.org on 2022/08/23 19:41:15 UTC
[db-jdo] 01/02: Format all Java files using GJF
This is an automated email from the ASF dual-hosted git repository.
tobous pushed a commit to branch gjf-reformat
in repository https://gitbox.apache.org/repos/asf/db-jdo.git
commit e9936cd9565cb1a79b00617f378b125598b8920b
Author: Tobias Bouschen <to...@googlemail.com>
AuthorDate: Tue Aug 23 21:34:10 2022 +0200
Format all Java files using GJF
---
.../main/java/javax/jdo/AttributeConverter.java | 68 +-
api/src/main/java/javax/jdo/Constants.java | 2005 +++----
api/src/main/java/javax/jdo/Enhancer.java | 765 +--
api/src/main/java/javax/jdo/Extent.java | 149 +-
api/src/main/java/javax/jdo/FetchGroup.java | 476 +-
api/src/main/java/javax/jdo/FetchPlan.java | 414 +-
api/src/main/java/javax/jdo/InstanceCallbacks.java | 77 +-
.../main/java/javax/jdo/JDOCanRetryException.java | 141 +-
.../main/java/javax/jdo/JDODataStoreException.java | 141 +-
.../javax/jdo/JDODetachedFieldAccessException.java | 112 +-
.../main/java/javax/jdo/JDOEnhanceException.java | 72 +-
api/src/main/java/javax/jdo/JDOEnhancer.java | 258 +-
api/src/main/java/javax/jdo/JDOException.java | 526 +-
.../java/javax/jdo/JDOFatalDataStoreException.java | 142 +-
api/src/main/java/javax/jdo/JDOFatalException.java | 143 +-
.../java/javax/jdo/JDOFatalInternalException.java | 141 +-
.../main/java/javax/jdo/JDOFatalUserException.java | 144 +-
api/src/main/java/javax/jdo/JDOHelper.java | 3578 ++++++------
.../java/javax/jdo/JDONullIdentityException.java | 101 +-
.../java/javax/jdo/JDOObjectNotFoundException.java | 141 +-
.../jdo/JDOOptimisticVerificationException.java | 128 +-
api/src/main/java/javax/jdo/JDOQLTypedQuery.java | 1191 ++--
.../main/java/javax/jdo/JDOQLTypedSubquery.java | 173 +-
.../javax/jdo/JDOQueryInterruptedException.java | 40 +-
.../main/java/javax/jdo/JDOReadOnlyException.java | 93 +-
.../javax/jdo/JDOUnsupportedOptionException.java | 79 +-
.../java/javax/jdo/JDOUserCallbackException.java | 142 +-
api/src/main/java/javax/jdo/JDOUserException.java | 142 +-
api/src/main/java/javax/jdo/LegacyJava.java | 289 +-
api/src/main/java/javax/jdo/ObjectState.java | 47 +-
.../main/java/javax/jdo/PersistenceManager.java | 2603 ++++-----
.../java/javax/jdo/PersistenceManagerFactory.java | 1526 ++---
api/src/main/java/javax/jdo/Query.java | 2081 +++----
api/src/main/java/javax/jdo/Transaction.java | 477 +-
.../main/java/javax/jdo/annotations/Cacheable.java | 16 +-
.../main/java/javax/jdo/annotations/Column.java | 149 +-
.../main/java/javax/jdo/annotations/Columns.java | 17 +-
.../main/java/javax/jdo/annotations/Convert.java | 42 +-
.../javax/jdo/annotations/DatastoreIdentity.java | 77 +-
.../java/javax/jdo/annotations/Discriminator.java | 84 +-
.../jdo/annotations/DiscriminatorStrategy.java | 13 +-
.../main/java/javax/jdo/annotations/Element.java | 285 +-
.../main/java/javax/jdo/annotations/Embedded.java | 66 +-
.../java/javax/jdo/annotations/EmbeddedOnly.java | 13 +-
.../main/java/javax/jdo/annotations/Extension.java | 40 +-
.../java/javax/jdo/annotations/Extensions.java | 18 +-
.../java/javax/jdo/annotations/FetchGroup.java | 57 +-
.../java/javax/jdo/annotations/FetchGroups.java | 18 +-
.../main/java/javax/jdo/annotations/FetchPlan.java | 55 +-
.../java/javax/jdo/annotations/FetchPlans.java | 18 +-
.../java/javax/jdo/annotations/ForeignKey.java | 101 +-
.../javax/jdo/annotations/ForeignKeyAction.java | 17 +-
.../java/javax/jdo/annotations/ForeignKeys.java | 18 +-
.../javax/jdo/annotations/IdGeneratorStrategy.java | 19 +-
.../java/javax/jdo/annotations/IdentityType.java | 13 +-
api/src/main/java/javax/jdo/annotations/Index.java | 70 +-
.../main/java/javax/jdo/annotations/Indices.java | 18 +-
.../java/javax/jdo/annotations/Inheritance.java | 35 +-
.../javax/jdo/annotations/InheritanceStrategy.java | 15 +-
api/src/main/java/javax/jdo/annotations/Join.java | 156 +-
api/src/main/java/javax/jdo/annotations/Joins.java | 23 +-
api/src/main/java/javax/jdo/annotations/Key.java | 279 +-
.../java/javax/jdo/annotations/NotPersistent.java | 12 +-
.../main/java/javax/jdo/annotations/NullValue.java | 14 +-
api/src/main/java/javax/jdo/annotations/Order.java | 60 +-
.../javax/jdo/annotations/PersistenceAware.java | 12 +-
.../javax/jdo/annotations/PersistenceCapable.java | 146 +-
.../javax/jdo/annotations/PersistenceModifier.java | 18 +-
.../java/javax/jdo/annotations/Persistent.java | 457 +-
.../java/javax/jdo/annotations/PrimaryKey.java | 55 +-
.../main/java/javax/jdo/annotations/Queries.java | 18 +-
api/src/main/java/javax/jdo/annotations/Query.java | 90 +-
.../main/java/javax/jdo/annotations/Sequence.java | 86 +-
.../javax/jdo/annotations/SequenceStrategy.java | 11 +-
.../java/javax/jdo/annotations/Serialized.java | 17 +-
.../java/javax/jdo/annotations/Transactional.java | 14 +-
.../main/java/javax/jdo/annotations/Unique.java | 75 +-
.../main/java/javax/jdo/annotations/Uniques.java | 18 +-
api/src/main/java/javax/jdo/annotations/Value.java | 280 +-
.../main/java/javax/jdo/annotations/Version.java | 79 +-
.../javax/jdo/annotations/VersionStrategy.java | 15 +-
.../java/javax/jdo/datastore/DataStoreCache.java | 295 +-
.../java/javax/jdo/datastore/JDOConnection.java | 62 +-
.../main/java/javax/jdo/datastore/Sequence.java | 114 +-
.../main/java/javax/jdo/identity/ByteIdentity.java | 250 +-
.../main/java/javax/jdo/identity/CharIdentity.java | 274 +-
.../main/java/javax/jdo/identity/IntIdentity.java | 261 +-
.../main/java/javax/jdo/identity/LongIdentity.java | 278 +-
.../java/javax/jdo/identity/ObjectIdentity.java | 349 +-
.../java/javax/jdo/identity/ShortIdentity.java | 242 +-
.../javax/jdo/identity/SingleFieldIdentity.java | 348 +-
.../java/javax/jdo/identity/StringIdentity.java | 179 +-
.../java/javax/jdo/listener/AttachCallback.java | 50 +-
.../jdo/listener/AttachLifecycleListener.java | 66 +-
.../java/javax/jdo/listener/ClearCallback.java | 37 +-
.../javax/jdo/listener/ClearLifecycleListener.java | 69 +-
.../jdo/listener/CreateLifecycleListener.java | 35 +-
.../java/javax/jdo/listener/DeleteCallback.java | 39 +-
.../jdo/listener/DeleteLifecycleListener.java | 60 +-
.../java/javax/jdo/listener/DetachCallback.java | 47 +-
.../jdo/listener/DetachLifecycleListener.java | 63 +-
.../javax/jdo/listener/DirtyLifecycleListener.java | 48 +-
.../javax/jdo/listener/InstanceLifecycleEvent.java | 304 +-
.../jdo/listener/InstanceLifecycleListener.java | 20 +-
.../main/java/javax/jdo/listener/LoadCallback.java | 36 +-
.../javax/jdo/listener/LoadLifecycleListener.java | 35 +-
.../java/javax/jdo/listener/StoreCallback.java | 41 +-
.../javax/jdo/listener/StoreLifecycleListener.java | 57 +-
.../java/javax/jdo/metadata/ArrayMetadata.java | 97 +-
.../java/javax/jdo/metadata/ClassMetadata.java | 51 +-
.../jdo/metadata/ClassPersistenceModifier.java | 10 +-
.../javax/jdo/metadata/CollectionMetadata.java | 97 +-
.../java/javax/jdo/metadata/ColumnMetadata.java | 309 +-
.../jdo/metadata/DatastoreIdentityMetadata.java | 130 +-
.../javax/jdo/metadata/DiscriminatorMetadata.java | 152 +-
.../java/javax/jdo/metadata/ElementMetadata.java | 312 +-
.../java/javax/jdo/metadata/EmbeddedMetadata.java | 143 +-
.../java/javax/jdo/metadata/ExtensionMetadata.java | 33 +-
.../javax/jdo/metadata/FetchGroupMetadata.java | 84 +-
.../java/javax/jdo/metadata/FetchPlanMetadata.java | 95 +-
.../java/javax/jdo/metadata/FieldMetadata.java | 5 +-
.../javax/jdo/metadata/ForeignKeyMetadata.java | 264 +-
.../java/javax/jdo/metadata/IndexMetadata.java | 155 +-
api/src/main/java/javax/jdo/metadata/Indexed.java | 13 +-
.../javax/jdo/metadata/InheritanceMetadata.java | 93 +-
.../java/javax/jdo/metadata/InterfaceMetadata.java | 5 +-
.../main/java/javax/jdo/metadata/JDOMetadata.java | 230 +-
.../main/java/javax/jdo/metadata/JoinMetadata.java | 311 +-
.../main/java/javax/jdo/metadata/KeyMetadata.java | 319 +-
.../main/java/javax/jdo/metadata/MapMetadata.java | 223 +-
.../java/javax/jdo/metadata/MemberMetadata.java | 999 ++--
api/src/main/java/javax/jdo/metadata/Metadata.java | 54 +-
.../java/javax/jdo/metadata/OrderMetadata.java | 104 +-
.../java/javax/jdo/metadata/PackageMetadata.java | 223 +-
.../javax/jdo/metadata/PrimaryKeyMetadata.java | 82 +-
.../java/javax/jdo/metadata/PropertyMetadata.java | 25 +-
.../java/javax/jdo/metadata/QueryMetadata.java | 154 +-
.../java/javax/jdo/metadata/SequenceMetadata.java | 127 +-
.../main/java/javax/jdo/metadata/TypeMetadata.java | 730 +--
.../java/javax/jdo/metadata/UniqueMetadata.java | 156 +-
.../java/javax/jdo/metadata/ValueMetadata.java | 299 +-
.../java/javax/jdo/metadata/VersionMetadata.java | 128 +-
.../java/javax/jdo/query/BooleanExpression.java | 69 +-
.../main/java/javax/jdo/query/ByteExpression.java | 20 +-
.../java/javax/jdo/query/CharacterExpression.java | 65 +-
.../java/javax/jdo/query/CollectionExpression.java | 67 +-
.../java/javax/jdo/query/ComparableExpression.java | 164 +-
.../main/java/javax/jdo/query/DateExpression.java | 54 +-
.../java/javax/jdo/query/DateTimeExpression.java | 87 +-
.../main/java/javax/jdo/query/EnumExpression.java | 28 +-
api/src/main/java/javax/jdo/query/Expression.java | 133 +-
.../java/javax/jdo/query/IfThenElseExpression.java | 65 +-
.../main/java/javax/jdo/query/ListExpression.java | 45 +-
.../java/javax/jdo/query/LocalDateExpression.java | 52 +-
.../javax/jdo/query/LocalDateTimeExpression.java | 85 +-
.../java/javax/jdo/query/LocalTimeExpression.java | 52 +-
.../main/java/javax/jdo/query/MapExpression.java | 145 +-
.../java/javax/jdo/query/NumericExpression.java | 450 +-
.../java/javax/jdo/query/ObjectExpression.java | 23 +-
.../java/javax/jdo/query/OptionalExpression.java | 43 +-
.../main/java/javax/jdo/query/OrderExpression.java | 90 +-
.../javax/jdo/query/PersistableExpression.java | 39 +-
.../java/javax/jdo/query/StringExpression.java | 467 +-
.../java/javax/jdo/query/SubqueryExpression.java | 21 +-
.../main/java/javax/jdo/query/TimeExpression.java | 54 +-
api/src/main/java/javax/jdo/spi/Detachable.java | 58 +-
api/src/main/java/javax/jdo/spi/I18NHelper.java | 731 +--
api/src/main/java/javax/jdo/spi/JDOImplHelper.java | 2118 +++----
api/src/main/java/javax/jdo/spi/JDOPermission.java | 141 +-
.../java/javax/jdo/spi/PersistenceCapable.java | 1143 ++--
.../java/javax/jdo/spi/RegisterClassEvent.java | 172 +-
.../java/javax/jdo/spi/RegisterClassListener.java | 36 +-
.../java/javax/jdo/spi/StateInterrogation.java | 422 +-
api/src/main/java/javax/jdo/spi/StateManager.java | 1070 ++--
.../test/java/javax/jdo/AbstractJDOConfigTest.java | 205 +-
api/src/test/java/javax/jdo/EnhancerTest.java | 844 +--
.../java/javax/jdo/JDOConfigTestClassLoader.java | 65 +-
.../test/java/javax/jdo/JDOHelperConfigTest.java | 825 +--
api/src/test/java/javax/jdo/JDOHelperTest.java | 1125 ++--
api/src/test/java/javax/jdo/MockEnhancer.java | 215 +-
api/src/test/java/javax/jdo/ObjectStateTest.java | 370 +-
api/src/test/java/javax/jdo/PMFMapMapTest.java | 695 +--
api/src/test/java/javax/jdo/PMFProxy.java | 61 +-
api/src/test/java/javax/jdo/PMFService.java | 58 +-
api/src/test/java/javax/jdo/annotations/Line.java | 11 +-
api/src/test/java/javax/jdo/annotations/Point.java | 11 +-
.../javax/jdo/annotations/TestEmbeddedMap.java | 56 +-
.../javax/jdo/annotations/TestEmbeddedSet.java | 54 +-
.../java/javax/jdo/annotations/TestExtensions.java | 47 +-
.../java/javax/jdo/identity/ByteIdentityTest.java | 212 +-
.../java/javax/jdo/identity/CharIdentityTest.java | 230 +-
.../javax/jdo/identity/ConcreteTestIdentity.java | 73 +-
.../java/javax/jdo/identity/IntIdentityTest.java | 208 +-
.../java/javax/jdo/identity/LongIdentityTest.java | 221 +-
.../javax/jdo/identity/ObjectIdentityTest.java | 768 +--
.../java/javax/jdo/identity/ShortIdentityTest.java | 211 +-
.../jdo/identity/SingleFieldIdentityTest.java | 141 +-
.../javax/jdo/identity/StringIdentityTest.java | 144 +-
.../jdo/listener/InstanceLifecycleEventTest.java | 201 +-
api/src/test/java/javax/jdo/pc/PCPoint.java | 775 ++-
api/src/test/java/javax/jdo/schema/XMLTest.java | 184 +-
.../test/java/javax/jdo/spi/JDOImplHelperTest.java | 466 +-
.../java/javax/jdo/spi/StateInterrogationTest.java | 881 ++-
api/src/test/java/javax/jdo/stub/StubPMF.java | 874 ++-
api/src/test/java/javax/jdo/util/AbstractTest.java | 142 +-
.../java/javax/jdo/util/BatchResultPrinter.java | 165 +-
.../test/java/javax/jdo/util/BatchTestRunner.java | 231 +-
api/src/test/java/javax/jdo/util/XMLTestUtil.java | 969 ++--
.../org/apache/jdo/exectck/AbstractTCKMojo.java | 234 +-
.../main/java/org/apache/jdo/exectck/Enhance.java | 441 +-
.../src/main/java/org/apache/jdo/exectck/Help.java | 137 +-
.../java/org/apache/jdo/exectck/InstallSchema.java | 427 +-
.../java/org/apache/jdo/exectck/PropertyUtils.java | 184 +-
.../main/java/org/apache/jdo/exectck/RunTCK.java | 989 ++--
.../java/org/apache/jdo/exectck/SQLFileLoader.java | 582 +-
.../java/org/apache/jdo/exectck/Utilities.java | 303 +-
.../org/apache/jdo/tck/AbstractReaderTest.java | 101 +-
tck/src/main/java/org/apache/jdo/tck/JDO_Test.java | 2630 +++++----
.../java/org/apache/jdo/tck/api/SignatureTest.java | 164 +-
.../api/converter/IntAttributeConverterTest.java | 760 ++-
.../api/converter/PointAttributeConverterTest.java | 663 ++-
.../tck/api/exceptions/ExceptionConstructor.java | 526 +-
.../jdo/tck/api/fetchgroup/FetchGroupTest.java | 1118 ++--
.../AbstractInstanceLifecycleListener.java | 820 ++-
.../AccessOtherInstancesInPrestore.java | 149 +-
.../AccessingFieldsInPredelete.java | 311 +-
.../api/instancecallbacks/CallingJdoPostload.java | 232 +-
.../api/instancecallbacks/CallingJdoPreclear.java | 254 +-
.../api/instancecallbacks/CallingJdoPredelete.java | 211 +-
.../api/instancecallbacks/CallingJdoPrestore.java | 400 +-
.../InstanceLifecycleListenerAttach.java | 253 +-
.../InstanceLifecycleListenerClear.java | 223 +-
.../InstanceLifecycleListenerCreate.java | 158 +-
.../InstanceLifecycleListenerDelete.java | 227 +-
.../InstanceLifecycleListenerDetach.java | 252 +-
.../InstanceLifecycleListenerDirty.java | 199 +-
.../InstanceLifecycleListenerLoad.java | 208 +-
.../InstanceLifecycleListenerStore.java | 220 +-
...ationOfNontransactionalNonpersistentFields.java | 293 +-
.../NoAccessToFieldsAfterPredelete.java | 272 +-
.../jdo/tck/api/instancecallbacks/TestParts.java | 288 +-
.../apache/jdo/tck/api/jdohelper/GetObjectId.java | 115 +-
.../jdo/tck/api/jdohelper/GetObjectIdForNull.java | 93 +-
.../tck/api/jdohelper/GetObjectIdForTransient.java | 89 +-
.../GetObjectIdNotPersistenceCapable.java | 90 +-
.../apache/jdo/tck/api/jdohelper/GetObjectIds.java | 417 +-
.../tck/api/jdohelper/GetPersistenceManager.java | 117 +-
.../jdohelper/GetPersistenceManagerForNull.java | 89 +-
.../GetPersistenceManagerForTransient.java | 86 +-
...GetPersistenceManagerNotPersistenceCapable.java | 92 +-
.../api/jdohelper/GetTransactionalObjectId.java | 107 +-
.../jdohelper/GetTransactionalObjectIdForNull.java | 91 +-
.../GetTransactionalObjectIdForTransient.java | 91 +-
...TransactionalObjectIdNotPersistenceCapable.java | 85 +-
.../apache/jdo/tck/api/jdohelper/IsDeleted.java | 107 +-
.../jdo/tck/api/jdohelper/IsDeletedFalse.java | 109 +-
.../jdo/tck/api/jdohelper/IsDeletedForNull.java | 89 +-
.../tck/api/jdohelper/IsDeletedForTransient.java | 87 +-
.../jdohelper/IsDeletedNotPersistenceCapable.java | 89 +-
.../apache/jdo/tck/api/jdohelper/IsDetached.java | 103 +-
.../org/apache/jdo/tck/api/jdohelper/IsDirty.java | 109 +-
.../apache/jdo/tck/api/jdohelper/IsDirtyFalse.java | 117 +-
.../jdo/tck/api/jdohelper/IsDirtyForNull.java | 85 +-
.../jdo/tck/api/jdohelper/IsDirtyForTransient.java | 88 +-
.../jdohelper/IsDirtyNotPersistenceCapable.java | 89 +-
.../org/apache/jdo/tck/api/jdohelper/IsNew.java | 104 +-
.../apache/jdo/tck/api/jdohelper/IsNewFalse.java | 98 +-
.../apache/jdo/tck/api/jdohelper/IsNewForNull.java | 83 +-
.../jdo/tck/api/jdohelper/IsNewForTransient.java | 87 +-
.../api/jdohelper/IsNewNotPersistenceCapable.java | 90 +-
.../apache/jdo/tck/api/jdohelper/IsPersistent.java | 105 +-
.../jdo/tck/api/jdohelper/IsPersistentFalse.java | 89 +-
.../jdo/tck/api/jdohelper/IsPersistentForNull.java | 85 +-
.../api/jdohelper/IsPersistentForTransient.java | 92 +-
.../IsPersistentNotPersistenceCapable.java | 89 +-
.../jdo/tck/api/jdohelper/IsTransactional.java | 121 +-
.../tck/api/jdohelper/IsTransactionalFalse.java | 134 +-
.../tck/api/jdohelper/IsTransactionalForNull.java | 86 +-
.../api/jdohelper/IsTransactionalForTransient.java | 86 +-
.../IsTransactionalNotPersistenceCapable.java | 88 +-
.../apache/jdo/tck/api/jdohelper/MakeDirty.java | 117 +-
.../jdo/tck/api/jdohelper/MakeDirtyForNull.java | 87 +-
.../tck/api/jdohelper/MakeDirtyForTransient.java | 91 +-
.../jdohelper/MakeDirtyNotPersistenceCapable.java | 88 +-
.../AbstractPersistenceCapableTest.java | 81 +-
.../CopyKeyFieldsFromObjectId.java | 448 +-
.../persistencecapable/NewObjectIdInstance.java | 393 +-
.../ChangingObjectIdHasNoEffectOnInstance.java | 92 +-
.../ConcurrentPersistenceManagers.java | 115 +-
.../ConcurrentPersistenceManagersSameClasses.java | 242 +-
.../api/persistencemanager/CurrentTransaction.java | 76 +-
.../api/persistencemanager/DataStoreCacheTest.java | 141 +-
.../persistencemanager/DataStoreConnection.java | 214 +-
.../DataStoreConnectionThrows.java | 329 +-
.../api/persistencemanager/DatastoreTimeout.java | 965 ++--
.../api/persistencemanager/DeletePersistent.java | 419 +-
.../DeletePersistentAllFails.java | 243 +-
...DeletePersistentFailsIfInstanceIsTransient.java | 222 +-
...InstanceManagedByAnotherPersistenceManager.java | 276 +-
...etePersistentHasNoEffectOnDeletedInstances.java | 251 +-
.../GetPersistenceManagerFactory.java | 79 +-
.../tck/api/persistencemanager/GetProperties.java | 675 ++-
.../persistencemanager/GetPutRemoveUserObject.java | 259 +-
.../api/persistencemanager/GetSetUserObject.java | 100 +-
...nsactionalObjectIdWhenObjectIdBeingChanged.java | 123 +-
.../GetTransactionalObjectIdWithNoTransaction.java | 104 +-
.../tck/api/persistencemanager/NewInstance.java | 170 +-
.../NoPersistenceManagerIfTransient.java | 67 +-
.../ObjectIdUniqueAmongInstances.java | 136 +-
.../OneInstanceOfObjectPerPersistenceManager.java | 214 +-
...sistenceManagerIfPersistentOrTransactional.java | 67 +-
.../api/persistencemanager/OptimisticFailure.java | 391 +-
.../persistencemanager/PersistenceManagerTest.java | 186 +-
...ionInstanceForAllCallsToCurrentTransaction.java | 103 +-
.../jdo/tck/api/persistencemanager/ThreadSafe.java | 326 +-
...TransactionalInstanceRetainsValuesAtCommit.java | 259 +-
...llingEvictAllWithCollectionContainingNulls.java | 207 +-
...ingRefreshAllWithCollectionContainingNulls.java | 214 +-
.../cache/EvictAllWithNoParameters.java | 211 +-
.../EvictingCollectionOfInstancesSideEffects.java | 350 +-
.../cache/EvictingWithRestoreValuesFalse.java | 222 +-
.../cache/EvictingWithRetainValuesFalse.java | 234 +-
.../PassingNullToEvictAllThrowsException.java | 163 +-
.../cache/PassingNullToEvictHasNoEffect.java | 107 +-
.../PassingNullToRefreshAllThrowsException.java | 169 +-
.../cache/PassingNullToRefreshHasNoEffect.java | 106 +-
.../cache/RefreshAllNoParameterSideEffects.java | 272 +-
.../cache/RefreshAllSideEffects.java | 324 +-
.../cache/RefreshAllWithNoParameters.java | 144 +-
.../cache/RefreshSideEffects.java | 375 +-
.../tck/api/persistencemanager/cache/Retrieve.java | 553 +-
.../close/AfterCloseAllMethodsThrowException.java | 130 +-
.../persistencemanager/close/AutoCloseable.java | 126 +-
.../close/CloseWithActiveTxRollsBack.java | 120 +-
.../close/IsClosedIsFalseUponConstruction.java | 71 +-
.../IsClosedIsFalseUponRetrievalFromPool.java | 74 +-
.../close/IsClosedIsTrueAfterClose.java | 75 +-
.../detach/CopyOnAttachFalse.java | 130 +-
.../detach/DetachAccessUnloadedField.java | 205 +-
.../detach/DetachAllOnCommit.java | 83 +-
.../persistencemanager/detach/DetachAttach.java | 69 +-
.../detach/DetachAttachDirty.java | 87 +-
.../api/persistencemanager/detach/DetachCopy.java | 128 +-
.../persistencemanager/detach/DetachSerialize.java | 142 +-
.../api/persistencemanager/detach/DetachTest.java | 341 +-
.../detach/DetachUndetachable.java | 91 +-
.../detach/SetDetachAllOnCommit.java | 102 +-
...WithInstancesMadePersistentViaReachability.java | 159 +-
.../extent/GetExtentWithNoSubclasses.java | 152 +-
.../extent/GetExtentWithSubclasses.java | 211 +-
.../fetchplan/AbstractFetchPlanTest.java | 270 +-
.../fetchplan/FetchPlanInterface.java | 615 +-
.../fetchplan/FetchPlanIsCopy.java | 214 +-
.../fetchplan/FetchPlanMakeTransient.java | 128 +-
.../fetchplan/FetchPlanQuery.java | 81 +-
.../fetchplan/FetchPlanRefresh.java | 127 +-
.../fetchplan/FetchPlanRetrieve.java | 122 +-
.../persistencemanager/flags/GetIgnoreCache.java | 90 +-
.../flags/SetIgnoreCacheToFalse.java | 111 +-
.../flags/SetIgnoreCacheToTrue.java | 113 +-
.../flags/SetMultithreadedFalse.java | 111 +-
.../flags/SetMultithreadedTrue.java | 112 +-
.../flags/SettingFlagsWithTransactionInstance.java | 88 +-
.../getobject/GetObjectById.java | 219 +-
.../getobject/GetObjectByIdExactClass.java | 448 +-
.../GetObjectByIdNoValidationInstanceInCache.java | 104 +-
...IdNoValidationInstanceInCacheNoStateChange.java | 110 +-
...etObjectByIdNoValidationInstanceNotInCache.java | 114 +-
...jectByIdNoValidationInstanceNotInCacheNoTx.java | 113 +-
...jectByIdNoValidationInstanceNotInDatastore.java | 105 +-
.../getobject/GetObjectByIdNotResolved.java | 113 +-
...GetObjectByIdWithValidationInstanceInCache.java | 122 +-
...ithValidationInstanceInCacheNotInDatastore.java | 119 +-
...ValidationInstanceNotInCacheNotInDatastore.java | 96 +-
.../persistencemanager/getobject/GetObjectId.java | 106 +-
.../getobject/GetObjectIdClass.java | 133 +-
...assForAbstractOrNonPersistenceCapableClass.java | 101 +-
.../GetObjectIdForNullOrNotPersistent.java | 101 +-
.../GetObjectIdForPersistentInterface.java | 114 +-
...etObjectIdWithApplicationModifyingIdentity.java | 131 +-
.../getobject/GetObjectsById.java | 343 +-
.../lifecycle/MakeNontransactionalAllFails.java | 279 +-
.../MakeNontransactionalDirtyInstance.java | 486 +-
.../lifecycle/MakeNontransactionalIsImmediate.java | 402 +-
...akeNontransactionalPersistentCleanInstance.java | 387 +-
...MakeNontransactionalTransientCleanInstance.java | 359 +-
.../lifecycle/MakePersistent.java | 363 +-
.../lifecycle/MakePersistentAllFails.java | 198 +-
.../MakePersistentAndInstancesNotReachable.java | 169 +-
.../lifecycle/MakePersistentAssignsObjectId.java | 282 +-
...InstanceManagedByAnotherPersistenceManager.java | 296 +-
...PersistentHasNoEffectOnPersistentInstances.java | 260 +-
.../lifecycle/MakeTransactional.java | 249 +-
...ctionalANontransactionalPersistentInstance.java | 546 +-
.../lifecycle/MakeTransactionalAllFails.java | 187 +-
.../lifecycle/MakeTransactionalIsImmediate.java | 283 +-
...eTransactionalPriorToTransactionRolledback.java | 356 +-
...keTransactionalWithinTransactionRolledback.java | 318 +-
.../lifecycle/MakeTransient.java | 271 +-
.../lifecycle/MakeTransientAllFails.java | 202 +-
.../MakeTransientCausesLossOfIdentity.java | 299 +-
.../MakeTransientFailsWithDirtyInstance.java | 305 +-
.../MakeTransientFieldsPreservedUnchanged.java | 404 +-
...keTransientHasNoEffectOnTransientInstances.java | 229 +-
.../MakeTransientNotSubjectToRollback.java | 296 +-
.../nullargs/DeletePersistentNullArgs.java | 139 +-
.../nullargs/DetachCopyNullArgs.java | 132 +-
.../persistencemanager/nullargs/EvictNullArgs.java | 130 +-
.../nullargs/MakeNontransactionalNullArgs.java | 143 +-
.../nullargs/MakePersistentNullArgs.java | 136 +-
.../nullargs/MakeTransactionalNullArgs.java | 140 +-
.../nullargs/MakeTransientNullArgs.java | 136 +-
.../nullargs/PersistenceManagerNullsTest.java | 999 ++--
.../nullargs/RefreshNullArgs.java | 131 +-
.../nullargs/RetrieveNullArgs.java | 133 +-
.../nullargs/RetrieveWithFetchPlanNullArgs.java | 143 +-
.../persistencemanagerfactory/AbstractGetPMF.java | 329 +-
.../AfterCloseGetPMThrowsException.java | 96 +-
.../AfterCloseSetMethodsThrowException.java | 368 +-
...erGetPersistenceManagerNoSetMethodsSucceed.java | 373 +-
.../tck/api/persistencemanagerfactory/Close.java | 193 +-
.../CloseFailsIfTransactionActive.java | 317 +-
...seWithoutPermissionThrowsSecurityException.java | 134 +-
.../FlushThrowsIfReadOnly.java | 259 +-
.../GetManagedClasses.java | 95 +-
.../persistencemanagerfactory/GetPMFByFile.java | 94 +-
.../GetPMFByFileAndClassLoader.java | 105 +-
.../GetPMFByJNDILocation.java | 154 +-
.../GetPMFByJNDILocationAndClassLoader.java | 150 +-
.../GetPMFByResource.java | 94 +-
.../GetPMFByResourceAndClassLoader.java | 97 +-
.../persistencemanagerfactory/GetPMFByStream.java | 116 +-
.../GetPMFByStreamAndClassLoader.java | 119 +-
.../GetPersistenceManager.java | 88 +-
...sistenceManagerFactoryByPropertiesInstance.java | 101 +-
.../GetPersistenceManagerForUser.java | 114 +-
.../persistencemanagerfactory/GetProperties.java | 95 +-
.../SetConnectionPassword.java | 90 +-
.../SetConnectionURL.java | 114 +-
.../SetConnectionUserName.java | 119 +-
.../persistencemanagerfactory/SetIgnoreCache.java | 101 +-
.../SetMultithreaded.java | 104 +-
.../SetNonTransactionalRead.java | 104 +-
.../SetNonTransactionalWrite.java | 117 +-
.../persistencemanagerfactory/SetOptimistic.java | 114 +-
.../api/persistencemanagerfactory/SetReadOnly.java | 103 +-
.../persistencemanagerfactory/SetRetainValues.java | 106 +-
.../SetTransactionIsolationLevel.java | 307 +-
.../SupportedOptions.java | 81 +-
.../config/JDOConfigListener.java | 230 +-
.../config/Jdoconfig.java | 328 +-
.../config/Persistence.java | 195 +-
.../config/StoreListener.java | 65 +-
.../config/StoreListenerGetInstance.java | 87 +-
.../config/ThrowOnUnknownStandardProperties.java | 205 +-
.../metadata/GetMetadataTest.java | 192 +-
.../apache/jdo/tck/enhancement/EnhancerTest.java | 140 +-
.../org/apache/jdo/tck/extents/AutoCloseable.java | 255 +-
.../java/org/apache/jdo/tck/extents/CloseAll.java | 104 +-
.../CloseOfExtentIteratorIsIteratorSpecific.java | 100 +-
.../org/apache/jdo/tck/extents/ExtentTest.java | 476 +-
.../apache/jdo/tck/extents/GetCandidateClass.java | 69 +-
.../jdo/tck/extents/GetPersistenceManager.java | 71 +-
.../apache/jdo/tck/extents/HasSubclassesFalse.java | 69 +-
.../apache/jdo/tck/extents/HasSubclassesTrue.java | 69 +-
...nstancesDeletedPriorToIterationNotReturned.java | 106 +-
...InstancesPersistedPriorToIterationReturned.java | 104 +-
.../IteratorHasNextFalseAfterExtentClose.java | 129 +-
.../jdo/tck/extents/IteratorMutatingMethods.java | 90 +-
.../tck/extents/IteratorNextAfterExtentClose.java | 142 +-
.../extents/IteratorNextAfterExtentCloseAll.java | 124 +-
.../java/org/apache/jdo/tck/extents/Iterators.java | 83 +-
.../tck/lifecycle/HollowInstanceMaintainsPK.java | 151 +-
...ltiplePMsReturnInstancesRepresentingSamePC.java | 251 +-
.../NontransactionalWriteDatastoreCommit.java | 112 +-
...ntransactionalWriteDatastoreCommitConflict.java | 119 +-
.../NontransactionalWriteDatastoreRollback.java | 114 +-
.../NontransactionalWriteOptimisticCommit.java | 114 +-
...transactionalWriteOptimisticCommitConflict.java | 122 +-
.../NontransactionalWriteOptimisticRollback.java | 114 +-
.../tck/lifecycle/NontransactionalWriteTest.java | 411 +-
.../tck/lifecycle/NontransactionalWriteThrows.java | 93 +-
...tIdNotModifiedWhenObjectIdInstanceModified.java | 232 +-
.../PMReturnsIdenticalInstancesForEqualObjIds.java | 175 +-
.../PMsCanSharePCClassesButNotPCInstances.java | 403 +-
.../apache/jdo/tck/lifecycle/StateTransitions.java | 2072 +++----
.../lifecycle/StateTransitionsReturnedObjects.java | 1470 ++---
.../TransientTransactionalStateCommit.java | 163 +-
.../TransientTransactionalStateRollback.java | 196 +-
.../jdo/tck/mapping/AbstractRelationshipTest.java | 111 +-
.../apache/jdo/tck/mapping/CompletenessTest.java | 168 +-
.../jdo/tck/mapping/CompletenessTestJPA.java | 174 +-
.../jdo/tck/mapping/CompletenessTestList.java | 174 +-
.../jdo/tck/mapping/CompletenessTestMap.java | 174 +-
.../jdo/tck/mapping/CompletenessTestOrder.java | 171 +-
.../mapping/Relationship1To1AllRelationships.java | 768 +--
.../mapping/Relationship1To1NoRelationships.java | 383 +-
.../Relationship1ToManyAllRelationships.java | 844 +--
.../Relationship1ToManyNoRelationships.java | 431 +-
.../RelationshipManyToManyAllRelationships.java | 895 ++-
.../RelationshipManyToManyNoRelationships.java | 409 +-
.../tck/mapping/RelationshipNegative1To1Test.java | 225 +-
.../mapping/RelationshipNegative1ToManyTest.java | 196 +-
.../tck/models/embedded/EmbeddedInheritance.java | 353 +-
.../SecondClassObjectsTrackTheirChanges.java | 229 +-
.../models/fieldtypes/TestArrayCollections.java | 322 +-
.../fieldtypes/TestArrayListCollections.java | 318 +-
.../fieldtypes/TestCollectionCollections.java | 294 +-
.../models/fieldtypes/TestFieldsOfBigDecimal.java | 202 +-
.../models/fieldtypes/TestFieldsOfBigInteger.java | 205 +-
.../tck/models/fieldtypes/TestFieldsOfBoolean.java | 203 +-
.../tck/models/fieldtypes/TestFieldsOfByte.java | 201 +-
.../models/fieldtypes/TestFieldsOfCharacter.java | 198 +-
.../tck/models/fieldtypes/TestFieldsOfDate.java | 197 +-
.../tck/models/fieldtypes/TestFieldsOfDouble.java | 198 +-
.../tck/models/fieldtypes/TestFieldsOfFloat.java | 196 +-
.../tck/models/fieldtypes/TestFieldsOfInteger.java | 198 +-
.../tck/models/fieldtypes/TestFieldsOfLocale.java | 200 +-
.../tck/models/fieldtypes/TestFieldsOfLong.java | 196 +-
.../tck/models/fieldtypes/TestFieldsOfObject.java | 220 +-
.../fieldtypes/TestFieldsOfPrimitiveboolean.java | 195 +-
.../fieldtypes/TestFieldsOfPrimitivebyte.java | 194 +-
.../fieldtypes/TestFieldsOfPrimitivechar.java | 192 +-
.../fieldtypes/TestFieldsOfPrimitivedouble.java | 194 +-
.../fieldtypes/TestFieldsOfPrimitivefloat.java | 194 +-
.../fieldtypes/TestFieldsOfPrimitiveint.java | 190 +-
.../fieldtypes/TestFieldsOfPrimitivelong.java | 196 +-
.../fieldtypes/TestFieldsOfPrimitiveshort.java | 195 +-
.../tck/models/fieldtypes/TestFieldsOfShort.java | 198 +-
.../models/fieldtypes/TestFieldsOfSimpleClass.java | 189 +-
.../models/fieldtypes/TestFieldsOfSimpleEnum.java | 190 +-
.../fieldtypes/TestFieldsOfSimpleInterface.java | 188 +-
.../tck/models/fieldtypes/TestFieldsOfString.java | 199 +-
.../TestHashMapStringKeyCollections.java | 313 +-
.../TestHashMapStringValueCollections.java | 336 +-
.../models/fieldtypes/TestHashSetCollections.java | 299 +-
.../TestHashtableStringKeyCollections.java | 316 +-
.../TestHashtableStringValueCollections.java | 335 +-
.../fieldtypes/TestLinkedListCollections.java | 296 +-
.../tck/models/fieldtypes/TestListCollections.java | 307 +-
.../fieldtypes/TestMapStringKeyCollections.java | 309 +-
.../fieldtypes/TestMapStringValueCollections.java | 337 +-
.../tck/models/fieldtypes/TestSetCollections.java | 287 +-
.../TestTreeMapStringKeyCollections.java | 312 +-
.../TestTreeMapStringValueCollections.java | 331 +-
.../models/fieldtypes/TestTreeSetCollections.java | 266 +-
.../apache/jdo/tck/models/fieldtypes/TestUtil.java | 599 +-
.../models/fieldtypes/TestVectorCollections.java | 296 +-
.../inheritance/FieldWithSameNameInSuperclass.java | 521 +-
...rsistentFieldsAreNonPersistentInSubclasses.java | 213 +-
.../inheritance/NonpersistentSuperClass.java | 500 +-
...ceCapableFlexibilityInInheritanceHierarchy.java | 504 +-
.../PersistentFieldsArePersistentInSubClasses.java | 491 +-
.../jdo/tck/models/inheritance/TestParts.java | 266 +-
...actionalFieldsAreTransactionalInSubclasses.java | 206 +-
.../org/apache/jdo/tck/pc/building/Kitchen.java | 157 +-
.../jdo/tck/pc/building/MultifunctionOven.java | 92 +-
.../java/org/apache/jdo/tck/pc/building/Oven.java | 114 +-
.../org/apache/jdo/tck/pc/company/Address.java | 599 +-
.../org/apache/jdo/tck/pc/company/Company.java | 638 ++-
.../apache/jdo/tck/pc/company/CompanyFactory.java | 108 +-
.../tck/pc/company/CompanyFactoryAbstractImpl.java | 465 +-
.../CompanyFactoryAnnotatedAbstractDelegator.java | 111 +-
.../pc/company/CompanyFactoryConcreteClass.java | 253 +-
.../tck/pc/company/CompanyFactoryNewInstance.java | 45 +-
.../jdo/tck/pc/company/CompanyFactoryPMClass.java | 116 +-
.../tck/pc/company/CompanyFactoryPMInterface.java | 115 +-
.../jdo/tck/pc/company/CompanyFactoryRegistry.java | 192 +-
.../jdo/tck/pc/company/CompanyModelReader.java | 442 +-
.../apache/jdo/tck/pc/company/DentalInsurance.java | 184 +-
.../org/apache/jdo/tck/pc/company/Department.java | 815 +--
.../org/apache/jdo/tck/pc/company/Employee.java | 928 +--
.../jdo/tck/pc/company/FullTimeEmployee.java | 208 +-
.../org/apache/jdo/tck/pc/company/IAddress.java | 53 +-
.../org/apache/jdo/tck/pc/company/ICompany.java | 49 +-
.../jdo/tck/pc/company/IDentalInsurance.java | 22 +-
.../org/apache/jdo/tck/pc/company/IDepartment.java | 61 +-
.../org/apache/jdo/tck/pc/company/IEmployee.java | 104 +-
.../jdo/tck/pc/company/IFullTimeEmployee.java | 24 +-
.../org/apache/jdo/tck/pc/company/IInsurance.java | 35 +-
.../jdo/tck/pc/company/IMedicalInsurance.java | 24 +-
.../apache/jdo/tck/pc/company/IMeetingRoom.java | 29 +-
.../jdo/tck/pc/company/IPartTimeEmployee.java | 22 +-
.../org/apache/jdo/tck/pc/company/IPerson.java | 60 +-
.../org/apache/jdo/tck/pc/company/IProject.java | 48 +-
.../org/apache/jdo/tck/pc/company/Insurance.java | 464 +-
.../jdo/tck/pc/company/MedicalInsurance.java | 180 +-
.../org/apache/jdo/tck/pc/company/MeetingRoom.java | 411 +-
.../org/apache/jdo/tck/pc/company/PIAddress.java | 53 +-
.../org/apache/jdo/tck/pc/company/PICompany.java | 51 +-
.../jdo/tck/pc/company/PIDentalInsurance.java | 22 +-
.../apache/jdo/tck/pc/company/PIDepartment.java | 54 +-
.../org/apache/jdo/tck/pc/company/PIEmployee.java | 104 +-
.../jdo/tck/pc/company/PIFullTimeEmployee.java | 24 +-
.../org/apache/jdo/tck/pc/company/PIInsurance.java | 35 +-
.../jdo/tck/pc/company/PIMedicalInsurance.java | 24 +-
.../apache/jdo/tck/pc/company/PIMeetingRoom.java | 29 +-
.../jdo/tck/pc/company/PIPartTimeEmployee.java | 22 +-
.../org/apache/jdo/tck/pc/company/PIPerson.java | 60 +-
.../org/apache/jdo/tck/pc/company/PIProject.java | 48 +-
.../jdo/tck/pc/company/PartTimeEmployee.java | 203 +-
.../java/org/apache/jdo/tck/pc/company/Person.java | 757 +--
.../org/apache/jdo/tck/pc/company/Project.java | 640 +--
.../CompanyFactoryAnnotatedFCAppConcrete.java | 120 +-
.../CompanyFactoryAnnotatedFCAppPM.java | 120 +-
...CompanyFactoryAnnotatedFCConcreteDelegator.java | 26 +-
.../CompanyFactoryAnnotatedFCDSConcrete.java | 120 +-
.../CompanyFactoryAnnotatedFCDSPM.java | 120 +-
.../CompanyFactoryAnnotatedFCPMDelegator.java | 27 +-
.../CompanyFactoryAnnotatedPMFieldClass.java | 192 +-
...toreIdDiscriminatorClassNameInheritanceNew.java | 32 +-
...iscriminatorClassNameInheritanceSuperclass.java | 34 +-
.../tck/pc/companyAnnotatedFC/FCAppAddress.java | 605 +-
.../tck/pc/companyAnnotatedFC/FCAppCompany.java | 689 ++-
.../companyAnnotatedFC/FCAppDentalInsurance.java | 190 +-
.../tck/pc/companyAnnotatedFC/FCAppDepartment.java | 784 +--
.../tck/pc/companyAnnotatedFC/FCAppEmployee.java | 993 ++--
.../companyAnnotatedFC/FCAppFullTimeEmployee.java | 220 +-
.../tck/pc/companyAnnotatedFC/FCAppInsurance.java | 497 +-
.../companyAnnotatedFC/FCAppMedicalInsurance.java | 187 +-
.../pc/companyAnnotatedFC/FCAppMeetingRoom.java | 427 +-
.../companyAnnotatedFC/FCAppPartTimeEmployee.java | 215 +-
.../jdo/tck/pc/companyAnnotatedFC/FCAppPerson.java | 815 +--
.../tck/pc/companyAnnotatedFC/FCAppProject.java | 682 +--
.../jdo/tck/pc/companyAnnotatedFC/FCDSAddress.java | 603 +-
.../jdo/tck/pc/companyAnnotatedFC/FCDSCompany.java | 682 +--
.../pc/companyAnnotatedFC/FCDSDentalInsurance.java | 193 +-
.../tck/pc/companyAnnotatedFC/FCDSDepartment.java | 780 +--
.../tck/pc/companyAnnotatedFC/FCDSEmployee.java | 993 ++--
.../companyAnnotatedFC/FCDSFullTimeEmployee.java | 218 +-
.../tck/pc/companyAnnotatedFC/FCDSInsurance.java | 487 +-
.../companyAnnotatedFC/FCDSMedicalInsurance.java | 190 +-
.../tck/pc/companyAnnotatedFC/FCDSMeetingRoom.java | 420 +-
.../companyAnnotatedFC/FCDSPartTimeEmployee.java | 210 +-
.../jdo/tck/pc/companyAnnotatedFC/FCDSPerson.java | 812 +--
.../jdo/tck/pc/companyAnnotatedFC/FCDSProject.java | 676 +--
.../CompanyFactoryAnnotatedJPAAppConcrete.java | 120 +-
.../CompanyFactoryAnnotatedJPAAppPM.java | 116 +-
.../CompanyFactoryAnnotatedPMFieldClassJPA.java | 153 +-
.../tck/pc/companyAnnotatedJPA/JPAAppAddress.java | 605 +-
.../tck/pc/companyAnnotatedJPA/JPAAppCompany.java | 697 ++-
.../companyAnnotatedJPA/JPAAppDentalInsurance.java | 193 +-
.../pc/companyAnnotatedJPA/JPAAppDepartment.java | 792 +--
.../tck/pc/companyAnnotatedJPA/JPAAppEmployee.java | 1011 ++--
.../JPAAppFullTimeEmployee.java | 218 +-
.../pc/companyAnnotatedJPA/JPAAppInsurance.java | 492 +-
.../JPAAppMedicalInsurance.java | 188 +-
.../JPAAppPartTimeEmployee.java | 213 +-
.../tck/pc/companyAnnotatedJPA/JPAAppPerson.java | 891 +--
.../pc/companyAnnotatedJPA/JPAAppPhoneNumber.java | 331 +-
.../tck/pc/companyAnnotatedJPA/JPAAppProject.java | 683 +--
.../CompanyFactoryAnnotatedPCAppConcrete.java | 118 +-
.../CompanyFactoryAnnotatedPCAppPM.java | 118 +-
...CompanyFactoryAnnotatedPCConcreteDelegator.java | 26 +-
.../CompanyFactoryAnnotatedPCDSConcrete.java | 118 +-
.../CompanyFactoryAnnotatedPCDSPM.java | 118 +-
.../CompanyFactoryAnnotatedPCPMDelegator.java | 27 +-
.../tck/pc/companyAnnotatedPC/PCAppAddress.java | 604 +-
.../tck/pc/companyAnnotatedPC/PCAppCompany.java | 694 ++-
.../companyAnnotatedPC/PCAppDentalInsurance.java | 193 +-
.../tck/pc/companyAnnotatedPC/PCAppDepartment.java | 792 ++-
.../tck/pc/companyAnnotatedPC/PCAppEmployee.java | 1024 ++--
.../companyAnnotatedPC/PCAppFullTimeEmployee.java | 223 +-
.../tck/pc/companyAnnotatedPC/PCAppInsurance.java | 515 +-
.../companyAnnotatedPC/PCAppMedicalInsurance.java | 192 +-
.../companyAnnotatedPC/PCAppPartTimeEmployee.java | 219 +-
.../jdo/tck/pc/companyAnnotatedPC/PCAppPerson.java | 815 ++-
.../tck/pc/companyAnnotatedPC/PCAppProject.java | 686 ++-
.../jdo/tck/pc/companyAnnotatedPC/PCDSAddress.java | 602 +-
.../jdo/tck/pc/companyAnnotatedPC/PCDSCompany.java | 699 ++-
.../pc/companyAnnotatedPC/PCDSDentalInsurance.java | 197 +-
.../tck/pc/companyAnnotatedPC/PCDSDepartment.java | 794 ++-
.../tck/pc/companyAnnotatedPC/PCDSEmployee.java | 1037 ++--
.../companyAnnotatedPC/PCDSFullTimeEmployee.java | 222 +-
.../tck/pc/companyAnnotatedPC/PCDSInsurance.java | 516 +-
.../companyAnnotatedPC/PCDSMedicalInsurance.java | 195 +-
.../companyAnnotatedPC/PCDSPartTimeEmployee.java | 216 +-
.../jdo/tck/pc/companyAnnotatedPC/PCDSPerson.java | 815 ++-
.../jdo/tck/pc/companyAnnotatedPC/PCDSProject.java | 688 ++-
.../CompanyFactoryAnnotatedPIAppPM.java | 118 +-
.../CompanyFactoryAnnotatedPIDSPM.java | 118 +-
.../CompanyFactoryAnnotatedPIPMDelegator.java | 26 +-
.../CompanyFactoryAnnotatedPMInterface.java | 177 +-
.../tck/pc/companyAnnotatedPI/PIAppAddress.java | 57 +-
.../tck/pc/companyAnnotatedPI/PIAppCompany.java | 89 +-
.../companyAnnotatedPI/PIAppDentalInsurance.java | 29 +-
.../tck/pc/companyAnnotatedPI/PIAppDepartment.java | 85 +-
.../tck/pc/companyAnnotatedPI/PIAppEmployee.java | 163 +-
.../companyAnnotatedPI/PIAppFullTimeEmployee.java | 30 +-
.../tck/pc/companyAnnotatedPI/PIAppInsurance.java | 67 +-
.../companyAnnotatedPI/PIAppMedicalInsurance.java | 31 +-
.../companyAnnotatedPI/PIAppPartTimeEmployee.java | 28 +-
.../jdo/tck/pc/companyAnnotatedPI/PIAppPerson.java | 117 +-
.../tck/pc/companyAnnotatedPI/PIAppProject.java | 82 +-
.../jdo/tck/pc/companyAnnotatedPI/PIDSAddress.java | 55 +-
.../jdo/tck/pc/companyAnnotatedPI/PIDSCompany.java | 90 +-
.../pc/companyAnnotatedPI/PIDSDentalInsurance.java | 24 +-
.../tck/pc/companyAnnotatedPI/PIDSDepartment.java | 84 +-
.../tck/pc/companyAnnotatedPI/PIDSEmployee.java | 158 +-
.../companyAnnotatedPI/PIDSFullTimeEmployee.java | 28 +-
.../tck/pc/companyAnnotatedPI/PIDSInsurance.java | 64 +-
.../companyAnnotatedPI/PIDSMedicalInsurance.java | 26 +-
.../companyAnnotatedPI/PIDSPartTimeEmployee.java | 26 +-
.../jdo/tck/pc/companyAnnotatedPI/PIDSPerson.java | 114 +-
.../jdo/tck/pc/companyAnnotatedPI/PIDSProject.java | 84 +-
.../jdo/tck/pc/companyListWithoutJoin/Company.java | 575 +-
.../pc/companyListWithoutJoin/CompanyFactory.java | 43 +-
.../CompanyFactoryAbstractImpl.java | 170 +-
.../CompanyFactoryConcreteClass.java | 82 +-
.../CompanyFactoryPMClass.java | 71 +-
.../CompanyFactoryPMInterface.java | 69 +-
.../CompanyFactoryRegistry.java | 192 +-
.../companyListWithoutJoin/CompanyModelReader.java | 303 +-
.../tck/pc/companyListWithoutJoin/Department.java | 586 +-
.../tck/pc/companyListWithoutJoin/Employee.java | 651 ++-
.../companyListWithoutJoin/FullTimeEmployee.java | 167 +-
.../tck/pc/companyListWithoutJoin/ICompany.java | 43 +-
.../tck/pc/companyListWithoutJoin/IDepartment.java | 43 +-
.../tck/pc/companyListWithoutJoin/IEmployee.java | 80 +-
.../companyListWithoutJoin/IFullTimeEmployee.java | 24 +-
.../companyListWithoutJoin/IPartTimeEmployee.java | 22 +-
.../jdo/tck/pc/companyListWithoutJoin/IPerson.java | 48 +-
.../companyListWithoutJoin/PartTimeEmployee.java | 162 +-
.../jdo/tck/pc/companyListWithoutJoin/Person.java | 565 +-
.../jdo/tck/pc/companyMapWithoutJoin/Company.java | 575 +-
.../pc/companyMapWithoutJoin/CompanyFactory.java | 57 +-
.../CompanyFactoryAbstractImpl.java | 176 +-
.../CompanyFactoryConcreteClass.java | 96 +-
.../CompanyFactoryPMClass.java | 71 +-
.../CompanyFactoryPMInterface.java | 69 +-
.../CompanyFactoryRegistry.java | 192 +-
.../companyMapWithoutJoin/CompanyModelReader.java | 303 +-
.../tck/pc/companyMapWithoutJoin/Department.java | 588 +-
.../jdo/tck/pc/companyMapWithoutJoin/Employee.java | 696 +--
.../pc/companyMapWithoutJoin/FullTimeEmployee.java | 176 +-
.../jdo/tck/pc/companyMapWithoutJoin/ICompany.java | 43 +-
.../tck/pc/companyMapWithoutJoin/IDepartment.java | 43 +-
.../tck/pc/companyMapWithoutJoin/IEmployee.java | 86 +-
.../companyMapWithoutJoin/IFullTimeEmployee.java | 24 +-
.../companyMapWithoutJoin/IPartTimeEmployee.java | 22 +-
.../jdo/tck/pc/companyMapWithoutJoin/IPerson.java | 48 +-
.../pc/companyMapWithoutJoin/PartTimeEmployee.java | 171 +-
.../jdo/tck/pc/companyMapWithoutJoin/Person.java | 565 +-
.../ApplicationIdDiscriminatorClassName.java | 25 +-
.../org/apache/jdo/tck/pc/converter/IPCPoint.java | 14 +-
.../org/apache/jdo/tck/pc/converter/IPCRect.java | 14 +-
.../org/apache/jdo/tck/pc/converter/PCPoint.java | 80 +-
.../jdo/tck/pc/converter/PCPointAnnotated.java | 77 +-
.../apache/jdo/tck/pc/converter/PCPointProp.java | 80 +-
.../jdo/tck/pc/converter/PCPointPropAnnotated.java | 77 +-
.../org/apache/jdo/tck/pc/converter/PCRect.java | 84 +-
.../jdo/tck/pc/converter/PCRectAnnotated.java | 96 +-
.../org/apache/jdo/tck/pc/fieldtypes/AllTypes.java | 660 ++-
.../jdo/tck/pc/fieldtypes/ArrayCollections.java | 451 +-
.../tck/pc/fieldtypes/ArrayListCollections.java | 551 +-
.../tck/pc/fieldtypes/CollectionCollections.java | 511 +-
.../jdo/tck/pc/fieldtypes/FieldsOfBigDecimal.java | 1544 ++---
.../jdo/tck/pc/fieldtypes/FieldsOfBigInteger.java | 1544 ++---
.../jdo/tck/pc/fieldtypes/FieldsOfBoolean.java | 1543 ++---
.../apache/jdo/tck/pc/fieldtypes/FieldsOfByte.java | 1559 ++---
.../jdo/tck/pc/fieldtypes/FieldsOfCharacter.java | 1543 ++---
.../apache/jdo/tck/pc/fieldtypes/FieldsOfDate.java | 1544 ++---
.../jdo/tck/pc/fieldtypes/FieldsOfDouble.java | 1559 ++---
.../jdo/tck/pc/fieldtypes/FieldsOfFloat.java | 1559 ++---
.../jdo/tck/pc/fieldtypes/FieldsOfInteger.java | 1560 ++---
.../jdo/tck/pc/fieldtypes/FieldsOfLocale.java | 1544 ++---
.../apache/jdo/tck/pc/fieldtypes/FieldsOfLong.java | 1559 ++---
.../jdo/tck/pc/fieldtypes/FieldsOfObject.java | 1543 ++---
.../pc/fieldtypes/FieldsOfPrimitiveboolean.java | 1543 ++---
.../tck/pc/fieldtypes/FieldsOfPrimitivebyte.java | 1542 ++---
.../tck/pc/fieldtypes/FieldsOfPrimitivechar.java | 1543 ++---
.../tck/pc/fieldtypes/FieldsOfPrimitivedouble.java | 1544 ++---
.../tck/pc/fieldtypes/FieldsOfPrimitivefloat.java | 1543 ++---
.../tck/pc/fieldtypes/FieldsOfPrimitiveint.java | 1543 ++---
.../tck/pc/fieldtypes/FieldsOfPrimitivelong.java | 1544 ++---
.../tck/pc/fieldtypes/FieldsOfPrimitiveshort.java | 1543 ++---
.../jdo/tck/pc/fieldtypes/FieldsOfShort.java | 1559 ++---
.../jdo/tck/pc/fieldtypes/FieldsOfSimpleClass.java | 1796 +++---
.../jdo/tck/pc/fieldtypes/FieldsOfSimpleEnum.java | 1544 ++---
.../tck/pc/fieldtypes/FieldsOfSimpleInterface.java | 1543 ++---
.../jdo/tck/pc/fieldtypes/FieldsOfString.java | 1543 ++---
.../pc/fieldtypes/HashMapStringKeyCollections.java | 1059 ++--
.../fieldtypes/HashMapStringValueCollections.java | 992 ++--
.../jdo/tck/pc/fieldtypes/HashSetCollections.java | 511 +-
.../fieldtypes/HashtableStringKeyCollections.java | 1061 ++--
.../HashtableStringValueCollections.java | 991 ++--
.../tck/pc/fieldtypes/LinkedListCollections.java | 512 +-
.../jdo/tck/pc/fieldtypes/ListCollections.java | 511 +-
.../tck/pc/fieldtypes/MapStringKeyCollections.java | 1191 ++--
.../pc/fieldtypes/MapStringValueCollections.java | 1121 ++--
.../jdo/tck/pc/fieldtypes/SetCollections.java | 511 +-
.../apache/jdo/tck/pc/fieldtypes/SimpleClass.java | 150 +-
.../apache/jdo/tck/pc/fieldtypes/SimpleEnum.java | 206 +-
.../jdo/tck/pc/fieldtypes/SimpleInterface.java | 18 +-
.../pc/fieldtypes/TreeMapStringKeyCollections.java | 1062 ++--
.../fieldtypes/TreeMapStringValueCollections.java | 991 ++--
.../jdo/tck/pc/fieldtypes/TreeSetCollections.java | 471 +-
.../jdo/tck/pc/fieldtypes/VectorCollections.java | 512 +-
.../apache/jdo/tck/pc/inheritance/AllPersist.java | 122 +-
.../apache/jdo/tck/pc/inheritance/AllPersist2.java | 46 +-
.../apache/jdo/tck/pc/inheritance/AllPersist3.java | 44 +-
.../apache/jdo/tck/pc/inheritance/AllPersist4.java | 52 +-
.../apache/jdo/tck/pc/inheritance/Constants.java | 51 +-
.../jdo/tck/pc/inheritance/FieldSameName.java | 148 +-
.../jdo/tck/pc/inheritance/FieldSameName2.java | 94 +-
.../jdo/tck/pc/inheritance/FieldSameName3.java | 92 +-
.../jdo/tck/pc/inheritance/FieldSameName4.java | 100 +-
.../jdo/tck/pc/inheritance/TopNonPersist.java | 32 +-
.../jdo/tck/pc/inheritance/TopNonPersistB.java | 104 +-
.../jdo/tck/pc/inheritance/TopNonPersistC.java | 35 +-
.../jdo/tck/pc/inheritance/TopNonPersistD.java | 35 +-
.../jdo/tck/pc/inheritance/TopNonPersistE.java | 38 +-
.../jdo/tck/pc/inheritance/TopNonPersistF.java | 46 +-
.../jdo/tck/pc/inheritance/TopNonPersistG.java | 46 +-
.../jdo/tck/pc/inheritance/TopNonPersistH.java | 46 +-
.../apache/jdo/tck/pc/inheritance/TopPersist.java | 106 +-
.../apache/jdo/tck/pc/inheritance/TopPersistC.java | 33 +-
.../apache/jdo/tck/pc/inheritance/TopPersistD.java | 33 +-
.../apache/jdo/tck/pc/inheritance/TopPersistE.java | 36 +-
.../apache/jdo/tck/pc/inheritance/TopPersistF.java | 46 +-
.../apache/jdo/tck/pc/inheritance/TopPersistG.java | 44 +-
.../apache/jdo/tck/pc/inheritance/TopPersistH.java | 43 +-
.../instancecallbacks/InstanceCallbackClass.java | 398 +-
.../InstanceCallbackNonPersistFdsClass.java | 524 +-
.../jdo/tck/pc/lifecycle/StateTransitionObj.java | 200 +-
.../org/apache/jdo/tck/pc/mylib/MylibReader.java | 146 +-
.../java/org/apache/jdo/tck/pc/mylib/PCClass.java | 295 +-
.../java/org/apache/jdo/tck/pc/mylib/PCPoint.java | 158 +-
.../java/org/apache/jdo/tck/pc/mylib/PCPoint2.java | 211 +-
.../java/org/apache/jdo/tck/pc/mylib/PCRect.java | 162 +-
.../java/org/apache/jdo/tck/pc/mylib/Point.java | 83 +-
.../apache/jdo/tck/pc/mylib/PrimitiveTypes.java | 684 +--
.../apache/jdo/tck/pc/mylib/VersionedPCPoint.java | 178 +-
.../apache/jdo/tck/pc/newInstance/AAddress.java | 53 +-
.../jdo/tck/pc/newInstance/AAddress_bad.java | 61 +-
.../org/apache/jdo/tck/pc/newInstance/Address.java | 589 +-
.../apache/jdo/tck/pc/newInstance/Address_bad.java | 591 +-
.../apache/jdo/tck/pc/newInstance/IAddress.java | 53 +-
.../jdo/tck/pc/newInstance/IAddress_bad.java | 61 +-
.../java/org/apache/jdo/tck/pc/order/Order.java | 325 +-
.../org/apache/jdo/tck/pc/order/OrderFactory.java | 30 +-
.../jdo/tck/pc/order/OrderFactoryAbstractImpl.java | 86 +-
.../tck/pc/order/OrderFactoryConcreteClass.java | 62 +-
.../jdo/tck/pc/order/OrderFactoryPMClass.java | 54 +-
.../jdo/tck/pc/order/OrderFactoryPMInterface.java | 52 +-
.../jdo/tck/pc/order/OrderFactoryRegistry.java | 184 +-
.../org/apache/jdo/tck/pc/order/OrderItem.java | 386 +-
.../apache/jdo/tck/pc/order/OrderModelReader.java | 214 +-
.../tck/pc/query/JDOQLKeywordsAsFieldNames.java | 38 +-
.../apache/jdo/tck/pc/query/LocalDateSample.java | 74 +-
.../jdo/tck/pc/query/LocalDateTimeSample.java | 74 +-
.../apache/jdo/tck/pc/query/LocalTimeSample.java | 74 +-
.../org/apache/jdo/tck/pc/query/MathSample.java | 223 +-
.../jdo/tck/pc/query/NamedQueriesSample.java | 53 +-
.../java/org/apache/jdo/tck/pc/query/NoExtent.java | 42 +-
.../apache/jdo/tck/pc/query/OptionalSample.java | 207 +-
.../org/apache/jdo/tck/pc/query/TimeSample.java | 89 +-
.../org/apache/jdo/tck/pc/shoppingcart/Cart.java | 195 +-
.../apache/jdo/tck/pc/shoppingcart/CartEntry.java | 212 +-
.../apache/jdo/tck/pc/shoppingcart/Product.java | 142 +-
.../jdo/tck/pc/shoppingcart/Undetachable.java | 113 +-
.../AbstractPCPointSingleField.java | 58 +-
.../jdo/tck/pc/singlefieldidentity/Employee.java | 167 +-
.../pc/singlefieldidentity/FullTimeEmployee.java | 134 +-
.../PCPointSingleFieldByte.java | 149 +-
.../PCPointSingleFieldCharacter.java | 149 +-
.../PCPointSingleFieldDate.java | 153 +-
.../PCPointSingleFieldInteger.java | 149 +-
.../PCPointSingleFieldLong.java | 149 +-
.../PCPointSingleFieldPrimitivebyte.java | 130 +-
.../PCPointSingleFieldPrimitivechar.java | 130 +-
.../PCPointSingleFieldPrimitiveint.java | 130 +-
.../PCPointSingleFieldPrimitivelong.java | 130 +-
.../PCPointSingleFieldPrimitiveshort.java | 130 +-
.../PCPointSingleFieldShort.java | 149 +-
.../PCPointSingleFieldString.java | 149 +-
.../pc/singlefieldidentity/PartTimeEmployee.java | 132 +-
.../jdo/tck/pc/singlefieldidentity/Person.java | 299 +-
.../apache/jdo/tck/query/QueryElementHolder.java | 792 +--
.../java/org/apache/jdo/tck/query/QueryTest.java | 2897 +++++-----
.../apache/jdo/tck/query/api/AutoCloseable.java | 434 +-
.../org/apache/jdo/tck/query/api/ChangeQuery.java | 141 +-
.../java/org/apache/jdo/tck/query/api/Close.java | 195 +-
.../org/apache/jdo/tck/query/api/CloseAll.java | 136 +-
.../org/apache/jdo/tck/query/api/CompileQuery.java | 129 +-
.../apache/jdo/tck/query/api/DeclareImports.java | 245 +-
.../jdo/tck/query/api/DeclareParameters.java | 257 +-
.../apache/jdo/tck/query/api/DeclareVariables.java | 165 +-
.../org/apache/jdo/tck/query/api/ExecuteQuery.java | 265 +-
.../jdo/tck/query/api/ExecuteQueryWithArray.java | 221 +-
.../jdo/tck/query/api/ExecuteQueryWithMap.java | 225 +-
.../org/apache/jdo/tck/query/api/GetFetchPlan.java | 176 +-
.../apache/jdo/tck/query/api/GetIgnoreCache.java | 200 +-
.../jdo/tck/query/api/GetPersistenceManager.java | 194 +-
...sistenceManagerFromRestoredSerializedQuery.java | 193 +-
.../jdo/tck/query/api/InvalidNamedQuery.java | 67 +-
.../jdo/tck/query/api/MetadataSearchOrder.java | 176 +-
.../jdo/tck/query/api/NamedQueryNotFound.java | 69 +-
.../query/api/NamedQueryRepeatableAnnotations.java | 71 +-
.../apache/jdo/tck/query/api/NewNamedQuery.java | 135 +-
...ryFromExistingQueryBoundToPMFromSameVendor.java | 259 +-
.../api/NewQueryFromRestoredSerializedQuery.java | 195 +-
.../jdo/tck/query/api/NewQuerySingleString.java | 131 +-
.../tck/query/api/NewQueryWithCandidateClass.java | 105 +-
.../NewQueryWithCandidateClassAndCollection.java | 106 +-
.../api/NewQueryWithCandidateClassAndExtent.java | 112 +-
.../api/NewQueryWithCandidateClassAndFilter.java | 116 +-
...NewQueryWithCandidateClassCollectionFilter.java | 115 +-
.../jdo/tck/query/api/NewQueryWithExtent.java | 105 +-
.../tck/query/api/NewQueryWithExtentAndFilter.java | 114 +-
.../api/NewQueryWithSpecifiedLanguageAndQuery.java | 144 +-
.../org/apache/jdo/tck/query/api/QueryCancel.java | 420 +-
.../apache/jdo/tck/query/api/QueryExtentions.java | 105 +-
.../apache/jdo/tck/query/api/SampleQueries.java | 6053 ++++++++++----------
.../apache/jdo/tck/query/api/SaveAsNamedQuery.java | 128 +-
.../jdo/tck/query/api/SetCandidateCollection.java | 139 +-
.../jdo/tck/query/api/SetCandidateExtent.java | 135 +-
.../org/apache/jdo/tck/query/api/SetFilter.java | 122 +-
.../org/apache/jdo/tck/query/api/SetGrouping.java | 100 +-
.../apache/jdo/tck/query/api/SetIgnoreCache.java | 248 +-
.../org/apache/jdo/tck/query/api/SetOrdering.java | 201 +-
.../org/apache/jdo/tck/query/api/SetRange.java | 100 +-
.../org/apache/jdo/tck/query/api/SetResult.java | 122 +-
.../apache/jdo/tck/query/api/SetResultClass.java | 112 +-
.../org/apache/jdo/tck/query/api/SetUnique.java | 115 +-
.../tck/query/api/SetterReplacePreviousValues.java | 302 +-
.../jdo/tck/query/api/SingleStringQuery.java | 181 +-
.../jdo/tck/query/api/UnmodifiableQuery.java | 300 +-
.../jdo/tck/query/delete/DeleteCallback.java | 839 ++-
.../jdo/tck/query/delete/DeletePersistentAll.java | 443 +-
.../jdo/tck/query/delete/DeleteQueryElements.java | 454 +-
...nmentPrePostIncrementDecrementNotSupported.java | 217 +-
.../java/org/apache/jdo/tck/query/jdoql/Cast.java | 189 +-
.../query/jdoql/CharacterAndStringLiterals.java | 278 +-
.../jdoql/ComparingCollectionFieldToNull.java | 154 +-
...omparingPersistentAndNonPersistentInstance.java | 214 +-
.../tck/query/jdoql/DenoteUniquenessInFilter.java | 328 +-
...ExecuteQueryWhenPersistenceManagerIsClosed.java | 124 +-
...gMultipleQueriesSimultaneouslyIsThreadSafe.java | 273 +-
...eryWhenNoTransactionNoNontransactionalRead.java | 102 +-
.../org/apache/jdo/tck/query/jdoql/Having.java | 299 +-
.../query/jdoql/IdentifiersEqualFieldNames.java | 378 +-
.../apache/jdo/tck/query/jdoql/IfElseInFilter.java | 442 +-
.../jdo/tck/query/jdoql/IgnoreCacheFalse.java | 283 +-
...ctiveQueryInstanceInSamePersistenceManager.java | 171 +-
.../tck/query/jdoql/MultipleIdenticalImports.java | 295 +-
.../tck/query/jdoql/NamespaceOfIdentifiers.java | 127 +-
.../query/jdoql/NavigationComparisonWithNull.java | 870 ++-
.../jdoql/NavigationThroughACollectionField.java | 149 +-
.../jdoql/NavigationThroughANullValuedField.java | 356 +-
...NavigationThroughReferencesUsesDotOperator.java | 347 +-
.../apache/jdo/tck/query/jdoql/NegativeRange.java | 292 +-
.../jdoql/NullCollectionsAndContainsMethod.java | 225 +-
.../tck/query/jdoql/NullCollectionsAndIsEmpty.java | 132 +-
.../jdo/tck/query/jdoql/OrderingSpecification.java | 462 +-
.../jdoql/ParenthesesMarkOperatorPrecedence.java | 673 +--
.../apache/jdo/tck/query/jdoql/PositiveRange.java | 310 +-
.../jdo/tck/query/jdoql/QueryIsSerializable.java | 299 +-
.../jdoql/QueryResultPassedToAnotherQuery.java | 324 +-
.../jdo/tck/query/jdoql/QueryWithNoFilter.java | 134 +-
.../apache/jdo/tck/query/jdoql/RangeAsString.java | 315 +-
...ializedQueryInstanceLosesAssociationWithPM.java | 136 +-
.../query/jdoql/SeparateNamespaceForTypeNames.java | 207 +-
.../jdoql/WhiteSpaceIsACharacterAndIgnored.java | 220 +-
.../query/jdoql/keywords/InvalidUseOfKeywords.java | 162 +-
.../query/jdoql/keywords/KeywordsAsFieldNames.java | 157 +-
.../jdo/tck/query/jdoql/keywords/SingleString.java | 124 +-
.../ThisIsReservedWordForElementOfCollection.java | 110 +-
.../query/jdoql/keywords/UppercaseLowercase.java | 98 +-
.../keywords/UseOfThisToAcessHiddenField.java | 217 +-
.../tck/query/jdoql/methods/EnumMethodOrdinal.java | 161 +-
.../query/jdoql/methods/EnumMethodToString.java | 161 +-
.../MethodsAndObjectConstructionNotSupported.java | 99 +-
.../query/jdoql/methods/StartsWithAndEndsWith.java | 183 +-
.../jdoql/methods/SupportedCollectionMethods.java | 399 +-
.../query/jdoql/methods/SupportedDateMethods.java | 257 +-
.../jdoql/methods/SupportedJDOHelperMethods.java | 385 +-
.../query/jdoql/methods/SupportedListMethods.java | 215 +-
.../jdoql/methods/SupportedLocalDateMethods.java | 243 +-
.../methods/SupportedLocalDateTimeMethods.java | 365 +-
.../jdoql/methods/SupportedLocalTimeMethods.java | 247 +-
.../query/jdoql/methods/SupportedMapMethods.java | 388 +-
.../query/jdoql/methods/SupportedMathMethods.java | 1751 +++---
.../jdoql/methods/SupportedOptionalMethods.java | 1115 ++--
.../jdoql/methods/SupportedStringMethods.java | 1030 ++--
.../query/jdoql/methods/SupportedTimeMethods.java | 287 +-
.../tck/query/jdoql/operators/BinaryAddition.java | 159 +-
.../query/jdoql/operators/BinarySubtraction.java | 167 +-
.../jdoql/operators/BitwiseBinaryOperators.java | 409 +-
.../query/jdoql/operators/BitwiseComplement.java | 140 +-
.../query/jdoql/operators/BooleanLogicalAND.java | 196 +-
.../query/jdoql/operators/BooleanLogicalOR.java | 245 +-
.../tck/query/jdoql/operators/ComparisonTests.java | 179 +-
.../tck/query/jdoql/operators/ConditionalAND.java | 198 +-
.../tck/query/jdoql/operators/ConditionalOR.java | 199 +-
.../jdo/tck/query/jdoql/operators/Division.java | 177 +-
.../jdo/tck/query/jdoql/operators/Equality.java | 3067 ++++++----
...dComparisonsBetweenDateFieldsAndParameters.java | 337 +-
...risonsBetweenPrimitivesAndWrapperInstances.java | 152 +-
...omparisonsBetweenStringFieldsAndParameters.java | 281 +-
.../jdo/tck/query/jdoql/operators/GreaterThan.java | 3425 +++++++----
.../query/jdoql/operators/GreaterThanOrEqual.java | 3443 +++++++----
.../jdo/tck/query/jdoql/operators/Instanceof.java | 169 +-
.../jdo/tck/query/jdoql/operators/LessThan.java | 3430 +++++++----
.../tck/query/jdoql/operators/LessThanOrEqual.java | 3446 +++++++----
.../query/jdoql/operators/LogicalComplement.java | 386 +-
.../jdo/tck/query/jdoql/operators/Modulo.java | 190 +-
.../tck/query/jdoql/operators/Multiplication.java | 157 +-
.../jdo/tck/query/jdoql/operators/NotEquals.java | 3097 ++++++----
.../operators/PromotionOfNumericOperands.java | 137 +-
.../tck/query/jdoql/operators/SignInversion.java | 163 +-
.../query/jdoql/operators/StringConcatenation.java | 202 +-
.../jdo/tck/query/jdoql/operators/UnaryPlus.java | 113 +-
.../jdoql/parameters/BoundParameterCheck.java | 119 +-
.../parameters/DomainObjectsAsParameters.java | 571 +-
.../query/jdoql/parameters/ImplicitParameters.java | 339 +-
.../query/jdoql/parameters/MixedParameters.java | 210 +-
.../query/jdoql/parameters/OrderOfParameters.java | 162 +-
.../parameters/ParameterBoundToDifferentPM.java | 134 +-
...eclaredWithSameNameAsFieldOfCandidateClass.java | 245 +-
.../parameters/PrimitiveParameterPassedAsNull.java | 104 +-
.../query/jdoql/subqueries/AggregateOnSize.java | 120 +-
.../jdoql/subqueries/CorrelatedSubqueries.java | 418 +-
.../CorrelatedSubqueriesWithParameters.java | 334 +-
.../subqueries/MultipleCallsReplaceSubquery.java | 126 +-
.../jdoql/subqueries/NonCorrelatedSubqueries.java | 251 +-
.../NullCandidateCollectionExpression.java | 127 +-
.../jdoql/subqueries/NullSubqueryParameter.java | 111 +-
.../jdoql/subqueries/NullVariableDeclaration.java | 111 +-
.../tck/query/jdoql/subqueries/SubqueriesTest.java | 97 +-
.../subqueries/UnmodifiedSubqueryInstance.java | 211 +-
.../tck/query/jdoql/variables/MixedVariables.java | 222 +-
.../jdoql/variables/UnconstrainedVariable.java | 133 +-
...eclaredWithSameNameAsFieldOfCandidateClass.java | 138 +-
.../query/jdoql/variables/VariablesAndFields.java | 411 +-
.../jdoql/variables/VariablesWithoutExtent.java | 159 +-
.../jdo/tck/query/result/AggregateResult.java | 1877 +++---
.../apache/jdo/tck/query/result/DefaultResult.java | 117 +-
.../apache/jdo/tck/query/result/DefaultUnique.java | 705 +--
.../query/result/DistinctCandidateInstances.java | 248 +-
.../apache/jdo/tck/query/result/DistinctQuery.java | 337 +-
.../org/apache/jdo/tck/query/result/Grouping.java | 187 +-
.../apache/jdo/tck/query/result/IfElseResult.java | 389 +-
.../jdo/tck/query/result/ImmutableQueryResult.java | 282 +-
.../jdo/tck/query/result/MethodsInResult.java | 459 +-
.../jdo/tck/query/result/NPEInResultExpr.java | 196 +-
.../apache/jdo/tck/query/result/NullResults.java | 252 +-
.../result/ProjectedSCODoesNotTrackChanges.java | 266 +-
.../tck/query/result/ResultClassRequirements.java | 986 ++--
.../jdo/tck/query/result/ResultExpressions.java | 1331 ++---
.../apache/jdo/tck/query/result/ShapeOfResult.java | 730 +--
.../org/apache/jdo/tck/query/result/Unique.java | 281 +-
.../jdo/tck/query/result/VariableInResult.java | 425 +-
.../result/VariableInResultMultipleNavigation.java | 399 +-
.../query/result/VariableInResultNavigation.java | 478 +-
.../jdo/tck/query/result/classes/FullName.java | 210 +-
.../jdo/tck/query/result/classes/LongString.java | 140 +-
.../result/classes/MissingNoArgsConstructor.java | 104 +-
.../query/result/classes/NoFieldsNoMethods.java | 22 +-
.../tck/query/result/classes/PublicLongField.java | 72 +-
.../tck/query/result/classes/PublicPutMethod.java | 86 +-
.../jdo/tck/query/sql/AllowedAPIMethods.java | 383 +-
.../apache/jdo/tck/query/sql/ExecuteWithMap.java | 322 +-
.../org/apache/jdo/tck/query/sql/NewQuery.java | 125 +-
.../apache/jdo/tck/query/sql/NoCandidateClass.java | 139 +-
.../apache/jdo/tck/query/sql/ShapeOfResult.java | 348 +-
.../AfterCompletionMethodCalledWhenCommitted.java | 195 +-
.../AfterCompletionMethodCalledWhenRolledback.java | 197 +-
.../AfterSetRollbackOnlyCommitFails.java | 67 +-
.../transactions/BeforeCompletionMethodCalled.java | 184 +-
...oreCompletionMethodNotCalledBeforeRollback.java | 175 +-
.../org/apache/jdo/tck/transactions/Commit.java | 228 +-
.../tck/transactions/GetPersistenceManager.java | 127 +-
.../jdo/tck/transactions/GetRetainValues.java | 135 +-
.../GetRollbackOnlyReturnsFalseUntilSet.java | 96 +-
.../jdo/tck/transactions/GetSynchronization.java | 192 +-
.../org/apache/jdo/tck/transactions/IsActive.java | 133 +-
.../IsActiveUntilAfterCompletionMethodCalled.java | 202 +-
.../org/apache/jdo/tck/transactions/Rollback.java | 252 +-
.../jdo/tck/transactions/SetIsolationLevel.java | 263 +-
.../tck/transactions/SetNontransactionalRead.java | 252 +-
...ntransactionalReadCalledDuringTxCompletion.java | 214 +-
...etNontransactionalReadTrueWhenNotSupported.java | 115 +-
...transactionalWriteCalledDuringTxCompletion.java | 216 +-
.../apache/jdo/tck/transactions/SetOptimistic.java | 175 +-
.../SetOptimisticCalledDuringTxCompletion.java | 210 +-
.../SetOptimisticDuringTransaction.java | 142 +-
.../SetOptimisticTrueWhenNotSupported.java | 110 +-
.../jdo/tck/transactions/SetRetainValues.java | 110 +-
.../SetRetainValuesCalledDuringTxCompletion.java | 208 +-
.../SetRetainValuesTrueWhenNotSupported.java | 115 +-
.../jdo/tck/transactions/SetSynchronization.java | 179 +-
.../tck/transactions/SetSynchronizationToNull.java | 149 +-
.../WhenNontransactionalReadIsFalse.java | 220 +-
.../apache/jdo/tck/util/BatchResultPrinter.java | 422 +-
.../org/apache/jdo/tck/util/BatchTestRunner.java | 574 +-
.../org/apache/jdo/tck/util/ClassGenerator.java | 1377 ++---
.../org/apache/jdo/tck/util/ConsoleFileOutput.java | 108 +-
.../org/apache/jdo/tck/util/ConversionHelper.java | 250 +-
.../java/org/apache/jdo/tck/util/DeepEquality.java | 93 +-
.../org/apache/jdo/tck/util/EqualityHelper.java | 1676 +++---
.../apache/jdo/tck/util/GetSupportedOptions.java | 46 +-
.../jdo/tck/util/IntegerToStringConverter.java | 107 +-
.../apache/jdo/tck/util/JDOCustomDateEditor.java | 10 +-
.../org/apache/jdo/tck/util/JDOJdk14Logger.java | 135 +-
.../jdo/tck/util/PointToStringConverter.java | 138 +-
.../org/apache/jdo/tck/util/ResultSummary.java | 348 +-
.../java/org/apache/jdo/tck/util/RogueBarrier.java | 269 +-
.../org/apache/jdo/tck/util/SystemCfgSummary.java | 133 +-
.../org/apache/jdo/tck/util/TCKFileHandler.java | 558 +-
.../jdo/tck/util/ThreadExceptionHandler.java | 101 +-
.../apache/jdo/tck/util/signature/Formatter.java | 287 +-
.../jdo/tck/util/signature/SignatureVerifier.java | 3402 +++++------
.../apache/jdo/tck/util/signature/TypeHelper.java | 433 +-
1114 files changed, 173797 insertions(+), 168862 deletions(-)
diff --git a/api/src/main/java/javax/jdo/AttributeConverter.java b/api/src/main/java/javax/jdo/AttributeConverter.java
index 61e3dcfe..ea94c3a1 100644
--- a/api/src/main/java/javax/jdo/AttributeConverter.java
+++ b/api/src/main/java/javax/jdo/AttributeConverter.java
@@ -17,44 +17,50 @@
package javax.jdo;
/**
- * Converts persistent attribute values (fields or properties) to different
- * values stored in the underlying datastore and vice versa.
- * [TBD:
+ * Converts persistent attribute values (fields or properties) to different values stored in the
+ * underlying datastore and vice versa. [TBD:
+ *
* <ul>
- * <li>should we require that converters need access to any other information, e.g metadata? passed into the constructor</li>
- * <li>otherwise we assume there is a default constructor, and is instantiable using the current JDO class loader(s)</li>
- * </ul>]
- *
+ * <li>should we require that converters need access to any other information, e.g metadata?
+ * passed into the constructor
+ * <li>otherwise we assume there is a default constructor, and is instantiable using the current
+ * JDO class loader(s)
+ * </ul>
+ *
+ * ]
+ *
* @param <A> The type of persistent attribute (field or property).
* @param <D> The type to be used in the datastore.
*/
public interface AttributeConverter<A, D> {
- /**
- * Converts the given persistent attribute value to its representation in the datastore.
- * @param attributeValue Value of attribute
- * @return Value in datastore
- */
- D convertToDatastore(A attributeValue);
+ /**
+ * Converts the given persistent attribute value to its representation in the datastore.
+ *
+ * @param attributeValue Value of attribute
+ * @return Value in datastore
+ */
+ D convertToDatastore(A attributeValue);
- /**
- * Converts the given datastore value to its representation as a persistent attribute.
- * @param datastoreValue Value in datastore
- * @return Value in attribute
- */
- A convertToAttribute(D datastoreValue);
+ /**
+ * Converts the given datastore value to its representation as a persistent attribute.
+ *
+ * @param datastoreValue Value in datastore
+ * @return Value in attribute
+ */
+ A convertToAttribute(D datastoreValue);
- /**
- * Dummy converter to represent "use the implementation default for this type" when using annotations.
- */
- public static class UseDefault implements AttributeConverter<Object, Object>
- {
- public Object convertToDatastore(Object attributeValue) {
- throw new JDOUserException("This converter is not usable.");
- }
+ /**
+ * Dummy converter to represent "use the implementation default for this type" when using
+ * annotations.
+ */
+ public static class UseDefault implements AttributeConverter<Object, Object> {
+ public Object convertToDatastore(Object attributeValue) {
+ throw new JDOUserException("This converter is not usable.");
+ }
- public Object convertToAttribute(Object datastoreValue) {
- throw new JDOUserException("This converter is not usable.");
- }
- }
+ public Object convertToAttribute(Object datastoreValue) {
+ throw new JDOUserException("This converter is not usable.");
+ }
+ }
}
diff --git a/api/src/main/java/javax/jdo/Constants.java b/api/src/main/java/javax/jdo/Constants.java
index 18169f3b..8f4a69ce 100644
--- a/api/src/main/java/javax/jdo/Constants.java
+++ b/api/src/main/java/javax/jdo/Constants.java
@@ -25,1072 +25,941 @@ package javax.jdo;
*/
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 <code>META-INF/services/javax.jdo.PersistenceManagerFactory</code>.
- *
- * @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 <code>META-INF/services/javax.jdo.JDOEnhancer</code>.
- * @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 <code>META-INF/jdoconfig.xml</code>.
- *
- * @since 2.1
- */
- static String JDOCONFIG_RESOURCE_NAME
- = "META-INF/jdoconfig.xml";
-
- /**
- * The standard JDO configuration schema namespace.
- * Constant value is <code>https://db.apache.org/jdo/xmlns/jdoconfig</code>.
- *
- * @since 2.1
- */
- static String JDOCONFIG_XSD_NS
- = "https://db.apache.org/jdo/xmlns/jdoconfig";
-
- /**
- * The standard JDO metadata schema namespace.
- * Constant value is <code>https://db.apache.org/jdo/xmlns/jdo</code>.
- *
- * @since 2.1
- */
- static String JDO_XSD_NS
- = "https://db.apache.org/jdo/xmlns/jdo";
-
- /**
- * The standard JDO object-repository mapping schema namespace.
- * Constant value is <code>https://db.apache.org/jdo/xmlns/orm</code>.
- *
- * @since 2.1
- */
- static String ORM_XSD_NS
- = "https://db.apache.org/jdo/xmlns/orm";
-
- /**
- * The standard JDO query schema namespace.
- * Constant value is <code>https://db.apache.org/jdo/xmlns/jdoquery</code>.
- *
- * @since 2.1
- */
- static String JDOQUERY_XSD_NS
- = "https://db.apache.org/jdo/xmlns/jdoquery";
-
- /**
- * The name of the persistence manager factory element in the JDO
- * configuration file.
- * Constant value is <code>persistence-manager-factory</code>.
- *
- * @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.query.JDOQL.BitwiseOperations"
- * @see PersistenceManagerFactory#supportedOptions()
- * @since 3.2
- */
- static String OPTION_QUERY_JDOQL_BITWISE_OPERATIONS = "javax.jdo.query.JDOQL.BitwiseOperations";
-
- /**
- * "javax.jdo.query.JDOQL.UnconstrainedQueryVariables"
- * @see PersistenceManagerFactory#supportedOptions()
- * @since 2.1
- */
- static String OPTION_UNCONSTRAINED_QUERY_VARIABLES = "javax.jdo.query.JDOQL.UnconstrainedQueryVariables";
-
- /**
- * "javax.jdo.option.DatastoreTimeout"
- *
- * @see PersistenceManagerFactory#supportedOptions()
- * @since 3.0
- */
- static String OPTION_DATASTORE_TIMEOUT
- = "javax.jdo.option.DatastoreTimeout";
- /**
- * "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"
- * This property might be ignored by the JDO implementation
- * because the JDBC DriverManager handles the driver name.
- * @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.spi.PropertiesFileName"
- *
- * @since 3.2
- */
- static String PROPERTY_SPI_PROPERTIES_FILE_NAME
- = "javax.jdo.spi.PropertiesFileName";
-
- /**
- * "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 <code>InstanceLifecycleListener</code> 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.<br>
- * For example,<br>
- * <code>javax.jdo.option.InstanceLifecycleListener.com.example.MyListener=com.example.Foo,com.example.Bar</code><br>
- * is equivalent to calling<br>
- * <code>pmf.addInstanceLifecycleListener(new com.example.MyListener(), new Class[] {com.example.Foo.class, com.example.Bar.class});</code><br>
- * where <code>pmf</code> is an instance of type
- * <code>PersistenceManagerFactory</code>.
- *
- * @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";
+ /**
+ * 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 <code>
+ * META-INF/services/javax.jdo.PersistenceManagerFactory</code>.
+ *
+ * @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 <code>
+ * META-INF/services/javax.jdo.JDOEnhancer</code>.
+ *
+ * @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 <code>
+ * META-INF/jdoconfig.xml</code>.
+ *
+ * @since 2.1
+ */
+ static String JDOCONFIG_RESOURCE_NAME = "META-INF/jdoconfig.xml";
+
+ /**
+ * The standard JDO configuration schema namespace. Constant value is <code>
+ * https://db.apache.org/jdo/xmlns/jdoconfig</code>.
+ *
+ * @since 2.1
+ */
+ static String JDOCONFIG_XSD_NS = "https://db.apache.org/jdo/xmlns/jdoconfig";
+
+ /**
+ * The standard JDO metadata schema namespace. Constant value is <code>
+ * https://db.apache.org/jdo/xmlns/jdo</code>.
+ *
+ * @since 2.1
+ */
+ static String JDO_XSD_NS = "https://db.apache.org/jdo/xmlns/jdo";
+
+ /**
+ * The standard JDO object-repository mapping schema namespace. Constant value is <code>
+ * https://db.apache.org/jdo/xmlns/orm</code>.
+ *
+ * @since 2.1
+ */
+ static String ORM_XSD_NS = "https://db.apache.org/jdo/xmlns/orm";
+
+ /**
+ * The standard JDO query schema namespace. Constant value is <code>
+ * https://db.apache.org/jdo/xmlns/jdoquery</code>.
+ *
+ * @since 2.1
+ */
+ static String JDOQUERY_XSD_NS = "https://db.apache.org/jdo/xmlns/jdoquery";
+
+ /**
+ * The name of the persistence manager factory element in the JDO configuration file. Constant
+ * value is <code>persistence-manager-factory</code>.
+ *
+ * @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.query.JDOQL.BitwiseOperations"
+ *
+ * @see PersistenceManagerFactory#supportedOptions()
+ * @since 3.2
+ */
+ static String OPTION_QUERY_JDOQL_BITWISE_OPERATIONS = "javax.jdo.query.JDOQL.BitwiseOperations";
+
+ /**
+ * "javax.jdo.query.JDOQL.UnconstrainedQueryVariables"
+ *
+ * @see PersistenceManagerFactory#supportedOptions()
+ * @since 2.1
+ */
+ static String OPTION_UNCONSTRAINED_QUERY_VARIABLES =
+ "javax.jdo.query.JDOQL.UnconstrainedQueryVariables";
+
+ /**
+ * "javax.jdo.option.DatastoreTimeout"
+ *
+ * @see PersistenceManagerFactory#supportedOptions()
+ * @since 3.0
+ */
+ static String OPTION_DATASTORE_TIMEOUT = "javax.jdo.option.DatastoreTimeout";
+ /**
+ * "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 static final String PROPERTY_ENHANCER_VENDOR_NAME = "VendorName";
+
+ /**
+ * "VersionNumber"
+ *
+ * @see JDOEnhancer#getProperties()
+ * @since 3.0
+ */
+ public static final String PROPERTY_ENHANCER_VERSION_NUMBER = "VersionNumber";
+
+ /**
+ * Exit value for no enhancer found
+ *
+ * @since 3.0
+ */
+ public static final int ENHANCER_NO_JDO_ENHANCER_FOUND = 2;
+
+ /**
+ * Exit value for usage error
+ *
+ * @since 3.0
+ */
+ public static final int ENHANCER_USAGE_ERROR = 3;
+
+ /**
+ * Exit value for an exception from the JDOEnhancer
+ *
+ * @since 3.0
+ */
+ public static final 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" This property might be ignored by the JDO
+ * implementation because the JDBC DriverManager handles the driver name.
+ *
+ * @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.spi.PropertiesFileName"
+ *
+ * @since 3.2
+ */
+ static String PROPERTY_SPI_PROPERTIES_FILE_NAME = "javax.jdo.spi.PropertiesFileName";
+
+ /**
+ * "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 <code>InstanceLifecycleListener</code> 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.<br>
+ * For example,<br>
+ * <code>
+ * javax.jdo.option.InstanceLifecycleListener.com.example.MyListener=com.example.Foo,com.example.Bar
+ * </code><br>
+ * is equivalent to calling<br>
+ * <code>
+ * pmf.addInstanceLifecycleListener(new com.example.MyListener(), new Class[] {com.example.Foo.class, com.example.Bar.class});
+ * </code><br>
+ * where <code>pmf</code> is an instance of type <code>PersistenceManagerFactory</code>.
+ *
+ * @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";
}
diff --git a/api/src/main/java/javax/jdo/Enhancer.java b/api/src/main/java/javax/jdo/Enhancer.java
index 19d14ec2..be8104cc 100644
--- a/api/src/main/java/javax/jdo/Enhancer.java
+++ b/api/src/main/java/javax/jdo/Enhancer.java
@@ -38,419 +38,440 @@ 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:
+ * Main class to invoke a JDO Enhancer. The enhancer is invoked with the following command line:
+ *
* <pre>
* java -cp {classpath} javax.jdo.Enhancer {options} {directory, file, or resource names}
* </pre>
- * <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:
- * <ul><li>? : print usage to stderr and exit
- * </li><li>-h : print usage to stderr and exit
- * </li><li>-help : print usage to stderr and exit
- * </li><li>-pu <persistence-unit-name> : the name of a persistence unit
- * </li><li>-d <target directory> : write the enhanced classes to the specified directory
- * </li><li>-checkonly : just check the classes for enhancement status
- * </li><li>-v : verbose output
- * </li><li>-r : recurse through directories to find all classes and metadata files to enhance
- * </li><li>-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
- * </li></ul><directory, file, or resource names>
- * <ul><li>Directory names must not end in ".jdo", ".jar", or ".class"
- * </li><li>Directories will be searched for files with suffixes ".jdo", ".jar", and ".class"
- * </li><li>Directories will be searched recursively if the -r option is set
- * </li></ul>
- *
+ *
+ * <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.
+ *
+ * <p><options> include:
+ *
+ * <ul>
+ * <li>? : print usage to stderr and exit
+ * <li>-h : print usage to stderr and exit
+ * <li>-help : print usage to stderr and exit
+ * <li>-pu <persistence-unit-name> : the name of a persistence unit
+ * <li>-d <target directory> : write the enhanced classes to the specified directory
+ * <li>-checkonly : just check the classes for enhancement status
+ * <li>-v : verbose output
+ * <li>-r : recurse through directories to find all classes and metadata files to enhance
+ * <li>-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
+ * </ul>
+ *
+ * <directory, file, or resource names>
+ *
+ * <ul>
+ * <li>Directory names must not end in ".jdo", ".jar", or ".class"
+ * <li>Directories will be searched for files with suffixes ".jdo", ".jar", and ".class"
+ * <li>Directories will be searched recursively if the -r option is set
+ * </ul>
+ *
* @since 3.0
*/
public class Enhancer {
- /** The Internationalization message helper. */
- private final static I18NHelper msg =
- I18NHelper.getInstance ("javax.jdo.Bundle"); //NOI18N
+ /** The Internationalization message helper. */
+ private static final 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
- /** 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;
- /** Error indicator */
- private boolean error = false;
- /** If set, process parameters, print usage, and exit. */
- private boolean printAndExit = false;
+ /** Persistence Units */
+ private List<String> persistenceUnitNames = new ArrayList<String>();
+ /** 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<String> fileNames = new ArrayList<String>();
+ /** Class File Names */
+ private List<String> classFileNames = new ArrayList<String>();
+ /** JDO File Names */
+ private List<String> jdoFileNames = new ArrayList<String>();
+ /** Jar File Names */
+ private List<String> jarFileNames = new ArrayList<String>();
+ /** The number of classes validated by the JDOEnhancer */
+ private int numberOfValidatedClasses = 0;
+ /** The number of classes enhanced by the JDOEnhancer */
+ private int numberOfEnhancedClasses = 0;
- /** Persistence Units */
- private List<String> persistenceUnitNames = new ArrayList<String>();
- /** 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<String> fileNames = new ArrayList<String>();
- /** Class File Names */
- private List<String> classFileNames = new ArrayList<String>();
- /** JDO File Names */
- private List<String> jdoFileNames = new ArrayList<String>();
- /** Jar File Names */
- private List<String> jarFileNames = new ArrayList<String>();
- /** 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;
- /** 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);
+ }
- /** 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);
}
- /** 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<Entry<Object, Object>> props = properties.entrySet();
+ Iterator<Entry<Object, Object>> entries = props.iterator();
+ while (entries.hasNext()) {
+ Entry<Object, Object> 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);
+ }
- 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<Entry<Object, Object>> props = properties.entrySet();
- Iterator<Entry<Object, Object>> entries = props.iterator();
- while (entries.hasNext()) {
- Entry<Object, Object> 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
+ 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
- }
+ /**
+ * 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<String>();
- 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;
+ /**
+ * 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<String>();
+ 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();
}
- 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 if ("cp".equals(option)) { // NOI18N
+ if (hasNextArgument("MSG_EnhancerProcessing", "-cp", i, args.length)) { // NOI18N
+ classPath = args[++i];
+ addVerboseMessage("MSG_EnhancerClassPath", classPath); // NOI18N
} else {
- fileNames.add(arg);
+ setError();
}
- }
- }
-
- /** 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) {
+ } 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(msgId, where));
- addErrorMessage(msg.msg("ERR_EnhancerRequiredArgumentMissing")); //NOI18N
- return false;
+ addErrorMessage(msg.msg("ERR_EnhancerUnrecognizedOption", option)); // NOI18N
+ }
+ } else {
+ doneWithOptions = true;
+ fileNames.add(arg);
}
- return true;
+ } else {
+ fileNames.add(arg);
+ }
}
+ }
- /**
- * Files can be one of four types:
- * <ol><li>directory: the directory is examined for files of the following types
- * </li><li>.class: this is a java class file
- * </li><li>.jdo: this is a jdo metadata file
- * </li><li>.jar: this is a jar file
- * </li></ol>
- * 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);
- }
- }
- }
- }
- }
+ /**
+ * 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;
+ }
- /** 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<URL> urls = new ArrayList<URL>();
- 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));
+ /**
+ * Files can be one of four types:
+ *
+ * <ol>
+ * <li>directory: the directory is examined for files of the following types
+ * <li>.class: this is a java class file
+ * <li>.jdo: this is a jdo metadata file
+ * <li>.jar: this is a jar file
+ * </ol>
+ *
+ * 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);
}
+ }
}
- 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);
+ /**
+ * 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<URL> urls = new ArrayList<URL>();
+ 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;
+ }
- /** Set the error flag.
- *
- */
- private void setError() {
- error = true;
- }
+ /**
+ * 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 print-and-exit flag.
- *
- */
- private void setPrintAndExit() {
- printAndExit = true;
- }
+ /** Set the error flag. */
+ private void setError() {
+ error = 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);
- }
+ /** Set the print-and-exit flag. */
+ private void setPrintAndExit() {
+ printAndExit = true;
+ }
- /** 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);
- }
+ /**
+ * 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, 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, int where) {
- addVerboseMessage(msgId, String.valueOf(where));
- }
+ /**
+ * 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));
+ }
}
diff --git a/api/src/main/java/javax/jdo/Extent.java b/api/src/main/java/javax/jdo/Extent.java
index 120200f3..573cdcf7 100644
--- a/api/src/main/java/javax/jdo/Extent.java
+++ b/api/src/main/java/javax/jdo/Extent.java
@@ -5,13 +5,13 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
* limitations under the License.
*/
@@ -25,75 +25,90 @@ package javax.jdo;
import java.lang.Iterable;
import java.util.Iterator;
-/** Instances of the <code>Extent</code> class represent the entire collection
- * of instances in the data store of the candidate class or interface
- * possibly including its subclasses or subinterfaces.
- * <P>The <code>Extent</code> instance has two possible uses:
+/**
+ * Instances of the <code>Extent</code> class represent the entire collection of instances in the
+ * data store of the candidate class or interface possibly including its subclasses or
+ * subinterfaces.
+ *
+ * <p>The <code>Extent</code> instance has two possible uses:
+ *
* <ol>
- * <li>to iterate all instances of a particular class or interface
- * <li>to execute a <code>Query</code> in the data store over all instances
- * of a particular class or interface
+ * <li>to iterate all instances of a particular class or interface
+ * <li>to execute a <code>Query</code> in the data store over all instances of a particular class
+ * or interface
* </ol>
+ *
* @version 2.1
*/
public interface Extent<E> extends Iterable<E>, AutoCloseable {
-
- /** Returns an iterator over all the instances in the <code>Extent</code>.
- * The behavior of the returned iterator might depend on the setting of the
- * <code>ignoreCache</code> flag in the owning <code>PersistenceManager</code>.
- * @return an iterator over all instances in the <code>Extent</code>
- */
- Iterator<E> iterator();
- /** Returns whether this <code>Extent</code> was defined to contain subclasses.
- * @return true if this <code>Extent</code> was defined to contain instances
- * that are of a subclass type.
- */
- boolean hasSubclasses();
+ /**
+ * Returns an iterator over all the instances in the <code>Extent</code>. The behavior of the
+ * returned iterator might depend on the setting of the <code>ignoreCache</code> flag in the
+ * owning <code>PersistenceManager</code>.
+ *
+ * @return an iterator over all instances in the <code>Extent</code>
+ */
+ Iterator<E> iterator();
- /** An <code>Extent</code> contains all instances of a particular class
- * or interface in the data
- * store; this method returns the <code>Class</code> of the instances
- * represented by this Extent.
- * @return the <code>Class</code> of instances of this <code>Extent</code>.
- */
- Class<E> getCandidateClass();
+ /**
+ * Returns whether this <code>Extent</code> was defined to contain subclasses.
+ *
+ * @return true if this <code>Extent</code> was defined to contain instances that are of a
+ * subclass type.
+ */
+ boolean hasSubclasses();
- /** An <code>Extent</code> is managed by a <code>PersistenceManager</code>;
- * this method gives access to the owning <code>PersistenceManager</code>.
- * @return the owning <code>PersistenceManager</code>
- */
- PersistenceManager getPersistenceManager();
-
- /** Close all <code>Iterator</code>s associated with this <code>Extent</code> instance.
- * <code>Iterator</code>s closed by this method will return <code>false</code>
- * to <code>hasNext()</code> and will throw
- * <code>NoSuchElementException</code> on <code>next()</code>.
- * The <code>Extent</code> instance can still be used
- * as a parameter of <code>Query.setExtent</code>, and to get an <code>Iterator</code>.
- */
- void closeAll ();
-
- /** Close an <code>Iterator</code> associated with this <code>Extent</code> instance.
- * <code>Iterator</code>s closed by this method will return <code>false</code>
- * to <code>hasNext()</code> and will throw <code>NoSuchElementException</code>
- * on <code>next()</code>. The <code>Extent</code> instance can still be used
- * as a parameter of <code>Query.setExtent</code>, and to get an <code>Iterator</code>.
- * @param it an <code>Iterator</code> obtained by the method
- * <code>iterator()</code> on this <code>Extent</code> instance.
- */
- void close (Iterator<E> it);
+ /**
+ * An <code>Extent</code> contains all instances of a particular class or interface in the data
+ * store; this method returns the <code>Class</code> of the instances represented by this Extent.
+ *
+ * @return the <code>Class</code> of instances of this <code>Extent</code>.
+ */
+ Class<E> getCandidateClass();
- /**
- * Don't use this method directly; use <code>closeAll()</code> instead. It is intended for use with try-with-resources.
- * @throws Exception if this resource cannot be closed
- */
- void close() throws Exception;
+ /**
+ * An <code>Extent</code> is managed by a <code>PersistenceManager</code>; this method gives
+ * access to the owning <code>PersistenceManager</code>.
+ *
+ * @return the owning <code>PersistenceManager</code>
+ */
+ PersistenceManager getPersistenceManager();
- /** Get the fetch plan associated with this Extent.
- * @return the fetch plan
- * @since 2.0
- */
- FetchPlan getFetchPlan();
-}
+ /**
+ * Close all <code>Iterator</code>s associated with this <code>Extent</code> instance. <code>
+ * Iterator</code>s closed by this method will return <code>false</code> to <code>hasNext()</code>
+ * and will throw <code>NoSuchElementException</code> on <code>next()</code>. The <code>Extent
+ * </code> instance can still be used as a parameter of <code>Query.setExtent</code>, and to get
+ * an <code>Iterator</code>.
+ */
+ void closeAll();
+
+ /**
+ * Close an <code>Iterator</code> associated with this <code>Extent</code> instance. <code>
+ * Iterator</code>s closed by this method will return <code>false</code> to <code>hasNext()</code>
+ * and will throw <code>NoSuchElementException</code> on <code>next()</code>. The <code>Extent
+ * </code> instance can still be used as a parameter of <code>Query.setExtent</code>, and to get
+ * an <code>Iterator</code>.
+ *
+ * @param it an <code>Iterator</code> obtained by the method <code>iterator()</code> on this
+ * <code>Extent</code> instance.
+ */
+ void close(Iterator<E> it);
+ /**
+ * Don't use this method directly; use <code>closeAll()</code> instead. It is intended for use
+ * with try-with-resources.
+ *
+ * @throws Exception if this resource cannot be closed
+ */
+ void close() throws Exception;
+
+ /**
+ * Get the fetch plan associated with this Extent.
+ *
+ * @return the fetch plan
+ * @since 2.0
+ */
+ FetchPlan getFetchPlan();
+}
diff --git a/api/src/main/java/javax/jdo/FetchGroup.java b/api/src/main/java/javax/jdo/FetchGroup.java
index ca4d2ace..2e7827bc 100644
--- a/api/src/main/java/javax/jdo/FetchGroup.java
+++ b/api/src/main/java/javax/jdo/FetchGroup.java
@@ -5,13 +5,13 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
* limitations under the License.
*/
@@ -19,265 +19,269 @@
* 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.
- * <p>
- * 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}.
- * <p>
- * 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.
- * <ul><li>When a FetchGroup is obtained via
- * {@link PersistenceManager#getFetchGroup},
- * it is immediately in scope of its <code>PersistenceManager</code>.
- * Subsequent modifications of the FetchGroup
- * immediately affect <code>FetchPlan</code>s that contain the
- * <code>FetchGroup</code>.
- * </li><li>When a FetchGroup is obtained via
- * {@link PersistenceManagerFactory#getFetchGroup}, it is unscoped.
- * </li><li>When a FetchGroup is added to the set of active FetchGroups via
- * {@link PersistenceManagerFactory#addFetchGroups}, it is put in scope of the
- * <code>PersistenceManagerFactory</code>.
- * </li><li>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.
- * </li></ul>
+ * 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.
+ *
+ * <p>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}.
+ *
+ * <p>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.
+ *
+ * <ul>
+ * <li>When a FetchGroup is obtained via {@link PersistenceManager#getFetchGroup}, it is
+ * immediately in scope of its <code>PersistenceManager</code>. Subsequent modifications of
+ * the FetchGroup immediately affect <code>FetchPlan</code>s that contain the <code>FetchGroup
+ * </code>.
+ * <li>When a FetchGroup is obtained via {@link PersistenceManagerFactory#getFetchGroup}, it is
+ * unscoped.
+ * <li>When a FetchGroup is added to the set of active FetchGroups via {@link
+ * PersistenceManagerFactory#addFetchGroups}, it is put in scope of the <code>
+ * PersistenceManagerFactory</code>.
+ * <li>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.
+ * </ul>
+ *
* @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.
- * <p>
- * Using this category also sets the fetch-depth for the members in the
- * default fetch group.</p>
- * @since 2.2
- */
- public static final String DEFAULT = "default";
+ /**
+ * 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.
+ *
+ * <p>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 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 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
+ * 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.
- * <p>
- * Using this category also sets the fetch-depth for the members in the
- * default fetch group.</p>
- * @since 2.2
- */
- public static final String ALL = "all";
+ /**
+ * For use with {@link #addCategory} and {@link #removeCategory} calls. This category includes all
+ * members in the persistent type.
+ *
+ * <p>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 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);
+ /**
+ * 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 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 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();
+ /**
+ * 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.
- * @param postLoad Whether to post load this fetch group
- * @return the FetchGroup
- * @throws JDOUserException if the FetchGroup is unmodifiable
- * @since 2.2
- */
- FetchGroup setPostLoad(boolean postLoad);
+ /**
+ * Set the post-load property of this FetchGroup.
+ *
+ * @param postLoad Whether to post load this fetch group
+ * @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.
+ *
+ * @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);
+ /**
+ * 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.
- * @param memberName Name of the member of the class to remove from 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 removeMember(String memberName);
+ /**
+ * Remove the member (field or property) from the set of members in this FetchGroup.
+ *
+ * @param memberName Name of the member of the class to remove from 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 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.
- * @param memberNames Member names of the class to remove from this 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 removeMembers(String... memberNames);
+ /**
+ * 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.
+ *
+ * @param memberNames Member names of the class to remove from this 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 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.
- * @param categoryName Category to add to this FetchGroup.
- * @return the FetchGroup
- * @throws JDOUserException if the FetchGroup is unmodifiable
- * @since 2.2
- */
- FetchGroup addCategory(String categoryName);
+ /**
+ * 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.
+ *
+ * @param categoryName Category to add to this FetchGroup.
+ * @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.
- * @param categoryName Category to remove from this FetchGroup.
- * @return the FetchGroup
- * @throws JDOUserException if the FetchGroup is unmodifiable
- * @since 2.2
- */
- FetchGroup removeCategory(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.
+ *
+ * @param categoryName Category to remove from this FetchGroup.
+ * @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);
+ /**
+ * 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);
+ /**
+ * 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();
+ /**
+ * 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();
+ /**
+ * 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();
+ /**
+ * 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();
}
diff --git a/api/src/main/java/javax/jdo/FetchPlan.java b/api/src/main/java/javax/jdo/FetchPlan.java
index 85ea6722..0548b5cd 100644
--- a/api/src/main/java/javax/jdo/FetchPlan.java
+++ b/api/src/main/java/javax/jdo/FetchPlan.java
@@ -5,13 +5,13 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
* limitations under the License.
*/
@@ -19,211 +19,221 @@
* 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 <code>Query</code> or
- * <code>Extent</code> is retrieved from a
- * <code>PersistenceManager</code>, its <code>FetchPlan</code> is
- * initialized to the same settings as that of the
- * <code>PersistenceManager</code>. Subsequent modifications of the
- * <code>Query</code> or <code>Extent</code>'s <code>FetchPlan</code>
- * are not reflected in the <code>FetchPlan</code> of the
- * <code>PersistenceManager</code>.
+ * 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 <code>Query</code> or <code>Extent</code> is retrieved from a <code>
+ * PersistenceManager</code>, its <code>FetchPlan</code> is initialized to the same settings as that
+ * of the <code>PersistenceManager</code>. Subsequent modifications of the <code>Query</code> or
+ * <code>Extent</code>'s <code>FetchPlan</code> are not reflected in the <code>FetchPlan</code> of
+ * the <code>PersistenceManager</code>.
+ *
* @version 2.0
* @since 2.0
*/
public interface FetchPlan {
- /**
- * For use with {@link #addGroup}, {@link #removeGroup}, and the
- * various {@link #setGroups} calls. Value: <code>default</code>.
- * @since 2.0
- */
- public static final String DEFAULT = "default";
-
- /**
- * For use with {@link #addGroup}, {@link #removeGroup}, and the
- * various {@link #setGroups} calls. Value: <code>all</code>.
- * @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.
- * @param fetchGroupName Name of the FetchGroup to add
- * @return the FetchPlan
- * @since 2.0
- */
- FetchPlan addGroup(String fetchGroupName);
-
- /**
- * Remove the fetch group from the set active fetch groups.
- * @param fetchGroupName Name of the FetchGroup to remove
- * @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.
- * @return This FetchPlan
- * @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.
- * @return This FetchPlan
- * @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}.
- * @param options Options for use during detachment.
- * @return This FetchPlan
- */
- FetchPlan setDetachmentOptions(int options);
-
- /**
- * Get options used during detachment.
- * @return Options to use during detachment.
- */
- int getDetachmentOptions();
-
+ /**
+ * For use with {@link #addGroup}, {@link #removeGroup}, and the various {@link #setGroups} calls.
+ * Value: <code>default</code>.
+ *
+ * @since 2.0
+ */
+ public static final String DEFAULT = "default";
+
+ /**
+ * For use with {@link #addGroup}, {@link #removeGroup}, and the various {@link #setGroups} calls.
+ * Value: <code>all</code>.
+ *
+ * @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.
+ *
+ * @param fetchGroupName Name of the FetchGroup to add
+ * @return the FetchPlan
+ * @since 2.0
+ */
+ FetchPlan addGroup(String fetchGroupName);
+
+ /**
+ * Remove the fetch group from the set active fetch groups.
+ *
+ * @param fetchGroupName Name of the FetchGroup to remove
+ * @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.
+ * @return This FetchPlan
+ * @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.
+ * @return This FetchPlan
+ * @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}.
+ *
+ * @param options Options for use during detachment.
+ * @return This FetchPlan
+ */
+ FetchPlan setDetachmentOptions(int options);
+
+ /**
+ * Get options used during detachment.
+ *
+ * @return Options to use during detachment.
+ */
+ int getDetachmentOptions();
}
-
diff --git a/api/src/main/java/javax/jdo/InstanceCallbacks.java b/api/src/main/java/javax/jdo/InstanceCallbacks.java
index 640e963e..2aad32ab 100644
--- a/api/src/main/java/javax/jdo/InstanceCallbacks.java
+++ b/api/src/main/java/javax/jdo/InstanceCallbacks.java
@@ -5,13 +5,13 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
* limitations under the License.
*/
@@ -19,53 +19,44 @@
* InstanceCallbacks.java
*
*/
-
+
package javax.jdo;
-/** A <code>PersistenceCapable</code> class that provides callback methods for life
- * cycle events implements this interface.
+/**
+ * A <code>PersistenceCapable</code> class that provides callback methods for life cycle events
+ * implements this interface.
*
- * <P>For JDO 2.0, <code>InstanceCallbacks</code> 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 <code>InstanceCallbacks</code> interface is preserved.
+ * <p>For JDO 2.0, <code>InstanceCallbacks</code> 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 <code>InstanceCallbacks
+ * </code> interface is preserved.
*
- * <P>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.
+ * <p>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.
*
- * <P>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.
+ * <p>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.
*
- * <P>To implement this, the application programmer would implement
- * <code>jdoPostLoad</code> to put itself into the list of managed
- * instances, and implement <code>jdoPreClear</code> to remove itself from
- * the list. With JDO 1.0, the domain class would be declared to implement
- * <code>InstanceCallbacks</code>. With JDO 2.0, the domain class
- * would be declared to implement
- * <code>javax.jdo.listener.LoadCallback</code> and
- * <code>javax.jdo.listener.ClearCallback</code>.
+ * <p>To implement this, the application programmer would implement <code>jdoPostLoad</code> to put
+ * itself into the list of managed instances, and implement <code>jdoPreClear</code> to remove
+ * itself from the list. With JDO 1.0, the domain class would be declared to implement <code>
+ * InstanceCallbacks</code>. With JDO 2.0, the domain class would be declared to implement <code>
+ * javax.jdo.listener.LoadCallback</code> and <code>javax.jdo.listener.ClearCallback</code>.
*
- * <P>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.
+ * <p>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,
+public interface InstanceCallbacks
+ extends javax.jdo.listener.ClearCallback,
javax.jdo.listener.DeleteCallback,
javax.jdo.listener.LoadCallback,
- javax.jdo.listener.StoreCallback {
-}
+ javax.jdo.listener.StoreCallback {}
diff --git a/api/src/main/java/javax/jdo/JDOCanRetryException.java b/api/src/main/java/javax/jdo/JDOCanRetryException.java
index 8296fc39..59d10e5a 100644
--- a/api/src/main/java/javax/jdo/JDOCanRetryException.java
+++ b/api/src/main/java/javax/jdo/JDOCanRetryException.java
@@ -5,13 +5,13 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
* limitations under the License.
*/
@@ -22,74 +22,81 @@
package javax.jdo;
-/** This is the base class for exceptions that can be retried.
+/**
+ * This is the base class for exceptions that can be retried.
*
* @version 1.0
*/
public class JDOCanRetryException extends JDOException {
- private static final long serialVersionUID = 3046202905626157173L;
+ private static final long serialVersionUID = 3046202905626157173L;
+
+ /** Constructs a new <code>JDOCanRetryException</code> without a detail message. */
+ public JDOCanRetryException() {}
+
+ /**
+ * Constructs a new <code>JDOCanRetryException</code> with the specified detail message.
+ *
+ * @param msg the detail message.
+ */
+ public JDOCanRetryException(String msg) {
+ super(msg);
+ }
+
+ /**
+ * Constructs a new <code>JDOCanRetryException</code> with the specified detail message and nested
+ * <code>Throwable</code>s.
+ *
+ * @param msg the detail message.
+ * @param nested the nested <code>Throwable[]</code>.
+ */
+ public JDOCanRetryException(String msg, Throwable[] nested) {
+ super(msg, nested);
+ }
- /**
- * Constructs a new <code>JDOCanRetryException</code> without a detail message.
- */
- public JDOCanRetryException() {
- }
+ /**
+ * Constructs a new <code>JDOCanRetryException</code> with the specified detail message and nested
+ * <code>Throwable</code>s.
+ *
+ * @param msg the detail message.
+ * @param nested the nested <code>Throwable</code>.
+ */
+ public JDOCanRetryException(String msg, Throwable nested) {
+ super(msg, nested);
+ }
- /**
- * Constructs a new <code>JDOCanRetryException</code> with the specified detail message.
- * @param msg the detail message.
- */
- public JDOCanRetryException(String msg) {
- super(msg);
- }
+ /**
+ * Constructs a new <code>JDOCanRetryException</code> 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 <code>JDOCanRetryException</code> with the specified detail
- * message and nested <code>Throwable</code>s.
- * @param msg the detail message.
- * @param nested the nested <code>Throwable[]</code>.
- */
- public JDOCanRetryException(String msg, Throwable[] nested) {
- super(msg, nested);
- }
-
- /**
- * Constructs a new <code>JDOCanRetryException</code> with the specified detail
- * message and nested <code>Throwable</code>s.
- * @param msg the detail message.
- * @param nested the nested <code>Throwable</code>.
- */
- public JDOCanRetryException(String msg, Throwable nested) {
- super(msg, nested);
- }
-
- /** Constructs a new <code>JDOCanRetryException</code> 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 <code>JDOCanRetryException</code> with the specified detail message,
- * nested <code>Throwable</code>s, and failed object.
- * @param msg the detail message.
- * @param nested the nested <code>Throwable[]</code>.
- * @param failed the failed object.
- */
- public JDOCanRetryException(String msg, Throwable[] nested, Object failed) {
- super(msg, nested, failed);
- }
+ /**
+ * Constructs a new <code>JDOCanRetryException</code> with the specified detail message, nested
+ * <code>Throwable</code>s, and failed object.
+ *
+ * @param msg the detail message.
+ * @param nested the nested <code>Throwable[]</code>.
+ * @param failed the failed object.
+ */
+ public JDOCanRetryException(String msg, Throwable[] nested, Object failed) {
+ super(msg, nested, failed);
+ }
- /** Constructs a new <code>JDOCanRetryException</code> with the specified detail message,
- * nested <code>Throwable</code>s, and failed object.
- * @param msg the detail message.
- * @param nested the nested <code>Throwable</code>.
- * @param failed the failed object.
- */
- public JDOCanRetryException(String msg, Throwable nested, Object failed) {
- super(msg, nested, failed);
- }
+ /**
+ * Constructs a new <code>JDOCanRetryException</code> with the specified detail message, nested
+ * <code>Throwable</code>s, and failed object.
+ *
+ * @param msg the detail message.
+ * @param nested the nested <code>Throwable</code>.
+ * @param failed the failed object.
+ */
+ public JDOCanRetryException(String msg, Throwable nested, Object failed) {
+ super(msg, nested, failed);
+ }
}
diff --git a/api/src/main/java/javax/jdo/JDODataStoreException.java b/api/src/main/java/javax/jdo/JDODataStoreException.java
index 4437d10a..b08c4703 100644
--- a/api/src/main/java/javax/jdo/JDODataStoreException.java
+++ b/api/src/main/java/javax/jdo/JDODataStoreException.java
@@ -5,13 +5,13 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
* limitations under the License.
*/
@@ -22,78 +22,81 @@
package javax.jdo;
-/** This class represents data store exceptions that can be retried.
+/**
+ * This class represents data store exceptions that can be retried.
*
* @version 1.0
*/
public class JDODataStoreException extends JDOCanRetryException {
- private static final long serialVersionUID = -8728485891077403354L;
+ private static final long serialVersionUID = -8728485891077403354L;
- /**
- * Constructs a new <code>JDODataStoreException</code> without a detail message.
- */
- public JDODataStoreException() {
- }
+ /** Constructs a new <code>JDODataStoreException</code> without a detail message. */
+ public JDODataStoreException() {}
- /**
- * Constructs a new <code>JDODataStoreException</code> with the specified detail message.
- * @param msg the detail message.
- */
- public JDODataStoreException(String msg) {
- super(msg);
- }
+ /**
+ * Constructs a new <code>JDODataStoreException</code> with the specified detail message.
+ *
+ * @param msg the detail message.
+ */
+ public JDODataStoreException(String msg) {
+ super(msg);
+ }
- /**
- * Constructs a new <code>JDODataStoreException</code> with the specified
- * detail message and nested <code>Throwable</code>s.
- * @param msg the detail message.
- * @param nested the nested <code>Throwable[]</code>.
- */
- public JDODataStoreException(String msg, Throwable[] nested) {
- super(msg, nested);
- }
+ /**
+ * Constructs a new <code>JDODataStoreException</code> with the specified detail message and
+ * nested <code>Throwable</code>s.
+ *
+ * @param msg the detail message.
+ * @param nested the nested <code>Throwable[]</code>.
+ */
+ public JDODataStoreException(String msg, Throwable[] nested) {
+ super(msg, nested);
+ }
- /**
- * Constructs a new <code>JDODataStoreException</code> with the specified
- * detail message and nested <code>Throwable</code>s.
- * @param msg the detail message.
- * @param nested the nested <code>Throwable</code>.
- */
- public JDODataStoreException(String msg, Throwable nested) {
- super(msg, nested);
- }
+ /**
+ * Constructs a new <code>JDODataStoreException</code> with the specified detail message and
+ * nested <code>Throwable</code>s.
+ *
+ * @param msg the detail message.
+ * @param nested the nested <code>Throwable</code>.
+ */
+ public JDODataStoreException(String msg, Throwable nested) {
+ super(msg, nested);
+ }
- /**
- * Constructs a new <code>JDODataStoreException</code> 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 <code>JDODataStoreException</code> with the specified detail message,
- * nested <code>Throwable</code>s, and failed object.
- * @param msg the detail message.
- * @param nested the nested <code>Throwable[]</code>.
- * @param failed the failed object.
- */
- public JDODataStoreException(String msg, Throwable[] nested, Object failed) {
- super(msg, nested, failed);
- }
+ /**
+ * Constructs a new <code>JDODataStoreException</code> 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 <code>JDODataStoreException</code> with the specified detail message,
- * nested <code>Throwable</code>s, and failed object.
- * @param msg the detail message.
- * @param nested the nested <code>Throwable</code>.
- * @param failed the failed object.
- */
- public JDODataStoreException(String msg, Throwable nested, Object failed) {
- super(msg, nested, failed);
- }
-}
+ /**
+ * Constructs a new <code>JDODataStoreException</code> with the specified detail message, nested
+ * <code>Throwable</code>s, and failed object.
+ *
+ * @param msg the detail message.
+ * @param nested the nested <code>Throwable[]</code>.
+ * @param failed the failed object.
+ */
+ public JDODataStoreException(String msg, Throwable[] nested, Object failed) {
+ super(msg, nested, failed);
+ }
+ /**
+ * Constructs a new <code>JDODataStoreException</code> with the specified detail message, nested
+ * <code>Throwable</code>s, and failed object.
+ *
+ * @param msg the detail message.
+ * @param nested the nested <code>Throwable</code>.
+ * @param failed the failed object.
+ */
+ public JDODataStoreException(String msg, Throwable nested, Object failed) {
+ super(msg, nested, failed);
+ }
+}
diff --git a/api/src/main/java/javax/jdo/JDODetachedFieldAccessException.java b/api/src/main/java/javax/jdo/JDODetachedFieldAccessException.java
index 011f6cda..72fd5b2e 100644
--- a/api/src/main/java/javax/jdo/JDODetachedFieldAccessException.java
+++ b/api/src/main/java/javax/jdo/JDODetachedFieldAccessException.java
@@ -5,13 +5,13 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
* limitations under the License.
*/
@@ -22,61 +22,67 @@
package javax.jdo;
-/** This class represents exceptions caused by access of an unloaded field while
- * the instance is detached.
+/**
+ * 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 {
- private static final long serialVersionUID = 5035418119865472625L;
+ private static final long serialVersionUID = 5035418119865472625L;
+
+ /**
+ * Constructs a new <code>JDODetachedFieldAccessException</code> without a detail message.
+ *
+ * @since 2.0
+ */
+ public JDODetachedFieldAccessException() {}
- /**
- * Constructs a new <code>JDODetachedFieldAccessException</code> without a detail message.
- * @since 2.0
- */
- public JDODetachedFieldAccessException() {
- }
+ /**
+ * Constructs a new <code>JDODetachedFieldAccessException</code> with the specified detail
+ * message.
+ *
+ * @param msg the detail message.
+ * @since 2.0
+ */
+ public JDODetachedFieldAccessException(String msg) {
+ super(msg);
+ }
- /**
- * Constructs a new <code>JDODetachedFieldAccessException</code> with the
- * specified detail message.
- * @param msg the detail message.
- * @since 2.0
- */
- public JDODetachedFieldAccessException(String msg) {
- super(msg);
- }
+ /**
+ * Constructs a new <code>JDODetachedFieldAccessException</code> 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 <code>JDODetachedFieldAccessException</code>
- * 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 <code>JDODetachedFieldAccessException</code> with the
- * specified detail message and nested <code>Throwable</code>s.
- * @param msg the detail message.
- * @param nested the nested <code>Throwable[]</code>.
- * @since 2.0
- */
- public JDODetachedFieldAccessException(String msg, Throwable[] nested) {
- super(msg, nested);
- }
+ /**
+ * Constructs a new <code>JDODetachedFieldAccessException</code> with the specified detail message
+ * and nested <code>Throwable</code>s.
+ *
+ * @param msg the detail message.
+ * @param nested the nested <code>Throwable[]</code>.
+ * @since 2.0
+ */
+ public JDODetachedFieldAccessException(String msg, Throwable[] nested) {
+ super(msg, nested);
+ }
- /**
- * Constructs a new <code>JDODetachedFieldAccessException</code> with the
- * specified detail message and nested <code>Throwable</code>s.
- * @param msg the detail message.
- * @param nested the nested <code>Throwable</code>.
- * @since 2.0
- */
- public JDODetachedFieldAccessException(String msg, Throwable nested) {
- super(msg, nested);
- }
+ /**
+ * Constructs a new <code>JDODetachedFieldAccessException</code> with the specified detail message
+ * and nested <code>Throwable</code>s.
+ *
+ * @param msg the detail message.
+ * @param nested the nested <code>Throwable</code>.
+ * @since 2.0
+ */
+ public JDODetachedFieldAccessException(String msg, Throwable nested) {
+ super(msg, nested);
+ }
}
diff --git a/api/src/main/java/javax/jdo/JDOEnhanceException.java b/api/src/main/java/javax/jdo/JDOEnhanceException.java
index dc8ed535..56afd05c 100644
--- a/api/src/main/java/javax/jdo/JDOEnhanceException.java
+++ b/api/src/main/java/javax/jdo/JDOEnhanceException.java
@@ -18,49 +18,43 @@ package javax.jdo;
/**
* Exception thrown when an error occurs during enhancement.
+ *
* @since 3.0
*/
-public class JDOEnhanceException extends JDOException
-{
- private static final long serialVersionUID = 7953336394264555958L;
+public class JDOEnhanceException extends JDOException {
+ private static final long serialVersionUID = 7953336394264555958L;
- /**
- * Constructs a new <code>JDOEnhanceException</code> without a
- * detail message.
- */
- public JDOEnhanceException()
- {
- }
+ /** Constructs a new <code>JDOEnhanceException</code> without a detail message. */
+ public JDOEnhanceException() {}
- /**
- * Constructs a new <code>JDOEnhanceException</code> with the
- * specified detail message.
- * @param msg the detail message.
- */
- public JDOEnhanceException(String msg)
- {
- super(msg);
- }
+ /**
+ * Constructs a new <code>JDOEnhanceException</code> with the specified detail message.
+ *
+ * @param msg the detail message.
+ */
+ public JDOEnhanceException(String msg) {
+ super(msg);
+ }
- /**
- * Constructs a new <code>JDOEnhanceException</code> with the
- * specified detail message and nested <code>Throwable</code>s.
- * @param msg the detail message.
- * @param nested the nested <code>Throwable[]</code>.
- */
- public JDOEnhanceException(String msg, Throwable[] nested)
- {
- super(msg, nested);
- }
+ /**
+ * Constructs a new <code>JDOEnhanceException</code> with the specified detail message and nested
+ * <code>Throwable</code>s.
+ *
+ * @param msg the detail message.
+ * @param nested the nested <code>Throwable[]</code>.
+ */
+ public JDOEnhanceException(String msg, Throwable[] nested) {
+ super(msg, nested);
+ }
- /**
- * Constructs a new <code>JDOEnhanceException</code> with the
- * specified detail message and nested <code>Throwable</code>s.
- * @param msg the detail message.
- * @param nested the nested <code>Throwable</code>.
- */
- public JDOEnhanceException(String msg, Throwable nested)
- {
- super(msg, nested);
- }
+ /**
+ * Constructs a new <code>JDOEnhanceException</code> with the specified detail message and nested
+ * <code>Throwable</code>s.
+ *
+ * @param msg the detail message.
+ * @param nested the nested <code>Throwable</code>.
+ */
+ public JDOEnhanceException(String msg, Throwable nested) {
+ super(msg, nested);
+ }
}
diff --git a/api/src/main/java/javax/jdo/JDOEnhancer.java b/api/src/main/java/javax/jdo/JDOEnhancer.java
index 08deb809..ac53c995 100644
--- a/api/src/main/java/javax/jdo/JDOEnhancer.java
+++ b/api/src/main/java/javax/jdo/JDOEnhancer.java
@@ -23,130 +23,140 @@ 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
- * <code>JDOEnhancer</code>.
- * 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();
+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 <code>JDOEnhancer
+ * </code>. 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();
}
diff --git a/api/src/main/java/javax/jdo/JDOException.java b/api/src/main/java/javax/jdo/JDOException.java
index 18007f6c..3ea68ec9 100644
--- a/api/src/main/java/javax/jdo/JDOException.java
+++ b/api/src/main/java/javax/jdo/JDOException.java
@@ -5,13 +5,13 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
* limitations under the License.
*/
@@ -24,275 +24,291 @@ 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 <code>Throwable</code> array and an optional failed object.
+/**
+ * This is the root of all JDO Exceptions. It contains an optional detail message, an optional
+ * nested <code>Throwable</code> array and an optional failed object.
+ *
* @author Craig Russell
* @version 1.0.2
*/
public class JDOException extends java.lang.RuntimeException {
- private static final long serialVersionUID = 1950979275859696534L;
+ private static final long serialVersionUID = 1950979275859696534L;
- /** This exception was generated because of an exception in the runtime library.
- * @serial the nested <code>Throwable</code> 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 <code>Object</code>
- */
- Object failed;
+ /**
+ * This exception was generated because of an exception in the runtime library.
+ *
+ * @serial the nested <code>Throwable</code> array
+ */
+ Throwable[] nested;
- /**
- * The Internationalization message helper.
- */
- private static I18NHelper msg = I18NHelper.getInstance ("javax.jdo.Bundle"); //NOI18N
+ /**
+ * 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 <code>Object</code>
+ */
+ Object failed;
- /**
- * Flag indicating whether printStackTrace is being executed.
- */
- private boolean inPrintStackTrace = false;
-
- /**
- * Constructs a new <code>JDOException</code> without a detail message.
- */
- public JDOException() {
- }
+ /** The Internationalization message helper. */
+ private static I18NHelper msg = I18NHelper.getInstance("javax.jdo.Bundle"); // NOI18N
- /**
- * Constructs a new <code>JDOException</code> with the specified detail message.
- * @param msg the detail message.
- */
- public JDOException(String msg) {
- super(msg);
- }
+ /** Flag indicating whether printStackTrace is being executed. */
+ private boolean inPrintStackTrace = false;
- /** Constructs a new <code>JDOException</code> with the specified detail message
- * and nested <code>Throwable</code>s.
- * @param msg the detail message.
- * @param nested the nested <code>Throwable[]</code>.
- */
- public JDOException(String msg, Throwable[] nested) {
- super(msg);
- this.nested = nested;
- }
-
- /** Constructs a new <code>JDOException</code> with the specified detail message
- * and nested <code>Throwable</code>.
- * @param msg the detail message.
- * @param nested the nested <code>Throwable</code>.
- */
- public JDOException(String msg, Throwable nested) {
- super(msg);
- this.nested = new Throwable[] {nested};
- }
-
- /** Constructs a new <code>JDOException</code> 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 <code>JDOException</code> with the specified detail message,
- * nested <code>Throwable</code>s, and failed object.
- * @param msg the detail message.
- * @param nested the nested <code>Throwable[]</code>.
- * @param failed the failed object.
- */
- public JDOException(String msg, Throwable[] nested, Object failed) {
- super(msg);
- this.nested = nested;
- this.failed = failed;
- }
-
- /** Constructs a new <code>JDOException</code> with the specified detail message,
- * nested <code>Throwable</code>, and failed object.
- * @param msg the detail message.
- * @param nested the nested <code>Throwable</code>.
- * @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 <code>Exception</code>.
- * @return the nested Throwable array.
- */
- public Throwable[] getNestedExceptions() {
- return nested;
+ /** Constructs a new <code>JDOException</code> without a detail message. */
+ public JDOException() {}
+
+ /**
+ * Constructs a new <code>JDOException</code> with the specified detail message.
+ *
+ * @param msg the detail message.
+ */
+ public JDOException(String msg) {
+ super(msg);
+ }
+
+ /**
+ * Constructs a new <code>JDOException</code> with the specified detail message and nested <code>
+ * Throwable</code>s.
+ *
+ * @param msg the detail message.
+ * @param nested the nested <code>Throwable[]</code>.
+ */
+ public JDOException(String msg, Throwable[] nested) {
+ super(msg);
+ this.nested = nested;
+ }
+
+ /**
+ * Constructs a new <code>JDOException</code> with the specified detail message and nested <code>
+ * Throwable</code>.
+ *
+ * @param msg the detail message.
+ * @param nested the nested <code>Throwable</code>.
+ */
+ public JDOException(String msg, Throwable nested) {
+ super(msg);
+ this.nested = new Throwable[] {nested};
+ }
+
+ /**
+ * Constructs a new <code>JDOException</code> 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 <code>JDOException</code> with the specified detail message, nested <code>
+ * Throwable</code>s, and failed object.
+ *
+ * @param msg the detail message.
+ * @param nested the nested <code>Throwable[]</code>.
+ * @param failed the failed object.
+ */
+ public JDOException(String msg, Throwable[] nested, Object failed) {
+ super(msg);
+ this.nested = nested;
+ this.failed = failed;
+ }
+
+ /**
+ * Constructs a new <code>JDOException</code> with the specified detail message, nested <code>
+ * Throwable</code>, and failed object.
+ *
+ * @param msg the detail message.
+ * @param nested the nested <code>Throwable</code>.
+ * @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 <code>Exception</code>.
+ *
+ * @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];
}
-
- /** 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;
+ }
+
+ /**
+ * 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 <code>String</code> representation includes the name of the class, the descriptive comment
+ * (if any), the <code>String</code> representation of the failed <code>Object</code> (if any),
+ * and the <code>String</code> representation of the nested <code>Throwable</code>s (if any).
+ *
+ * @return the <code>String</code>.
+ */
+ 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 {
- return nested[0];
+ // 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);
}
-
- /** 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 <code>String</code> representation includes the name of the class,
- * the descriptive comment (if any),
- * the <code>String</code> representation of the failed <code>Object</code> (if any),
- * and the <code>String</code> representation of the nested <code>Throwable</code>s (if any).
- * @return the <code>String</code>.
- */
- 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; i<len; ++i) {
- sb.append ("\n"); //NOI18N
- exception = nested[i];
- sb.append (exception==null?"null":exception.toString()); //NOI18N
- }
- }
- return sb.toString();
- }
-
- /**
- * Prints this <code>JDOException</code> and its backtrace to the
- * standard error output.
- * Print nested Throwables' stack trace as well.
- */
- public void printStackTrace() {
- printStackTrace (System.err);
+ // 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; i < len; ++i) {
+ sb.append("\n"); // NOI18N
+ exception = nested[i];
+ sb.append(exception == null ? "null" : exception.toString()); // NOI18N
+ }
}
+ return sb.toString();
+ }
+
+ /**
+ * Prints this <code>JDOException</code> and its backtrace to the standard error output. Print
+ * nested Throwables' stack trace as well.
+ */
+ public void printStackTrace() {
+ printStackTrace(System.err);
+ }
- /**
- * Prints this <code>JDOException</code> and its backtrace to the
- * specified print stream.
- * Print nested Throwables' stack trace as well.
- * @param s <code>PrintStream</code> 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; i<len; ++i) {
- Throwable exception = nested[i];
- if (exception != null) {
- exception.printStackTrace(s);
- }
- }
- }
- inPrintStackTrace = false;
+ /**
+ * Prints this <code>JDOException</code> and its backtrace to the specified print stream. Print
+ * nested Throwables' stack trace as well.
+ *
+ * @param s <code>PrintStream</code> 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; i < len; ++i) {
+ Throwable exception = nested[i];
+ if (exception != null) {
+ exception.printStackTrace(s);
+ }
}
+ }
+ inPrintStackTrace = false;
}
+ }
- /**
- * Prints this <code>JDOException</code> and its backtrace to the specified
- * print writer.
- * Print nested Throwables' stack trace as well.
- * @param s <code>PrintWriter</code> 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; i<len; ++i) {
- Throwable exception = nested[i];
- if (exception != null) {
- exception.printStackTrace(s);
- }
- }
- }
- inPrintStackTrace = false;
+ /**
+ * Prints this <code>JDOException</code> and its backtrace to the specified print writer. Print
+ * nested Throwables' stack trace as well.
+ *
+ * @param s <code>PrintWriter</code> 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; i < len; ++i) {
+ Throwable exception = nested[i];
+ if (exception != null) {
+ exception.printStackTrace(s);
+ }
}
+ }
+ inPrintStackTrace = false;
}
+ }
- /**
- * Helper method returning a short description of the exception passed
- * as an argument. The returned string has the format defined by
- * Throwable.toString. If the exception has a non-null detail message
- * string, then it returns the name of exception class concatenated
- * with ": " concatenated with the detailed message. Otherwise it
- * returns the name of exception class.
- * @param ex the exception to be represented.
- * @return a string representation of the exception passed as an argument.
- */
- private static String exceptionToString(Exception ex)
- {
- if (ex == null) return null;
- String s = ex.getClass().getName();
- String message = ex.getMessage();
- return (message != null) ? (s + ": " + message) : s;
- }
+ /**
+ * Helper method returning a short description of the exception passed as an argument. The
+ * returned string has the format defined by Throwable.toString. If the exception has a non-null
+ * detail message string, then it returns the name of exception class concatenated with ": "
+ * concatenated with the detailed message. Otherwise it returns the name of exception class.
+ *
+ * @param ex the exception to be represented.
+ * @return a string representation of the exception passed as an argument.
+ */
+ private static String exceptionToString(Exception ex) {
+ if (ex == null) return null;
+ String s = ex.getClass().getName();
+ String message = ex.getMessage();
+ return (message != null) ? (s + ": " + message) : s;
+ }
}
diff --git a/api/src/main/java/javax/jdo/JDOFatalDataStoreException.java b/api/src/main/java/javax/jdo/JDOFatalDataStoreException.java
index 538ca3e3..feb72f78 100644
--- a/api/src/main/java/javax/jdo/JDOFatalDataStoreException.java
+++ b/api/src/main/java/javax/jdo/JDOFatalDataStoreException.java
@@ -5,13 +5,13 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
* limitations under the License.
*/
@@ -22,77 +22,81 @@
package javax.jdo;
-/** This class represents data store exceptions that cannot be retried.
+/**
+ * This class represents data store exceptions that cannot be retried.
*
* @version 1.0.1
*/
public class JDOFatalDataStoreException extends JDOFatalException {
- private static final long serialVersionUID = 8953679366316248154L;
+ private static final long serialVersionUID = 8953679366316248154L;
- /**
- * Constructs a new <code>JDOFatalDataStoreException</code> without a detail message.
- */
- public JDOFatalDataStoreException() {
- }
+ /** Constructs a new <code>JDOFatalDataStoreException</code> without a detail message. */
+ public JDOFatalDataStoreException() {}
- /**
- * Constructs a new <code>JDOFatalDataStoreException</code> with the specified detail message.
- * @param msg the detail message.
- */
- public JDOFatalDataStoreException(String msg) {
- super(msg);
- }
+ /**
+ * Constructs a new <code>JDOFatalDataStoreException</code> with the specified detail message.
+ *
+ * @param msg the detail message.
+ */
+ public JDOFatalDataStoreException(String msg) {
+ super(msg);
+ }
- /** Constructs a new <code>JDOFatalDataStoreException</code> 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 <code>JDOFatalDataStoreException</code> with the specified
- * detail message and nested <code>Throwable</code>s.
- * @param msg the detail message.
- * @param nested the nested <code>Throwable[]</code>.
- */
- public JDOFatalDataStoreException(String msg, Throwable[] nested) {
- super(msg, nested);
- }
+ /**
+ * Constructs a new <code>JDOFatalDataStoreException</code> 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 <code>JDOFatalDataStoreException</code> with the specified
- * detail message and nested <code>Throwable</code>s.
- * @param msg the detail message.
- * @param nested the nested <code>Throwable</code>.
- */
- public JDOFatalDataStoreException(String msg, Throwable nested) {
- super(msg, nested);
- }
-
- /**
- * Constructs a new <code>JDOFatalDataStoreException</code> with the specified
- * detail message, nested <code>Throwable</code>s, and failed object.
- * @param msg the detail message.
- * @param nested the nested <code>Throwable[]</code>.
- * @param failed the failed object.
- */
- public JDOFatalDataStoreException(String msg, Throwable[] nested, Object failed) {
- super(msg, nested, failed);
- }
+ /**
+ * Constructs a new <code>JDOFatalDataStoreException</code> with the specified detail message and
+ * nested <code>Throwable</code>s.
+ *
+ * @param msg the detail message.
+ * @param nested the nested <code>Throwable[]</code>.
+ */
+ public JDOFatalDataStoreException(String msg, Throwable[] nested) {
+ super(msg, nested);
+ }
- /**
- * Constructs a new <code>JDOFatalDataStoreException</code> with the specified
- * detail message, nested <code>Throwable</code>s, and failed object.
- * @param msg the detail message.
- * @param nested the nested <code>Throwable</code>.
- * @param failed the failed object.
- */
- public JDOFatalDataStoreException(String msg, Throwable nested, Object failed) {
- super(msg, nested, failed);
- }
-}
+ /**
+ * Constructs a new <code>JDOFatalDataStoreException</code> with the specified detail message and
+ * nested <code>Throwable</code>s.
+ *
+ * @param msg the detail message.
+ * @param nested the nested <code>Throwable</code>.
+ */
+ public JDOFatalDataStoreException(String msg, Throwable nested) {
+ super(msg, nested);
+ }
+ /**
+ * Constructs a new <code>JDOFatalDataStoreException</code> with the specified detail message,
+ * nested <code>Throwable</code>s, and failed object.
+ *
+ * @param msg the detail message.
+ * @param nested the nested <code>Throwable[]</code>.
+ * @param failed the failed object.
+ */
+ public JDOFatalDataStoreException(String msg, Throwable[] nested, Object failed) {
+ super(msg, nested, failed);
+ }
+
+ /**
+ * Constructs a new <code>JDOFatalDataStoreException</code> with the specified detail message,
+ * nested <code>Throwable</code>s, and failed object.
+ *
+ * @param msg the detail message.
+ * @param nested the nested <code>Throwable</code>.
+ * @param failed the failed object.
+ */
+ public JDOFatalDataStoreException(String msg, Throwable nested, Object failed) {
+ super(msg, nested, failed);
+ }
+}
diff --git a/api/src/main/java/javax/jdo/JDOFatalException.java b/api/src/main/java/javax/jdo/JDOFatalException.java
index 6247306c..eb39889e 100644
--- a/api/src/main/java/javax/jdo/JDOFatalException.java
+++ b/api/src/main/java/javax/jdo/JDOFatalException.java
@@ -5,13 +5,13 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
* limitations under the License.
*/
@@ -22,75 +22,82 @@
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.
+/**
+ * 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 {
- private static final long serialVersionUID = -414371106009364006L;
+ private static final long serialVersionUID = -414371106009364006L;
+
+ /** Constructs a new <code>JDOFatalException</code> without a detail message. */
+ public JDOFatalException() {}
+
+ /**
+ * Constructs a new <code>JDOFatalException</code> with the specified detail message.
+ *
+ * @param msg the detail message.
+ */
+ public JDOFatalException(String msg) {
+ super(msg);
+ }
+
+ /**
+ * Constructs a new <code>JDOFatalException</code> with the specified detail message and nested
+ * <code>Throwable</code>s.
+ *
+ * @param msg the detail message.
+ * @param nested the nested <code>Throwable[]</code>.
+ */
+ public JDOFatalException(String msg, Throwable[] nested) {
+ super(msg, nested);
+ }
- /**
- * Constructs a new <code>JDOFatalException</code> without a detail message.
- */
- public JDOFatalException() {
- }
+ /**
+ * Constructs a new <code>JDOFatalException</code> with the specified detail message and nested
+ * <code>Throwable</code>s.
+ *
+ * @param msg the detail message.
+ * @param nested the nested <code>Throwable</code>.
+ */
+ public JDOFatalException(String msg, Throwable nested) {
+ super(msg, nested);
+ }
- /**
- * Constructs a new <code>JDOFatalException</code> with the specified detail message.
- * @param msg the detail message.
- */
- public JDOFatalException(String msg) {
- super(msg);
- }
+ /**
+ * Constructs a new <code>JDOFatalException</code> 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 <code>JDOFatalException</code> with the specified detail
- * message and nested <code>Throwable</code>s.
- * @param msg the detail message.
- * @param nested the nested <code>Throwable[]</code>.
- */
- public JDOFatalException(String msg, Throwable[] nested) {
- super(msg, nested);
- }
-
- /**
- * Constructs a new <code>JDOFatalException</code> with the specified detail
- * message and nested <code>Throwable</code>s.
- * @param msg the detail message.
- * @param nested the nested <code>Throwable</code>.
- */
- public JDOFatalException(String msg, Throwable nested) {
- super(msg, nested);
- }
-
- /** Constructs a new <code>JDOFatalException</code> 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 <code>JDOFatalException</code> with the specified detail message,
- * nested <code>Throwable</code>s, and failed object.
- * @param msg the detail message.
- * @param nested the nested <code>Throwable[]</code>.
- * @param failed the failed object.
- */
- public JDOFatalException(String msg, Throwable[] nested, Object failed) {
- super(msg, nested, failed);
- }
+ /**
+ * Constructs a new <code>JDOFatalException</code> with the specified detail message, nested
+ * <code>Throwable</code>s, and failed object.
+ *
+ * @param msg the detail message.
+ * @param nested the nested <code>Throwable[]</code>.
+ * @param failed the failed object.
+ */
+ public JDOFatalException(String msg, Throwable[] nested, Object failed) {
+ super(msg, nested, failed);
+ }
- /** Constructs a new <code>JDOFatalException</code> with the specified detail message,
- * nested <code>Throwable</code>s, and failed object.
- * @param msg the detail message.
- * @param nested the nested <code>Throwable</code>.
- * @param failed the failed object.
- */
- public JDOFatalException(String msg, Throwable nested, Object failed) {
- super(msg, nested, failed);
- }
+ /**
+ * Constructs a new <code>JDOFatalException</code> with the specified detail message, nested
+ * <code>Throwable</code>s, and failed object.
+ *
+ * @param msg the detail message.
+ * @param nested the nested <code>Throwable</code>.
+ * @param failed the failed object.
+ */
+ public JDOFatalException(String msg, Throwable nested, Object failed) {
+ super(msg, nested, failed);
+ }
}
diff --git a/api/src/main/java/javax/jdo/JDOFatalInternalException.java b/api/src/main/java/javax/jdo/JDOFatalInternalException.java
index 5ba042e5..b239d638 100644
--- a/api/src/main/java/javax/jdo/JDOFatalInternalException.java
+++ b/api/src/main/java/javax/jdo/JDOFatalInternalException.java
@@ -5,13 +5,13 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
* limitations under the License.
*/
@@ -22,79 +22,82 @@
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.
+/**
+ * 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 {
- private static final long serialVersionUID = -2315924677228266735L;
+ private static final long serialVersionUID = -2315924677228266735L;
- /**
- * Constructs a new <code>JDOFatalInternalException</code> without a detail message.
- */
- public JDOFatalInternalException() {
- }
+ /** Constructs a new <code>JDOFatalInternalException</code> without a detail message. */
+ public JDOFatalInternalException() {}
- /**
- * Constructs a new <code>JDOFatalInternalException</code> with the specified detail message.
- * @param msg the detail message.
- */
- public JDOFatalInternalException(String msg) {
- super(msg);
- }
+ /**
+ * Constructs a new <code>JDOFatalInternalException</code> with the specified detail message.
+ *
+ * @param msg the detail message.
+ */
+ public JDOFatalInternalException(String msg) {
+ super(msg);
+ }
- /**
- * Constructs a new <code>JDOFatalInternalException</code> with the specified
- * detail message and nested <code>Throwable</code>s.
- * @param msg the detail message.
- * @param nested the nested <code>Throwable[]</code>.
- */
- public JDOFatalInternalException(String msg, Throwable[] nested) {
- super(msg, nested);
- }
+ /**
+ * Constructs a new <code>JDOFatalInternalException</code> with the specified detail message and
+ * nested <code>Throwable</code>s.
+ *
+ * @param msg the detail message.
+ * @param nested the nested <code>Throwable[]</code>.
+ */
+ public JDOFatalInternalException(String msg, Throwable[] nested) {
+ super(msg, nested);
+ }
- /**
- * Constructs a new <code>JDOFatalInternalException</code> with the specified
- * detail message and nested <code>Throwable</code>s.
- * @param msg the detail message.
- * @param nested the nested <code>Throwable</code>.
- */
- public JDOFatalInternalException(String msg, Throwable nested) {
- super(msg, nested);
- }
+ /**
+ * Constructs a new <code>JDOFatalInternalException</code> with the specified detail message and
+ * nested <code>Throwable</code>s.
+ *
+ * @param msg the detail message.
+ * @param nested the nested <code>Throwable</code>.
+ */
+ public JDOFatalInternalException(String msg, Throwable nested) {
+ super(msg, nested);
+ }
- /**
- * Constructs a new <code>JDOFatalInternalException</code>
- * 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 <code>JDOFatalInternalException</code> 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 <code>JDOFatalInternalException</code> with the specified
- * detail message, nested <code>Throwable</code>s, and failed object.
- * @param msg the detail message.
- * @param nested the nested <code>Throwable[]</code>.
- * @param failed the failed object.
- */
- public JDOFatalInternalException(String msg, Throwable[] nested, Object failed) {
- super(msg, nested, failed);
- }
+ /**
+ * Constructs a new <code>JDOFatalInternalException</code> with the specified detail message,
+ * nested <code>Throwable</code>s, and failed object.
+ *
+ * @param msg the detail message.
+ * @param nested the nested <code>Throwable[]</code>.
+ * @param failed the failed object.
+ */
+ public JDOFatalInternalException(String msg, Throwable[] nested, Object failed) {
+ super(msg, nested, failed);
+ }
- /**
- * Constructs a new <code>JDOFatalInternalException</code> with the specified
- * detail message, nested <code>Throwable</code>s, and failed object.
- * @param msg the detail message.
- * @param nested the nested <code>Throwable</code>.
- * @param failed the failed object.
- */
- public JDOFatalInternalException(String msg, Throwable nested, Object failed) {
- super(msg, nested, failed);
- }
+ /**
+ * Constructs a new <code>JDOFatalInternalException</code> with the specified detail message,
+ * nested <code>Throwable</code>s, and failed object.
+ *
+ * @param msg the detail message.
+ * @param nested the nested <code>Throwable</code>.
+ * @param failed the failed object.
+ */
+ public JDOFatalInternalException(String msg, Throwable nested, Object failed) {
+ super(msg, nested, failed);
+ }
}
diff --git a/api/src/main/java/javax/jdo/JDOFatalUserException.java b/api/src/main/java/javax/jdo/JDOFatalUserException.java
index 8dc1434d..f43cfd2c 100644
--- a/api/src/main/java/javax/jdo/JDOFatalUserException.java
+++ b/api/src/main/java/javax/jdo/JDOFatalUserException.java
@@ -5,13 +5,13 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
* limitations under the License.
*/
@@ -22,75 +22,81 @@
package javax.jdo;
-/** This class represents user errors that cannot be retried.
+/**
+ * This class represents user errors that cannot be retried.
*
* @version 1.0
*/
public class JDOFatalUserException extends JDOFatalException {
- private static final long serialVersionUID = -7451285498620809419L;
+ private static final long serialVersionUID = -7451285498620809419L;
- /**
- * Constructs a new <code>JDOFatalUserException</code> without a detail message.
- */
- public JDOFatalUserException() {
- }
+ /** Constructs a new <code>JDOFatalUserException</code> without a detail message. */
+ public JDOFatalUserException() {}
- /**
- * Constructs a new <code>JDOFatalUserException</code> with the specified detail message.
- * @param msg the detail message.
- */
- public JDOFatalUserException(String msg) {
- super(msg);
- }
+ /**
+ * Constructs a new <code>JDOFatalUserException</code> with the specified detail message.
+ *
+ * @param msg the detail message.
+ */
+ public JDOFatalUserException(String msg) {
+ super(msg);
+ }
- /**
- * Constructs a new <code>JDOFatalUserException</code> with the specified
- * detail message and nested <code>Throwable</code>s.
- * @param msg the detail message.
- * @param nested the nested <code>Throwable[]</code>.
- */
- public JDOFatalUserException(String msg, Throwable[] nested) {
- super(msg, nested);
- }
-
- /**
- * Constructs a new <code>JDOFatalUserException</code> with the specified
- * detail message and nested <code>Throwable</code>s.
- * @param msg the detail message.
- * @param nested the nested <code>Throwable</code>.
- */
- public JDOFatalUserException(String msg, Throwable nested) {
- super(msg, nested);
- }
-
- /** Constructs a new <code>JDOFatalUserException</code> 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 <code>JDOFatalUserException</code> with the specified
- * detail message, nested <code>Throwable</code>s, and failed object.
- * @param msg the detail message.
- * @param nested the nested <code>Throwable[]</code>.
- * @param failed the failed object.
- */
- public JDOFatalUserException(String msg, Throwable[] nested, Object failed) {
- super(msg, nested, failed);
- }
-
- /** Constructs a new <code>JDOFatalUserException</code> with the specified
- * detail message, nested <code>Throwable</code>s, and failed object.
- * @param msg the detail message.
- * @param nested the nested <code>Throwable</code>.
- * @param failed the failed object.
- */
- public JDOFatalUserException(String msg, Throwable nested, Object failed) {
- super(msg, nested, failed);
- }
-}
+ /**
+ * Constructs a new <code>JDOFatalUserException</code> with the specified detail message and
+ * nested <code>Throwable</code>s.
+ *
+ * @param msg the detail message.
+ * @param nested the nested <code>Throwable[]</code>.
+ */
+ public JDOFatalUserException(String msg, Throwable[] nested) {
+ super(msg, nested);
+ }
+
+ /**
+ * Constructs a new <code>JDOFatalUserException</code> with the specified detail message and
+ * nested <code>Throwable</code>s.
+ *
+ * @param msg the detail message.
+ * @param nested the nested <code>Throwable</code>.
+ */
+ public JDOFatalUserException(String msg, Throwable nested) {
+ super(msg, nested);
+ }
+ /**
+ * Constructs a new <code>JDOFatalUserException</code> 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 <code>JDOFatalUserException</code> with the specified detail message, nested
+ * <code>Throwable</code>s, and failed object.
+ *
+ * @param msg the detail message.
+ * @param nested the nested <code>Throwable[]</code>.
+ * @param failed the failed object.
+ */
+ public JDOFatalUserException(String msg, Throwable[] nested, Object failed) {
+ super(msg, nested, failed);
+ }
+
+ /**
+ * Constructs a new <code>JDOFatalUserException</code> with the specified detail message, nested
+ * <code>Throwable</code>s, and failed object.
+ *
+ * @param msg the detail message.
+ * @param nested the nested <code>Throwable</code>.
+ * @param failed the failed object.
+ */
+ public JDOFatalUserException(String msg, Throwable nested, Object failed) {
+ super(msg, nested, failed);
+ }
+}
diff --git a/api/src/main/java/javax/jdo/JDOHelper.java b/api/src/main/java/javax/jdo/JDOHelper.java
index 892d4683..d43e298b 100644
--- a/api/src/main/java/javax/jdo/JDOHelper.java
+++ b/api/src/main/java/javax/jdo/JDOHelper.java
@@ -5,13 +5,13 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
* limitations under the License.
*/
@@ -19,7 +19,7 @@
* JDOHelper.java
*
*/
-
+
package javax.jdo;
import java.io.BufferedReader;
@@ -69,1806 +69,1614 @@ 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 <code>PersistenceCapable</code> instances without declaring them to be
- * <code>PersistenceCapable</code>.
- * <P>It is also used to acquire a <code>PersistenceManagerFactory</code> via
- * various methods.
- * <P>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
- * <code>PersistenceManager</code> if it has one.
- *
+ * This class can be used by a JDO-aware application to call the JDO behavior of <code>
+ * PersistenceCapable</code> instances without declaring them to be <code>PersistenceCapable</code>.
+ *
+ * <p>It is also used to acquire a <code>PersistenceManagerFactory</code> via various methods.
+ *
+ * <p>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 <code>
+ * PersistenceManager</code> 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<String, String> 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<String, String> createAttributePropertyXref() {
- Map<String, String> xref = new HashMap<String,String>();
-
- 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)
- doPrivileged(
- new PrivilegedAction<JDOImplHelper> () {
- public JDOImplHelper run () {
- return JDOImplHelper.getInstance();
+ /** A mapping from jdoconfig.xsd element attributes to PMF properties. */
+ static final Map<String, String> ATTRIBUTE_PROPERTY_XREF = createAttributePropertyXref();
+
+ /** The Internationalization message helper. */
+ private static final 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<String, String> createAttributePropertyXref() {
+ Map<String, String> xref = new HashMap<String, String>();
+
+ 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)
+ doPrivileged(
+ new PrivilegedAction<JDOImplHelper>() {
+ 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 <code>PersistenceManager</code> if there is one.
- * Transactional and persistent instances return the associated
- * <code>PersistenceManager</code>.
- *
- * <P>Transient non-transactional instances and instances of classes
- * that do not implement <code>PersistenceCapable</code> return
- * <code>null</code>.
- * @see PersistenceCapable#jdoGetPersistenceManager()
- * @param pc the <code>PersistenceCapable</code> instance.
- * @return the <code>PersistenceManager</code> 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);
+ });
+
+ /**
+ * 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);
}
- }
-
- /** Explicitly mark the parameter instance and field dirty.
- * Normally, <code>PersistenceCapable</code> 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.
- *
- * <P>Transient instances and instances of classes
- * that do not implement <code>PersistenceCapable</code> ignore this method.
- * @see PersistenceCapable#jdoMakeDirty(String fieldName)
- * @param pc the <code>PersistenceCapable</code> 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);
+ };
+
+ /**
+ * 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);
}
- }
-
- /** Return a copy of the JDO identity associated with the parameter
- * instance.
- *
- * <P>Persistent instances of <code>PersistenceCapable</code> classes have a
- * JDO identity managed by the <code>PersistenceManager</code>. This method
- * returns a copy of the ObjectId that represents the JDO identity.
- *
- * <P>Transient instances and instances of classes that do not implement
- * <code>PersistenceCapable</code> return <code>null</code>.
- *
- * <P>The ObjectId may be serialized
- * and later restored, and used with a <code>PersistenceManager</code> from
- * the same JDO implementation to locate a persistent instance with the same
- * data store identity.
- *
- * <P>If the JDO identity is managed by the application, then the ObjectId
- * may be used with a <code>PersistenceManager</code> from any JDO
- * implementation that supports the <code>PersistenceCapable</code> class.
- *
- * <P>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.
- *<P>
- * @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);
+ };
+
+ /**
+ * 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);
}
- }
-
- /** 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<Object> getObjectIds(Collection<?> pcs) {
- ArrayList<Object> result = new ArrayList<Object>();
- for (Iterator<?> it = pcs.iterator(); it.hasNext();) {
- result.add(getObjectId(it.next()));
+ };
+
+ /**
+ * 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);
}
- return result;
- }
+ };
+
+ /**
+ * 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);
+ }
+ };
- /** 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]);
+ /** 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);
}
- 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 <code>PersistenceCapable</code> 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);
+ /** 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);
}
- }
-
- /**
- * 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);
+ };
+
+ /**
+ * 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);
}
- }
- /** Tests whether the parameter instance is dirty.
- *
- * Instances that have been modified, deleted, or newly
- * made persistent in the current transaction return <code>true</code>.
- *
- *<P>Transient instances and instances of classes that do not implement
- * <code>PersistenceCapable</code> return <code>false</code>.
- *<P>
- * @see javax.jdo.spi.StateManager#makeDirty(PersistenceCapable pc,
- * String fieldName)
- * @see PersistenceCapable#jdoIsDirty()
- * @param pc the <code>PersistenceCapable</code> instance.
- * @return <code>true</code> 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);
+ };
+
+ /**
+ * 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 <code>PersistenceManager</code> if there is one. Transactional and
+ * persistent instances return the associated <code>PersistenceManager</code>.
+ *
+ * <p>Transient non-transactional instances and instances of classes that do not implement <code>
+ * PersistenceCapable</code> return <code>null</code>.
+ *
+ * @see PersistenceCapable#jdoGetPersistenceManager()
+ * @param pc the <code>PersistenceCapable</code> instance.
+ * @return the <code>PersistenceManager</code> 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);
}
-
- /** Tests whether the parameter instance is transactional.
- *
- * Instances whose state is associated with the current transaction
- * return true.
- *
- *<P>Transient instances and instances of classes that do not implement
- * <code>PersistenceCapable</code> return <code>false</code>.
- * @see PersistenceCapable#jdoIsTransactional()
- * @param pc the <code>PersistenceCapable</code> instance.
- * @return <code>true</code> 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);
- }
+ }
+
+ /**
+ * Explicitly mark the parameter instance and field dirty. Normally, <code>PersistenceCapable
+ * </code> 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.
+ *
+ * <p>Transient instances and instances of classes that do not implement <code>PersistenceCapable
+ * </code> ignore this method.
+ *
+ * @see PersistenceCapable#jdoMakeDirty(String fieldName)
+ * @param pc the <code>PersistenceCapable</code> 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);
}
-
- /** Tests whether the parameter instance is persistent.
- *
- * Instances that represent persistent objects in the data store
- * return <code>true</code>.
- *
- *<P>Transient instances and instances of classes that do not implement
- * <code>PersistenceCapable</code> return <code>false</code>.
- *<P>
- * @see PersistenceManager#makePersistent(Object pc)
- * @see PersistenceCapable#jdoIsPersistent()
- * @param pc the <code>PersistenceCapable</code> instance.
- * @return <code>true</code> 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);
- }
+ }
+
+ /**
+ * Return a copy of the JDO identity associated with the parameter instance.
+ *
+ * <p>Persistent instances of <code>PersistenceCapable</code> classes have a JDO identity managed
+ * by the <code>PersistenceManager</code>. This method returns a copy of the ObjectId that
+ * represents the JDO identity.
+ *
+ * <p>Transient instances and instances of classes that do not implement <code>PersistenceCapable
+ * </code> return <code>null</code>.
+ *
+ * <p>The ObjectId may be serialized and later restored, and used with a <code>PersistenceManager
+ * </code> from the same JDO implementation to locate a persistent instance with the same data
+ * store identity.
+ *
+ * <p>If the JDO identity is managed by the application, then the ObjectId may be used with a
+ * <code>PersistenceManager</code> from any JDO implementation that supports the <code>
+ * PersistenceCapable</code> class.
+ *
+ * <p>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.
+ *
+ * <p>
+ *
+ * @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);
}
-
- /** Tests whether the parameter instance has been newly made persistent.
- *
- * Instances that have been made persistent in the current transaction
- * return <code>true</code>.
- *
- *<P>Transient instances and instances of classes that do not implement
- * <code>PersistenceCapable</code> return <code>false</code>.
- *<P>
- * @see PersistenceManager#makePersistent(Object pc)
- * @see PersistenceCapable#jdoIsNew()
- * @param pc the <code>PersistenceCapable</code> instance.
- * @return <code>true</code> 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);
- }
+ }
+
+ /**
+ * 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<Object> getObjectIds(Collection<?> pcs) {
+ ArrayList<Object> result = new ArrayList<Object>();
+ for (Iterator<?> it = pcs.iterator(); it.hasNext(); ) {
+ result.add(getObjectId(it.next()));
}
-
- /** Tests whether the parameter instance has been deleted.
- *
- * Instances that have been deleted in the current transaction return
- * <code>true</code>.
- *
- *<P>Transient instances and instances of classes that do not implement
- * <code>PersistenceCapable</code> return <code>false</code>.
- *<P>
- * @see PersistenceManager#deletePersistent(Object pc)
- * @see PersistenceCapable#jdoIsDeleted()
- * @param pc the <code>PersistenceCapable</code> instance.
- * @return <code>true</code> 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);
- }
+ 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]);
}
-
- /**
- * Tests whether the parameter instance has been detached.
- *
- * Instances that have been detached return true.
- *
- * <P>Transient instances return false.
- * <P>
- * @see PersistenceCapable#jdoIsDetached()
- * @return <code>true</code> 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);
- }
+ 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 <code>PersistenceCapable</code> 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);
}
-
- /** 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;
- }
- }
- }
+ }
+
+ /**
+ * 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);
}
-
- /** Get the anonymous <code>PersistenceManagerFactory</code> 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 <code>PersistenceManagerFactory</code>.
- * @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);
+ }
+ /**
+ * Tests whether the parameter instance is dirty.
+ *
+ * <p>Instances that have been modified, deleted, or newly made persistent in the current
+ * transaction return <code>true</code>.
+ *
+ * <p>Transient instances and instances of classes that do not implement <code>PersistenceCapable
+ * </code> return <code>false</code>.
+ *
+ * <p>
+ *
+ * @see javax.jdo.spi.StateManager#makeDirty(PersistenceCapable pc, String fieldName)
+ * @see PersistenceCapable#jdoIsDirty()
+ * @param pc the <code>PersistenceCapable</code> instance.
+ * @return <code>true</code> 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);
}
-
- /** Get the anonymous <code>PersistenceManagerFactory</code> configured via
- * the standard configuration file resource "META-INF/jdoconfig.xml", using
- * the given class loader.
- * @return the anonymous <code>PersistenceManagerFactory</code>.
- * @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);
+ }
+
+ /**
+ * Tests whether the parameter instance is transactional.
+ *
+ * <p>Instances whose state is associated with the current transaction return true.
+ *
+ * <p>Transient instances and instances of classes that do not implement <code>PersistenceCapable
+ * </code> return <code>false</code>.
+ *
+ * @see PersistenceCapable#jdoIsTransactional()
+ * @param pc the <code>PersistenceCapable</code> instance.
+ * @return <code>true</code> 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);
}
-
- /** Get a <code>PersistenceManagerFactory</code> based on a <code>Properties</code>
- * instance, using the current thread's context class loader to locate the
- * <code>PersistenceManagerFactory</code> class.
- * @return the <code>PersistenceManagerFactory</code>.
- * @param props a <code>Properties</code> instance with properties of the
- * <code>PersistenceManagerFactory</code>.
- * @see #getPersistenceManagerFactory(java.util.Map,ClassLoader)
- */
- public static PersistenceManagerFactory getPersistenceManagerFactory
- (Map<?, ?> props) {
- return getPersistenceManagerFactory(
- null, props, getContextClassLoader());
+ }
+
+ /**
+ * Tests whether the parameter instance is persistent.
+ *
+ * <p>Instances that represent persistent objects in the data store return <code>true</code>.
+ *
+ * <p>Transient instances and instances of classes that do not implement <code>PersistenceCapable
+ * </code> return <code>false</code>.
+ *
+ * <p>
+ *
+ * @see PersistenceManager#makePersistent(Object pc)
+ * @see PersistenceCapable#jdoIsPersistent()
+ * @param pc the <code>PersistenceCapable</code> instance.
+ * @return <code>true</code> 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);
}
-
-
- /** Get a <code>PersistenceManagerFactory</code> based on a
- * <code>Map</code> 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 <code>PersistenceManagerFactory</code>.
- * @param props a <code>Map</code> with properties of the
- * <code>PersistenceManagerFactory</code>.
- * @param pmfClassLoader the class loader used to load the
- * <code>PersistenceManagerFactory</code> class
- * @since 1.0
- */
- public static PersistenceManagerFactory getPersistenceManagerFactory
- (Map<?, ?> props, ClassLoader pmfClassLoader) {
- return getPersistenceManagerFactory(
- null, props, pmfClassLoader);
+ }
+
+ /**
+ * Tests whether the parameter instance has been newly made persistent.
+ *
+ * <p>Instances that have been made persistent in the current transaction return <code>true</code>
+ * .
+ *
+ * <p>Transient instances and instances of classes that do not implement <code>PersistenceCapable
+ * </code> return <code>false</code>.
+ *
+ * <p>
+ *
+ * @see PersistenceManager#makePersistent(Object pc)
+ * @see PersistenceCapable#jdoIsNew()
+ * @param pc the <code>PersistenceCapable</code> instance.
+ * @return <code>true</code> 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.
+ *
+ * <p>Instances that have been deleted in the current transaction return <code>true</code>.
+ *
+ * <p>Transient instances and instances of classes that do not implement <code>PersistenceCapable
+ * </code> return <code>false</code>.
+ *
+ * <p>
+ *
+ * @see PersistenceManager#deletePersistent(Object pc)
+ * @see PersistenceCapable#jdoIsDeleted()
+ * @param pc the <code>PersistenceCapable</code> instance.
+ * @return <code>true</code> 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.
+ *
+ * <p>Instances that have been detached return true.
+ *
+ * <p>Transient instances return false.
+ *
+ * <p>
+ *
+ * @see PersistenceCapable#jdoIsDetached()
+ * @return <code>true</code> 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;
}
- /**
- * Get a <code>PersistenceManagerFactory</code> based on a
- * <code>Map</code> of overrides, a <code>Map</code> of
- * properties, and a class loader.
- * The following are standard key names:
- * <BR><code>"javax.jdo.PersistenceManagerFactoryClass"
- * <BR>"javax.jdo.option.Optimistic",
- * <BR>"javax.jdo.option.RetainValues",
- * <BR>"javax.jdo.option.RestoreValues",
- * <BR>"javax.jdo.option.IgnoreCache",
- * <BR>"javax.jdo.option.NontransactionalRead",
- * <BR>"javax.jdo.option.NontransactionalWrite",
- * <BR>"javax.jdo.option.Multithreaded",
- * <BR>"javax.jdo.option.ConnectionUserName",
- * <BR>"javax.jdo.option.ConnectionPassword",
- * <BR>"javax.jdo.option.ConnectionURL",
- * <BR>"javax.jdo.option.ConnectionFactoryName",
- * <BR>"javax.jdo.option.ConnectionFactory2Name",
- * <BR>"javax.jdo.option.Mapping",
- * <BR>"javax.jdo.mapping.Catalog",
- * <BR>"javax.jdo.mapping.Schema",
- * <BR>"javax.jdo.option.PersistenceUnitName",
- * <BR>"javax.jdo.option.DetachAllOnCommit",
- * <BR>"javax.jdo.option.CopyOnAttach",
- * <BR>"javax.jdo.option.ReadOnly",
- * <BR>"javax.jdo.option.TransactionIsolationLevel",
- * <BR>"javax.jdo.option.TransactionType",
- * <BR>"javax.jdo.option.ServerTimeZoneID",
- * <BR>"javax.jdo.option.DatastoreReadTimeoutMillis",
- * <BR>"javax.jdo.option.DatastoreWriteTimeoutMillis",
- * <BR>"javax.jdo.option.Name".
- * </code>
- * and properties of the form
- * <BR><code>javax.jdo.option.InstanceLifecycleListener.{listenerClass}[=[{pcClasses}]]</code>
- * where <code>{listenerClass}</code> is the fully qualified name of a
- * class that implements
- * {@link javax.jdo.listener.InstanceLifecycleListener}, and
- * <code>{pcClasses}</code> 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.
- * <P>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
- * <code>JDOFatalUserException</code> thrown by the method.
- * <P>The returned <code>PersistenceManagerFactory</code> is not
- * configurable (the <code>set<I>XXX</I></code> methods will throw an
- * exception).
- * <P>JDO implementations might manage a map of instantiated
- * <code>PersistenceManagerFactory</code> instances based on specified
- * property key values, and return a previously instantiated
- * <code>PersistenceManagerFactory</code> instance. In this case, the
- * properties of the returned instance must exactly match the requested
- * properties.
- * @param overrides Overrides of properties
- * @param props a <code>Properties</code> instance with properties of the
- * <code>PersistenceManagerFactory</code>.
- * @param pmfClassLoader the class loader to use to load the
- * <code>PersistenceManagerFactory</code> class
- * @return the <code>PersistenceManagerFactory</code>.
- * @throws JDOFatalUserException if
- * <ul><li>the pmfClassLoader passed is invalid; or
- * </li><li>a valid class name cannot be obtained from
- * either <code>props</code> or system resources
- * (an entry in META-INF/services/javax.jdo.PersistenceManagerFactory); or
- * </li><li>all implementations throw an exception.
- * </li></ul>
- * @since 2.1
- */
- protected static PersistenceManagerFactory getPersistenceManagerFactory
- (Map<?, ?> overrides, Map<?, ?> props, ClassLoader pmfClassLoader) {
-
- List<Throwable> exceptions = new ArrayList<Throwable>();
- 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<URL> urls = null;
- try {
- urls = getResources(pmfClassLoader,
- SERVICE_LOOKUP_PMF_RESOURCE_NAME);
- } catch (Throwable ex) {
- exceptions.add(ex);
+ 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 <code>PersistenceManagerFactory</code> 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 <code>PersistenceManagerFactory</code>.
+ * @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 <code>PersistenceManagerFactory</code> configured via the standard
+ * configuration file resource "META-INF/jdoconfig.xml", using the given class loader.
+ *
+ * @return the anonymous <code>PersistenceManagerFactory</code>.
+ * @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 <code>PersistenceManagerFactory</code> based on a <code>Properties</code> instance, using
+ * the current thread's context class loader to locate the <code>PersistenceManagerFactory</code>
+ * class.
+ *
+ * @return the <code>PersistenceManagerFactory</code>.
+ * @param props a <code>Properties</code> instance with properties of the <code>
+ * PersistenceManagerFactory</code>.
+ * @see #getPersistenceManagerFactory(java.util.Map,ClassLoader)
+ */
+ public static PersistenceManagerFactory getPersistenceManagerFactory(Map<?, ?> props) {
+ return getPersistenceManagerFactory(null, props, getContextClassLoader());
+ }
+
+ /**
+ * Get a <code>PersistenceManagerFactory</code> based on a <code>Map</code> 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 <code>PersistenceManagerFactory</code>.
+ * @param props a <code>Map</code> with properties of the <code>PersistenceManagerFactory</code>.
+ * @param pmfClassLoader the class loader used to load the <code>PersistenceManagerFactory</code>
+ * class
+ * @since 1.0
+ */
+ public static PersistenceManagerFactory getPersistenceManagerFactory(
+ Map<?, ?> props, ClassLoader pmfClassLoader) {
+ return getPersistenceManagerFactory(null, props, pmfClassLoader);
+ }
+
+ /**
+ * Get a <code>PersistenceManagerFactory</code> based on a <code>Map</code> of overrides, a <code>
+ * Map</code> of properties, and a class loader. The following are standard key names: <br>
+ * <code>"javax.jdo.PersistenceManagerFactoryClass"
+ * <BR>"javax.jdo.option.Optimistic",
+ * <BR>"javax.jdo.option.RetainValues",
+ * <BR>"javax.jdo.option.RestoreValues",
+ * <BR>"javax.jdo.option.IgnoreCache",
+ * <BR>"javax.jdo.option.NontransactionalRead",
+ * <BR>"javax.jdo.option.NontransactionalWrite",
+ * <BR>"javax.jdo.option.Multithreaded",
+ * <BR>"javax.jdo.option.ConnectionUserName",
+ * <BR>"javax.jdo.option.ConnectionPassword",
+ * <BR>"javax.jdo.option.ConnectionURL",
+ * <BR>"javax.jdo.option.ConnectionFactoryName",
+ * <BR>"javax.jdo.option.ConnectionFactory2Name",
+ * <BR>"javax.jdo.option.Mapping",
+ * <BR>"javax.jdo.mapping.Catalog",
+ * <BR>"javax.jdo.mapping.Schema",
+ * <BR>"javax.jdo.option.PersistenceUnitName",
+ * <BR>"javax.jdo.option.DetachAllOnCommit",
+ * <BR>"javax.jdo.option.CopyOnAttach",
+ * <BR>"javax.jdo.option.ReadOnly",
+ * <BR>"javax.jdo.option.TransactionIsolationLevel",
+ * <BR>"javax.jdo.option.TransactionType",
+ * <BR>"javax.jdo.option.ServerTimeZoneID",
+ * <BR>"javax.jdo.option.DatastoreReadTimeoutMillis",
+ * <BR>"javax.jdo.option.DatastoreWriteTimeoutMillis",
+ * <BR>"javax.jdo.option.Name".
+ * </code> and properties of the form <br>
+ * <code>javax.jdo.option.InstanceLifecycleListener.{listenerClass}[=[{pcClasses}]]</code> where
+ * <code>{listenerClass}</code> is the fully qualified name of a class that implements {@link
+ * javax.jdo.listener.InstanceLifecycleListener}, and <code>{pcClasses}</code> 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.
+ *
+ * <p>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 <code>JDOFatalUserException</code> thrown by
+ * the method.
+ *
+ * <p>The returned <code>PersistenceManagerFactory</code> is not configurable (the <code>
+ * set<I>XXX</I></code> methods will throw an exception).
+ *
+ * <p>JDO implementations might manage a map of instantiated <code>PersistenceManagerFactory
+ * </code> instances based on specified property key values, and return a previously instantiated
+ * <code>PersistenceManagerFactory</code> instance. In this case, the properties of the returned
+ * instance must exactly match the requested properties.
+ *
+ * @param overrides Overrides of properties
+ * @param props a <code>Properties</code> instance with properties of the <code>
+ * PersistenceManagerFactory</code>.
+ * @param pmfClassLoader the class loader to use to load the <code>PersistenceManagerFactory
+ * </code> class
+ * @return the <code>PersistenceManagerFactory</code>.
+ * @throws JDOFatalUserException if
+ * <ul>
+ * <li>the pmfClassLoader passed is invalid; or
+ * <li>a valid class name cannot be obtained from either <code>props</code> or system
+ * resources (an entry in META-INF/services/javax.jdo.PersistenceManagerFactory); or
+ * <li>all implementations throw an exception.
+ * </ul>
+ *
+ * @since 2.1
+ */
+ protected static PersistenceManagerFactory getPersistenceManagerFactory(
+ Map<?, ?> overrides, Map<?, ?> props, ClassLoader pmfClassLoader) {
+
+ List<Throwable> exceptions = new ArrayList<Throwable>();
+ 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<URL> 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());
+ if (urls != null) {
+ while (urls.hasMoreElements()) {
- // return the implementation that is valid.
- PersistenceManagerFactory pmf =
- invokeGetPersistenceManagerFactoryOnImplementation(
- pmfClassName, overrides, props, pmfClassLoader);
- return pmf;
+ try {
+ pmfClassName = getClassNameFromURL((URL) urls.nextElement());
- } catch (Throwable ex) {
+ // return the implementation that is valid.
+ PersistenceManagerFactory pmf =
+ invokeGetPersistenceManagerFactoryOnImplementation(
+ pmfClassName, overrides, props, pmfClassLoader);
+ return pmf;
- // remember exceptions from failed pmf invocations
- exceptions.add(ex);
+ } 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 Throw if an error occurs on accessing this URL
- * @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
- }
+ // 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 Throw if an error occurs on accessing this URL
+ * @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)
- * @param name Name of the PMF
- * @return PersistenceManagerFactory
- */
- public static PersistenceManagerFactory getPersistenceManagerFactory
- (String name) {
- ClassLoader cl = getContextClassLoader();
- return getPersistenceManagerFactory(null, name, cl, cl);
+ }
+
+ /**
+ * Returns a named {@link PersistenceManagerFactory} or persistence unit.
+ *
+ * @since 2.1
+ * @see #getPersistenceManagerFactory(Map,String,ClassLoader,ClassLoader)
+ * @param name Name of the PMF
+ * @return PersistenceManagerFactory
+ */
+ 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)
+ * @param name Name of the PMF
+ * @param loader ClassLoader to use
+ * @return PersistenceManagerFactory
+ */
+ 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)
+ * @param name Name of the PMF
+ * @param resourceLoader ClassLoader to use for loading resources
+ * @param pmfLoader ClassLoader to use for loading the PMF
+ * @return PersistenceManagerFactory
+ */
+ 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)
+ * @param name Name of the PMF
+ * @param overrides Property overrides
+ * @return PersistenceManagerFactory
+ */
+ 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)
+ * @param overrides Property overrides
+ * @param name Name of the PMF
+ * @param resourceLoader ClassLoader to use for loading resources
+ * @return The PMF
+ */
+ 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 <code>name</code>, or, if not found, returns a {@link PersistenceManagerFactory}
+ * with the given name or, if not found, returns a <code>javax.persistence.EntityManagerFactory
+ * </code> 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:
+ * <br>
+ * <code>"javax.jdo.PersistenceManagerFactoryClass"
+ * <BR>"javax.jdo.option.Optimistic",
+ * <BR>"javax.jdo.option.RetainValues",
+ * <BR>"javax.jdo.option.RestoreValues",
+ * <BR>"javax.jdo.option.IgnoreCache",
+ * <BR>"javax.jdo.option.NontransactionalRead",
+ * <BR>"javax.jdo.option.NontransactionalWrite",
+ * <BR>"javax.jdo.option.Multithreaded",
+ * <BR>"javax.jdo.option.ConnectionUserName",
+ * <BR>"javax.jdo.option.ConnectionPassword",
+ * <BR>"javax.jdo.option.ConnectionURL",
+ * <BR>"javax.jdo.option.ConnectionFactoryName",
+ * <BR>"javax.jdo.option.ConnectionFactory2Name",
+ * <BR>"javax.jdo.option.Mapping",
+ * <BR>"javax.jdo.mapping.Catalog",
+ * <BR>"javax.jdo.mapping.Schema",
+ * <BR>"javax.jdo.option.PersistenceUnitName".
+ * <BR>"javax.jdo.option.DetachAllOnCommit".
+ * <BR>"javax.jdo.option.CopyOnAttach".
+ * <BR>"javax.jdo.option.TransactionType".
+ * <BR>"javax.jdo.option.ServerTimeZoneID".
+ * <BR>"javax.jdo.option.DatastoreReadTimeoutMillis",
+ * <BR>"javax.jdo.option.DatastoreWriteTimeoutMillis",
+ * <BR>"javax.jdo.option.Name".
+ * </code> and properties of the form <br>
+ * <code>javax.jdo.option.InstanceLifecycleListener.{listenerClass}[=[{pcClasses}]]</code> where
+ * <code>{listenerClass}</code> is the fully qualified name of a class that implements {@link
+ * javax.jdo.listener.InstanceLifecycleListener}, and <code>{pcClasses}</code> 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.
+ *
+ * <p>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 <code>JDOFatalUserException</code> thrown by
+ * the method.
+ *
+ * <p>The returned <code>PersistenceManagerFactory</code> is not configurable (the <code>
+ * set<I>XXX</I></code> methods will throw an exception).
+ *
+ * <p>This method loads the properties found at <code>name</code>, if any, via <code>
+ * resourceLoader</code>, and creates a {@link PersistenceManagerFactory} with <code>pmfLoader
+ * </code>. 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 <code>name</code> is non-null or blank
+ * @param pmfLoader the class loader to use to load the {@link PersistenceManagerFactory} or
+ * <code>javax.persistence.EntityManagerFactory</code> 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
}
- /**
- * Returns a named {@link PersistenceManagerFactory} or persistence unit.
- * @since 1.0
- * @see #getPersistenceManagerFactory(Map,String,ClassLoader,ClassLoader)
- * @param name Name of the PMF
- * @param loader ClassLoader to use
- * @return PersistenceManagerFactory
- */
- public static PersistenceManagerFactory getPersistenceManagerFactory
- (String name, ClassLoader loader) {
-
- return getPersistenceManagerFactory(null, name, loader, loader);
+ Map<Object, Object> 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);
}
- /**
- * Returns a named {@link PersistenceManagerFactory} or persistence unit.
- * @since 2.0
- * @see #getPersistenceManagerFactory(Map,String,ClassLoader,ClassLoader)
- * @param name Name of the PMF
- * @param resourceLoader ClassLoader to use for loading resources
- * @param pmfLoader ClassLoader to use for loading the PMF
- * @return PersistenceManagerFactory
- */
- public static PersistenceManagerFactory getPersistenceManagerFactory
- (String name, ClassLoader resourceLoader, ClassLoader pmfLoader) {
-
- return getPersistenceManagerFactory(
- null, name, resourceLoader, pmfLoader);
+ 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);
}
-
- /**
- * Returns a named {@link PersistenceManagerFactory} or persistence unit.
- * @since 2.1
- * @see #getPersistenceManagerFactory(Map,String,ClassLoader,ClassLoader)
- * @param name Name of the PMF
- * @param overrides Property overrides
- * @return PersistenceManagerFactory
- */
- public static PersistenceManagerFactory getPersistenceManagerFactory
- (Map<?, ?> overrides, String name) {
-
- ClassLoader cl = getContextClassLoader();
- return getPersistenceManagerFactory(overrides, name, cl, cl);
+ // props were null; try getting from jdoconfig.xml
+ props = getPropertiesFromJdoconfig(name, resourceLoader);
+ 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);
}
-
- /**
- * Returns a named {@link PersistenceManagerFactory} or persistence unit.
- * @since 2.1
- * @see #getPersistenceManagerFactory(Map,String,ClassLoader,ClassLoader)
- * @param overrides Property overrides
- * @param name Name of the PMF
- * @param resourceLoader ClassLoader to use for loading resources
- * @return The PMF
- */
- public static PersistenceManagerFactory getPersistenceManagerFactory
- (Map<?, ?> overrides, String name, ClassLoader resourceLoader) {
-
- return getPersistenceManagerFactory(
- overrides, name, resourceLoader, resourceLoader);
+ // 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);
}
-
-
- /**
- * Returns a {@link PersistenceManagerFactory} configured based
- * on the properties stored in the resource at
- * <code>name</code>, or, if not found, returns a
- * {@link PersistenceManagerFactory} with the given
- * name or, if not found, returns a
- * <code>javax.persistence.EntityManagerFactory</code> 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:
- * <BR><code>"javax.jdo.PersistenceManagerFactoryClass"
- * <BR>"javax.jdo.option.Optimistic",
- * <BR>"javax.jdo.option.RetainValues",
- * <BR>"javax.jdo.option.RestoreValues",
- * <BR>"javax.jdo.option.IgnoreCache",
- * <BR>"javax.jdo.option.NontransactionalRead",
- * <BR>"javax.jdo.option.NontransactionalWrite",
- * <BR>"javax.jdo.option.Multithreaded",
- * <BR>"javax.jdo.option.ConnectionUserName",
- * <BR>"javax.jdo.option.ConnectionPassword",
- * <BR>"javax.jdo.option.ConnectionURL",
- * <BR>"javax.jdo.option.ConnectionFactoryName",
- * <BR>"javax.jdo.option.ConnectionFactory2Name",
- * <BR>"javax.jdo.option.Mapping",
- * <BR>"javax.jdo.mapping.Catalog",
- * <BR>"javax.jdo.mapping.Schema",
- * <BR>"javax.jdo.option.PersistenceUnitName".
- * <BR>"javax.jdo.option.DetachAllOnCommit".
- * <BR>"javax.jdo.option.CopyOnAttach".
- * <BR>"javax.jdo.option.TransactionType".
- * <BR>"javax.jdo.option.ServerTimeZoneID".
- * <BR>"javax.jdo.option.DatastoreReadTimeoutMillis",
- * <BR>"javax.jdo.option.DatastoreWriteTimeoutMillis",
- * <BR>"javax.jdo.option.Name".
- * </code>
- * and properties of the form
- * <BR><code>javax.jdo.option.InstanceLifecycleListener.{listenerClass}[=[{pcClasses}]]</code>
- * where <code>{listenerClass}</code> is the fully qualified name of a
- * class that implements
- * {@link javax.jdo.listener.InstanceLifecycleListener}, and
- * <code>{pcClasses}</code> 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.
- * <P>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
- * <code>JDOFatalUserException</code> thrown by the method.
- * <P>The returned <code>PersistenceManagerFactory</code> is not
- * configurable (the <code>set<I>XXX</I></code> methods will throw an
- * exception).
- *
- * This method loads the properties found at <code>name</code>, if any, via
- * <code>resourceLoader</code>, and creates a {@link
- * PersistenceManagerFactory} with <code>pmfLoader</code>. 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 <code>name</code> is non-null or blank
- * @param pmfLoader the class loader to use to load the
- * {@link PersistenceManagerFactory} or
- * <code>javax.persistence.EntityManagerFactory</code> 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<Object,Object> 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);
+ // 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
}
-
- 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, resourceLoader);
- 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
- }
+ 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<Object,Object> loadPropertiesFromResource(
- ClassLoader resourceLoader, String name) {
- InputStream in = null;
- Properties props = null;
- // try to load resources from properties file
+ }
+
+ /**
+ * 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<Object, Object> 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 = 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);
- }
+ in.close();
} 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
- * @param name Name of the PMF
- * @param resourceLoader ClassLoader to use for loading resources
- * @return The properties for this PMF
- */
- protected static Map<Object,Object> 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 <code>PersistenceManagerFactory</code> 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<Object,Object> getNamedPMFProperties(
- String name,
- ClassLoader resourceLoader,
- String jdoconfigResourceName) {
- // key is PU name, value is Map of PU properties
- Map<String,Map<Object,Object>> propertiesByNameInAllConfigs
- = new HashMap<String,Map<Object,Object>>();
- try {
- URL firstFoundConfigURL = null;
-
- // get all JDO configurations
- Enumeration<URL> resources =
- getResources(resourceLoader, jdoconfigResourceName);
-
- if (resources.hasMoreElements()) {
- ArrayList<URL> processedResources = new ArrayList<URL>();
-
- // get ready to parse XML
- DocumentBuilderFactory factory = getDocumentBuilderFactory();
- do {
- URL currentConfigURL = resources.nextElement();
- if (processedResources.contains(currentConfigURL)) {
- continue;
- }
- else {
- processedResources.add(currentConfigURL);
- }
-
- Map<String,Map<Object,Object>> 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());
+ return props;
+ }
+
+ /**
+ * @see #getNamedPMFProperties(String,ClassLoader,String)
+ * @since 2.1
+ * @param name Name of the PMF
+ * @param resourceLoader ClassLoader to use for loading resources
+ * @return The properties for this PMF
+ */
+ protected static Map<Object, Object> 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 <code>PersistenceManagerFactory</code> 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<Object, Object> getNamedPMFProperties(
+ String name, ClassLoader resourceLoader, String jdoconfigResourceName) {
+ // key is PU name, value is Map of PU properties
+ Map<String, Map<Object, Object>> propertiesByNameInAllConfigs =
+ new HashMap<String, Map<Object, Object>>();
+ try {
+ URL firstFoundConfigURL = null;
+
+ // get all JDO configurations
+ Enumeration<URL> resources = getResources(resourceLoader, jdoconfigResourceName);
+
+ if (resources.hasMoreElements()) {
+ ArrayList<URL> processedResources = new ArrayList<URL>();
+
+ // get ready to parse XML
+ DocumentBuilderFactory factory = getDocumentBuilderFactory();
+ do {
+ URL currentConfigURL = resources.nextElement();
+ if (processedResources.contains(currentConfigURL)) {
+ continue;
+ } else {
+ processedResources.add(currentConfigURL);
+ }
+
+ Map<String, Map<Object, Object>> 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;
}
- }
- 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<Object,Object>) propertiesByNameInAllConfigs.get(name);
+ 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<Object, Object>) propertiesByNameInAllConfigs.get(name);
+ }
- protected static DocumentBuilderFactory getDocumentBuilderFactory() {
- @SuppressWarnings("static-access")
- DocumentBuilderFactory factory =
- implHelper.getRegisteredDocumentBuilderFactory();
- if (factory == null) {
- factory = getDefaultDocumentBuilderFactory();
- }
- return factory;
+ protected static DocumentBuilderFactory getDocumentBuilderFactory() {
+ @SuppressWarnings("static-access")
+ DocumentBuilderFactory factory = implHelper.getRegisteredDocumentBuilderFactory();
+ if (factory == null) {
+ factory = getDefaultDocumentBuilderFactory();
}
-
- 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;
+ 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 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;
- }
+ 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 fatalError(SAXParseException exception) throws SAXException {
+ throw exception;
+ }
- public void warning(SAXParseException exception)
- throws SAXException {
- // gulp: ignore warnings
- }
- };
- }
+ 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 <code>DocumentBuilderFactory</code> to use for XML parsing.
+ * @return a Map<String,Map> holding persistence unit configurations; for the anonymous
+ * persistence unit, the value of the String key is the empty string, "".
+ */
+ protected static Map<String, Map<Object, Object>> readNamedPMFProperties(
+ URL url, String requestedPMFName, DocumentBuilderFactory factory) {
+ requestedPMFName = requestedPMFName == null ? "" : requestedPMFName.trim();
+
+ Map<String, Map<Object, Object>> propertiesByName = new HashMap<String, Map<Object, Object>>();
+ 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);
- /**
- * 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 <code>DocumentBuilderFactory</code> to use for XML parsing.
- * @return a Map<String,Map> holding persistence unit configurations; for the
- * anonymous persistence unit, the value of the String key is the empty string, "".
- */
- protected static Map<String,Map<Object,Object>> readNamedPMFProperties(
- URL url,
- String requestedPMFName,
- DocumentBuilderFactory factory) {
- requestedPMFName = requestedPMFName == null
- ? ""
- : requestedPMFName.trim();
-
- Map<String,Map<Object,Object>>
- propertiesByName = new HashMap<String,Map<Object,Object>>();
- InputStream in = null;
- try {
- DocumentBuilder builder = factory.newDocumentBuilder();
- builder.setErrorHandler(getErrorHandler());
+ for (int i = 0; i < pmfs.getLength(); i++) {
+ Node pmfElement = pmfs.item(i);
- in = openStream(url);
- Document doc = builder.parse(in);
+ Properties pmfPropertiesFromAttributes = readPropertiesFromPMFElementAttributes(pmfElement);
- Element root = doc.getDocumentElement();
- if (root == null) {
- throw new JDOFatalUserException(
- msg.msg("EXC_InvalidJDOConfigNoRoot", url.toExternalForm())
- );
- }
+ Properties pmfPropertiesFromElements = readPropertiesFromPMFSubelements(pmfElement, url);
- 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 =
... 370315 lines suppressed ...